vxe-table 4.8.2 → 4.8.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/README.md +12 -12
- 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/hook.js +135 -3
- package/es/table/module/custom/panel.js +151 -175
- package/es/table/src/cell.js +2 -2
- package/es/table/src/table.js +8 -28
- package/es/table/style.css +42 -37
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +2 -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 +268 -198
- 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/hook.js +177 -3
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +77 -157
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/src/cell.js +2 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/table.js +8 -34
- package/lib/table/src/table.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 +2 -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/hook.ts +136 -3
- package/packages/table/module/custom/panel.ts +157 -179
- package/packages/table/src/cell.ts +2 -2
- package/packages/table/src/table.ts +8 -28
- package/packages/ui/index.ts +1 -0
- package/styles/components/table-module/custom.scss +21 -5
- /package/es/{iconfont.1730898232530.ttf → iconfont.1730971754265.ttf} +0 -0
- /package/es/{iconfont.1730898232530.woff → iconfont.1730971754265.woff} +0 -0
- /package/es/{iconfont.1730898232530.woff2 → iconfont.1730971754265.woff2} +0 -0
- /package/lib/{iconfont.1730898232530.ttf → iconfont.1730971754265.ttf} +0 -0
- /package/lib/{iconfont.1730898232530.woff → iconfont.1730971754265.woff} +0 -0
- /package/lib/{iconfont.1730898232530.woff2 → iconfont.1730971754265.woff2} +0 -0
|
@@ -4,7 +4,7 @@ import { formatText } from '../../../ui/src/utils';
|
|
|
4
4
|
import { addClass, removeClass } from '../../../ui/src/dom';
|
|
5
5
|
import { errLog } from '../../../ui/src/log';
|
|
6
6
|
import XEUtils from 'xe-utils';
|
|
7
|
-
const { getI18n, getIcon } = VxeUI;
|
|
7
|
+
const { getI18n, getIcon, renderEmptyElement } = VxeUI;
|
|
8
8
|
export default defineComponent({
|
|
9
9
|
name: 'TableCustomPanel',
|
|
10
10
|
props: {
|
|
@@ -43,73 +43,21 @@ export default defineComponent({
|
|
|
43
43
|
}, 300);
|
|
44
44
|
};
|
|
45
45
|
const confirmCustomEvent = ({ $event }) => {
|
|
46
|
-
|
|
47
|
-
const customOpts = computeCustomOpts.value;
|
|
48
|
-
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts;
|
|
49
|
-
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
50
|
-
if (parent) {
|
|
51
|
-
// 更新子列信息
|
|
52
|
-
column.fixed = parent.fixed;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
if (allowSort) {
|
|
56
|
-
const sortIndex = index + 1;
|
|
57
|
-
column.renderSortNumber = sortIndex;
|
|
58
|
-
}
|
|
59
|
-
if (allowFixed) {
|
|
60
|
-
column.fixed = column.renderFixed;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (allowResizable) {
|
|
64
|
-
if (column.renderVisible && (!column.children || column.children.length)) {
|
|
65
|
-
if (column.renderResizeWidth !== column.renderWidth) {
|
|
66
|
-
column.resizeWidth = column.renderResizeWidth;
|
|
67
|
-
column.renderWidth = column.renderResizeWidth;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (allowVisible) {
|
|
72
|
-
column.visible = column.renderVisible;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
46
|
+
$xeTable.saveCustom();
|
|
75
47
|
$xeTable.closeCustom();
|
|
76
48
|
$xeTable.emitCustomEvent('confirm', $event);
|
|
77
|
-
$xeTable.saveCustomStore('confirm');
|
|
78
49
|
};
|
|
79
50
|
const cancelCloseEvent = ({ $event }) => {
|
|
80
51
|
$xeTable.closeCustom();
|
|
81
52
|
$xeTable.emitCustomEvent('close', $event);
|
|
82
53
|
};
|
|
83
54
|
const cancelCustomEvent = ({ $event }) => {
|
|
84
|
-
|
|
85
|
-
const { customColumnList } = reactData;
|
|
86
|
-
const { oldSortMaps, oldFixedMaps, oldVisibleMaps } = customStore;
|
|
87
|
-
const customOpts = computeCustomOpts.value;
|
|
88
|
-
const { allowVisible, allowSort, allowFixed, allowResizable } = customOpts;
|
|
89
|
-
XEUtils.eachTree(customColumnList, column => {
|
|
90
|
-
const colid = column.getKey();
|
|
91
|
-
const visible = !!oldVisibleMaps[colid];
|
|
92
|
-
const fixed = oldFixedMaps[colid] || '';
|
|
93
|
-
if (allowVisible) {
|
|
94
|
-
column.renderVisible = visible;
|
|
95
|
-
column.visible = visible;
|
|
96
|
-
}
|
|
97
|
-
if (allowFixed) {
|
|
98
|
-
column.renderFixed = fixed;
|
|
99
|
-
column.fixed = fixed;
|
|
100
|
-
}
|
|
101
|
-
if (allowSort) {
|
|
102
|
-
column.renderSortNumber = oldSortMaps[colid] || 0;
|
|
103
|
-
}
|
|
104
|
-
if (allowResizable) {
|
|
105
|
-
column.renderResizeWidth = column.renderWidth;
|
|
106
|
-
}
|
|
107
|
-
}, { children: 'children' });
|
|
55
|
+
$xeTable.cancelCustom();
|
|
108
56
|
$xeTable.closeCustom();
|
|
109
57
|
$xeTable.emitCustomEvent('cancel', $event);
|
|
110
58
|
};
|
|
111
59
|
const handleResetCustomEvent = (evnt) => {
|
|
112
|
-
$xeTable.
|
|
60
|
+
$xeTable.resetCustom(true);
|
|
113
61
|
$xeTable.closeCustom();
|
|
114
62
|
$xeTable.emitCustomEvent('reset', evnt);
|
|
115
63
|
};
|
|
@@ -199,41 +147,7 @@ export default defineComponent({
|
|
|
199
147
|
}
|
|
200
148
|
};
|
|
201
149
|
const allOptionEvent = () => {
|
|
202
|
-
|
|
203
|
-
const { customColumnList } = reactData;
|
|
204
|
-
const customOpts = computeCustomOpts.value;
|
|
205
|
-
const { checkMethod, visibleMethod } = customOpts;
|
|
206
|
-
const isAll = !customStore.isAll;
|
|
207
|
-
if (customOpts.immediate) {
|
|
208
|
-
XEUtils.eachTree(customColumnList, (column) => {
|
|
209
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
column.visible = isAll;
|
|
216
|
-
column.renderVisible = isAll;
|
|
217
|
-
column.halfVisible = false;
|
|
218
|
-
});
|
|
219
|
-
customStore.isAll = isAll;
|
|
220
|
-
$xeTable.handleCustom();
|
|
221
|
-
$xeTable.saveCustomStore('update:visible');
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
XEUtils.eachTree(customColumnList, (column) => {
|
|
225
|
-
if (visibleMethod && !visibleMethod({ column })) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
if (checkMethod && !checkMethod({ column })) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
column.renderVisible = isAll;
|
|
232
|
-
column.halfVisible = false;
|
|
233
|
-
});
|
|
234
|
-
customStore.isAll = isAll;
|
|
235
|
-
}
|
|
236
|
-
$xeTable.checkCustomStatus();
|
|
150
|
+
$xeTable.toggleCustomAllCheckbox();
|
|
237
151
|
};
|
|
238
152
|
const sortMousedownEvent = (evnt) => {
|
|
239
153
|
const btnEl = evnt.currentTarget;
|
|
@@ -244,6 +158,7 @@ export default defineComponent({
|
|
|
244
158
|
trEl.draggable = true;
|
|
245
159
|
dragColumnRef.value = column;
|
|
246
160
|
addClass(trEl, 'active--drag-origin');
|
|
161
|
+
updateDropHint(evnt);
|
|
247
162
|
};
|
|
248
163
|
const sortMouseupEvent = (evnt) => {
|
|
249
164
|
const btnEl = evnt.currentTarget;
|
|
@@ -351,13 +266,29 @@ export default defineComponent({
|
|
|
351
266
|
const { maxHeight } = customStore;
|
|
352
267
|
const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts;
|
|
353
268
|
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
269
|
+
const slots = customOpts.slots || {};
|
|
270
|
+
const headerSlot = slots.header;
|
|
271
|
+
const topSlot = slots.top;
|
|
272
|
+
const bottomSlot = slots.bottom;
|
|
273
|
+
const defaultSlot = slots.default;
|
|
274
|
+
const footerSlot = slots.footer;
|
|
354
275
|
const colVNs = [];
|
|
355
276
|
const customWrapperOns = {};
|
|
277
|
+
const isAllChecked = customStore.isAll;
|
|
278
|
+
const isAllIndeterminate = customStore.isIndeterminate;
|
|
279
|
+
const dragColumn = dragColumnRef.value;
|
|
356
280
|
// hover 触发
|
|
357
281
|
if (trigger === 'hover') {
|
|
358
282
|
customWrapperOns.onMouseenter = handleWrapperMouseenterEvent;
|
|
359
283
|
customWrapperOns.onMouseleave = handleWrapperMouseleaveEvent;
|
|
360
284
|
}
|
|
285
|
+
const params = {
|
|
286
|
+
$table: $xeTable,
|
|
287
|
+
$grid: $xeTable.xegrid,
|
|
288
|
+
columns: customColumnList,
|
|
289
|
+
isAllChecked,
|
|
290
|
+
isAllIndeterminate
|
|
291
|
+
};
|
|
361
292
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
362
293
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true;
|
|
363
294
|
if (isVisible) {
|
|
@@ -458,9 +389,6 @@ export default defineComponent({
|
|
|
458
389
|
]));
|
|
459
390
|
}
|
|
460
391
|
});
|
|
461
|
-
const isAllChecked = customStore.isAll;
|
|
462
|
-
const isAllIndeterminate = customStore.isIndeterminate;
|
|
463
|
-
const dragColumn = dragColumnRef.value;
|
|
464
392
|
return h('div', {
|
|
465
393
|
ref: refElem,
|
|
466
394
|
key: 'simple',
|
|
@@ -474,40 +402,60 @@ export default defineComponent({
|
|
|
474
402
|
: {}
|
|
475
403
|
}, customStore.visible
|
|
476
404
|
? [
|
|
477
|
-
h('
|
|
405
|
+
h('div', {
|
|
478
406
|
class: 'vxe-table-custom--header'
|
|
479
|
-
},
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
'is--indeterminate': isAllIndeterminate
|
|
488
|
-
}],
|
|
489
|
-
title: getI18n('vxe.table.allTitle'),
|
|
490
|
-
onClick: allOptionEvent
|
|
407
|
+
}, headerSlot
|
|
408
|
+
? $xeTable.callSlot(headerSlot, params)
|
|
409
|
+
: [
|
|
410
|
+
h('ul', {
|
|
411
|
+
class: 'vxe-table-custom--panel-list'
|
|
412
|
+
}, [
|
|
413
|
+
h('li', {
|
|
414
|
+
class: 'vxe-table-custom--option'
|
|
491
415
|
}, [
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
416
|
+
allowVisible
|
|
417
|
+
? h('div', {
|
|
418
|
+
class: ['vxe-table-custom--checkbox-option', {
|
|
419
|
+
'is--checked': isAllChecked,
|
|
420
|
+
'is--indeterminate': isAllIndeterminate
|
|
421
|
+
}],
|
|
422
|
+
title: getI18n('vxe.table.allTitle'),
|
|
423
|
+
onClick: allOptionEvent
|
|
424
|
+
}, [
|
|
425
|
+
h('span', {
|
|
426
|
+
class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : (isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED)]
|
|
427
|
+
}),
|
|
428
|
+
h('span', {
|
|
429
|
+
class: 'vxe-checkbox--label'
|
|
430
|
+
}, getI18n('vxe.toolbar.customAll'))
|
|
431
|
+
])
|
|
432
|
+
: h('span', {
|
|
433
|
+
class: 'vxe-checkbox--label'
|
|
434
|
+
}, getI18n('vxe.table.customTitle'))
|
|
498
435
|
])
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
}, getI18n('vxe.table.customTitle'))
|
|
502
|
-
])
|
|
503
|
-
]),
|
|
436
|
+
])
|
|
437
|
+
]),
|
|
504
438
|
h('div', {
|
|
505
439
|
ref: bodyElemRef,
|
|
506
|
-
class: 'vxe-table-custom--
|
|
440
|
+
class: 'vxe-table-custom--body'
|
|
507
441
|
}, [
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
442
|
+
topSlot
|
|
443
|
+
? h('div', {
|
|
444
|
+
class: 'vxe-table-custom--panel-top'
|
|
445
|
+
}, $xeTable.callSlot(topSlot, params))
|
|
446
|
+
: renderEmptyElement($xeTable),
|
|
447
|
+
defaultSlot
|
|
448
|
+
? h('div', {
|
|
449
|
+
class: 'vxe-table-custom--panel-body'
|
|
450
|
+
}, $xeTable.callSlot(defaultSlot, params))
|
|
451
|
+
: h(TransitionGroup, Object.assign({ class: 'vxe-table-custom--panel-list', name: 'vxe-table-custom--list', tag: 'ul' }, customWrapperOns), {
|
|
452
|
+
default: () => colVNs
|
|
453
|
+
}),
|
|
454
|
+
bottomSlot
|
|
455
|
+
? h('div', {
|
|
456
|
+
class: 'vxe-table-custom--panel-bottom'
|
|
457
|
+
}, $xeTable.callSlot(bottomSlot, params))
|
|
458
|
+
: renderEmptyElement($xeTable),
|
|
511
459
|
h('div', {
|
|
512
460
|
ref: dragHintElemRef,
|
|
513
461
|
class: 'vxe-table-custom-popup--drag-hint'
|
|
@@ -516,40 +464,46 @@ export default defineComponent({
|
|
|
516
464
|
customOpts.showFooter
|
|
517
465
|
? h('div', {
|
|
518
466
|
class: 'vxe-table-custom--footer'
|
|
519
|
-
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
467
|
+
}, footerSlot
|
|
468
|
+
? $xeTable.callSlot(footerSlot, params)
|
|
469
|
+
: [
|
|
470
|
+
h('div', {
|
|
471
|
+
class: 'vxe-table-custom--footer-buttons'
|
|
472
|
+
}, [
|
|
473
|
+
VxeUIButtonComponent
|
|
474
|
+
? h(VxeUIButtonComponent, {
|
|
475
|
+
mode: 'text',
|
|
476
|
+
content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
|
|
477
|
+
onClick: resetCustomEvent
|
|
478
|
+
})
|
|
479
|
+
: createCommentVNode(),
|
|
480
|
+
customOpts.immediate
|
|
481
|
+
? (VxeUIButtonComponent
|
|
482
|
+
? h(VxeUIButtonComponent, {
|
|
483
|
+
mode: 'text',
|
|
484
|
+
content: customOpts.closeButtonText || getI18n('vxe.table.customClose'),
|
|
485
|
+
onClick: cancelCloseEvent
|
|
486
|
+
})
|
|
487
|
+
: createCommentVNode())
|
|
488
|
+
: (VxeUIButtonComponent
|
|
489
|
+
? h(VxeUIButtonComponent, {
|
|
490
|
+
mode: 'text',
|
|
491
|
+
content: customOpts.cancelButtonText || getI18n('vxe.table.customCancel'),
|
|
492
|
+
onClick: cancelCustomEvent
|
|
493
|
+
})
|
|
494
|
+
: createCommentVNode()),
|
|
495
|
+
customOpts.immediate
|
|
496
|
+
? createCommentVNode()
|
|
497
|
+
: (VxeUIButtonComponent
|
|
498
|
+
? h(VxeUIButtonComponent, {
|
|
499
|
+
mode: 'text',
|
|
500
|
+
status: 'primary',
|
|
501
|
+
content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm'),
|
|
502
|
+
onClick: confirmCustomEvent
|
|
503
|
+
})
|
|
504
|
+
: createCommentVNode())
|
|
505
|
+
])
|
|
506
|
+
])
|
|
553
507
|
: null
|
|
554
508
|
]
|
|
555
509
|
: []);
|
|
@@ -565,7 +519,23 @@ export default defineComponent({
|
|
|
565
519
|
const modalOpts = Object.assign({}, modalOptions);
|
|
566
520
|
const drawerOpts = Object.assign({}, drawerOptions);
|
|
567
521
|
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
522
|
+
const slots = customOpts.slots || {};
|
|
523
|
+
const headerSlot = slots.header;
|
|
524
|
+
const topSlot = slots.top;
|
|
525
|
+
const bottomSlot = slots.bottom;
|
|
526
|
+
const defaultSlot = slots.default;
|
|
527
|
+
const footerSlot = slots.footer;
|
|
568
528
|
const trVNs = [];
|
|
529
|
+
const isAllChecked = customStore.isAll;
|
|
530
|
+
const isAllIndeterminate = customStore.isIndeterminate;
|
|
531
|
+
const dragColumn = dragColumnRef.value;
|
|
532
|
+
const params = {
|
|
533
|
+
$table: $xeTable,
|
|
534
|
+
$grid: $xeTable.xegrid,
|
|
535
|
+
columns: customColumnList,
|
|
536
|
+
isAllChecked,
|
|
537
|
+
isAllIndeterminate
|
|
538
|
+
};
|
|
569
539
|
XEUtils.eachTree(customColumnList, (column, index, items, path, parent) => {
|
|
570
540
|
const isVisible = visibleMethod ? visibleMethod({ column }) : true;
|
|
571
541
|
if (isVisible) {
|
|
@@ -688,15 +658,20 @@ export default defineComponent({
|
|
|
688
658
|
]));
|
|
689
659
|
}
|
|
690
660
|
});
|
|
691
|
-
const isAllChecked = customStore.isAll;
|
|
692
|
-
const isAllIndeterminate = customStore.isIndeterminate;
|
|
693
|
-
const dragColumn = dragColumnRef.value;
|
|
694
661
|
const scopedSlots = {
|
|
695
662
|
default: () => {
|
|
663
|
+
if (defaultSlot) {
|
|
664
|
+
return $xeTable.callSlot(defaultSlot, params);
|
|
665
|
+
}
|
|
696
666
|
return h('div', {
|
|
697
667
|
ref: bodyElemRef,
|
|
698
668
|
class: 'vxe-table-custom-popup--body'
|
|
699
669
|
}, [
|
|
670
|
+
topSlot
|
|
671
|
+
? h('div', {
|
|
672
|
+
class: 'vxe-table-custom-popup--table-top'
|
|
673
|
+
}, $xeTable.callSlot(topSlot, params))
|
|
674
|
+
: renderEmptyElement($xeTable),
|
|
700
675
|
h('div', {
|
|
701
676
|
class: 'vxe-table-custom-popup--table-wrapper'
|
|
702
677
|
}, [
|
|
@@ -704,35 +679,25 @@ export default defineComponent({
|
|
|
704
679
|
h('colgroup', {}, [
|
|
705
680
|
allowVisible
|
|
706
681
|
? h('col', {
|
|
707
|
-
|
|
708
|
-
width: '80px'
|
|
709
|
-
}
|
|
682
|
+
class: 'vxe-table-custom-popup--table-col-seq'
|
|
710
683
|
})
|
|
711
684
|
: createCommentVNode(),
|
|
712
685
|
allowSort
|
|
713
686
|
? h('col', {
|
|
714
|
-
|
|
715
|
-
width: '80px'
|
|
716
|
-
}
|
|
687
|
+
class: 'vxe-table-custom-popup--table-col-sort'
|
|
717
688
|
})
|
|
718
689
|
: createCommentVNode(),
|
|
719
690
|
h('col', {
|
|
720
|
-
|
|
721
|
-
minWidth: '120px'
|
|
722
|
-
}
|
|
691
|
+
class: 'vxe-table-custom-popup--table-col-title'
|
|
723
692
|
}),
|
|
724
693
|
allowResizable
|
|
725
694
|
? h('col', {
|
|
726
|
-
|
|
727
|
-
width: '140px'
|
|
728
|
-
}
|
|
695
|
+
class: 'vxe-table-custom-popup--table-col-width'
|
|
729
696
|
})
|
|
730
697
|
: createCommentVNode(),
|
|
731
698
|
allowFixed
|
|
732
699
|
? h('col', {
|
|
733
|
-
|
|
734
|
-
width: '200px'
|
|
735
|
-
}
|
|
700
|
+
class: 'vxe-table-custom-popup--table-col-fixed'
|
|
736
701
|
})
|
|
737
702
|
: createCommentVNode()
|
|
738
703
|
]),
|
|
@@ -787,7 +752,7 @@ export default defineComponent({
|
|
|
787
752
|
])
|
|
788
753
|
]),
|
|
789
754
|
h(TransitionGroup, {
|
|
790
|
-
class: 'vxe-table-custom--
|
|
755
|
+
class: 'vxe-table-custom--panel-list',
|
|
791
756
|
tag: 'tbody',
|
|
792
757
|
name: 'vxe-table-custom--list'
|
|
793
758
|
}, {
|
|
@@ -795,6 +760,11 @@ export default defineComponent({
|
|
|
795
760
|
})
|
|
796
761
|
])
|
|
797
762
|
]),
|
|
763
|
+
bottomSlot
|
|
764
|
+
? h('div', {
|
|
765
|
+
class: 'vxe-table-custom-popup--table-bottom'
|
|
766
|
+
}, $xeTable.callSlot(bottomSlot, params))
|
|
767
|
+
: renderEmptyElement($xeTable),
|
|
798
768
|
h('div', {
|
|
799
769
|
ref: dragHintElemRef,
|
|
800
770
|
class: 'vxe-table-custom-popup--drag-hint'
|
|
@@ -802,6 +772,9 @@ export default defineComponent({
|
|
|
802
772
|
]);
|
|
803
773
|
},
|
|
804
774
|
footer: () => {
|
|
775
|
+
if (footerSlot) {
|
|
776
|
+
return $xeTable.callSlot(footerSlot, params);
|
|
777
|
+
}
|
|
805
778
|
return h('div', {
|
|
806
779
|
class: 'vxe-table-custom-popup--footer'
|
|
807
780
|
}, [
|
|
@@ -827,6 +800,9 @@ export default defineComponent({
|
|
|
827
800
|
]);
|
|
828
801
|
}
|
|
829
802
|
};
|
|
803
|
+
if (headerSlot) {
|
|
804
|
+
scopedSlots.header = () => $xeTable.callSlot(headerSlot, params);
|
|
805
|
+
}
|
|
830
806
|
if (mode === 'drawer') {
|
|
831
807
|
return VxeUIDrawerComponent
|
|
832
808
|
? h(VxeUIDrawerComponent, {
|
package/es/table/src/cell.js
CHANGED
|
@@ -44,7 +44,7 @@ function renderCellDragIcon(params) {
|
|
|
44
44
|
const { $table } = params;
|
|
45
45
|
const { computeDragOpts } = $table.getComputeMaps();
|
|
46
46
|
const dragOpts = computeDragOpts.value;
|
|
47
|
-
const { rowDisabledMethod } = dragOpts;
|
|
47
|
+
const { rowIcon, rowDisabledMethod } = dragOpts;
|
|
48
48
|
const isDisabled = rowDisabledMethod && rowDisabledMethod(params);
|
|
49
49
|
return h('span', {
|
|
50
50
|
key: 'dg',
|
|
@@ -59,7 +59,7 @@ function renderCellDragIcon(params) {
|
|
|
59
59
|
onMouseup: $table.handleCellDragMouseupEvent
|
|
60
60
|
}, [
|
|
61
61
|
h('i', {
|
|
62
|
-
class:
|
|
62
|
+
class: rowIcon || getIcon().TABLE_DRAG_ROW
|
|
63
63
|
})
|
|
64
64
|
]);
|
|
65
65
|
}
|
package/es/table/src/table.js
CHANGED
|
@@ -2175,7 +2175,9 @@ export default defineComponent({
|
|
|
2175
2175
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2176
2176
|
treeExpandLazyLoadedMaps[rowid] = row;
|
|
2177
2177
|
Promise.resolve(loadMethod({ $table: $xeTable, row })).then((childRecords) => {
|
|
2178
|
-
rowRest
|
|
2178
|
+
if (rowRest) {
|
|
2179
|
+
rowRest.treeLoaded = true;
|
|
2180
|
+
}
|
|
2179
2181
|
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
2180
2182
|
delete treeExpandLazyLoadedMaps[rowid];
|
|
2181
2183
|
}
|
|
@@ -2201,7 +2203,9 @@ export default defineComponent({
|
|
|
2201
2203
|
}
|
|
2202
2204
|
}).catch(() => {
|
|
2203
2205
|
const { treeExpandLazyLoadedMaps } = reactData;
|
|
2204
|
-
rowRest
|
|
2206
|
+
if (rowRest) {
|
|
2207
|
+
rowRest.treeLoaded = false;
|
|
2208
|
+
}
|
|
2205
2209
|
if (treeExpandLazyLoadedMaps[rowid]) {
|
|
2206
2210
|
delete treeExpandLazyLoadedMaps[rowid];
|
|
2207
2211
|
}
|
|
@@ -3624,32 +3628,8 @@ export default defineComponent({
|
|
|
3624
3628
|
* 如果已关联工具栏,则会同步更新
|
|
3625
3629
|
*/
|
|
3626
3630
|
resetColumn(options) {
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
const { checkMethod } = customOpts;
|
|
3630
|
-
const opts = Object.assign({
|
|
3631
|
-
visible: true,
|
|
3632
|
-
resizable: options === true,
|
|
3633
|
-
fixed: options === true,
|
|
3634
|
-
sort: options === true
|
|
3635
|
-
}, options);
|
|
3636
|
-
XEUtils.eachTree(collectColumn, (column) => {
|
|
3637
|
-
if (opts.resizable) {
|
|
3638
|
-
column.resizeWidth = 0;
|
|
3639
|
-
}
|
|
3640
|
-
if (opts.fixed) {
|
|
3641
|
-
column.fixed = column.defaultFixed;
|
|
3642
|
-
}
|
|
3643
|
-
if (opts.sort) {
|
|
3644
|
-
column.renderSortNumber = column.sortNumber;
|
|
3645
|
-
}
|
|
3646
|
-
if (!checkMethod || checkMethod({ column })) {
|
|
3647
|
-
column.visible = column.defaultVisible;
|
|
3648
|
-
}
|
|
3649
|
-
column.renderResizeWidth = column.renderWidth;
|
|
3650
|
-
});
|
|
3651
|
-
$xeTable.saveCustomStore('reset');
|
|
3652
|
-
return tablePrivateMethods.handleCustom();
|
|
3631
|
+
warnLog('vxe.error.delFunc', ['resetColumn', 'resetCustom']);
|
|
3632
|
+
return $xeTable.resetCustom(options);
|
|
3653
3633
|
},
|
|
3654
3634
|
/**
|
|
3655
3635
|
* 刷新列信息
|