vxe-table 4.13.43 → 4.13.45
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 +4 -4
- package/es/{iconfont.1750301151390.ttf → iconfont.1750641793236.ttf} +0 -0
- package/es/iconfont.1750641793236.woff +0 -0
- package/es/iconfont.1750641793236.woff2 +0 -0
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +9 -1
- package/es/table/module/custom/panel.js +320 -224
- package/es/table/module/edit/hook.js +24 -10
- package/es/table/module/export/hook.js +19 -6
- package/es/table/src/cell.js +4 -4
- package/es/table/src/emits.js +3 -0
- package/es/table/src/table.js +16 -4
- package/es/table/style.css +37 -9
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +7 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +37 -9
- package/es/vxe-table/style.min.css +1 -1
- package/lib/{iconfont.1750301151390.ttf → iconfont.1750641793236.ttf} +0 -0
- package/lib/iconfont.1750641793236.woff +0 -0
- package/lib/iconfont.1750641793236.woff2 +0 -0
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +275 -89
- 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 +11 -1
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +181 -60
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/hook.js +46 -10
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +19 -4
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/cell.js +4 -4
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/table.js +5 -5
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +37 -9
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +7 -3
- 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 +37 -9
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/hook.ts +10 -1
- package/packages/table/module/custom/panel.ts +338 -236
- package/packages/table/module/edit/hook.ts +24 -10
- package/packages/table/module/export/hook.ts +18 -7
- package/packages/table/src/cell.ts +4 -4
- package/packages/table/src/emits.ts +3 -0
- package/packages/table/src/table.ts +17 -4
- package/packages/ui/index.ts +6 -2
- package/styles/components/icon.scss +9 -1
- package/styles/components/table-module/custom.scss +26 -3
- package/styles/helpers/baseMixin.scss +16 -2
- package/styles/icon/iconfont.ttf +0 -0
- package/styles/icon/iconfont.woff +0 -0
- package/styles/icon/iconfont.woff2 +0 -0
- package/es/iconfont.1750301151390.woff +0 -0
- package/es/iconfont.1750301151390.woff2 +0 -0
- package/lib/iconfont.1750301151390.woff +0 -0
- package/lib/iconfont.1750301151390.woff2 +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.13.
|
|
3141
|
+
const version = "4.13.45";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3347,13 +3347,13 @@ core_.VxeUI.setConfig({
|
|
|
3347
3347
|
isReplace: true
|
|
3348
3348
|
},
|
|
3349
3349
|
virtualXConfig: {
|
|
3350
|
-
enabled:
|
|
3350
|
+
// enabled: false,
|
|
3351
3351
|
gt: 24,
|
|
3352
3352
|
preSize: 1,
|
|
3353
3353
|
oSize: 0
|
|
3354
3354
|
},
|
|
3355
3355
|
virtualYConfig: {
|
|
3356
|
-
enabled:
|
|
3356
|
+
// enabled: false,
|
|
3357
3357
|
gt: 100,
|
|
3358
3358
|
preSize: 1,
|
|
3359
3359
|
oSize: 0
|
|
@@ -3433,14 +3433,18 @@ core_.VxeUI.setIcon({
|
|
|
3433
3433
|
TABLE_CHECKBOX_CHECKED: iconPrefix + 'checkbox-checked-fill',
|
|
3434
3434
|
TABLE_CHECKBOX_UNCHECKED: iconPrefix + 'checkbox-unchecked',
|
|
3435
3435
|
TABLE_CHECKBOX_INDETERMINATE: iconPrefix + 'checkbox-indeterminate-fill',
|
|
3436
|
+
TABLE_CHECKBOX_DISABLED_UNCHECKED: iconPrefix + 'checkbox-unchecked-fill',
|
|
3436
3437
|
TABLE_RADIO_CHECKED: iconPrefix + 'radio-checked-fill',
|
|
3437
3438
|
TABLE_RADIO_UNCHECKED: iconPrefix + 'radio-unchecked',
|
|
3439
|
+
TABLE_RADIO_DISABLED_UNCHECKED: iconPrefix + 'radio-unchecked-fill',
|
|
3438
3440
|
TABLE_CUSTOM_SORT: iconPrefix + 'drag-handle',
|
|
3439
3441
|
TABLE_MENU_OPTIONS: iconPrefix + 'arrow-right',
|
|
3440
3442
|
TABLE_DRAG_ROW: iconPrefix + 'drag-handle',
|
|
3441
3443
|
TABLE_DRAG_COLUMN: iconPrefix + 'drag-handle',
|
|
3442
3444
|
TABLE_DRAG_STATUS_ROW: iconPrefix + 'sort',
|
|
3443
3445
|
TABLE_DRAG_STATUS_SUB_ROW: iconPrefix + 'add-sub',
|
|
3446
|
+
TABLE_DRAG_STATUS_AGG_GROUP: iconPrefix + 'grouping',
|
|
3447
|
+
TABLE_DRAG_STATUS_AGG_VALUES: iconPrefix + 'values',
|
|
3444
3448
|
TABLE_DRAG_STATUS_COLUMN: iconPrefix + 'swap',
|
|
3445
3449
|
TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
|
|
3446
3450
|
TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
|
|
@@ -3614,7 +3618,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3614
3618
|
const {
|
|
3615
3619
|
log: log_log
|
|
3616
3620
|
} = core_.VxeUI;
|
|
3617
|
-
const log_version = `table v${"4.13.
|
|
3621
|
+
const log_version = `table v${"4.13.45"}`;
|
|
3618
3622
|
const warnLog = log_log.create('warn', log_version);
|
|
3619
3623
|
const errLog = log_log.create('error', log_version);
|
|
3620
3624
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -5545,7 +5549,7 @@ const Cell = {
|
|
|
5545
5549
|
const radioVNs = [];
|
|
5546
5550
|
if (isVisible) {
|
|
5547
5551
|
radioVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
5548
|
-
class: ['vxe-radio--icon', isChecked ? cell_getIcon().TABLE_RADIO_CHECKED : cell_getIcon().TABLE_RADIO_UNCHECKED]
|
|
5552
|
+
class: ['vxe-radio--icon', isChecked ? cell_getIcon().TABLE_RADIO_CHECKED : isDisabled ? cell_getIcon().TABLE_RADIO_DISABLED_UNCHECKED : cell_getIcon().TABLE_RADIO_UNCHECKED]
|
|
5549
5553
|
}));
|
|
5550
5554
|
}
|
|
5551
5555
|
if (defaultSlot || labelField) {
|
|
@@ -5626,7 +5630,7 @@ const Cell = {
|
|
|
5626
5630
|
title: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(headerTitle) ? cell_getI18n('vxe.table.allTitle') : `${headerTitle || ''}`,
|
|
5627
5631
|
...ons
|
|
5628
5632
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
5629
|
-
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? cell_getIcon().TABLE_CHECKBOX_CHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
5633
|
+
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? cell_getIcon().TABLE_CHECKBOX_CHECKED : isAllCheckboxDisabled ? cell_getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
5630
5634
|
})].concat(titleSlot || colTitle ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
5631
5635
|
class: 'vxe-checkbox--label'
|
|
5632
5636
|
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams) : colTitle)] : []))]));
|
|
@@ -5705,7 +5709,7 @@ const Cell = {
|
|
|
5705
5709
|
const checkVNs = [];
|
|
5706
5710
|
if (isVisible) {
|
|
5707
5711
|
checkVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
5708
|
-
class: ['vxe-checkbox--icon', indeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? cell_getIcon().TABLE_CHECKBOX_CHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
5712
|
+
class: ['vxe-checkbox--icon', indeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? cell_getIcon().TABLE_CHECKBOX_CHECKED : isDisabled ? cell_getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
5709
5713
|
}));
|
|
5710
5714
|
}
|
|
5711
5715
|
if (defaultSlot || labelField) {
|
|
@@ -5801,7 +5805,7 @@ const Cell = {
|
|
|
5801
5805
|
const checkVNs = [];
|
|
5802
5806
|
if (isVisible) {
|
|
5803
5807
|
checkVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
5804
|
-
class: ['vxe-checkbox--icon', isIndeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? cell_getIcon().TABLE_CHECKBOX_CHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
5808
|
+
class: ['vxe-checkbox--icon', isIndeterminate ? cell_getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? cell_getIcon().TABLE_CHECKBOX_CHECKED : isDisabled ? cell_getIcon().TABLE_CHECKBOX_DISABLED_UNCHECKED : cell_getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
5805
5809
|
}));
|
|
5806
5810
|
if (defaultSlot || labelField) {
|
|
5807
5811
|
checkVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
@@ -8622,7 +8626,7 @@ const {
|
|
|
8622
8626
|
params: Object
|
|
8623
8627
|
});
|
|
8624
8628
|
;// ./packages/table/src/emits.ts
|
|
8625
|
-
/* harmony default export */ var emits = (['update:data', 'keydown-start', 'keydown', 'keydown-end', 'paste', 'copy', 'cut', 'current-change', 'current-row-change', 'current-row-disabled', 'current-column-change', 'current-column-disabled', 'radio-change', 'checkbox-change', 'checkbox-all', 'checkbox-range-start', 'checkbox-range-change', 'checkbox-range-end', 'checkbox-range-select', 'cell-click', 'cell-dblclick', 'cell-menu', 'cell-mouseenter', 'cell-mouseleave', 'cell-selected', 'cell-delete-value', 'cell-backspace-value', 'header-cell-click', 'header-cell-dblclick', 'header-cell-menu', 'footer-cell-click', 'footer-cell-dblclick', 'footer-cell-menu', 'clear-merge', 'sort-change', 'clear-sort', 'clear-all-sort', 'filter-change', 'filter-visible', 'clear-filter', 'clear-all-filter', 'resizable-change', 'column-resizable-change', 'row-resizable-change', 'toggle-row-group-expand', 'toggle-row-expand', 'toggle-tree-expand', 'menu-click', 'edit-closed', 'row-dragstart', 'row-dragover', 'row-dragend', 'column-dragstart', 'column-dragover', 'column-dragend', 'enter-append-row', 'edit-actived', 'edit-activated', 'edit-disabled', 'valid-error', 'scroll', 'scroll-boundary', 'custom', 'change-fnr', 'open-fnr', 'show-fnr', 'hide-fnr', 'fnr-change', 'fnr-find', 'fnr-find-all', 'fnr-replace', 'fnr-replace-all', 'cell-area-copy', 'cell-area-cut', 'cell-area-paste', 'cell-area-merge', 'clear-cell-area-selection', 'clear-cell-area-merge', 'header-cell-area-selection', 'cell-area-selection-invalid', 'cell-area-selection-start', 'cell-area-selection-drag', 'cell-area-selection-end', 'cell-area-extension-start', 'cell-area-extension-drag', 'cell-area-extension-end', 'cell-area-selection-all-start', 'cell-area-selection-all-end', 'cell-area-arrows-start', 'cell-area-arrows-end', 'active-cell-change-start', 'active-cell-change-end']);
|
|
8629
|
+
/* harmony default export */ var emits = (['update:data', 'keydown-start', 'keydown', 'keydown-end', 'paste', 'copy', 'cut', 'current-change', 'current-row-change', 'current-row-disabled', 'current-column-change', 'current-column-disabled', 'radio-change', 'checkbox-change', 'checkbox-all', 'checkbox-range-start', 'checkbox-range-change', 'checkbox-range-end', 'checkbox-range-select', 'cell-click', 'cell-dblclick', 'cell-menu', 'cell-mouseenter', 'cell-mouseleave', 'cell-selected', 'cell-delete-value', 'cell-backspace-value', 'header-cell-click', 'header-cell-dblclick', 'header-cell-menu', 'footer-cell-click', 'footer-cell-dblclick', 'footer-cell-menu', 'clear-merge', 'sort-change', 'clear-sort', 'clear-all-sort', 'filter-change', 'filter-visible', 'clear-filter', 'clear-all-filter', 'resizable-change', 'column-resizable-change', 'row-resizable-change', 'toggle-row-group-expand', 'toggle-row-expand', 'toggle-tree-expand', 'menu-click', 'edit-closed', 'row-dragstart', 'row-dragover', 'row-dragend', 'column-dragstart', 'column-dragover', 'column-dragend', 'enter-append-row', 'edit-actived', 'edit-activated', 'edit-disabled', 'valid-error', 'scroll', 'scroll-boundary', 'custom', 'custom-visible-change', 'custom-visible-all', 'custom-fixed-change', 'change-fnr', 'open-fnr', 'show-fnr', 'hide-fnr', 'fnr-change', 'fnr-find', 'fnr-find-all', 'fnr-replace', 'fnr-replace-all', 'cell-area-copy', 'cell-area-cut', 'cell-area-paste', 'cell-area-merge', 'clear-cell-area-selection', 'clear-cell-area-merge', 'header-cell-area-selection', 'cell-area-selection-invalid', 'cell-area-selection-start', 'cell-area-selection-drag', 'cell-area-selection-end', 'cell-area-extension-start', 'cell-area-extension-drag', 'cell-area-extension-end', 'cell-area-selection-all-start', 'cell-area-selection-all-end', 'cell-area-arrows-start', 'cell-area-arrows-end', 'active-cell-change-start', 'active-cell-change-end']);
|
|
8626
8630
|
;// ./packages/table/module/custom/panel.ts
|
|
8627
8631
|
|
|
8628
8632
|
|
|
@@ -8649,7 +8653,8 @@ const {
|
|
|
8649
8653
|
default: () => ({})
|
|
8650
8654
|
}
|
|
8651
8655
|
},
|
|
8652
|
-
setup(props) {
|
|
8656
|
+
setup(props, context) {
|
|
8657
|
+
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
8653
8658
|
const VxeUIModalComponent = core_.VxeUI.getComponent('VxeModal');
|
|
8654
8659
|
const VxeUIDrawerComponent = core_.VxeUI.getComponent('VxeDrawer');
|
|
8655
8660
|
const VxeUIButtonComponent = core_.VxeUI.getComponent('VxeButton');
|
|
@@ -8658,8 +8663,8 @@ const {
|
|
|
8658
8663
|
const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', {});
|
|
8659
8664
|
const {
|
|
8660
8665
|
props: tableProps,
|
|
8661
|
-
reactData,
|
|
8662
|
-
internalData
|
|
8666
|
+
reactData: tableReactData,
|
|
8667
|
+
internalData: tableInternalData
|
|
8663
8668
|
} = $xeTable;
|
|
8664
8669
|
const {
|
|
8665
8670
|
computeCustomOpts,
|
|
@@ -8669,13 +8674,29 @@ const {
|
|
|
8669
8674
|
computeResizableOpts
|
|
8670
8675
|
} = $xeTable.getComputeMaps();
|
|
8671
8676
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
8672
|
-
const
|
|
8677
|
+
const refBodyWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
8678
|
+
const refCustomBodyElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
8673
8679
|
const refDragLineElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
8674
8680
|
const refDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
8675
|
-
const
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8681
|
+
const customPanelReactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
8682
|
+
dragCol: null,
|
|
8683
|
+
dragGroup: null,
|
|
8684
|
+
dragValues: null,
|
|
8685
|
+
dragTipText: ''
|
|
8686
|
+
});
|
|
8687
|
+
const customPanelInternalData = {
|
|
8688
|
+
// prevDragCol: undefined,
|
|
8689
|
+
// prevDragToChild: false,
|
|
8690
|
+
// prevDragPos: null
|
|
8691
|
+
};
|
|
8692
|
+
const refMaps = {
|
|
8693
|
+
refElem,
|
|
8694
|
+
refBodyWrapperElem,
|
|
8695
|
+
refCustomBodyElem,
|
|
8696
|
+
refDragLineElem,
|
|
8697
|
+
refDragTipElem
|
|
8698
|
+
};
|
|
8699
|
+
const computeMaps = {};
|
|
8679
8700
|
const handleWrapperMouseenterEvent = evnt => {
|
|
8680
8701
|
const {
|
|
8681
8702
|
customStore
|
|
@@ -8697,7 +8718,7 @@ const {
|
|
|
8697
8718
|
const confirmCustomEvent = ({
|
|
8698
8719
|
$event
|
|
8699
8720
|
}) => {
|
|
8700
|
-
|
|
8721
|
+
tableReactData.isCustomStatus = true;
|
|
8701
8722
|
$xeTable.saveCustom();
|
|
8702
8723
|
$xeTable.closeCustom();
|
|
8703
8724
|
$xeTable.emitCustomEvent('confirm', $event);
|
|
@@ -8740,7 +8761,7 @@ const {
|
|
|
8740
8761
|
const handleOptionCheck = column => {
|
|
8741
8762
|
const {
|
|
8742
8763
|
customColumnList
|
|
8743
|
-
} =
|
|
8764
|
+
} = tableReactData;
|
|
8744
8765
|
const matchObj = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(customColumnList, item => item === column);
|
|
8745
8766
|
if (matchObj && matchObj.parent) {
|
|
8746
8767
|
const {
|
|
@@ -8753,7 +8774,7 @@ const {
|
|
|
8753
8774
|
}
|
|
8754
8775
|
}
|
|
8755
8776
|
};
|
|
8756
|
-
const changeCheckboxOption = column => {
|
|
8777
|
+
const changeCheckboxOption = (column, evnt) => {
|
|
8757
8778
|
const isChecked = !column.renderVisible;
|
|
8758
8779
|
const customOpts = computeCustomOpts.value;
|
|
8759
8780
|
if (customOpts.immediate) {
|
|
@@ -8762,7 +8783,7 @@ const {
|
|
|
8762
8783
|
item.renderVisible = isChecked;
|
|
8763
8784
|
item.halfVisible = false;
|
|
8764
8785
|
});
|
|
8765
|
-
|
|
8786
|
+
tableReactData.isCustomStatus = true;
|
|
8766
8787
|
$xeTable.handleCustom();
|
|
8767
8788
|
$xeTable.saveCustomStore('update:visible');
|
|
8768
8789
|
} else {
|
|
@@ -8773,6 +8794,10 @@ const {
|
|
|
8773
8794
|
}
|
|
8774
8795
|
handleOptionCheck(column);
|
|
8775
8796
|
$xeTable.checkCustomStatus();
|
|
8797
|
+
$xeTable.dispatchEvent('custom-visible-change', {
|
|
8798
|
+
column,
|
|
8799
|
+
checked: isChecked
|
|
8800
|
+
}, evnt);
|
|
8776
8801
|
};
|
|
8777
8802
|
const changeColumnWidth = column => {
|
|
8778
8803
|
const customOpts = computeCustomOpts.value;
|
|
@@ -8780,62 +8805,89 @@ const {
|
|
|
8780
8805
|
if (column.renderResizeWidth !== column.renderWidth) {
|
|
8781
8806
|
column.resizeWidth = column.renderResizeWidth;
|
|
8782
8807
|
column.renderWidth = column.renderResizeWidth;
|
|
8783
|
-
|
|
8808
|
+
tableReactData.isCustomStatus = true;
|
|
8784
8809
|
$xeTable.handleCustom();
|
|
8785
8810
|
$xeTable.saveCustomStore('update:width');
|
|
8786
8811
|
}
|
|
8787
8812
|
}
|
|
8788
8813
|
};
|
|
8789
|
-
const changeFixedOption = (column, colFixed) => {
|
|
8814
|
+
const changeFixedOption = (column, colFixed, evnt) => {
|
|
8790
8815
|
const isMaxFixedColumn = computeIsMaxFixedColumn.value;
|
|
8791
8816
|
const customOpts = computeCustomOpts.value;
|
|
8817
|
+
let targetFixed = null;
|
|
8792
8818
|
if (customOpts.immediate) {
|
|
8793
8819
|
if (column.renderFixed === colFixed) {
|
|
8820
|
+
targetFixed = '';
|
|
8794
8821
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], col => {
|
|
8795
8822
|
col.fixed = '';
|
|
8796
8823
|
col.renderFixed = '';
|
|
8797
8824
|
});
|
|
8798
8825
|
} else {
|
|
8799
8826
|
if (!isMaxFixedColumn || column.renderFixed) {
|
|
8827
|
+
targetFixed = colFixed;
|
|
8800
8828
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], col => {
|
|
8801
8829
|
col.fixed = colFixed;
|
|
8802
8830
|
col.renderFixed = colFixed;
|
|
8803
8831
|
});
|
|
8804
8832
|
}
|
|
8805
8833
|
}
|
|
8806
|
-
|
|
8834
|
+
tableReactData.isCustomStatus = true;
|
|
8807
8835
|
$xeTable.handleCustom();
|
|
8808
8836
|
$xeTable.saveCustomStore('update:fixed');
|
|
8809
8837
|
} else {
|
|
8810
8838
|
if (column.renderFixed === colFixed) {
|
|
8839
|
+
targetFixed = '';
|
|
8811
8840
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], col => {
|
|
8812
8841
|
col.renderFixed = '';
|
|
8813
8842
|
});
|
|
8814
8843
|
} else {
|
|
8815
8844
|
if (!isMaxFixedColumn || column.renderFixed) {
|
|
8845
|
+
targetFixed = colFixed;
|
|
8816
8846
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column], col => {
|
|
8817
8847
|
col.renderFixed = colFixed;
|
|
8818
8848
|
});
|
|
8819
8849
|
}
|
|
8820
8850
|
}
|
|
8821
8851
|
}
|
|
8852
|
+
if (!targetFixed !== null) {
|
|
8853
|
+
$xeTable.dispatchEvent('custom-fixed-change', {
|
|
8854
|
+
column,
|
|
8855
|
+
fixed: targetFixed
|
|
8856
|
+
}, evnt);
|
|
8857
|
+
}
|
|
8822
8858
|
};
|
|
8823
|
-
const allOptionEvent =
|
|
8859
|
+
const allOptionEvent = evnt => {
|
|
8860
|
+
const {
|
|
8861
|
+
customStore
|
|
8862
|
+
} = tableReactData;
|
|
8863
|
+
const isAll = !customStore.isAll;
|
|
8824
8864
|
$xeTable.toggleCustomAllCheckbox();
|
|
8865
|
+
$xeTable.dispatchEvent('custom-visible-all', {
|
|
8866
|
+
checked: isAll
|
|
8867
|
+
}, evnt);
|
|
8825
8868
|
};
|
|
8826
8869
|
const showDropTip = (evnt, optEl, showLine, dragPos) => {
|
|
8827
|
-
const
|
|
8828
|
-
if (!
|
|
8870
|
+
const bodyWrapperElem = refBodyWrapperElem.value;
|
|
8871
|
+
if (!bodyWrapperElem) {
|
|
8872
|
+
return;
|
|
8873
|
+
}
|
|
8874
|
+
const customBodyElem = refCustomBodyElem.value;
|
|
8875
|
+
if (!customBodyElem) {
|
|
8829
8876
|
return;
|
|
8830
8877
|
}
|
|
8831
|
-
const
|
|
8878
|
+
const {
|
|
8879
|
+
prevDragToChild
|
|
8880
|
+
} = customPanelInternalData;
|
|
8881
|
+
const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect();
|
|
8882
|
+
const customBodyRect = customBodyElem.getBoundingClientRect();
|
|
8832
8883
|
if (optEl) {
|
|
8833
8884
|
const dragLineEl = refDragLineElem.value;
|
|
8834
8885
|
if (dragLineEl) {
|
|
8835
8886
|
if (showLine) {
|
|
8836
8887
|
const optRect = optEl.getBoundingClientRect();
|
|
8837
8888
|
dragLineEl.style.display = 'block';
|
|
8838
|
-
dragLineEl.style.
|
|
8889
|
+
dragLineEl.style.left = `${Math.max(0, customBodyRect.x - bodyWrapperRect.x)}px`;
|
|
8890
|
+
dragLineEl.style.top = `${Math.max(1, optRect.y + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
|
|
8839
8891
|
dragLineEl.style.height = `${optRect.height}px`;
|
|
8840
8892
|
dragLineEl.style.width = `${optRect.width}px`;
|
|
8841
8893
|
dragLineEl.setAttribute('drag-pos', dragPos);
|
|
@@ -8848,11 +8900,31 @@ const {
|
|
|
8848
8900
|
const dragTipEl = refDragTipElem.value;
|
|
8849
8901
|
if (dragTipEl) {
|
|
8850
8902
|
dragTipEl.style.display = 'block';
|
|
8851
|
-
dragTipEl.style.top = `${Math.min(
|
|
8852
|
-
dragTipEl.style.left = `${Math.min(
|
|
8903
|
+
dragTipEl.style.top = `${Math.min(bodyWrapperElem.clientHeight + bodyWrapperElem.scrollTop - dragTipEl.clientHeight, evnt.clientY + bodyWrapperElem.scrollTop - bodyWrapperRect.y)}px`;
|
|
8904
|
+
dragTipEl.style.left = `${Math.min(bodyWrapperElem.clientWidth + bodyWrapperElem.scrollLeft - dragTipEl.clientWidth, evnt.clientX + bodyWrapperElem.scrollLeft - bodyWrapperRect.x)}px`;
|
|
8853
8905
|
dragTipEl.setAttribute('drag-status', showLine ? prevDragToChild ? 'sub' : 'normal' : 'disabled');
|
|
8854
8906
|
}
|
|
8855
8907
|
};
|
|
8908
|
+
const updateColDropTipContent = () => {
|
|
8909
|
+
const {
|
|
8910
|
+
dragCol
|
|
8911
|
+
} = customPanelReactData;
|
|
8912
|
+
const columnDragOpts = computeColumnDragOpts.value;
|
|
8913
|
+
const {
|
|
8914
|
+
tooltipMethod
|
|
8915
|
+
} = columnDragOpts;
|
|
8916
|
+
let tipContent = '';
|
|
8917
|
+
if (tooltipMethod) {
|
|
8918
|
+
const dtParams = {
|
|
8919
|
+
$table: $xeTable,
|
|
8920
|
+
column: dragCol
|
|
8921
|
+
};
|
|
8922
|
+
tipContent = `${tooltipMethod(dtParams) || ''}`;
|
|
8923
|
+
} else {
|
|
8924
|
+
tipContent = panel_getI18n('vxe.custom.cstmDragTarget', [dragCol && dragCol.type !== 'html' ? dragCol.getTitle() : '']);
|
|
8925
|
+
}
|
|
8926
|
+
customPanelReactData.dragTipText = tipContent;
|
|
8927
|
+
};
|
|
8856
8928
|
const hideDropTip = () => {
|
|
8857
8929
|
const dragTipEl = refDragTipElem.value;
|
|
8858
8930
|
const dragLineEl = refDragLineElem.value;
|
|
@@ -8871,7 +8943,8 @@ const {
|
|
|
8871
8943
|
const colid = trEl.getAttribute('colid');
|
|
8872
8944
|
const column = $xeTable.getColumnById(colid);
|
|
8873
8945
|
trEl.draggable = true;
|
|
8874
|
-
|
|
8946
|
+
customPanelReactData.dragCol = column;
|
|
8947
|
+
updateColDropTipContent();
|
|
8875
8948
|
addClass(trEl, 'active--drag-origin');
|
|
8876
8949
|
};
|
|
8877
8950
|
const sortMouseupEvent = evnt => {
|
|
@@ -8881,13 +8954,15 @@ const {
|
|
|
8881
8954
|
const trEl = tdEl.parentElement;
|
|
8882
8955
|
hideDropTip();
|
|
8883
8956
|
trEl.draggable = false;
|
|
8884
|
-
|
|
8957
|
+
customPanelReactData.dragCol = null;
|
|
8885
8958
|
removeClass(trEl, 'active--drag-origin');
|
|
8886
8959
|
};
|
|
8887
8960
|
const sortDragstartEvent = evnt => {
|
|
8888
8961
|
if (evnt.dataTransfer) {
|
|
8889
8962
|
evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
|
|
8890
8963
|
}
|
|
8964
|
+
customPanelReactData.dragGroup = null;
|
|
8965
|
+
customPanelReactData.dragValues = null;
|
|
8891
8966
|
};
|
|
8892
8967
|
const sortDragendEvent = evnt => {
|
|
8893
8968
|
const {
|
|
@@ -8895,16 +8970,15 @@ const {
|
|
|
8895
8970
|
} = tableProps;
|
|
8896
8971
|
const {
|
|
8897
8972
|
customColumnList
|
|
8898
|
-
} =
|
|
8973
|
+
} = tableReactData;
|
|
8899
8974
|
const {
|
|
8900
8975
|
collectColumn
|
|
8901
|
-
} =
|
|
8976
|
+
} = tableInternalData;
|
|
8902
8977
|
const customOpts = computeCustomOpts.value;
|
|
8903
8978
|
const {
|
|
8904
8979
|
immediate
|
|
8905
8980
|
} = customOpts;
|
|
8906
8981
|
const trEl = evnt.currentTarget;
|
|
8907
|
-
const dragCol = dragColumnRef.value;
|
|
8908
8982
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
8909
8983
|
const {
|
|
8910
8984
|
isCrossDrag,
|
|
@@ -8912,8 +8986,22 @@ const {
|
|
|
8912
8986
|
isToChildDrag,
|
|
8913
8987
|
dragEndMethod
|
|
8914
8988
|
} = columnDragOpts;
|
|
8989
|
+
const {
|
|
8990
|
+
dragCol,
|
|
8991
|
+
dragGroup,
|
|
8992
|
+
dragValues
|
|
8993
|
+
} = customPanelReactData;
|
|
8994
|
+
const {
|
|
8995
|
+
prevDragCol,
|
|
8996
|
+
prevDragPos,
|
|
8997
|
+
prevDragToChild
|
|
8998
|
+
} = customPanelInternalData;
|
|
8915
8999
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
8916
|
-
if (
|
|
9000
|
+
if (dragGroup || dragValues) {
|
|
9001
|
+
if ($xeTable.handlePivotTableAggregatePanelDragendEvent) {
|
|
9002
|
+
$xeTable.handlePivotTableAggregatePanelDragendEvent(evnt);
|
|
9003
|
+
}
|
|
9004
|
+
} else if (prevDragCol && dragCol) {
|
|
8917
9005
|
// 判断是否有拖动
|
|
8918
9006
|
if (prevDragCol !== dragCol) {
|
|
8919
9007
|
const dragColumn = dragCol;
|
|
@@ -9039,7 +9127,7 @@ const {
|
|
|
9039
9127
|
nafIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(customColumnList, item => item.id === newColumn.id);
|
|
9040
9128
|
customColumnList.splice(nafIndex + dragOffsetIndex, 0, dragColumn);
|
|
9041
9129
|
}
|
|
9042
|
-
|
|
9130
|
+
tableReactData.isDragColMove = true;
|
|
9043
9131
|
if (mouseConfig) {
|
|
9044
9132
|
if ($xeTable.clearSelected) {
|
|
9045
9133
|
$xeTable.clearSelected();
|
|
@@ -9061,14 +9149,16 @@ const {
|
|
|
9061
9149
|
}
|
|
9062
9150
|
}, evnt);
|
|
9063
9151
|
if (immediate) {
|
|
9064
|
-
|
|
9152
|
+
tableReactData.customColumnList = collectColumn.slice(0);
|
|
9065
9153
|
$xeTable.handleColDragSwapColumn();
|
|
9066
9154
|
}
|
|
9067
9155
|
}).catch(() => {});
|
|
9068
9156
|
}
|
|
9069
9157
|
}
|
|
9070
9158
|
hideDropTip();
|
|
9071
|
-
|
|
9159
|
+
customPanelReactData.dragCol = null;
|
|
9160
|
+
customPanelReactData.dragGroup = null;
|
|
9161
|
+
customPanelReactData.dragValues = null;
|
|
9072
9162
|
trEl.draggable = false;
|
|
9073
9163
|
trEl.removeAttribute('drag-pos');
|
|
9074
9164
|
removeClass(trEl, 'active--drag-target');
|
|
@@ -9088,7 +9178,11 @@ const {
|
|
|
9088
9178
|
const isControlKey = hasControlKey(evnt);
|
|
9089
9179
|
const colid = optEl.getAttribute('colid');
|
|
9090
9180
|
const column = $xeTable.getColumnById(colid);
|
|
9091
|
-
const
|
|
9181
|
+
const {
|
|
9182
|
+
dragCol
|
|
9183
|
+
} = customPanelReactData;
|
|
9184
|
+
customPanelReactData.dragGroup = null;
|
|
9185
|
+
customPanelReactData.dragValues = null;
|
|
9092
9186
|
// 是否移入有效列
|
|
9093
9187
|
if (column && (isCrossDrag || column.level === 1)) {
|
|
9094
9188
|
evnt.preventDefault();
|
|
@@ -9098,14 +9192,16 @@ const {
|
|
|
9098
9192
|
showDropTip(evnt, optEl, false, dragPos);
|
|
9099
9193
|
return;
|
|
9100
9194
|
}
|
|
9101
|
-
prevDragToChild = !!(isCrossDrag && isToChildDrag && isControlKey && immediate);
|
|
9102
|
-
prevDragCol = column;
|
|
9103
|
-
prevDragPos = dragPos;
|
|
9195
|
+
customPanelInternalData.prevDragToChild = !!(isCrossDrag && isToChildDrag && isControlKey && immediate);
|
|
9196
|
+
customPanelInternalData.prevDragCol = column;
|
|
9197
|
+
customPanelInternalData.prevDragPos = dragPos;
|
|
9104
9198
|
showDropTip(evnt, optEl, true, dragPos);
|
|
9105
9199
|
}
|
|
9106
9200
|
};
|
|
9107
9201
|
const renderDragTip = () => {
|
|
9108
|
-
const
|
|
9202
|
+
const {
|
|
9203
|
+
dragTipText
|
|
9204
|
+
} = customPanelReactData;
|
|
9109
9205
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
9110
9206
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9111
9207
|
ref: refDragLineElem,
|
|
@@ -9123,11 +9219,15 @@ const {
|
|
|
9123
9219
|
class: ['vxe-table-custom-popup--drag-tip-normal-status', panel_getIcon().TABLE_DRAG_STATUS_ROW]
|
|
9124
9220
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
9125
9221
|
class: ['vxe-table-custom-popup--drag-tip-sub-status', panel_getIcon().TABLE_DRAG_STATUS_SUB_ROW]
|
|
9222
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
9223
|
+
class: ['vxe-table-custom-popup--drag-tip-group-status', panel_getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
|
|
9224
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
9225
|
+
class: ['vxe-table-custom-popup--drag-tip-values-status', panel_getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
|
|
9126
9226
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
9127
9227
|
class: ['vxe-table-custom-popup--drag-tip-disabled-status', panel_getIcon().TABLE_DRAG_DISABLED]
|
|
9128
9228
|
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9129
9229
|
class: 'vxe-table-custom-popup--drag-tip-content'
|
|
9130
|
-
},
|
|
9230
|
+
}, `${dragTipText || ''}`)])])]);
|
|
9131
9231
|
};
|
|
9132
9232
|
const renderSimplePanel = () => {
|
|
9133
9233
|
const $xeGrid = $xeTable.xeGrid;
|
|
@@ -9143,7 +9243,7 @@ const {
|
|
|
9143
9243
|
const {
|
|
9144
9244
|
isCustomStatus,
|
|
9145
9245
|
customColumnList
|
|
9146
|
-
} =
|
|
9246
|
+
} = tableReactData;
|
|
9147
9247
|
const customOpts = computeCustomOpts.value;
|
|
9148
9248
|
const {
|
|
9149
9249
|
immediate
|
|
@@ -9220,9 +9320,9 @@ const {
|
|
|
9220
9320
|
'is--disabled': isDisabled
|
|
9221
9321
|
}],
|
|
9222
9322
|
title: panel_getI18n('vxe.custom.setting.colVisible'),
|
|
9223
|
-
onClick:
|
|
9323
|
+
onClick: evnt => {
|
|
9224
9324
|
if (!isDisabled) {
|
|
9225
|
-
changeCheckboxOption(column);
|
|
9325
|
+
changeCheckboxOption(column, evnt);
|
|
9226
9326
|
}
|
|
9227
9327
|
}
|
|
9228
9328
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
@@ -9257,8 +9357,10 @@ const {
|
|
|
9257
9357
|
status: column.renderFixed === 'left' ? 'primary' : '',
|
|
9258
9358
|
disabled: isDisabled || isHidden || isMaxFixedColumn && !column.renderFixed,
|
|
9259
9359
|
title: panel_getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft'),
|
|
9260
|
-
onClick: (
|
|
9261
|
-
|
|
9360
|
+
onClick: ({
|
|
9361
|
+
$event
|
|
9362
|
+
}) => {
|
|
9363
|
+
changeFixedOption(column, 'left', $event);
|
|
9262
9364
|
}
|
|
9263
9365
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), VxeUIButtonComponent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUIButtonComponent, {
|
|
9264
9366
|
mode: 'text',
|
|
@@ -9266,8 +9368,10 @@ const {
|
|
|
9266
9368
|
status: column.renderFixed === 'right' ? 'primary' : '',
|
|
9267
9369
|
disabled: isDisabled || isHidden || isMaxFixedColumn && !column.renderFixed,
|
|
9268
9370
|
title: panel_getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight'),
|
|
9269
|
-
onClick: (
|
|
9270
|
-
|
|
9371
|
+
onClick: ({
|
|
9372
|
+
$event
|
|
9373
|
+
}) => {
|
|
9374
|
+
changeFixedOption(column, 'right', $event);
|
|
9271
9375
|
}
|
|
9272
9376
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]));
|
|
9273
9377
|
}
|
|
@@ -9281,9 +9385,13 @@ const {
|
|
|
9281
9385
|
style: maxHeight && !['left', 'right'].includes(placement) ? {
|
|
9282
9386
|
maxHeight: `${maxHeight}px`
|
|
9283
9387
|
} : {}
|
|
9284
|
-
}, customStore.visible ? [
|
|
9388
|
+
}, customStore.visible ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9389
|
+
ref: refBodyWrapperElem,
|
|
9390
|
+
class: 'vxe-table-custom-simple--body-wrapper'
|
|
9391
|
+
}, [!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)($xeTable.getPivotTableAggregateSimplePanel(), {
|
|
9285
9392
|
customStore
|
|
9286
9393
|
}) : panel_renderEmptyElement($xeTable), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9394
|
+
ref: refCustomBodyElem,
|
|
9287
9395
|
class: 'vxe-table-custom--handle-wrapper'
|
|
9288
9396
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9289
9397
|
class: 'vxe-table-custom--header'
|
|
@@ -9305,7 +9413,6 @@ const {
|
|
|
9305
9413
|
}, panel_getI18n('vxe.toolbar.customAll'))]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
9306
9414
|
class: 'vxe-checkbox--label'
|
|
9307
9415
|
}, panel_getI18n('vxe.table.customTitle'))])])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9308
|
-
ref: bodyElemRef,
|
|
9309
9416
|
class: 'vxe-table-custom--body'
|
|
9310
9417
|
}, [topSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9311
9418
|
class: 'vxe-table-custom--panel-top'
|
|
@@ -9320,7 +9427,7 @@ const {
|
|
|
9320
9427
|
default: () => colVNs
|
|
9321
9428
|
}), bottomSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9322
9429
|
class: 'vxe-table-custom--panel-bottom'
|
|
9323
|
-
}, $xeTable.callSlot(bottomSlot, params)) : panel_renderEmptyElement($xeTable)
|
|
9430
|
+
}, $xeTable.callSlot(bottomSlot, params)) : panel_renderEmptyElement($xeTable)]), customOpts.showFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9324
9431
|
class: 'vxe-table-custom--footer'
|
|
9325
9432
|
}, footerSlot ? $xeTable.callSlot(footerSlot, params) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9326
9433
|
class: 'vxe-table-custom--footer-buttons'
|
|
@@ -9342,7 +9449,7 @@ const {
|
|
|
9342
9449
|
status: 'primary',
|
|
9343
9450
|
content: customOpts.confirmButtonText || panel_getI18n('vxe.table.customConfirm'),
|
|
9344
9451
|
onClick: confirmCustomEvent
|
|
9345
|
-
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]) : null])] : []);
|
|
9452
|
+
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]) : null]), renderDragTip()])] : []);
|
|
9346
9453
|
};
|
|
9347
9454
|
const renderPopupPanel = () => {
|
|
9348
9455
|
const $xeGrid = $xeTable.xeGrid;
|
|
@@ -9355,7 +9462,7 @@ const {
|
|
|
9355
9462
|
const {
|
|
9356
9463
|
isCustomStatus,
|
|
9357
9464
|
customColumnList
|
|
9358
|
-
} =
|
|
9465
|
+
} = tableReactData;
|
|
9359
9466
|
const customOpts = computeCustomOpts.value;
|
|
9360
9467
|
const {
|
|
9361
9468
|
immediate
|
|
@@ -9455,9 +9562,9 @@ const {
|
|
|
9455
9562
|
'is--disabled': isDisabled
|
|
9456
9563
|
}],
|
|
9457
9564
|
title: panel_getI18n('vxe.custom.setting.colVisible'),
|
|
9458
|
-
onClick:
|
|
9565
|
+
onClick: evnt => {
|
|
9459
9566
|
if (!isDisabled) {
|
|
9460
|
-
changeCheckboxOption(column);
|
|
9567
|
+
changeCheckboxOption(column, evnt);
|
|
9461
9568
|
}
|
|
9462
9569
|
}
|
|
9463
9570
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
@@ -9523,20 +9630,23 @@ const {
|
|
|
9523
9630
|
value: 'right',
|
|
9524
9631
|
disabled: isDisabled || isHidden || isMaxFixedColumn
|
|
9525
9632
|
}],
|
|
9526
|
-
|
|
9527
|
-
|
|
9633
|
+
onChange({
|
|
9634
|
+
label,
|
|
9635
|
+
$event
|
|
9636
|
+
}) {
|
|
9637
|
+
changeFixedOption(column, label, $event);
|
|
9528
9638
|
}
|
|
9529
9639
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]));
|
|
9530
9640
|
}
|
|
9531
9641
|
});
|
|
9532
9642
|
const scopedSlots = {
|
|
9533
9643
|
default: () => {
|
|
9534
|
-
if (defaultSlot) {
|
|
9535
|
-
return $xeTable.callSlot(defaultSlot, params);
|
|
9536
|
-
}
|
|
9537
9644
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9538
|
-
ref:
|
|
9539
|
-
class: 'vxe-table-custom-popup--body'
|
|
9645
|
+
ref: refBodyWrapperElem,
|
|
9646
|
+
class: 'vxe-table-custom-popup--body-wrapper'
|
|
9647
|
+
}, defaultSlot ? $xeTable.callSlot(defaultSlot, params) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9648
|
+
ref: refCustomBodyElem,
|
|
9649
|
+
class: 'vxe-table-custom-popup--handle-wrapper'
|
|
9540
9650
|
}, [topSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9541
9651
|
class: 'vxe-table-custom-popup--table-top'
|
|
9542
9652
|
}, $xeTable.callSlot(topSlot, params)) : panel_renderEmptyElement($xeTable), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
@@ -9568,7 +9678,7 @@ const {
|
|
|
9568
9678
|
default: () => trVNs
|
|
9569
9679
|
})])]), bottomSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9570
9680
|
class: 'vxe-table-custom-popup--table-bottom'
|
|
9571
|
-
}, $xeTable.callSlot(bottomSlot, params)) : panel_renderEmptyElement($xeTable), renderDragTip()]);
|
|
9681
|
+
}, $xeTable.callSlot(bottomSlot, params)) : panel_renderEmptyElement($xeTable), renderDragTip()])]);
|
|
9572
9682
|
},
|
|
9573
9683
|
footer: () => {
|
|
9574
9684
|
if (footerSlot) {
|
|
@@ -9666,7 +9776,22 @@ const {
|
|
|
9666
9776
|
errLog('vxe.error.reqComp', ['vxe-radio-group']);
|
|
9667
9777
|
}
|
|
9668
9778
|
});
|
|
9669
|
-
|
|
9779
|
+
const $xeTableCustomPanel = {
|
|
9780
|
+
xID,
|
|
9781
|
+
props,
|
|
9782
|
+
context,
|
|
9783
|
+
reactData: customPanelReactData,
|
|
9784
|
+
internalData: customPanelInternalData,
|
|
9785
|
+
xeTable: $xeTable,
|
|
9786
|
+
getRefMaps: () => refMaps,
|
|
9787
|
+
getComputeMaps: () => computeMaps,
|
|
9788
|
+
renderVN
|
|
9789
|
+
};
|
|
9790
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeTableCustomPanel', $xeTableCustomPanel);
|
|
9791
|
+
return $xeTableCustomPanel;
|
|
9792
|
+
},
|
|
9793
|
+
render() {
|
|
9794
|
+
return this.renderVN();
|
|
9670
9795
|
}
|
|
9671
9796
|
}));
|
|
9672
9797
|
;// ./packages/table/module/filter/panel.ts
|
|
@@ -10837,7 +10962,7 @@ if(resizableData||sortData||visibleData||fixedData){external_root_XEUtils_common
|
|
|
10837
10962
|
if(!parentColumn){if(fixedData&&fixedData[colKey]!==undefined){column.fixed=fixedData[colKey];}if(sortData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(sortData[colKey])){hasCustomSort=true;column.renderSortNumber=sortData[colKey];}}if(resizableData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])){column.resizeWidth=resizableData[colKey];}if(visibleData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])){column.visible=visibleData[colKey];}});// 如果自定义了顺序
|
|
10838
10963
|
if(hasCustomSort){collectColumn=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(collectColumn,'renderSortNumber');internalData.collectColumn=collectColumn;internalData.tableFullColumn=getColumnList(collectColumn);}reactData.isCustomStatus=true;}else{reactData.isCustomStatus=false;}};/**
|
|
10839
10964
|
* 还原自定义列操作状态
|
|
10840
|
-
*/const restoreCustomStorage=()=>{const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{storage,restoreStore,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);if((customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({$table:$xeTable,id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore(storeData);}).catch(e=>e);}else{return handleCustomRestore(storeData);}}};/**
|
|
10965
|
+
*/const restoreCustomStorage=()=>{const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{storage,restoreStore,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({$table:$xeTable,id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore(storeData);}).catch(e=>e);}else{return handleCustomRestore(storeData);}}};/**
|
|
10841
10966
|
* 更新数据列的 Map
|
|
10842
10967
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
10843
10968
|
*/const cacheColumnMap=()=>{const{tableFullColumn,collectColumn}=internalData;const fullColumnIdData=internalData.fullColumnIdData={};const fullColumnFieldData=internalData.fullColumnFieldData={};const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const columnOpts=computeColumnOpts.value;const columnDragOpts=computeColumnDragOpts.value;const virtualYOpts=computeVirtualYOpts.value;const{isCrossDrag,isSelfToChildDrag}=columnDragOpts;const customOpts=computeCustomOpts.value;const{storage}=customOpts;const rowOpts=computeRowOpts.value;const isGroup=collectColumn.some(hasChildrenList);let isAllOverflow=!!props.showOverflow;let rowGroupColumn;let expandColumn;let treeNodeColumn;let checkboxColumn;let radioColumn;let htmlColumn;let hasFixed;const handleFunc=(column,index,items,path,parentColumn)=>{const{id:colid,field,fixed,type,treeNode,rowGroupNode}=column;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};if(field){if(fullColumnFieldData[field]){errLog('vxe.error.colRepet',['field',field]);}fullColumnFieldData[field]=rest;}else{if(storage&&!type||columnOpts.drag&&(isCrossDrag||isSelfToChildDrag)){errLog('vxe.error.reqProp',[`${column.getTitle()||type||''} -> column.field=?`]);}}if(!hasFixed&&fixed){hasFixed=fixed;}if(!htmlColumn&&type==='html'){htmlColumn=column;}if(treeNode){if(treeNodeColumn){warnLog('vxe.error.colRepet',['tree-node',treeNode]);}if(!treeNodeColumn){treeNodeColumn=column;}}if(rowGroupNode){if(treeNodeColumn){warnLog('vxe.error.colRepet',['row-group-node',rowGroupNode]);}if(!rowGroupColumn){rowGroupColumn=column;}}if(type==='expand'){if(expandColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!expandColumn){expandColumn=column;}}if(type==='checkbox'){if(checkboxColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!checkboxColumn){checkboxColumn=column;}}else if(type==='radio'){if(radioColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!radioColumn){radioColumn=column;}}if(isAllOverflow&&column.showOverflow===false){isAllOverflow=false;}if(fullColumnIdData[colid]){errLog('vxe.error.colRepet',['colId',colid]);}fullColumnIdData[colid]=rest;};if(isGroup){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn,nodes)=>{column.level=nodes.length;handleFunc(column,index,items,path,parentColumn);});}else{tableFullColumn.forEach(handleFunc);}if(expandColumn&&expandOpts.mode!=='fixed'&&virtualYOpts.enabled){warnLog('vxe.error.notConflictProp',['column.type="expand','virtual-y-config.enabled=false']);}if(expandColumn&&expandOpts.mode!=='fixed'&&mouseOpts.area){errLog('vxe.error.errConflicts',['mouse-config.area','column.type=expand']);}if(htmlColumn){if(!columnOpts.useKey){errLog('vxe.error.reqProp',['column-config.useKey & column.type=html']);}if(!rowOpts.useKey){errLog('vxe.error.reqProp',['row-config.useKey & column.type=html']);}}reactData.isGroup=isGroup;reactData.rowGroupColumn=rowGroupColumn;reactData.treeNodeColumn=treeNodeColumn;reactData.expandColumn=expandColumn;reactData.isAllOverflow=isAllOverflow;};const updateHeight=()=>{internalData.customHeight=calcTableHeight('height');internalData.customMinHeight=calcTableHeight('minHeight');internalData.customMaxHeight=calcTableHeight('maxHeight');// 如果启用虚拟滚动,默认高度
|
|
@@ -11291,7 +11416,7 @@ rowExpandedMaps={};internalData.rowExpandedMaps=rowExpandedMaps;rows=rows.slice(
|
|
|
11291
11416
|
*/isRowExpandByRow(row){const{rowExpandedFlag}=reactData;const{rowExpandedMaps}=internalData;const rowid=getRowid($xeTable,row);return!!rowExpandedFlag&&!!rowExpandedMaps[rowid];},isExpandByRow(row){// 已废弃
|
|
11292
11417
|
warnLog('vxe.error.delFunc',['isExpandByRow','isRowExpandByRow']);return tableMethods.isRowExpandByRow(row);},/**
|
|
11293
11418
|
* 手动清空展开行状态,数据会恢复成未展开的状态
|
|
11294
|
-
*/clearRowExpand(){const{tableFullData}=internalData;const expandOpts=computeExpandOpts.value;const{reserve}=expandOpts;const expList=$xeTable.getRowExpandRecords();internalData.rowExpandedMaps={};reactData.rowExpandedFlag++;if(reserve){tableFullData.forEach(row=>handleRowExpandReserve(row,false));}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if(expList.length){return $xeTable.recalculate(true);}}).then(()=>{updateRowOffsetTop();updateRowExpandStyle();handleRowExpandScroll();return $xeTable.updateCellAreas();});},clearRowExpandReserve(){internalData.rowExpandedReserveRowMap={};return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getRowExpandRecords(){const rest=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.rowExpandedMaps,item=>{if(item){rest.push(item);}});return rest;},setRowGroups(fieldOrColumns){const{aggregateConfig,rowGroupConfig}=props;if(!(aggregateConfig||rowGroupConfig)){errLog('vxe.error.reqProp',['aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}if(fieldOrColumns){handleUpdateRowGroup((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumns)?fieldOrColumns:[fieldOrColumns]).map(fieldOrColumn=>{return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn)?fieldOrColumn:fieldOrColumn.field;}));return loadTableData(internalData.tableSynchData,true);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},clearRowGroups(){const{aggregateConfig,rowGroupConfig}=props;if(!(aggregateConfig||rowGroupConfig)){errLog('vxe.error.reqProp',['aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}handleUpdateRowGroup([]);return loadTableData(internalData.tableSynchData,true);},isRowGroupRecord(row){warnLog('vxe.error.delFunc',['isRowGroupRecord','isAggregateRecord']);return $xeTable.isAggregateRecord(row);},isRowGroupExpandByRow(row){warnLog('vxe.error.delFunc',['isRowGroupExpandByRow','isAggregateExpandByRow']);return $xeTable.isAggregateExpandByRow(row);},isAggregateRecord(row){const{isRowGroupStatus}=reactData;return isRowGroupStatus&&row.isAggregate;},isAggregateExpandByRow(row){const{rowGroupExpandedFlag}=reactData;const{rowGroupExpandedMaps}=internalData;return!!rowGroupExpandedFlag&&!!rowGroupExpandedMaps[getRowid($xeTable,row)];},setRowGroupExpand(rows,expanded){if(rows){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}return handleRowGroupVirtualExpand(rows,expanded);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},setAllRowGroupExpand(expanded){const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;const rgExpandedMaps={};if(expanded&&mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row[mapChildrenField]&&row[mapChildrenField].length){rgExpandedMaps[getRowid($xeTable,row)]=row;}},{children:mapChildrenField});}internalData.rowGroupExpandedMaps=rgExpandedMaps;handleVirtualTreeToList();$xeTable.handleTableData();updateAfterDataIndex();reactData.rowGroupExpandedFlag++;return $xeTable.recalculate(true);},clearRowGroupExpand(){internalData.rowGroupExpandedMaps={};handleVirtualTreeToList();$xeTable.handleTableData();updateAfterDataIndex();reactData.rowGroupExpandedFlag++;return $xeTable.recalculate(true);},getTreeExpandRecords(){const rest=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.treeExpandedMaps,item=>{if(item){rest.push(item);}});return rest;},/**
|
|
11419
|
+
*/clearRowExpand(){const{tableFullData}=internalData;const expandOpts=computeExpandOpts.value;const{reserve}=expandOpts;const expList=$xeTable.getRowExpandRecords();internalData.rowExpandedMaps={};reactData.rowExpandedFlag++;if(reserve){tableFullData.forEach(row=>handleRowExpandReserve(row,false));}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if(expList.length){return $xeTable.recalculate(true);}}).then(()=>{updateRowOffsetTop();updateRowExpandStyle();handleRowExpandScroll();return $xeTable.updateCellAreas();});},clearRowExpandReserve(){internalData.rowExpandedReserveRowMap={};return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getRowExpandRecords(){const rest=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.rowExpandedMaps,item=>{if(item){rest.push(item);}});return rest;},setRowGroups(fieldOrColumns){const{aggregateConfig,rowGroupConfig}=props;if(!(aggregateConfig||rowGroupConfig)){errLog('vxe.error.reqProp',['aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}if(fieldOrColumns){handleUpdateRowGroup((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumns)?fieldOrColumns:[fieldOrColumns]).map(fieldOrColumn=>{return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn)?fieldOrColumn:fieldOrColumn.field;}));return loadTableData(internalData.tableSynchData,true);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},clearRowGroups(){const{aggregateConfig,rowGroupConfig}=props;if(!(aggregateConfig||rowGroupConfig)){errLog('vxe.error.reqProp',['aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}handleUpdateRowGroup([]);return loadTableData(internalData.tableSynchData,true);},isRowGroupRecord(row){warnLog('vxe.error.delFunc',['isRowGroupRecord','isAggregateRecord']);return $xeTable.isAggregateRecord(row);},isRowGroupExpandByRow(row){warnLog('vxe.error.delFunc',['isRowGroupExpandByRow','isAggregateExpandByRow']);return $xeTable.isAggregateExpandByRow(row);},isAggregateRecord(row){const{isRowGroupStatus}=reactData;return isRowGroupStatus&&row.isAggregate;},getAggregateContentByRow(row){const{isRowGroupStatus}=reactData;return isRowGroupStatus&&row&&row.isAggregate?row.groupContent:'';},getAggregateRowChildren(row){const aggregateOpts=computeAggregateOpts.value;const{childrenField,mapChildrenField}=aggregateOpts;const{isRowGroupStatus}=reactData;return isRowGroupStatus&&row&&row.isAggregate&&childrenField&&mapChildrenField?row[mapChildrenField]||[]:[];},isAggregateExpandByRow(row){const{rowGroupExpandedFlag}=reactData;const{rowGroupExpandedMaps}=internalData;return!!rowGroupExpandedFlag&&!!rowGroupExpandedMaps[getRowid($xeTable,row)];},setRowGroupExpand(rows,expanded){if(rows){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}return handleRowGroupVirtualExpand(rows,expanded);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},setAllRowGroupExpand(expanded){const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;const rgExpandedMaps={};if(expanded&&mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row[mapChildrenField]&&row[mapChildrenField].length){rgExpandedMaps[getRowid($xeTable,row)]=row;}},{children:mapChildrenField});}internalData.rowGroupExpandedMaps=rgExpandedMaps;handleVirtualTreeToList();$xeTable.handleTableData();updateAfterDataIndex();reactData.rowGroupExpandedFlag++;return $xeTable.recalculate(true);},clearRowGroupExpand(){internalData.rowGroupExpandedMaps={};handleVirtualTreeToList();$xeTable.handleTableData();updateAfterDataIndex();reactData.rowGroupExpandedFlag++;return $xeTable.recalculate(true);},getTreeExpandRecords(){const rest=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.treeExpandedMaps,item=>{if(item){rest.push(item);}});return rest;},/**
|
|
11295
11420
|
* 判断树节点是否懒加载完成
|
|
11296
11421
|
* @param {Row} row 行对象
|
|
11297
11422
|
*/isTreeExpandLoaded(row){const{fullAllDataRowIdData}=internalData;const rowRest=fullAllDataRowIdData[getRowid($xeTable,row)];return rowRest&&!!rowRest.treeLoaded;},clearTreeExpandLoaded(rows){const{fullAllDataRowIdData,treeExpandedMaps}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;if(rows){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}rows.forEach(row=>{const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest.treeLoaded=false;if(treeExpandedMaps[rowid]){delete treeExpandedMaps[rowid];}}});}else{external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(fullAllDataRowIdData,rowRest=>{rowRest.treeLoaded=false;});}internalData.treeExpandedMaps={};if(transform){handleVirtualTreeToList();$xeTable.handleTableData();}reactData.treeExpandedFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
@@ -11349,7 +11474,7 @@ if(transform){return handleVirtualTreeExpand(rows,expanded);}else{return handleB
|
|
|
11349
11474
|
* 获取所有被合并的表尾
|
|
11350
11475
|
*/getMergeFooterItems(){return internalData.mergeFooterList.slice(0);},/**
|
|
11351
11476
|
* 清除所有表尾合并
|
|
11352
|
-
*/clearMergeFooterItems(){internalData.mergeFooterList=[];internalData.mergeFooterMaps={};internalData.mergeFooterCellMaps={};reactData.mergeFootFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return updateStyle();});},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCustomStoreData(){const{id}=props;const customOpts=computeCustomOpts.value;const{collectColumn}=internalData;const{storage,checkMethod,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);const resizableData={};const sortData={};const visibleData={};const fixedData={};const storeData={resizableData:undefined,sortData:undefined,visibleData:undefined,fixedData:undefined};if(!id){errLog('vxe.error.reqProp',['id']);return storeData;}let hasResizable=0;let hasSort=0;let hasFixed=0;let hasVisible=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();if(!colKey){errLog('vxe.error.reqProp',[`${column.getTitle()||column.type||''} -> column.field=?`]);return;}// 只支持一级
|
|
11477
|
+
*/clearMergeFooterItems(){internalData.mergeFooterList=[];internalData.mergeFooterMaps={};internalData.mergeFooterCellMaps={};reactData.mergeFootFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return updateStyle();});},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCustomStoreData(){const{id}=props;const customOpts=computeCustomOpts.value;const{collectColumn}=internalData;const{storage,checkMethod,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);const resizableData={};const sortData={};const visibleData={};const fixedData={};const storeData={resizableData:undefined,sortData:undefined,visibleData:undefined,fixedData:undefined};if(!id){if(storage){errLog('vxe.error.reqProp',['id']);}return storeData;}let hasResizable=0;let hasSort=0;let hasFixed=0;let hasVisible=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();if(!colKey){errLog('vxe.error.reqProp',[`${column.getTitle()||column.type||''} -> column.field=?`]);return;}// 只支持一级
|
|
11353
11478
|
if(!parentColumn){if(isCustomSort){hasSort=1;sortData[colKey]=column.renderSortNumber;}if(isCustomFixed&&column.fixed!==column.defaultFixed){hasFixed=1;fixedData[colKey]=column.fixed;}}if(isCustomResizable&&column.resizeWidth){hasResizable=1;resizableData[colKey]=column.renderWidth;}if(isCustomVisible&&(!checkMethod||checkMethod({$table:$xeTable,column}))){if(!column.visible&&column.defaultVisible){hasVisible=1;visibleData[colKey]=false;}else if(column.visible&&!column.defaultVisible){hasVisible=1;visibleData[colKey]=true;}}});if(hasResizable){storeData.resizableData=resizableData;}if(hasSort){storeData.sortData=sortData;}if(hasFixed){storeData.fixedData=fixedData;}if(hasVisible){storeData.visibleData=visibleData;}return storeData;},focus(){internalData.isActivated=true;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},blur(){internalData.isActivated=false;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
11354
11479
|
* 连接工具栏
|
|
11355
11480
|
* @param $toolbar
|
|
@@ -11451,14 +11576,14 @@ if(treeConfig){const childrenField=treeOpts.children||treeOpts.childrenField;ext
|
|
|
11451
11576
|
const dragMinLeft=isRightFixed?0:cellRect.x-tableRect.x+dragBtnWidth+minInterval;const dragMaxLeft=cellRect.x-tableRect.x+cell.clientWidth-minInterval;let fixedLeftRemainWidth=0;let fixedRightRemainWidth=0;if(isLeftFixed||isRightFixed){let isMach=false;const fixedColumn=isLeftFixed?leftList:rightList;for(let i=0;i<fixedColumn.length;i++){const item=fixedColumn[i];if(isMach){fixedLeftRemainWidth+=item.renderWidth;}else{isMach=item.id===resizeColumn.id;if(!isMach){fixedRightRemainWidth+=item.renderWidth;}}}}// 处理拖动事件
|
|
11452
11577
|
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const tableHeight=tableEl.clientHeight;const offsetX=evnt.clientX-dragClientX;let left=dragPosLeft+offsetX;if(isLeftFixed){if(rightContainerRect){left=Math.min(left,rightContainerRect.x-tableRect.x-fixedLeftRemainWidth-minInterval);}}else if(isRightFixed){if(leftContainerElem){left=Math.max(left,leftContainerElem.clientWidth+fixedRightRemainWidth+minInterval);}left=Math.min(left,dragMaxLeft);}dragLeft=Math.max(left,dragMinLeft);const resizeBarLeft=Math.max(1,dragLeft);resizeBarElem.style.left=`${resizeBarLeft}px`;resizeBarElem.style.top=`${scrollbarXToTop?osbHeight:0}px`;resizeBarElem.style.height=`${scrollbarXToTop?tableHeight-osbHeight:tableHeight}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeColTip',[Math.floor(resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft))]);const tableWrapperWidth=tableEl.clientWidth;const resizeBarWidth=resizeBarElem.clientWidth;const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeTipLeft=-resizeTipWidth;if(resizeBarLeft<resizeTipWidth+resizeBarWidth){resizeTipLeft=0;}else if(resizeBarLeft>tableWrapperWidth){resizeTipLeft+=tableWrapperWidth-resizeBarLeft;}resizeTipElem.style.left=`${resizeTipLeft}px`;resizeTipElem.style.top=`${Math.min(tableHeight-resizeTipHeight,Math.max(0,evnt.clientY-tableRect.y-resizeTipHeight/2))}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'col-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);const resizeWidth=resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft);const resizeParams={...params,resizeWidth,resizeColumn};if(resizableOpts.dragMode==='fixed'){visibleColumn.forEach(item=>{if(item.id!==resizeColumn.id){if(!item.resizeWidth){item.resizeWidth=item.renderWidth;}}});}if($xeTable.handleColResizeCellAreaEvent){$xeTable.handleColResizeCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}removeClass(tableEl,'col-drag--resize');};updateEvent(evnt);if($xeTable.closeMenu){$xeTable.closeMenu();}},handleColResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoWidth}=resizableOpts;const el=refElem.value;if(isDblclickAutoWidth&&el){evnt.stopPropagation();evnt.preventDefault();const{fullColumnIdData}=internalData;const{column}=params;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const colid=resizeColumn.id;const colRest=fullColumnIdData[colid];const dragBtnElem=evnt.target;const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell});const colMinWidth=getColReMinWidth(cellParams);el.setAttribute('data-calc-col','Y');let resizeWidth=calcColumnAutoWidth(resizeColumn,el);el.removeAttribute('data-calc-col');if(colRest){resizeWidth=Math.max(resizeWidth,colRest.width);}resizeWidth=Math.max(colMinWidth,resizeWidth);const resizeParams={...params,resizeWidth,resizeColumn};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleColResizeDblclickCellAreaEvent){$xeTable.handleColResizeDblclickCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}}},handleRowResizeMousedownEvent(evnt,params){evnt.stopPropagation();evnt.preventDefault();const{row}=params;const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{elemStore,fullAllDataRowIdData}=internalData;const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const scrollbarYToLeft=computeScrollbarYToLeft.value;const resizableOpts=computeResizableOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const tableEl=refElem.value;const resizeBarElem=refRowResizeBar.value;if(!resizeBarElem){return;}const{clientY:dragClientY}=evnt;const resizeTipElem=resizeBarElem.firstElementChild;const dragBtnElem=evnt.currentTarget;const tdEl=dragBtnElem.parentNode;const trEl=tdEl.parentNode;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const defaultRowHeight=computeDefaultRowHeight.value;const currCellHeight=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;const tableRect=tableEl.getBoundingClientRect();const trRect=trEl.getBoundingClientRect();const targetOffsetY=dragClientY-trRect.y-trEl.clientHeight;let resizeHeight=currCellHeight;const cellEl=tdEl.querySelector('.vxe-cell');let cellMinHeight=0;if(cellEl){const cellStyle=getComputedStyle(cellEl);cellMinHeight=Math.max(1,Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingBottom)));}const minTop=trRect.y-tableRect.y+cellMinHeight;// 处理拖动事件
|
|
11453
11578
|
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const rtWidth=tableEl.clientWidth-osbWidth;const tableHeight=tableEl.clientHeight-osbHeight;let dragTop=evnt.clientY-tableRect.y-targetOffsetY;if(dragTop<minTop){dragTop=minTop;}else{resizeHeight=Math.max(cellMinHeight,currCellHeight+evnt.clientY-dragClientY);}resizeBarElem.style.left=`${scrollbarYToLeft?osbWidth:0}px`;resizeBarElem.style.top=`${dragTop}px`;resizeBarElem.style.width=`${rtWidth}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeRowTip',[resizeHeight]);const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeBarLeft=Math.max(2,evnt.clientX-tableRect.x);let resizeBarTop=0;if(resizeBarLeft+resizeTipWidth>=rtWidth-2){resizeBarLeft=rtWidth-resizeTipWidth-2;}if(dragTop+resizeTipHeight>=tableHeight){resizeBarTop=tableHeight-(dragTop+resizeTipHeight);}resizeTipElem.style.left=`${resizeBarLeft}px`;resizeTipElem.style.top=`${resizeBarTop}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'row-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);if(resizeHeight!==currCellHeight){const resizeParams={...params,resizeHeight,resizeRow:row};internalData.isResizeCellHeight=true;if($xeTable.handleRowResizeCellAreaEvent){$xeTable.handleRowResizeCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);updateRowOffsetTop();}}removeClass(tableEl,'row-drag--resize');};updateEvent(evnt);},handleRowResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoHeight}=resizableOpts;const el=refElem.value;if(isDblclickAutoHeight&&el){evnt.stopPropagation();evnt.preventDefault();const{editStore}=reactData;const{fullAllDataRowIdData}=internalData;const{actived}=editStore;const{row}=params;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const handleRsHeight=()=>{el.setAttribute('data-calc-row','Y');const resizeHeight=calcCellAutoHeight(rowRest,el);el.removeAttribute('data-calc-row');const resizeParams={...params,resizeHeight,resizeRow:row};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleRowResizeDblclickCellAreaEvent){$xeTable.handleRowResizeDblclickCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);}};if(actived.row||actived.column){$xeTable.clearEdit().then(handleRsHeight);}else{handleRsHeight();}}},saveCustomStore(type){const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{updateStore,storage,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);if(type!=='reset'){// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
11454
|
-
reactData.isCustomStatus=true;}if((customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const storeData=type==='reset'?{resizableData:{},sortData:{},visibleData:{},fixedData:{}}:tableMethods.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},handleCustom(){const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}tablePrivateMethods.analyColumnWidth();return tableMethods.refreshColumn(true);},handleUpdateDataQueue(){reactData.upDataFlag++;},handleRefreshColumnQueue(){reactData.reColumnFlag++;},preventEvent(evnt,type,args,next,end){let evntList=table_interceptor.get(type);// 兼容老版本
|
|
11579
|
+
reactData.isCustomStatus=true;}if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const storeData=type==='reset'?{resizableData:{},sortData:{},visibleData:{},fixedData:{}}:tableMethods.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},handleCustom(){const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}tablePrivateMethods.analyColumnWidth();return tableMethods.refreshColumn(true);},handleUpdateDataQueue(){reactData.upDataFlag++;},handleRefreshColumnQueue(){reactData.reColumnFlag++;},preventEvent(evnt,type,args,next,end){let evntList=table_interceptor.get(type);// 兼容老版本
|
|
11455
11580
|
if(!evntList.length&&type==='event.clearEdit'){evntList=table_interceptor.get('event.clearActived');if(evntList.length){warnLog('vxe.error.delEvent',['event.clearActived','event.clearEdit']);}}// 兼容老版本
|
|
11456
11581
|
let rest=null;let isStop=false;for(let i=0;i<evntList.length;i++){const func=evntList[i];const fnRest=func(Object.assign({$grid:$xeGrid,$table:$xeTable,$event:evnt},args));if(fnRest===false){isStop=true;break;}else if(fnRest&&fnRest.status===false){rest=fnRest.result;isStop=true;break;}}if(!isStop){if(next){rest=next();}}if(end){end();}return rest;},updateCheckboxStatus(){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterTreeFullData,afterGroupFullData,selectCheckboxMaps,treeIndeterminateRowMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const childrenField=treeOpts.children||treeOpts.childrenField;const checkboxOpts=computeCheckboxOpts.value;const{checkField,checkStrictly,checkMethod}=checkboxOpts;if(checkStrictly){return;}if(isRowGroupStatus||treeConfig){const{handleGetRowId}=createHandleGetRowId($xeTable);const childRowMaps={};const childRowList=[];if(isRowGroupStatus){// 行分组
|
|
11457
11582
|
const mapChildrenField=aggregateOpts.mapChildrenField;if(mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterGroupFullData,row=>{const rowid=handleGetRowId(row);const childList=row[mapChildrenField];if(childList&&childList.length&&!childRowMaps[rowid]){childRowMaps[rowid]=1;childRowList.unshift([row,rowid,childList]);}},{children:mapChildrenField});}}else if(treeConfig){// 树结构
|
|
11458
11583
|
const{transform,mapChildrenField}=treeOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData,row=>{const rowid=handleGetRowId(row);const childList=row[transform?mapChildrenField:childrenField];if(childList&&childList.length&&!childRowMaps[rowid]){childRowMaps[rowid]=1;childRowList.unshift([row,rowid,childList]);}},{children:transform?mapChildrenField:childrenField});}childRowList.forEach(vals=>{const row=vals[0];const rowid=vals[1];const childList=vals[2];let sLen=0;// 已选
|
|
11459
11584
|
let hLen=0;// 半选
|
|
11460
11585
|
let vLen=0;// 有效行
|
|
11461
|
-
childList.forEach(checkMethod?item=>{const childRowid=handleGetRowId(item);const isSelect=checkField?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item,checkField):selectCheckboxMaps[childRowid];if(checkMethod({$table:$xeTable,row:item})){if(isSelect){sLen++;}else if(treeIndeterminateRowMaps[childRowid]){hLen++;}vLen++;}else{if(isSelect){sLen++;}else if(treeIndeterminateRowMaps[childRowid]){hLen++;}}}:item=>{const childRowid=handleGetRowId(item);const isSelect=checkField?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item,checkField):selectCheckboxMaps[childRowid];if(isSelect){sLen++;}else if(treeIndeterminateRowMaps[childRowid]){hLen++;}vLen++;});const isSelected=sLen>=vLen;const halfSelect=!isSelected&&(sLen>=1||hLen>=1);if(checkField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,checkField,isSelected);}if(isSelected){if(!checkField){selectCheckboxMaps[rowid]=row;}if(treeIndeterminateRowMaps[rowid]){delete treeIndeterminateRowMaps[rowid];}}else{if(!checkField){if(selectCheckboxMaps[rowid]){delete selectCheckboxMaps[rowid];}}if(halfSelect){treeIndeterminateRowMaps[rowid]=row;}else{if(treeIndeterminateRowMaps[rowid]){delete treeIndeterminateRowMaps[rowid];}}}});}reactData.updateCheckboxFlag++;},updateAllCheckboxStatus(){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterFullData,afterTreeFullData,afterGroupFullData,checkboxReserveRowMap,selectCheckboxMaps,treeIndeterminateRowMaps}=internalData;const checkboxOpts=computeCheckboxOpts.value;const{checkField,checkMethod,showReserveStatus}=checkboxOpts;const{handleGetRowId}=createHandleGetRowId($xeTable);let sLen=0;// 已选
|
|
11586
|
+
childList.forEach(checkMethod?item=>{const childRowid=handleGetRowId(item);const isSelect=checkField?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item,checkField):selectCheckboxMaps[childRowid];if(checkMethod({$table:$xeTable,row:item})){if(isSelect){sLen++;}else if(treeIndeterminateRowMaps[childRowid]){hLen++;}vLen++;}else{if(isSelect){sLen++;}else if(treeIndeterminateRowMaps[childRowid]){hLen++;}}}:item=>{const childRowid=handleGetRowId(item);const isSelect=checkField?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(item,checkField):selectCheckboxMaps[childRowid];if(isSelect){sLen++;}else if(treeIndeterminateRowMaps[childRowid]){hLen++;}vLen++;});const isSelected=selectCheckboxMaps[rowid]||sLen>=vLen&&(vLen>=1||hLen>=1);const halfSelect=!isSelected&&(sLen>=1||hLen>=1);if(checkField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,checkField,isSelected);}if(isSelected){if(!checkField){selectCheckboxMaps[rowid]=row;}if(treeIndeterminateRowMaps[rowid]){delete treeIndeterminateRowMaps[rowid];}}else{if(!checkField){if(selectCheckboxMaps[rowid]){delete selectCheckboxMaps[rowid];}}if(halfSelect){treeIndeterminateRowMaps[rowid]=row;}else{if(treeIndeterminateRowMaps[rowid]){delete treeIndeterminateRowMaps[rowid];}}}});}reactData.updateCheckboxFlag++;},updateAllCheckboxStatus(){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterFullData,afterTreeFullData,afterGroupFullData,checkboxReserveRowMap,selectCheckboxMaps,treeIndeterminateRowMaps}=internalData;const checkboxOpts=computeCheckboxOpts.value;const{checkField,checkMethod,showReserveStatus}=checkboxOpts;const{handleGetRowId}=createHandleGetRowId($xeTable);let sLen=0;// 已选
|
|
11462
11587
|
let hLen=0;// 半选
|
|
11463
11588
|
let vLen=0;// 有效行
|
|
11464
11589
|
const rootList=treeConfig?afterTreeFullData:isRowGroupStatus?afterGroupFullData:afterFullData;rootList.forEach(checkMethod?row=>{const childRowid=handleGetRowId(row);const selected=checkField?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,checkField):selectCheckboxMaps[childRowid];if(checkMethod({$table:$xeTable,row})){if(selected){sLen++;}else if(treeIndeterminateRowMaps[childRowid]){hLen++;}vLen++;}else{if(selected){sLen++;}else if(treeIndeterminateRowMaps[childRowid]){hLen++;}}}:row=>{const childRowid=handleGetRowId(row);const selected=checkField?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,checkField):selectCheckboxMaps[childRowid];if(selected){sLen++;}else if(treeIndeterminateRowMaps[childRowid]){hLen++;}vLen++;});const isSelected=rootList.length>0?vLen>0?sLen>=vLen:sLen>=rootList.length:false;let halfSelect=!isSelected&&(sLen>=1||hLen>=1);// 如果复选框启用保留记录,当保留数据存在时显示半选
|
|
@@ -14945,7 +15070,7 @@ const {
|
|
|
14945
15070
|
hooks: edit_hook_hooks,
|
|
14946
15071
|
getI18n: hook_getI18n
|
|
14947
15072
|
} = core_.VxeUI;
|
|
14948
|
-
const tableEditMethodKeys = ['insert', 'insertAt', 'insertNextAt', 'insertChild', 'insertChildAt', 'insertChildNextAt', 'remove', 'removeCheckboxRow', 'removeRadioRow', 'removeCurrentRow', 'getRecordset', 'getInsertRecords', 'getRemoveRecords', 'getUpdateRecords', 'getEditRecord', 'getActiveRecord', 'getSelectedCell', 'clearEdit', 'clearActived', 'clearSelected', 'isEditByRow', 'isActiveByRow', 'setEditRow', 'setActiveRow', 'setEditCell', 'setActiveCell', 'setSelectCell'];
|
|
15073
|
+
const tableEditMethodKeys = ['insert', 'insertAt', 'insertNextAt', 'insertChild', 'insertChildAt', 'insertChildNextAt', 'remove', 'removeCheckboxRow', 'removeRadioRow', 'removeCurrentRow', 'getRecordset', 'getInsertRecords', 'getRemoveRecords', 'getUpdateRecords', 'getEditRecord', 'getActiveRecord', 'getEditCell', 'getSelectedCell', 'clearEdit', 'clearActived', 'clearSelected', 'isEditByRow', 'isActiveByRow', 'setEditRow', 'setActiveRow', 'setEditCell', 'setActiveCell', 'setSelectCell'];
|
|
14949
15074
|
edit_hook_hooks.add('tableEditModule', {
|
|
14950
15075
|
setupTable($xeTable) {
|
|
14951
15076
|
const {
|
|
@@ -15844,23 +15969,56 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
15844
15969
|
return [];
|
|
15845
15970
|
},
|
|
15846
15971
|
getActiveRecord() {
|
|
15847
|
-
warnLog('vxe.error.delFunc', ['getActiveRecord', '
|
|
15848
|
-
|
|
15972
|
+
warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditCell']);
|
|
15973
|
+
const {
|
|
15974
|
+
editStore
|
|
15975
|
+
} = reactData;
|
|
15976
|
+
const {
|
|
15977
|
+
fullAllDataRowIdData
|
|
15978
|
+
} = internalData;
|
|
15979
|
+
const {
|
|
15980
|
+
args,
|
|
15981
|
+
row
|
|
15982
|
+
} = editStore.actived;
|
|
15983
|
+
if (args && row && fullAllDataRowIdData[getRowid($xeTable, row)]) {
|
|
15984
|
+
return Object.assign({}, args, {
|
|
15985
|
+
row
|
|
15986
|
+
});
|
|
15987
|
+
}
|
|
15988
|
+
return null;
|
|
15849
15989
|
},
|
|
15850
15990
|
getEditRecord() {
|
|
15991
|
+
warnLog('vxe.error.delFunc', ['getEditRecord', 'getEditCell']);
|
|
15851
15992
|
const {
|
|
15852
15993
|
editStore
|
|
15853
15994
|
} = reactData;
|
|
15854
15995
|
const {
|
|
15855
|
-
|
|
15996
|
+
fullAllDataRowIdData
|
|
15856
15997
|
} = internalData;
|
|
15857
|
-
const el = refElem.value;
|
|
15858
15998
|
const {
|
|
15859
15999
|
args,
|
|
15860
16000
|
row
|
|
15861
16001
|
} = editStore.actived;
|
|
15862
|
-
if (args && $xeTable
|
|
15863
|
-
return Object.assign({}, args
|
|
16002
|
+
if (args && row && fullAllDataRowIdData[getRowid($xeTable, row)]) {
|
|
16003
|
+
return Object.assign({}, args, {
|
|
16004
|
+
row
|
|
16005
|
+
});
|
|
16006
|
+
}
|
|
16007
|
+
return null;
|
|
16008
|
+
},
|
|
16009
|
+
getEditCell() {
|
|
16010
|
+
const {
|
|
16011
|
+
editStore
|
|
16012
|
+
} = reactData;
|
|
16013
|
+
const {
|
|
16014
|
+
row,
|
|
16015
|
+
column
|
|
16016
|
+
} = editStore.actived;
|
|
16017
|
+
if (column && row) {
|
|
16018
|
+
return {
|
|
16019
|
+
row,
|
|
16020
|
+
column
|
|
16021
|
+
};
|
|
15864
16022
|
}
|
|
15865
16023
|
return null;
|
|
15866
16024
|
},
|
|
@@ -15872,11 +16030,14 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
15872
16030
|
editStore
|
|
15873
16031
|
} = reactData;
|
|
15874
16032
|
const {
|
|
15875
|
-
|
|
16033
|
+
row,
|
|
15876
16034
|
column
|
|
15877
16035
|
} = editStore.selected;
|
|
15878
|
-
if (
|
|
15879
|
-
return
|
|
16036
|
+
if (row && column) {
|
|
16037
|
+
return {
|
|
16038
|
+
row,
|
|
16039
|
+
column
|
|
16040
|
+
};
|
|
15880
16041
|
}
|
|
15881
16042
|
return null;
|
|
15882
16043
|
},
|
|
@@ -16506,11 +16667,20 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
16506
16667
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
16507
16668
|
// 如果是树表格只允许导出数据源
|
|
16508
16669
|
const rest = [];
|
|
16509
|
-
const expandMaps =
|
|
16670
|
+
const expandMaps = {};
|
|
16671
|
+
const useMaps = {};
|
|
16672
|
+
const {
|
|
16673
|
+
handleGetRowId
|
|
16674
|
+
} = createHandleGetRowId($xeTable);
|
|
16510
16675
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(datas, (item, $rowIndex, items, path, parent, nodes) => {
|
|
16511
16676
|
const row = item._row || item;
|
|
16677
|
+
const rowid = handleGetRowId(row);
|
|
16678
|
+
if (useMaps[rowid]) {
|
|
16679
|
+
return;
|
|
16680
|
+
}
|
|
16512
16681
|
const parentRow = parent && parent._row ? parent._row : parent;
|
|
16513
|
-
|
|
16682
|
+
const pRowid = parentRow ? handleGetRowId(parentRow) : '';
|
|
16683
|
+
if (isAllExpand || !parentRow || expandMaps[pRowid] && $xeTable.isTreeExpandByRow(parentRow)) {
|
|
16514
16684
|
const hasRowChild = hasTreeChildren(row);
|
|
16515
16685
|
const item = {
|
|
16516
16686
|
_row: row,
|
|
@@ -16581,7 +16751,10 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
16581
16751
|
}
|
|
16582
16752
|
item[column.id] = toStringValue(cellValue);
|
|
16583
16753
|
});
|
|
16584
|
-
|
|
16754
|
+
useMaps[rowid] = true;
|
|
16755
|
+
if (pRowid) {
|
|
16756
|
+
expandMaps[pRowid] = true;
|
|
16757
|
+
}
|
|
16585
16758
|
rest.push(Object.assign(item, row));
|
|
16586
16759
|
}
|
|
16587
16760
|
}, {
|
|
@@ -17455,6 +17628,7 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
17455
17628
|
const {
|
|
17456
17629
|
tableFullColumn,
|
|
17457
17630
|
afterFullData,
|
|
17631
|
+
afterTreeFullData,
|
|
17458
17632
|
collectColumn,
|
|
17459
17633
|
mergeBodyList,
|
|
17460
17634
|
mergeFooterList
|
|
@@ -17734,8 +17908,10 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
17734
17908
|
}
|
|
17735
17909
|
}
|
|
17736
17910
|
if (mode === 'current') {
|
|
17737
|
-
handleOptions.data = afterFullData;
|
|
17911
|
+
handleOptions.data = treeConfig ? afterTreeFullData : afterFullData;
|
|
17738
17912
|
}
|
|
17913
|
+
} else {
|
|
17914
|
+
handleOptions._isCustomData = true;
|
|
17739
17915
|
}
|
|
17740
17916
|
return handleExport(handleOptions);
|
|
17741
17917
|
},
|
|
@@ -19260,7 +19436,7 @@ validator_hook_hooks.add('tableValidatorModule', {
|
|
|
19260
19436
|
|
|
19261
19437
|
|
|
19262
19438
|
|
|
19263
|
-
const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
|
|
19439
|
+
const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
|
|
19264
19440
|
core_.VxeUI.hooks.add('tableCustomModule', {
|
|
19265
19441
|
setupTable($xeTable) {
|
|
19266
19442
|
const {
|
|
@@ -19338,6 +19514,15 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19338
19514
|
}
|
|
19339
19515
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
19340
19516
|
};
|
|
19517
|
+
const toggleCustom = () => {
|
|
19518
|
+
const {
|
|
19519
|
+
customStore
|
|
19520
|
+
} = reactData;
|
|
19521
|
+
if (customStore.visible) {
|
|
19522
|
+
return closeCustom();
|
|
19523
|
+
}
|
|
19524
|
+
return openCustom();
|
|
19525
|
+
};
|
|
19341
19526
|
const saveCustom = () => {
|
|
19342
19527
|
const {
|
|
19343
19528
|
customColumnList,
|
|
@@ -19494,6 +19679,7 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19494
19679
|
const customMethods = {
|
|
19495
19680
|
openCustom,
|
|
19496
19681
|
closeCustom,
|
|
19682
|
+
toggleCustom,
|
|
19497
19683
|
saveCustom,
|
|
19498
19684
|
cancelCustom,
|
|
19499
19685
|
resetCustom(options) {
|