sms.template.data.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. const { t } = useI18n() // 国际化
  3. // 表单校验
  4. export const rules = reactive({
  5. type: [required],
  6. status: [required],
  7. code: [required],
  8. name: [required],
  9. content: [required],
  10. apiTemplateId: [required],
  11. channelId: [required]
  12. })
  13. // CrudSchema
  14. const crudSchemas = reactive<VxeCrudSchema>({
  15. primaryKey: 'id',
  16. primaryType: 'id',
  17. primaryTitle: '模板编号',
  18. action: true,
  19. actionWidth: '280',
  20. columns: [
  21. {
  22. title: '模板编码',
  23. field: 'code',
  24. isSearch: true
  25. },
  26. {
  27. title: '模板名称',
  28. field: 'name',
  29. isSearch: true
  30. },
  31. {
  32. title: '模板内容',
  33. field: 'content'
  34. },
  35. {
  36. title: '短信 API 的模板编号',
  37. field: 'apiTemplateId',
  38. isSearch: true
  39. },
  40. {
  41. title: '短信类型',
  42. field: 'type',
  43. dictType: DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE,
  44. dictClass: 'number',
  45. isSearch: true,
  46. table: {
  47. width: 80
  48. }
  49. },
  50. {
  51. title: t('common.status'),
  52. field: 'status',
  53. dictType: DICT_TYPE.COMMON_STATUS,
  54. dictClass: 'number',
  55. isSearch: true,
  56. table: {
  57. width: 80
  58. }
  59. },
  60. {
  61. title: t('form.remark'),
  62. field: 'remark',
  63. isTable: false
  64. },
  65. {
  66. title: t('common.createTime'),
  67. field: 'createTime',
  68. formatter: 'formatDate',
  69. isForm: false,
  70. search: {
  71. show: true,
  72. itemRender: {
  73. name: 'XDataTimePicker'
  74. }
  75. }
  76. }
  77. ]
  78. })
  79. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)