sms.channel.data.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
  2. const { t } = useI18n() // 国际化
  3. // 表单校验
  4. export const rules = reactive({
  5. signature: [required],
  6. code: [required],
  7. apiKey: [required],
  8. status: [required]
  9. })
  10. // CrudSchema
  11. const crudSchemas = reactive<VxeCrudSchema>({
  12. primaryKey: 'id',
  13. primaryType: 'id',
  14. primaryTitle: '渠道编号',
  15. action: true,
  16. columns: [
  17. {
  18. title: '短信签名',
  19. field: 'signature',
  20. isSearch: true
  21. },
  22. {
  23. title: '渠道编码',
  24. field: 'code',
  25. dictType: DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE,
  26. isSearch: true
  27. },
  28. {
  29. title: t('common.status'),
  30. field: 'status',
  31. dictType: DICT_TYPE.COMMON_STATUS,
  32. dictClass: 'number',
  33. isSearch: true
  34. },
  35. {
  36. title: '短信 API 的账号',
  37. field: 'apiKey'
  38. },
  39. {
  40. title: '短信 API 的密钥',
  41. field: 'apiSecret'
  42. },
  43. {
  44. title: '短信发送回调 URL',
  45. field: 'callbackUrl'
  46. },
  47. {
  48. title: t('common.createTime'),
  49. field: 'createTime',
  50. formatter: 'formatDate',
  51. isForm: false,
  52. search: {
  53. show: true,
  54. itemRender: {
  55. name: 'XDataTimePicker'
  56. }
  57. }
  58. }
  59. ]
  60. })
  61. export const { allSchemas } = useVxeCrudSchemas(crudSchemas)