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
| import type { VxeGridProps } from '#/adapter/vxe-table';
| import type { DescItem } from '#/components/description';
|
| import { DictEnum } from '@vben/constants';
| import { getPopupContainer } from '@vben/utils';
|
| import { type FormSchemaGetter } from '#/adapter/form';
| import { getDictOptions } from '#/utils/dict';
| import { renderDict } from '#/utils/render';
|
| export const querySchema: FormSchemaGetter = () => [
| {
| component: 'Select',
| componentProps: {
| showSearch: true,
| allowClear: true,
| getPopupContainer
| },
| fieldName: 'equId',
| label: '设备名称'
| },
| {
| component: 'RangePicker',
| fieldName: 'changeDate',
| label: '变更日期'
| }
| ];
|
| export const columns: VxeGridProps['columns'] = [
| { type: 'checkbox', width: 60, fixed: 'left' },
| {
| title: '设备名称',
| field: 'equName',
| minWidth: 100,
| fixed: 'left',
| slots: { default: 'equName' }
| },
| {
| title: '变更日期',
| field: 'changeDate',
| sortable: true,
| minWidth: 180
| },
| {
| title: '变更前',
| field: 'beforeChange',
| sortable: true,
| slots: {
| default: ({ row }) => {
| return renderDict(row.beforeChange, DictEnum.SYS_EQU_STATUS);
| }
| },
| minWidth: 80,
| fixed: 'left'
| },
| {
| title: '变更后',
| field: 'afterChange',
| sortable: true,
| slots: {
| default: ({ row }) => {
| return renderDict(row.afterChange, DictEnum.SYS_EQU_STATUS);
| }
| },
| minWidth: 80,
| fixed: 'left'
| },
|
| {
| title: '变更描述',
| field: 'changeDesc',
| minWidth: 120
| },
| {
| title: '变更人',
| field: 'changeUserName',
| minWidth: 120
| },
| {
| field: 'action',
| fixed: 'right',
| slots: { default: 'action' },
| title: '操作',
| width: 200
| }
| ];
|
| export const drawerSchema: FormSchemaGetter = () => [
| {
| component: 'Input',
| dependencies: {
| show: () => false,
| triggerFields: ['']
| },
| fieldName: 'equStatuId'
| },
| {
| component: 'Select',
| componentProps: {
| showSearch: true,
| allowClear: true,
| getPopupContainer
| },
| dependencies: {
| show: () => false,
| triggerFields: ['']
| },
| fieldName: 'equId',
| label: '设备id'
| },
| {
| component: 'Input',
| fieldName: 'equName',
| label: '设备名称'
| },
| {
| component: 'DatePicker',
| componentProps: {
| format: 'YYYY-MM-DD HH:mm:ss',
| showTime: false,
| valueFormat: 'YYYY-MM-DD HH:mm:ss',
| getPopupContainer
| },
| fieldName: 'changeDate',
| label: '变更日期'
| },
| {
| component: 'TreeSelect',
| // 在drawer里更新 这里不需要默认的componentProps
| defaultValue: undefined,
| fieldName: 'userDept',
| label: '变更人部门',
| help: `变更人员所属部门`
| // rules: 'selectRequired',
| },
| {
| component: 'Select',
| componentProps: {
| allowClear: true,
| showSearch: true,
| getPopupContainer
| },
| fieldName: 'changeUser',
| label: '变更人',
| help: `设备状态变更操作人员`
| },
| {
| component: 'RadioGroup',
| componentProps: {
| buttonStyle: 'solid',
| options: getDictOptions(DictEnum.SYS_EQU_STATUS),
| optionType: 'button'
| },
| fieldName: 'beforeChange',
| label: '变更前',
| help: '设备变更前状态'
| },
| {
| component: 'RadioGroup',
| componentProps: {
| buttonStyle: 'solid',
| options: getDictOptions(DictEnum.SYS_EQU_STATUS),
| optionType: 'button'
| },
| fieldName: 'afterChange',
| label: '变更后',
| help: '设备变更后状态'
| },
| {
| component: 'Textarea',
| fieldName: 'changeDesc',
| label: '变更描述'
| }
| ];
|
| export const descSchema: DescItem[] = [
| {
| field: 'equName',
| label: '设备名称'
| },
| {
| field: 'beforeChange',
| label: '变更前',
| render(value) {
| return renderDict(value, DictEnum.SYS_EQU_STATUS);
| }
| },
| {
| field: 'afterChange',
| label: '变更后',
| render(value) {
| return renderDict(value, DictEnum.SYS_EQU_STATUS);
| }
| },
| {
| field: 'changeDate',
| label: '变更日期'
| },
| {
| field: 'changeDesc',
| label: '变更描述'
| },
| {
| field: 'changeUserName',
| label: '变更人'
| }
| ];
|
|