1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
| import type { FormSchemaGetter } from '#/adapter/form';
| import type { VxeGridProps } from '#/adapter/vxe-table';
|
| import { DictEnum } from '@vben/constants';
| import { getPopupContainer } from '@vben/utils';
| import { useAppConfig } from '@vben/hooks';
| import { useAccessStore } from '@vben/stores';
| import type { UploadFile } from 'ant-design-vue';
|
| import { z } from '#/adapter/form';
| import { getDictOptions } from '#/utils/dict';
| import { Item } from 'ant-design-vue/es/menu';
| // import { OptionsItem } from ""
|
| export const querySchema: FormSchemaGetter = () => [
| {
| component: 'Input',
| fieldName: 'workName',
| label: '工作名称',
| },
| {
| component: 'Select',
| componentProps: {
| getPopupContainer,
| options: getDictOptions(DictEnum.TASK_STATUS),
| },
| fieldName: 'workClass',
| label: '工作类别',
| },
| {
| component: 'Select',
| componentProps: {
| getPopupContainer,
| options: getDictOptions(DictEnum.TASK_STATUS),
| },
| fieldName: 'taskStatus',
| label: '任务状态',
| },
| {
| component: 'Input',
| fieldName: 'Annual',
| label: '年度',
| },
| ];
|
| export const columns: VxeGridProps['columns'] = [
| { type: 'checkbox', width: 60 },
| {
| field: 'workName',
| title: '名称',
| },
| {
| field: 'id',
| title: '编号',
| },
| {
| field: 'workClass',
| title: '类别',
| },
| {
| field: 'assessmentTime',
| title: '考核时间',
| },
| {
| field: 'taskStatus',
| title: '任务状态',
| },
| {
| field: 'Annual',
| title: '年度',
| },
| {
| field: 'workProgress',
| title: '工作进度',
| },
| {
| field: 'action',
| fixed: 'right',
| slots: { default: 'action' },
| title: '操作',
| width: 180,
| },
| ];
| // 工作详情
| export const drawerSchema: FormSchemaGetter = () => [
| {
| component: 'Input',
| fieldName: 'workName',
| label: '工作名称',
| rules: 'required'
| },
| {
| component: 'Input',
| fieldName: 'workClass',
| label: '工作类别',
| rules: 'required',
| },
| {
| component: 'Input',
| fieldName: 'workContent',
| label: '工作内容'
| },
| {
| component: 'Input',
| fieldName: 'projectBudget',
| label: '项目预算%',
| defaultValue: undefined
| },
| {
| component: 'Input',
| fieldName: 'amountProject',
| defaultValue: undefined,
| label: '项目金额'
| },
| {
| component: 'Select',
| componentProps: {
| getPopupContainer,
| options: []
| },
| fieldName: 'responsibleDepartment',
| label: '负责部门',
| rules: 'required',
| },
| {
| component: 'Select',
| componentProps: {
| getPopupContainer,
| options: getDictOptions(DictEnum.SYS_NORMAL_DISABLE)
| },
| fieldName: 'Head',
| label: '负责人',
| },
| {
| component: 'DatePicker',
| componentProps: {
| format: 'YYYY',
| showTime: true,
| valueFormat: 'YYYY',
| picker: "year",
| getPopupContainer,
| },
| fieldName: 'Annual',
| label: '年度',
| rules: 'required',
| },
| {
| component: 'DatePicker',
| componentProps: {
| format: 'YYYY-MM-DD',
| showTime: true,
| valueFormat: 'YYYY-MM-DD',
| getPopupContainer,
| },
| fieldName: 'assessmentTime',
| label: '考核时间',
| rules: 'required',
| },
| {
| component: 'Select',
| fieldName: 'assessmentIndicators',
| formItemClass: 'items-baseline',
| label: '考核指标',
| },
| {
| fieldName: 'File',
| component: 'NewFileUpload',
| componentProps: {
| action: uploadUrl,
| headers: headers,
| maxSize: 20,
| onDelete:(file: UploadFile)=>{
| console.log("存在文件被删除",file)
| }
| },
| formItemClass: 'items-baseline',
| label: '文件上传',
| }
| ];
|
| // 工作下发
| export const AssigningWorkSchema: FormSchemaGetter = () => [
| {
| component: 'Select',
| fieldName: 'assessmentIndicators',
| formItemClass: 'items-baseline',
| label: '负责人',
| },
| ]
|
| // 工作汇报
| export const ReportScheme: FormSchemaGetter = () => [
| {
| component: 'Input',
| fieldName: 'workName',
| label: '工作名称',
| rules: 'required'
| },
| {
| component: 'Input',
| fieldName: 'workClass',
| label: '工作类别',
| rules: 'required',
| },
| {
| component: 'Textarea',
| fieldName: 'workContent',
| label: '工作内容'
| },
| {
| component: 'DatePicker',
| componentProps: {
| format: 'YYYY-MM-DD',
| showTime: true,
| valueFormat: 'YYYY-MM-DD',
| getPopupContainer,
| },
| fieldName: 'DebriefingTime',
| label: '汇报时间',
| rules: 'required',
| },
| {
| component: 'Input',
| fieldName: 'workProgress',
| label: '完成进度'
| },
| {
| fieldName: 'File',
| component: 'NewFileUpload',
| componentProps: {
| action: uploadUrl,
| headers: headers,
| maxSize: 20,
| onDelete:(file: UploadFile)=>{
| console.log("存在文件被删除",file)
| }
| },
| formItemClass: 'items-baseline',
| label: '文件上传',
| },
| {
| component: 'Input',
| fieldName: 'workProgress',
| label: '资金使用(万元)'
| },
| {
| component: 'Textarea',
| fieldName: 'remark',
| label: '备注'
| },
| ]
|
| const { apiURL, clientId } = useAppConfig(
| import.meta.env,
| import.meta.env.PROD,
| );
| const uploadUrl = `${apiURL}/knowledge/attach/upload`;
| const accessStore = useAccessStore();
| const headers = {
| Authorization: `Bearer ${accessStore.accessToken}`,
| clientId,
| };
|
|