errorCode.data.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. const { t } = useI18n() // 国际化
  3. // 表单校验
  4. export const rules = reactive({
  5. applicationName: [required],
  6. code: [required],
  7. message: [required]
  8. })
  9. // 新增 + 修改
  10. const crudSchemas = reactive<VxeCrudSchema>({
  11. primaryKey: 'id',
  12. primaryType: 'seq',
  13. primaryTitle: '编号',
  14. action: true,
  15. columns: [
  16. {
  17. title: '错误码类型',
  18. field: 'type',
  19. dictType: DICT_TYPE.SYSTEM_ERROR_CODE_TYPE,
  20. dictClass: 'number',
  21. isSearch: true
  22. },
  23. {
  24. title: '应用名',
  25. field: 'applicationName',
  26. isSearch: true
  27. },
  28. {
  29. title: '错误码编码',
  30. field: 'code',
  31. isSearch: true
  32. },
  33. {
  34. title: '错误码错误提示',
  35. field: 'message',
  36. isSearch: true
  37. },
  38. {
  39. title: t('common.createTime'),
  40. field: 'createTime',
  41. formatter: 'formatDate',
  42. isForm: false,
  43. search: {
  44. show: true,
  45. itemRender: {
  46. name: 'XDataTimePicker'
  47. }
  48. }
  49. }
  50. ]
  51. })
  52. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)