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