message.data.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. // CrudSchema
  3. const crudSchemas = reactive<VxeCrudSchema>({
  4. primaryKey: 'id', // 默认的主键ID
  5. primaryTitle: '编号', // 默认显示的值
  6. primaryType: 'seq', // 默认为seq,序号模式
  7. action: true,
  8. actionWidth: '200', // 3个按钮默认200,如有删减对应增减即可
  9. columns: [
  10. {
  11. title: '用户编号',
  12. field: 'userId',
  13. isSearch: true
  14. },
  15. {
  16. title: '用户类型',
  17. field: 'userType',
  18. dictType: DICT_TYPE.USER_TYPE,
  19. dictClass: 'string',
  20. isSearch: true,
  21. table: {
  22. width: 80
  23. }
  24. },
  25. {
  26. title: '模版编号',
  27. field: 'templateId'
  28. },
  29. {
  30. title: '模板编码',
  31. field: 'templateCode',
  32. isSearch: true,
  33. table: {
  34. width: 80
  35. }
  36. },
  37. {
  38. title: '发送人名称',
  39. field: 'templateNickname',
  40. table: {
  41. width: 120
  42. }
  43. },
  44. {
  45. title: '模版内容',
  46. field: 'templateContent',
  47. table: {
  48. width: 200
  49. }
  50. },
  51. {
  52. title: '模版类型',
  53. field: 'templateType',
  54. dictType: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE,
  55. dictClass: 'number',
  56. isSearch: true,
  57. table: {
  58. width: 80
  59. }
  60. },
  61. {
  62. title: '模版参数',
  63. field: 'templateParams',
  64. isTable: false
  65. },
  66. {
  67. title: '是否已读',
  68. field: 'readStatus',
  69. dictType: DICT_TYPE.INFRA_BOOLEAN_STRING,
  70. dictClass: 'boolean',
  71. table: {
  72. width: 80
  73. }
  74. },
  75. {
  76. title: '阅读时间',
  77. field: 'readTime',
  78. formatter: 'formatDate',
  79. table: {
  80. width: 180
  81. }
  82. },
  83. {
  84. title: '创建时间',
  85. field: 'createTime',
  86. isForm: false,
  87. formatter: 'formatDate',
  88. search: {
  89. show: true,
  90. itemRender: {
  91. name: 'XDataTimePicker'
  92. }
  93. },
  94. table: {
  95. width: 180
  96. }
  97. }
  98. ]
  99. })
  100. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)