车间能级提升-智能设备管理系统
zhuguifei
2025-04-08 c6e203d8e80c9cd8f74c79498662fa20d223ff56
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
import type { VxeGridProps } from '#/adapter/vxe-table';
 
import { DictEnum } from '@vben/constants';
 
import { type FormSchemaGetter } from '#/adapter/form';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
 
export const querySchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    fieldName: 'faultCode',
    label: '知识编号'
  },
  {
    component: 'Input',
    fieldName: 'equName',
    label: '设备名称'
  },
  {
    component: 'Input',
    fieldName: 'assetNo',
    label: '资产编号'
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.EIMS_EQU_PART)
    },
    fieldName: 'equPart',
    label: '设备部位'
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.REPAIR_FAULT_TYPE)
    },
    fieldName: 'faultType',
    label: '故障类别'
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.EIMS_FAULT_REASON)
    },
    fieldName: 'faultReason',
    label: '故障原因'
  },
  {
    component: 'Input',
    fieldName: 'reqDesc',
    label: '故障描述'
  },
  {
    component: 'Input',
    fieldName: 'resHandle',
    label: '处理措施'
  }
];
 
export const columns: VxeGridProps['columns'] = [
  { type: 'checkbox', width: 60, fixed: 'left' },
  {
    title: '知识编码',
    field: 'faultCode',
    minWidth: 200
  },
  {
    title: '设备名称',
    field: 'equName',
    minWidth: 140,
    fixed: 'left',
    slots: { default: 'equName' }
  },
  {
    title: '资产编号',
    field: 'assetNo',
    sortable: true,
    minWidth: 140,
    fixed: 'left'
  },
  {
    title: '设备类型',
    field: 'equTypeName',
    minWidth: 140
  },
  {
    title: '设备部位',
    field: 'equPart',
    sortable: true,
    slots: {
      default: ({ row }) => {
        if (row.equPart === null || row.equPart === '') {
          return '';
        }
        return renderDict(row.equPart, DictEnum.EIMS_EQU_PART);
      }
    },
    minWidth: 120
  },
  {
    title: '故障类别',
    field: 'faultType',
    sortable: true,
    slots: {
      default: ({ row }) => {
        if (row.faultType === null || row.faultType === '') {
          return '';
        }
        return renderDict(row.faultType, DictEnum.REPAIR_FAULT_TYPE);
      }
    },
    minWidth: 120
  },
  {
    title: '故障原因',
    field: 'faultReason',
    sortable: true,
    slots: {
      default: ({ row }) => {
        if (row.faultReason === null || row.faultReason === '') {
          return '';
        }
        return renderDict(row.faultReason, DictEnum.EIMS_FAULT_REASON);
      }
    },
    minWidth: 120
  },
  {
    title: '报修描述',
    field: 'reqDesc',
    minWidth: 300
  },
  {
    title: '处理措施',
    field: 'resHandle',
    minWidth: 300
  },
  {
    field: 'action',
    fixed: 'right',
    slots: { default: 'action' },
    title: '操作',
    width: 200
  }
];
 
export const drawerSchema: FormSchemaGetter = () => [
  {
    component: 'Input',
    dependencies: {
      show: () => false,
      triggerFields: ['']
    },
    fieldName: 'equId'
  },
  {
    component: 'Input',
    fieldName: 'faultCode',
    label: '知识编码',
    rules: 'required'
  },
  {
    component: 'Input',
    fieldName: 'equName',
    label: '设备名称',
    rules: 'required'
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.EIMS_EQU_PART)
    },
    fieldName: 'equPart',
    label: '设备部位'
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.REPAIR_FAULT_TYPE)
    },
    fieldName: 'faultType',
    label: '故障类别'
  },
  {
    component: 'Select',
    componentProps: {
      options: getDictOptions(DictEnum.EIMS_FAULT_REASON)
    },
    fieldName: 'faultReason',
    label: '故障原因'
  },
  {
    component: 'Textarea',
    formItemClass: 'items-baseline',
    fieldName: 'reqDesc',
    label: '报修描述'
  },
  {
    component: 'Textarea',
    formItemClass: 'items-baseline',
    fieldName: 'resHandle',
    label: '处理措施'
  }
];