fileConfig.data.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. const { t } = useI18n() // 国际化
  3. // 表单校验
  4. export const rules = reactive({
  5. name: [required],
  6. storage: [required],
  7. config: {
  8. basePath: [required],
  9. host: [required],
  10. port: [required],
  11. username: [required],
  12. password: [required],
  13. mode: [required],
  14. endpoint: [required],
  15. bucket: [required],
  16. accessKey: [required],
  17. accessSecret: [required],
  18. domain: [required]
  19. }
  20. })
  21. // CrudSchema
  22. const crudSchemas = reactive<VxeCrudSchema>({
  23. primaryKey: 'id',
  24. primaryType: 'seq',
  25. primaryTitle: '配置编号',
  26. action: true,
  27. actionWidth: '400px',
  28. columns: [
  29. {
  30. title: '配置名',
  31. field: 'name',
  32. isSearch: true
  33. },
  34. {
  35. title: '存储器',
  36. field: 'storage',
  37. dictType: DICT_TYPE.INFRA_FILE_STORAGE,
  38. dictClass: 'number',
  39. isSearch: true
  40. },
  41. {
  42. title: '主配置',
  43. field: 'master',
  44. dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
  45. dictClass: 'boolean'
  46. },
  47. {
  48. title: t('form.remark'),
  49. field: 'remark',
  50. form: {
  51. component: 'Input',
  52. componentProps: {
  53. type: 'textarea',
  54. rows: 4
  55. },
  56. colProps: {
  57. span: 24
  58. }
  59. }
  60. },
  61. {
  62. title: t('common.createTime'),
  63. field: 'createTime',
  64. formatter: 'formatDate',
  65. isForm: false,
  66. search: {
  67. show: true,
  68. itemRender: {
  69. name: 'XDataTimePicker'
  70. }
  71. }
  72. }
  73. ]
  74. })
  75. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)