vxe-table 3.10.4 → 3.10.5
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/es/grid/src/grid.js +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +130 -2
- package/es/table/module/custom/panel.js +327 -338
- package/es/table/module/export/export-panel.js +2 -2
- package/es/table/src/methods.js +9 -28
- package/es/table/style.css +42 -37
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +42 -37
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +372 -297
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +176 -2
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +182 -255
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/export-panel.js +2 -2
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/src/methods.js +9 -35
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/style/style.css +42 -37
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +42 -37
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- package/packages/table/module/custom/mixin.ts +131 -2
- package/packages/table/module/custom/panel.ts +332 -337
- package/packages/table/module/export/export-panel.ts +2 -2
- package/packages/table/src/methods.ts +9 -28
- package/styles/components/table-module/custom.scss +21 -5
- /package/es/{iconfont.1730945625063.ttf → iconfont.1730971767552.ttf} +0 -0
- /package/es/{iconfont.1730945625063.woff → iconfont.1730971767552.woff} +0 -0
- /package/es/{iconfont.1730945625063.woff2 → iconfont.1730971767552.woff2} +0 -0
- /package/lib/{iconfont.1730945625063.ttf → iconfont.1730971767552.ttf} +0 -0
- /package/lib/{iconfont.1730945625063.woff → iconfont.1730971767552.woff} +0 -0
- /package/lib/{iconfont.1730945625063.woff2 → iconfont.1730971767552.woff2} +0 -0
|
@@ -21,10 +21,17 @@ function updateDropHint(_vm, evnt) {
|
|
|
21
21
|
}
|
|
22
22
|
const renderSimplePanel = (h, _vm) => {
|
|
23
23
|
const VxeUIButtonComponent = VxeUI.getComponent('VxeButton');
|
|
24
|
-
const
|
|
25
|
-
const {
|
|
24
|
+
const $xeTable = _vm.$xeTable;
|
|
25
|
+
const { _e, customStore, dragColumn } = _vm;
|
|
26
|
+
const { customColumnList, customOpts, isMaxFixedColumn } = $xeTable;
|
|
26
27
|
const { maxHeight } = customStore;
|
|
27
28
|
const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts;
|
|
29
|
+
const slots = customOpts.slots || {};
|
|
30
|
+
const headerSlot = slots.header;
|
|
31
|
+
const topSlot = slots.top;
|
|
32
|
+
const bottomSlot = slots.bottom;
|
|
33
|
+
const defaultSlot = slots.default;
|
|
34
|
+
const footerSlot = slots.footer;
|
|
28
35
|
const colVNs = [];
|
|
29
36
|
const customWrapperOns = {};
|
|
30
37
|
// hover 触发
|
|
@@ -32,6 +39,15 @@ const renderSimplePanel = (h, _vm) => {
|
|
|
32
39
|
customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
|
|
33
40
|
customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
|
|
34
41
|
}
|
|
42
|
+
const isAllChecked = customStore.isAll;
|
|
43
|
+
const isAllIndeterminate = customStore.isIndeterminate;
|
|
44
|
+
const params = {
|
|
45
|
+
$table: $xeTable,
|
|
46
|
+
$grid: $xeTable.xegrid,
|
|
47
|
+
columns: customColumnList,
|
|
48
|
+
isAllChecked,
|
|
49
|
+
isAllIndeterminate
|
|
50
|
+
};
|
|
35
51
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
36
52
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true;
|
|
37
53
|
if (isVisible) {
|
|
@@ -155,8 +171,6 @@ const renderSimplePanel = (h, _vm) => {
|
|
|
155
171
|
]));
|
|
156
172
|
}
|
|
157
173
|
});
|
|
158
|
-
const isAllChecked = customStore.isAll;
|
|
159
|
-
const isAllIndeterminate = customStore.isIndeterminate;
|
|
160
174
|
return h('div', {
|
|
161
175
|
key: 'simple',
|
|
162
176
|
class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
|
|
@@ -169,49 +183,69 @@ const renderSimplePanel = (h, _vm) => {
|
|
|
169
183
|
: {}
|
|
170
184
|
}, customStore.visible
|
|
171
185
|
? [
|
|
172
|
-
h('
|
|
186
|
+
h('div', {
|
|
173
187
|
class: 'vxe-table-custom--header'
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
'is--indeterminate': isAllIndeterminate
|
|
183
|
-
}],
|
|
184
|
-
attrs: {
|
|
185
|
-
title: getI18n('vxe.table.allTitle')
|
|
186
|
-
},
|
|
187
|
-
on: {
|
|
188
|
-
click: _vm.allOptionEvent
|
|
189
|
-
}
|
|
188
|
+
}, headerSlot
|
|
189
|
+
? $xeTable.callSlot(headerSlot, params, h)
|
|
190
|
+
: [
|
|
191
|
+
h('ul', {
|
|
192
|
+
class: 'vxe-table-custom--panel-list'
|
|
193
|
+
}, [
|
|
194
|
+
h('li', {
|
|
195
|
+
class: 'vxe-table-custom--option'
|
|
190
196
|
}, [
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
+
allowVisible
|
|
198
|
+
? h('div', {
|
|
199
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
200
|
+
'is--checked': isAllChecked,
|
|
201
|
+
'is--indeterminate': isAllIndeterminate
|
|
202
|
+
}],
|
|
203
|
+
attrs: {
|
|
204
|
+
title: getI18n('vxe.table.allTitle')
|
|
205
|
+
},
|
|
206
|
+
on: {
|
|
207
|
+
click: _vm.allOptionEvent
|
|
208
|
+
}
|
|
209
|
+
}, [
|
|
210
|
+
h('span', {
|
|
211
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
212
|
+
}),
|
|
213
|
+
h('span', {
|
|
214
|
+
class: 'vxe-checkbox--label'
|
|
215
|
+
}, getI18n('vxe.toolbar.customAll'))
|
|
216
|
+
])
|
|
217
|
+
: h('span', {
|
|
218
|
+
class: 'vxe-checkbox--label'
|
|
219
|
+
}, getI18n('vxe.table.customTitle'))
|
|
197
220
|
])
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}, getI18n('vxe.table.customTitle'))
|
|
201
|
-
])
|
|
202
|
-
]),
|
|
221
|
+
])
|
|
222
|
+
]),
|
|
203
223
|
h('div', {
|
|
204
224
|
ref: 'bodyElemRef',
|
|
205
|
-
class: 'vxe-table-custom--
|
|
225
|
+
class: 'vxe-table-custom--body'
|
|
206
226
|
}, [
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
227
|
+
topSlot
|
|
228
|
+
? h('div', {
|
|
229
|
+
class: 'vxe-table-custom--panel-top'
|
|
230
|
+
}, $xeTable.callSlot(topSlot, params, h))
|
|
231
|
+
: renderEmptyElement($xeTable),
|
|
232
|
+
defaultSlot
|
|
233
|
+
? h('div', {
|
|
234
|
+
class: 'vxe-table-custom--panel-body'
|
|
235
|
+
}, $xeTable.callSlot(defaultSlot, params, h))
|
|
236
|
+
: h('transition-group', {
|
|
237
|
+
class: 'vxe-table-custom--panel-list',
|
|
238
|
+
props: {
|
|
239
|
+
name: 'vxe-table-custom--list',
|
|
240
|
+
tag: 'ul'
|
|
241
|
+
},
|
|
242
|
+
on: customWrapperOns
|
|
243
|
+
}, colVNs),
|
|
244
|
+
bottomSlot
|
|
245
|
+
? h('div', {
|
|
246
|
+
class: 'vxe-table-custom--panel-bottom'
|
|
247
|
+
}, $xeTable.callSlot(bottomSlot, params, h))
|
|
248
|
+
: renderEmptyElement($xeTable),
|
|
215
249
|
h('div', {
|
|
216
250
|
ref: 'dragHintElemRef',
|
|
217
251
|
class: 'vxe-table-custom-popup--drag-hint'
|
|
@@ -220,48 +254,54 @@ const renderSimplePanel = (h, _vm) => {
|
|
|
220
254
|
customOpts.showFooter
|
|
221
255
|
? h('div', {
|
|
222
256
|
class: 'vxe-table-custom--footer'
|
|
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
|
-
|
|
257
|
+
}, footerSlot
|
|
258
|
+
? $xeTable.callSlot(footerSlot, params, h)
|
|
259
|
+
: [
|
|
260
|
+
h('div', {
|
|
261
|
+
class: 'vxe-table-custom--footer-buttons'
|
|
262
|
+
}, [
|
|
263
|
+
h(VxeUIButtonComponent, {
|
|
264
|
+
props: {
|
|
265
|
+
mode: 'text',
|
|
266
|
+
content: customOpts.resetButtonText || getI18n('vxe.table.customRestore')
|
|
267
|
+
},
|
|
268
|
+
on: {
|
|
269
|
+
click: _vm.resetCustomEvent
|
|
270
|
+
}
|
|
271
|
+
}),
|
|
272
|
+
customOpts.immediate
|
|
273
|
+
? h(VxeUIButtonComponent, {
|
|
274
|
+
props: {
|
|
275
|
+
mode: 'text',
|
|
276
|
+
content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
|
|
277
|
+
},
|
|
278
|
+
on: {
|
|
279
|
+
click: _vm.cancelCloseEvent
|
|
280
|
+
}
|
|
281
|
+
})
|
|
282
|
+
: h(VxeUIButtonComponent, {
|
|
283
|
+
props: {
|
|
284
|
+
mode: 'text',
|
|
285
|
+
content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
|
|
286
|
+
},
|
|
287
|
+
on: {
|
|
288
|
+
click: _vm.cancelCustomEvent
|
|
289
|
+
}
|
|
290
|
+
}),
|
|
291
|
+
customOpts.immediate
|
|
292
|
+
? _e()
|
|
293
|
+
: h(VxeUIButtonComponent, {
|
|
294
|
+
props: {
|
|
295
|
+
mode: 'text',
|
|
296
|
+
status: 'primary',
|
|
297
|
+
content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
|
|
298
|
+
},
|
|
299
|
+
on: {
|
|
300
|
+
click: _vm.confirmCustomEvent
|
|
301
|
+
}
|
|
302
|
+
})
|
|
303
|
+
])
|
|
304
|
+
])
|
|
265
305
|
: null
|
|
266
306
|
]
|
|
267
307
|
: []);
|
|
@@ -272,12 +312,28 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
272
312
|
const VxeUIInputComponent = VxeUI.getComponent('VxeInput');
|
|
273
313
|
const VxeUITooltipComponent = VxeUI.getComponent('VxeTooltip');
|
|
274
314
|
const $xeTableCustomPanel = _vm;
|
|
275
|
-
const
|
|
276
|
-
const {
|
|
315
|
+
const $xeTable = _vm.$xeTable;
|
|
316
|
+
const { _e, customStore } = _vm;
|
|
317
|
+
const { customOpts, customColumnList, columnOpts, isMaxFixedColumn } = $xeTable;
|
|
277
318
|
const { modalOptions, allowVisible, allowSort, allowFixed, allowResizable, checkMethod, visibleMethod } = customOpts;
|
|
278
319
|
const { maxFixedSize } = columnOpts;
|
|
279
320
|
const modalOpts = Object.assign({}, modalOptions);
|
|
321
|
+
const slots = customOpts.slots || {};
|
|
322
|
+
const headerSlot = slots.header;
|
|
323
|
+
const topSlot = slots.top;
|
|
324
|
+
const bottomSlot = slots.bottom;
|
|
325
|
+
const defaultSlot = slots.default;
|
|
326
|
+
const footerSlot = slots.footer;
|
|
280
327
|
const trVNs = [];
|
|
328
|
+
const isAllChecked = customStore.isAll;
|
|
329
|
+
const isAllIndeterminate = customStore.isIndeterminate;
|
|
330
|
+
const params = {
|
|
331
|
+
$table: $xeTable,
|
|
332
|
+
$grid: $xeTable.xegrid,
|
|
333
|
+
columns: customColumnList,
|
|
334
|
+
isAllChecked,
|
|
335
|
+
isAllIndeterminate
|
|
336
|
+
};
|
|
281
337
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
282
338
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true;
|
|
283
339
|
if (isVisible) {
|
|
@@ -424,8 +480,164 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
424
480
|
]));
|
|
425
481
|
}
|
|
426
482
|
});
|
|
427
|
-
const
|
|
428
|
-
|
|
483
|
+
const scopedSlots = {
|
|
484
|
+
default: () => {
|
|
485
|
+
if (defaultSlot) {
|
|
486
|
+
return $xeTable.callSlot(defaultSlot, params, h);
|
|
487
|
+
}
|
|
488
|
+
return h('div', {
|
|
489
|
+
ref: 'bodyElemRef',
|
|
490
|
+
class: 'vxe-table-custom-popup--body'
|
|
491
|
+
}, [
|
|
492
|
+
topSlot
|
|
493
|
+
? h('div', {
|
|
494
|
+
class: 'vxe-table-custom-popup--table-top'
|
|
495
|
+
}, $xeTable.callSlot(topSlot, params, h))
|
|
496
|
+
: renderEmptyElement($xeTable),
|
|
497
|
+
h('div', {
|
|
498
|
+
class: 'vxe-table-custom-popup--table-wrapper'
|
|
499
|
+
}, [
|
|
500
|
+
h('table', {}, [
|
|
501
|
+
h('colgroup', {}, [
|
|
502
|
+
allowVisible
|
|
503
|
+
? h('col', {
|
|
504
|
+
class: 'vxe-table-custom-popup--table-col-seq'
|
|
505
|
+
})
|
|
506
|
+
: _e(),
|
|
507
|
+
allowSort
|
|
508
|
+
? h('col', {
|
|
509
|
+
class: 'vxe-table-custom-popup--table-col-sort'
|
|
510
|
+
})
|
|
511
|
+
: _e(),
|
|
512
|
+
h('col', {
|
|
513
|
+
class: 'vxe-table-custom-popup--table-col-title'
|
|
514
|
+
}),
|
|
515
|
+
allowResizable
|
|
516
|
+
? h('col', {
|
|
517
|
+
class: 'vxe-table-custom-popup--table-col-width'
|
|
518
|
+
})
|
|
519
|
+
: _e(),
|
|
520
|
+
allowFixed
|
|
521
|
+
? h('col', {
|
|
522
|
+
class: 'vxe-table-custom-popup--table-col-fixed'
|
|
523
|
+
})
|
|
524
|
+
: _e()
|
|
525
|
+
]),
|
|
526
|
+
h('thead', {}, [
|
|
527
|
+
h('tr', {}, [
|
|
528
|
+
allowVisible
|
|
529
|
+
? h('th', {}, [
|
|
530
|
+
h('div', {
|
|
531
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
532
|
+
'is--checked': isAllChecked,
|
|
533
|
+
'is--indeterminate': isAllIndeterminate
|
|
534
|
+
}],
|
|
535
|
+
attrs: {
|
|
536
|
+
title: getI18n('vxe.table.allTitle')
|
|
537
|
+
},
|
|
538
|
+
on: {
|
|
539
|
+
click: _vm.allOptionEvent
|
|
540
|
+
}
|
|
541
|
+
}, [
|
|
542
|
+
h('span', {
|
|
543
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
544
|
+
}),
|
|
545
|
+
h('span', {
|
|
546
|
+
class: 'vxe-checkbox--label'
|
|
547
|
+
}, getI18n('vxe.toolbar.customAll'))
|
|
548
|
+
])
|
|
549
|
+
])
|
|
550
|
+
: _e(),
|
|
551
|
+
allowSort
|
|
552
|
+
? h('th', {}, [
|
|
553
|
+
h('span', {
|
|
554
|
+
class: 'vxe-table-custom-popup--table-sort-help-title'
|
|
555
|
+
}, getI18n('vxe.custom.setting.colSort')),
|
|
556
|
+
VxeUITooltipComponent
|
|
557
|
+
? h(VxeUITooltipComponent, {
|
|
558
|
+
props: {
|
|
559
|
+
enterable: true,
|
|
560
|
+
content: getI18n('vxe.custom.setting.sortHelpTip'),
|
|
561
|
+
popupClassName: 'vxe-table--ignore-clear'
|
|
562
|
+
},
|
|
563
|
+
scopedSlots: {
|
|
564
|
+
default: () => {
|
|
565
|
+
return h('i', {
|
|
566
|
+
class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
})
|
|
571
|
+
: renderEmptyElement($xeTableCustomPanel)
|
|
572
|
+
])
|
|
573
|
+
: _e(),
|
|
574
|
+
h('th', {}, getI18n('vxe.custom.setting.colTitle')),
|
|
575
|
+
allowResizable
|
|
576
|
+
? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
|
|
577
|
+
: _e(),
|
|
578
|
+
allowFixed
|
|
579
|
+
? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
|
|
580
|
+
: _e()
|
|
581
|
+
])
|
|
582
|
+
]),
|
|
583
|
+
h('transition-group', {
|
|
584
|
+
class: 'vxe-table-custom--panel-list',
|
|
585
|
+
props: {
|
|
586
|
+
tag: 'tbody',
|
|
587
|
+
name: 'vxe-table-custom--list'
|
|
588
|
+
}
|
|
589
|
+
}, trVNs)
|
|
590
|
+
])
|
|
591
|
+
]),
|
|
592
|
+
bottomSlot
|
|
593
|
+
? h('div', {
|
|
594
|
+
class: 'vxe-table-custom-popup--table-bottom'
|
|
595
|
+
}, $xeTable.callSlot(bottomSlot, params, h))
|
|
596
|
+
: renderEmptyElement($xeTable),
|
|
597
|
+
h('div', {
|
|
598
|
+
ref: 'dragHintElemRef',
|
|
599
|
+
class: 'vxe-table-custom-popup--drag-hint'
|
|
600
|
+
}, getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))
|
|
601
|
+
]);
|
|
602
|
+
},
|
|
603
|
+
footer: () => {
|
|
604
|
+
if (footerSlot) {
|
|
605
|
+
return $xeTable.callSlot(footerSlot, params, h);
|
|
606
|
+
}
|
|
607
|
+
return h('div', {
|
|
608
|
+
class: 'vxe-table-custom-popup--footer'
|
|
609
|
+
}, [
|
|
610
|
+
h(VxeUIButtonComponent, {
|
|
611
|
+
props: {
|
|
612
|
+
content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore')
|
|
613
|
+
},
|
|
614
|
+
on: {
|
|
615
|
+
click: _vm.resetCustomEvent
|
|
616
|
+
}
|
|
617
|
+
}),
|
|
618
|
+
h(VxeUIButtonComponent, {
|
|
619
|
+
props: {
|
|
620
|
+
content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
|
|
621
|
+
},
|
|
622
|
+
on: {
|
|
623
|
+
click: _vm.cancelCustomEvent
|
|
624
|
+
}
|
|
625
|
+
}),
|
|
626
|
+
h(VxeUIButtonComponent, {
|
|
627
|
+
props: {
|
|
628
|
+
status: 'primary',
|
|
629
|
+
content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
|
|
630
|
+
},
|
|
631
|
+
on: {
|
|
632
|
+
click: _vm.confirmCustomEvent
|
|
633
|
+
}
|
|
634
|
+
})
|
|
635
|
+
]);
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
if (headerSlot) {
|
|
639
|
+
scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h);
|
|
640
|
+
}
|
|
429
641
|
return VxeUIModalComponent
|
|
430
642
|
? h(VxeUIModalComponent, {
|
|
431
643
|
key: 'modal',
|
|
@@ -437,10 +649,12 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
437
649
|
minWidth: modalOpts.minWidth || 700,
|
|
438
650
|
height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
|
|
439
651
|
minHeight: modalOpts.minHeight || 400,
|
|
440
|
-
showZoom:
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
652
|
+
showZoom: modalOpts.showZoom,
|
|
653
|
+
showMaximize: modalOpts.showMaximize,
|
|
654
|
+
showMinimize: modalOpts.showMinimize,
|
|
655
|
+
mask: modalOpts.mask,
|
|
656
|
+
lockView: modalOpts.lockView,
|
|
657
|
+
resize: modalOpts.resize,
|
|
444
658
|
escClosable: !!modalOpts.escClosable,
|
|
445
659
|
destroyOnClose: true,
|
|
446
660
|
showFooter: true
|
|
@@ -450,155 +664,7 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
450
664
|
customStore.visible = value;
|
|
451
665
|
}
|
|
452
666
|
},
|
|
453
|
-
scopedSlots
|
|
454
|
-
default: () => {
|
|
455
|
-
return h('div', {
|
|
456
|
-
ref: 'bodyElemRef',
|
|
457
|
-
class: 'vxe-table-custom-popup--body'
|
|
458
|
-
}, [
|
|
459
|
-
h('div', {
|
|
460
|
-
class: 'vxe-table-custom-popup--table-wrapper'
|
|
461
|
-
}, [
|
|
462
|
-
h('table', {}, [
|
|
463
|
-
h('colgroup', {}, [
|
|
464
|
-
allowVisible
|
|
465
|
-
? h('col', {
|
|
466
|
-
style: {
|
|
467
|
-
width: '80px'
|
|
468
|
-
}
|
|
469
|
-
})
|
|
470
|
-
: _e(),
|
|
471
|
-
allowSort
|
|
472
|
-
? h('col', {
|
|
473
|
-
style: {
|
|
474
|
-
width: '80px'
|
|
475
|
-
}
|
|
476
|
-
})
|
|
477
|
-
: _e(),
|
|
478
|
-
h('col', {
|
|
479
|
-
style: {
|
|
480
|
-
minWidth: '120px'
|
|
481
|
-
}
|
|
482
|
-
}),
|
|
483
|
-
allowResizable
|
|
484
|
-
? h('col', {
|
|
485
|
-
style: {
|
|
486
|
-
width: '140px'
|
|
487
|
-
}
|
|
488
|
-
})
|
|
489
|
-
: _e(),
|
|
490
|
-
allowFixed
|
|
491
|
-
? h('col', {
|
|
492
|
-
style: {
|
|
493
|
-
width: '200px'
|
|
494
|
-
}
|
|
495
|
-
})
|
|
496
|
-
: _e()
|
|
497
|
-
]),
|
|
498
|
-
h('thead', {}, [
|
|
499
|
-
h('tr', {}, [
|
|
500
|
-
allowVisible
|
|
501
|
-
? h('th', {}, [
|
|
502
|
-
h('div', {
|
|
503
|
-
class: ['vxe-table-custom--checkbox-option', {
|
|
504
|
-
'is--checked': isAllChecked,
|
|
505
|
-
'is--indeterminate': isAllIndeterminate
|
|
506
|
-
}],
|
|
507
|
-
attrs: {
|
|
508
|
-
title: getI18n('vxe.table.allTitle')
|
|
509
|
-
},
|
|
510
|
-
on: {
|
|
511
|
-
click: _vm.allOptionEvent
|
|
512
|
-
}
|
|
513
|
-
}, [
|
|
514
|
-
h('span', {
|
|
515
|
-
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
516
|
-
}),
|
|
517
|
-
h('span', {
|
|
518
|
-
class: 'vxe-checkbox--label'
|
|
519
|
-
}, getI18n('vxe.toolbar.customAll'))
|
|
520
|
-
])
|
|
521
|
-
])
|
|
522
|
-
: _e(),
|
|
523
|
-
allowSort
|
|
524
|
-
? h('th', {}, [
|
|
525
|
-
h('span', {
|
|
526
|
-
class: 'vxe-table-custom-popup--table-sort-help-title'
|
|
527
|
-
}, getI18n('vxe.custom.setting.colSort')),
|
|
528
|
-
VxeUITooltipComponent
|
|
529
|
-
? h(VxeUITooltipComponent, {
|
|
530
|
-
props: {
|
|
531
|
-
enterable: true,
|
|
532
|
-
content: getI18n('vxe.custom.setting.sortHelpTip'),
|
|
533
|
-
popupClassName: 'vxe-table--ignore-clear'
|
|
534
|
-
},
|
|
535
|
-
scopedSlots: {
|
|
536
|
-
default: () => {
|
|
537
|
-
return h('i', {
|
|
538
|
-
class: 'vxe-table-custom-popup--table-sort-help-icon vxe-icon-question-circle-fill'
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
})
|
|
543
|
-
: renderEmptyElement($xeTableCustomPanel)
|
|
544
|
-
])
|
|
545
|
-
: _e(),
|
|
546
|
-
h('th', {}, getI18n('vxe.custom.setting.colTitle')),
|
|
547
|
-
allowResizable
|
|
548
|
-
? h('th', {}, getI18n('vxe.custom.setting.colResizable'))
|
|
549
|
-
: _e(),
|
|
550
|
-
allowFixed
|
|
551
|
-
? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize]))
|
|
552
|
-
: _e()
|
|
553
|
-
])
|
|
554
|
-
]),
|
|
555
|
-
h('transition-group', {
|
|
556
|
-
class: 'vxe-table-custom--body',
|
|
557
|
-
props: {
|
|
558
|
-
tag: 'tbody',
|
|
559
|
-
name: 'vxe-table-custom--list'
|
|
560
|
-
}
|
|
561
|
-
}, trVNs)
|
|
562
|
-
])
|
|
563
|
-
]),
|
|
564
|
-
h('div', {
|
|
565
|
-
ref: 'dragHintElemRef',
|
|
566
|
-
class: 'vxe-table-custom-popup--drag-hint'
|
|
567
|
-
}, getI18n('vxe.custom.cstmDragTarget', [_vm.dragColumn ? _vm.dragColumn.getTitle() : '']))
|
|
568
|
-
]);
|
|
569
|
-
},
|
|
570
|
-
footer: () => {
|
|
571
|
-
return h('div', {
|
|
572
|
-
class: 'vxe-table-custom-popup--footer'
|
|
573
|
-
}, [
|
|
574
|
-
h(VxeUIButtonComponent, {
|
|
575
|
-
props: {
|
|
576
|
-
content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore')
|
|
577
|
-
},
|
|
578
|
-
on: {
|
|
579
|
-
click: _vm.resetCustomEvent
|
|
580
|
-
}
|
|
581
|
-
}),
|
|
582
|
-
h(VxeUIButtonComponent, {
|
|
583
|
-
props: {
|
|
584
|
-
content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
|
|
585
|
-
},
|
|
586
|
-
on: {
|
|
587
|
-
click: _vm.cancelCustomEvent
|
|
588
|
-
}
|
|
589
|
-
}),
|
|
590
|
-
h(VxeUIButtonComponent, {
|
|
591
|
-
props: {
|
|
592
|
-
status: 'primary',
|
|
593
|
-
content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
|
|
594
|
-
},
|
|
595
|
-
on: {
|
|
596
|
-
click: _vm.confirmCustomEvent
|
|
597
|
-
}
|
|
598
|
-
})
|
|
599
|
-
]);
|
|
600
|
-
}
|
|
601
|
-
}
|
|
667
|
+
scopedSlots
|
|
602
668
|
})
|
|
603
669
|
: renderEmptyElement($xeTableCustomPanel);
|
|
604
670
|
};
|
|
@@ -611,6 +677,9 @@ export default {
|
|
|
611
677
|
}
|
|
612
678
|
},
|
|
613
679
|
inject: {
|
|
680
|
+
$xeTable: {
|
|
681
|
+
default: null
|
|
682
|
+
},
|
|
614
683
|
$xetable: {
|
|
615
684
|
default: null
|
|
616
685
|
}
|
|
@@ -673,82 +742,33 @@ export default {
|
|
|
673
742
|
customStore.activeWrapper = false;
|
|
674
743
|
setTimeout(() => {
|
|
675
744
|
if (!customStore.activeBtn && !customStore.activeWrapper) {
|
|
676
|
-
$xetable.
|
|
745
|
+
$xetable.customCloseEvent(evnt);
|
|
677
746
|
}
|
|
678
747
|
}, 300);
|
|
679
748
|
},
|
|
680
749
|
getStoreData() {
|
|
681
750
|
return {};
|
|
682
751
|
},
|
|
683
|
-
confirmCustomEvent(
|
|
684
|
-
const
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
if (parent) {
|
|
689
|
-
// 更新子列信息
|
|
690
|
-
column.fixed = parent.fixed;
|
|
691
|
-
}
|
|
692
|
-
else {
|
|
693
|
-
if (allowSort) {
|
|
694
|
-
const sortIndex = index + 1;
|
|
695
|
-
column.renderSortNumber = sortIndex;
|
|
696
|
-
}
|
|
697
|
-
if (allowFixed) {
|
|
698
|
-
column.fixed = column.renderFixed;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
if (allowResizable) {
|
|
702
|
-
if (column.renderVisible && (!column.children || column.children.length)) {
|
|
703
|
-
if (column.renderResizeWidth !== column.renderWidth) {
|
|
704
|
-
column.resizeWidth = column.renderResizeWidth;
|
|
705
|
-
column.renderWidth = column.renderResizeWidth;
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
if (allowVisible) {
|
|
710
|
-
column.visible = column.renderVisible;
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
$xetable.closeCustom();
|
|
714
|
-
$xetable.emitCustomEvent('confirm', evnt);
|
|
715
|
-
$xetable.saveCustomStore('confirm');
|
|
752
|
+
confirmCustomEvent({ $event }) {
|
|
753
|
+
const $xeTable = this.$xeTable;
|
|
754
|
+
$xeTable.saveCustom();
|
|
755
|
+
$xeTable.closeCustom();
|
|
756
|
+
$xeTable.emitCustomEvent('confirm', $event);
|
|
716
757
|
},
|
|
717
758
|
cancelCloseEvent({ $event }) {
|
|
718
|
-
const
|
|
719
|
-
$
|
|
720
|
-
$
|
|
759
|
+
const $xeTable = this.$xeTable;
|
|
760
|
+
$xeTable.closeCustom();
|
|
761
|
+
$xeTable.emitCustomEvent('close', $event);
|
|
721
762
|
},
|
|
722
|
-
cancelCustomEvent(
|
|
723
|
-
const
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
XEUtils.eachTree(customColumnList, column => {
|
|
728
|
-
const colid = column.getKey();
|
|
729
|
-
const visible = !!oldVisibleMaps[colid];
|
|
730
|
-
const fixed = oldFixedMaps[colid] || '';
|
|
731
|
-
if (allowVisible) {
|
|
732
|
-
column.renderVisible = visible;
|
|
733
|
-
column.visible = visible;
|
|
734
|
-
}
|
|
735
|
-
if (allowFixed) {
|
|
736
|
-
column.renderFixed = fixed;
|
|
737
|
-
column.fixed = fixed;
|
|
738
|
-
}
|
|
739
|
-
if (allowSort) {
|
|
740
|
-
column.renderSortNumber = oldSortMaps[colid] || 0;
|
|
741
|
-
}
|
|
742
|
-
if (allowResizable) {
|
|
743
|
-
column.renderResizeWidth = column.renderWidth;
|
|
744
|
-
}
|
|
745
|
-
}, { children: 'children' });
|
|
746
|
-
$xetable.closeCustom();
|
|
747
|
-
$xetable.emitCustomEvent('cancel', evnt);
|
|
763
|
+
cancelCustomEvent({ $event }) {
|
|
764
|
+
const $xeTable = this.$xeTable;
|
|
765
|
+
$xeTable.cancelCustom();
|
|
766
|
+
$xeTable.closeCustom();
|
|
767
|
+
$xeTable.emitCustomEvent('cancel', $event);
|
|
748
768
|
},
|
|
749
769
|
handleResetCustomEvent(evnt) {
|
|
750
770
|
const { $xetable } = this;
|
|
751
|
-
$xetable.
|
|
771
|
+
$xetable.resetCustom(true);
|
|
752
772
|
$xetable.closeCustom();
|
|
753
773
|
$xetable.emitCustomEvent('reset', evnt);
|
|
754
774
|
},
|
|
@@ -856,40 +876,8 @@ export default {
|
|
|
856
876
|
}
|
|
857
877
|
},
|
|
858
878
|
allOptionEvent() {
|
|
859
|
-
const { $xetable
|
|
860
|
-
|
|
861
|
-
const { checkMethod, visibleMethod } = customOpts;
|
|
862
|
-
const isAll = !customStore.isAll;
|
|
863
|
-
if (customOpts.immediate) {
|
|
864
|
-
XEUtils.eachTree(customColumnList, (column) => {
|
|
865
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
866
|
-
return;
|
|
867
|
-
}
|
|
868
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
869
|
-
return;
|
|
870
|
-
}
|
|
871
|
-
column.visible = isAll;
|
|
872
|
-
column.renderVisible = isAll;
|
|
873
|
-
column.halfVisible = false;
|
|
874
|
-
});
|
|
875
|
-
customStore.isAll = isAll;
|
|
876
|
-
$xetable.handleCustom();
|
|
877
|
-
$xetable.saveCustomStore('update:visible');
|
|
878
|
-
}
|
|
879
|
-
else {
|
|
880
|
-
XEUtils.eachTree(customColumnList, (column) => {
|
|
881
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
882
|
-
return;
|
|
883
|
-
}
|
|
884
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
885
|
-
return;
|
|
886
|
-
}
|
|
887
|
-
column.renderVisible = isAll;
|
|
888
|
-
column.halfVisible = false;
|
|
889
|
-
});
|
|
890
|
-
customStore.isAll = isAll;
|
|
891
|
-
}
|
|
892
|
-
$xetable.checkCustomStatus();
|
|
879
|
+
const { $xetable } = this;
|
|
880
|
+
$xetable.toggleCustomAllCheckbox();
|
|
893
881
|
},
|
|
894
882
|
sortMousedownEvent(evnt) {
|
|
895
883
|
const { $xetable } = this;
|
|
@@ -901,6 +889,7 @@ export default {
|
|
|
901
889
|
trEl.draggable = true;
|
|
902
890
|
this.dragColumn = column;
|
|
903
891
|
addClass(trEl, 'active--drag-origin');
|
|
892
|
+
updateDropHint(this, evnt);
|
|
904
893
|
},
|
|
905
894
|
sortMouseupEvent(evnt) {
|
|
906
895
|
const btnEl = evnt.currentTarget;
|