sensitiveWord.data.ts 1.4 KB

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