headerConfig.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { PlusOutlined } from "@ant-design/icons"
  2. import React from "react"
  3. import { FormConfig } from '@/components/Formitem/type'
  4. let config = (fnc: () => void, seek: (bookName: string) => void, seekType: (typeId: string) => void, seekPlatform: (platformId: string) => void, platform: any[], access: any, bookify: any[], handleTypeId: (id: number) => void): FormConfig[] => {
  5. let arr: any = [
  6. {
  7. label: '书名',
  8. tag: 'inputSearch',
  9. name: 'bookName',
  10. children: [{ value: '1', text: '全部分组' }],
  11. change: true,
  12. width: 200,
  13. callback: seek
  14. },
  15. {
  16. label: '状态',
  17. tag: 'inputSearch',
  18. name: 'status',
  19. change: true,
  20. width: 200,
  21. callback: seekType
  22. },
  23. {
  24. label: '平台',
  25. tag: 'select',
  26. name: 'platformId',
  27. children: platform,
  28. change: true,
  29. width: 200,
  30. callback: seekPlatform
  31. },
  32. {
  33. label: '分类',
  34. tag: 'select',
  35. name: 'typeId',
  36. children: bookify,
  37. change: true,
  38. width: 200,
  39. callback: handleTypeId
  40. },
  41. ]
  42. return access['新增小说'] ? [...arr, {
  43. label: '添加书籍',
  44. icon: <PlusOutlined />,
  45. tag: 'button',
  46. htmlType: 'button',
  47. btnType: 'primary',
  48. name: 'zx',
  49. callback: fnc,
  50. }] : arr
  51. }
  52. export default config