log.data.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
  2. import { dateFormatter } from '@/utils/formatTime'
  3. import * as MailAccountApi from '@/api/system/mail/account'
  4. // 邮箱账号的列表
  5. const accountList = await MailAccountApi.getSimpleMailAccountList()
  6. // CrudSchema:https://kailong110120130.gitee.io/vue-element-plus-admin-doc/hooks/useCrudSchemas.html
  7. const crudSchemas = reactive<CrudSchema[]>([
  8. {
  9. label: '编号',
  10. field: 'id'
  11. },
  12. {
  13. label: '发送时间',
  14. field: 'sendTime',
  15. formatter: dateFormatter,
  16. search: {
  17. show: true,
  18. component: 'DatePicker',
  19. componentProps: {
  20. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  21. type: 'daterange',
  22. defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
  23. }
  24. },
  25. detail: {
  26. dateFormat: 'YYYY-MM-DD HH:mm:ss'
  27. }
  28. },
  29. {
  30. label: '接收邮箱',
  31. field: 'toMail'
  32. },
  33. {
  34. label: '用户编号',
  35. field: 'userId',
  36. isSearch: true,
  37. isTable: false
  38. },
  39. {
  40. label: '用户类型',
  41. field: 'userType',
  42. dictType: DICT_TYPE.USER_TYPE,
  43. dictClass: 'number',
  44. isSearch: true,
  45. isTable: false
  46. },
  47. {
  48. label: '邮件标题',
  49. field: 'templateTitle'
  50. },
  51. {
  52. label: '邮件内容',
  53. field: 'templateContent',
  54. isTable: false
  55. },
  56. {
  57. label: '邮箱参数',
  58. field: 'templateParams',
  59. isTable: false
  60. },
  61. {
  62. label: '发送状态',
  63. field: 'sendStatus',
  64. dictType: DICT_TYPE.SYSTEM_MAIL_SEND_STATUS,
  65. dictClass: 'string',
  66. isSearch: true
  67. },
  68. {
  69. label: '邮箱账号',
  70. field: 'accountId',
  71. isTable: false,
  72. search: {
  73. show: true,
  74. component: 'Select',
  75. api: () => accountList,
  76. componentProps: {
  77. optionsAlias: {
  78. labelField: 'mail',
  79. valueField: 'id'
  80. }
  81. }
  82. }
  83. },
  84. {
  85. label: '发送邮箱地址',
  86. field: 'fromMail',
  87. table: {
  88. label: '邮箱账号'
  89. }
  90. },
  91. {
  92. label: '模板编号',
  93. field: 'templateId',
  94. isSearch: true
  95. },
  96. {
  97. label: '模板编码',
  98. field: 'templateCode',
  99. isTable: false
  100. },
  101. {
  102. label: '模版发送人名称',
  103. field: 'templateNickname',
  104. isTable: false
  105. },
  106. {
  107. label: '发送返回的消息编号',
  108. field: 'sendMessageId',
  109. isTable: false
  110. },
  111. {
  112. label: '发送异常',
  113. field: 'sendException',
  114. isTable: false
  115. },
  116. {
  117. label: '创建时间',
  118. field: 'createTime',
  119. isTable: false,
  120. formatter: dateFormatter,
  121. detail: {
  122. dateFormat: 'YYYY-MM-DD HH:mm:ss'
  123. }
  124. },
  125. {
  126. label: '操作',
  127. field: 'action',
  128. isDetail: false
  129. }
  130. ])
  131. export const { allSchemas } = useCrudSchemas(crudSchemas)