tenantPackage.data.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. const { t } = useI18n() // 国际化
  3. // 表单校验
  4. export const rules = reactive({
  5. name: [required],
  6. id: [required],
  7. type: [required],
  8. remark: [required],
  9. status: [required],
  10. menuIds: [required]
  11. })
  12. // CrudSchema
  13. const crudSchemas = reactive<VxeCrudSchema>({
  14. primaryKey: 'id',
  15. primaryType: 'id',
  16. primaryTitle: '套餐编号',
  17. action: true,
  18. columns: [
  19. {
  20. title: '套餐名称',
  21. field: 'name',
  22. isSearch: true
  23. },
  24. {
  25. title: t('common.status'),
  26. field: 'status',
  27. dictType: DICT_TYPE.COMMON_STATUS,
  28. dictClass: 'number',
  29. isSearch: true
  30. },
  31. {
  32. title: '菜单权限',
  33. field: 'menuIds',
  34. isTable: false,
  35. form: {
  36. colProps: {
  37. span: 24
  38. }
  39. }
  40. },
  41. {
  42. title: t('form.remark'),
  43. field: 'remark',
  44. isTable: false,
  45. isSearch: true,
  46. form: {
  47. component: 'Input',
  48. componentProps: {
  49. type: 'textarea',
  50. rows: 4
  51. },
  52. colProps: {
  53. span: 24
  54. }
  55. }
  56. },
  57. {
  58. title: '创建时间',
  59. field: 'createTime',
  60. formatter: 'formatDate',
  61. isForm: false,
  62. search: {
  63. show: true,
  64. itemRender: {
  65. name: 'XDataTimePicker'
  66. }
  67. }
  68. }
  69. ]
  70. })
  71. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)