|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+// @ts-ignore: 忽略
|
|
|
2
|
+import type { FormSchemaGetter } from '#/adapter/form';
|
|
|
3
|
+// @ts-ignore: 忽略
|
|
|
4
|
+import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
|
5
|
+
|
|
|
6
|
+import { DictEnum } from '@vben/constants';
|
|
|
7
|
+
|
|
|
8
|
+// @ts-ignore: 忽略
|
|
|
9
|
+import { getMultipleImageUploadConfig } from '#/components/upload';
|
|
|
10
|
+import { getDictOptions } from '#/utils/dict';
|
|
|
11
|
+
|
|
|
12
|
+export const reportFormSchema: any | FormSchemaGetter = () => [
|
|
|
13
|
+ {
|
|
|
14
|
+ component: 'Select',
|
|
|
15
|
+ fieldName: 'drillEvaluation',
|
|
|
16
|
+ label: '演练评估',
|
|
|
17
|
+ componentProps: {
|
|
|
18
|
+ placeholder: '请输入演练评估',
|
|
|
19
|
+ options: getDictOptions(DictEnum.EXERCISE_EVALUATION),
|
|
|
20
|
+ },
|
|
|
21
|
+ rules: 'required',
|
|
|
22
|
+ },
|
|
|
23
|
+ {
|
|
|
24
|
+ component: 'Input',
|
|
|
25
|
+ fieldName: 'mainContent',
|
|
|
26
|
+ label: '简述演练的主要内容',
|
|
|
27
|
+ componentProps: {
|
|
|
28
|
+ placeholder: '请输入演练的主要内容',
|
|
|
29
|
+ type: 'textarea',
|
|
|
30
|
+ rows: 3,
|
|
|
31
|
+ },
|
|
|
32
|
+ rules: 'required',
|
|
|
33
|
+ },
|
|
|
34
|
+ {
|
|
|
35
|
+ component: 'Input',
|
|
|
36
|
+ fieldName: 'existingProblems',
|
|
|
37
|
+ label: '演练过程存在的问题',
|
|
|
38
|
+ componentProps: {
|
|
|
39
|
+ placeholder: '请输入演练过程存在的问题',
|
|
|
40
|
+ type: 'textarea',
|
|
|
41
|
+ rows: 3,
|
|
|
42
|
+ },
|
|
|
43
|
+ rules: 'required',
|
|
|
44
|
+ },
|
|
|
45
|
+ {
|
|
|
46
|
+ component: 'Input',
|
|
|
47
|
+ fieldName: 'improvementMeasures',
|
|
|
48
|
+ label: '针对问题的改进措施',
|
|
|
49
|
+ componentProps: {
|
|
|
50
|
+ placeholder: '请输入针对问题的改进措施',
|
|
|
51
|
+ type: 'textarea',
|
|
|
52
|
+ rows: 3,
|
|
|
53
|
+ },
|
|
|
54
|
+ rules: 'required',
|
|
|
55
|
+ },
|
|
|
56
|
+
|
|
|
57
|
+ {
|
|
|
58
|
+ component: 'Input',
|
|
|
59
|
+ fieldName: 'managerComment',
|
|
|
60
|
+ label: '经理点评',
|
|
|
61
|
+ componentProps: {
|
|
|
62
|
+ placeholder: '请输入经理点评',
|
|
|
63
|
+ type: 'textarea',
|
|
|
64
|
+ rows: 3,
|
|
|
65
|
+ },
|
|
|
66
|
+ rules: 'required',
|
|
|
67
|
+ },
|
|
|
68
|
+ {
|
|
|
69
|
+ component: 'Input',
|
|
|
70
|
+ fieldName: 'images',
|
|
|
71
|
+ label: '图片',
|
|
|
72
|
+ componentProps: {
|
|
|
73
|
+ maxlength: 30,
|
|
|
74
|
+ },
|
|
|
75
|
+ dependencies: {
|
|
|
76
|
+ show: () => false,
|
|
|
77
|
+ triggerFields: [''],
|
|
|
78
|
+ },
|
|
|
79
|
+ },
|
|
|
80
|
+ {
|
|
|
81
|
+ component: 'Upload',
|
|
|
82
|
+ fieldName: 'imagesPaths',
|
|
|
83
|
+ label: '图片',
|
|
|
84
|
+ componentProps: (row: any) => {
|
|
|
85
|
+ return {
|
|
|
86
|
+ ...getMultipleImageUploadConfig(5),
|
|
|
87
|
+ multiple: true,
|
|
|
88
|
+ onSuccess: (res: any, uploadFile: any, uploadFiles: any) => {
|
|
|
89
|
+ if (res.code === 200) {
|
|
|
90
|
+ const paths: string[] = [];
|
|
|
91
|
+ uploadFiles.forEach((item: any) => {
|
|
|
92
|
+ if (item.response?.code === 200) {
|
|
|
93
|
+ paths.push(item.response.data.fileName);
|
|
|
94
|
+ }
|
|
|
95
|
+ });
|
|
|
96
|
+ row.images = paths.join(',');
|
|
|
97
|
+
|
|
|
98
|
+ return res.data;
|
|
|
99
|
+ }
|
|
|
100
|
+ },
|
|
|
101
|
+ };
|
|
|
102
|
+ },
|
|
|
103
|
+ renderComponentContent: () => {
|
|
|
104
|
+ return {
|
|
|
105
|
+ default: () => '点击上传',
|
|
|
106
|
+ };
|
|
|
107
|
+ },
|
|
|
108
|
+ rules: 'required',
|
|
|
109
|
+ },
|
|
|
110
|
+];
|
|
|
111
|
+
|
|
|
112
|
+export const drawerFormSchema: any | FormSchemaGetter = () => [
|
|
|
113
|
+ // {
|
|
|
114
|
+ // component: 'SectionTitle',
|
|
|
115
|
+ // fieldName: '_section_title',
|
|
|
116
|
+ // hideLabel: true,
|
|
|
117
|
+ // componentProps: {
|
|
|
118
|
+ // title: '基本信息',
|
|
|
119
|
+ // },
|
|
|
120
|
+ // },
|
|
|
121
|
+ {
|
|
|
122
|
+ component: 'Input',
|
|
|
123
|
+ fieldName: 'drillName',
|
|
|
124
|
+ label: '应急演练名称',
|
|
|
125
|
+ componentProps: {
|
|
|
126
|
+ placeholder: '请输入应急演练名称',
|
|
|
127
|
+ },
|
|
|
128
|
+ rules: 'required',
|
|
|
129
|
+ },
|
|
|
130
|
+ {
|
|
|
131
|
+ component: 'DatePicker',
|
|
|
132
|
+ fieldName: 'drillTime',
|
|
|
133
|
+ label: '演练时间',
|
|
|
134
|
+ componentProps: {
|
|
|
135
|
+ type: 'datetime',
|
|
|
136
|
+ placeholder: '请选择演练时间',
|
|
|
137
|
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
138
|
+ },
|
|
|
139
|
+ rules: 'required',
|
|
|
140
|
+ },
|
|
|
141
|
+ {
|
|
|
142
|
+ component: 'Input',
|
|
|
143
|
+ fieldName: 'organizationDepartment',
|
|
|
144
|
+ label: '组织部门',
|
|
|
145
|
+ componentProps: {
|
|
|
146
|
+ placeholder: '请输入组织部门',
|
|
|
147
|
+ },
|
|
|
148
|
+ rules: 'required',
|
|
|
149
|
+ },
|
|
|
150
|
+ {
|
|
|
151
|
+ component: 'InputNumber',
|
|
|
152
|
+ fieldName: 'participantsCount',
|
|
|
153
|
+ label: '参加人数',
|
|
|
154
|
+ componentProps: {
|
|
|
155
|
+ placeholder: '请输入参加人数',
|
|
|
156
|
+ min: 0,
|
|
|
157
|
+ step: 1,
|
|
|
158
|
+ },
|
|
|
159
|
+ rules: 'required',
|
|
|
160
|
+ },
|
|
|
161
|
+ {
|
|
|
162
|
+ component: 'InputNumber',
|
|
|
163
|
+ fieldName: 'totalCount',
|
|
|
164
|
+ label: '总人数',
|
|
|
165
|
+ componentProps: {
|
|
|
166
|
+ placeholder: '请输入总人数',
|
|
|
167
|
+ min: 0,
|
|
|
168
|
+ step: 1,
|
|
|
169
|
+ },
|
|
|
170
|
+ rules: 'required',
|
|
|
171
|
+ },
|
|
|
172
|
+ {
|
|
|
173
|
+ component: 'Input',
|
|
|
174
|
+ fieldName: 'drillLocation',
|
|
|
175
|
+ label: '演练地点/装置',
|
|
|
176
|
+ componentProps: {
|
|
|
177
|
+ placeholder: '请输入演练地点/装置',
|
|
|
178
|
+ },
|
|
|
179
|
+ rules: 'required',
|
|
|
180
|
+ },
|
|
|
181
|
+ {
|
|
|
182
|
+ component: 'Input',
|
|
|
183
|
+ fieldName: 'drillPurpose',
|
|
|
184
|
+ label: '演练目的',
|
|
|
185
|
+ componentProps: {
|
|
|
186
|
+ placeholder: '请输入演练目的',
|
|
|
187
|
+ type: 'textarea',
|
|
|
188
|
+ rows: 3,
|
|
|
189
|
+ },
|
|
|
190
|
+ rules: 'required',
|
|
|
191
|
+ },
|
|
|
192
|
+ {
|
|
|
193
|
+ component: 'Input',
|
|
|
194
|
+ fieldName: 'accidentAssumption',
|
|
|
195
|
+ label: '事件/事故现场假定',
|
|
|
196
|
+ componentProps: {
|
|
|
197
|
+ placeholder: '请输入事件/事故现场假定',
|
|
|
198
|
+ type: 'textarea',
|
|
|
199
|
+ rows: 3,
|
|
|
200
|
+ },
|
|
|
201
|
+ rules: 'required',
|
|
|
202
|
+ },
|
|
|
203
|
+ {
|
|
|
204
|
+ component: 'Input',
|
|
|
205
|
+ fieldName: 'drillPlanSummary',
|
|
|
206
|
+ label: '演练方案简述',
|
|
|
207
|
+ componentProps: {
|
|
|
208
|
+ placeholder: '请输入演练方案简述',
|
|
|
209
|
+ type: 'textarea',
|
|
|
210
|
+ rows: 3,
|
|
|
211
|
+ },
|
|
|
212
|
+ rules: 'required',
|
|
|
213
|
+ },
|
|
|
214
|
+ {
|
|
|
215
|
+ component: 'Input',
|
|
|
216
|
+ fieldName: 'materialPreparation',
|
|
|
217
|
+ label: '物资准备',
|
|
|
218
|
+ componentProps: {
|
|
|
219
|
+ placeholder: '请输入物资准备',
|
|
|
220
|
+ type: 'textarea',
|
|
|
221
|
+ rows: 3,
|
|
|
222
|
+ },
|
|
|
223
|
+ rules: 'required',
|
|
|
224
|
+ },
|
|
|
225
|
+ {
|
|
|
226
|
+ component: 'Input',
|
|
|
227
|
+ fieldName: 'precautions',
|
|
|
228
|
+ label: '演练注意事项及要求',
|
|
|
229
|
+ componentProps: {
|
|
|
230
|
+ placeholder: '请输入演练注意事项及要求',
|
|
|
231
|
+ type: 'textarea',
|
|
|
232
|
+ rows: 3,
|
|
|
233
|
+ },
|
|
|
234
|
+ rules: 'required',
|
|
|
235
|
+ },
|
|
|
236
|
+];
|
|
|
237
|
+
|
|
|
238
|
+export const defautTableColumns: VxeGridProps['columns'] = [
|
|
|
239
|
+ {
|
|
|
240
|
+ field: 'employeeName',
|
|
|
241
|
+ title: '员工姓名',
|
|
|
242
|
+ width: 100,
|
|
|
243
|
+ fixed: 'left',
|
|
|
244
|
+ },
|
|
|
245
|
+];
|