|
|
@@ -1,240 +1,224 @@
|
|
1
|
1
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
|
2
|
2
|
import type { FormSchemaGetter } from '#/adapter/form';
|
|
3
|
3
|
|
|
4
|
|
-// 油轮检查类型定义
|
|
5
|
|
-export interface TankerInspectData {
|
|
6
|
|
- id: number;
|
|
7
|
|
- taskName: string; // 任务名称
|
|
8
|
|
- area: string; // 片区
|
|
9
|
|
- station: string; // 油站
|
|
10
|
|
- participateTime: string; // 参与时间
|
|
11
|
|
- executor: string; // 执行人
|
|
12
|
|
- comment: string; // 评论
|
|
13
|
|
- deadline: string; // 截止时间
|
|
14
|
|
- processingTime: string; // 处理时间
|
|
15
|
|
- completionStatus: string; // 完成状态
|
|
16
|
|
- creation: string; // 创建
|
|
17
|
|
-}
|
|
|
4
|
+import {
|
|
|
5
|
+ selectAllSysAreaList,
|
|
|
6
|
+ selectAllSysStation,
|
|
|
7
|
+} from '#/api/system/infoEntry/stationInfo/stationInfo';
|
|
18
|
8
|
|
|
19
|
|
-// 油轮检查表格配置
|
|
20
|
|
-export const tableColumns: VxeGridProps['columns'] = [
|
|
21
|
|
- { title: '任务名称', field: 'taskName', minWidth: 180, align: 'center' },
|
|
22
|
|
- { title: '片区', field: 'area', minWidth: 120, align: 'center' },
|
|
23
|
|
- { title: '油站', field: 'station', minWidth: 150, align: 'center' },
|
|
24
|
|
- { title: '参与时间', field: 'participateTime', minWidth: 200, align: 'center' },
|
|
25
|
|
- { title: '执行人', field: 'executor', minWidth: 120, align: 'center' },
|
|
26
|
|
- { title: '评论', field: 'comment', minWidth: 120, align: 'center' },
|
|
27
|
|
- { title: '截止时间', field: 'deadline', minWidth: 200, align: 'center' },
|
|
28
|
|
- { title: '处理时间', field: 'processingTime', minWidth: 200, align: 'center' },
|
|
29
|
|
- { title: '完成状态', field: 'completionStatus', minWidth: 120, align: 'center' },
|
|
30
|
|
- { title: '创建', field: 'creation', minWidth: 200, align: 'center' },
|
|
31
|
|
- { title: '操作', minWidth: 100, align: 'center', slots: { default: 'action' } },
|
|
32
|
|
-];
|
|
|
9
|
+// 获取过滤后的岗位列表
|
|
|
10
|
+import { getFilteredPositions } from '../../utils/positionFilter';
|
|
33
|
11
|
|
|
34
|
|
-// 油轮检查模拟数据
|
|
35
|
|
-export const TANKER_INSPECT_MOCK_DATA: TankerInspectData[] = [
|
|
36
|
|
- {
|
|
37
|
|
- id: 1,
|
|
38
|
|
- taskName: '油轮安全检查',
|
|
39
|
|
- area: '华北片区',
|
|
40
|
|
- station: '北京东加油站',
|
|
41
|
|
- participateTime: '2025-01-15 09:00:00',
|
|
42
|
|
- executor: '张三',
|
|
43
|
|
- comment: '正常',
|
|
44
|
|
- deadline: '2025-01-20 18:00:00',
|
|
45
|
|
- processingTime: '2025-01-15 10:30:00',
|
|
46
|
|
- completionStatus: '已完成',
|
|
47
|
|
- creation: '2025-01-10 14:20:00'
|
|
|
12
|
+// 油轮检查表格配置
|
|
|
13
|
+export const columns: VxeGridProps['columns'] = [
|
|
|
14
|
+ {
|
|
|
15
|
+ type: 'checkbox',
|
|
|
16
|
+ width: 80,
|
|
48
|
17
|
},
|
|
49
|
18
|
{
|
|
50
|
|
- id: 2,
|
|
51
|
|
- taskName: '油轮设备检修',
|
|
52
|
|
- area: '华北片区',
|
|
53
|
|
- station: '北京西加油站',
|
|
54
|
|
- participateTime: '2025-01-16 10:00:00',
|
|
55
|
|
- executor: '李四',
|
|
56
|
|
- comment: '需要更换零件',
|
|
57
|
|
- deadline: '2025-01-22 18:00:00',
|
|
58
|
|
- processingTime: '2025-01-16 11:45:00',
|
|
59
|
|
- completionStatus: '处理中',
|
|
60
|
|
- creation: '2025-01-11 09:15:00'
|
|
|
19
|
+ field: 'action',
|
|
|
20
|
+ fixed: 'right',
|
|
|
21
|
+ slots: { default: 'action' },
|
|
|
22
|
+ title: '操作',
|
|
|
23
|
+ width: 230,
|
|
61
|
24
|
},
|
|
62
|
25
|
{
|
|
63
|
|
- id: 3,
|
|
64
|
|
- taskName: '油轮防漏检查',
|
|
65
|
|
- area: '华东片区',
|
|
66
|
|
- station: '上海南加油站',
|
|
67
|
|
- participateTime: '2025-01-17 13:30:00',
|
|
68
|
|
- executor: '王五',
|
|
69
|
|
- comment: '发现轻微泄漏',
|
|
70
|
|
- deadline: '2025-01-23 18:00:00',
|
|
71
|
|
- processingTime: '2025-01-17 14:50:00',
|
|
72
|
|
- completionStatus: '待处理',
|
|
73
|
|
- creation: '2025-01-12 16:30:00'
|
|
|
26
|
+ field: 'taskName',
|
|
|
27
|
+ title: '任务名称',
|
|
|
28
|
+ minWidth: 150,
|
|
74
|
29
|
},
|
|
75
|
30
|
{
|
|
76
|
|
- id: 4,
|
|
77
|
|
- taskName: '油轮安全检查',
|
|
78
|
|
- area: '华东片区',
|
|
79
|
|
- station: '上海北加油站',
|
|
80
|
|
- participateTime: '2025-01-18 08:45:00',
|
|
81
|
|
- executor: '赵六',
|
|
82
|
|
- comment: '正常',
|
|
83
|
|
- deadline: '2025-01-24 18:00:00',
|
|
84
|
|
- processingTime: '2025-01-18 10:15:00',
|
|
85
|
|
- completionStatus: '已完成',
|
|
86
|
|
- creation: '2025-01-13 11:25:00'
|
|
|
31
|
+ field: 'stationId',
|
|
|
32
|
+ title: '油站',
|
|
|
33
|
+ minWidth: 120,
|
|
87
|
34
|
},
|
|
88
|
35
|
{
|
|
89
|
|
- id: 5,
|
|
90
|
|
- taskName: '油轮设备检修',
|
|
91
|
|
- area: '华南片区',
|
|
92
|
|
- station: '广州东加油站',
|
|
93
|
|
- participateTime: '2025-01-19 09:30:00',
|
|
94
|
|
- executor: '钱七',
|
|
95
|
|
- comment: '设备运行正常',
|
|
96
|
|
- deadline: '2025-01-25 18:00:00',
|
|
97
|
|
- processingTime: '2025-01-19 11:00:00',
|
|
98
|
|
- completionStatus: '已完成',
|
|
99
|
|
- creation: '2025-01-14 10:40:00'
|
|
|
36
|
+ field: 'executorName',
|
|
|
37
|
+ title: '执行人',
|
|
|
38
|
+ minWidth: 120,
|
|
100
|
39
|
},
|
|
101
|
40
|
{
|
|
102
|
|
- id: 6,
|
|
103
|
|
- taskName: '油轮防漏检查',
|
|
104
|
|
- area: '华南片区',
|
|
105
|
|
- station: '广州西加油站',
|
|
106
|
|
- participateTime: '2025-01-20 14:15:00',
|
|
107
|
|
- executor: '孙八',
|
|
108
|
|
- comment: '正常',
|
|
109
|
|
- deadline: '2025-01-26 18:00:00',
|
|
110
|
|
- processingTime: '2025-01-20 15:30:00',
|
|
111
|
|
- completionStatus: '已完成',
|
|
112
|
|
- creation: '2025-01-15 13:50:00'
|
|
|
41
|
+ field: 'position',
|
|
|
42
|
+ title: '岗位',
|
|
|
43
|
+ minWidth: 120,
|
|
113
|
44
|
},
|
|
114
|
45
|
{
|
|
115
|
|
- id: 7,
|
|
116
|
|
- taskName: '油轮安全检查',
|
|
117
|
|
- area: '华北片区',
|
|
118
|
|
- station: '天津加油站',
|
|
119
|
|
- participateTime: '2025-01-21 10:00:00',
|
|
120
|
|
- executor: '周九',
|
|
121
|
|
- comment: '需要加强管理',
|
|
122
|
|
- deadline: '2025-01-27 18:00:00',
|
|
123
|
|
- processingTime: '2025-01-21 11:20:00',
|
|
124
|
|
- completionStatus: '处理中',
|
|
125
|
|
- creation: '2025-01-16 09:10:00'
|
|
|
46
|
+ field: 'isComment',
|
|
|
47
|
+ title: '评论',
|
|
|
48
|
+ minWidth: 100,
|
|
|
49
|
+ align: 'center',
|
|
|
50
|
+ formatter: (cellValue: number) => {
|
|
|
51
|
+ return cellValue === 1 ? '已评' : '未评';
|
|
|
52
|
+ },
|
|
126
|
53
|
},
|
|
127
|
54
|
{
|
|
128
|
|
- id: 8,
|
|
129
|
|
- taskName: '油轮设备检修',
|
|
130
|
|
- area: '华东片区',
|
|
131
|
|
- station: '南京加油站',
|
|
132
|
|
- participateTime: '2025-01-22 13:30:00',
|
|
133
|
|
- executor: '吴十',
|
|
134
|
|
- comment: '设备老化',
|
|
135
|
|
- deadline: '2025-01-28 18:00:00',
|
|
136
|
|
- processingTime: '2025-01-22 14:45:00',
|
|
137
|
|
- completionStatus: '待处理',
|
|
138
|
|
- creation: '2025-01-17 14:20:00'
|
|
|
55
|
+ field: 'deadline',
|
|
|
56
|
+ title: '截止时间',
|
|
|
57
|
+ minWidth: 180,
|
|
139
|
58
|
},
|
|
140
|
|
-];
|
|
141
|
|
-
|
|
142
|
|
-export const queryFormSchema: FormSchemaGetter = () => QUERY_FORM_SCHEMA;
|
|
143
|
|
-
|
|
144
|
|
-// 查询表单模式配置
|
|
145
|
|
-const QUERY_FORM_SCHEMA = [
|
|
146
|
|
- {
|
|
147
|
|
- component: 'Select',
|
|
148
|
|
- fieldName: 'area',
|
|
149
|
|
- label: '片区',
|
|
150
|
|
- componentProps: {
|
|
151
|
|
- placeholder: '请选择片区',
|
|
152
|
|
- options: [
|
|
153
|
|
- { label: '华北片区', value: '华北片区' },
|
|
154
|
|
- { label: '华东片区', value: '华东片区' },
|
|
155
|
|
- { label: '华南片区', value: '华南片区' },
|
|
156
|
|
- ],
|
|
157
|
|
- },
|
|
|
59
|
+ {
|
|
|
60
|
+ field: 'processTime',
|
|
|
61
|
+ title: '处理时间',
|
|
|
62
|
+ minWidth: 180,
|
|
158
|
63
|
},
|
|
159
|
64
|
{
|
|
160
|
|
- component: 'Select',
|
|
161
|
|
- fieldName: 'station',
|
|
162
|
|
- label: '油站',
|
|
163
|
|
- componentProps: {
|
|
164
|
|
- placeholder: '请选择油站',
|
|
165
|
|
- options: [
|
|
166
|
|
- { label: '北京东加油站', value: '北京东加油站' },
|
|
167
|
|
- { label: '北京西加油站', value: '北京西加油站' },
|
|
168
|
|
- { label: '上海南加油站', value: '上海南加油站' },
|
|
169
|
|
- { label: '上海北加油站', value: '上海北加油站' },
|
|
170
|
|
- { label: '广州东加油站', value: '广州东加油站' },
|
|
171
|
|
- { label: '广州西加油站', value: '广州西加油站' },
|
|
172
|
|
- { label: '天津加油站', value: '天津加油站' },
|
|
173
|
|
- { label: '南京加油站', value: '南京加油站' },
|
|
174
|
|
- ],
|
|
|
65
|
+ field: 'completionStatus',
|
|
|
66
|
+ title: '完成状态',
|
|
|
67
|
+ minWidth: 120,
|
|
|
68
|
+ align: 'center',
|
|
|
69
|
+ formatter: ({ row }) => {
|
|
|
70
|
+ return row.completionStatus === 0 ? '按时完成' : '逾期完成';
|
|
175
|
71
|
},
|
|
176
|
72
|
},
|
|
177
|
73
|
{
|
|
178
|
|
- component: 'Input',
|
|
179
|
|
- fieldName: 'taskName',
|
|
180
|
|
- label: '任务名称',
|
|
181
|
|
- componentProps: {
|
|
182
|
|
- placeholder: '请输入任务名称',
|
|
|
74
|
+ field: 'createType',
|
|
|
75
|
+ title: '创建',
|
|
|
76
|
+ minWidth: 100,
|
|
|
77
|
+ align: 'center',
|
|
|
78
|
+ formatter: (cellValue: number) => {
|
|
|
79
|
+ return cellValue === 0 ? '系统' : '新增';
|
|
183
|
80
|
},
|
|
184
|
81
|
},
|
|
185
|
82
|
{
|
|
186
|
|
- component: 'DatePicker',
|
|
187
|
|
- fieldName: 'participateTimeRange',
|
|
188
|
|
- label: '参与时间',
|
|
189
|
|
- componentProps: {
|
|
190
|
|
- placeholder: '请选择参与时间范围',
|
|
191
|
|
- type: 'daterange',
|
|
192
|
|
- rangeSeparator: '至',
|
|
193
|
|
- startPlaceholder: '开始时间',
|
|
194
|
|
- endPlaceholder: '结束时间',
|
|
195
|
|
- valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
196
|
|
- },
|
|
|
83
|
+ field: 'participationTime',
|
|
|
84
|
+ title: '参与时间',
|
|
|
85
|
+ minWidth: 180,
|
|
197
|
86
|
},
|
|
198
|
87
|
{
|
|
199
|
|
- component: 'DatePicker',
|
|
200
|
|
- fieldName: 'processingTimeRange',
|
|
201
|
|
- label: '处理时间',
|
|
202
|
|
- componentProps: {
|
|
203
|
|
- placeholder: '请选择处理时间范围',
|
|
204
|
|
- type: 'daterange',
|
|
205
|
|
- rangeSeparator: '至',
|
|
206
|
|
- startPlaceholder: '开始时间',
|
|
207
|
|
- endPlaceholder: '结束时间',
|
|
208
|
|
- valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
209
|
|
- },
|
|
|
88
|
+ field: 'participationRecord',
|
|
|
89
|
+ title: '参加记录',
|
|
|
90
|
+ minWidth: 150,
|
|
210
|
91
|
},
|
|
211
|
92
|
{
|
|
212
|
|
- component: 'Select',
|
|
213
|
|
- fieldName: 'comment',
|
|
214
|
|
- label: '评论',
|
|
215
|
|
- componentProps: {
|
|
216
|
|
- placeholder: '请选择评论',
|
|
217
|
|
- options: [
|
|
218
|
|
- { label: '正常', value: '正常' },
|
|
219
|
|
- { label: '需要更换零件', value: '需要更换零件' },
|
|
220
|
|
- { label: '发现轻微泄漏', value: '发现轻微泄漏' },
|
|
221
|
|
- { label: '需要加强管理', value: '需要加强管理' },
|
|
222
|
|
- { label: '设备老化', value: '设备老化' },
|
|
223
|
|
- { label: '设备运行正常', value: '设备运行正常' },
|
|
224
|
|
- ],
|
|
|
93
|
+ field: 'recordType',
|
|
|
94
|
+ title: '记录类型',
|
|
|
95
|
+ minWidth: 120,
|
|
|
96
|
+ align: 'center',
|
|
|
97
|
+ formatter: (cellValue: number) => {
|
|
|
98
|
+ return cellValue === 1 ? '参与油站例会' : '参与应急演练';
|
|
225
|
99
|
},
|
|
226
|
100
|
},
|
|
|
101
|
+];
|
|
|
102
|
+
|
|
|
103
|
+export const querySchema: FormSchemaGetter = () => [
|
|
227
|
104
|
{
|
|
228
|
|
- component: 'Select',
|
|
229
|
|
- fieldName: 'completionStatus',
|
|
230
|
|
- label: '状态',
|
|
231
|
|
- componentProps: {
|
|
232
|
|
- placeholder: '请选择状态',
|
|
233
|
|
- options: [
|
|
234
|
|
- { label: '已完成', value: '已完成' },
|
|
235
|
|
- { label: '处理中', value: '处理中' },
|
|
236
|
|
- { label: '待处理', value: '待处理' },
|
|
237
|
|
- ],
|
|
|
105
|
+ component: 'ApiSelect',
|
|
|
106
|
+ fieldName: 'areaId',
|
|
|
107
|
+ label: '片区',
|
|
|
108
|
+ componentProps: {
|
|
|
109
|
+ placeholder: '请选择片区',
|
|
|
110
|
+ clearable: true,
|
|
|
111
|
+ api: async () => {
|
|
|
112
|
+ const resp = await selectAllSysAreaList();
|
|
|
113
|
+ const data = resp || [];
|
|
|
114
|
+ return Array.isArray(data)
|
|
|
115
|
+ ? data.map((item: any) => ({
|
|
|
116
|
+ label: item.areaName,
|
|
|
117
|
+ value: item.id,
|
|
|
118
|
+ }))
|
|
|
119
|
+ : [];
|
|
|
120
|
+ },
|
|
|
121
|
+ labelField: 'label',
|
|
|
122
|
+ valueField: 'value',
|
|
|
123
|
+ },
|
|
238
|
124
|
},
|
|
239
|
|
- },
|
|
|
125
|
+ {
|
|
|
126
|
+ component: 'ApiSelect',
|
|
|
127
|
+ fieldName: 'stationId',
|
|
|
128
|
+ label: '油站',
|
|
|
129
|
+ componentProps: {
|
|
|
130
|
+ placeholder: '请选择油站',
|
|
|
131
|
+ clearable: true,
|
|
|
132
|
+ api: async () => {
|
|
|
133
|
+ const resp = await selectAllSysStation();
|
|
|
134
|
+ const data = resp || [];
|
|
|
135
|
+ return Array.isArray(data)
|
|
|
136
|
+ ? data.map((item: any) => ({
|
|
|
137
|
+ label: item.stationName,
|
|
|
138
|
+ value: item.id.toString(),
|
|
|
139
|
+ }))
|
|
|
140
|
+ : [];
|
|
|
141
|
+ },
|
|
|
142
|
+ labelField: 'label',
|
|
|
143
|
+ valueField: 'value',
|
|
|
144
|
+ },
|
|
|
145
|
+ },
|
|
|
146
|
+ {
|
|
|
147
|
+ component: 'Select',
|
|
|
148
|
+ componentProps: {
|
|
|
149
|
+ options: [
|
|
|
150
|
+ { label: '按时完成', value: 0 },
|
|
|
151
|
+ { label: '逾期完成', value: 1 },
|
|
|
152
|
+ ],
|
|
|
153
|
+ },
|
|
|
154
|
+ fieldName: 'completionStatus',
|
|
|
155
|
+ label: '状态',
|
|
|
156
|
+ },
|
|
|
157
|
+ {
|
|
|
158
|
+ component: 'DatePicker',
|
|
|
159
|
+ componentProps: {
|
|
|
160
|
+ type: 'daterange',
|
|
|
161
|
+ format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
162
|
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
163
|
+ startPlaceholder: '开始日期',
|
|
|
164
|
+ endPlaceholder: '结束日期',
|
|
|
165
|
+ },
|
|
|
166
|
+ fieldName: 'processTime',
|
|
|
167
|
+ label: '处理时间',
|
|
|
168
|
+ },
|
|
|
169
|
+ {
|
|
|
170
|
+ component: 'Select',
|
|
|
171
|
+ componentProps: {
|
|
|
172
|
+ options: [
|
|
|
173
|
+ { label: '否', value: 0 },
|
|
|
174
|
+ { label: '是', value: 1 },
|
|
|
175
|
+ ],
|
|
|
176
|
+ },
|
|
|
177
|
+ fieldName: 'isComment',
|
|
|
178
|
+ label: '评论',
|
|
|
179
|
+ },
|
|
|
180
|
+ {
|
|
|
181
|
+ component: 'ApiSelect',
|
|
|
182
|
+ fieldName: 'position',
|
|
|
183
|
+ label: '岗位',
|
|
|
184
|
+ componentProps: {
|
|
|
185
|
+ placeholder: '请选择岗位',
|
|
|
186
|
+ clearable: true,
|
|
|
187
|
+ api: getFilteredPositions,
|
|
|
188
|
+ labelField: 'label',
|
|
|
189
|
+ valueField: 'value',
|
|
|
190
|
+ },
|
|
|
191
|
+ },
|
|
|
192
|
+ {
|
|
|
193
|
+ component: 'Select',
|
|
|
194
|
+ componentProps: {
|
|
|
195
|
+ options: [
|
|
|
196
|
+ { label: '系统', value: 0 },
|
|
|
197
|
+ { label: '新增', value: 1 },
|
|
|
198
|
+ ],
|
|
|
199
|
+ },
|
|
|
200
|
+ fieldName: 'createType',
|
|
|
201
|
+ label: '创建',
|
|
|
202
|
+ },
|
|
|
203
|
+ {
|
|
|
204
|
+ component: 'Input',
|
|
|
205
|
+ componentProps: {
|
|
|
206
|
+ placeholder: '请输入执行人',
|
|
|
207
|
+ },
|
|
|
208
|
+ fieldName: 'executorName',
|
|
|
209
|
+ label: '执行人',
|
|
|
210
|
+ },
|
|
240
|
211
|
];
|
|
|
212
|
+
|
|
|
213
|
+// 参与记录类型枚举
|
|
|
214
|
+export const RECORD_TYPE = {
|
|
|
215
|
+ OIL_STATION_MEETING: 1,
|
|
|
216
|
+ EMERGENCY_DRILL: 2,
|
|
|
217
|
+};
|
|
|
218
|
+
|
|
|
219
|
+// 参与记录类型映射
|
|
|
220
|
+export const RECORD_TYPE_MAP = {
|
|
|
221
|
+ [RECORD_TYPE.OIL_STATION_MEETING]: '参与油站例会',
|
|
|
222
|
+ [RECORD_TYPE.EMERGENCY_DRILL]: '参与应急演练',
|
|
|
223
|
+};
|
|
|
224
|
+
|