eoss-ui 0.5.13 → 0.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/button.js +2 -2
- package/lib/cascader.js +2 -2
- package/lib/checkbox-group.js +39 -21
- package/lib/data-table-form.js +3 -2
- package/lib/data-table.js +1204 -1516
- package/lib/date-picker.js +2 -2
- package/lib/dialog.js +9 -9
- package/lib/eoss-ui.common.js +1210 -1751
- package/lib/flow-list.js +2 -2
- package/lib/flow.js +7 -6
- package/lib/form.js +4 -9
- package/lib/icons.js +2 -2
- package/lib/index.js +1 -1
- package/lib/input-number.js +2 -2
- package/lib/input.js +2 -2
- package/lib/label.js +2 -2
- package/lib/layout.js +166 -152
- package/lib/main.js +6 -5
- package/lib/menu.js +2 -2
- package/lib/nav.js +9 -9
- package/lib/notify.js +2 -2
- package/lib/page.js +2 -2
- package/lib/pagination.js +2 -2
- package/lib/player.js +8 -8
- package/lib/qr-code.js +4 -4
- package/lib/radio-group.js +43 -21
- package/lib/retrial-auth.js +2 -2
- package/lib/select-ganged.js +25 -5
- package/lib/select.js +41 -18
- package/lib/selector-panel.js +6 -5
- package/lib/selector.js +4 -4
- package/lib/sizer.js +2 -2
- package/lib/steps.js +9 -9
- package/lib/switch.js +2 -2
- package/lib/table-form.js +2 -2
- package/lib/tabs-panel.js +2 -2
- package/lib/tabs.js +2 -2
- package/lib/theme-chalk/data-table.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/tips.js +2 -2
- package/lib/toolbar.js +2 -2
- package/lib/tree-group.js +2 -2
- package/lib/tree.js +2 -2
- package/lib/upload.js +3 -3
- package/lib/wujie.js +2 -2
- package/lib/wxlogin.js +2 -2
- package/package.json +1 -1
- package/packages/checkbox-group/src/main.vue +20 -30
- package/packages/data-table/src/children.vue +4 -8
- package/packages/data-table/src/column.vue +522 -575
- package/packages/data-table/src/main.vue +95 -119
- package/packages/form/src/main.vue +2 -7
- package/packages/radio-group/src/main.vue +20 -30
- package/packages/select/src/main.vue +20 -29
- package/packages/select-ganged/src/main.vue +1 -3
- package/packages/theme-chalk/lib/data-table.css +1 -1
- package/packages/theme-chalk/lib/index.css +1 -1
- package/packages/theme-chalk/src/data-table.scss +2 -1
- package/src/index.js +1 -1
- package/packages/data-table/src/column copy.vue +0 -977
- package/packages/data-table/src/main copy.vue +0 -1325
- package/packages/data-table/src/mixins/table.js +0 -12
|
@@ -1,455 +1,308 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-table-column
|
|
3
|
-
|
|
4
|
-
v-show="!item.hide"
|
|
5
|
-
:filter-icon="filterIcon"
|
|
6
|
-
:label="item.title || item.label"
|
|
7
|
-
:label-key="item.labelKey"
|
|
8
|
-
:value-key="item.valueKey"
|
|
9
|
-
:prop="item.field || item.prop"
|
|
10
|
-
:fixed="item.fixed"
|
|
11
|
-
:sortable="item.sortable || item.sort"
|
|
12
|
-
:column-key="item.columnKey"
|
|
13
|
-
:width="width"
|
|
14
|
-
:min-width="item.minWidth"
|
|
15
|
-
:render-header="item.renderHeader"
|
|
16
|
-
:sort-method="item.sortMethod"
|
|
17
|
-
:sort-by="item.sortBy"
|
|
18
|
-
:sort-orders="item.sortOrders"
|
|
19
|
-
:resizable="item.resizable"
|
|
20
|
-
:formatter="item.formatter"
|
|
21
|
-
:show-overflow-tooltip="item.showOverflowTooltip"
|
|
22
|
-
:align="item.align"
|
|
23
|
-
:header-align="item.headerAlign"
|
|
24
|
-
:class-name="
|
|
25
|
-
(item.className
|
|
26
|
-
? item.className + (item.type ? ' es-table-' + item.type + '-box' : '')
|
|
27
|
-
: item.type
|
|
28
|
-
? 'es-table-' + item.type + '-box'
|
|
29
|
-
: '') + (item.showOverflowTooltip ? ' es-text-ellipsis' : '')
|
|
30
|
-
"
|
|
31
|
-
:label-class-name="
|
|
32
|
-
item.required
|
|
33
|
-
? 'es-required' + (item.labelClassName ? ' ' + item.labelClassName : '')
|
|
34
|
-
: item.labelClassName
|
|
35
|
-
"
|
|
36
|
-
:selectable="item.selectable"
|
|
37
|
-
:reserve-selection="item.reserveSelection"
|
|
38
|
-
:filters="item.filters"
|
|
39
|
-
:filter-placement="item.filterPlacement"
|
|
40
|
-
:filter-multiple="item.filterMultiple"
|
|
41
|
-
:filter-method="item.filterMethod"
|
|
42
|
-
:filtered-value="item.filteredValue"
|
|
43
|
-
:colspan="item.colspan"
|
|
44
|
-
:rowspan="item.rowspan"
|
|
45
|
-
:total="item.total"
|
|
46
|
-
>
|
|
2
|
+
<el-table-column v-bind="config">
|
|
3
|
+
<slot> </slot>
|
|
47
4
|
<template slot-scope="scope">
|
|
48
|
-
<template v-if="
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
5
|
+
<template v-if="isForm && !isReadOnly(scope)">
|
|
6
|
+
<el-form-item
|
|
7
|
+
:name="name"
|
|
8
|
+
:prop="field || prop"
|
|
9
|
+
:rules="isNotRule(scope) ? [] : rules"
|
|
10
|
+
:index="scope.$index"
|
|
11
|
+
>
|
|
12
|
+
<es-select
|
|
13
|
+
v-if="type === 'select'"
|
|
14
|
+
v-bind="formOption"
|
|
15
|
+
v-model="scope.row[field || prop]"
|
|
16
|
+
@blur="
|
|
17
|
+
(event) => {
|
|
18
|
+
handleBlur({
|
|
19
|
+
item: config,
|
|
20
|
+
event: event,
|
|
21
|
+
data: scope.row,
|
|
22
|
+
scope: scope
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
"
|
|
26
|
+
@focus="
|
|
27
|
+
(event) => {
|
|
28
|
+
handleFocus({
|
|
29
|
+
item: config,
|
|
30
|
+
event: event,
|
|
31
|
+
data: scope.row,
|
|
32
|
+
scope: scope
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
"
|
|
36
|
+
@change="
|
|
37
|
+
(value) => {
|
|
38
|
+
handleChange({
|
|
39
|
+
item: config,
|
|
40
|
+
name: field || prop,
|
|
41
|
+
value: value,
|
|
42
|
+
data: scope.row,
|
|
43
|
+
scope: scope
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
"
|
|
47
|
+
></es-select>
|
|
48
|
+
<es-cascader
|
|
49
|
+
v-else-if="type == 'cascader'"
|
|
50
|
+
v-bind="formOption"
|
|
51
|
+
v-model="scope.row[field || prop]"
|
|
52
|
+
@blur="
|
|
53
|
+
(event) => {
|
|
54
|
+
handleBlur({
|
|
55
|
+
item: config,
|
|
56
|
+
event: event,
|
|
57
|
+
data: scope.row,
|
|
58
|
+
scope: scope
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
"
|
|
62
|
+
@focus="
|
|
63
|
+
(event) => {
|
|
64
|
+
handleFocus({
|
|
65
|
+
item: config,
|
|
66
|
+
event: event,
|
|
67
|
+
data: scope.row,
|
|
68
|
+
scope: scope
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
"
|
|
72
|
+
@change="
|
|
73
|
+
(value) => {
|
|
74
|
+
handleChange({
|
|
75
|
+
item: config,
|
|
76
|
+
name: field || prop,
|
|
77
|
+
value: value,
|
|
78
|
+
data: scope.row,
|
|
79
|
+
scope: scope
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
"
|
|
70
83
|
>
|
|
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
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
"
|
|
286
|
-
@focus="
|
|
287
|
-
(event) => {
|
|
288
|
-
handleFocus({
|
|
289
|
-
item: item,
|
|
290
|
-
event: event,
|
|
291
|
-
data: scope.row,
|
|
292
|
-
scope: scope
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
"
|
|
296
|
-
@change="
|
|
297
|
-
(value) => {
|
|
298
|
-
handleChange({
|
|
299
|
-
item: item,
|
|
300
|
-
name: item.field || item.prop,
|
|
301
|
-
value: value,
|
|
302
|
-
data: scope.row,
|
|
303
|
-
scope: scope
|
|
304
|
-
});
|
|
305
|
-
}
|
|
306
|
-
"
|
|
307
|
-
></es-date-picker>
|
|
308
|
-
<es-input-number
|
|
309
|
-
v-else-if="item.type == 'number'"
|
|
310
|
-
v-bind="exclAttribute({ data: item, attrs: 'width' })"
|
|
311
|
-
v-model="scope.row[item.field]"
|
|
312
|
-
@blur="
|
|
313
|
-
(event) => {
|
|
314
|
-
handleBlur({
|
|
315
|
-
item: item,
|
|
316
|
-
event: event,
|
|
317
|
-
data: scope.row,
|
|
318
|
-
scope: scope
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
"
|
|
322
|
-
@focus="
|
|
323
|
-
(event) => {
|
|
324
|
-
handleFocus({
|
|
325
|
-
item: item,
|
|
326
|
-
event: event,
|
|
327
|
-
data: scope.row,
|
|
328
|
-
scope: scope
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
"
|
|
332
|
-
@change="
|
|
333
|
-
(value) => {
|
|
334
|
-
handleChange({
|
|
335
|
-
item: item,
|
|
336
|
-
name: item.field || item.prop,
|
|
337
|
-
value: value,
|
|
338
|
-
data: scope.row,
|
|
339
|
-
scope: scope
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
"
|
|
343
|
-
></es-input-number>
|
|
344
|
-
<es-selector
|
|
345
|
-
v-else-if="item.type == 'selector'"
|
|
346
|
-
v-bind="exclAttribute({ data: item, attrs: 'width' })"
|
|
347
|
-
v-model="scope.row[item.field]"
|
|
348
|
-
v-on="
|
|
349
|
-
exclAttribute({
|
|
350
|
-
data: item.events,
|
|
351
|
-
attrs: 'change'
|
|
352
|
-
})
|
|
353
|
-
"
|
|
354
|
-
@change="
|
|
355
|
-
(value) => {
|
|
356
|
-
handleChange({
|
|
357
|
-
item: item,
|
|
358
|
-
name: item.field || item.prop,
|
|
359
|
-
value: value,
|
|
360
|
-
data: scope.row
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
"
|
|
364
|
-
></es-selector>
|
|
365
|
-
<template
|
|
366
|
-
v-else-if="item.type === 'text' || item.type === 'textarea'"
|
|
367
|
-
>
|
|
368
|
-
<template v-if="item.lazy">
|
|
369
|
-
<input
|
|
370
|
-
v-if="item.type === 'text'"
|
|
371
|
-
class="el-input__inner"
|
|
372
|
-
v-bind="exclAttribute({ data: item, attrs: 'width' })"
|
|
373
|
-
v-model.lazy="scope.row[item.field]"
|
|
374
|
-
@blur="
|
|
375
|
-
(event) => {
|
|
376
|
-
handleBlur({
|
|
377
|
-
item: item,
|
|
378
|
-
event: event,
|
|
379
|
-
data: scope.row,
|
|
380
|
-
scope: scope
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
"
|
|
384
|
-
@focus="
|
|
385
|
-
(event) => {
|
|
386
|
-
handleFocus({
|
|
387
|
-
item: item,
|
|
388
|
-
event: event,
|
|
389
|
-
data: scope.row,
|
|
390
|
-
scope: scope
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
"
|
|
394
|
-
@change="
|
|
395
|
-
(value) => {
|
|
396
|
-
handleChange({
|
|
397
|
-
item: item,
|
|
398
|
-
name: item.field || item.prop,
|
|
399
|
-
value: value,
|
|
400
|
-
data: scope.row,
|
|
401
|
-
scope: scope
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
"
|
|
405
|
-
/>
|
|
406
|
-
<textarea
|
|
407
|
-
v-else
|
|
408
|
-
class="el-textarea__inner"
|
|
409
|
-
v-bind="exclAttribute({ data: item, attrs: 'width' })"
|
|
410
|
-
v-model.lazy="scope.row[item.field]"
|
|
411
|
-
@blur="
|
|
412
|
-
(event) => {
|
|
413
|
-
handleBlur({
|
|
414
|
-
item: item,
|
|
415
|
-
event: event,
|
|
416
|
-
data: scope.row,
|
|
417
|
-
scope: scope
|
|
418
|
-
});
|
|
419
|
-
}
|
|
420
|
-
"
|
|
421
|
-
@focus="
|
|
422
|
-
(event) => {
|
|
423
|
-
handleFocus({
|
|
424
|
-
item: item,
|
|
425
|
-
event: event,
|
|
426
|
-
data: scope.row,
|
|
427
|
-
scope: scope
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
|
-
"
|
|
431
|
-
@change="
|
|
432
|
-
(value) => {
|
|
433
|
-
handleChange({
|
|
434
|
-
item: item,
|
|
435
|
-
name: item.field || item.prop,
|
|
436
|
-
value: value,
|
|
437
|
-
data: scope.row,
|
|
438
|
-
scope: scope
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
"
|
|
442
|
-
></textarea>
|
|
443
|
-
</template>
|
|
444
|
-
<es-input
|
|
84
|
+
</es-cascader>
|
|
85
|
+
<es-select-ganged
|
|
86
|
+
v-else-if="type === 'ganged'"
|
|
87
|
+
v-bind="
|
|
88
|
+
exclAttribute({
|
|
89
|
+
data: config,
|
|
90
|
+
attrs: ['width', 'url', 'sysCode']
|
|
91
|
+
})
|
|
92
|
+
"
|
|
93
|
+
v-model="scope.row[field || prop]"
|
|
94
|
+
:data="init(option, config)"
|
|
95
|
+
@change="
|
|
96
|
+
(value) => {
|
|
97
|
+
handleChange({
|
|
98
|
+
name: field || prop,
|
|
99
|
+
value: value,
|
|
100
|
+
data: scope.row,
|
|
101
|
+
item: item
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
"
|
|
105
|
+
></es-select-ganged>
|
|
106
|
+
<es-radio-group
|
|
107
|
+
v-else-if="type === 'radio'"
|
|
108
|
+
v-bind="formOption"
|
|
109
|
+
v-model="scope.row[field || prop]"
|
|
110
|
+
@change="
|
|
111
|
+
(value) => {
|
|
112
|
+
handleChange({
|
|
113
|
+
item: config,
|
|
114
|
+
name: field || prop,
|
|
115
|
+
value: value,
|
|
116
|
+
data: scope.row
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
"
|
|
120
|
+
></es-radio-group>
|
|
121
|
+
<es-checkbox-group
|
|
122
|
+
v-else-if="type === 'checkbox'"
|
|
123
|
+
v-bind="formOption"
|
|
124
|
+
v-model="scope.row[field || prop]"
|
|
125
|
+
@change="
|
|
126
|
+
(value) => {
|
|
127
|
+
handleChange({
|
|
128
|
+
item: config,
|
|
129
|
+
name: field || prop,
|
|
130
|
+
value: value,
|
|
131
|
+
data: scope.row
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
"
|
|
135
|
+
></es-checkbox-group>
|
|
136
|
+
<es-switch
|
|
137
|
+
v-else-if="type === 'switch'"
|
|
138
|
+
v-bind="formOption"
|
|
139
|
+
v-model="scope.row[field || prop]"
|
|
140
|
+
@change="
|
|
141
|
+
(value) => {
|
|
142
|
+
handleChange({
|
|
143
|
+
item: config,
|
|
144
|
+
name: field || prop,
|
|
145
|
+
value: value,
|
|
146
|
+
data: scope.row
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
"
|
|
150
|
+
></es-switch>
|
|
151
|
+
<es-date-picker
|
|
152
|
+
v-else-if="
|
|
153
|
+
config.date ||
|
|
154
|
+
type == 'date' ||
|
|
155
|
+
type == 'year' ||
|
|
156
|
+
type == 'month' ||
|
|
157
|
+
type == 'date' ||
|
|
158
|
+
type == 'dates' ||
|
|
159
|
+
type == 'week' ||
|
|
160
|
+
type == 'datetime' ||
|
|
161
|
+
type == 'datetimerange' ||
|
|
162
|
+
type == 'daterange' ||
|
|
163
|
+
type == 'monthrange' ||
|
|
164
|
+
type == 'quarter' ||
|
|
165
|
+
type == 'halfyear'
|
|
166
|
+
"
|
|
167
|
+
v-bind="formOption"
|
|
168
|
+
v-model="scope.row[field || prop]"
|
|
169
|
+
@blur="
|
|
170
|
+
(event) => {
|
|
171
|
+
handleBlur({
|
|
172
|
+
item: config,
|
|
173
|
+
event: event,
|
|
174
|
+
data: scope.row,
|
|
175
|
+
scope: scope
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
"
|
|
179
|
+
@focus="
|
|
180
|
+
(event) => {
|
|
181
|
+
handleFocus({
|
|
182
|
+
item: config,
|
|
183
|
+
event: event,
|
|
184
|
+
data: scope.row,
|
|
185
|
+
scope: scope
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
"
|
|
189
|
+
@change="
|
|
190
|
+
(value) => {
|
|
191
|
+
handleChange({
|
|
192
|
+
item: config,
|
|
193
|
+
name: field || prop,
|
|
194
|
+
value: value,
|
|
195
|
+
data: scope.row,
|
|
196
|
+
scope: scope
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
"
|
|
200
|
+
></es-date-picker>
|
|
201
|
+
<es-input-number
|
|
202
|
+
v-else-if="type == 'number'"
|
|
203
|
+
v-bind="formOption"
|
|
204
|
+
v-model="scope.row[field || prop]"
|
|
205
|
+
@blur="
|
|
206
|
+
(event) => {
|
|
207
|
+
handleBlur({
|
|
208
|
+
item: config,
|
|
209
|
+
event: event,
|
|
210
|
+
data: scope.row,
|
|
211
|
+
scope: scope
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
"
|
|
215
|
+
@focus="
|
|
216
|
+
(event) => {
|
|
217
|
+
handleFocus({
|
|
218
|
+
item: config,
|
|
219
|
+
event: event,
|
|
220
|
+
data: scope.row,
|
|
221
|
+
scope: scope
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
"
|
|
225
|
+
@change="
|
|
226
|
+
(value) => {
|
|
227
|
+
handleChange({
|
|
228
|
+
item: config,
|
|
229
|
+
name: field || prop,
|
|
230
|
+
value: value,
|
|
231
|
+
data: scope.row,
|
|
232
|
+
scope: scope
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
"
|
|
236
|
+
></es-input-number>
|
|
237
|
+
<es-selector
|
|
238
|
+
v-else-if="type == 'selector'"
|
|
239
|
+
v-bind="formOption"
|
|
240
|
+
v-model="scope.row[field || prop]"
|
|
241
|
+
v-on="
|
|
242
|
+
exclAttribute({
|
|
243
|
+
data: events,
|
|
244
|
+
attrs: 'change'
|
|
245
|
+
})
|
|
246
|
+
"
|
|
247
|
+
@change="
|
|
248
|
+
(value) => {
|
|
249
|
+
handleChange({
|
|
250
|
+
item: config,
|
|
251
|
+
name: field || prop,
|
|
252
|
+
value: value,
|
|
253
|
+
data: scope.row
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
"
|
|
257
|
+
></es-selector>
|
|
258
|
+
<template v-else-if="type === 'text' || type === 'textarea'">
|
|
259
|
+
<template v-if="config.lazy">
|
|
260
|
+
<input
|
|
261
|
+
v-if="type === 'text'"
|
|
262
|
+
class="el-input__inner"
|
|
263
|
+
v-bind="formOption"
|
|
264
|
+
v-model.lazy="scope.row[field]"
|
|
265
|
+
@blur="
|
|
266
|
+
(event) => {
|
|
267
|
+
handleBlur({
|
|
268
|
+
item: config,
|
|
269
|
+
event: event,
|
|
270
|
+
data: scope.row,
|
|
271
|
+
scope: scope
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
"
|
|
275
|
+
@focus="
|
|
276
|
+
(event) => {
|
|
277
|
+
handleFocus({
|
|
278
|
+
item: config,
|
|
279
|
+
event: event,
|
|
280
|
+
data: scope.row,
|
|
281
|
+
scope: scope
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
"
|
|
285
|
+
@change="
|
|
286
|
+
(value) => {
|
|
287
|
+
handleChange({
|
|
288
|
+
item: config,
|
|
289
|
+
name: field || prop,
|
|
290
|
+
value: value,
|
|
291
|
+
data: scope.row,
|
|
292
|
+
scope: scope
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
"
|
|
296
|
+
/>
|
|
297
|
+
<textarea
|
|
445
298
|
v-else
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
v-model="scope.row[
|
|
299
|
+
class="el-textarea__inner"
|
|
300
|
+
v-bind="formOption"
|
|
301
|
+
v-model.lazy="scope.row[field]"
|
|
449
302
|
@blur="
|
|
450
303
|
(event) => {
|
|
451
304
|
handleBlur({
|
|
452
|
-
item:
|
|
305
|
+
item: config,
|
|
453
306
|
event: event,
|
|
454
307
|
data: scope.row,
|
|
455
308
|
scope: scope
|
|
@@ -459,7 +312,7 @@
|
|
|
459
312
|
@focus="
|
|
460
313
|
(event) => {
|
|
461
314
|
handleFocus({
|
|
462
|
-
item:
|
|
315
|
+
item: config,
|
|
463
316
|
event: event,
|
|
464
317
|
data: scope.row,
|
|
465
318
|
scope: scope
|
|
@@ -469,95 +322,90 @@
|
|
|
469
322
|
@change="
|
|
470
323
|
(value) => {
|
|
471
324
|
handleChange({
|
|
472
|
-
item:
|
|
473
|
-
name:
|
|
325
|
+
item: config,
|
|
326
|
+
name: field || prop,
|
|
474
327
|
value: value,
|
|
475
328
|
data: scope.row,
|
|
476
329
|
scope: scope
|
|
477
330
|
});
|
|
478
331
|
}
|
|
479
332
|
"
|
|
480
|
-
></
|
|
333
|
+
></textarea>
|
|
481
334
|
</template>
|
|
482
|
-
|
|
483
|
-
|
|
335
|
+
<es-input
|
|
336
|
+
v-else
|
|
337
|
+
v-bind="formOption"
|
|
338
|
+
:scope="scope"
|
|
339
|
+
v-model="scope.row[field || prop]"
|
|
340
|
+
@blur="
|
|
341
|
+
(event) => {
|
|
342
|
+
handleBlur({
|
|
343
|
+
item: config,
|
|
344
|
+
event: event,
|
|
345
|
+
data: scope.row,
|
|
346
|
+
scope: scope
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
"
|
|
350
|
+
@focus="
|
|
351
|
+
(event) => {
|
|
352
|
+
handleFocus({
|
|
353
|
+
item: config,
|
|
354
|
+
event: event,
|
|
355
|
+
data: scope.row,
|
|
356
|
+
scope: scope
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
"
|
|
360
|
+
@change="
|
|
361
|
+
(value) => {
|
|
362
|
+
handleChange({
|
|
363
|
+
item: config,
|
|
364
|
+
name: field || prop,
|
|
365
|
+
value: value,
|
|
366
|
+
data: scope.row,
|
|
367
|
+
scope: scope
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
"
|
|
371
|
+
></es-input>
|
|
372
|
+
</template>
|
|
373
|
+
</el-form-item>
|
|
484
374
|
</template>
|
|
485
|
-
<!-- 按钮区域 -->
|
|
486
375
|
<es-button-group
|
|
487
|
-
v-if="
|
|
376
|
+
v-else-if="type === 'handle' && !scope.row.hideHandle"
|
|
488
377
|
v-bind="
|
|
489
378
|
exclAttribute({
|
|
490
|
-
data:
|
|
379
|
+
data: { ...config, prop: this.prop, field: this.field },
|
|
491
380
|
attrs: ['contents', 'events', 'type', 'width', 'template', 'title']
|
|
492
381
|
})
|
|
493
382
|
"
|
|
494
383
|
stop
|
|
495
|
-
:contents="
|
|
384
|
+
:contents="contents || events"
|
|
496
385
|
:data="scope.row"
|
|
497
386
|
@handleClick="handleClick"
|
|
498
|
-
v-model="
|
|
387
|
+
v-model="btnWidth"
|
|
499
388
|
></es-button-group>
|
|
500
|
-
</template>
|
|
501
|
-
</el-table-column>
|
|
502
|
-
<el-table-column
|
|
503
|
-
v-else
|
|
504
|
-
v-show="!item.hide"
|
|
505
|
-
:key="index"
|
|
506
|
-
:filter-icon="filterIcon"
|
|
507
|
-
:label="item.title || item.label"
|
|
508
|
-
:label-key="item.labelKey"
|
|
509
|
-
:value-key="item.valueKey"
|
|
510
|
-
:prop="item.field || item.prop"
|
|
511
|
-
:fixed="item.fixed"
|
|
512
|
-
:sortable="item.sortable || item.sort"
|
|
513
|
-
:index="item.index"
|
|
514
|
-
:column-key="item.columnKey"
|
|
515
|
-
:width="item.width"
|
|
516
|
-
:min-width="item.minWidth"
|
|
517
|
-
:render-header="item.renderHeader"
|
|
518
|
-
:sort-method="item.sortMethod"
|
|
519
|
-
:sort-by="item.sortBy"
|
|
520
|
-
:sort-orders="item.sortOrders"
|
|
521
|
-
:resizable="item.resizable"
|
|
522
|
-
:formatter="item.formatter"
|
|
523
|
-
:show-overflow-tooltip="item.showOverflowTooltip"
|
|
524
|
-
:align="item.align"
|
|
525
|
-
:header-align="item.headerAlign"
|
|
526
|
-
:class-name="item.className"
|
|
527
|
-
:label-class-name="item.labelClassName"
|
|
528
|
-
:selectable="item.selectable"
|
|
529
|
-
:reserve-selection="item.reserveSelection"
|
|
530
|
-
:filters="item.filters"
|
|
531
|
-
:filter-placement="item.filterPlacement"
|
|
532
|
-
:filter-multiple="item.filterMultiple"
|
|
533
|
-
:filter-method="item.filterMethod"
|
|
534
|
-
:filtered-value="item.filteredValue"
|
|
535
|
-
:colspan="item.colspan"
|
|
536
|
-
:rowspan="item.rowspan"
|
|
537
|
-
:total="item.total"
|
|
538
|
-
>
|
|
539
|
-
<slot></slot>
|
|
540
|
-
<template slot-scope="scope">
|
|
541
389
|
<expand-dom
|
|
542
|
-
v-if="
|
|
543
|
-
:column="
|
|
390
|
+
v-else-if="render"
|
|
391
|
+
:column="{ ...config, prop: this.prop, field: this.field }"
|
|
544
392
|
:row="scope.row"
|
|
545
|
-
:render="
|
|
546
|
-
:index="
|
|
393
|
+
:render="render"
|
|
394
|
+
:index="indexs"
|
|
547
395
|
>
|
|
548
396
|
</expand-dom>
|
|
549
|
-
<template v-else>
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
397
|
+
<template v-else-if="dateFormat">
|
|
398
|
+
{{ formatDate(scope.row[field || prop], dateFormat) }}
|
|
399
|
+
</template>
|
|
400
|
+
<span v-else :style="styles ? styles[scope.row[prop]] : {}">{{
|
|
401
|
+
format(scope.row)
|
|
402
|
+
}}</span>
|
|
554
403
|
</template>
|
|
555
404
|
</el-table-column>
|
|
556
405
|
</template>
|
|
557
406
|
|
|
558
407
|
<script type="text/babel">
|
|
559
408
|
import { findSysCode } from 'eoss-ui/src/config/api.js';
|
|
560
|
-
import tableMixin from './mixins/table';
|
|
561
409
|
import util from 'eoss-ui/src/utils/util';
|
|
562
410
|
export default {
|
|
563
411
|
name: 'Column',
|
|
@@ -598,38 +446,52 @@ export default {
|
|
|
598
446
|
},
|
|
599
447
|
tableReload: {
|
|
600
448
|
default: ''
|
|
449
|
+
},
|
|
450
|
+
table: {
|
|
451
|
+
default: ''
|
|
601
452
|
}
|
|
602
453
|
},
|
|
603
|
-
mixins: [tableMixin],
|
|
604
454
|
props: {
|
|
455
|
+
form: Boolean,
|
|
605
456
|
readonly: Boolean,
|
|
606
457
|
name: String,
|
|
607
458
|
filterIcon: [Boolean, String],
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
459
|
+
title: String,
|
|
460
|
+
label: String,
|
|
461
|
+
labelKey: String,
|
|
462
|
+
valueKey: String,
|
|
463
|
+
field: String,
|
|
464
|
+
prop: String,
|
|
465
|
+
sortable: [Boolean, String],
|
|
466
|
+
sort: [Boolean, String],
|
|
467
|
+
className: String,
|
|
468
|
+
labelClassName: String,
|
|
469
|
+
type: String,
|
|
470
|
+
required: Boolean,
|
|
471
|
+
width: String,
|
|
472
|
+
minWidth: String,
|
|
473
|
+
hide: Boolean,
|
|
474
|
+
showOverflowTooltip: Boolean,
|
|
475
|
+
render: [Function, String],
|
|
476
|
+
contents: Array,
|
|
477
|
+
events: [Array, Object],
|
|
478
|
+
dateFormat: String,
|
|
479
|
+
styles: [Array, Object],
|
|
480
|
+
sysCode: String,
|
|
481
|
+
valueToString: Boolean,
|
|
482
|
+
symbol: String,
|
|
483
|
+
rules: [Array, Object],
|
|
484
|
+
method: String,
|
|
485
|
+
indexs: {
|
|
615
486
|
type: Number,
|
|
616
487
|
default: null
|
|
617
488
|
},
|
|
618
|
-
|
|
619
|
-
type: String,
|
|
620
|
-
default() {
|
|
621
|
-
return this.form ? '180px' : undefined;
|
|
622
|
-
}
|
|
623
|
-
},
|
|
489
|
+
data: Object,
|
|
624
490
|
optionData: {
|
|
625
491
|
type: Object,
|
|
626
492
|
default() {
|
|
627
493
|
return {};
|
|
628
494
|
}
|
|
629
|
-
},
|
|
630
|
-
form: {
|
|
631
|
-
type: Boolean,
|
|
632
|
-
default: false
|
|
633
495
|
}
|
|
634
496
|
},
|
|
635
497
|
watch: {
|
|
@@ -638,14 +500,106 @@ export default {
|
|
|
638
500
|
handler(val) {
|
|
639
501
|
this.optionDatas = val;
|
|
640
502
|
}
|
|
503
|
+
},
|
|
504
|
+
width: {
|
|
505
|
+
immediate: true,
|
|
506
|
+
handler(val) {
|
|
507
|
+
if (val) {
|
|
508
|
+
this.btnWidth = parseInt(val, 10) + 'px';
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
computed: {
|
|
514
|
+
config() {
|
|
515
|
+
let config = {
|
|
516
|
+
label: this.label || this.title,
|
|
517
|
+
width: this.btnWidth || this.width
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
if (this.type === 'expand') {
|
|
521
|
+
config = { type: this.type, ...config, ...this.$attrs };
|
|
522
|
+
return config;
|
|
523
|
+
}
|
|
524
|
+
let minWidth =
|
|
525
|
+
this.label || this.title
|
|
526
|
+
? (this.label || this.title).length * 14 + 20
|
|
527
|
+
: this.width
|
|
528
|
+
? ''
|
|
529
|
+
: '180px';
|
|
530
|
+
config = {
|
|
531
|
+
...config,
|
|
532
|
+
filterIcon: this.icon,
|
|
533
|
+
sortable: this.sortable || this.sort,
|
|
534
|
+
minWidth: this.minWidth || this.table.minWidth || minWidth,
|
|
535
|
+
className: [
|
|
536
|
+
this.className ? this.className : '',
|
|
537
|
+
this.type ? ' es-table-' + this.type + '-box' : '',
|
|
538
|
+
this.showOverflowTooltip ? ' es-text-ellipsis' : ''
|
|
539
|
+
].join(' '),
|
|
540
|
+
labelClassName: [
|
|
541
|
+
this.labelClassName ? this.labelClassName : '',
|
|
542
|
+
this.required ? 'es-required' : ''
|
|
543
|
+
].join(' '),
|
|
544
|
+
...this.$attrs
|
|
545
|
+
};
|
|
546
|
+
return { ...config, prop: this.field || this.prop, field: this.field };
|
|
547
|
+
},
|
|
548
|
+
formOption() {
|
|
549
|
+
return {
|
|
550
|
+
labelKey: this.sysCode ? 'shortName' : this.labelKey,
|
|
551
|
+
valueKey: this.sysCode ? 'cciValue' : this.valueKey,
|
|
552
|
+
rules: this.rules,
|
|
553
|
+
events: this.events,
|
|
554
|
+
...this.$attrs,
|
|
555
|
+
data: this.option
|
|
556
|
+
};
|
|
557
|
+
},
|
|
558
|
+
icon() {
|
|
559
|
+
if (this.filterIcon === true) {
|
|
560
|
+
return 'es-icon-biao';
|
|
561
|
+
}
|
|
562
|
+
return false;
|
|
563
|
+
},
|
|
564
|
+
isForm() {
|
|
565
|
+
let type = this.type ? this.type.toLowerCase() : '';
|
|
566
|
+
let flag =
|
|
567
|
+
(this.form &&
|
|
568
|
+
[
|
|
569
|
+
'text',
|
|
570
|
+
'textarea',
|
|
571
|
+
'checkbox',
|
|
572
|
+
'radio',
|
|
573
|
+
'select',
|
|
574
|
+
'handle',
|
|
575
|
+
'date',
|
|
576
|
+
'year',
|
|
577
|
+
'month',
|
|
578
|
+
'date',
|
|
579
|
+
'dates',
|
|
580
|
+
'week',
|
|
581
|
+
'datetime',
|
|
582
|
+
'datetimerange',
|
|
583
|
+
'daterange',
|
|
584
|
+
'monthrange',
|
|
585
|
+
'quarter',
|
|
586
|
+
'halfyear',
|
|
587
|
+
'switch',
|
|
588
|
+
'selector',
|
|
589
|
+
'ganged',
|
|
590
|
+
'number'
|
|
591
|
+
].indexOf(type) > -1) ||
|
|
592
|
+
['space', 'slot'].indexOf(type) > -1;
|
|
593
|
+
return flag;
|
|
594
|
+
},
|
|
595
|
+
option() {
|
|
596
|
+
const field = this.field || this.prop;
|
|
597
|
+
return this.data ? this.data : this.optionDatas[this.sysCode || field];
|
|
641
598
|
}
|
|
642
599
|
},
|
|
643
|
-
computed: {},
|
|
644
600
|
data() {
|
|
645
601
|
return {
|
|
646
|
-
|
|
647
|
-
? parseInt(this.item.width, 10) + 'px'
|
|
648
|
-
: undefined,
|
|
602
|
+
btnWidth: '',
|
|
649
603
|
searchs: [],
|
|
650
604
|
optionDatas: this.optionData
|
|
651
605
|
};
|
|
@@ -655,20 +609,20 @@ export default {
|
|
|
655
609
|
init(data, value, item) {
|
|
656
610
|
if (data && value) {
|
|
657
611
|
if (Array.isArray(value) && value.length) {
|
|
658
|
-
if (item.url ||
|
|
612
|
+
if (item.url || this.sysCode) {
|
|
659
613
|
value.forEach(async (val, index) => {
|
|
660
614
|
if (
|
|
661
615
|
val.hasSub == false ||
|
|
662
|
-
this.searchs.indexOf(val[
|
|
616
|
+
this.searchs.indexOf(val[this.valueKey] || val.value) > -1
|
|
663
617
|
) {
|
|
664
618
|
return;
|
|
665
619
|
}
|
|
666
|
-
this.searchs.push(val[
|
|
620
|
+
this.searchs.push(val[this.valueKey] || val.value);
|
|
667
621
|
if ((item.ganged && index < item.ganged - 1) || val.hasSub) {
|
|
668
622
|
let option = data[index + 1];
|
|
669
623
|
let lists = [];
|
|
670
624
|
if (option) {
|
|
671
|
-
let v = val[
|
|
625
|
+
let v = val[this.valueKey] || val.value;
|
|
672
626
|
lists = option.filter((list) => {
|
|
673
627
|
return list[item.filtrateKey] == v;
|
|
674
628
|
});
|
|
@@ -683,13 +637,13 @@ export default {
|
|
|
683
637
|
}
|
|
684
638
|
let params = util.extend(
|
|
685
639
|
true,
|
|
686
|
-
|
|
640
|
+
this.sysCode ? { sysAppCode: this.sysCode } : {},
|
|
687
641
|
item.param ? item.param : {},
|
|
688
642
|
param
|
|
689
643
|
);
|
|
690
644
|
await util
|
|
691
645
|
.ajax({
|
|
692
|
-
url:
|
|
646
|
+
url: this.sysCode ? findSysCode : item.url,
|
|
693
647
|
method: this.method,
|
|
694
648
|
params: params,
|
|
695
649
|
data: params
|
|
@@ -733,16 +687,12 @@ export default {
|
|
|
733
687
|
exclAttribute({ data, attrs }) {
|
|
734
688
|
return util.exclAttribute({ data, attrs });
|
|
735
689
|
},
|
|
736
|
-
format(rows
|
|
737
|
-
const field =
|
|
738
|
-
let data =
|
|
739
|
-
? col.data
|
|
740
|
-
: col.optionData
|
|
741
|
-
? rows[col.optionData]
|
|
742
|
-
: this.optionDatas[field];
|
|
690
|
+
format(rows) {
|
|
691
|
+
const field = this.field || this.prop;
|
|
692
|
+
let data = this.option;
|
|
743
693
|
if (util.isObject(rows[field])) {
|
|
744
694
|
return (
|
|
745
|
-
rows[field][
|
|
695
|
+
rows[field][this.labelKey] ||
|
|
746
696
|
rows[field]['name'] ||
|
|
747
697
|
rows[field]['label'] ||
|
|
748
698
|
rows[field]['shortName']
|
|
@@ -751,95 +701,92 @@ export default {
|
|
|
751
701
|
const vals = rows[field].map((item) => {
|
|
752
702
|
if (util.isObject(item)) {
|
|
753
703
|
return (
|
|
754
|
-
item[
|
|
704
|
+
item[this.labelKey] ||
|
|
755
705
|
item['name'] ||
|
|
756
706
|
item['label'] ||
|
|
757
707
|
item['shortName']
|
|
758
708
|
);
|
|
759
709
|
} else {
|
|
760
710
|
if (data && data.length && util.isObject(data[0])) {
|
|
761
|
-
return this.getLabel(data, item
|
|
711
|
+
return this.getLabel(data, item);
|
|
762
712
|
}
|
|
763
713
|
return item;
|
|
764
714
|
}
|
|
765
715
|
});
|
|
766
|
-
return vals.join(
|
|
716
|
+
return vals.join(this.symbol ? this.symbol : '-');
|
|
767
717
|
} else {
|
|
768
|
-
if (
|
|
718
|
+
if (this.valueToString) {
|
|
769
719
|
const vals = rows[field].split(',').map((item) => {
|
|
770
720
|
if (data && data.length && util.isObject(data[0])) {
|
|
771
|
-
return this.getLabel(data, item
|
|
721
|
+
return this.getLabel(data, item);
|
|
772
722
|
}
|
|
773
723
|
return item;
|
|
774
724
|
});
|
|
775
|
-
return vals.join(
|
|
725
|
+
return vals.join(this.symbol ? this.symbol : '-');
|
|
776
726
|
} else {
|
|
777
727
|
if (data && data.length && util.isObject(data[0])) {
|
|
778
|
-
return this.getLabel(data, rows[field]
|
|
728
|
+
return this.getLabel(data, rows[field]);
|
|
779
729
|
}
|
|
780
730
|
return rows[field];
|
|
781
731
|
}
|
|
782
732
|
}
|
|
783
733
|
},
|
|
784
|
-
getLabel(obj, val
|
|
734
|
+
getLabel(obj, val) {
|
|
785
735
|
for (let i = 0; i < obj.length; i++) {
|
|
786
736
|
let item = obj[i];
|
|
787
|
-
let value = item[
|
|
737
|
+
let value = item[this.valueKey || 'cciValue'] || item['value'];
|
|
788
738
|
if (value == val) {
|
|
789
739
|
return (
|
|
790
|
-
item[
|
|
740
|
+
item[this.labelKey] ||
|
|
791
741
|
item['name'] ||
|
|
792
742
|
item['label'] ||
|
|
793
743
|
item['shortName']
|
|
794
744
|
);
|
|
795
745
|
} else if (item.children && item.children.length) {
|
|
796
|
-
return this.getLabel(item.children, val
|
|
746
|
+
return this.getLabel(item.children, val);
|
|
797
747
|
}
|
|
798
748
|
}
|
|
799
749
|
},
|
|
800
|
-
isReadOnly(
|
|
750
|
+
isReadOnly(scope) {
|
|
801
751
|
return (
|
|
802
752
|
scope.row.canEdit === false ||
|
|
803
753
|
this.readonly ||
|
|
804
|
-
|
|
754
|
+
this.$attrs.editable === false ||
|
|
805
755
|
(scope.row.cantEditKey &&
|
|
806
|
-
scope.row.cantEditKey.indexOf(
|
|
807
|
-
item.readonly
|
|
756
|
+
scope.row.cantEditKey.indexOf(this.field || this.prop) > -1)
|
|
808
757
|
);
|
|
809
758
|
},
|
|
810
|
-
isNotRule(
|
|
759
|
+
isNotRule(scope) {
|
|
811
760
|
if (
|
|
812
761
|
scope.row.canRule === false ||
|
|
813
762
|
(scope.row.notRules &&
|
|
814
|
-
scope.row.notRules.indexOf(
|
|
763
|
+
scope.row.notRules.indexOf(this.field || this.prop) > -1)
|
|
815
764
|
) {
|
|
816
|
-
this.elForm && this.elForm.clearValidate(
|
|
765
|
+
this.elForm && this.elForm.clearValidate(this.field || this.prop);
|
|
817
766
|
return true;
|
|
818
767
|
}
|
|
819
768
|
return false;
|
|
820
769
|
},
|
|
821
770
|
handleBlur(data) {
|
|
822
|
-
|
|
823
|
-
item.events && item.events.blur && item.events.blur(data);
|
|
771
|
+
this.events && this.events.blur && this.events.blur(data);
|
|
824
772
|
this.$emit('formBlur', data);
|
|
825
773
|
},
|
|
826
774
|
handleFocus(data) {
|
|
827
|
-
|
|
828
|
-
item.events && item.events.focus && item.events.focus(data);
|
|
775
|
+
this.events && this.events.focus && this.events.focus(data);
|
|
829
776
|
this.$emit('formFocus', data);
|
|
830
777
|
},
|
|
831
778
|
handleChange(data) {
|
|
832
779
|
let { item } = data;
|
|
833
|
-
if (item &&
|
|
780
|
+
if (item && this.type == 'ganged') {
|
|
834
781
|
let { index, value } = data.value;
|
|
835
782
|
if (
|
|
836
|
-
(item.url ||
|
|
783
|
+
(item.url || this.sysCode) &&
|
|
837
784
|
((item.ganged && index > item.ganged - 1) || value.hasSub)
|
|
838
785
|
) {
|
|
839
|
-
let filte = value[
|
|
786
|
+
let filte = value[this.valueKey] || value.value;
|
|
840
787
|
let datas = [];
|
|
841
|
-
if (this.optionDatas[
|
|
842
|
-
datas = this.optionDatas[
|
|
788
|
+
if (this.optionDatas[this.field || this.prop][index + 1]) {
|
|
789
|
+
datas = this.optionDatas[this.field || this.prop][index + 1].filter(
|
|
843
790
|
(items) => {
|
|
844
791
|
return filte == items[item.filtrateKey];
|
|
845
792
|
}
|
|
@@ -855,13 +802,13 @@ export default {
|
|
|
855
802
|
}
|
|
856
803
|
let params = util.extend(
|
|
857
804
|
true,
|
|
858
|
-
|
|
805
|
+
this.sysCode ? { sysAppCode: this.sysCode } : {},
|
|
859
806
|
item.param ? item.param : {},
|
|
860
807
|
param
|
|
861
808
|
);
|
|
862
809
|
util
|
|
863
810
|
.ajax({
|
|
864
|
-
url:
|
|
811
|
+
url: this.sysCode ? findSysCode : item.url,
|
|
865
812
|
method: this.method,
|
|
866
813
|
params: params,
|
|
867
814
|
data: params
|
|
@@ -869,7 +816,7 @@ export default {
|
|
|
869
816
|
.then((res) => {
|
|
870
817
|
if (res.rCode === 0) {
|
|
871
818
|
let options = JSON.parse(
|
|
872
|
-
JSON.stringify(this.optionDatas[
|
|
819
|
+
JSON.stringify(this.optionDatas[this.sysCode])
|
|
873
820
|
);
|
|
874
821
|
if (options[index + 1]) {
|
|
875
822
|
options[index + 1] = options[index + 1].concat(
|
|
@@ -878,7 +825,7 @@ export default {
|
|
|
878
825
|
} else {
|
|
879
826
|
options.push(JSON.parse(JSON.stringify(res.results)));
|
|
880
827
|
}
|
|
881
|
-
this.$set(this.optionDatas,
|
|
828
|
+
this.$set(this.optionDatas, this.sysCode, options);
|
|
882
829
|
} else {
|
|
883
830
|
let msg = res.msg || '系统错误,请联系管理员!';
|
|
884
831
|
this.$message.error(msg);
|
|
@@ -892,7 +839,7 @@ export default {
|
|
|
892
839
|
}
|
|
893
840
|
}
|
|
894
841
|
}
|
|
895
|
-
|
|
842
|
+
this.events && this.events.change && this.events.change(data);
|
|
896
843
|
this.$emit('formChange', data);
|
|
897
844
|
},
|
|
898
845
|
handleClick(data) {
|