vxe-pc-ui 4.7.4 → 4.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/icon/style.css +1 -1
- package/es/language/ar-EG.js +19 -1
- package/es/language/de-DE.js +19 -1
- package/es/language/en-US.js +20 -2
- package/es/language/es-ES.js +19 -1
- package/es/language/fr-FR.js +19 -1
- package/es/language/hu-HU.js +19 -1
- package/es/language/hy-AM.js +18 -0
- package/es/language/id-ID.js +19 -1
- package/es/language/it-IT.js +19 -1
- package/es/language/ja-JP.js +19 -1
- package/es/language/ko-KR.js +19 -1
- package/es/language/ms-MY.js +19 -1
- package/es/language/nb-NO.js +19 -1
- package/es/language/pt-BR.js +19 -1
- package/es/language/ru-RU.js +19 -1
- package/es/language/th-TH.js +19 -1
- package/es/language/ug-CN.js +19 -1
- package/es/language/uk-UA.js +19 -1
- package/es/language/uz-UZ.js +19 -1
- package/es/language/vi-VN.js +19 -1
- package/es/language/zh-CHT.js +19 -1
- package/es/language/zh-CN.js +18 -0
- package/es/list/src/list.js +1 -1
- package/es/select/src/select.js +135 -42
- package/es/select/style.css +21 -0
- 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 +918 -407
- package/es/tree/src/util.js +32 -0
- package/es/tree/style.css +23 -26
- package/es/tree/style.min.css +1 -1
- package/es/tree-select/src/tree-select.js +227 -18
- package/es/tree-select/style.css +36 -1
- package/es/tree-select/style.min.css +1 -1
- package/es/ui/index.js +19 -3
- package/es/ui/src/dom.js +9 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-select/style.css +21 -0
- package/es/vxe-select/style.min.css +1 -1
- package/es/vxe-tree/style.css +23 -26
- package/es/vxe-tree/style.min.css +1 -1
- package/es/vxe-tree-select/style.css +36 -1
- package/es/vxe-tree-select/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +1505 -530
- package/lib/index.umd.min.js +1 -1
- package/lib/language/ar-EG.js +19 -1
- package/lib/language/ar-EG.min.js +1 -1
- package/lib/language/ar-EG.umd.js +19 -1
- package/lib/language/de-DE.js +19 -1
- package/lib/language/de-DE.min.js +1 -1
- package/lib/language/de-DE.umd.js +19 -1
- package/lib/language/en-US.js +20 -2
- package/lib/language/en-US.min.js +1 -1
- package/lib/language/en-US.umd.js +20 -2
- package/lib/language/es-ES.js +19 -1
- package/lib/language/es-ES.min.js +1 -1
- package/lib/language/es-ES.umd.js +19 -1
- package/lib/language/fr-FR.js +19 -1
- package/lib/language/fr-FR.min.js +1 -1
- package/lib/language/fr-FR.umd.js +19 -1
- package/lib/language/hu-HU.js +19 -1
- package/lib/language/hu-HU.min.js +1 -1
- package/lib/language/hu-HU.umd.js +19 -1
- package/lib/language/hy-AM.js +18 -0
- package/lib/language/hy-AM.min.js +1 -1
- package/lib/language/hy-AM.umd.js +18 -0
- package/lib/language/id-ID.js +19 -1
- package/lib/language/id-ID.min.js +1 -1
- package/lib/language/id-ID.umd.js +19 -1
- package/lib/language/it-IT.js +19 -1
- package/lib/language/it-IT.min.js +1 -1
- package/lib/language/it-IT.umd.js +19 -1
- package/lib/language/ja-JP.js +19 -1
- package/lib/language/ja-JP.min.js +1 -1
- package/lib/language/ja-JP.umd.js +19 -1
- package/lib/language/ko-KR.js +19 -1
- package/lib/language/ko-KR.min.js +1 -1
- package/lib/language/ko-KR.umd.js +19 -1
- package/lib/language/ms-MY.js +19 -1
- package/lib/language/ms-MY.min.js +1 -1
- package/lib/language/ms-MY.umd.js +19 -1
- package/lib/language/nb-NO.js +19 -1
- package/lib/language/nb-NO.min.js +1 -1
- package/lib/language/nb-NO.umd.js +19 -1
- package/lib/language/pt-BR.js +19 -1
- package/lib/language/pt-BR.min.js +1 -1
- package/lib/language/pt-BR.umd.js +19 -1
- package/lib/language/ru-RU.js +19 -1
- package/lib/language/ru-RU.min.js +1 -1
- package/lib/language/ru-RU.umd.js +19 -1
- package/lib/language/th-TH.js +19 -1
- package/lib/language/th-TH.min.js +1 -1
- package/lib/language/th-TH.umd.js +19 -1
- package/lib/language/ug-CN.js +19 -1
- package/lib/language/ug-CN.min.js +1 -1
- package/lib/language/ug-CN.umd.js +19 -1
- package/lib/language/uk-UA.js +19 -1
- package/lib/language/uk-UA.min.js +1 -1
- package/lib/language/uk-UA.umd.js +19 -1
- package/lib/language/uz-UZ.js +19 -1
- package/lib/language/uz-UZ.min.js +1 -1
- package/lib/language/uz-UZ.umd.js +19 -1
- package/lib/language/vi-VN.js +19 -1
- package/lib/language/vi-VN.min.js +1 -1
- package/lib/language/vi-VN.umd.js +19 -1
- package/lib/language/zh-CHT.js +19 -1
- package/lib/language/zh-CHT.min.js +1 -1
- package/lib/language/zh-CHT.umd.js +19 -1
- package/lib/language/zh-CN.js +18 -0
- package/lib/language/zh-CN.min.js +1 -1
- package/lib/language/zh-CN.umd.js +18 -0
- package/lib/list/src/list.js +1 -1
- package/lib/list/src/list.min.js +1 -1
- package/lib/select/src/select.js +139 -44
- package/lib/select/src/select.min.js +1 -1
- package/lib/select/style/style.css +21 -0
- 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 +1147 -572
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/tree/src/util.js +51 -0
- package/lib/tree/src/util.min.js +1 -0
- package/lib/tree/style/style.css +23 -26
- package/lib/tree/style/style.min.css +1 -1
- package/lib/tree-select/src/tree-select.js +237 -21
- package/lib/tree-select/src/tree-select.min.js +1 -1
- package/lib/tree-select/style/style.css +36 -1
- package/lib/tree-select/style/style.min.css +1 -1
- package/lib/ui/index.js +19 -3
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +10 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-select/style/style.css +21 -0
- package/lib/vxe-select/style/style.min.css +1 -1
- package/lib/vxe-tree/style/style.css +23 -26
- package/lib/vxe-tree/style/style.min.css +1 -1
- package/lib/vxe-tree-select/style/style.css +36 -1
- package/lib/vxe-tree-select/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/language/ar-EG.ts +19 -1
- package/packages/language/de-DE.ts +19 -1
- package/packages/language/en-US.ts +20 -2
- package/packages/language/es-ES.ts +19 -1
- package/packages/language/fr-FR.ts +19 -1
- package/packages/language/hu-HU.ts +19 -1
- package/packages/language/hy-AM.ts +18 -0
- package/packages/language/id-ID.ts +19 -1
- package/packages/language/it-IT.ts +19 -1
- package/packages/language/ja-JP.ts +19 -1
- package/packages/language/ko-KR.ts +19 -1
- package/packages/language/ms-MY.ts +19 -1
- package/packages/language/nb-NO.ts +19 -1
- package/packages/language/pt-BR.ts +19 -1
- package/packages/language/ru-RU.ts +19 -1
- package/packages/language/th-TH.ts +19 -1
- package/packages/language/ug-CN.ts +19 -1
- package/packages/language/uk-UA.ts +19 -1
- package/packages/language/uz-UZ.ts +19 -1
- package/packages/language/vi-VN.ts +19 -1
- package/packages/language/zh-CHT.ts +19 -1
- package/packages/language/zh-CN.ts +18 -0
- package/packages/list/src/list.ts +1 -1
- package/packages/select/src/select.ts +146 -50
- package/packages/tree/src/tree.ts +941 -410
- package/packages/tree/src/util.ts +35 -0
- package/packages/tree-select/src/tree-select.ts +240 -19
- package/packages/ui/index.ts +18 -2
- package/packages/ui/src/dom.ts +10 -0
- package/styles/components/select.scss +19 -0
- package/styles/components/tree-select.scss +36 -1
- package/styles/components/tree.scss +28 -31
- package/types/components/button.d.ts +11 -1
- package/types/components/grid.d.ts +5 -0
- package/types/components/icon-picker.d.ts +11 -1
- package/types/components/input.d.ts +2 -2
- package/types/components/select.d.ts +28 -39
- package/types/components/table.d.ts +2 -4
- package/types/components/tree-select.d.ts +73 -12
- package/types/components/tree.d.ts +125 -8
- /package/es/icon/{iconfont.1752133996961.ttf → iconfont.1752416456948.ttf} +0 -0
- /package/es/icon/{iconfont.1752133996961.woff → iconfont.1752416456948.woff} +0 -0
- /package/es/icon/{iconfont.1752133996961.woff2 → iconfont.1752416456948.woff2} +0 -0
- /package/es/{iconfont.1752133996961.ttf → iconfont.1752416456948.ttf} +0 -0
- /package/es/{iconfont.1752133996961.woff → iconfont.1752416456948.woff} +0 -0
- /package/es/{iconfont.1752133996961.woff2 → iconfont.1752416456948.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1752133996961.ttf → iconfont.1752416456948.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1752133996961.woff → iconfont.1752416456948.woff} +0 -0
- /package/lib/icon/style/{iconfont.1752133996961.woff2 → iconfont.1752416456948.woff2} +0 -0
- /package/lib/{iconfont.1752133996961.ttf → iconfont.1752416456948.ttf} +0 -0
- /package/lib/{iconfont.1752133996961.woff → iconfont.1752416456948.woff} +0 -0
- /package/lib/{iconfont.1752133996961.woff2 → iconfont.1752416456948.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3573,8 +3573,26 @@ setTheme();
|
|
|
3573
3573
|
operError: '发生错误,操作失败!'
|
|
3574
3574
|
},
|
|
3575
3575
|
select: {
|
|
3576
|
+
clear: '清除',
|
|
3577
|
+
allChecked: '全选',
|
|
3578
|
+
total: '{0} / {1}',
|
|
3576
3579
|
search: '搜索',
|
|
3577
3580
|
loadingText: '加载中',
|
|
3581
|
+
emptyText: '暂无数据',
|
|
3582
|
+
maxSize: '最大可选择的数量不能超过 {0} 个',
|
|
3583
|
+
overSizeErr: '已超出最大可选数量 {0} 个,超出部分将被忽略!',
|
|
3584
|
+
searchEmpty: '未匹配到数据!'
|
|
3585
|
+
},
|
|
3586
|
+
tree: {
|
|
3587
|
+
searchEmpty: '未匹配到数据!'
|
|
3588
|
+
},
|
|
3589
|
+
treeSelect: {
|
|
3590
|
+
clearChecked: '清除',
|
|
3591
|
+
allChecked: '全选',
|
|
3592
|
+
allExpand: '全部展开',
|
|
3593
|
+
clearExpand: '全部收起',
|
|
3594
|
+
total: '已选 {0}',
|
|
3595
|
+
search: '搜索',
|
|
3578
3596
|
emptyText: '暂无数据'
|
|
3579
3597
|
},
|
|
3580
3598
|
pager: {
|
|
@@ -4260,14 +4278,14 @@ function checkDynamic() {
|
|
|
4260
4278
|
}
|
|
4261
4279
|
;// CONCATENATED MODULE: ./packages/ui/src/log.ts
|
|
4262
4280
|
|
|
4263
|
-
const log_version = `ui v${"4.7.
|
|
4281
|
+
const log_version = `ui v${"4.7.6"}`;
|
|
4264
4282
|
const warnLog = log.create('warn', log_version);
|
|
4265
4283
|
const errLog = log.create('error', log_version);
|
|
4266
4284
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
4267
4285
|
|
|
4268
4286
|
|
|
4269
4287
|
|
|
4270
|
-
const ui_version = "4.7.
|
|
4288
|
+
const ui_version = "4.7.6";
|
|
4271
4289
|
index_esm_VxeUI.uiVersion = ui_version;
|
|
4272
4290
|
index_esm_VxeUI.dynamicApp = dynamicApp;
|
|
4273
4291
|
function config(options) {
|
|
@@ -4557,7 +4575,7 @@ setConfig({
|
|
|
4557
4575
|
},
|
|
4558
4576
|
virtualYConfig: {
|
|
4559
4577
|
enabled: true,
|
|
4560
|
-
gt:
|
|
4578
|
+
gt: 50,
|
|
4561
4579
|
oSize: 2
|
|
4562
4580
|
}
|
|
4563
4581
|
},
|
|
@@ -4614,16 +4632,32 @@ setConfig({
|
|
|
4614
4632
|
isArrow: true
|
|
4615
4633
|
},
|
|
4616
4634
|
tree: {
|
|
4635
|
+
// autoResize: false,
|
|
4617
4636
|
indent: 20,
|
|
4618
4637
|
minHeight: 60,
|
|
4619
4638
|
radioConfig: {
|
|
4620
4639
|
strict: true
|
|
4640
|
+
},
|
|
4641
|
+
virtualYConfig: {
|
|
4642
|
+
enabled: true,
|
|
4643
|
+
gt: 50,
|
|
4644
|
+
oSize: 2
|
|
4621
4645
|
}
|
|
4622
4646
|
},
|
|
4623
4647
|
treeSelect: {
|
|
4648
|
+
autoClose: true,
|
|
4649
|
+
virtualYConfig: {
|
|
4650
|
+
enabled: true,
|
|
4651
|
+
gt: 0,
|
|
4652
|
+
oSize: 2
|
|
4653
|
+
},
|
|
4624
4654
|
treeConfig: {
|
|
4655
|
+
maxHeight: 300,
|
|
4625
4656
|
radioConfig: {},
|
|
4626
|
-
checkboxConfig: {}
|
|
4657
|
+
checkboxConfig: {},
|
|
4658
|
+
filterConfig: {
|
|
4659
|
+
autoExpandAll: true
|
|
4660
|
+
}
|
|
4627
4661
|
}
|
|
4628
4662
|
},
|
|
4629
4663
|
upload: {
|
|
@@ -5106,6 +5140,15 @@ function getAbsolutePos(elem) {
|
|
|
5106
5140
|
visibleWidth
|
|
5107
5141
|
};
|
|
5108
5142
|
}
|
|
5143
|
+
function getPaddingTopBottomSize(elem) {
|
|
5144
|
+
if (elem) {
|
|
5145
|
+
const computedStyle = getComputedStyle(elem);
|
|
5146
|
+
const paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(computedStyle.paddingTop);
|
|
5147
|
+
const paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(computedStyle.paddingBottom);
|
|
5148
|
+
return paddingTop + paddingBottom;
|
|
5149
|
+
}
|
|
5150
|
+
return 0;
|
|
5151
|
+
}
|
|
5109
5152
|
const scrollIntoViewIfNeeded = 'scrollIntoViewIfNeeded';
|
|
5110
5153
|
const scrollIntoView = 'scrollIntoView';
|
|
5111
5154
|
function scrollToView(elem) {
|
|
@@ -24998,7 +25041,7 @@ const Link = VxeLink;
|
|
|
24998
25041
|
ref: refVirtualBody,
|
|
24999
25042
|
class: 'vxe-list--body',
|
|
25000
25043
|
style: {
|
|
25001
|
-
|
|
25044
|
+
transform: `translateY(${topSpaceHeight}px)`
|
|
25002
25045
|
}
|
|
25003
25046
|
}, defaultSlot ? defaultSlot({
|
|
25004
25047
|
items,
|
|
@@ -28541,6 +28584,7 @@ const Option = VxeOption;
|
|
|
28541
28584
|
|
|
28542
28585
|
|
|
28543
28586
|
|
|
28587
|
+
|
|
28544
28588
|
function isOptionVisible(option) {
|
|
28545
28589
|
return option.visible !== false;
|
|
28546
28590
|
}
|
|
@@ -28592,25 +28636,46 @@ function getOptUniqueId() {
|
|
|
28592
28636
|
filterable: Boolean,
|
|
28593
28637
|
filterMethod: Function,
|
|
28594
28638
|
remote: Boolean,
|
|
28595
|
-
// 已废弃,被 remote-config.queryMethod 替换
|
|
28596
|
-
remoteMethod: Function,
|
|
28597
28639
|
remoteConfig: Object,
|
|
28598
28640
|
emptyText: String,
|
|
28641
|
+
showTotalButoon: {
|
|
28642
|
+
type: Boolean,
|
|
28643
|
+
default: () => getConfig().select.showTotalButoon
|
|
28644
|
+
},
|
|
28645
|
+
showCheckedButoon: {
|
|
28646
|
+
type: Boolean,
|
|
28647
|
+
default: () => getConfig().select.showCheckedButoon
|
|
28648
|
+
},
|
|
28649
|
+
showClearButton: {
|
|
28650
|
+
type: Boolean,
|
|
28651
|
+
default: () => getConfig().select.showClearButton
|
|
28652
|
+
},
|
|
28599
28653
|
transfer: {
|
|
28600
28654
|
type: Boolean,
|
|
28601
28655
|
default: null
|
|
28602
28656
|
},
|
|
28603
28657
|
virtualYConfig: Object,
|
|
28604
28658
|
scrollY: Object,
|
|
28605
|
-
|
|
28659
|
+
/**
|
|
28660
|
+
* 已废弃,被 remote-config.queryMethod 替换
|
|
28661
|
+
* @deprecated
|
|
28662
|
+
*/
|
|
28663
|
+
remoteMethod: Function,
|
|
28664
|
+
/**
|
|
28665
|
+
* 已废弃,被 option-config.keyField 替换
|
|
28666
|
+
* @deprecated
|
|
28667
|
+
*/
|
|
28606
28668
|
optionId: {
|
|
28607
28669
|
type: String,
|
|
28608
28670
|
default: () => getConfig().select.optionId
|
|
28609
28671
|
},
|
|
28610
|
-
|
|
28672
|
+
/**
|
|
28673
|
+
* 已废弃,被 option-config.useKey 替换
|
|
28674
|
+
* @deprecated
|
|
28675
|
+
*/
|
|
28611
28676
|
optionKey: Boolean
|
|
28612
28677
|
},
|
|
28613
|
-
emits: ['update:modelValue', 'change', 'clear', 'blur', 'focus', 'click', 'scroll', 'visible-change'],
|
|
28678
|
+
emits: ['update:modelValue', 'change', 'all-change', 'clear', 'blur', 'focus', 'click', 'scroll', 'visible-change'],
|
|
28614
28679
|
setup(props, context) {
|
|
28615
28680
|
const {
|
|
28616
28681
|
slots,
|
|
@@ -28637,7 +28702,6 @@ function getOptUniqueId() {
|
|
|
28637
28702
|
bodyHeight: 0,
|
|
28638
28703
|
topSpaceHeight: 0,
|
|
28639
28704
|
optList: [],
|
|
28640
|
-
afterVisibleList: [],
|
|
28641
28705
|
staticOptions: [],
|
|
28642
28706
|
reactFlag: 0,
|
|
28643
28707
|
currentOption: null,
|
|
@@ -28654,6 +28718,7 @@ function getOptUniqueId() {
|
|
|
28654
28718
|
const internalData = {
|
|
28655
28719
|
synchData: [],
|
|
28656
28720
|
fullData: [],
|
|
28721
|
+
afterVisibleList: [],
|
|
28657
28722
|
optAddMaps: {},
|
|
28658
28723
|
optGroupKeyMaps: {},
|
|
28659
28724
|
optFullValMaps: {},
|
|
@@ -28760,16 +28825,11 @@ function getOptUniqueId() {
|
|
|
28760
28825
|
});
|
|
28761
28826
|
const computeIsMaximize = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
28762
28827
|
const {
|
|
28763
|
-
modelValue
|
|
28764
|
-
multiple,
|
|
28765
|
-
max
|
|
28828
|
+
modelValue
|
|
28766
28829
|
} = props;
|
|
28767
|
-
|
|
28768
|
-
return (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue.length : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(modelValue) ? 0 : 1) >= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(max);
|
|
28769
|
-
}
|
|
28770
|
-
return false;
|
|
28830
|
+
return checkMaxLimit(modelValue);
|
|
28771
28831
|
});
|
|
28772
|
-
const
|
|
28832
|
+
const computeVirtualYOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
28773
28833
|
return Object.assign({}, getConfig().select.virtualYConfig || getConfig().select.scrollY, props.virtualYConfig || props.scrollY);
|
|
28774
28834
|
});
|
|
28775
28835
|
const computeRemoteOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
@@ -28833,6 +28893,16 @@ function getOptUniqueId() {
|
|
|
28833
28893
|
const optid = option[getOptKey()];
|
|
28834
28894
|
return optid ? encodeURIComponent(optid) : '';
|
|
28835
28895
|
};
|
|
28896
|
+
const checkMaxLimit = selectVals => {
|
|
28897
|
+
const {
|
|
28898
|
+
multiple,
|
|
28899
|
+
max
|
|
28900
|
+
} = props;
|
|
28901
|
+
if (multiple && max) {
|
|
28902
|
+
return (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(selectVals) ? selectVals.length : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(selectVals) ? 0 : 1) >= external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(max);
|
|
28903
|
+
}
|
|
28904
|
+
return false;
|
|
28905
|
+
};
|
|
28836
28906
|
const getRemoteSelectLabel = value => {
|
|
28837
28907
|
const {
|
|
28838
28908
|
remoteValMaps,
|
|
@@ -28923,7 +28993,7 @@ function getOptUniqueId() {
|
|
|
28923
28993
|
cacheItem._index = index;
|
|
28924
28994
|
}
|
|
28925
28995
|
});
|
|
28926
|
-
|
|
28996
|
+
internalData.afterVisibleList = avList;
|
|
28927
28997
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
28928
28998
|
};
|
|
28929
28999
|
const setCurrentOption = option => {
|
|
@@ -28984,7 +29054,7 @@ function getOptUniqueId() {
|
|
|
28984
29054
|
reactData.isAniVisible = true;
|
|
28985
29055
|
if (filterable) {
|
|
28986
29056
|
if (remote && remoteOpts.enabled && remoteOpts.autoLoad && !fullData.length) {
|
|
28987
|
-
|
|
29057
|
+
handleSearchEvent();
|
|
28988
29058
|
} else {
|
|
28989
29059
|
handleOption();
|
|
28990
29060
|
updateYData();
|
|
@@ -29042,6 +29112,52 @@ function getOptUniqueId() {
|
|
|
29042
29112
|
clearValueEvent($event, null);
|
|
29043
29113
|
hideOptionPanel();
|
|
29044
29114
|
};
|
|
29115
|
+
const allCheckedPanelEvent = params => {
|
|
29116
|
+
const {
|
|
29117
|
+
$event
|
|
29118
|
+
} = params;
|
|
29119
|
+
const {
|
|
29120
|
+
modelValue,
|
|
29121
|
+
multiple,
|
|
29122
|
+
max
|
|
29123
|
+
} = props;
|
|
29124
|
+
const {
|
|
29125
|
+
optList
|
|
29126
|
+
} = reactData;
|
|
29127
|
+
const valueField = computeValueField.value;
|
|
29128
|
+
if (multiple) {
|
|
29129
|
+
const multipleValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(modelValue) ? [] : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue : [modelValue];
|
|
29130
|
+
for (let i = 0; i < optList.length; i++) {
|
|
29131
|
+
const option = optList[i];
|
|
29132
|
+
const selectValue = option[valueField];
|
|
29133
|
+
// 检测是否超过最大可选数量
|
|
29134
|
+
if (checkMaxLimit(multipleValue)) {
|
|
29135
|
+
if (index_esm_VxeUI) {
|
|
29136
|
+
index_esm_VxeUI.modal.message({
|
|
29137
|
+
content: getI18n('vxe.select.overSizeErr', [max]),
|
|
29138
|
+
status: 'warning'
|
|
29139
|
+
});
|
|
29140
|
+
}
|
|
29141
|
+
break;
|
|
29142
|
+
}
|
|
29143
|
+
if (!multipleValue.some(val => val === selectValue)) {
|
|
29144
|
+
multipleValue.push(selectValue);
|
|
29145
|
+
}
|
|
29146
|
+
}
|
|
29147
|
+
changeEvent($event, multipleValue);
|
|
29148
|
+
dispatchEvent('all-change', {
|
|
29149
|
+
value: multipleValue
|
|
29150
|
+
}, $event);
|
|
29151
|
+
hideOptionPanel();
|
|
29152
|
+
}
|
|
29153
|
+
};
|
|
29154
|
+
const clearCheckedPanelEvent = params => {
|
|
29155
|
+
const {
|
|
29156
|
+
$event
|
|
29157
|
+
} = params;
|
|
29158
|
+
clearValueEvent($event, null);
|
|
29159
|
+
hideOptionPanel();
|
|
29160
|
+
};
|
|
29045
29161
|
const changeOptionEvent = (evnt, option) => {
|
|
29046
29162
|
const {
|
|
29047
29163
|
modelValue,
|
|
@@ -29124,12 +29240,12 @@ function getOptUniqueId() {
|
|
|
29124
29240
|
allowCreate
|
|
29125
29241
|
} = props;
|
|
29126
29242
|
const {
|
|
29127
|
-
afterVisibleList,
|
|
29128
29243
|
optList
|
|
29129
29244
|
} = reactData;
|
|
29130
29245
|
const {
|
|
29131
29246
|
optFullValMaps,
|
|
29132
|
-
optAddMaps
|
|
29247
|
+
optAddMaps,
|
|
29248
|
+
afterVisibleList
|
|
29133
29249
|
} = internalData;
|
|
29134
29250
|
const valueField = computeValueField.value;
|
|
29135
29251
|
let fullList = afterVisibleList;
|
|
@@ -29342,13 +29458,10 @@ function getOptUniqueId() {
|
|
|
29342
29458
|
}
|
|
29343
29459
|
}
|
|
29344
29460
|
};
|
|
29345
|
-
const checkOptionDisabled = (isSelected, option
|
|
29461
|
+
const checkOptionDisabled = (isSelected, option) => {
|
|
29346
29462
|
if (option.disabled) {
|
|
29347
29463
|
return true;
|
|
29348
29464
|
}
|
|
29349
|
-
if (group && group.disabled) {
|
|
29350
|
-
return true;
|
|
29351
|
-
}
|
|
29352
29465
|
const isMaximize = computeIsMaximize.value;
|
|
29353
29466
|
if (isMaximize && !isSelected) {
|
|
29354
29467
|
return true;
|
|
@@ -29357,11 +29470,11 @@ function getOptUniqueId() {
|
|
|
29357
29470
|
};
|
|
29358
29471
|
const updateYSpace = () => {
|
|
29359
29472
|
const {
|
|
29360
|
-
scrollYLoad
|
|
29361
|
-
afterVisibleList
|
|
29473
|
+
scrollYLoad
|
|
29362
29474
|
} = reactData;
|
|
29363
29475
|
const {
|
|
29364
|
-
scrollYStore
|
|
29476
|
+
scrollYStore,
|
|
29477
|
+
afterVisibleList
|
|
29365
29478
|
} = internalData;
|
|
29366
29479
|
reactData.bodyHeight = scrollYLoad ? afterVisibleList.length * scrollYStore.rowHeight : 0;
|
|
29367
29480
|
reactData.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
|
|
@@ -29373,12 +29486,12 @@ function getOptUniqueId() {
|
|
|
29373
29486
|
} = props;
|
|
29374
29487
|
const {
|
|
29375
29488
|
scrollYLoad,
|
|
29376
|
-
afterVisibleList,
|
|
29377
29489
|
searchValue
|
|
29378
29490
|
} = reactData;
|
|
29379
29491
|
const {
|
|
29380
29492
|
optAddMaps,
|
|
29381
|
-
scrollYStore
|
|
29493
|
+
scrollYStore,
|
|
29494
|
+
afterVisibleList
|
|
29382
29495
|
} = internalData;
|
|
29383
29496
|
const labelField = computeLabelField.value;
|
|
29384
29497
|
const valueField = computeValueField.value;
|
|
@@ -29410,13 +29523,10 @@ function getOptUniqueId() {
|
|
|
29410
29523
|
scrollYStore
|
|
29411
29524
|
} = internalData;
|
|
29412
29525
|
const virtualBodyElem = refVirtualBody.value;
|
|
29413
|
-
const
|
|
29526
|
+
const virtualYOpts = computeVirtualYOpts.value;
|
|
29414
29527
|
let rowHeight = 0;
|
|
29415
29528
|
let firstItemElem;
|
|
29416
29529
|
if (virtualBodyElem) {
|
|
29417
|
-
if (sYOpts.sItem) {
|
|
29418
|
-
firstItemElem = virtualBodyElem.querySelector(sYOpts.sItem);
|
|
29419
|
-
}
|
|
29420
29530
|
if (!firstItemElem) {
|
|
29421
29531
|
firstItemElem = virtualBodyElem.children[0];
|
|
29422
29532
|
}
|
|
@@ -29430,7 +29540,7 @@ function getOptUniqueId() {
|
|
|
29430
29540
|
if (scrollYLoad) {
|
|
29431
29541
|
const scrollBodyElem = refVirtualWrapper.value;
|
|
29432
29542
|
const visibleYSize = Math.max(8, scrollBodyElem ? Math.ceil(scrollBodyElem.clientHeight / rowHeight) : 0);
|
|
29433
|
-
const offsetYSize = Math.max(0, Math.min(2, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(
|
|
29543
|
+
const offsetYSize = Math.max(0, Math.min(2, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize)));
|
|
29434
29544
|
scrollYStore.offsetSize = offsetYSize;
|
|
29435
29545
|
scrollYStore.visibleSize = visibleYSize;
|
|
29436
29546
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex, visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
@@ -29456,6 +29566,9 @@ function getOptUniqueId() {
|
|
|
29456
29566
|
if (avIndex > -1) {
|
|
29457
29567
|
const optWrapperElem = refVirtualWrapper.value;
|
|
29458
29568
|
const panelElem = refOptionPanel.value;
|
|
29569
|
+
if (!panelElem) {
|
|
29570
|
+
return;
|
|
29571
|
+
}
|
|
29459
29572
|
const optElem = panelElem.querySelector(`[optid='${optid}']`);
|
|
29460
29573
|
if (optWrapperElem) {
|
|
29461
29574
|
if (optElem) {
|
|
@@ -29600,7 +29713,7 @@ function getOptUniqueId() {
|
|
|
29600
29713
|
scrollYStore
|
|
29601
29714
|
} = internalData;
|
|
29602
29715
|
const defaultOpts = computeDefaultOpts.value;
|
|
29603
|
-
const
|
|
29716
|
+
const virtualYOpts = computeVirtualYOpts.value;
|
|
29604
29717
|
const valueField = computeValueField.value;
|
|
29605
29718
|
Object.assign(scrollYStore, {
|
|
29606
29719
|
startIndex: 0,
|
|
@@ -29609,7 +29722,7 @@ function getOptUniqueId() {
|
|
|
29609
29722
|
});
|
|
29610
29723
|
internalData.synchData = datas || [];
|
|
29611
29724
|
// 如果gt为0,则总是启用
|
|
29612
|
-
reactData.scrollYLoad = !!
|
|
29725
|
+
reactData.scrollYLoad = !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt <= fullData.length);
|
|
29613
29726
|
handleData();
|
|
29614
29727
|
if (!isLoaded) {
|
|
29615
29728
|
const {
|
|
@@ -29687,13 +29800,17 @@ function getOptUniqueId() {
|
|
|
29687
29800
|
},
|
|
29688
29801
|
focus() {
|
|
29689
29802
|
const $input = refInput.value;
|
|
29803
|
+
if ($input) {
|
|
29804
|
+
$input.blur();
|
|
29805
|
+
}
|
|
29690
29806
|
reactData.isActivated = true;
|
|
29691
|
-
$input.blur();
|
|
29692
29807
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
29693
29808
|
},
|
|
29694
29809
|
blur() {
|
|
29695
29810
|
const $input = refInput.value;
|
|
29696
|
-
$input
|
|
29811
|
+
if ($input) {
|
|
29812
|
+
$input.blur();
|
|
29813
|
+
}
|
|
29697
29814
|
reactData.isActivated = false;
|
|
29698
29815
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
29699
29816
|
},
|
|
@@ -29701,7 +29818,7 @@ function getOptUniqueId() {
|
|
|
29701
29818
|
clearScroll
|
|
29702
29819
|
};
|
|
29703
29820
|
Object.assign($xeSelect, selectMethods);
|
|
29704
|
-
const renderOption =
|
|
29821
|
+
const renderOption = list => {
|
|
29705
29822
|
const {
|
|
29706
29823
|
allowCreate,
|
|
29707
29824
|
optionKey,
|
|
@@ -29732,11 +29849,11 @@ function getOptUniqueId() {
|
|
|
29732
29849
|
const isAdd = !!(allowCreate && optAddMaps[optid]);
|
|
29733
29850
|
const isSelected = !isAdd && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue.indexOf(optionValue) > -1 : modelValue === optionValue);
|
|
29734
29851
|
const isVisible = isAdd || !isOptGroup || isOptionVisible(option);
|
|
29735
|
-
const isDisabled = !isAdd && checkOptionDisabled(isSelected, option
|
|
29852
|
+
const isDisabled = !isAdd && checkOptionDisabled(isSelected, option);
|
|
29736
29853
|
const defaultSlot = slots ? slots.default : null;
|
|
29737
29854
|
const optParams = {
|
|
29738
29855
|
option,
|
|
29739
|
-
group: null,
|
|
29856
|
+
group: isOptGroup ? option : null,
|
|
29740
29857
|
$select: $xeSelect
|
|
29741
29858
|
};
|
|
29742
29859
|
let optLabel = '';
|
|
@@ -29810,15 +29927,21 @@ function getOptUniqueId() {
|
|
|
29810
29927
|
};
|
|
29811
29928
|
const renderVN = () => {
|
|
29812
29929
|
const {
|
|
29930
|
+
modelValue,
|
|
29813
29931
|
className,
|
|
29814
29932
|
popupClassName,
|
|
29933
|
+
multiple,
|
|
29815
29934
|
loading,
|
|
29816
|
-
filterable
|
|
29935
|
+
filterable,
|
|
29936
|
+
showTotalButoon,
|
|
29937
|
+
showCheckedButoon,
|
|
29938
|
+
showClearButton
|
|
29817
29939
|
} = props;
|
|
29818
29940
|
const {
|
|
29819
29941
|
initialized,
|
|
29820
29942
|
isActivated,
|
|
29821
29943
|
isAniVisible,
|
|
29944
|
+
optList,
|
|
29822
29945
|
visiblePanel,
|
|
29823
29946
|
bodyHeight,
|
|
29824
29947
|
topSpaceHeight
|
|
@@ -29844,6 +29967,7 @@ function getOptUniqueId() {
|
|
|
29844
29967
|
class: 'vxe-select-label'
|
|
29845
29968
|
}, selectLabel)]);
|
|
29846
29969
|
}
|
|
29970
|
+
const selectVals = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(modelValue) ? [] : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue : [modelValue];
|
|
29847
29971
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
29848
29972
|
ref: refElem,
|
|
29849
29973
|
class: ['vxe-select', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
|
|
@@ -29910,9 +30034,23 @@ function getOptUniqueId() {
|
|
|
29910
30034
|
onFocus: focusSearchEvent,
|
|
29911
30035
|
onChange: triggerSearchEvent,
|
|
29912
30036
|
onSearch: triggerSearchEvent
|
|
29913
|
-
})]) : renderEmptyElement($xeSelect), headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
30037
|
+
})]) : renderEmptyElement($xeSelect), showTotalButoon || showCheckedButoon && multiple || showClearButton || headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
29914
30038
|
class: 'vxe-select--panel-header'
|
|
29915
|
-
}, headerSlot({})
|
|
30039
|
+
}, headerSlot ? callSlot(headerSlot, {}) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
30040
|
+
class: 'vxe-select--header-button'
|
|
30041
|
+
}, [showTotalButoon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
30042
|
+
class: 'vxe-select--header-total'
|
|
30043
|
+
}, getI18n('vxe.select.total', [selectVals.length, optList.length])) : renderEmptyElement($xeSelect), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
30044
|
+
class: 'vxe-select--header-btns'
|
|
30045
|
+
}, [showCheckedButoon && multiple ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
30046
|
+
content: getI18n('vxe.select.allChecked'),
|
|
30047
|
+
mode: 'text',
|
|
30048
|
+
onClick: allCheckedPanelEvent
|
|
30049
|
+
}) : renderEmptyElement($xeSelect), showClearButton ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
30050
|
+
content: getI18n('vxe.select.clear'),
|
|
30051
|
+
mode: 'text',
|
|
30052
|
+
onClick: clearCheckedPanelEvent
|
|
30053
|
+
}) : renderEmptyElement($xeSelect)])])]) : renderEmptyElement($xeSelect), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
29916
30054
|
class: 'vxe-select--panel-body'
|
|
29917
30055
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
29918
30056
|
ref: refVirtualWrapper,
|
|
@@ -29927,11 +30065,11 @@ function getOptUniqueId() {
|
|
|
29927
30065
|
ref: refVirtualBody,
|
|
29928
30066
|
class: 'vxe-select--body',
|
|
29929
30067
|
style: {
|
|
29930
|
-
|
|
30068
|
+
transform: `translateY(${topSpaceHeight}px)`
|
|
29931
30069
|
}
|
|
29932
30070
|
}, renderOpts())])]), footerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
29933
30071
|
class: 'vxe-select--panel-footer'
|
|
29934
|
-
}, footerSlot
|
|
30072
|
+
}, callSlot(footerSlot, {})) : renderEmptyElement($xeSelect)])] : [])])]);
|
|
29935
30073
|
};
|
|
29936
30074
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => reactData.staticOptions, val => {
|
|
29937
30075
|
loadData(val);
|
|
@@ -37175,6 +37313,52 @@ dynamicApp.use(VxeTooltip);
|
|
|
37175
37313
|
index_esm_VxeUI.component(tooltip);
|
|
37176
37314
|
const Tooltip = VxeTooltip;
|
|
37177
37315
|
/* harmony default export */ var packages_tooltip = (VxeTooltip);
|
|
37316
|
+
;// CONCATENATED MODULE: ./packages/tree/src/util.ts
|
|
37317
|
+
function countTreeExpand($xeTree, prevNode) {
|
|
37318
|
+
let count = 1;
|
|
37319
|
+
if (!prevNode) {
|
|
37320
|
+
return count;
|
|
37321
|
+
}
|
|
37322
|
+
const props = $xeTree.props;
|
|
37323
|
+
const {
|
|
37324
|
+
transform
|
|
37325
|
+
} = props;
|
|
37326
|
+
const reactData = $xeTree.reactData;
|
|
37327
|
+
const {
|
|
37328
|
+
updateExpandedFlag
|
|
37329
|
+
} = reactData;
|
|
37330
|
+
const internalData = $xeTree.internalData;
|
|
37331
|
+
const {
|
|
37332
|
+
treeExpandedMaps
|
|
37333
|
+
} = internalData;
|
|
37334
|
+
const {
|
|
37335
|
+
computeChildrenField,
|
|
37336
|
+
computeMapChildrenField
|
|
37337
|
+
} = $xeTree.getComputeMaps();
|
|
37338
|
+
const childrenField = computeChildrenField.value;
|
|
37339
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
37340
|
+
const nodeChildren = prevNode[transform ? mapChildrenField : childrenField];
|
|
37341
|
+
if (nodeChildren && updateExpandedFlag && treeExpandedMaps[$xeTree.getNodeId(prevNode)]) {
|
|
37342
|
+
for (let index = 0; index < nodeChildren.length; index++) {
|
|
37343
|
+
count += countTreeExpand($xeTree, nodeChildren[index]);
|
|
37344
|
+
}
|
|
37345
|
+
}
|
|
37346
|
+
return count;
|
|
37347
|
+
}
|
|
37348
|
+
function calcTreeLine($xeTree, node, prevNode) {
|
|
37349
|
+
const internalData = $xeTree.internalData;
|
|
37350
|
+
const {
|
|
37351
|
+
scrollYStore
|
|
37352
|
+
} = internalData;
|
|
37353
|
+
const {
|
|
37354
|
+
rowHeight
|
|
37355
|
+
} = scrollYStore;
|
|
37356
|
+
let expandSize = 1;
|
|
37357
|
+
if (prevNode) {
|
|
37358
|
+
expandSize = countTreeExpand($xeTree, prevNode);
|
|
37359
|
+
}
|
|
37360
|
+
return (rowHeight || 28) * expandSize - (prevNode ? 1 : 12);
|
|
37361
|
+
}
|
|
37178
37362
|
;// CONCATENATED MODULE: ./packages/tree/src/tree.ts
|
|
37179
37363
|
|
|
37180
37364
|
|
|
@@ -37184,6 +37368,8 @@ const Tooltip = VxeTooltip;
|
|
|
37184
37368
|
|
|
37185
37369
|
|
|
37186
37370
|
|
|
37371
|
+
|
|
37372
|
+
|
|
37187
37373
|
/**
|
|
37188
37374
|
* 生成节点的唯一主键
|
|
37189
37375
|
*/
|
|
@@ -37194,7 +37380,15 @@ function getNodeUniqueId() {
|
|
|
37194
37380
|
name: 'VxeTree',
|
|
37195
37381
|
props: {
|
|
37196
37382
|
data: Array,
|
|
37383
|
+
autoResize: {
|
|
37384
|
+
type: Boolean,
|
|
37385
|
+
default: () => getConfig().tree.autoResize
|
|
37386
|
+
},
|
|
37197
37387
|
height: [String, Number],
|
|
37388
|
+
maxHeight: {
|
|
37389
|
+
type: [String, Number],
|
|
37390
|
+
default: () => getConfig().tree.maxHeight
|
|
37391
|
+
},
|
|
37198
37392
|
minHeight: {
|
|
37199
37393
|
type: [String, Number],
|
|
37200
37394
|
default: () => getConfig().tree.minHeight
|
|
@@ -37286,12 +37480,15 @@ function getNodeUniqueId() {
|
|
|
37286
37480
|
type: String,
|
|
37287
37481
|
default: () => getConfig().tree.iconLoaded
|
|
37288
37482
|
},
|
|
37483
|
+
filterValue: [String, Number],
|
|
37484
|
+
filterConfig: Object,
|
|
37289
37485
|
size: {
|
|
37290
37486
|
type: String,
|
|
37291
37487
|
default: () => getConfig().tree.size || getConfig().size
|
|
37292
|
-
}
|
|
37488
|
+
},
|
|
37489
|
+
virtualYConfig: Object
|
|
37293
37490
|
},
|
|
37294
|
-
emits: ['update:modelValue', 'update:checkNodeKey', 'update:checkNodeKeys', 'node-click', 'node-dblclick', 'current-change', 'radio-change', 'checkbox-change', 'load-success', 'load-error'],
|
|
37491
|
+
emits: ['update:modelValue', 'update:checkNodeKey', 'update:checkNodeKeys', 'node-click', 'node-dblclick', 'current-change', 'radio-change', 'checkbox-change', 'load-success', 'load-error', 'scroll'],
|
|
37295
37492
|
setup(props, context) {
|
|
37296
37493
|
const {
|
|
37297
37494
|
emit,
|
|
@@ -37302,8 +37499,19 @@ function getNodeUniqueId() {
|
|
|
37302
37499
|
computeSize
|
|
37303
37500
|
} = useSize(props);
|
|
37304
37501
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
37502
|
+
const refHeaderWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
37503
|
+
const refFooterWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
37504
|
+
const refVirtualWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
37505
|
+
const refVirtualBody = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
37305
37506
|
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
37507
|
+
parentHeight: 0,
|
|
37508
|
+
customHeight: 0,
|
|
37509
|
+
customMinHeight: 0,
|
|
37510
|
+
customMaxHeight: 0,
|
|
37306
37511
|
currentNode: null,
|
|
37512
|
+
scrollYLoad: false,
|
|
37513
|
+
bodyHeight: 0,
|
|
37514
|
+
topSpaceHeight: 0,
|
|
37307
37515
|
selectRadioKey: props.checkNodeKey,
|
|
37308
37516
|
treeList: [],
|
|
37309
37517
|
updateExpandedFlag: 1,
|
|
@@ -37311,11 +37519,26 @@ function getNodeUniqueId() {
|
|
|
37311
37519
|
});
|
|
37312
37520
|
const internalData = {
|
|
37313
37521
|
// initialized: false,
|
|
37522
|
+
// lastFilterValue: '',
|
|
37523
|
+
treeFullData: [],
|
|
37524
|
+
afterTreeList: [],
|
|
37525
|
+
afterVisibleList: [],
|
|
37314
37526
|
nodeMaps: {},
|
|
37315
37527
|
selectCheckboxMaps: {},
|
|
37316
37528
|
indeterminateRowMaps: {},
|
|
37317
37529
|
treeExpandedMaps: {},
|
|
37318
|
-
treeExpandLazyLoadedMaps: {}
|
|
37530
|
+
treeExpandLazyLoadedMaps: {},
|
|
37531
|
+
lastScrollLeft: 0,
|
|
37532
|
+
lastScrollTop: 0,
|
|
37533
|
+
scrollYStore: {
|
|
37534
|
+
startIndex: 0,
|
|
37535
|
+
endIndex: 0,
|
|
37536
|
+
visibleSize: 0,
|
|
37537
|
+
offsetSize: 0,
|
|
37538
|
+
rowHeight: 0
|
|
37539
|
+
},
|
|
37540
|
+
lastScrollTime: 0
|
|
37541
|
+
// hpTimeout: undefined
|
|
37319
37542
|
};
|
|
37320
37543
|
const refMaps = {
|
|
37321
37544
|
refElem
|
|
@@ -37342,6 +37565,9 @@ function getNodeUniqueId() {
|
|
|
37342
37565
|
const computeHasChildField = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
37343
37566
|
return props.hasChildField || 'hasChild';
|
|
37344
37567
|
});
|
|
37568
|
+
const computeVirtualYOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
37569
|
+
return Object.assign({}, getConfig().tree.virtualYConfig, props.virtualYConfig);
|
|
37570
|
+
});
|
|
37345
37571
|
const computeIsRowCurrent = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
37346
37572
|
const nodeOpts = computeNodeOpts.value;
|
|
37347
37573
|
const {
|
|
@@ -37380,19 +37606,28 @@ function getNodeUniqueId() {
|
|
|
37380
37606
|
});
|
|
37381
37607
|
const computeTreeStyle = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
37382
37608
|
const {
|
|
37383
|
-
|
|
37384
|
-
|
|
37385
|
-
|
|
37609
|
+
customHeight,
|
|
37610
|
+
customMinHeight,
|
|
37611
|
+
customMaxHeight
|
|
37612
|
+
} = reactData;
|
|
37386
37613
|
const stys = {};
|
|
37387
|
-
if (
|
|
37388
|
-
stys.height = toCssUnit(
|
|
37614
|
+
if (customHeight) {
|
|
37615
|
+
stys.height = toCssUnit(customHeight);
|
|
37389
37616
|
}
|
|
37390
|
-
if (
|
|
37391
|
-
stys.minHeight = toCssUnit(
|
|
37617
|
+
if (customMinHeight) {
|
|
37618
|
+
stys.minHeight = toCssUnit(customMinHeight);
|
|
37619
|
+
}
|
|
37620
|
+
if (customMaxHeight) {
|
|
37621
|
+
stys.maxHeight = toCssUnit(customMaxHeight);
|
|
37392
37622
|
}
|
|
37393
37623
|
return stys;
|
|
37394
37624
|
});
|
|
37625
|
+
const computeFilterOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
37626
|
+
return Object.assign({}, getConfig().tree.filterConfig, props.filterConfig);
|
|
37627
|
+
});
|
|
37395
37628
|
const computeMaps = {
|
|
37629
|
+
computeChildrenField,
|
|
37630
|
+
computeMapChildrenField,
|
|
37396
37631
|
computeRadioOpts,
|
|
37397
37632
|
computeCheckboxOpts,
|
|
37398
37633
|
computeNodeOpts
|
|
@@ -37548,6 +37783,39 @@ function getNodeUniqueId() {
|
|
|
37548
37783
|
$tree: $xeTree
|
|
37549
37784
|
}, params));
|
|
37550
37785
|
};
|
|
37786
|
+
const getParentElem = () => {
|
|
37787
|
+
const el = refElem.value;
|
|
37788
|
+
return el ? el.parentElement : null;
|
|
37789
|
+
};
|
|
37790
|
+
const calcTableHeight = key => {
|
|
37791
|
+
const {
|
|
37792
|
+
parentHeight
|
|
37793
|
+
} = reactData;
|
|
37794
|
+
const val = props[key];
|
|
37795
|
+
let num = 0;
|
|
37796
|
+
if (val) {
|
|
37797
|
+
if (val === '100%' || val === 'auto') {
|
|
37798
|
+
num = parentHeight;
|
|
37799
|
+
} else {
|
|
37800
|
+
if (isScale(val)) {
|
|
37801
|
+
num = Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(val) || 1) / 100 * parentHeight);
|
|
37802
|
+
} else {
|
|
37803
|
+
num = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(val);
|
|
37804
|
+
}
|
|
37805
|
+
num = Math.max(40, num);
|
|
37806
|
+
}
|
|
37807
|
+
}
|
|
37808
|
+
return num;
|
|
37809
|
+
};
|
|
37810
|
+
const updateHeight = () => {
|
|
37811
|
+
reactData.customHeight = calcTableHeight('height');
|
|
37812
|
+
reactData.customMinHeight = calcTableHeight('minHeight');
|
|
37813
|
+
reactData.customMaxHeight = calcTableHeight('maxHeight');
|
|
37814
|
+
// 如果启用虚拟滚动,默认高度
|
|
37815
|
+
if (reactData.scrollYLoad && !(reactData.customHeight || reactData.customMinHeight)) {
|
|
37816
|
+
reactData.customHeight = 300;
|
|
37817
|
+
}
|
|
37818
|
+
};
|
|
37551
37819
|
const createNode = records => {
|
|
37552
37820
|
const valueField = computeValueField.value;
|
|
37553
37821
|
return Promise.resolve(records.map(obj => {
|
|
@@ -37562,428 +37830,451 @@ function getNodeUniqueId() {
|
|
|
37562
37830
|
return item;
|
|
37563
37831
|
}));
|
|
37564
37832
|
};
|
|
37565
|
-
const
|
|
37566
|
-
|
|
37567
|
-
|
|
37568
|
-
|
|
37569
|
-
|
|
37570
|
-
|
|
37571
|
-
|
|
37572
|
-
|
|
37573
|
-
|
|
37574
|
-
|
|
37575
|
-
|
|
37576
|
-
|
|
37833
|
+
const cacheNodeMap = () => {
|
|
37834
|
+
const {
|
|
37835
|
+
treeFullData
|
|
37836
|
+
} = internalData;
|
|
37837
|
+
const valueField = computeValueField.value;
|
|
37838
|
+
const childrenField = computeChildrenField.value;
|
|
37839
|
+
const keyMaps = {};
|
|
37840
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(treeFullData, (item, index, items, path, parent, nodes) => {
|
|
37841
|
+
let nodeid = getNodeId(item);
|
|
37842
|
+
if (!nodeid) {
|
|
37843
|
+
nodeid = getNodeUniqueId();
|
|
37844
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(item, valueField, nodeid);
|
|
37577
37845
|
}
|
|
37578
|
-
|
|
37579
|
-
|
|
37580
|
-
|
|
37581
|
-
|
|
37582
|
-
|
|
37583
|
-
|
|
37584
|
-
|
|
37585
|
-
|
|
37586
|
-
|
|
37587
|
-
|
|
37588
|
-
|
|
37589
|
-
|
|
37590
|
-
|
|
37591
|
-
|
|
37846
|
+
keyMaps[nodeid] = {
|
|
37847
|
+
item,
|
|
37848
|
+
index,
|
|
37849
|
+
items,
|
|
37850
|
+
parent,
|
|
37851
|
+
nodes,
|
|
37852
|
+
level: nodes.length,
|
|
37853
|
+
treeIndex: index,
|
|
37854
|
+
lineCount: 0,
|
|
37855
|
+
treeLoaded: false
|
|
37856
|
+
};
|
|
37857
|
+
}, {
|
|
37858
|
+
children: childrenField
|
|
37859
|
+
});
|
|
37860
|
+
internalData.nodeMaps = keyMaps;
|
|
37861
|
+
};
|
|
37862
|
+
const updateAfterDataIndex = () => {
|
|
37863
|
+
const {
|
|
37864
|
+
transform
|
|
37865
|
+
} = props;
|
|
37866
|
+
const {
|
|
37867
|
+
afterTreeList,
|
|
37868
|
+
nodeMaps
|
|
37869
|
+
} = internalData;
|
|
37870
|
+
const childrenField = computeChildrenField.value;
|
|
37871
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
37872
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeList, (item, index, items) => {
|
|
37873
|
+
const nodeid = getNodeId(item);
|
|
37874
|
+
const nodeItem = nodeMaps[nodeid];
|
|
37875
|
+
if (nodeItem) {
|
|
37876
|
+
nodeItem.items = items;
|
|
37877
|
+
nodeItem.treeIndex = index;
|
|
37878
|
+
} else {
|
|
37879
|
+
const rest = {
|
|
37880
|
+
item,
|
|
37881
|
+
index,
|
|
37882
|
+
items,
|
|
37883
|
+
parent,
|
|
37884
|
+
nodes: [],
|
|
37885
|
+
level: 0,
|
|
37886
|
+
treeIndex: index,
|
|
37887
|
+
lineCount: 0,
|
|
37888
|
+
treeLoaded: false
|
|
37889
|
+
};
|
|
37890
|
+
nodeMaps[nodeid] = rest;
|
|
37592
37891
|
}
|
|
37593
|
-
|
|
37594
|
-
|
|
37595
|
-
|
|
37596
|
-
|
|
37597
|
-
|
|
37598
|
-
|
|
37599
|
-
|
|
37600
|
-
|
|
37601
|
-
|
|
37602
|
-
|
|
37603
|
-
|
|
37604
|
-
|
|
37605
|
-
|
|
37606
|
-
|
|
37607
|
-
|
|
37608
|
-
|
|
37609
|
-
|
|
37610
|
-
|
|
37611
|
-
|
|
37612
|
-
|
|
37613
|
-
|
|
37614
|
-
|
|
37615
|
-
|
|
37616
|
-
|
|
37617
|
-
|
|
37618
|
-
|
|
37619
|
-
|
|
37620
|
-
|
|
37621
|
-
|
|
37622
|
-
|
|
37623
|
-
|
|
37624
|
-
|
|
37625
|
-
|
|
37892
|
+
}, {
|
|
37893
|
+
children: transform ? mapChildrenField : childrenField
|
|
37894
|
+
});
|
|
37895
|
+
};
|
|
37896
|
+
const updateAfterFullData = () => {
|
|
37897
|
+
const {
|
|
37898
|
+
transform,
|
|
37899
|
+
filterValue
|
|
37900
|
+
} = props;
|
|
37901
|
+
const {
|
|
37902
|
+
treeFullData,
|
|
37903
|
+
lastFilterValue
|
|
37904
|
+
} = internalData;
|
|
37905
|
+
const titleField = computeTitleField.value;
|
|
37906
|
+
const childrenField = computeChildrenField.value;
|
|
37907
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
37908
|
+
const filterOpts = computeFilterOpts.value;
|
|
37909
|
+
const {
|
|
37910
|
+
autoExpandAll,
|
|
37911
|
+
beforeFilterMethod,
|
|
37912
|
+
filterMethod,
|
|
37913
|
+
afterFilterMethod
|
|
37914
|
+
} = filterOpts;
|
|
37915
|
+
let fullList = treeFullData;
|
|
37916
|
+
let treeList = fullList;
|
|
37917
|
+
let filterStr = '';
|
|
37918
|
+
if (filterValue || filterValue === 0) {
|
|
37919
|
+
filterStr = `${filterValue}`;
|
|
37920
|
+
const handleSearch = filterMethod ? item => {
|
|
37921
|
+
return filterMethod({
|
|
37922
|
+
$tree: $xeTree,
|
|
37923
|
+
node: item,
|
|
37924
|
+
filterValue: filterStr
|
|
37925
|
+
});
|
|
37926
|
+
} : item => {
|
|
37927
|
+
return String(item[titleField]).toLowerCase().indexOf(filterStr) > -1;
|
|
37928
|
+
};
|
|
37929
|
+
const bafParams = {
|
|
37930
|
+
$tree: $xeTree,
|
|
37931
|
+
filterValue: filterStr
|
|
37932
|
+
};
|
|
37933
|
+
if (beforeFilterMethod) {
|
|
37934
|
+
beforeFilterMethod(bafParams);
|
|
37935
|
+
}
|
|
37936
|
+
if (transform) {
|
|
37937
|
+
treeList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(treeFullData, handleSearch, {
|
|
37938
|
+
children: childrenField,
|
|
37939
|
+
mapChildren: mapChildrenField,
|
|
37940
|
+
isEvery: true
|
|
37941
|
+
});
|
|
37942
|
+
fullList = treeList;
|
|
37943
|
+
} else {
|
|
37944
|
+
fullList = treeFullData.filter(handleSearch);
|
|
37626
37945
|
}
|
|
37627
|
-
|
|
37628
|
-
|
|
37629
|
-
|
|
37630
|
-
|
|
37631
|
-
|
|
37632
|
-
|
|
37633
|
-
|
|
37634
|
-
|
|
37635
|
-
|
|
37636
|
-
|
|
37637
|
-
|
|
37638
|
-
|
|
37639
|
-
|
|
37640
|
-
return Object.keys(selectCheckboxMaps);
|
|
37641
|
-
},
|
|
37642
|
-
getCheckboxNodes() {
|
|
37643
|
-
const {
|
|
37644
|
-
nodeMaps,
|
|
37645
|
-
selectCheckboxMaps
|
|
37646
|
-
} = internalData;
|
|
37647
|
-
const list = [];
|
|
37648
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (item, nodeid) => {
|
|
37649
|
-
const nodeItem = nodeMaps[nodeid];
|
|
37650
|
-
if (nodeItem) {
|
|
37651
|
-
list.push(nodeItem.item);
|
|
37946
|
+
internalData.lastFilterValue = filterStr;
|
|
37947
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
37948
|
+
// 筛选时自动展开
|
|
37949
|
+
if (autoExpandAll) {
|
|
37950
|
+
$xeTree.setAllExpandNode(true).then(() => {
|
|
37951
|
+
if (afterFilterMethod) {
|
|
37952
|
+
afterFilterMethod(bafParams);
|
|
37953
|
+
}
|
|
37954
|
+
});
|
|
37955
|
+
} else {
|
|
37956
|
+
if (afterFilterMethod) {
|
|
37957
|
+
afterFilterMethod(bafParams);
|
|
37958
|
+
}
|
|
37652
37959
|
}
|
|
37653
37960
|
});
|
|
37654
|
-
|
|
37655
|
-
|
|
37656
|
-
|
|
37657
|
-
|
|
37658
|
-
|
|
37659
|
-
|
|
37660
|
-
},
|
|
37661
|
-
setAllCheckboxNode(checked) {
|
|
37662
|
-
const {
|
|
37663
|
-
transform
|
|
37664
|
-
} = props;
|
|
37665
|
-
const selectMaps = {};
|
|
37666
|
-
const childrenField = computeChildrenField.value;
|
|
37667
|
-
const mapChildrenField = computeMapChildrenField.value;
|
|
37668
|
-
if (checked) {
|
|
37669
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(reactData.treeList, node => {
|
|
37670
|
-
const nodeid = getNodeId(node);
|
|
37671
|
-
selectMaps[nodeid] = true;
|
|
37672
|
-
}, {
|
|
37673
|
-
children: transform ? mapChildrenField : childrenField
|
|
37961
|
+
} else {
|
|
37962
|
+
if (transform) {
|
|
37963
|
+
treeList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(treeFullData, () => true, {
|
|
37964
|
+
children: childrenField,
|
|
37965
|
+
mapChildren: mapChildrenField,
|
|
37966
|
+
isEvery: true
|
|
37674
37967
|
});
|
|
37968
|
+
fullList = treeList;
|
|
37969
|
+
if (lastFilterValue) {
|
|
37970
|
+
const bafParams = {
|
|
37971
|
+
$tree: $xeTree,
|
|
37972
|
+
filterValue: filterStr
|
|
37973
|
+
};
|
|
37974
|
+
if (beforeFilterMethod) {
|
|
37975
|
+
beforeFilterMethod(bafParams);
|
|
37976
|
+
}
|
|
37977
|
+
// 取消筛选时自动收起
|
|
37978
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
37979
|
+
if (autoExpandAll) {
|
|
37980
|
+
$xeTree.clearAllExpandNode().then(() => {
|
|
37981
|
+
if (afterFilterMethod) {
|
|
37982
|
+
afterFilterMethod(bafParams);
|
|
37983
|
+
}
|
|
37984
|
+
});
|
|
37985
|
+
} else {
|
|
37986
|
+
if (afterFilterMethod) {
|
|
37987
|
+
afterFilterMethod(bafParams);
|
|
37988
|
+
}
|
|
37989
|
+
}
|
|
37990
|
+
});
|
|
37991
|
+
}
|
|
37675
37992
|
}
|
|
37676
|
-
internalData.
|
|
37677
|
-
|
|
37678
|
-
|
|
37679
|
-
|
|
37680
|
-
|
|
37681
|
-
|
|
37682
|
-
|
|
37683
|
-
|
|
37684
|
-
|
|
37685
|
-
|
|
37686
|
-
|
|
37687
|
-
|
|
37688
|
-
|
|
37993
|
+
internalData.lastFilterValue = '';
|
|
37994
|
+
}
|
|
37995
|
+
internalData.afterVisibleList = fullList;
|
|
37996
|
+
internalData.afterTreeList = treeList;
|
|
37997
|
+
updateAfterDataIndex();
|
|
37998
|
+
};
|
|
37999
|
+
/**
|
|
38000
|
+
* 如果为虚拟树、则将树结构拍平
|
|
38001
|
+
*/
|
|
38002
|
+
const handleTreeToList = () => {
|
|
38003
|
+
const {
|
|
38004
|
+
transform
|
|
38005
|
+
} = props;
|
|
38006
|
+
const {
|
|
38007
|
+
afterTreeList,
|
|
38008
|
+
treeExpandedMaps
|
|
38009
|
+
} = internalData;
|
|
38010
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
38011
|
+
const expandMaps = {};
|
|
38012
|
+
if (transform) {
|
|
38013
|
+
const fullData = [];
|
|
38014
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeList, (item, index, items, path, parentRow) => {
|
|
38015
|
+
const nodeid = getNodeId(item);
|
|
38016
|
+
const parentNodeid = getNodeId(parentRow);
|
|
38017
|
+
if (!parentRow || expandMaps[parentNodeid] && treeExpandedMaps[parentNodeid]) {
|
|
38018
|
+
expandMaps[nodeid] = 1;
|
|
38019
|
+
fullData.push(item);
|
|
38020
|
+
}
|
|
38021
|
+
}, {
|
|
38022
|
+
children: mapChildrenField
|
|
37689
38023
|
});
|
|
37690
|
-
|
|
37691
|
-
|
|
37692
|
-
return
|
|
37693
|
-
}
|
|
37694
|
-
|
|
37695
|
-
|
|
37696
|
-
|
|
37697
|
-
|
|
37698
|
-
|
|
37699
|
-
|
|
37700
|
-
|
|
38024
|
+
updateScrollYStatus(fullData);
|
|
38025
|
+
internalData.afterVisibleList = fullData;
|
|
38026
|
+
return fullData;
|
|
38027
|
+
}
|
|
38028
|
+
return internalData.afterVisibleList;
|
|
38029
|
+
};
|
|
38030
|
+
const handleData = force => {
|
|
38031
|
+
const {
|
|
38032
|
+
scrollYLoad
|
|
38033
|
+
} = reactData;
|
|
38034
|
+
const {
|
|
38035
|
+
scrollYStore
|
|
38036
|
+
} = internalData;
|
|
38037
|
+
let fullList = internalData.afterVisibleList;
|
|
38038
|
+
if (force) {
|
|
38039
|
+
// 更新数据,处理筛选和排序
|
|
38040
|
+
updateAfterFullData();
|
|
38041
|
+
// 如果为虚拟树,将树结构拍平
|
|
38042
|
+
fullList = handleTreeToList();
|
|
38043
|
+
}
|
|
38044
|
+
const treeList = scrollYLoad ? fullList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullList.slice(0);
|
|
38045
|
+
reactData.treeList = treeList;
|
|
38046
|
+
};
|
|
38047
|
+
const triggerSearchEvent = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().debounce(() => handleData(true), 350, {
|
|
38048
|
+
trailing: true
|
|
38049
|
+
});
|
|
38050
|
+
const loadData = list => {
|
|
38051
|
+
const {
|
|
38052
|
+
expandAll,
|
|
38053
|
+
transform
|
|
38054
|
+
} = props;
|
|
38055
|
+
const {
|
|
38056
|
+
initialized,
|
|
38057
|
+
scrollYStore
|
|
38058
|
+
} = internalData;
|
|
38059
|
+
const keyField = computeKeyField.value;
|
|
38060
|
+
const parentField = computeParentField.value;
|
|
38061
|
+
const childrenField = computeChildrenField.value;
|
|
38062
|
+
const fullData = transform ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(list, {
|
|
38063
|
+
key: keyField,
|
|
38064
|
+
parentKey: parentField,
|
|
38065
|
+
mapChildren: childrenField
|
|
38066
|
+
}) : list ? list.slice(0) : [];
|
|
38067
|
+
internalData.treeFullData = fullData;
|
|
38068
|
+
Object.assign(scrollYStore, {
|
|
38069
|
+
startIndex: 0,
|
|
38070
|
+
endIndex: 1,
|
|
38071
|
+
visibleSize: 0
|
|
38072
|
+
});
|
|
38073
|
+
const sYLoad = updateScrollYStatus(fullData);
|
|
38074
|
+
cacheNodeMap();
|
|
38075
|
+
handleData(true);
|
|
38076
|
+
if (sYLoad) {
|
|
38077
|
+
if (!(props.height || props.maxHeight)) {
|
|
38078
|
+
errLog('vxe.error.reqProp', ['height | max-height | virtual-y-config.enabled=false']);
|
|
38079
|
+
}
|
|
38080
|
+
}
|
|
38081
|
+
return computeScrollLoad().then(() => {
|
|
38082
|
+
if (!initialized) {
|
|
38083
|
+
if (list && list.length) {
|
|
38084
|
+
internalData.initialized = true;
|
|
38085
|
+
if (expandAll) {
|
|
38086
|
+
$xeTree.setAllExpandNode(true);
|
|
38087
|
+
}
|
|
38088
|
+
$xeTree.setCheckboxByNodeId(props.checkNodeKeys || [], true);
|
|
37701
38089
|
}
|
|
37702
|
-
nodeids.forEach(nodeid => {
|
|
37703
|
-
handleSetExpand(nodeid, expanded, treeExpandedMaps);
|
|
37704
|
-
});
|
|
37705
|
-
reactData.updateExpandedFlag++;
|
|
37706
38090
|
}
|
|
37707
|
-
|
|
37708
|
-
|
|
37709
|
-
|
|
37710
|
-
|
|
37711
|
-
|
|
37712
|
-
|
|
37713
|
-
|
|
37714
|
-
}
|
|
37715
|
-
|
|
38091
|
+
updateHeight();
|
|
38092
|
+
refreshScroll();
|
|
38093
|
+
});
|
|
38094
|
+
};
|
|
38095
|
+
const updateScrollYStatus = fullData => {
|
|
38096
|
+
const {
|
|
38097
|
+
transform
|
|
38098
|
+
} = props;
|
|
38099
|
+
const virtualYOpts = computeVirtualYOpts.value;
|
|
38100
|
+
const allList = fullData || internalData.treeFullData;
|
|
38101
|
+
// 如果gt为0,则总是启用
|
|
38102
|
+
const scrollYLoad = !!transform && !!virtualYOpts.enabled && virtualYOpts.gt > -1 && (virtualYOpts.gt === 0 || virtualYOpts.gt < allList.length);
|
|
38103
|
+
reactData.scrollYLoad = scrollYLoad;
|
|
38104
|
+
return scrollYLoad;
|
|
38105
|
+
};
|
|
38106
|
+
const updateYSpace = () => {
|
|
38107
|
+
const {
|
|
38108
|
+
scrollYLoad
|
|
38109
|
+
} = reactData;
|
|
38110
|
+
const {
|
|
38111
|
+
scrollYStore,
|
|
38112
|
+
afterVisibleList
|
|
38113
|
+
} = internalData;
|
|
38114
|
+
reactData.bodyHeight = scrollYLoad ? afterVisibleList.length * scrollYStore.rowHeight : 0;
|
|
38115
|
+
reactData.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
|
|
38116
|
+
};
|
|
38117
|
+
const updateYData = () => {
|
|
38118
|
+
handleData();
|
|
38119
|
+
updateYSpace();
|
|
38120
|
+
};
|
|
38121
|
+
const computeScrollLoad = () => {
|
|
38122
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
37716
38123
|
const {
|
|
37717
|
-
|
|
37718
|
-
|
|
37719
|
-
} = internalData;
|
|
37720
|
-
const list = [];
|
|
37721
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(treeExpandedMaps, (item, nodeid) => {
|
|
37722
|
-
const nodeItem = nodeMaps[nodeid];
|
|
37723
|
-
if (nodeItem) {
|
|
37724
|
-
list.push(nodeItem.item);
|
|
37725
|
-
}
|
|
37726
|
-
});
|
|
37727
|
-
return list;
|
|
37728
|
-
},
|
|
37729
|
-
setExpandNode(nodes, expanded) {
|
|
38124
|
+
scrollYLoad
|
|
38125
|
+
} = reactData;
|
|
37730
38126
|
const {
|
|
37731
|
-
|
|
38127
|
+
scrollYStore
|
|
37732
38128
|
} = internalData;
|
|
37733
|
-
|
|
37734
|
-
|
|
37735
|
-
|
|
38129
|
+
const virtualBodyElem = refVirtualBody.value;
|
|
38130
|
+
const virtualYOpts = computeVirtualYOpts.value;
|
|
38131
|
+
let rowHeight = 0;
|
|
38132
|
+
let firstItemElem;
|
|
38133
|
+
if (virtualBodyElem) {
|
|
38134
|
+
if (!firstItemElem) {
|
|
38135
|
+
firstItemElem = virtualBodyElem.children[0];
|
|
37736
38136
|
}
|
|
37737
|
-
nodes.forEach(node => {
|
|
37738
|
-
const nodeid = getNodeId(node);
|
|
37739
|
-
handleSetExpand(nodeid, expanded, treeExpandedMaps);
|
|
37740
|
-
});
|
|
37741
|
-
reactData.updateExpandedFlag++;
|
|
37742
|
-
}
|
|
37743
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
37744
|
-
},
|
|
37745
|
-
toggleExpandByNodeId(nodeids) {
|
|
37746
|
-
const {
|
|
37747
|
-
treeExpandedMaps
|
|
37748
|
-
} = internalData;
|
|
37749
|
-
if (nodeids) {
|
|
37750
|
-
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(nodeids)) {
|
|
37751
|
-
nodeids = [nodeids];
|
|
37752
|
-
}
|
|
37753
|
-
nodeids.forEach(nodeid => {
|
|
37754
|
-
handleSetExpand(nodeid, !treeExpandedMaps[nodeid], treeExpandedMaps);
|
|
37755
|
-
});
|
|
37756
|
-
reactData.updateExpandedFlag++;
|
|
37757
38137
|
}
|
|
37758
|
-
|
|
37759
|
-
|
|
37760
|
-
toggleExpandNode(nodes) {
|
|
37761
|
-
const {
|
|
37762
|
-
treeExpandedMaps
|
|
37763
|
-
} = internalData;
|
|
37764
|
-
if (nodes) {
|
|
37765
|
-
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(nodes)) {
|
|
37766
|
-
nodes = [nodes];
|
|
37767
|
-
}
|
|
37768
|
-
nodes.forEach(node => {
|
|
37769
|
-
const nodeid = getNodeId(node);
|
|
37770
|
-
handleSetExpand(nodeid, !treeExpandedMaps[nodeid], treeExpandedMaps);
|
|
37771
|
-
});
|
|
37772
|
-
reactData.updateExpandedFlag++;
|
|
38138
|
+
if (firstItemElem) {
|
|
38139
|
+
rowHeight = firstItemElem.offsetHeight;
|
|
37773
38140
|
}
|
|
37774
|
-
|
|
37775
|
-
|
|
37776
|
-
|
|
37777
|
-
|
|
37778
|
-
|
|
37779
|
-
|
|
37780
|
-
|
|
37781
|
-
|
|
37782
|
-
|
|
37783
|
-
|
|
37784
|
-
|
|
37785
|
-
if (expanded) {
|
|
37786
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(reactData.treeList, node => {
|
|
37787
|
-
const childList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(node, childrenField);
|
|
37788
|
-
const hasChild = childList && childList.length;
|
|
37789
|
-
if (hasChild) {
|
|
37790
|
-
const nodeid = getNodeId(node);
|
|
37791
|
-
treeExpandedMaps[nodeid] = true;
|
|
37792
|
-
}
|
|
37793
|
-
}, {
|
|
37794
|
-
children: transform ? mapChildrenField : childrenField
|
|
37795
|
-
});
|
|
38141
|
+
rowHeight = Math.max(20, rowHeight);
|
|
38142
|
+
scrollYStore.rowHeight = rowHeight;
|
|
38143
|
+
// 计算 Y 逻辑
|
|
38144
|
+
if (scrollYLoad) {
|
|
38145
|
+
const scrollBodyElem = refVirtualWrapper.value;
|
|
38146
|
+
const visibleYSize = Math.max(8, scrollBodyElem ? Math.ceil(scrollBodyElem.clientHeight / rowHeight) : 0);
|
|
38147
|
+
const offsetYSize = Math.max(0, Math.min(2, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize)));
|
|
38148
|
+
scrollYStore.offsetSize = offsetYSize;
|
|
38149
|
+
scrollYStore.visibleSize = visibleYSize;
|
|
38150
|
+
scrollYStore.endIndex = Math.max(scrollYStore.startIndex, visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
38151
|
+
updateYData();
|
|
37796
38152
|
} else {
|
|
37797
|
-
|
|
37798
|
-
}
|
|
37799
|
-
reactData.updateExpandedFlag++;
|
|
37800
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
37801
|
-
},
|
|
37802
|
-
reloadExpandNode(node) {
|
|
37803
|
-
const {
|
|
37804
|
-
lazy
|
|
37805
|
-
} = props;
|
|
37806
|
-
if (lazy) {
|
|
37807
|
-
treeMethods.clearExpandLoaded(node);
|
|
37808
|
-
return handleAsyncTreeExpandChilds(node);
|
|
38153
|
+
updateYSpace();
|
|
37809
38154
|
}
|
|
37810
|
-
|
|
37811
|
-
|
|
37812
|
-
|
|
37813
|
-
|
|
37814
|
-
|
|
37815
|
-
|
|
37816
|
-
|
|
37817
|
-
|
|
37818
|
-
|
|
37819
|
-
|
|
37820
|
-
|
|
37821
|
-
|
|
37822
|
-
nodeItem.treeLoaded = false;
|
|
37823
|
-
}
|
|
38155
|
+
});
|
|
38156
|
+
};
|
|
38157
|
+
/**
|
|
38158
|
+
* 如果有滚动条,则滚动到对应的位置
|
|
38159
|
+
* @param {Number} scrollLeft 左距离
|
|
38160
|
+
* @param {Number} scrollTop 上距离
|
|
38161
|
+
*/
|
|
38162
|
+
const scrollTo = (scrollLeft, scrollTop) => {
|
|
38163
|
+
const scrollBodyElem = refVirtualWrapper.value;
|
|
38164
|
+
if (scrollBodyElem) {
|
|
38165
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollLeft)) {
|
|
38166
|
+
scrollBodyElem.scrollLeft = scrollLeft;
|
|
37824
38167
|
}
|
|
37825
|
-
|
|
37826
|
-
|
|
37827
|
-
/**
|
|
37828
|
-
* 用于树结构,给行数据加载子节点
|
|
37829
|
-
*/
|
|
37830
|
-
loadChildrenNode(node, childRecords) {
|
|
37831
|
-
const {
|
|
37832
|
-
lazy,
|
|
37833
|
-
transform
|
|
37834
|
-
} = props;
|
|
37835
|
-
const {
|
|
37836
|
-
nodeMaps
|
|
37837
|
-
} = internalData;
|
|
37838
|
-
if (!lazy) {
|
|
37839
|
-
return Promise.resolve([]);
|
|
38168
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(scrollTop)) {
|
|
38169
|
+
scrollBodyElem.scrollTop = scrollTop;
|
|
37840
38170
|
}
|
|
37841
|
-
|
|
37842
|
-
|
|
37843
|
-
|
|
37844
|
-
|
|
37845
|
-
|
|
37846
|
-
|
|
37847
|
-
|
|
37848
|
-
|
|
37849
|
-
item: node,
|
|
37850
|
-
itemIndex: -1,
|
|
37851
|
-
items,
|
|
37852
|
-
parent: parent || parentNodeItem.item,
|
|
37853
|
-
nodes: parentNodes.concat(nodes),
|
|
37854
|
-
level: parentLevel + nodes.length,
|
|
37855
|
-
lineCount: 0,
|
|
37856
|
-
treeLoaded: false
|
|
37857
|
-
};
|
|
37858
|
-
}, {
|
|
37859
|
-
children: childrenField
|
|
37860
|
-
});
|
|
37861
|
-
node[childrenField] = nodeList;
|
|
37862
|
-
if (transform) {
|
|
37863
|
-
node[childrenField] = nodeList;
|
|
37864
|
-
}
|
|
37865
|
-
updateNodeLine(node);
|
|
37866
|
-
return nodeList;
|
|
37867
|
-
});
|
|
37868
|
-
},
|
|
37869
|
-
isExpandByNode,
|
|
37870
|
-
isCheckedByRadioNodeId,
|
|
37871
|
-
isCheckedByRadioNode,
|
|
37872
|
-
isCheckedByCheckboxNodeId,
|
|
37873
|
-
isIndeterminateByCheckboxNode,
|
|
37874
|
-
isCheckedByCheckboxNode,
|
|
37875
|
-
getCheckboxIndeterminateNodes() {
|
|
37876
|
-
const {
|
|
37877
|
-
nodeMaps,
|
|
37878
|
-
indeterminateRowMaps
|
|
37879
|
-
} = internalData;
|
|
37880
|
-
const list = [];
|
|
37881
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(indeterminateRowMaps, (item, nodeid) => {
|
|
37882
|
-
const nodeItem = nodeMaps[nodeid];
|
|
37883
|
-
if (nodeItem) {
|
|
37884
|
-
list.push(nodeItem.item);
|
|
37885
|
-
}
|
|
38171
|
+
}
|
|
38172
|
+
if (reactData.scrollYLoad) {
|
|
38173
|
+
return new Promise(resolve => {
|
|
38174
|
+
setTimeout(() => {
|
|
38175
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
38176
|
+
resolve();
|
|
38177
|
+
});
|
|
38178
|
+
}, 50);
|
|
37886
38179
|
});
|
|
37887
|
-
return list;
|
|
37888
38180
|
}
|
|
38181
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
37889
38182
|
};
|
|
37890
|
-
|
|
37891
|
-
|
|
37892
|
-
|
|
37893
|
-
|
|
38183
|
+
/**
|
|
38184
|
+
* 刷新滚动条
|
|
38185
|
+
*/
|
|
38186
|
+
const refreshScroll = () => {
|
|
37894
38187
|
const {
|
|
37895
|
-
|
|
37896
|
-
|
|
37897
|
-
|
|
37898
|
-
|
|
37899
|
-
|
|
37900
|
-
|
|
37901
|
-
|
|
37902
|
-
|
|
37903
|
-
if (!nodeid) {
|
|
37904
|
-
nodeid = getNodeUniqueId();
|
|
37905
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(item, valueField, nodeid);
|
|
38188
|
+
lastScrollLeft,
|
|
38189
|
+
lastScrollTop
|
|
38190
|
+
} = internalData;
|
|
38191
|
+
return clearScroll().then(() => {
|
|
38192
|
+
if (lastScrollLeft || lastScrollTop) {
|
|
38193
|
+
internalData.lastScrollLeft = 0;
|
|
38194
|
+
internalData.lastScrollTop = 0;
|
|
38195
|
+
return scrollTo(lastScrollLeft, lastScrollTop);
|
|
37906
38196
|
}
|
|
37907
|
-
keyMaps[nodeid] = {
|
|
37908
|
-
item,
|
|
37909
|
-
itemIndex,
|
|
37910
|
-
items,
|
|
37911
|
-
parent,
|
|
37912
|
-
nodes,
|
|
37913
|
-
level: nodes.length,
|
|
37914
|
-
lineCount: 0,
|
|
37915
|
-
treeLoaded: false
|
|
37916
|
-
};
|
|
37917
|
-
}, {
|
|
37918
|
-
children: transform ? mapChildrenField : childrenField
|
|
37919
38197
|
});
|
|
37920
|
-
internalData.nodeMaps = keyMaps;
|
|
37921
38198
|
};
|
|
37922
|
-
|
|
37923
|
-
|
|
37924
|
-
|
|
37925
|
-
|
|
37926
|
-
} = props;
|
|
38199
|
+
/**
|
|
38200
|
+
* 重新计算列表
|
|
38201
|
+
*/
|
|
38202
|
+
const recalculate = () => {
|
|
37927
38203
|
const {
|
|
37928
|
-
|
|
38204
|
+
scrollYStore
|
|
37929
38205
|
} = internalData;
|
|
37930
|
-
const
|
|
37931
|
-
|
|
37932
|
-
|
|
37933
|
-
|
|
37934
|
-
|
|
37935
|
-
|
|
37936
|
-
|
|
37937
|
-
|
|
37938
|
-
|
|
37939
|
-
|
|
37940
|
-
|
|
37941
|
-
|
|
37942
|
-
|
|
37943
|
-
if (!initialized) {
|
|
37944
|
-
if (list && list.length) {
|
|
37945
|
-
internalData.initialized = true;
|
|
37946
|
-
if (expandAll) {
|
|
37947
|
-
$xeTree.setAllExpandNode(true);
|
|
37948
|
-
}
|
|
37949
|
-
$xeTree.setCheckboxByNodeId(props.checkNodeKeys || [], true);
|
|
38206
|
+
const {
|
|
38207
|
+
rowHeight
|
|
38208
|
+
} = scrollYStore;
|
|
38209
|
+
const el = refElem.value;
|
|
38210
|
+
if (el && el.clientWidth && el.clientHeight) {
|
|
38211
|
+
const parentEl = getParentElem();
|
|
38212
|
+
const headerWrapperEl = refHeaderWrapperElem.value;
|
|
38213
|
+
const footerWrapperEl = refFooterWrapperElem.value;
|
|
38214
|
+
const headHeight = headerWrapperEl ? headerWrapperEl.clientHeight : 0;
|
|
38215
|
+
const footHeight = footerWrapperEl ? footerWrapperEl.clientHeight : 0;
|
|
38216
|
+
if (parentEl) {
|
|
38217
|
+
const parentPaddingSize = getPaddingTopBottomSize(parentEl);
|
|
38218
|
+
reactData.parentHeight = Math.max(headHeight + footHeight + rowHeight, parentEl.clientHeight - parentPaddingSize - headHeight - footHeight);
|
|
37950
38219
|
}
|
|
38220
|
+
updateHeight();
|
|
38221
|
+
return computeScrollLoad();
|
|
37951
38222
|
}
|
|
38223
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
37952
38224
|
};
|
|
37953
|
-
const
|
|
38225
|
+
const loadYData = evnt => {
|
|
37954
38226
|
const {
|
|
37955
|
-
|
|
38227
|
+
scrollYStore
|
|
37956
38228
|
} = internalData;
|
|
37957
|
-
const childrenField = computeChildrenField.value;
|
|
37958
|
-
const nodeid = getNodeId(item);
|
|
37959
|
-
nodeItem.lineCount++;
|
|
37960
|
-
if (treeExpandedMaps[nodeid]) {
|
|
37961
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(item[childrenField], (childItem, childIndex, childList) => {
|
|
37962
|
-
if (!isRoot || childIndex < childList.length - 1) {
|
|
37963
|
-
handleCountLine(childItem, false, nodeItem);
|
|
37964
|
-
}
|
|
37965
|
-
});
|
|
37966
|
-
}
|
|
37967
|
-
};
|
|
37968
|
-
const updateNodeLine = node => {
|
|
37969
38229
|
const {
|
|
37970
|
-
|
|
37971
|
-
|
|
37972
|
-
|
|
37973
|
-
|
|
37974
|
-
|
|
37975
|
-
|
|
37976
|
-
|
|
37977
|
-
|
|
37978
|
-
|
|
37979
|
-
|
|
37980
|
-
|
|
37981
|
-
|
|
37982
|
-
|
|
37983
|
-
|
|
38230
|
+
startIndex,
|
|
38231
|
+
endIndex,
|
|
38232
|
+
visibleSize,
|
|
38233
|
+
offsetSize,
|
|
38234
|
+
rowHeight
|
|
38235
|
+
} = scrollYStore;
|
|
38236
|
+
const scrollBodyElem = evnt.target;
|
|
38237
|
+
const scrollTop = scrollBodyElem.scrollTop;
|
|
38238
|
+
const toVisibleIndex = Math.floor(scrollTop / rowHeight);
|
|
38239
|
+
const offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize);
|
|
38240
|
+
const offsetEndIndex = toVisibleIndex + visibleSize + offsetSize;
|
|
38241
|
+
if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
|
|
38242
|
+
if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
|
|
38243
|
+
scrollYStore.startIndex = offsetStartIndex;
|
|
38244
|
+
scrollYStore.endIndex = offsetEndIndex;
|
|
38245
|
+
updateYData();
|
|
37984
38246
|
}
|
|
37985
38247
|
}
|
|
37986
38248
|
};
|
|
38249
|
+
const scrollEvent = evnt => {
|
|
38250
|
+
const scrollBodyElem = evnt.target;
|
|
38251
|
+
const scrollTop = scrollBodyElem.scrollTop;
|
|
38252
|
+
const scrollLeft = scrollBodyElem.scrollLeft;
|
|
38253
|
+
const isX = scrollLeft !== internalData.lastScrollLeft;
|
|
38254
|
+
const isY = scrollTop !== internalData.lastScrollTop;
|
|
38255
|
+
internalData.lastScrollTop = scrollTop;
|
|
38256
|
+
internalData.lastScrollLeft = scrollLeft;
|
|
38257
|
+
if (reactData.scrollYLoad) {
|
|
38258
|
+
loadYData(evnt);
|
|
38259
|
+
}
|
|
38260
|
+
internalData.lastScrollTime = Date.now();
|
|
38261
|
+
dispatchEvent('scroll', {
|
|
38262
|
+
scrollLeft,
|
|
38263
|
+
scrollTop,
|
|
38264
|
+
isX,
|
|
38265
|
+
isY
|
|
38266
|
+
}, evnt);
|
|
38267
|
+
};
|
|
38268
|
+
const clearScroll = () => {
|
|
38269
|
+
const scrollBodyElem = refVirtualWrapper.value;
|
|
38270
|
+
if (scrollBodyElem) {
|
|
38271
|
+
scrollBodyElem.scrollTop = 0;
|
|
38272
|
+
scrollBodyElem.scrollLeft = 0;
|
|
38273
|
+
}
|
|
38274
|
+
internalData.lastScrollTop = 0;
|
|
38275
|
+
internalData.lastScrollLeft = 0;
|
|
38276
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
38277
|
+
};
|
|
37987
38278
|
const handleNodeClickEvent = (evnt, node) => {
|
|
37988
38279
|
const {
|
|
37989
38280
|
showRadio,
|
|
@@ -38071,7 +38362,6 @@ function getNodeUniqueId() {
|
|
|
38071
38362
|
if (!checkStrictly && $xeTree.isCheckedByCheckboxNodeId(nodeid)) {
|
|
38072
38363
|
handleCheckedCheckboxNode(childRows, true);
|
|
38073
38364
|
}
|
|
38074
|
-
updateNodeLine(node);
|
|
38075
38365
|
dispatchEvent('load-success', {
|
|
38076
38366
|
node,
|
|
38077
38367
|
data: childRecords
|
|
@@ -38079,7 +38369,6 @@ function getNodeUniqueId() {
|
|
|
38079
38369
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
38080
38370
|
});
|
|
38081
38371
|
} else {
|
|
38082
|
-
updateNodeLine(node);
|
|
38083
38372
|
dispatchEvent('load-success', {
|
|
38084
38373
|
node,
|
|
38085
38374
|
data: childRecords
|
|
@@ -38093,13 +38382,14 @@ function getNodeUniqueId() {
|
|
|
38093
38382
|
if (treeExpandLazyLoadedMaps[nodeid]) {
|
|
38094
38383
|
treeExpandLazyLoadedMaps[nodeid] = false;
|
|
38095
38384
|
}
|
|
38096
|
-
updateNodeLine(node);
|
|
38097
38385
|
dispatchEvent('load-error', {
|
|
38098
38386
|
node,
|
|
38099
38387
|
data: e
|
|
38100
38388
|
}, new Event('load-error'));
|
|
38101
38389
|
}).finally(() => {
|
|
38102
|
-
|
|
38390
|
+
handleTreeToList();
|
|
38391
|
+
handleData();
|
|
38392
|
+
return recalculate();
|
|
38103
38393
|
});
|
|
38104
38394
|
} else {
|
|
38105
38395
|
resolve();
|
|
@@ -38175,8 +38465,9 @@ function getNodeUniqueId() {
|
|
|
38175
38465
|
});
|
|
38176
38466
|
}
|
|
38177
38467
|
reactData.updateExpandedFlag++;
|
|
38178
|
-
|
|
38179
|
-
|
|
38468
|
+
handleTreeToList();
|
|
38469
|
+
handleData();
|
|
38470
|
+
return Promise.all(result).then(() => recalculate());
|
|
38180
38471
|
};
|
|
38181
38472
|
const toggleExpandEvent = (evnt, node) => {
|
|
38182
38473
|
const {
|
|
@@ -38197,12 +38488,10 @@ function getNodeUniqueId() {
|
|
|
38197
38488
|
const {
|
|
38198
38489
|
transform
|
|
38199
38490
|
} = props;
|
|
38200
|
-
const {
|
|
38201
|
-
treeList
|
|
38202
|
-
} = reactData;
|
|
38203
38491
|
const {
|
|
38204
38492
|
selectCheckboxMaps,
|
|
38205
|
-
indeterminateRowMaps
|
|
38493
|
+
indeterminateRowMaps,
|
|
38494
|
+
afterTreeList
|
|
38206
38495
|
} = internalData;
|
|
38207
38496
|
const childrenField = computeChildrenField.value;
|
|
38208
38497
|
const mapChildrenField = computeMapChildrenField.value;
|
|
@@ -38214,7 +38503,7 @@ function getNodeUniqueId() {
|
|
|
38214
38503
|
if (!checkStrictly) {
|
|
38215
38504
|
const childRowMaps = {};
|
|
38216
38505
|
const childRowList = [];
|
|
38217
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(
|
|
38506
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeList, node => {
|
|
38218
38507
|
const nodeid = getNodeId(node);
|
|
38219
38508
|
const childList = node[childrenField];
|
|
38220
38509
|
if (childList && childList.length && !childRowMaps[nodeid]) {
|
|
@@ -38230,11 +38519,13 @@ function getNodeUniqueId() {
|
|
|
38230
38519
|
const childList = vals[2];
|
|
38231
38520
|
let sLen = 0; // 已选
|
|
38232
38521
|
let hLen = 0; // 半选
|
|
38233
|
-
let vLen = 0; //
|
|
38522
|
+
let vLen = 0; // 有效子行
|
|
38523
|
+
const cLen = childList.length; // 子行
|
|
38234
38524
|
childList.forEach(checkMethod ? item => {
|
|
38235
38525
|
const childNodeid = getNodeId(item);
|
|
38236
38526
|
const isSelect = selectCheckboxMaps[childNodeid];
|
|
38237
38527
|
if (checkMethod({
|
|
38528
|
+
$tree: $xeTree,
|
|
38238
38529
|
node: item
|
|
38239
38530
|
})) {
|
|
38240
38531
|
if (isSelect) {
|
|
@@ -38260,8 +38551,25 @@ function getNodeUniqueId() {
|
|
|
38260
38551
|
}
|
|
38261
38552
|
vLen++;
|
|
38262
38553
|
});
|
|
38263
|
-
|
|
38264
|
-
|
|
38554
|
+
let isSelected = false;
|
|
38555
|
+
if (cLen > 0) {
|
|
38556
|
+
if (vLen > 0) {
|
|
38557
|
+
isSelected = (sLen > 0 || hLen > 0) && sLen >= vLen;
|
|
38558
|
+
} else {
|
|
38559
|
+
// 如果存在子项禁用
|
|
38560
|
+
if (sLen > 0 && sLen >= vLen) {
|
|
38561
|
+
isSelected = true;
|
|
38562
|
+
} else if (selectCheckboxMaps[nodeid]) {
|
|
38563
|
+
isSelected = true;
|
|
38564
|
+
} else {
|
|
38565
|
+
isSelected = false;
|
|
38566
|
+
}
|
|
38567
|
+
}
|
|
38568
|
+
} else {
|
|
38569
|
+
// 如果无子项
|
|
38570
|
+
isSelected = selectCheckboxMaps[nodeid];
|
|
38571
|
+
}
|
|
38572
|
+
const halfSelect = !isSelected && (sLen > 0 || hLen > 0);
|
|
38265
38573
|
if (isSelected) {
|
|
38266
38574
|
selectCheckboxMaps[nodeid] = node;
|
|
38267
38575
|
if (indeterminateRowMaps[nodeid]) {
|
|
@@ -38302,6 +38610,7 @@ function getNodeUniqueId() {
|
|
|
38302
38610
|
let isDisabled = !!checkMethod;
|
|
38303
38611
|
if (checkMethod) {
|
|
38304
38612
|
isDisabled = !checkMethod({
|
|
38613
|
+
$tree: $xeTree,
|
|
38305
38614
|
node
|
|
38306
38615
|
});
|
|
38307
38616
|
}
|
|
@@ -38317,7 +38626,7 @@ function getNodeUniqueId() {
|
|
|
38317
38626
|
selectCheckboxMaps[nodeid] = node;
|
|
38318
38627
|
}
|
|
38319
38628
|
if (!checkStrictly) {
|
|
38320
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(node, childrenField), childNode => {
|
|
38629
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(node, transform ? mapChildrenField : childrenField), childNode => {
|
|
38321
38630
|
const childNodeid = getNodeId(childNode);
|
|
38322
38631
|
if (isChecked) {
|
|
38323
38632
|
if (!selectCheckboxMaps[childNodeid]) {
|
|
@@ -38387,6 +38696,7 @@ function getNodeUniqueId() {
|
|
|
38387
38696
|
let isDisabled = !!checkMethod;
|
|
38388
38697
|
if (checkMethod) {
|
|
38389
38698
|
isDisabled = !checkMethod({
|
|
38699
|
+
$tree: $xeTree,
|
|
38390
38700
|
node
|
|
38391
38701
|
});
|
|
38392
38702
|
}
|
|
@@ -38403,6 +38713,372 @@ function getNodeUniqueId() {
|
|
|
38403
38713
|
checked: isChecked
|
|
38404
38714
|
}, evnt);
|
|
38405
38715
|
};
|
|
38716
|
+
const handleGlobalResizeEvent = () => {
|
|
38717
|
+
const el = refElem.value;
|
|
38718
|
+
if (!el || !el.clientWidth) {
|
|
38719
|
+
return;
|
|
38720
|
+
}
|
|
38721
|
+
recalculate();
|
|
38722
|
+
};
|
|
38723
|
+
const treeMethods = {
|
|
38724
|
+
dispatchEvent,
|
|
38725
|
+
getNodeId,
|
|
38726
|
+
loadData(data) {
|
|
38727
|
+
return loadData(data || []);
|
|
38728
|
+
},
|
|
38729
|
+
reloadData(data) {
|
|
38730
|
+
return loadData(data || []);
|
|
38731
|
+
},
|
|
38732
|
+
clearCurrentNode() {
|
|
38733
|
+
reactData.currentNode = null;
|
|
38734
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
38735
|
+
},
|
|
38736
|
+
getCurrentNodeId() {
|
|
38737
|
+
const {
|
|
38738
|
+
currentNode
|
|
38739
|
+
} = reactData;
|
|
38740
|
+
if (currentNode) {
|
|
38741
|
+
return getNodeId(currentNode);
|
|
38742
|
+
}
|
|
38743
|
+
return null;
|
|
38744
|
+
},
|
|
38745
|
+
getCurrentNode() {
|
|
38746
|
+
const {
|
|
38747
|
+
currentNode
|
|
38748
|
+
} = reactData;
|
|
38749
|
+
const {
|
|
38750
|
+
nodeMaps
|
|
38751
|
+
} = internalData;
|
|
38752
|
+
if (currentNode) {
|
|
38753
|
+
const nodeItem = nodeMaps[getNodeId(currentNode)];
|
|
38754
|
+
if (nodeItem) {
|
|
38755
|
+
return nodeItem.item;
|
|
38756
|
+
}
|
|
38757
|
+
}
|
|
38758
|
+
return null;
|
|
38759
|
+
},
|
|
38760
|
+
setCurrentNodeId(nodeKey) {
|
|
38761
|
+
const {
|
|
38762
|
+
nodeMaps
|
|
38763
|
+
} = internalData;
|
|
38764
|
+
const nodeItem = nodeMaps[nodeKey];
|
|
38765
|
+
reactData.currentNode = nodeItem ? nodeItem.item : null;
|
|
38766
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
38767
|
+
},
|
|
38768
|
+
setCurrentNode(node) {
|
|
38769
|
+
reactData.currentNode = node;
|
|
38770
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
38771
|
+
},
|
|
38772
|
+
clearRadioNode() {
|
|
38773
|
+
reactData.selectRadioKey = null;
|
|
38774
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
38775
|
+
},
|
|
38776
|
+
getRadioNodeId() {
|
|
38777
|
+
return reactData.selectRadioKey || null;
|
|
38778
|
+
},
|
|
38779
|
+
getRadioNode() {
|
|
38780
|
+
const {
|
|
38781
|
+
selectRadioKey
|
|
38782
|
+
} = reactData;
|
|
38783
|
+
const {
|
|
38784
|
+
nodeMaps
|
|
38785
|
+
} = internalData;
|
|
38786
|
+
if (selectRadioKey) {
|
|
38787
|
+
const nodeItem = nodeMaps[selectRadioKey];
|
|
38788
|
+
if (nodeItem) {
|
|
38789
|
+
return nodeItem.item;
|
|
38790
|
+
}
|
|
38791
|
+
}
|
|
38792
|
+
return null;
|
|
38793
|
+
},
|
|
38794
|
+
setRadioNodeId(nodeKey) {
|
|
38795
|
+
reactData.selectRadioKey = nodeKey;
|
|
38796
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
38797
|
+
},
|
|
38798
|
+
setRadioNode,
|
|
38799
|
+
setCheckboxNode,
|
|
38800
|
+
setCheckboxByNodeId,
|
|
38801
|
+
getCheckboxNodeIds() {
|
|
38802
|
+
const {
|
|
38803
|
+
selectCheckboxMaps
|
|
38804
|
+
} = internalData;
|
|
38805
|
+
return Object.keys(selectCheckboxMaps);
|
|
38806
|
+
},
|
|
38807
|
+
getCheckboxNodes() {
|
|
38808
|
+
const {
|
|
38809
|
+
nodeMaps,
|
|
38810
|
+
selectCheckboxMaps
|
|
38811
|
+
} = internalData;
|
|
38812
|
+
const list = [];
|
|
38813
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps, (item, nodeid) => {
|
|
38814
|
+
const nodeItem = nodeMaps[nodeid];
|
|
38815
|
+
if (nodeItem) {
|
|
38816
|
+
list.push(nodeItem.item);
|
|
38817
|
+
}
|
|
38818
|
+
});
|
|
38819
|
+
return list;
|
|
38820
|
+
},
|
|
38821
|
+
clearCheckboxNode() {
|
|
38822
|
+
internalData.selectCheckboxMaps = {};
|
|
38823
|
+
reactData.updateCheckboxFlag++;
|
|
38824
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
38825
|
+
return {
|
|
38826
|
+
checkNodeKeys: []
|
|
38827
|
+
};
|
|
38828
|
+
});
|
|
38829
|
+
},
|
|
38830
|
+
setAllCheckboxNode(checked) {
|
|
38831
|
+
const {
|
|
38832
|
+
transform
|
|
38833
|
+
} = props;
|
|
38834
|
+
const selectMaps = {};
|
|
38835
|
+
const childrenField = computeChildrenField.value;
|
|
38836
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
38837
|
+
const checkKeys = [];
|
|
38838
|
+
if (checked) {
|
|
38839
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterTreeList, node => {
|
|
38840
|
+
const nodeid = getNodeId(node);
|
|
38841
|
+
checkKeys.push(nodeid);
|
|
38842
|
+
selectMaps[nodeid] = true;
|
|
38843
|
+
}, {
|
|
38844
|
+
children: transform ? mapChildrenField : childrenField
|
|
38845
|
+
});
|
|
38846
|
+
}
|
|
38847
|
+
internalData.selectCheckboxMaps = selectMaps;
|
|
38848
|
+
reactData.updateCheckboxFlag++;
|
|
38849
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
38850
|
+
return {
|
|
38851
|
+
checkNodeKeys: checkKeys
|
|
38852
|
+
};
|
|
38853
|
+
});
|
|
38854
|
+
},
|
|
38855
|
+
clearExpandNode() {
|
|
38856
|
+
return treeMethods.clearAllExpandNode();
|
|
38857
|
+
},
|
|
38858
|
+
clearAllExpandNode() {
|
|
38859
|
+
const {
|
|
38860
|
+
nodeMaps
|
|
38861
|
+
} = internalData;
|
|
38862
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(nodeMaps, nodeItem => {
|
|
38863
|
+
nodeItem.treeLoaded = false;
|
|
38864
|
+
});
|
|
38865
|
+
internalData.treeExpandedMaps = {};
|
|
38866
|
+
reactData.updateExpandedFlag++;
|
|
38867
|
+
handleTreeToList();
|
|
38868
|
+
handleData();
|
|
38869
|
+
return recalculate();
|
|
38870
|
+
},
|
|
38871
|
+
setExpandByNodeId(nodeids, expanded) {
|
|
38872
|
+
const {
|
|
38873
|
+
treeExpandedMaps
|
|
38874
|
+
} = internalData;
|
|
38875
|
+
if (nodeids) {
|
|
38876
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(nodeids)) {
|
|
38877
|
+
nodeids = [nodeids];
|
|
38878
|
+
}
|
|
38879
|
+
nodeids.forEach(nodeid => {
|
|
38880
|
+
handleSetExpand(nodeid, expanded, treeExpandedMaps);
|
|
38881
|
+
});
|
|
38882
|
+
reactData.updateExpandedFlag++;
|
|
38883
|
+
}
|
|
38884
|
+
handleTreeToList();
|
|
38885
|
+
handleData();
|
|
38886
|
+
return recalculate();
|
|
38887
|
+
},
|
|
38888
|
+
getExpandNodeIds() {
|
|
38889
|
+
const {
|
|
38890
|
+
treeExpandedMaps
|
|
38891
|
+
} = internalData;
|
|
38892
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(treeExpandedMaps);
|
|
38893
|
+
},
|
|
38894
|
+
getExpandNodes() {
|
|
38895
|
+
const {
|
|
38896
|
+
nodeMaps,
|
|
38897
|
+
treeExpandedMaps
|
|
38898
|
+
} = internalData;
|
|
38899
|
+
const list = [];
|
|
38900
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(treeExpandedMaps, (item, nodeid) => {
|
|
38901
|
+
const nodeItem = nodeMaps[nodeid];
|
|
38902
|
+
if (nodeItem) {
|
|
38903
|
+
list.push(nodeItem.item);
|
|
38904
|
+
}
|
|
38905
|
+
});
|
|
38906
|
+
return list;
|
|
38907
|
+
},
|
|
38908
|
+
setExpandNode(nodes, expanded) {
|
|
38909
|
+
const {
|
|
38910
|
+
treeExpandedMaps
|
|
38911
|
+
} = internalData;
|
|
38912
|
+
if (nodes) {
|
|
38913
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(nodes)) {
|
|
38914
|
+
nodes = [nodes];
|
|
38915
|
+
}
|
|
38916
|
+
nodes.forEach(node => {
|
|
38917
|
+
const nodeid = getNodeId(node);
|
|
38918
|
+
handleSetExpand(nodeid, expanded, treeExpandedMaps);
|
|
38919
|
+
});
|
|
38920
|
+
reactData.updateExpandedFlag++;
|
|
38921
|
+
}
|
|
38922
|
+
handleTreeToList();
|
|
38923
|
+
handleData();
|
|
38924
|
+
return recalculate();
|
|
38925
|
+
},
|
|
38926
|
+
toggleExpandByNodeId(nodeids) {
|
|
38927
|
+
const {
|
|
38928
|
+
treeExpandedMaps
|
|
38929
|
+
} = internalData;
|
|
38930
|
+
if (nodeids) {
|
|
38931
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(nodeids)) {
|
|
38932
|
+
nodeids = [nodeids];
|
|
38933
|
+
}
|
|
38934
|
+
nodeids.forEach(nodeid => {
|
|
38935
|
+
handleSetExpand(nodeid, !treeExpandedMaps[nodeid], treeExpandedMaps);
|
|
38936
|
+
});
|
|
38937
|
+
reactData.updateExpandedFlag++;
|
|
38938
|
+
}
|
|
38939
|
+
handleTreeToList();
|
|
38940
|
+
handleData();
|
|
38941
|
+
return recalculate();
|
|
38942
|
+
},
|
|
38943
|
+
toggleExpandNode(nodes) {
|
|
38944
|
+
const {
|
|
38945
|
+
treeExpandedMaps
|
|
38946
|
+
} = internalData;
|
|
38947
|
+
if (nodes) {
|
|
38948
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(nodes)) {
|
|
38949
|
+
nodes = [nodes];
|
|
38950
|
+
}
|
|
38951
|
+
nodes.forEach(node => {
|
|
38952
|
+
const nodeid = getNodeId(node);
|
|
38953
|
+
handleSetExpand(nodeid, !treeExpandedMaps[nodeid], treeExpandedMaps);
|
|
38954
|
+
});
|
|
38955
|
+
reactData.updateExpandedFlag++;
|
|
38956
|
+
}
|
|
38957
|
+
handleTreeToList();
|
|
38958
|
+
handleData();
|
|
38959
|
+
return recalculate();
|
|
38960
|
+
},
|
|
38961
|
+
setAllExpandNode(expanded) {
|
|
38962
|
+
const {
|
|
38963
|
+
transform
|
|
38964
|
+
} = props;
|
|
38965
|
+
const {
|
|
38966
|
+
treeExpandedMaps
|
|
38967
|
+
} = internalData;
|
|
38968
|
+
const childrenField = computeChildrenField.value;
|
|
38969
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
38970
|
+
if (expanded) {
|
|
38971
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterTreeList, node => {
|
|
38972
|
+
const childList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(node, childrenField);
|
|
38973
|
+
const hasChild = childList && childList.length;
|
|
38974
|
+
if (hasChild) {
|
|
38975
|
+
const nodeid = getNodeId(node);
|
|
38976
|
+
treeExpandedMaps[nodeid] = true;
|
|
38977
|
+
}
|
|
38978
|
+
}, {
|
|
38979
|
+
children: transform ? mapChildrenField : childrenField
|
|
38980
|
+
});
|
|
38981
|
+
} else {
|
|
38982
|
+
internalData.treeExpandedMaps = {};
|
|
38983
|
+
}
|
|
38984
|
+
reactData.updateExpandedFlag++;
|
|
38985
|
+
handleTreeToList();
|
|
38986
|
+
handleData();
|
|
38987
|
+
return recalculate();
|
|
38988
|
+
},
|
|
38989
|
+
reloadExpandNode(node) {
|
|
38990
|
+
const {
|
|
38991
|
+
lazy
|
|
38992
|
+
} = props;
|
|
38993
|
+
if (lazy) {
|
|
38994
|
+
treeMethods.clearExpandLoaded(node);
|
|
38995
|
+
return handleAsyncTreeExpandChilds(node);
|
|
38996
|
+
}
|
|
38997
|
+
return recalculate();
|
|
38998
|
+
},
|
|
38999
|
+
clearExpandLoaded(node) {
|
|
39000
|
+
const {
|
|
39001
|
+
lazy
|
|
39002
|
+
} = props;
|
|
39003
|
+
const {
|
|
39004
|
+
nodeMaps
|
|
39005
|
+
} = internalData;
|
|
39006
|
+
if (lazy) {
|
|
39007
|
+
const nodeItem = nodeMaps[getNodeId(node)];
|
|
39008
|
+
if (nodeItem) {
|
|
39009
|
+
nodeItem.treeLoaded = false;
|
|
39010
|
+
}
|
|
39011
|
+
}
|
|
39012
|
+
return recalculate();
|
|
39013
|
+
},
|
|
39014
|
+
/**
|
|
39015
|
+
* 用于树结构,给行数据加载子节点
|
|
39016
|
+
*/
|
|
39017
|
+
loadChildrenNode(node, childRecords) {
|
|
39018
|
+
const {
|
|
39019
|
+
lazy,
|
|
39020
|
+
transform
|
|
39021
|
+
} = props;
|
|
39022
|
+
const {
|
|
39023
|
+
nodeMaps
|
|
39024
|
+
} = internalData;
|
|
39025
|
+
if (!lazy) {
|
|
39026
|
+
return Promise.resolve([]);
|
|
39027
|
+
}
|
|
39028
|
+
const childrenField = computeChildrenField.value;
|
|
39029
|
+
const mapChildrenField = computeMapChildrenField.value;
|
|
39030
|
+
const parentNodeItem = nodeMaps[getNodeId(node)];
|
|
39031
|
+
const parentLevel = parentNodeItem ? parentNodeItem.level : 0;
|
|
39032
|
+
const parentNodes = parentNodeItem ? parentNodeItem.nodes : [];
|
|
39033
|
+
return createNode(childRecords).then(nodeList => {
|
|
39034
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(nodeList, (childRow, index, items, path, parent, nodes) => {
|
|
39035
|
+
const itemNodeId = getNodeId(childRow);
|
|
39036
|
+
nodeMaps[itemNodeId] = {
|
|
39037
|
+
item: node,
|
|
39038
|
+
index: -1,
|
|
39039
|
+
items,
|
|
39040
|
+
parent: parent || parentNodeItem.item,
|
|
39041
|
+
nodes: parentNodes.concat(nodes),
|
|
39042
|
+
level: parentLevel + nodes.length,
|
|
39043
|
+
treeIndex: -1,
|
|
39044
|
+
lineCount: 0,
|
|
39045
|
+
treeLoaded: false
|
|
39046
|
+
};
|
|
39047
|
+
}, {
|
|
39048
|
+
children: childrenField
|
|
39049
|
+
});
|
|
39050
|
+
node[childrenField] = nodeList;
|
|
39051
|
+
if (transform) {
|
|
39052
|
+
node[mapChildrenField] = nodeList;
|
|
39053
|
+
}
|
|
39054
|
+
updateAfterDataIndex();
|
|
39055
|
+
return nodeList;
|
|
39056
|
+
});
|
|
39057
|
+
},
|
|
39058
|
+
isExpandByNode,
|
|
39059
|
+
isCheckedByRadioNodeId,
|
|
39060
|
+
isCheckedByRadioNode,
|
|
39061
|
+
isCheckedByCheckboxNodeId,
|
|
39062
|
+
isIndeterminateByCheckboxNode,
|
|
39063
|
+
isCheckedByCheckboxNode,
|
|
39064
|
+
getCheckboxIndeterminateNodes() {
|
|
39065
|
+
const {
|
|
39066
|
+
nodeMaps,
|
|
39067
|
+
indeterminateRowMaps
|
|
39068
|
+
} = internalData;
|
|
39069
|
+
const list = [];
|
|
39070
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(indeterminateRowMaps, (item, nodeid) => {
|
|
39071
|
+
const nodeItem = nodeMaps[nodeid];
|
|
39072
|
+
if (nodeItem) {
|
|
39073
|
+
list.push(nodeItem.item);
|
|
39074
|
+
}
|
|
39075
|
+
});
|
|
39076
|
+
return list;
|
|
39077
|
+
},
|
|
39078
|
+
recalculate,
|
|
39079
|
+
scrollTo,
|
|
39080
|
+
clearScroll
|
|
39081
|
+
};
|
|
38406
39082
|
const treePrivateMethods = {};
|
|
38407
39083
|
Object.assign($xeTree, treeMethods, treePrivateMethods);
|
|
38408
39084
|
const renderRadio = (node, nodeid, isChecked) => {
|
|
@@ -38416,12 +39092,14 @@ function getNodeUniqueId() {
|
|
|
38416
39092
|
visibleMethod
|
|
38417
39093
|
} = radioOpts;
|
|
38418
39094
|
const isVisible = !visibleMethod || visibleMethod({
|
|
39095
|
+
$tree: $xeTree,
|
|
38419
39096
|
node
|
|
38420
39097
|
});
|
|
38421
39098
|
let isDisabled = !!checkMethod;
|
|
38422
39099
|
if (showRadio && showIcon && isVisible) {
|
|
38423
39100
|
if (checkMethod) {
|
|
38424
39101
|
isDisabled = !checkMethod({
|
|
39102
|
+
$tree: $xeTree,
|
|
38425
39103
|
node
|
|
38426
39104
|
});
|
|
38427
39105
|
}
|
|
@@ -38453,12 +39131,14 @@ function getNodeUniqueId() {
|
|
|
38453
39131
|
} = checkboxOpts;
|
|
38454
39132
|
const isIndeterminate = isIndeterminateByCheckboxNodeid(nodeid);
|
|
38455
39133
|
const isVisible = !visibleMethod || visibleMethod({
|
|
39134
|
+
$tree: $xeTree,
|
|
38456
39135
|
node
|
|
38457
39136
|
});
|
|
38458
39137
|
let isDisabled = !!checkMethod;
|
|
38459
39138
|
if (showCheckbox && showIcon && isVisible) {
|
|
38460
39139
|
if (checkMethod) {
|
|
38461
39140
|
isDisabled = !checkMethod({
|
|
39141
|
+
$tree: $xeTree,
|
|
38462
39142
|
node
|
|
38463
39143
|
});
|
|
38464
39144
|
}
|
|
@@ -38479,7 +39159,7 @@ function getNodeUniqueId() {
|
|
|
38479
39159
|
}
|
|
38480
39160
|
return renderEmptyElement($xeTree);
|
|
38481
39161
|
};
|
|
38482
|
-
const renderNode = node => {
|
|
39162
|
+
const renderNode = (node, nodeid) => {
|
|
38483
39163
|
const {
|
|
38484
39164
|
lazy,
|
|
38485
39165
|
showRadio,
|
|
@@ -38497,6 +39177,7 @@ function getNodeUniqueId() {
|
|
|
38497
39177
|
updateExpandedFlag
|
|
38498
39178
|
} = reactData;
|
|
38499
39179
|
const {
|
|
39180
|
+
afterTreeList,
|
|
38500
39181
|
nodeMaps,
|
|
38501
39182
|
treeExpandedMaps,
|
|
38502
39183
|
treeExpandLazyLoadedMaps
|
|
@@ -38509,30 +39190,13 @@ function getNodeUniqueId() {
|
|
|
38509
39190
|
const iconSlot = slots.icon;
|
|
38510
39191
|
const titleSlot = slots.title;
|
|
38511
39192
|
const extraSlot = slots.extra;
|
|
38512
|
-
const nodeid = getNodeId(node);
|
|
38513
39193
|
const isExpand = updateExpandedFlag && treeExpandedMaps[nodeid];
|
|
38514
39194
|
const nodeItem = nodeMaps[nodeid];
|
|
38515
39195
|
const nodeValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(node, titleField);
|
|
38516
|
-
const
|
|
38517
|
-
if (hasChild && treeExpandedMaps[nodeid]) {
|
|
38518
|
-
if (showLine) {
|
|
38519
|
-
childVns.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38520
|
-
key: 'line',
|
|
38521
|
-
class: 'vxe-tree--node-child-line',
|
|
38522
|
-
style: {
|
|
38523
|
-
height: `calc(${nodeItem.lineCount} * var(--vxe-ui-tree-node-height) - var(--vxe-ui-tree-node-height) / 2)`,
|
|
38524
|
-
left: `${(nodeItem.level + 1) * (indent || 1)}px`
|
|
38525
|
-
}
|
|
38526
|
-
}));
|
|
38527
|
-
}
|
|
38528
|
-
childList.forEach(childItem => {
|
|
38529
|
-
childVns.push(renderNode(childItem));
|
|
38530
|
-
});
|
|
38531
|
-
}
|
|
39196
|
+
const nLevel = nodeItem.level;
|
|
38532
39197
|
let isRadioChecked = false;
|
|
38533
39198
|
if (showRadio) {
|
|
38534
|
-
|
|
38535
|
-
isRadioChecked = nodeid == selectRadioKey;
|
|
39199
|
+
isRadioChecked = nodeid === String(selectRadioKey);
|
|
38536
39200
|
}
|
|
38537
39201
|
let isCheckboxChecked = false;
|
|
38538
39202
|
if (showCheckbox) {
|
|
@@ -38546,8 +39210,14 @@ function getNodeUniqueId() {
|
|
|
38546
39210
|
hasLazyChilds = node[hasChildField];
|
|
38547
39211
|
isLazyLoaded = !!nodeItem.treeLoaded;
|
|
38548
39212
|
}
|
|
39213
|
+
const prevNode = nodeItem.items[nodeItem.treeIndex - 1];
|
|
39214
|
+
const nParams = {
|
|
39215
|
+
node,
|
|
39216
|
+
isExpand
|
|
39217
|
+
};
|
|
38549
39218
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38550
|
-
|
|
39219
|
+
key: nodeid,
|
|
39220
|
+
class: ['vxe-tree--node-wrapper', `node--level-${nLevel}`],
|
|
38551
39221
|
nodeid
|
|
38552
39222
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38553
39223
|
class: ['vxe-tree--node-item', {
|
|
@@ -38556,7 +39226,7 @@ function getNodeUniqueId() {
|
|
|
38556
39226
|
'is-checkbox--checked': isCheckboxChecked
|
|
38557
39227
|
}],
|
|
38558
39228
|
style: {
|
|
38559
|
-
paddingLeft: `${(
|
|
39229
|
+
paddingLeft: `${(nLevel - 1) * (indent || 1)}px`
|
|
38560
39230
|
},
|
|
38561
39231
|
onClick(evnt) {
|
|
38562
39232
|
handleNodeClickEvent(evnt, node);
|
|
@@ -38564,41 +39234,57 @@ function getNodeUniqueId() {
|
|
|
38564
39234
|
onDblclick(evnt) {
|
|
38565
39235
|
handleNodeDblclickEvent(evnt, node);
|
|
38566
39236
|
}
|
|
38567
|
-
}, [
|
|
39237
|
+
}, [showLine ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39238
|
+
class: 'vxe-tree--node-line-wrapper'
|
|
39239
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39240
|
+
class: 'vxe-tree--node-line',
|
|
39241
|
+
style: {
|
|
39242
|
+
height: `${getNodeId(afterTreeList[0]) === nodeid ? 1 : calcTreeLine($xeTree, node, prevNode)}px`
|
|
39243
|
+
}
|
|
39244
|
+
})]) : renderEmptyElement($xeTree), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38568
39245
|
class: 'vxe-tree--node-item-switcher'
|
|
38569
39246
|
}, showIcon && (lazy ? isLazyLoaded ? hasChild : hasLazyChilds : hasChild) ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38570
39247
|
class: 'vxe-tree--node-item-icon',
|
|
38571
39248
|
onClick(evnt) {
|
|
38572
39249
|
toggleExpandEvent(evnt, node);
|
|
38573
39250
|
}
|
|
38574
|
-
}, iconSlot ? iconSlot({
|
|
38575
|
-
node,
|
|
38576
|
-
isExpand
|
|
38577
|
-
}) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
39251
|
+
}, iconSlot ? getSlotVNs(iconSlot(nParams)) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
38578
39252
|
class: isLazyLoading ? iconLoaded || getIcon().TREE_NODE_LOADED : isExpand ? iconOpen || getIcon().TREE_NODE_OPEN : iconClose || getIcon().TREE_NODE_CLOSE
|
|
38579
|
-
})])] : [])
|
|
39253
|
+
})])] : []), renderRadio(node, nodeid, isRadioChecked), renderCheckbox(node, nodeid, isCheckboxChecked), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38580
39254
|
class: 'vxe-tree--node-item-inner'
|
|
38581
39255
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38582
39256
|
class: 'vxe-tree--node-item-title'
|
|
38583
|
-
}, titleSlot ? getSlotVNs(titleSlot({
|
|
38584
|
-
node,
|
|
38585
|
-
isExpand
|
|
38586
|
-
})) : `${nodeValue}`), extraSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39257
|
+
}, titleSlot ? getSlotVNs(titleSlot(nParams)) : `${nodeValue}`), extraSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38587
39258
|
class: 'vxe-tree--node-item-extra'
|
|
38588
|
-
}, getSlotVNs(extraSlot(
|
|
38589
|
-
node,
|
|
38590
|
-
isExpand
|
|
38591
|
-
}))) : renderEmptyElement($xeTree)])]), hasChild && treeExpandedMaps[nodeid] ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38592
|
-
class: 'vxe-tree--node-child-wrapper'
|
|
38593
|
-
}, childVns) : renderEmptyElement($xeTree)]);
|
|
39259
|
+
}, getSlotVNs(extraSlot(nParams))) : renderEmptyElement($xeTree)])])]);
|
|
38594
39260
|
};
|
|
38595
|
-
const
|
|
39261
|
+
const renderList = treeList => {
|
|
38596
39262
|
const {
|
|
38597
|
-
|
|
38598
|
-
} =
|
|
38599
|
-
|
|
38600
|
-
|
|
38601
|
-
}
|
|
39263
|
+
transform
|
|
39264
|
+
} = props;
|
|
39265
|
+
const {
|
|
39266
|
+
treeExpandedMaps
|
|
39267
|
+
} = internalData;
|
|
39268
|
+
const childrenField = computeChildrenField.value;
|
|
39269
|
+
if (!treeList.length) {
|
|
39270
|
+
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39271
|
+
class: 'vxe-tree--empty-placeholder'
|
|
39272
|
+
}, getI18n('vxe.tree.searchEmpty'))];
|
|
39273
|
+
}
|
|
39274
|
+
const nodeVNs = [];
|
|
39275
|
+
treeList.forEach(transform ? node => {
|
|
39276
|
+
const nodeid = getNodeId(node);
|
|
39277
|
+
nodeVNs.push(renderNode(node, nodeid));
|
|
39278
|
+
} : node => {
|
|
39279
|
+
const nodeid = getNodeId(node);
|
|
39280
|
+
nodeVNs.push(renderNode(node, nodeid));
|
|
39281
|
+
const childList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(node, childrenField);
|
|
39282
|
+
const hasChild = childList && childList.length;
|
|
39283
|
+
if (hasChild && treeExpandedMaps[nodeid]) {
|
|
39284
|
+
nodeVNs.push(...renderList(childList));
|
|
39285
|
+
}
|
|
39286
|
+
});
|
|
39287
|
+
return nodeVNs;
|
|
38602
39288
|
};
|
|
38603
39289
|
const renderVN = () => {
|
|
38604
39290
|
const {
|
|
@@ -38606,13 +39292,20 @@ function getNodeUniqueId() {
|
|
|
38606
39292
|
trigger,
|
|
38607
39293
|
showLine
|
|
38608
39294
|
} = props;
|
|
39295
|
+
const {
|
|
39296
|
+
bodyHeight,
|
|
39297
|
+
topSpaceHeight,
|
|
39298
|
+
treeList
|
|
39299
|
+
} = reactData;
|
|
38609
39300
|
const vSize = computeSize.value;
|
|
38610
39301
|
const radioOpts = computeRadioOpts.value;
|
|
38611
39302
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
38612
|
-
const treeStyle = computeTreeStyle.value;
|
|
38613
39303
|
const loadingOpts = computeLoadingOpts.value;
|
|
38614
39304
|
const isRowHover = computeIsRowHover.value;
|
|
39305
|
+
const treeStyle = computeTreeStyle.value;
|
|
38615
39306
|
const loadingSlot = slots.loading;
|
|
39307
|
+
const headerSlot = slots.header;
|
|
39308
|
+
const footerSlot = slots.footer;
|
|
38616
39309
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
38617
39310
|
ref: refElem,
|
|
38618
39311
|
class: ['vxe-tree', {
|
|
@@ -38623,9 +39316,34 @@ function getNodeUniqueId() {
|
|
|
38623
39316
|
'node--hover': isRowHover,
|
|
38624
39317
|
'node--trigger': trigger === 'node',
|
|
38625
39318
|
'is--loading': loading
|
|
38626
|
-
}]
|
|
38627
|
-
|
|
38628
|
-
|
|
39319
|
+
}]
|
|
39320
|
+
}, [headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39321
|
+
ref: refHeaderWrapperElem,
|
|
39322
|
+
class: 'vxe-tree--header-wrapper'
|
|
39323
|
+
}, headerSlot({
|
|
39324
|
+
$tree: $xeTree
|
|
39325
|
+
})) : renderEmptyElement($xeTree), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39326
|
+
ref: refVirtualWrapper,
|
|
39327
|
+
class: 'vxe-tree--node-list-wrapper',
|
|
39328
|
+
style: treeStyle,
|
|
39329
|
+
onScroll: scrollEvent
|
|
39330
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39331
|
+
class: 'vxe-select--y-space',
|
|
39332
|
+
style: {
|
|
39333
|
+
height: bodyHeight ? `${bodyHeight}px` : ''
|
|
39334
|
+
}
|
|
39335
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39336
|
+
ref: refVirtualBody,
|
|
39337
|
+
class: 'vxe-tree--node-list-body',
|
|
39338
|
+
style: {
|
|
39339
|
+
transform: `translateY(${topSpaceHeight}px)`
|
|
39340
|
+
}
|
|
39341
|
+
}, renderList(treeList))]), footerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39342
|
+
ref: refFooterWrapperElem,
|
|
39343
|
+
class: 'vxe-tree--footer-wrapper'
|
|
39344
|
+
}, footerSlot({
|
|
39345
|
+
$tree: $xeTree
|
|
39346
|
+
})) : renderEmptyElement($xeTree),
|
|
38629
39347
|
/**
|
|
38630
39348
|
* 加载中
|
|
38631
39349
|
*/
|
|
@@ -38648,7 +39366,7 @@ function getNodeUniqueId() {
|
|
|
38648
39366
|
dataFlag.value++;
|
|
38649
39367
|
});
|
|
38650
39368
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(dataFlag, () => {
|
|
38651
|
-
|
|
39369
|
+
loadData(props.data || []);
|
|
38652
39370
|
});
|
|
38653
39371
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.checkNodeKey, val => {
|
|
38654
39372
|
reactData.selectRadioKey = val;
|
|
@@ -38663,13 +39381,54 @@ function getNodeUniqueId() {
|
|
|
38663
39381
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(checkboxFlag, () => {
|
|
38664
39382
|
updateCheckboxChecked(props.checkNodeKeys || []);
|
|
38665
39383
|
});
|
|
39384
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.filterValue, () => {
|
|
39385
|
+
triggerSearchEvent(new Event('filter'));
|
|
39386
|
+
});
|
|
39387
|
+
const hFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
39388
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.height, () => {
|
|
39389
|
+
hFlag.value++;
|
|
39390
|
+
});
|
|
39391
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.minHeight, () => {
|
|
39392
|
+
hFlag.value++;
|
|
39393
|
+
});
|
|
39394
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.maxHeight, () => {
|
|
39395
|
+
hFlag.value++;
|
|
39396
|
+
});
|
|
39397
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(hFlag, () => {
|
|
39398
|
+
recalculate();
|
|
39399
|
+
});
|
|
39400
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
39401
|
+
if (props.autoResize) {
|
|
39402
|
+
const el = refElem.value;
|
|
39403
|
+
const parentEl = getParentElem();
|
|
39404
|
+
const resizeObserver = globalResize.create(() => {
|
|
39405
|
+
if (props.autoResize) {
|
|
39406
|
+
recalculate();
|
|
39407
|
+
}
|
|
39408
|
+
});
|
|
39409
|
+
if (el) {
|
|
39410
|
+
resizeObserver.observe(el);
|
|
39411
|
+
}
|
|
39412
|
+
if (parentEl) {
|
|
39413
|
+
resizeObserver.observe(parentEl);
|
|
39414
|
+
}
|
|
39415
|
+
internalData.resizeObserver = resizeObserver;
|
|
39416
|
+
}
|
|
39417
|
+
globalEvents.on($xeTree, 'resize', handleGlobalResizeEvent);
|
|
39418
|
+
});
|
|
38666
39419
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
|
|
38667
|
-
|
|
39420
|
+
const {
|
|
39421
|
+
resizeObserver
|
|
39422
|
+
} = internalData;
|
|
39423
|
+
if (resizeObserver) {
|
|
39424
|
+
resizeObserver.disconnect();
|
|
39425
|
+
}
|
|
38668
39426
|
internalData.treeExpandedMaps = {};
|
|
38669
39427
|
internalData.indeterminateRowMaps = {};
|
|
38670
39428
|
internalData.nodeMaps = {};
|
|
39429
|
+
globalEvents.off($xeTree, 'resize');
|
|
38671
39430
|
});
|
|
38672
|
-
|
|
39431
|
+
loadData(props.data || []);
|
|
38673
39432
|
$xeTree.renderVN = renderVN;
|
|
38674
39433
|
return $xeTree;
|
|
38675
39434
|
},
|
|
@@ -38700,6 +39459,7 @@ const Tree = VxeTree;
|
|
|
38700
39459
|
|
|
38701
39460
|
|
|
38702
39461
|
|
|
39462
|
+
|
|
38703
39463
|
function tree_select_getOptUniqueId() {
|
|
38704
39464
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId('node_');
|
|
38705
39465
|
}
|
|
@@ -38721,6 +39481,8 @@ function tree_select_getOptUniqueId() {
|
|
|
38721
39481
|
type: Boolean,
|
|
38722
39482
|
default: null
|
|
38723
39483
|
},
|
|
39484
|
+
filterable: Boolean,
|
|
39485
|
+
filterConfig: Object,
|
|
38724
39486
|
multiple: Boolean,
|
|
38725
39487
|
className: [String, Function],
|
|
38726
39488
|
popupClassName: [String, Function],
|
|
@@ -38730,18 +39492,44 @@ function tree_select_getOptUniqueId() {
|
|
|
38730
39492
|
optionProps: Object,
|
|
38731
39493
|
size: {
|
|
38732
39494
|
type: String,
|
|
38733
|
-
default: () => getConfig().
|
|
39495
|
+
default: () => getConfig().treeSelect.size || getConfig().size
|
|
38734
39496
|
},
|
|
38735
39497
|
remote: Boolean,
|
|
38736
|
-
|
|
39498
|
+
remoteConfig: Function,
|
|
38737
39499
|
popupConfig: Object,
|
|
38738
39500
|
treeConfig: Object,
|
|
39501
|
+
virtualYConfig: Object,
|
|
39502
|
+
autoClose: {
|
|
39503
|
+
type: Boolean,
|
|
39504
|
+
default: () => getConfig().treeSelect.autoClose
|
|
39505
|
+
},
|
|
39506
|
+
showTotalButoon: {
|
|
39507
|
+
type: Boolean,
|
|
39508
|
+
default: () => getConfig().treeSelect.showTotalButoon
|
|
39509
|
+
},
|
|
39510
|
+
showCheckedButoon: {
|
|
39511
|
+
type: Boolean,
|
|
39512
|
+
default: () => getConfig().treeSelect.showCheckedButoon
|
|
39513
|
+
},
|
|
39514
|
+
showClearButton: {
|
|
39515
|
+
type: Boolean,
|
|
39516
|
+
default: () => getConfig().treeSelect.showClearButton
|
|
39517
|
+
},
|
|
39518
|
+
showExpandButton: {
|
|
39519
|
+
type: Boolean,
|
|
39520
|
+
default: () => getConfig().treeSelect.showExpandButton
|
|
39521
|
+
},
|
|
38739
39522
|
transfer: {
|
|
38740
39523
|
type: Boolean,
|
|
38741
39524
|
default: null
|
|
38742
|
-
}
|
|
39525
|
+
},
|
|
39526
|
+
/**
|
|
39527
|
+
* 已废弃,被 remote-config.queryMethod 替换
|
|
39528
|
+
* @deprecated
|
|
39529
|
+
*/
|
|
39530
|
+
remoteMethod: Function
|
|
38743
39531
|
},
|
|
38744
|
-
emits: ['update:modelValue', 'change', 'clear', 'blur', 'focus', 'click', 'node-click'],
|
|
39532
|
+
emits: ['update:modelValue', 'change', 'all-change', 'clear', 'blur', 'focus', 'click', 'node-click'],
|
|
38745
39533
|
setup(props, context) {
|
|
38746
39534
|
const {
|
|
38747
39535
|
emit,
|
|
@@ -38758,12 +39546,14 @@ function tree_select_getOptUniqueId() {
|
|
|
38758
39546
|
} = useSize(props);
|
|
38759
39547
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
38760
39548
|
const refInput = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
39549
|
+
const refInpSearch = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
38761
39550
|
const refTreeWrapper = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
38762
39551
|
const refOptionPanel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
39552
|
+
const refTree = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
38763
39553
|
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
38764
39554
|
initialized: false,
|
|
38765
|
-
|
|
38766
|
-
|
|
39555
|
+
searchValue: '',
|
|
39556
|
+
searchLoading: false,
|
|
38767
39557
|
panelIndex: 0,
|
|
38768
39558
|
panelStyle: {},
|
|
38769
39559
|
panelPlacement: null,
|
|
@@ -38773,7 +39563,9 @@ function tree_select_getOptUniqueId() {
|
|
|
38773
39563
|
isActivated: false
|
|
38774
39564
|
});
|
|
38775
39565
|
const internalData = {
|
|
38776
|
-
hpTimeout: undefined
|
|
39566
|
+
// hpTimeout: undefined,
|
|
39567
|
+
fullOptionList: [],
|
|
39568
|
+
fullNodeMaps: {}
|
|
38777
39569
|
};
|
|
38778
39570
|
const refMaps = {
|
|
38779
39571
|
refElem
|
|
@@ -38874,15 +39666,26 @@ function tree_select_getOptUniqueId() {
|
|
|
38874
39666
|
const propsOpts = computePropsOpts.value;
|
|
38875
39667
|
return propsOpts.hasChild || 'hasChild';
|
|
38876
39668
|
});
|
|
39669
|
+
const computeVirtualYOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
39670
|
+
return Object.assign({}, getConfig().treeSelect.virtualYConfig, props.virtualYConfig);
|
|
39671
|
+
});
|
|
39672
|
+
const computeRemoteOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
39673
|
+
return Object.assign({}, getConfig().treeSelect.remoteConfig, props.remoteConfig);
|
|
39674
|
+
});
|
|
39675
|
+
const computeFilterOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
39676
|
+
const treeOpts = computeTreeOpts.value;
|
|
39677
|
+
return Object.assign({}, treeOpts.filterConfig, props.filterConfig);
|
|
39678
|
+
});
|
|
38877
39679
|
const computeSelectLabel = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
38878
39680
|
const {
|
|
38879
39681
|
modelValue
|
|
38880
39682
|
} = props;
|
|
38881
39683
|
const {
|
|
38882
39684
|
fullNodeMaps
|
|
38883
|
-
} =
|
|
39685
|
+
} = internalData;
|
|
38884
39686
|
const labelField = computeLabelField.value;
|
|
38885
|
-
|
|
39687
|
+
const selectVals = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(modelValue) ? [] : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue : [modelValue];
|
|
39688
|
+
return selectVals.map(val => {
|
|
38886
39689
|
const cacheItem = fullNodeMaps[val];
|
|
38887
39690
|
return cacheItem ? cacheItem.item[labelField] : val;
|
|
38888
39691
|
}).join(', ');
|
|
@@ -38933,12 +39736,16 @@ function tree_select_getOptUniqueId() {
|
|
|
38933
39736
|
const {
|
|
38934
39737
|
options
|
|
38935
39738
|
} = props;
|
|
39739
|
+
const treeOpts = computeTreeOpts.value;
|
|
38936
39740
|
const nodeKeyField = computeNodeKeyField.value;
|
|
38937
39741
|
const childrenField = computeChildrenField.value;
|
|
38938
39742
|
const valueField = computeValueField.value;
|
|
39743
|
+
const {
|
|
39744
|
+
transform
|
|
39745
|
+
} = treeOpts;
|
|
38939
39746
|
const nodeMaps = {};
|
|
38940
39747
|
const keyMaps = {};
|
|
38941
|
-
|
|
39748
|
+
const handleOptNode = (item, index, items, path, parent, nodes) => {
|
|
38942
39749
|
let nodeid = getNodeid(item);
|
|
38943
39750
|
if (!nodeid) {
|
|
38944
39751
|
nodeid = tree_select_getOptUniqueId();
|
|
@@ -38958,11 +39765,20 @@ function tree_select_getOptUniqueId() {
|
|
|
38958
39765
|
parent,
|
|
38959
39766
|
nodes
|
|
38960
39767
|
};
|
|
38961
|
-
}
|
|
38962
|
-
|
|
38963
|
-
|
|
38964
|
-
|
|
38965
|
-
|
|
39768
|
+
};
|
|
39769
|
+
if (options) {
|
|
39770
|
+
if (transform) {
|
|
39771
|
+
options.forEach((item, index, items) => {
|
|
39772
|
+
handleOptNode(item, index, items, [], null, []);
|
|
39773
|
+
});
|
|
39774
|
+
} else {
|
|
39775
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(options, handleOptNode, {
|
|
39776
|
+
children: childrenField
|
|
39777
|
+
});
|
|
39778
|
+
}
|
|
39779
|
+
}
|
|
39780
|
+
internalData.fullOptionList = options || [];
|
|
39781
|
+
internalData.fullNodeMaps = nodeMaps;
|
|
38966
39782
|
};
|
|
38967
39783
|
const updateZindex = () => {
|
|
38968
39784
|
if (reactData.panelIndex < getLastZIndex()) {
|
|
@@ -38995,9 +39811,15 @@ function tree_select_getOptUniqueId() {
|
|
|
38995
39811
|
};
|
|
38996
39812
|
const showOptionPanel = () => {
|
|
38997
39813
|
const {
|
|
38998
|
-
loading
|
|
39814
|
+
loading,
|
|
39815
|
+
remote,
|
|
39816
|
+
filterable
|
|
38999
39817
|
} = props;
|
|
39818
|
+
const {
|
|
39819
|
+
fullOptionList
|
|
39820
|
+
} = internalData;
|
|
39000
39821
|
const isDisabled = computeIsDisabled.value;
|
|
39822
|
+
const remoteOpts = computeRemoteOpts.value;
|
|
39001
39823
|
if (!loading && !isDisabled) {
|
|
39002
39824
|
clearTimeout(internalData.hpTimeout);
|
|
39003
39825
|
if (!reactData.initialized) {
|
|
@@ -39005,8 +39827,14 @@ function tree_select_getOptUniqueId() {
|
|
|
39005
39827
|
}
|
|
39006
39828
|
reactData.isActivated = true;
|
|
39007
39829
|
reactData.isAniVisible = true;
|
|
39830
|
+
if (filterable) {
|
|
39831
|
+
if (remote && remoteOpts.enabled && remoteOpts.autoLoad && !fullOptionList.length) {
|
|
39832
|
+
handleSearchEvent();
|
|
39833
|
+
}
|
|
39834
|
+
}
|
|
39008
39835
|
setTimeout(() => {
|
|
39009
39836
|
reactData.visiblePanel = true;
|
|
39837
|
+
handleFocusSearch();
|
|
39010
39838
|
}, 10);
|
|
39011
39839
|
updateZindex();
|
|
39012
39840
|
updatePlacement();
|
|
@@ -39021,7 +39849,7 @@ function tree_select_getOptUniqueId() {
|
|
|
39021
39849
|
const changeEvent = (evnt, selectValue) => {
|
|
39022
39850
|
const {
|
|
39023
39851
|
fullNodeMaps
|
|
39024
|
-
} =
|
|
39852
|
+
} = internalData;
|
|
39025
39853
|
emitModel(selectValue);
|
|
39026
39854
|
if (selectValue !== props.modelValue) {
|
|
39027
39855
|
const cacheItem = fullNodeMaps[selectValue];
|
|
@@ -39045,6 +39873,65 @@ function tree_select_getOptUniqueId() {
|
|
|
39045
39873
|
clearValueEvent(evnt, null);
|
|
39046
39874
|
hideOptionPanel();
|
|
39047
39875
|
};
|
|
39876
|
+
const allCheckedPanelEvent = params => {
|
|
39877
|
+
const {
|
|
39878
|
+
$event
|
|
39879
|
+
} = params;
|
|
39880
|
+
const {
|
|
39881
|
+
multiple,
|
|
39882
|
+
autoClose
|
|
39883
|
+
} = props;
|
|
39884
|
+
const $tree = refTree.value;
|
|
39885
|
+
if (multiple) {
|
|
39886
|
+
if ($tree) {
|
|
39887
|
+
$tree.setAllCheckboxNode(true).then(({
|
|
39888
|
+
checkNodeKeys
|
|
39889
|
+
}) => {
|
|
39890
|
+
changeEvent($event, checkNodeKeys);
|
|
39891
|
+
dispatchEvent('all-change', {
|
|
39892
|
+
value: checkNodeKeys
|
|
39893
|
+
}, $event);
|
|
39894
|
+
if (autoClose) {
|
|
39895
|
+
hideOptionPanel();
|
|
39896
|
+
}
|
|
39897
|
+
});
|
|
39898
|
+
}
|
|
39899
|
+
}
|
|
39900
|
+
};
|
|
39901
|
+
const clearCheckedPanelEvent = params => {
|
|
39902
|
+
const {
|
|
39903
|
+
$event
|
|
39904
|
+
} = params;
|
|
39905
|
+
const {
|
|
39906
|
+
multiple,
|
|
39907
|
+
autoClose
|
|
39908
|
+
} = props;
|
|
39909
|
+
const $tree = refTree.value;
|
|
39910
|
+
if ($tree) {
|
|
39911
|
+
const value = multiple ? [] : null;
|
|
39912
|
+
$tree.clearCheckboxNode().then(() => {
|
|
39913
|
+
if (autoClose) {
|
|
39914
|
+
hideOptionPanel();
|
|
39915
|
+
}
|
|
39916
|
+
});
|
|
39917
|
+
changeEvent($event, value);
|
|
39918
|
+
dispatchEvent('clear', {
|
|
39919
|
+
value
|
|
39920
|
+
}, $event);
|
|
39921
|
+
}
|
|
39922
|
+
};
|
|
39923
|
+
const allExpandPanelEvent = () => {
|
|
39924
|
+
const $tree = refTree.value;
|
|
39925
|
+
if ($tree) {
|
|
39926
|
+
$tree.setAllExpandNode(true);
|
|
39927
|
+
}
|
|
39928
|
+
};
|
|
39929
|
+
const clearExpandPanelEvent = () => {
|
|
39930
|
+
const $tree = refTree.value;
|
|
39931
|
+
if ($tree) {
|
|
39932
|
+
$tree.clearAllExpandNode();
|
|
39933
|
+
}
|
|
39934
|
+
};
|
|
39048
39935
|
const handleGlobalMousewheelEvent = evnt => {
|
|
39049
39936
|
const {
|
|
39050
39937
|
visiblePanel
|
|
@@ -39086,6 +39973,16 @@ function tree_select_getOptUniqueId() {
|
|
|
39086
39973
|
updatePlacement();
|
|
39087
39974
|
}
|
|
39088
39975
|
};
|
|
39976
|
+
const handleFocusSearch = () => {
|
|
39977
|
+
if (props.filterable) {
|
|
39978
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
39979
|
+
const inpSearch = refInpSearch.value;
|
|
39980
|
+
if (inpSearch) {
|
|
39981
|
+
inpSearch.focus();
|
|
39982
|
+
}
|
|
39983
|
+
});
|
|
39984
|
+
}
|
|
39985
|
+
};
|
|
39089
39986
|
const focusEvent = evnt => {
|
|
39090
39987
|
const isDisabled = computeIsDisabled.value;
|
|
39091
39988
|
if (!isDisabled) {
|
|
@@ -39107,6 +40004,31 @@ function tree_select_getOptUniqueId() {
|
|
|
39107
40004
|
reactData.isActivated = false;
|
|
39108
40005
|
dispatchEvent('blur', {}, evnt);
|
|
39109
40006
|
};
|
|
40007
|
+
const modelSearchEvent = value => {
|
|
40008
|
+
reactData.searchValue = value;
|
|
40009
|
+
};
|
|
40010
|
+
const handleSearchEvent = () => {
|
|
40011
|
+
const {
|
|
40012
|
+
modelValue,
|
|
40013
|
+
remote,
|
|
40014
|
+
remoteMethod
|
|
40015
|
+
} = props;
|
|
40016
|
+
const {
|
|
40017
|
+
searchValue
|
|
40018
|
+
} = reactData;
|
|
40019
|
+
const remoteOpts = computeRemoteOpts.value;
|
|
40020
|
+
const queryMethod = remoteOpts.queryMethod || remoteMethod;
|
|
40021
|
+
if (remote && queryMethod && remoteOpts.enabled) {
|
|
40022
|
+
reactData.searchLoading = true;
|
|
40023
|
+
Promise.resolve(queryMethod({
|
|
40024
|
+
$treeSelect: $xeTreeSelect,
|
|
40025
|
+
searchValue,
|
|
40026
|
+
value: modelValue
|
|
40027
|
+
})).then(() => (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)()).catch(() => (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)()).finally(() => {
|
|
40028
|
+
reactData.searchLoading = false;
|
|
40029
|
+
});
|
|
40030
|
+
}
|
|
40031
|
+
};
|
|
39110
40032
|
const togglePanelEvent = params => {
|
|
39111
40033
|
const {
|
|
39112
40034
|
$event
|
|
@@ -39154,13 +40076,19 @@ function tree_select_getOptUniqueId() {
|
|
|
39154
40076
|
modelValue,
|
|
39155
40077
|
multiple,
|
|
39156
40078
|
options,
|
|
39157
|
-
loading
|
|
40079
|
+
loading,
|
|
40080
|
+
filterable,
|
|
40081
|
+
showTotalButoon,
|
|
40082
|
+
showCheckedButoon,
|
|
40083
|
+
showClearButton,
|
|
40084
|
+
showExpandButton
|
|
39158
40085
|
} = props;
|
|
39159
40086
|
const {
|
|
39160
40087
|
initialized,
|
|
39161
40088
|
isActivated,
|
|
39162
40089
|
isAniVisible,
|
|
39163
|
-
visiblePanel
|
|
40090
|
+
visiblePanel,
|
|
40091
|
+
searchValue
|
|
39164
40092
|
} = reactData;
|
|
39165
40093
|
const vSize = computeSize.value;
|
|
39166
40094
|
const isDisabled = computeIsDisabled.value;
|
|
@@ -39183,6 +40111,8 @@ function tree_select_getOptUniqueId() {
|
|
|
39183
40111
|
const childrenField = computeChildrenField.value;
|
|
39184
40112
|
const parentField = computeParentField.value;
|
|
39185
40113
|
const hasChildField = computeHasChildField.value;
|
|
40114
|
+
const virtualYOpts = computeVirtualYOpts.value;
|
|
40115
|
+
const filterOpts = computeFilterOpts.value;
|
|
39186
40116
|
if (formReadonly) {
|
|
39187
40117
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39188
40118
|
ref: refElem,
|
|
@@ -39191,12 +40121,14 @@ function tree_select_getOptUniqueId() {
|
|
|
39191
40121
|
class: 'vxe-tree-select-label'
|
|
39192
40122
|
}, selectLabel)]);
|
|
39193
40123
|
}
|
|
40124
|
+
const selectVals = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(modelValue) ? [] : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue : [modelValue];
|
|
39194
40125
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39195
40126
|
ref: refElem,
|
|
39196
40127
|
class: ['vxe-tree-select', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className({
|
|
39197
40128
|
$treeSelect: $xeTreeSelect
|
|
39198
40129
|
}) : className : '', {
|
|
39199
40130
|
[`size--${vSize}`]: vSize,
|
|
40131
|
+
'is--filterable': filterable,
|
|
39200
40132
|
'is--visible': visiblePanel,
|
|
39201
40133
|
'is--disabled': isDisabled,
|
|
39202
40134
|
'is--loading': loading,
|
|
@@ -39212,6 +40144,7 @@ function tree_select_getOptUniqueId() {
|
|
|
39212
40144
|
prefixIcon: props.prefixIcon,
|
|
39213
40145
|
suffixIcon: loading ? getIcon().TREE_SELECT_LOADED : visiblePanel ? getIcon().TREE_SELECT_OPEN : getIcon().TREE_SELECT_CLOSE,
|
|
39214
40146
|
modelValue: loading ? '' : selectLabel,
|
|
40147
|
+
title: selectLabel,
|
|
39215
40148
|
onClear: clearEvent,
|
|
39216
40149
|
onClick: clickEvent,
|
|
39217
40150
|
onFocus: focusEvent,
|
|
@@ -39236,16 +40169,55 @@ function tree_select_getOptUniqueId() {
|
|
|
39236
40169
|
style: reactData.panelStyle
|
|
39237
40170
|
}, initialized ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39238
40171
|
class: 'vxe-tree-select--panel-wrapper'
|
|
39239
|
-
}, [
|
|
40172
|
+
}, [filterable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
40173
|
+
class: 'vxe-tree-select--panel-search'
|
|
40174
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(input, {
|
|
40175
|
+
ref: refInpSearch,
|
|
40176
|
+
class: 'vxe-tree-select-search--input',
|
|
40177
|
+
modelValue: searchValue,
|
|
40178
|
+
clearable: true,
|
|
40179
|
+
disabled: false,
|
|
40180
|
+
readonly: false,
|
|
40181
|
+
placeholder: getI18n('vxe.treeSelect.search'),
|
|
40182
|
+
prefixIcon: getIcon().INPUT_SEARCH,
|
|
40183
|
+
'onUpdate:modelValue': modelSearchEvent
|
|
40184
|
+
})]) : renderEmptyElement($xeTreeSelect), showTotalButoon || showCheckedButoon && multiple || showClearButton || showExpandButton || headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39240
40185
|
class: 'vxe-tree-select--panel-header'
|
|
39241
|
-
}, headerSlot({})
|
|
40186
|
+
}, headerSlot ? headerSlot({}) : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
40187
|
+
class: 'vxe-tree-select--header-button'
|
|
40188
|
+
}, [showTotalButoon ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
40189
|
+
class: 'vxe-tree-select--header-total'
|
|
40190
|
+
}, getI18n('vxe.treeSelect.total', [selectVals.length])) : renderEmptyElement($xeTreeSelect), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
40191
|
+
class: 'vxe-tree-select--header-btns'
|
|
40192
|
+
}, [showCheckedButoon && multiple ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
40193
|
+
content: getI18n('vxe.treeSelect.allChecked'),
|
|
40194
|
+
mode: 'text',
|
|
40195
|
+
onClick: allCheckedPanelEvent
|
|
40196
|
+
}) : renderEmptyElement($xeTreeSelect), showClearButton ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
40197
|
+
content: getI18n('vxe.treeSelect.clearChecked'),
|
|
40198
|
+
mode: 'text',
|
|
40199
|
+
onClick: clearCheckedPanelEvent
|
|
40200
|
+
}) : renderEmptyElement($xeTreeSelect), showExpandButton ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
40201
|
+
content: getI18n('vxe.treeSelect.allExpand'),
|
|
40202
|
+
mode: 'text',
|
|
40203
|
+
onClick: allExpandPanelEvent
|
|
40204
|
+
}) : renderEmptyElement($xeTreeSelect), showExpandButton ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(src_button, {
|
|
40205
|
+
content: getI18n('vxe.treeSelect.clearExpand'),
|
|
40206
|
+
mode: 'text',
|
|
40207
|
+
onClick: clearExpandPanelEvent
|
|
40208
|
+
}) : renderEmptyElement($xeTreeSelect)])])]) : renderEmptyElement($xeTreeSelect), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39242
40209
|
class: 'vxe-tree-select--panel-body'
|
|
39243
40210
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
39244
40211
|
ref: refTreeWrapper,
|
|
39245
40212
|
class: 'vxe-tree-select-tree--wrapper',
|
|
39246
40213
|
style: popupWrapperStyle
|
|
39247
40214
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(tree, {
|
|
40215
|
+
ref: refTree,
|
|
39248
40216
|
class: 'vxe-tree-select--tree',
|
|
40217
|
+
height: popupOpts.height ? '100%' : treeOpts.height,
|
|
40218
|
+
minHeight: treeOpts.minHeight,
|
|
40219
|
+
maxHeight: popupOpts.height ? '' : treeOpts.maxHeight,
|
|
40220
|
+
autoResize: true,
|
|
39249
40221
|
data: options,
|
|
39250
40222
|
indent: treeOpts.indent,
|
|
39251
40223
|
showRadio: !multiple,
|
|
@@ -39273,6 +40245,9 @@ function tree_select_getOptUniqueId() {
|
|
|
39273
40245
|
iconOpen: treeOpts.iconOpen,
|
|
39274
40246
|
iconLoaded: treeOpts.iconLoaded,
|
|
39275
40247
|
iconClose: treeOpts.iconClose,
|
|
40248
|
+
filterValue: searchValue,
|
|
40249
|
+
filterConfig: filterOpts,
|
|
40250
|
+
virtualYConfig: virtualYOpts,
|
|
39276
40251
|
onNodeClick: nodeClickEvent,
|
|
39277
40252
|
onRadioChange: radioChangeEvent,
|
|
39278
40253
|
onCheckboxChange: checkboxChangeEvent,
|