vxe-pc-ui 4.15.14 → 4.15.16
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/dist/all.esm.js +196 -99
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/button/style.css +31 -72
- package/es/button/style.min.css +1 -1
- package/es/cascader/style.css +29 -33
- package/es/cascader/style.min.css +1 -1
- package/es/checkbox/style.css +22 -28
- package/es/checkbox/style.min.css +1 -1
- package/es/context-menu/style.css +14 -13
- package/es/context-menu/style.min.css +1 -1
- package/es/date-picker/src/date-picker.js +1 -1
- package/es/form/style.css +45 -95
- package/es/form/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/icon-picker/style.css +20 -18
- package/es/icon-picker/style.min.css +1 -1
- package/es/layout-container/style.css +14 -0
- package/es/layout-container/style.min.css +1 -1
- package/es/list/style.css +26 -28
- package/es/list/style.min.css +1 -1
- package/es/menu/style.css +19 -33
- package/es/menu/style.min.css +1 -1
- package/es/notice-bar/style.css +14 -10
- package/es/notice-bar/style.min.css +1 -1
- package/es/radio/style.css +22 -30
- package/es/radio/style.min.css +1 -1
- package/es/select/style.css +42 -59
- package/es/select/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tree/src/tree.js +193 -96
- package/es/tree/style.css +26 -25
- package/es/tree/style.min.css +1 -1
- package/es/tree-select/style.css +27 -31
- package/es/tree-select/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/upload/style.css +30 -41
- package/es/upload/style.min.css +1 -1
- package/es/vxe-button/style.css +31 -72
- package/es/vxe-button/style.min.css +1 -1
- package/es/vxe-cascader/style.css +29 -33
- package/es/vxe-cascader/style.min.css +1 -1
- package/es/vxe-checkbox/style.css +22 -28
- package/es/vxe-checkbox/style.min.css +1 -1
- package/es/vxe-context-menu/style.css +14 -13
- package/es/vxe-context-menu/style.min.css +1 -1
- package/es/vxe-form/style.css +45 -95
- package/es/vxe-form/style.min.css +1 -1
- package/es/vxe-icon-picker/style.css +20 -18
- package/es/vxe-icon-picker/style.min.css +1 -1
- package/es/vxe-layout-container/style.css +14 -0
- package/es/vxe-layout-container/style.min.css +1 -1
- package/es/vxe-list/style.css +26 -28
- package/es/vxe-list/style.min.css +1 -1
- package/es/vxe-menu/style.css +19 -33
- package/es/vxe-menu/style.min.css +1 -1
- package/es/vxe-notice-bar/style.css +14 -10
- package/es/vxe-notice-bar/style.min.css +1 -1
- package/es/vxe-radio/style.css +22 -30
- package/es/vxe-radio/style.min.css +1 -1
- package/es/vxe-select/style.css +42 -59
- package/es/vxe-select/style.min.css +1 -1
- package/es/vxe-tree/style.css +26 -25
- package/es/vxe-tree/style.min.css +1 -1
- package/es/vxe-tree-select/style.css +27 -31
- package/es/vxe-tree-select/style.min.css +1 -1
- package/es/vxe-upload/style.css +30 -41
- package/es/vxe-upload/style.min.css +1 -1
- package/lib/button/style/style.css +31 -72
- package/lib/button/style/style.min.css +1 -1
- package/lib/cascader/style/style.css +29 -33
- package/lib/cascader/style/style.min.css +1 -1
- package/lib/checkbox/style/style.css +22 -28
- package/lib/checkbox/style/style.min.css +1 -1
- package/lib/context-menu/style/style.css +14 -13
- package/lib/context-menu/style/style.min.css +1 -1
- package/lib/date-picker/src/date-picker.js +1 -1
- package/lib/date-picker/src/date-picker.min.js +1 -1
- package/lib/form/style/style.css +45 -95
- package/lib/form/style/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/icon-picker/style/style.css +20 -18
- package/lib/icon-picker/style/style.min.css +1 -1
- package/lib/index.umd.js +217 -99
- package/lib/index.umd.min.js +1 -1
- package/lib/layout-container/style/style.css +14 -0
- package/lib/layout-container/style/style.min.css +1 -1
- package/lib/list/style/style.css +26 -28
- package/lib/list/style/style.min.css +1 -1
- package/lib/menu/style/style.css +19 -33
- package/lib/menu/style/style.min.css +1 -1
- package/lib/notice-bar/style/style.css +14 -10
- package/lib/notice-bar/style/style.min.css +1 -1
- package/lib/radio/style/style.css +22 -30
- package/lib/radio/style/style.min.css +1 -1
- package/lib/select/style/style.css +42 -59
- package/lib/select/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tree/src/tree.js +214 -96
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree/style/style.css +26 -25
- package/lib/tree/style/style.min.css +1 -1
- package/lib/tree-select/style/style.css +27 -31
- package/lib/tree-select/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/upload/style/style.css +30 -41
- package/lib/upload/style/style.min.css +1 -1
- package/lib/vxe-button/style/style.css +31 -72
- package/lib/vxe-button/style/style.min.css +1 -1
- package/lib/vxe-cascader/style/style.css +29 -33
- package/lib/vxe-cascader/style/style.min.css +1 -1
- package/lib/vxe-checkbox/style/style.css +22 -28
- package/lib/vxe-checkbox/style/style.min.css +1 -1
- package/lib/vxe-context-menu/style/style.css +14 -13
- package/lib/vxe-context-menu/style/style.min.css +1 -1
- package/lib/vxe-form/style/style.css +45 -95
- package/lib/vxe-form/style/style.min.css +1 -1
- package/lib/vxe-icon-picker/style/style.css +20 -18
- package/lib/vxe-icon-picker/style/style.min.css +1 -1
- package/lib/vxe-layout-container/style/style.css +14 -0
- package/lib/vxe-layout-container/style/style.min.css +1 -1
- package/lib/vxe-list/style/style.css +26 -28
- package/lib/vxe-list/style/style.min.css +1 -1
- package/lib/vxe-menu/style/style.css +19 -33
- package/lib/vxe-menu/style/style.min.css +1 -1
- package/lib/vxe-notice-bar/style/style.css +14 -10
- package/lib/vxe-notice-bar/style/style.min.css +1 -1
- package/lib/vxe-radio/style/style.css +22 -30
- package/lib/vxe-radio/style/style.min.css +1 -1
- package/lib/vxe-select/style/style.css +42 -59
- package/lib/vxe-select/style/style.min.css +1 -1
- package/lib/vxe-tree/style/style.css +26 -25
- package/lib/vxe-tree/style/style.min.css +1 -1
- package/lib/vxe-tree-select/style/style.css +27 -31
- package/lib/vxe-tree-select/style/style.min.css +1 -1
- package/lib/vxe-upload/style/style.css +30 -41
- package/lib/vxe-upload/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/date-picker/src/date-picker.ts +1 -1
- package/packages/tree/src/tree.ts +197 -96
- package/styles/components/button.scss +33 -69
- package/styles/components/cascader.scss +25 -27
- package/styles/components/checkbox.scss +22 -24
- package/styles/components/context-menu.scss +15 -13
- package/styles/components/form.scss +57 -134
- package/styles/components/icon-picker.scss +19 -16
- package/styles/components/layout-container.scss +15 -0
- package/styles/components/link.scss +1 -1
- package/styles/components/list.scss +24 -26
- package/styles/components/menu.scss +20 -34
- package/styles/components/notice-bar.scss +15 -13
- package/styles/components/radio.scss +22 -23
- package/styles/components/select.scss +36 -62
- package/styles/components/tree-select.scss +26 -27
- package/styles/components/tree.scss +16 -14
- package/styles/components/upload.scss +28 -30
- package/styles/helpers/baseMixin.scss +2 -2
- package/styles/theme/base.scss +11 -3
- package/types/components/icon-picker.d.ts +2 -1
- package/types/components/tree.d.ts +29 -5
- /package/es/icon/{iconfont.1782742200841.ttf → iconfont.1782833723333.ttf} +0 -0
- /package/es/icon/{iconfont.1782742200841.woff → iconfont.1782833723333.woff} +0 -0
- /package/es/icon/{iconfont.1782742200841.woff2 → iconfont.1782833723333.woff2} +0 -0
- /package/es/{iconfont.1782742200841.ttf → iconfont.1782833723333.ttf} +0 -0
- /package/es/{iconfont.1782742200841.woff → iconfont.1782833723333.woff} +0 -0
- /package/es/{iconfont.1782742200841.woff2 → iconfont.1782833723333.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1782742200841.ttf → iconfont.1782833723333.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1782742200841.woff → iconfont.1782833723333.woff} +0 -0
- /package/lib/icon/style/{iconfont.1782742200841.woff2 → iconfont.1782833723333.woff2} +0 -0
- /package/lib/{iconfont.1782742200841.ttf → iconfont.1782833723333.ttf} +0 -0
- /package/lib/{iconfont.1782742200841.woff → iconfont.1782833723333.woff} +0 -0
- /package/lib/{iconfont.1782742200841.woff2 → iconfont.1782833723333.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -81,7 +81,7 @@ function checkDynamic() {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
const { log } = VxeUI;
|
|
84
|
-
const uiVersion = `ui v${"4.15.
|
|
84
|
+
const uiVersion = `ui v${"4.15.16"}`;
|
|
85
85
|
function createComponentLog(name) {
|
|
86
86
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
87
87
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -95,7 +95,7 @@ function createComponentLog(name) {
|
|
|
95
95
|
const warnLog$c = log.create('warn', uiVersion);
|
|
96
96
|
log.create('error', uiVersion);
|
|
97
97
|
|
|
98
|
-
const version = "4.15.
|
|
98
|
+
const version = "4.15.16";
|
|
99
99
|
VxeUI.uiVersion = version;
|
|
100
100
|
VxeUI.dynamicApp = dynamicApp;
|
|
101
101
|
function config(options) {
|
|
@@ -19029,7 +19029,7 @@ VxeUI.component(VxeDatePanelComponent);
|
|
|
19029
19029
|
const DatePanel = VxeDatePanel;
|
|
19030
19030
|
|
|
19031
19031
|
const { warnLog: warnLog$9, errLog: errLog$e } = createComponentLog('date-picker');
|
|
19032
|
-
const defaultMaskPlaceholder = '
|
|
19032
|
+
const defaultMaskPlaceholder = '_';
|
|
19033
19033
|
const maskedTypes = ['year', 'month', 'date', 'datetime', 'time'];
|
|
19034
19034
|
const inputMaskedKeys = ['y', 'M', 'd', 'H', 'm', 'n', 's'];
|
|
19035
19035
|
const parseInputKayMaps = {};
|
|
@@ -39479,7 +39479,7 @@ function createInternalData$2() {
|
|
|
39479
39479
|
afterVisibleList: [],
|
|
39480
39480
|
nodeMaps: {},
|
|
39481
39481
|
selectCheckboxMaps: {},
|
|
39482
|
-
|
|
39482
|
+
indeterminateNodeMaps: {},
|
|
39483
39483
|
treeExpandedMaps: {},
|
|
39484
39484
|
treeExpandLazyLoadedMaps: {},
|
|
39485
39485
|
lastScrollLeft: 0,
|
|
@@ -39491,8 +39491,8 @@ function createInternalData$2() {
|
|
|
39491
39491
|
offsetSize: 0,
|
|
39492
39492
|
rowHeight: 0
|
|
39493
39493
|
},
|
|
39494
|
-
|
|
39495
|
-
|
|
39494
|
+
removeNodeMaps: {},
|
|
39495
|
+
insertNodeMaps: {},
|
|
39496
39496
|
// prevDragNode: null,
|
|
39497
39497
|
// prevDragToChild: false,
|
|
39498
39498
|
// prevDragPos: ''
|
|
@@ -39514,10 +39514,11 @@ function createReactData$2() {
|
|
|
39514
39514
|
treeList: [],
|
|
39515
39515
|
updateExpandedFlag: 1,
|
|
39516
39516
|
updateCheckboxFlag: 1,
|
|
39517
|
-
|
|
39518
|
-
|
|
39517
|
+
insertNodeFlag: 1,
|
|
39518
|
+
removeNodeFlag: 1,
|
|
39519
39519
|
dragNode: null,
|
|
39520
|
-
dragTipText: ''
|
|
39520
|
+
dragTipText: '',
|
|
39521
|
+
isCrossDragNode: false
|
|
39521
39522
|
};
|
|
39522
39523
|
}
|
|
39523
39524
|
let crossTreeDragNodeObj = null;
|
|
@@ -39705,7 +39706,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
39705
39706
|
const computeVirtualYOpts = computed(() => {
|
|
39706
39707
|
return Object.assign({}, getConfig().tree.virtualYConfig, props.virtualYConfig);
|
|
39707
39708
|
});
|
|
39708
|
-
const
|
|
39709
|
+
const computeIsNodeCurrent = computed(() => {
|
|
39709
39710
|
const nodeOpts = computeNodeOpts.value;
|
|
39710
39711
|
const { isCurrent } = nodeOpts;
|
|
39711
39712
|
if (XEUtils.isBoolean(isCurrent)) {
|
|
@@ -39713,7 +39714,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
39713
39714
|
}
|
|
39714
39715
|
return props.isCurrent;
|
|
39715
39716
|
});
|
|
39716
|
-
const
|
|
39717
|
+
const computeIsNodeHover = computed(() => {
|
|
39717
39718
|
const nodeOpts = computeNodeOpts.value;
|
|
39718
39719
|
const { isHover } = nodeOpts;
|
|
39719
39720
|
if (XEUtils.isBoolean(isHover)) {
|
|
@@ -39821,8 +39822,8 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
39821
39822
|
};
|
|
39822
39823
|
const isIndeterminateByCheckboxNodeid = (nodeid) => {
|
|
39823
39824
|
const { updateCheckboxFlag } = reactData;
|
|
39824
|
-
const {
|
|
39825
|
-
return !!(updateCheckboxFlag &&
|
|
39825
|
+
const { indeterminateNodeMaps } = internalData;
|
|
39826
|
+
return !!(updateCheckboxFlag && indeterminateNodeMaps[nodeid]);
|
|
39826
39827
|
};
|
|
39827
39828
|
const isIndeterminateByCheckboxNode = (node) => {
|
|
39828
39829
|
return isIndeterminateByCheckboxNodeid(getNodeId(node));
|
|
@@ -40108,10 +40109,10 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40108
40109
|
const expandMaps = {};
|
|
40109
40110
|
if (transform) {
|
|
40110
40111
|
const fullData = [];
|
|
40111
|
-
XEUtils.eachTree(afterTreeList, (item, index, items, path,
|
|
40112
|
+
XEUtils.eachTree(afterTreeList, (item, index, items, path, parentNode) => {
|
|
40112
40113
|
const nodeid = getNodeId(item);
|
|
40113
|
-
const parentNodeid = getNodeId(
|
|
40114
|
-
if (!
|
|
40114
|
+
const parentNodeid = getNodeId(parentNode);
|
|
40115
|
+
if (!parentNode || (expandMaps[parentNodeid] && treeExpandedMaps[parentNodeid])) {
|
|
40115
40116
|
expandMaps[nodeid] = 1;
|
|
40116
40117
|
fullData.push(item);
|
|
40117
40118
|
}
|
|
@@ -40159,6 +40160,10 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40159
40160
|
})
|
|
40160
40161
|
: list ? list.slice(0) : [];
|
|
40161
40162
|
internalData.treeFullData = fullData;
|
|
40163
|
+
internalData.insertNodeMaps = {};
|
|
40164
|
+
reactData.insertNodeFlag++;
|
|
40165
|
+
internalData.removeNodeMaps = {};
|
|
40166
|
+
reactData.removeNodeFlag++;
|
|
40162
40167
|
Object.assign(scrollYStore, {
|
|
40163
40168
|
startIndex: 0,
|
|
40164
40169
|
endIndex: 1,
|
|
@@ -40376,12 +40381,12 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40376
40381
|
const { showRadio, showCheckbox, trigger } = props;
|
|
40377
40382
|
const radioOpts = computeRadioOpts.value;
|
|
40378
40383
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
40379
|
-
const
|
|
40384
|
+
const isNodeCurrent = computeIsNodeCurrent.value;
|
|
40380
40385
|
let triggerCurrent = false;
|
|
40381
40386
|
let triggerRadio = false;
|
|
40382
40387
|
let triggerCheckbox = false;
|
|
40383
40388
|
let triggerExpand = false;
|
|
40384
|
-
if (
|
|
40389
|
+
if (isNodeCurrent) {
|
|
40385
40390
|
triggerCurrent = true;
|
|
40386
40391
|
changeCurrentEvent(evnt, node);
|
|
40387
40392
|
}
|
|
@@ -40407,12 +40412,12 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40407
40412
|
};
|
|
40408
40413
|
const handleContextmenuEvent = (evnt, node) => {
|
|
40409
40414
|
const { menuConfig } = props;
|
|
40410
|
-
const
|
|
40415
|
+
const isNodeCurrent = computeIsNodeCurrent.value;
|
|
40411
40416
|
const menuOpts = computeMenuOpts.value;
|
|
40412
40417
|
if (menuConfig ? isEnableConf(menuOpts) : menuOpts.enabled) {
|
|
40413
40418
|
const { options, visibleMethod } = menuOpts;
|
|
40414
40419
|
if (!visibleMethod || visibleMethod({ $tree: $xeTree, options, node })) {
|
|
40415
|
-
if (
|
|
40420
|
+
if (isNodeCurrent) {
|
|
40416
40421
|
changeCurrentEvent(evnt, node);
|
|
40417
40422
|
}
|
|
40418
40423
|
else if (reactData.currentNode) {
|
|
@@ -40468,15 +40473,15 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40468
40473
|
childRecords = [];
|
|
40469
40474
|
}
|
|
40470
40475
|
if (childRecords) {
|
|
40471
|
-
return $xeTree.loadChildrenNode(node, childRecords).then(
|
|
40476
|
+
return $xeTree.loadChildrenNode(node, childRecords).then(childNodes => {
|
|
40472
40477
|
const { treeExpandedMaps } = internalData;
|
|
40473
|
-
if (
|
|
40478
|
+
if (childNodes.length && !treeExpandedMaps[nodeid]) {
|
|
40474
40479
|
treeExpandedMaps[nodeid] = true;
|
|
40475
40480
|
}
|
|
40476
40481
|
reactData.updateExpandedFlag++;
|
|
40477
40482
|
// 如果当前节点已选中,则展开后子节点也被选中
|
|
40478
40483
|
if (!checkStrictly && $xeTree.isCheckedByCheckboxNodeId(nodeid)) {
|
|
40479
|
-
handleCheckedCheckboxNode(
|
|
40484
|
+
handleCheckedCheckboxNode(childNodes, true);
|
|
40480
40485
|
}
|
|
40481
40486
|
dispatchEvent('load-success', { node, data: childRecords }, new Event('load-success'));
|
|
40482
40487
|
return nextTick();
|
|
@@ -40575,23 +40580,23 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40575
40580
|
};
|
|
40576
40581
|
const updateCheckboxStatus = () => {
|
|
40577
40582
|
const { transform } = props;
|
|
40578
|
-
const { selectCheckboxMaps,
|
|
40583
|
+
const { selectCheckboxMaps, indeterminateNodeMaps, afterTreeList } = internalData;
|
|
40579
40584
|
const childrenField = computeChildrenField.value;
|
|
40580
40585
|
const mapChildrenField = computeMapChildrenField.value;
|
|
40581
40586
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
40582
40587
|
const { checkStrictly, checkMethod } = checkboxOpts;
|
|
40583
40588
|
if (!checkStrictly) {
|
|
40584
|
-
const
|
|
40585
|
-
const
|
|
40589
|
+
const childNodeMaps = {};
|
|
40590
|
+
const childNodeList = [];
|
|
40586
40591
|
XEUtils.eachTree(afterTreeList, (node) => {
|
|
40587
40592
|
const nodeid = getNodeId(node);
|
|
40588
40593
|
const childList = node[childrenField];
|
|
40589
|
-
if (childList && childList.length && !
|
|
40590
|
-
|
|
40591
|
-
|
|
40594
|
+
if (childList && childList.length && !childNodeMaps[nodeid]) {
|
|
40595
|
+
childNodeMaps[nodeid] = 1;
|
|
40596
|
+
childNodeList.unshift([node, nodeid, childList]);
|
|
40592
40597
|
}
|
|
40593
40598
|
}, { children: transform ? mapChildrenField : childrenField });
|
|
40594
|
-
|
|
40599
|
+
childNodeList.forEach(vals => {
|
|
40595
40600
|
const node = vals[0];
|
|
40596
40601
|
const nodeid = vals[1];
|
|
40597
40602
|
const childList = vals[2];
|
|
@@ -40607,7 +40612,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40607
40612
|
if (isSelect) {
|
|
40608
40613
|
sLen++;
|
|
40609
40614
|
}
|
|
40610
|
-
else if (
|
|
40615
|
+
else if (indeterminateNodeMaps[childNodeid]) {
|
|
40611
40616
|
hLen++;
|
|
40612
40617
|
}
|
|
40613
40618
|
vLen++;
|
|
@@ -40616,7 +40621,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40616
40621
|
if (isSelect) {
|
|
40617
40622
|
sLen++;
|
|
40618
40623
|
}
|
|
40619
|
-
else if (
|
|
40624
|
+
else if (indeterminateNodeMaps[childNodeid]) {
|
|
40620
40625
|
hLen++;
|
|
40621
40626
|
}
|
|
40622
40627
|
}
|
|
@@ -40627,7 +40632,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40627
40632
|
if (isSelect) {
|
|
40628
40633
|
sLen++;
|
|
40629
40634
|
}
|
|
40630
|
-
else if (
|
|
40635
|
+
else if (indeterminateNodeMaps[childNodeid]) {
|
|
40631
40636
|
hLen++;
|
|
40632
40637
|
}
|
|
40633
40638
|
vLen++;
|
|
@@ -40657,8 +40662,8 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40657
40662
|
const halfSelect = !isSelected && (sLen > 0 || hLen > 0);
|
|
40658
40663
|
if (isSelected) {
|
|
40659
40664
|
selectCheckboxMaps[nodeid] = node;
|
|
40660
|
-
if (
|
|
40661
|
-
delete
|
|
40665
|
+
if (indeterminateNodeMaps[nodeid]) {
|
|
40666
|
+
delete indeterminateNodeMaps[nodeid];
|
|
40662
40667
|
}
|
|
40663
40668
|
}
|
|
40664
40669
|
else {
|
|
@@ -40666,11 +40671,11 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40666
40671
|
delete selectCheckboxMaps[nodeid];
|
|
40667
40672
|
}
|
|
40668
40673
|
if (halfSelect) {
|
|
40669
|
-
|
|
40674
|
+
indeterminateNodeMaps[nodeid] = node;
|
|
40670
40675
|
}
|
|
40671
40676
|
else {
|
|
40672
|
-
if (
|
|
40673
|
-
delete
|
|
40677
|
+
if (indeterminateNodeMaps[nodeid]) {
|
|
40678
|
+
delete indeterminateNodeMaps[nodeid];
|
|
40674
40679
|
}
|
|
40675
40680
|
}
|
|
40676
40681
|
}
|
|
@@ -40791,9 +40796,9 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40791
40796
|
const mapChildrenField = computeMapChildrenField.value;
|
|
40792
40797
|
const funcName = isAppend ? 'push' : 'unshift';
|
|
40793
40798
|
newRecords.forEach((item) => {
|
|
40794
|
-
const
|
|
40799
|
+
const parentNodeId = item[parentField];
|
|
40795
40800
|
const nodeid = getNodeId(item);
|
|
40796
|
-
const matchObj =
|
|
40801
|
+
const matchObj = parentNodeId ? XEUtils.findTree(treeFullData, (item) => parentNodeId === item[keyField], { children: mapChildrenField }) : null;
|
|
40797
40802
|
const itemRest = getItemCacheObj(item);
|
|
40798
40803
|
if (matchObj) {
|
|
40799
40804
|
const { item: parentItem } = matchObj;
|
|
@@ -40814,7 +40819,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40814
40819
|
pMapChilds[funcName](item);
|
|
40815
40820
|
}
|
|
40816
40821
|
else {
|
|
40817
|
-
if (
|
|
40822
|
+
if (parentNodeId) {
|
|
40818
40823
|
warnLog$2('vxe.error.unableInsert');
|
|
40819
40824
|
}
|
|
40820
40825
|
treeFullData[funcName](item);
|
|
@@ -40824,7 +40829,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40824
40829
|
};
|
|
40825
40830
|
const handleInsertNodeAt = (records, targetNodeOrNodeid, isInsertNextNode) => {
|
|
40826
40831
|
const { transform } = props;
|
|
40827
|
-
const { treeFullData, nodeMaps } = internalData;
|
|
40832
|
+
const { treeFullData, nodeMaps, removeNodeMaps, insertNodeMaps } = internalData;
|
|
40828
40833
|
const keyField = computeKeyField.value;
|
|
40829
40834
|
const parentField = computeParentField.value;
|
|
40830
40835
|
const childrenField = computeChildrenField.value;
|
|
@@ -40862,26 +40867,26 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40862
40867
|
const parentMapChilds = parentNode ? parentNode[mapChildrenField] : treeFullData;
|
|
40863
40868
|
const parentRest = nodeMaps[getNodeId(parentNode)];
|
|
40864
40869
|
const parentLevel = parentRest ? parentRest.level : 0;
|
|
40865
|
-
treeRecords.forEach((
|
|
40870
|
+
treeRecords.forEach((item, i) => {
|
|
40866
40871
|
if (parentNode) {
|
|
40867
|
-
if (
|
|
40868
|
-
errLog$2('vxe.error.errProp', [`${parentField}=${
|
|
40869
|
-
|
|
40872
|
+
if (item[parentField] !== parentNode[keyField]) {
|
|
40873
|
+
errLog$2('vxe.error.errProp', [`${parentField}=${item[parentField]}`, `${parentField}=${parentNode[keyField]}`]);
|
|
40874
|
+
item[parentField] = parentNode[keyField];
|
|
40870
40875
|
}
|
|
40871
40876
|
}
|
|
40872
40877
|
else {
|
|
40873
|
-
if (
|
|
40874
|
-
if (!XEUtils.eqNull(
|
|
40875
|
-
errLog$2('vxe.error.errProp', [`${parentField}=${
|
|
40878
|
+
if (item[parentField] !== null) {
|
|
40879
|
+
if (!XEUtils.eqNull(item[parentField])) {
|
|
40880
|
+
errLog$2('vxe.error.errProp', [`${parentField}=${item[parentField]}`, 'null']);
|
|
40876
40881
|
}
|
|
40877
|
-
|
|
40882
|
+
item[parentField] = null;
|
|
40878
40883
|
}
|
|
40879
40884
|
}
|
|
40880
40885
|
let targetIndex = matchMapObj.index + i;
|
|
40881
40886
|
if (isInsertNextNode) {
|
|
40882
40887
|
targetIndex = targetIndex + 1;
|
|
40883
40888
|
}
|
|
40884
|
-
parentMapChilds.splice(targetIndex, 0,
|
|
40889
|
+
parentMapChilds.splice(targetIndex, 0, item);
|
|
40885
40890
|
});
|
|
40886
40891
|
XEUtils.eachTree(treeRecords, (item) => {
|
|
40887
40892
|
const nodeid = getNodeId(item);
|
|
@@ -40911,7 +40916,22 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40911
40916
|
}
|
|
40912
40917
|
}
|
|
40913
40918
|
}
|
|
40914
|
-
|
|
40919
|
+
const handleStatus = (newItem) => {
|
|
40920
|
+
const nodeid = getNodeId(newItem);
|
|
40921
|
+
// 如果是被删除的数据,则还原状态
|
|
40922
|
+
if (removeNodeMaps[nodeid]) {
|
|
40923
|
+
delete removeNodeMaps[nodeid];
|
|
40924
|
+
if (insertNodeMaps[nodeid]) {
|
|
40925
|
+
delete insertNodeMaps[nodeid];
|
|
40926
|
+
}
|
|
40927
|
+
}
|
|
40928
|
+
else {
|
|
40929
|
+
insertNodeMaps[nodeid] = newItem;
|
|
40930
|
+
}
|
|
40931
|
+
};
|
|
40932
|
+
XEUtils.eachTree(treeRecords, handleStatus, { children: mapChildrenField });
|
|
40933
|
+
reactData.removeNodeFlag++;
|
|
40934
|
+
reactData.insertNodeFlag++;
|
|
40915
40935
|
cacheNodeMap();
|
|
40916
40936
|
handleData(true);
|
|
40917
40937
|
updateAfterDataIndex();
|
|
@@ -40926,6 +40946,27 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
40926
40946
|
};
|
|
40927
40947
|
});
|
|
40928
40948
|
};
|
|
40949
|
+
const handleInsertChildNodeAt = (records, parentNodeOrParentId, targetNodeOrNodeid, isInsertNextNode) => {
|
|
40950
|
+
const { transform } = props;
|
|
40951
|
+
const { nodeMaps } = internalData;
|
|
40952
|
+
const keyField = computeKeyField.value;
|
|
40953
|
+
const parentField = computeParentField.value;
|
|
40954
|
+
if (!transform) {
|
|
40955
|
+
errLog$2('vxe.error.reqSupportProp', ['insertChild() | insertChildAt() | insertChildNextAt()', 'transform']);
|
|
40956
|
+
return Promise.resolve({ node: null, nodes: [] });
|
|
40957
|
+
}
|
|
40958
|
+
if (!XEUtils.isArray(records)) {
|
|
40959
|
+
records = [records];
|
|
40960
|
+
}
|
|
40961
|
+
let parentNode = parentNodeOrParentId;
|
|
40962
|
+
if (XEUtils.isString(parentNodeOrParentId) || XEUtils.isNumber(parentNodeOrParentId)) {
|
|
40963
|
+
const nodeRest = nodeMaps[parentNodeOrParentId];
|
|
40964
|
+
if (nodeRest) {
|
|
40965
|
+
parentNode = nodeRest.item;
|
|
40966
|
+
}
|
|
40967
|
+
}
|
|
40968
|
+
return handleInsertNodeAt(records.map((item) => Object.assign({}, item, { [parentField]: parentNode[keyField] })), targetNodeOrNodeid, isInsertNextNode);
|
|
40969
|
+
};
|
|
40929
40970
|
const treeMethods = {
|
|
40930
40971
|
dispatchEvent,
|
|
40931
40972
|
getNodeId,
|
|
@@ -41047,7 +41088,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41047
41088
|
return list;
|
|
41048
41089
|
},
|
|
41049
41090
|
clearCheckboxNode() {
|
|
41050
|
-
internalData.
|
|
41091
|
+
internalData.indeterminateNodeMaps = {};
|
|
41051
41092
|
internalData.selectCheckboxMaps = {};
|
|
41052
41093
|
reactData.updateCheckboxFlag++;
|
|
41053
41094
|
emitCheckboxMode([]);
|
|
@@ -41071,7 +41112,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41071
41112
|
selectMaps[nodeid] = true;
|
|
41072
41113
|
}, { children: transform ? mapChildrenField : childrenField });
|
|
41073
41114
|
}
|
|
41074
|
-
internalData.
|
|
41115
|
+
internalData.indeterminateNodeMaps = {};
|
|
41075
41116
|
internalData.selectCheckboxMaps = selectMaps;
|
|
41076
41117
|
reactData.updateCheckboxFlag++;
|
|
41077
41118
|
updateCheckboxStatus();
|
|
@@ -41251,10 +41292,10 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41251
41292
|
const parentLevel = parentNodeItem ? parentNodeItem.level : 0;
|
|
41252
41293
|
const parentNodes = parentNodeItem ? parentNodeItem.nodes : [];
|
|
41253
41294
|
return createNode(childRecords).then((nodeList) => {
|
|
41254
|
-
XEUtils.eachTree(nodeList, (
|
|
41255
|
-
const itemNodeId = getNodeId(
|
|
41295
|
+
XEUtils.eachTree(nodeList, (childNode, index, items, path, parent, nodes) => {
|
|
41296
|
+
const itemNodeId = getNodeId(childNode);
|
|
41256
41297
|
nodeMaps[itemNodeId] = {
|
|
41257
|
-
item:
|
|
41298
|
+
item: childNode,
|
|
41258
41299
|
index: -1,
|
|
41259
41300
|
$index: -1,
|
|
41260
41301
|
_index: -1,
|
|
@@ -41282,9 +41323,9 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41282
41323
|
isIndeterminateByCheckboxNode,
|
|
41283
41324
|
isCheckedByCheckboxNode,
|
|
41284
41325
|
getCheckboxIndeterminateNodes() {
|
|
41285
|
-
const { nodeMaps,
|
|
41326
|
+
const { nodeMaps, indeterminateNodeMaps } = internalData;
|
|
41286
41327
|
const list = [];
|
|
41287
|
-
XEUtils.each(
|
|
41328
|
+
XEUtils.each(indeterminateNodeMaps, (item, nodeid) => {
|
|
41288
41329
|
const nodeItem = nodeMaps[nodeid];
|
|
41289
41330
|
if (nodeItem) {
|
|
41290
41331
|
list.push(nodeItem.item);
|
|
@@ -41339,9 +41380,30 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41339
41380
|
insertNextAt(records, targetNodeOrNodeid) {
|
|
41340
41381
|
return handleInsertNodeAt(records, targetNodeOrNodeid, true);
|
|
41341
41382
|
},
|
|
41383
|
+
insertChild(records, parentNodeOrParentId) {
|
|
41384
|
+
return handleInsertChildNodeAt(records, parentNodeOrParentId, null);
|
|
41385
|
+
},
|
|
41386
|
+
insertChildAt(records, parentNodeOrParentId, targetNode) {
|
|
41387
|
+
return handleInsertChildNodeAt(records, parentNodeOrParentId, targetNode);
|
|
41388
|
+
},
|
|
41389
|
+
insertChildNextAt(records, parentNodeOrParentId, targetNode) {
|
|
41390
|
+
return handleInsertChildNodeAt(records, parentNodeOrParentId, targetNode, true);
|
|
41391
|
+
},
|
|
41392
|
+
getInsertRecords() {
|
|
41393
|
+
const { insertNodeMaps } = internalData;
|
|
41394
|
+
const insertRecords = [];
|
|
41395
|
+
XEUtils.each(insertNodeMaps, (item) => {
|
|
41396
|
+
insertRecords.push(item);
|
|
41397
|
+
});
|
|
41398
|
+
return insertRecords;
|
|
41399
|
+
},
|
|
41400
|
+
isInsertByNode(node) {
|
|
41401
|
+
const nodeid = getNodeId(node);
|
|
41402
|
+
return !!reactData.insertNodeFlag && !!internalData.insertNodeMaps[nodeid];
|
|
41403
|
+
},
|
|
41342
41404
|
remove(nodes) {
|
|
41343
41405
|
const { transform } = props;
|
|
41344
|
-
const { treeFullData } = internalData;
|
|
41406
|
+
const { treeFullData, insertNodeMaps, removeNodeMaps } = internalData;
|
|
41345
41407
|
const childrenField = computeChildrenField.value;
|
|
41346
41408
|
const mapChildrenField = computeMapChildrenField.value;
|
|
41347
41409
|
if (!transform) {
|
|
@@ -41358,6 +41420,13 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41358
41420
|
if (!nodes.length) {
|
|
41359
41421
|
return Promise.resolve({ node: null, nodes: [] });
|
|
41360
41422
|
}
|
|
41423
|
+
// 如果是新增,则保存记录
|
|
41424
|
+
nodes.forEach((item) => {
|
|
41425
|
+
if (!$xeTree.isInsertByNode(item)) {
|
|
41426
|
+
const nodeid = getNodeId(item);
|
|
41427
|
+
removeNodeMaps[nodeid] = item;
|
|
41428
|
+
}
|
|
41429
|
+
});
|
|
41361
41430
|
// 从数据源中移除
|
|
41362
41431
|
if (treeFullData === nodes) {
|
|
41363
41432
|
nodes = delList = treeFullData.slice(0);
|
|
@@ -41378,8 +41447,15 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41378
41447
|
}
|
|
41379
41448
|
});
|
|
41380
41449
|
}
|
|
41381
|
-
|
|
41382
|
-
|
|
41450
|
+
// 从新增中移除已删除的数据
|
|
41451
|
+
nodes.forEach((item) => {
|
|
41452
|
+
const nodeid = getNodeId(item);
|
|
41453
|
+
if (insertNodeMaps[nodeid]) {
|
|
41454
|
+
delete insertNodeMaps[nodeid];
|
|
41455
|
+
}
|
|
41456
|
+
});
|
|
41457
|
+
reactData.removeNodeFlag++;
|
|
41458
|
+
reactData.insertNodeFlag++;
|
|
41383
41459
|
cacheNodeMap();
|
|
41384
41460
|
handleData(true);
|
|
41385
41461
|
updateAfterDataIndex();
|
|
@@ -41393,21 +41469,17 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41393
41469
|
return { node: delList.length ? delList[delList.length - 1] : null, nodes: delList };
|
|
41394
41470
|
});
|
|
41395
41471
|
},
|
|
41396
|
-
getInsertRecords() {
|
|
41397
|
-
const { insertRowMaps } = internalData;
|
|
41398
|
-
const insertRecords = [];
|
|
41399
|
-
XEUtils.each(insertRowMaps, (row) => {
|
|
41400
|
-
insertRecords.push(row);
|
|
41401
|
-
});
|
|
41402
|
-
return insertRecords;
|
|
41403
|
-
},
|
|
41404
41472
|
getRemoveRecords() {
|
|
41405
|
-
const {
|
|
41473
|
+
const { removeNodeMaps } = internalData;
|
|
41406
41474
|
const removeRecords = [];
|
|
41407
|
-
XEUtils.each(
|
|
41408
|
-
removeRecords.push(
|
|
41475
|
+
XEUtils.each(removeNodeMaps, (item) => {
|
|
41476
|
+
removeRecords.push(item);
|
|
41409
41477
|
});
|
|
41410
41478
|
return removeRecords;
|
|
41479
|
+
},
|
|
41480
|
+
isRemoveByNode(node) {
|
|
41481
|
+
const nodeid = getNodeId(node);
|
|
41482
|
+
return !!reactData.removeNodeFlag && !!internalData.removeNodeMaps[nodeid];
|
|
41411
41483
|
}
|
|
41412
41484
|
};
|
|
41413
41485
|
const handleNodeDragEndClearStatus = () => {
|
|
@@ -41435,7 +41507,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41435
41507
|
});
|
|
41436
41508
|
}
|
|
41437
41509
|
};
|
|
41438
|
-
const
|
|
41510
|
+
const updateNodeDropTipContent = (itemEl) => {
|
|
41439
41511
|
const { dragNode } = reactData;
|
|
41440
41512
|
const dragOpts = computeDragOpts.value;
|
|
41441
41513
|
const { tooltipMethod } = dragOpts;
|
|
@@ -41480,20 +41552,26 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41480
41552
|
evnt.stopPropagation();
|
|
41481
41553
|
const { node } = params;
|
|
41482
41554
|
const dragConfig = computeDragOpts.value;
|
|
41483
|
-
const { trigger, dragStartMethod } = dragConfig;
|
|
41555
|
+
const { isCrossTreeDrag, trigger, dragStartMethod } = dragConfig;
|
|
41484
41556
|
const dragEl = evnt.currentTarget;
|
|
41485
41557
|
const itemEl = trigger === 'node' ? dragEl : dragEl.parentElement.parentElement;
|
|
41486
41558
|
clearNodeDropOrigin();
|
|
41487
41559
|
if (dragStartMethod && !dragStartMethod(params)) {
|
|
41488
41560
|
itemEl.draggable = false;
|
|
41489
41561
|
reactData.dragNode = null;
|
|
41562
|
+
clearCrossTreeDragStatus();
|
|
41490
41563
|
hideDropTip();
|
|
41491
41564
|
return;
|
|
41492
41565
|
}
|
|
41566
|
+
if (isCrossTreeDrag) {
|
|
41567
|
+
crossTreeDragNodeInfo.node = node;
|
|
41568
|
+
crossTreeDragNodeObj = { $oldTree: $xeTree, $newTree: null };
|
|
41569
|
+
}
|
|
41493
41570
|
reactData.dragNode = node;
|
|
41571
|
+
reactData.isCrossDragNode = false;
|
|
41494
41572
|
itemEl.draggable = true;
|
|
41495
41573
|
updateNodeDropOrigin(node);
|
|
41496
|
-
|
|
41574
|
+
updateNodeDropTipContent(itemEl);
|
|
41497
41575
|
dispatchEvent('node-dragstart', params, evnt);
|
|
41498
41576
|
};
|
|
41499
41577
|
const handleNodeDragMouseupEvent = () => {
|
|
@@ -41561,6 +41639,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41561
41639
|
status: false
|
|
41562
41640
|
};
|
|
41563
41641
|
if (!(el && prevDragNode && dragNode)) {
|
|
41642
|
+
handleNodeDragEndClearStatus();
|
|
41564
41643
|
return Promise.resolve(errRest);
|
|
41565
41644
|
}
|
|
41566
41645
|
// 判断是否有拖动
|
|
@@ -41608,15 +41687,13 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41608
41687
|
if (isPeerDrag && !isCrossDrag) {
|
|
41609
41688
|
if (oldRest.item[parentField] !== newRest.item[parentField]) {
|
|
41610
41689
|
// 非同级
|
|
41611
|
-
|
|
41612
|
-
clearCrossTreeDragStatus();
|
|
41690
|
+
handleNodeDragEndClearStatus();
|
|
41613
41691
|
return errRest;
|
|
41614
41692
|
}
|
|
41615
41693
|
}
|
|
41616
41694
|
else {
|
|
41617
41695
|
if (!isCrossDrag) {
|
|
41618
|
-
|
|
41619
|
-
clearCrossTreeDragStatus();
|
|
41696
|
+
handleNodeDragEndClearStatus();
|
|
41620
41697
|
return errRest;
|
|
41621
41698
|
}
|
|
41622
41699
|
if (oldAllMaps[newNodeid]) {
|
|
@@ -41628,8 +41705,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41628
41705
|
content: getI18n('vxe.error.treeDragChild')
|
|
41629
41706
|
});
|
|
41630
41707
|
}
|
|
41631
|
-
|
|
41632
|
-
clearCrossTreeDragStatus();
|
|
41708
|
+
handleNodeDragEndClearStatus();
|
|
41633
41709
|
return errRest;
|
|
41634
41710
|
}
|
|
41635
41711
|
}
|
|
@@ -41638,16 +41714,14 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41638
41714
|
else if (oldLevel) {
|
|
41639
41715
|
// 子到根
|
|
41640
41716
|
if (!isCrossDrag) {
|
|
41641
|
-
|
|
41642
|
-
clearCrossTreeDragStatus();
|
|
41717
|
+
handleNodeDragEndClearStatus();
|
|
41643
41718
|
return errRest;
|
|
41644
41719
|
}
|
|
41645
41720
|
}
|
|
41646
41721
|
else if (newLevel) {
|
|
41647
41722
|
// 根到子
|
|
41648
41723
|
if (!isCrossDrag) {
|
|
41649
|
-
|
|
41650
|
-
clearCrossTreeDragStatus();
|
|
41724
|
+
handleNodeDragEndClearStatus();
|
|
41651
41725
|
return errRest;
|
|
41652
41726
|
}
|
|
41653
41727
|
if (oldAllMaps[newNodeid]) {
|
|
@@ -41659,8 +41733,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41659
41733
|
content: getI18n('vxe.error.treeDragChild')
|
|
41660
41734
|
});
|
|
41661
41735
|
}
|
|
41662
|
-
|
|
41663
|
-
clearCrossTreeDragStatus();
|
|
41736
|
+
handleNodeDragEndClearStatus();
|
|
41664
41737
|
return errRest;
|
|
41665
41738
|
}
|
|
41666
41739
|
}
|
|
@@ -41808,13 +41881,11 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41808
41881
|
}).catch(() => {
|
|
41809
41882
|
return errRest;
|
|
41810
41883
|
}).then((rest) => {
|
|
41811
|
-
|
|
41812
|
-
clearCrossTreeDragStatus();
|
|
41884
|
+
handleNodeDragEndClearStatus();
|
|
41813
41885
|
return rest;
|
|
41814
41886
|
});
|
|
41815
41887
|
}
|
|
41816
|
-
|
|
41817
|
-
clearCrossTreeDragStatus();
|
|
41888
|
+
handleNodeDragEndClearStatus();
|
|
41818
41889
|
return Promise.resolve(errRest);
|
|
41819
41890
|
};
|
|
41820
41891
|
const handleNodeDragDragstartEvent = (evnt) => {
|
|
@@ -41863,7 +41934,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41863
41934
|
const dragConfig = computeDragOpts.value;
|
|
41864
41935
|
const parentField = computeParentField.value;
|
|
41865
41936
|
const hasChildField = computeHasChildField.value;
|
|
41866
|
-
const { isCrossDrag, isPeerDrag, isToChildDrag } = dragConfig;
|
|
41937
|
+
const { isCrossTreeDrag, isCrossDrag, isPeerDrag, isToChildDrag } = dragConfig;
|
|
41867
41938
|
if (!dragNode && !isCrossDrag) {
|
|
41868
41939
|
evnt.preventDefault();
|
|
41869
41940
|
}
|
|
@@ -41879,6 +41950,32 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
41879
41950
|
internalData.prevDragToChild = !!(transform && (isCrossDrag && isToChildDrag) && isControlKey);
|
|
41880
41951
|
internalData.prevDragNode = node;
|
|
41881
41952
|
internalData.prevDragPos = dragPos;
|
|
41953
|
+
// 跨树拖拽
|
|
41954
|
+
if (isCrossTreeDrag && isCrossDrag && crossTreeDragNodeObj) {
|
|
41955
|
+
const { $oldTree, $newTree } = crossTreeDragNodeObj;
|
|
41956
|
+
if ($oldTree) {
|
|
41957
|
+
const oldTreeReactData = $oldTree.reactData;
|
|
41958
|
+
if ($oldTree.xID === $xeTree.xID) {
|
|
41959
|
+
if ($newTree) {
|
|
41960
|
+
$newTree.hideCrossTreeNodeDropClearStatus();
|
|
41961
|
+
}
|
|
41962
|
+
reactData.isCrossDragNode = false;
|
|
41963
|
+
oldTreeReactData.isCrossDragNode = false;
|
|
41964
|
+
crossTreeDragNodeObj.$newTree = null;
|
|
41965
|
+
}
|
|
41966
|
+
else if (isCrossDrag) {
|
|
41967
|
+
if ($newTree && $newTree.xID !== $xeTree.xID) {
|
|
41968
|
+
$newTree.hideCrossTreeNodeDropClearStatus();
|
|
41969
|
+
}
|
|
41970
|
+
$oldTree.hideCrossTreeNodeDropClearStatus();
|
|
41971
|
+
oldTreeReactData.isCrossDragNode = true;
|
|
41972
|
+
reactData.dragTipText = oldTreeReactData.dragTipText;
|
|
41973
|
+
crossTreeDragNodeObj.$newTree = $xeTree;
|
|
41974
|
+
showDropTip(evnt, itemEl, true, dragPos);
|
|
41975
|
+
return;
|
|
41976
|
+
}
|
|
41977
|
+
}
|
|
41978
|
+
}
|
|
41882
41979
|
if ((dragNode && getNodeId(dragNode) === nodeid) ||
|
|
41883
41980
|
(isControlKey && lazy && node[hasChildField] && nodeItem && !nodeItem.treeLoaded) ||
|
|
41884
41981
|
(!isCrossDrag && transform && (isPeerDrag ? dragNode[parentField] !== node[parentField] : nodeItem.level))) {
|
|
@@ -42052,9 +42149,9 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
42052
42149
|
else {
|
|
42053
42150
|
dragNode[parentField] = null;
|
|
42054
42151
|
}
|
|
42055
|
-
dragList.forEach(
|
|
42056
|
-
|
|
42057
|
-
|
|
42152
|
+
dragList.forEach(item => {
|
|
42153
|
+
item[childrenField] = undefined;
|
|
42154
|
+
item[mapChildrenField] = undefined;
|
|
42058
42155
|
});
|
|
42059
42156
|
if (prevDragNode) {
|
|
42060
42157
|
if (prevDragPos === 'bottom') {
|
|
@@ -42403,7 +42500,7 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
42403
42500
|
const radioOpts = computeRadioOpts.value;
|
|
42404
42501
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
42405
42502
|
const loadingOpts = computeLoadingOpts.value;
|
|
42406
|
-
const
|
|
42503
|
+
const isNodeHover = computeIsNodeHover.value;
|
|
42407
42504
|
const treeStyle = computeTreeStyle.value;
|
|
42408
42505
|
const dragOpts = computeDragOpts.value;
|
|
42409
42506
|
const loadingSlot = slots.loading;
|
|
@@ -42411,14 +42508,14 @@ var VxeTreeComponent = defineVxeComponent({
|
|
|
42411
42508
|
const footerSlot = slots.footer;
|
|
42412
42509
|
const teOns = {};
|
|
42413
42510
|
if (dragOpts.isCrossTreeDrag && !treeList.length) {
|
|
42414
|
-
teOns.onDragover = $xeTree.
|
|
42511
|
+
teOns.onDragover = $xeTree.handleCrossTreeNodeDragoverEmptyEvent;
|
|
42415
42512
|
}
|
|
42416
42513
|
return h('div', Object.assign({ ref: refElem, class: ['vxe-tree', {
|
|
42417
42514
|
[`size--${vSize}`]: vSize,
|
|
42418
42515
|
'show--line': showLine,
|
|
42419
42516
|
'checkbox--highlight': checkboxOpts.highlight,
|
|
42420
42517
|
'radio--highlight': radioOpts.highlight,
|
|
42421
|
-
'node--hover':
|
|
42518
|
+
'node--hover': isNodeHover,
|
|
42422
42519
|
'node--trigger': trigger === 'node',
|
|
42423
42520
|
'is--loading': loading
|
|
42424
42521
|
}] }, teOns), [
|