@xtctwins/tctwins-bimx-engine 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -196
- package/dist/{alert-ChDNxVgQ.mjs → Alert-5pEYzrMO.mjs} +8 -8
- package/dist/AnnotationTool-B3tDIyWy.mjs +239 -0
- package/dist/BIMX_Viewer_Lib.es.js +3 -3
- package/dist/BIMX_Viewer_Lib.umd.js +222 -175
- package/dist/CommentTool--UgPVIZZ.mjs +1541 -0
- package/dist/{HiddenTool-CoPawMRd.mjs → HiddenTool-rORoKTeD.mjs} +16 -16
- package/dist/{InspectorTool-BIvnydPf.mjs → InspectorTool-l4bDxTia.mjs} +66 -66
- package/dist/{MeasureTool-BUi0QI_R.mjs → MeasureTool-d-EV6m2R.mjs} +126 -102
- package/dist/{MouseTool-CdVwRiX1.mjs → MouseTool-DKMcdeRD.mjs} +35 -32
- package/dist/{NavigateTool-DoP9z3yP.mjs → NavigateTool-BNvZ8Oat.mjs} +13 -13
- package/dist/{panel.vue_vue_type_style_index_0_lang-BaSZShh_.mjs → Panel.vue_vue_type_style_index_0_lang-C4tqfy-B.mjs} +2 -2
- package/dist/{RoamTool-POFy076i.mjs → RoamTool-DJu93SVl.mjs} +14 -14
- package/dist/ScreenShotTool-D2h0Qjtv.mjs +430 -0
- package/dist/SectionTool-DHw2Zfzv.mjs +343 -0
- package/dist/SettingTool-D13GBT87.mjs +747 -0
- package/dist/StructureTree-DHaOzAP9.mjs +1662 -0
- package/dist/{tallPanel-DKlcFjrl.mjs → TallPanel-DtXOSzmF.mjs} +14 -14
- package/dist/bimTools-D3TraX9d.mjs +75 -0
- package/dist/el-slider-CHaMBaUG.mjs +1040 -0
- package/dist/{index-Dsq1epCY.mjs → index-BDupeKSG.mjs} +55597 -53543
- package/dist/index.html +17 -17
- package/dist/style.css +1 -1
- package/package.json +4 -3
- package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +38 -10
- package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +37 -9
- package/types/components/BCFComponents/BCFDisplayList.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFFilter.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFTool.vue.d.ts +4 -7
- package/types/components/BCFComponents/addObjectOrAnno.vue.d.ts +5 -7
- package/types/components/BCFComponents/checkObjectPanel.vue.d.ts +5 -6
- package/types/components/BCFComponents/commentInput.vue.d.ts +36 -10
- package/types/components/BCFComponents/commentsView.vue.d.ts +36 -7
- package/types/components/BCFComponents/dialogPanel.vue.d.ts +5 -8
- package/types/components/BCFComponents/imageView.vue.d.ts +5 -7
- package/types/components/BCFComponents/imageZoomIn.vue.d.ts +5 -6
- package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/AppToolbar.vue.d.ts +18 -1
- package/types/components/BimViewerComponents/ClickEvent.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/CommentTool.vue.d.ts +32 -1
- package/types/components/BimViewerComponents/HiddenTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/InspectorTool.vue.d.ts +2 -0
- package/types/components/BimViewerComponents/MeasureTool.vue.d.ts +2 -0
- package/types/components/BimViewerComponents/MobileCommentsTool/{add.vue.d.ts → MobileCommentAdd.vue.d.ts} +6 -8
- package/types/components/BimViewerComponents/MobileCommentsTool/detail.vue.d.ts +4 -5
- package/types/components/BimViewerComponents/MobileCommentsTool/draw.vue.d.ts +2 -2
- package/types/components/BimViewerComponents/MobileCommentsTool/filter.vue.d.ts +478 -1
- package/types/components/BimViewerComponents/MobileCommentsTool/list.vue.d.ts +499 -7
- package/types/components/BimViewerComponents/MobileCommentsTool/zoomIn.vue.d.ts +5 -6
- package/types/components/BimViewerComponents/MouseTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/NavigateTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/PCCommentTool/pcdraw.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/RoamTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/SectionTool.vue.d.ts +4 -0
- package/types/components/BimViewerComponents/SettingTool.vue.d.ts +4 -6
- package/types/components/BimViewerComponents/StructureTree.vue.d.ts +4026 -1
- package/types/components/BimViewerComponents/Toolbar.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/mobileToolbar.vue.d.ts +18 -1
- package/types/components/BimxViewerComp.vue.d.ts +7 -14
- package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +37 -10
- package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +37 -9
- package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +499 -7
- package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +478 -1
- package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +5 -8
- package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +38 -12
- package/types/components/MobileBCFComponents/MobileCommentsView.vue.d.ts +7 -9
- package/types/components/MobileBCFComponents/selectPanel.vue.d.ts +5 -7
- package/types/components/bcf/AddObjectOrAnno.vue.d.ts +16 -0
- package/types/components/bcf/BCFAddPanel.vue.d.ts +55 -0
- package/types/components/bcf/BCFDetailPanel.vue.d.ts +59 -0
- package/types/components/bcf/BCFDisplayList.vue.d.ts +18 -0
- package/types/components/bcf/BCFFilter.vue.d.ts +14 -0
- package/types/components/bcf/BCFTool.vue.d.ts +15 -0
- package/types/components/bcf/CheckObjectPanel.vue.d.ts +11 -0
- package/types/components/bcf/CommentInput.vue.d.ts +51 -0
- package/types/components/bcf/CommentsView.vue.d.ts +48 -0
- package/types/components/bcf/DialogPanel.vue.d.ts +15 -0
- package/types/components/bcf/ImageView.vue.d.ts +17 -0
- package/types/components/bcf/ImageZoomIn.vue.d.ts +9 -0
- package/types/components/bcf/MobileBCFAdd.vue.d.ts +56 -0
- package/types/components/bcf/MobileBCFDetail.vue.d.ts +55 -0
- package/types/components/bcf/MobileBCFDisplayList.vue.d.ts +498 -0
- package/types/components/bcf/MobileBCFFilter.vue.d.ts +475 -0
- package/types/components/bcf/MobileBCFTool.vue.d.ts +17 -0
- package/types/components/bcf/MobileCommentInput.vue.d.ts +54 -0
- package/types/components/bcf/MobileCommentsView.vue.d.ts +17 -0
- package/types/components/bcf/SelectPanel.vue.d.ts +12 -0
- package/types/components/bimxViewer.vue.d.ts +7 -14
- package/types/components/comment/mobile/MobileCommentAdd.vue.d.ts +14 -0
- package/types/components/comment/mobile/MobileDetail.vue.d.ts +11 -0
- package/types/components/comment/mobile/MobileDraw.vue.d.ts +17 -0
- package/types/components/comment/mobile/MobileFilter.vue.d.ts +475 -0
- package/types/components/comment/mobile/MobileList.vue.d.ts +497 -0
- package/types/components/comment/mobile/MobileZoomIn.vue.d.ts +9 -0
- package/types/components/comment/pc/PcDraw.vue.d.ts +14 -0
- package/types/components/shared/Alert.vue.d.ts +32 -0
- package/types/components/shared/CloseButton.vue.d.ts +50 -0
- package/types/components/shared/CloseButtonDark.vue.d.ts +32 -0
- package/types/components/shared/EmptyPage.vue.d.ts +6 -0
- package/types/components/shared/Loading.vue.d.ts +2 -0
- package/types/components/shared/Panel.vue.d.ts +47 -0
- package/types/components/shared/Prompt.vue.d.ts +8 -0
- package/types/components/shared/RectangleButton.vue.d.ts +106 -0
- package/types/components/shared/TallPanel.vue.d.ts +69 -0
- package/types/components/shared/TallPanelNoPos.vue.d.ts +82 -0
- package/types/components/tools/AnnotationTool.vue.d.ts +14 -0
- package/types/components/tools/AppToolbar.vue.d.ts +27 -0
- package/types/components/tools/ClickEvent.vue.d.ts +6 -0
- package/types/components/tools/CommentTool.vue.d.ts +45 -0
- package/types/components/tools/HiddenTool.vue.d.ts +12 -0
- package/types/components/tools/InspectorTool.vue.d.ts +14 -0
- package/types/components/tools/MeasureTool.vue.d.ts +14 -0
- package/types/components/tools/MouseTool.vue.d.ts +6 -0
- package/types/components/tools/NavigateTool.vue.d.ts +10 -0
- package/types/components/tools/RoamTool.vue.d.ts +12 -0
- package/types/components/tools/ScreenShotTool.vue.d.ts +10 -0
- package/types/components/tools/SectionTool.vue.d.ts +14 -0
- package/types/components/tools/SettingTool.vue.d.ts +13 -0
- package/types/components/tools/StructureTree.vue.d.ts +11645 -0
- package/types/components/tools/Toolbar.vue.d.ts +10 -0
- package/types/components/utilsComponents/alert.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton_dark.vue.d.ts +1 -1
- package/types/components/utilsComponents/emptyPage.vue.d.ts +1 -1
- package/types/components/utilsComponents/loading.vue.d.ts +1 -1
- package/types/components/utilsComponents/panel.vue.d.ts +8 -2
- package/types/components/utilsComponents/prompt.vue.d.ts +1 -1
- package/types/components/utilsComponents/rectangleButton.vue.d.ts +3 -1
- package/types/components/utilsComponents/tallPanel.vue.d.ts +13 -3
- package/types/components/utilsComponents/tallPanel_noPos.vue.d.ts +13 -3
- package/types/composables/useBimViewerEvent.d.ts +44 -0
- package/types/composables/useEmitHandler.d.ts +2 -0
- package/types/composables/useToolActive.d.ts +1 -0
- package/types/composables/useToolReady.d.ts +1 -0
- package/types/i18n/index.d.ts +5 -1
- package/types/i18n/locales/en-US.d.ts +1 -0
- package/types/i18n/locales/zh-CN.d.ts +1 -0
- package/types/pages/BimxViewerEntry.vue.d.ts +5 -57
- package/types/pages/viewerEntry.vue.d.ts +7 -57
- package/types/store/bcfReflect.d.ts +13 -81
- package/types/store/const/app.d.ts +66 -0
- package/types/store/const/bimTools.d.ts +81 -0
- package/types/store/const/project.d.ts +48 -0
- package/types/store/const/theme.d.ts +16 -0
- package/types/store/const/toolbar.d.ts +26 -0
- package/types/store/const.d.ts +11 -228
- package/types/store/initConfigs.d.ts +1 -1
- package/types/store/toolbars.d.ts +68 -46
- package/types/store/userInfoStore.d.ts +1 -1
- package/types/stores/viewerStore.d.ts +112 -0
- package/types/types/bcf.d.ts +83 -0
- package/types/types/events.d.ts +88 -0
- package/types/utils/OSSHelper.d.ts +27 -0
- package/types/utils/cacheInfo.d.ts +26 -3
- package/types/utils/dbscan.d.ts +1 -0
- package/types/utils/eventBus.d.ts +1 -83
- package/types/viewerManager/viewerManager.d.ts +53 -3
- package/dist/AnnotationTool-CGRte6Cc.mjs +0 -167
- package/dist/CommentTool-CT3wFozB.mjs +0 -1529
- package/dist/ScreenShotTool-CcUyU0g7.mjs +0 -357
- package/dist/SectionTool-DGjjH3JO.mjs +0 -331
- package/dist/SettingTool-CjXfbX5r.mjs +0 -657
- package/dist/StructureTree-DdRX-y-V.mjs +0 -1583
- package/dist/const-DOnRsYpZ.mjs +0 -389
- package/dist/el-input-number-CK5d8pzH.mjs +0 -818
- package/types/components/BCFComponents/BCFCommentNew.vue.d.ts +0 -22
- package/types/components/BimViewerComponents/emptyPage.vue.d.ts +0 -8
- package/types/tests/cmt.d.ts +0 -1
|
@@ -0,0 +1,1662 @@
|
|
|
1
|
+
import { u as ae, w as Be, b as ze, c as et, a as tt, i as se, d as xe, e as nt, f as ye, h as De, g as ve, j as we, k as me, l as Fe, N as ot, m as st, n as Pe, r as Ee, o as at, E as rt, p as dt, q as it, _ as Re, s as lt, t as ct, v as Z, x as ut, y as ht, z as ft, A as pt, B as yt, C as ne, D as ge, T as je, F as vt, G as gt, H as kt, I as Nt } from "./index-BDupeKSG.mjs";
|
|
2
|
+
import { _ as Ct } from "./TallPanel-DtXOSzmF.mjs";
|
|
3
|
+
import { defineComponent as de, openBlock as I, createBlock as Y, Transition as mt, mergeProps as bt, unref as T, toHandlers as _t, withCtx as L, renderSlot as be, useAttrs as Et, ref as w, computed as Ke, onMounted as Ae, onUpdated as qe, resolveDynamicComponent as Ve, normalizeStyle as Ue, normalizeClass as F, nextTick as re, reactive as xt, inject as fe, onBeforeUnmount as Ye, provide as pe, h as $e, getCurrentInstance as We, watch as q, resolveComponent as oe, withDirectives as G, createElementBlock as $, withModifiers as ee, createElementVNode as D, createCommentVNode as le, createVNode as A, Fragment as ue, renderList as he, vShow as Q, toDisplayString as R } from "vue";
|
|
4
|
+
import { Loading as Dt, CaretRight as wt } from "@element-plus/icons-vue";
|
|
5
|
+
import { _ as Kt } from "./Panel.vue_vue_type_style_index_0_lang-C4tqfy-B.mjs";
|
|
6
|
+
import { S as ke } from "./bimTools-D3TraX9d.mjs";
|
|
7
|
+
var Tt = /* @__PURE__ */ de({
|
|
8
|
+
name: "ElCollapseTransition",
|
|
9
|
+
__name: "collapse-transition",
|
|
10
|
+
setup(e) {
|
|
11
|
+
const t = ae("collapse-transition"), o = (n) => {
|
|
12
|
+
n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom;
|
|
13
|
+
}, s = {
|
|
14
|
+
beforeEnter(n) {
|
|
15
|
+
n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.style.height && (n.dataset.elExistsHeight = n.style.height), n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0;
|
|
16
|
+
},
|
|
17
|
+
enter(n) {
|
|
18
|
+
requestAnimationFrame(() => {
|
|
19
|
+
n.dataset.oldOverflow = n.style.overflow, n.dataset.elExistsHeight ? n.style.maxHeight = n.dataset.elExistsHeight : n.scrollHeight !== 0 ? n.style.maxHeight = `${n.scrollHeight}px` : n.style.maxHeight = 0, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom, n.style.overflow = "hidden";
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
afterEnter(n) {
|
|
23
|
+
n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow;
|
|
24
|
+
},
|
|
25
|
+
enterCancelled(n) {
|
|
26
|
+
o(n);
|
|
27
|
+
},
|
|
28
|
+
beforeLeave(n) {
|
|
29
|
+
n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.dataset.oldOverflow = n.style.overflow, n.style.maxHeight = `${n.scrollHeight}px`, n.style.overflow = "hidden";
|
|
30
|
+
},
|
|
31
|
+
leave(n) {
|
|
32
|
+
n.scrollHeight !== 0 && (n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0);
|
|
33
|
+
},
|
|
34
|
+
afterLeave(n) {
|
|
35
|
+
o(n);
|
|
36
|
+
},
|
|
37
|
+
leaveCancelled(n) {
|
|
38
|
+
o(n);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return (n, a) => (I(), Y(mt, bt({ name: T(t).b() }, _t(s)), {
|
|
42
|
+
default: L(() => [be(n.$slots, "default")]),
|
|
43
|
+
_: 3
|
|
44
|
+
}, 16, ["name"]));
|
|
45
|
+
}
|
|
46
|
+
}), It = Tt;
|
|
47
|
+
const St = Be(It), Bt = ze({
|
|
48
|
+
/**
|
|
49
|
+
* @description text type
|
|
50
|
+
*/
|
|
51
|
+
type: {
|
|
52
|
+
type: String,
|
|
53
|
+
values: [
|
|
54
|
+
"primary",
|
|
55
|
+
"success",
|
|
56
|
+
"info",
|
|
57
|
+
"warning",
|
|
58
|
+
"danger",
|
|
59
|
+
""
|
|
60
|
+
],
|
|
61
|
+
default: ""
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* @description text size
|
|
65
|
+
*/
|
|
66
|
+
size: {
|
|
67
|
+
type: String,
|
|
68
|
+
values: et,
|
|
69
|
+
default: ""
|
|
70
|
+
},
|
|
71
|
+
/**
|
|
72
|
+
* @description render ellipsis
|
|
73
|
+
*/
|
|
74
|
+
truncated: Boolean,
|
|
75
|
+
/**
|
|
76
|
+
* @description maximum lines
|
|
77
|
+
*/
|
|
78
|
+
lineClamp: { type: [String, Number] },
|
|
79
|
+
/**
|
|
80
|
+
* @description custom element tag
|
|
81
|
+
*/
|
|
82
|
+
tag: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: "span"
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
var At = /* @__PURE__ */ de({
|
|
88
|
+
name: "ElText",
|
|
89
|
+
__name: "text",
|
|
90
|
+
props: Bt,
|
|
91
|
+
setup(e) {
|
|
92
|
+
const t = e, o = Et(), s = w(), n = tt(), a = ae("text"), d = Ke(() => [
|
|
93
|
+
a.b(),
|
|
94
|
+
a.m(t.type),
|
|
95
|
+
a.m(n.value),
|
|
96
|
+
a.is("truncated", t.truncated),
|
|
97
|
+
a.is("line-clamp", !se(t.lineClamp))
|
|
98
|
+
]), l = async () => {
|
|
99
|
+
var u, r, c, y, E, x, N;
|
|
100
|
+
if (await re(), o.title) return;
|
|
101
|
+
let p = !1;
|
|
102
|
+
const h = ((u = s.value) == null ? void 0 : u.textContent) || "";
|
|
103
|
+
if (t.truncated) {
|
|
104
|
+
const k = (r = s.value) == null ? void 0 : r.offsetWidth, S = (c = s.value) == null ? void 0 : c.scrollWidth;
|
|
105
|
+
k && S && S > k && (p = !0);
|
|
106
|
+
} else if (!se(t.lineClamp)) {
|
|
107
|
+
const k = (y = s.value) == null ? void 0 : y.offsetHeight, S = (E = s.value) == null ? void 0 : E.scrollHeight;
|
|
108
|
+
k && S && S > k && (p = !0);
|
|
109
|
+
}
|
|
110
|
+
p ? (x = s.value) == null || x.setAttribute("title", h) : (N = s.value) == null || N.removeAttribute("title");
|
|
111
|
+
};
|
|
112
|
+
return Ae(l), qe(l), (p, h) => (I(), Y(Ve(e.tag), {
|
|
113
|
+
ref_key: "textRef",
|
|
114
|
+
ref: s,
|
|
115
|
+
class: F(d.value),
|
|
116
|
+
style: Ue({ "-webkit-line-clamp": e.lineClamp })
|
|
117
|
+
}, {
|
|
118
|
+
default: L(() => [be(p.$slots, "default")]),
|
|
119
|
+
_: 3
|
|
120
|
+
}, 8, ["class", "style"]));
|
|
121
|
+
}
|
|
122
|
+
}), Lt = At;
|
|
123
|
+
const Ot = Be(Lt), Le = "RootTree", Je = "NodeInstance", He = "TreeNodeMap", Pt = ze({
|
|
124
|
+
data: {
|
|
125
|
+
type: ye(Array),
|
|
126
|
+
default: () => []
|
|
127
|
+
},
|
|
128
|
+
emptyText: { type: String },
|
|
129
|
+
renderAfterExpand: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: !0
|
|
132
|
+
},
|
|
133
|
+
nodeKey: String,
|
|
134
|
+
checkStrictly: Boolean,
|
|
135
|
+
defaultExpandAll: Boolean,
|
|
136
|
+
expandOnClickNode: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: !0
|
|
139
|
+
},
|
|
140
|
+
checkOnClickNode: Boolean,
|
|
141
|
+
checkOnClickLeaf: {
|
|
142
|
+
type: Boolean,
|
|
143
|
+
default: !0
|
|
144
|
+
},
|
|
145
|
+
checkDescendants: Boolean,
|
|
146
|
+
autoExpandParent: {
|
|
147
|
+
type: Boolean,
|
|
148
|
+
default: !0
|
|
149
|
+
},
|
|
150
|
+
defaultCheckedKeys: { type: Array },
|
|
151
|
+
defaultExpandedKeys: { type: Array },
|
|
152
|
+
currentNodeKey: { type: [String, Number] },
|
|
153
|
+
renderContent: { type: ye(Function) },
|
|
154
|
+
showCheckbox: Boolean,
|
|
155
|
+
draggable: Boolean,
|
|
156
|
+
allowDrag: { type: ye(Function) },
|
|
157
|
+
allowDrop: { type: ye(Function) },
|
|
158
|
+
props: {
|
|
159
|
+
type: Object,
|
|
160
|
+
default: () => ({
|
|
161
|
+
children: "children",
|
|
162
|
+
label: "label",
|
|
163
|
+
disabled: "disabled"
|
|
164
|
+
})
|
|
165
|
+
},
|
|
166
|
+
lazy: Boolean,
|
|
167
|
+
highlightCurrent: Boolean,
|
|
168
|
+
load: { type: Function },
|
|
169
|
+
filterNodeMethod: { type: Function },
|
|
170
|
+
accordion: Boolean,
|
|
171
|
+
indent: {
|
|
172
|
+
type: Number,
|
|
173
|
+
default: 18
|
|
174
|
+
},
|
|
175
|
+
icon: { type: nt }
|
|
176
|
+
}), jt = {
|
|
177
|
+
"check-change": (e, t, o) => e && xe(t) && xe(o),
|
|
178
|
+
"current-change": (e, t) => !0,
|
|
179
|
+
"node-click": (e, t, o, s) => e && t && s instanceof Event,
|
|
180
|
+
"node-contextmenu": (e, t, o, s) => e instanceof Event && t && o,
|
|
181
|
+
"node-collapse": (e, t, o) => e && t,
|
|
182
|
+
"node-expand": (e, t, o) => e && t,
|
|
183
|
+
check: (e, t) => e && t,
|
|
184
|
+
"node-drag-start": (e, t) => e && t,
|
|
185
|
+
"node-drag-end": (e, t, o, s) => e && s,
|
|
186
|
+
"node-drop": (e, t, o, s) => e && t && s,
|
|
187
|
+
"node-drag-leave": (e, t, o) => e && t && o,
|
|
188
|
+
"node-drag-enter": (e, t, o) => e && t && o,
|
|
189
|
+
"node-drag-over": (e, t, o) => e && t && o
|
|
190
|
+
}, Ge = "$treeNodeId", Me = function(e, t) {
|
|
191
|
+
!t || t.$treeNodeId || Object.defineProperty(t, Ge, {
|
|
192
|
+
value: e.id,
|
|
193
|
+
enumerable: !1,
|
|
194
|
+
configurable: !1,
|
|
195
|
+
writable: !1
|
|
196
|
+
});
|
|
197
|
+
}, Oe = (e, t) => t == null ? void 0 : t[e || "$treeNodeId"], Te = (e, t, o) => {
|
|
198
|
+
const s = e.value.currentNode;
|
|
199
|
+
o();
|
|
200
|
+
const n = e.value.currentNode;
|
|
201
|
+
s !== n && t("current-change", n ? n.data : null, n);
|
|
202
|
+
}, Qe = (e) => {
|
|
203
|
+
let t = !0, o = !0, s = !0, n = !0;
|
|
204
|
+
for (let a = 0, d = e.length; a < d; a++) {
|
|
205
|
+
const l = e[a];
|
|
206
|
+
(l.checked !== !0 || l.indeterminate) && (t = !1, l.disabled || (s = !1)), (l.checked !== !1 || l.indeterminate) && (o = !1), l.isEffectivelyChecked || (n = !1);
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
all: t,
|
|
210
|
+
none: o,
|
|
211
|
+
allWithoutDisable: s,
|
|
212
|
+
half: !t && !o,
|
|
213
|
+
isEffectivelyChecked: n
|
|
214
|
+
};
|
|
215
|
+
}, ce = function(e) {
|
|
216
|
+
if (e.childNodes.length === 0 || e.loading) {
|
|
217
|
+
e.isEffectivelyChecked = e.disabled || e.checked;
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const { all: t, none: o, half: s, isEffectivelyChecked: n } = Qe(e.childNodes);
|
|
221
|
+
e.isEffectivelyChecked = n, t ? (e.checked = !0, e.indeterminate = !1) : s ? (e.checked = !1, e.indeterminate = !0) : o && (e.checked = !1, e.indeterminate = !1);
|
|
222
|
+
const a = e.parent;
|
|
223
|
+
!a || a.level === 0 || e.store.checkStrictly || ce(a);
|
|
224
|
+
}, Ne = function(e, t) {
|
|
225
|
+
const o = e.store.props, s = e.data || {}, n = o[t];
|
|
226
|
+
if (me(n)) return n(s, e);
|
|
227
|
+
if (Fe(n)) return s[n];
|
|
228
|
+
if (se(n)) {
|
|
229
|
+
const a = s[t];
|
|
230
|
+
return se(a) ? "" : a;
|
|
231
|
+
}
|
|
232
|
+
}, Ie = function(e, t) {
|
|
233
|
+
e.forEach((o) => {
|
|
234
|
+
o.canFocus = t, Ie(o.childNodes, t);
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
let $t = 0;
|
|
238
|
+
var Se = class Ce {
|
|
239
|
+
constructor(t) {
|
|
240
|
+
this.isLeafByUser = void 0, this.isLeaf = void 0, this.isEffectivelyChecked = !1, this.id = $t++, this.text = null, this.checked = !1, this.indeterminate = !1, this.data = null, this.expanded = !1, this.parent = null, this.visible = !0, this.isCurrent = !1, this.canFocus = !1;
|
|
241
|
+
for (const o in t) De(t, o) && (this[o] = t[o]);
|
|
242
|
+
this.level = 0, this.loaded = !1, this.childNodes = [], this.loading = !1, this.parent && (this.level = this.parent.level + 1);
|
|
243
|
+
}
|
|
244
|
+
initialize() {
|
|
245
|
+
var a;
|
|
246
|
+
const t = this.store;
|
|
247
|
+
if (!t) throw new Error("[Node]store is required!");
|
|
248
|
+
t.registerNode(this);
|
|
249
|
+
const o = t.props;
|
|
250
|
+
if (o && typeof o.isLeaf < "u") {
|
|
251
|
+
const d = Ne(this, "isLeaf");
|
|
252
|
+
xe(d) && (this.isLeafByUser = d);
|
|
253
|
+
}
|
|
254
|
+
if (t.lazy !== !0 && this.data ? (this.setData(this.data), t.defaultExpandAll && (this.expanded = !0, this.canFocus = !0)) : this.level > 0 && t.lazy && t.defaultExpandAll && !this.isLeafByUser && this.expand(), ve(this.data) || Me(this, this.data), !this.data) return;
|
|
255
|
+
const s = t.defaultExpandedKeys, n = t.key;
|
|
256
|
+
n && !we(this.key) && s && s.includes(this.key) && this.expand(null, t.autoExpandParent), n && t.currentNodeKey !== void 0 && this.key === t.currentNodeKey && (t.currentNode && (t.currentNode.isCurrent = !1), t.currentNode = this, t.currentNode.isCurrent = !0), t.lazy && t._initDefaultCheckedNode(this), this.updateLeafState(), (this.level === 1 || ((a = this.parent) == null ? void 0 : a.expanded) === !0) && (this.canFocus = !0);
|
|
257
|
+
}
|
|
258
|
+
setData(t) {
|
|
259
|
+
ve(t) || Me(this, t), this.data = t, this.childNodes = [];
|
|
260
|
+
let o;
|
|
261
|
+
this.level === 0 && ve(this.data) ? o = this.data : o = Ne(this, "children") || [];
|
|
262
|
+
for (let s = 0, n = o.length; s < n; s++) this.insertChild({ data: o[s] });
|
|
263
|
+
}
|
|
264
|
+
get label() {
|
|
265
|
+
return Ne(this, "label");
|
|
266
|
+
}
|
|
267
|
+
get key() {
|
|
268
|
+
const t = this.store.key;
|
|
269
|
+
return this.data ? this.data[t] : null;
|
|
270
|
+
}
|
|
271
|
+
get disabled() {
|
|
272
|
+
return Ne(this, "disabled");
|
|
273
|
+
}
|
|
274
|
+
get nextSibling() {
|
|
275
|
+
const t = this.parent;
|
|
276
|
+
if (t) {
|
|
277
|
+
const o = t.childNodes.indexOf(this);
|
|
278
|
+
if (o > -1) return t.childNodes[o + 1];
|
|
279
|
+
}
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
get previousSibling() {
|
|
283
|
+
const t = this.parent;
|
|
284
|
+
if (t) {
|
|
285
|
+
const o = t.childNodes.indexOf(this);
|
|
286
|
+
if (o > -1) return o > 0 ? t.childNodes[o - 1] : null;
|
|
287
|
+
}
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
contains(t, o = !0) {
|
|
291
|
+
return (this.childNodes || []).some((s) => s === t || o && s.contains(t));
|
|
292
|
+
}
|
|
293
|
+
remove() {
|
|
294
|
+
const t = this.parent;
|
|
295
|
+
t && t.removeChild(this);
|
|
296
|
+
}
|
|
297
|
+
insertChild(t, o, s) {
|
|
298
|
+
if (!t) throw new Error("InsertChild error: child is required.");
|
|
299
|
+
if (!(t instanceof Ce)) {
|
|
300
|
+
if (!s) {
|
|
301
|
+
const n = this.getChildren(!0);
|
|
302
|
+
n != null && n.includes(t.data) || (se(o) || o < 0 ? n == null || n.push(t.data) : n == null || n.splice(o, 0, t.data));
|
|
303
|
+
}
|
|
304
|
+
Object.assign(t, {
|
|
305
|
+
parent: this,
|
|
306
|
+
store: this.store
|
|
307
|
+
}), t = xt(new Ce(t)), t instanceof Ce && t.initialize();
|
|
308
|
+
}
|
|
309
|
+
t.level = this.level + 1, se(o) || o < 0 ? this.childNodes.push(t) : this.childNodes.splice(o, 0, t), this.updateLeafState();
|
|
310
|
+
}
|
|
311
|
+
insertBefore(t, o) {
|
|
312
|
+
let s;
|
|
313
|
+
o && (s = this.childNodes.indexOf(o)), this.insertChild(t, s);
|
|
314
|
+
}
|
|
315
|
+
insertAfter(t, o) {
|
|
316
|
+
let s;
|
|
317
|
+
o && (s = this.childNodes.indexOf(o), s !== -1 && (s += 1)), this.insertChild(t, s);
|
|
318
|
+
}
|
|
319
|
+
removeChild(t) {
|
|
320
|
+
const o = this.getChildren() || [], s = o.indexOf(t.data);
|
|
321
|
+
s > -1 && o.splice(s, 1);
|
|
322
|
+
const n = this.childNodes.indexOf(t);
|
|
323
|
+
n > -1 && (this.store && this.store.deregisterNode(t), t.parent = null, this.childNodes.splice(n, 1)), this.updateLeafState();
|
|
324
|
+
}
|
|
325
|
+
removeChildByData(t) {
|
|
326
|
+
const o = this.childNodes.find((s) => s.data === t);
|
|
327
|
+
o && this.removeChild(o);
|
|
328
|
+
}
|
|
329
|
+
expand(t, o) {
|
|
330
|
+
const s = () => {
|
|
331
|
+
if (o) {
|
|
332
|
+
let n = this.parent;
|
|
333
|
+
for (; n && n.level > 0; )
|
|
334
|
+
n.expanded = !0, n = n.parent;
|
|
335
|
+
}
|
|
336
|
+
this.expanded = !0, t && t(), Ie(this.childNodes, !0);
|
|
337
|
+
};
|
|
338
|
+
this.shouldLoadData() ? this.loadData((n) => {
|
|
339
|
+
ve(n) && (this.store.checkStrictly || (this.checked ? this.setChecked(!0, !0) : ce(this)), s());
|
|
340
|
+
}) : s();
|
|
341
|
+
}
|
|
342
|
+
doCreateChildren(t, o = {}) {
|
|
343
|
+
t.forEach((s) => {
|
|
344
|
+
this.insertChild(Object.assign({ data: s }, o), void 0, !0);
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
collapse() {
|
|
348
|
+
this.expanded = !1, Ie(this.childNodes, !1);
|
|
349
|
+
}
|
|
350
|
+
shouldLoadData() {
|
|
351
|
+
return !!(this.store.lazy === !0 && this.store.load && !this.loaded);
|
|
352
|
+
}
|
|
353
|
+
updateLeafState() {
|
|
354
|
+
if (this.store.lazy === !0 && this.loaded !== !0 && typeof this.isLeafByUser < "u") {
|
|
355
|
+
this.isLeaf = this.isLeafByUser, this.isEffectivelyChecked = this.isLeaf && this.disabled;
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
const t = this.childNodes;
|
|
359
|
+
if (!this.store.lazy || this.store.lazy === !0 && this.loaded === !0) {
|
|
360
|
+
this.isLeaf = !t || t.length === 0, this.isEffectivelyChecked = this.isLeaf && this.disabled;
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
this.isLeaf = !1;
|
|
364
|
+
}
|
|
365
|
+
setChecked(t, o, s, n) {
|
|
366
|
+
if (this.indeterminate = t === "half", this.checked = t === !0, this.isEffectivelyChecked = !this.childNodes.length && (this.disabled || this.checked), this.store.checkStrictly && !o) return;
|
|
367
|
+
if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
|
|
368
|
+
const d = () => {
|
|
369
|
+
if (o) {
|
|
370
|
+
const l = this.childNodes;
|
|
371
|
+
for (let r = 0, c = l.length; r < c; r++) {
|
|
372
|
+
const y = l[r];
|
|
373
|
+
n = n || t !== !1;
|
|
374
|
+
const E = y.disabled && y.isLeaf ? y.checked : n;
|
|
375
|
+
y.setChecked(E, o, !0, n);
|
|
376
|
+
}
|
|
377
|
+
const { half: p, all: h, isEffectivelyChecked: u } = Qe(l);
|
|
378
|
+
h || (this.checked = h, this.indeterminate = p), this.isEffectivelyChecked = this.childNodes.length ? u : this.disabled || this.checked;
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
if (this.shouldLoadData()) {
|
|
382
|
+
this.loadData(() => {
|
|
383
|
+
d(), ce(this);
|
|
384
|
+
}, { checked: t !== !1 });
|
|
385
|
+
return;
|
|
386
|
+
} else d();
|
|
387
|
+
}
|
|
388
|
+
const a = this.parent;
|
|
389
|
+
!a || a.level === 0 || !s && !this.store.checkStrictly && ce(a);
|
|
390
|
+
}
|
|
391
|
+
getChildren(t = !1) {
|
|
392
|
+
if (this.level === 0) return this.data;
|
|
393
|
+
const o = this.data;
|
|
394
|
+
if (!o) return null;
|
|
395
|
+
const s = this.store.props;
|
|
396
|
+
let n = "children";
|
|
397
|
+
return s && (n = s.children || "children"), se(o[n]) && (o[n] = null), t && !o[n] && (o[n] = []), o[n];
|
|
398
|
+
}
|
|
399
|
+
updateChildren() {
|
|
400
|
+
const t = this.getChildren() || [], o = this.childNodes.map((a) => a.data), s = {}, n = [];
|
|
401
|
+
t.forEach((a, d) => {
|
|
402
|
+
const l = a[Ge];
|
|
403
|
+
l && o.some((p) => (p == null ? void 0 : p.$treeNodeId) === l) ? s[l] = {
|
|
404
|
+
index: d,
|
|
405
|
+
data: a
|
|
406
|
+
} : n.push({
|
|
407
|
+
index: d,
|
|
408
|
+
data: a
|
|
409
|
+
});
|
|
410
|
+
}), this.store.lazy || o.forEach((a) => {
|
|
411
|
+
s[a == null ? void 0 : a.$treeNodeId] || this.removeChildByData(a);
|
|
412
|
+
}), n.forEach(({ index: a, data: d }) => {
|
|
413
|
+
this.insertChild({ data: d }, a);
|
|
414
|
+
}), this.updateLeafState();
|
|
415
|
+
}
|
|
416
|
+
loadData(t, o = {}) {
|
|
417
|
+
if (this.store.lazy === !0 && this.store.load && !this.loaded && (!this.loading || Object.keys(o).length)) {
|
|
418
|
+
this.loading = !0;
|
|
419
|
+
const s = (a) => {
|
|
420
|
+
this.childNodes = [], this.doCreateChildren(a, o), this.loaded = !0, this.loading = !1, this.updateLeafState(), t && t.call(this, a);
|
|
421
|
+
}, n = () => {
|
|
422
|
+
this.loading = !1;
|
|
423
|
+
};
|
|
424
|
+
this.store.load(this, s, n);
|
|
425
|
+
} else t && t.call(this);
|
|
426
|
+
}
|
|
427
|
+
eachNode(t) {
|
|
428
|
+
const o = [this];
|
|
429
|
+
for (; o.length; ) {
|
|
430
|
+
const s = o.shift();
|
|
431
|
+
o.unshift(...s.childNodes), t(s);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
reInitChecked() {
|
|
435
|
+
this.store.checkStrictly || ce(this);
|
|
436
|
+
}
|
|
437
|
+
}, Ht = class {
|
|
438
|
+
constructor(e) {
|
|
439
|
+
this.lazy = !1, this.checkStrictly = !1, this.autoExpandParent = !1, this.defaultExpandAll = !1, this.checkDescendants = !1, this.currentNode = null, this.currentNodeKey = null;
|
|
440
|
+
for (const t in e) De(e, t) && (this[t] = e[t]);
|
|
441
|
+
this.nodesMap = {};
|
|
442
|
+
}
|
|
443
|
+
initialize() {
|
|
444
|
+
if (this.root = new Se({
|
|
445
|
+
data: this.data,
|
|
446
|
+
store: this
|
|
447
|
+
}), this.root.initialize(), this.lazy && this.load) {
|
|
448
|
+
const e = this.load;
|
|
449
|
+
e(this.root, (t) => {
|
|
450
|
+
this.root.doCreateChildren(t), this._initDefaultCheckedNodes();
|
|
451
|
+
}, ot);
|
|
452
|
+
} else this._initDefaultCheckedNodes();
|
|
453
|
+
}
|
|
454
|
+
filter(e) {
|
|
455
|
+
const t = this.filterNodeMethod, o = this.lazy, s = async function(n) {
|
|
456
|
+
const a = n.root ? n.root.childNodes : n.childNodes;
|
|
457
|
+
for (const [d, l] of a.entries())
|
|
458
|
+
l.visible = !!(t != null && t.call(l, e, l.data, l)), d % 80 === 0 && d > 0 && await re(), await s(l);
|
|
459
|
+
if (!n.visible && a.length) {
|
|
460
|
+
let d = !0;
|
|
461
|
+
d = !a.some((l) => l.visible), n.root ? n.root.visible = d === !1 : n.visible = d === !1;
|
|
462
|
+
}
|
|
463
|
+
e && n.visible && !n.isLeaf && (!o || n.loaded) && n.expand();
|
|
464
|
+
};
|
|
465
|
+
s(this);
|
|
466
|
+
}
|
|
467
|
+
setData(e) {
|
|
468
|
+
e !== this.root.data ? (this.nodesMap = {}, this.root.setData(e), this._initDefaultCheckedNodes(), this.setCurrentNodeKey(this.currentNodeKey)) : this.root.updateChildren();
|
|
469
|
+
}
|
|
470
|
+
getNode(e) {
|
|
471
|
+
if (e instanceof Se) return e;
|
|
472
|
+
const t = st(e) ? Oe(this.key, e) : e;
|
|
473
|
+
return this.nodesMap[t] || null;
|
|
474
|
+
}
|
|
475
|
+
insertBefore(e, t) {
|
|
476
|
+
var s;
|
|
477
|
+
const o = this.getNode(t);
|
|
478
|
+
(s = o.parent) == null || s.insertBefore({ data: e }, o);
|
|
479
|
+
}
|
|
480
|
+
insertAfter(e, t) {
|
|
481
|
+
var s;
|
|
482
|
+
const o = this.getNode(t);
|
|
483
|
+
(s = o.parent) == null || s.insertAfter({ data: e }, o);
|
|
484
|
+
}
|
|
485
|
+
remove(e) {
|
|
486
|
+
const t = this.getNode(e);
|
|
487
|
+
t && t.parent && (t === this.currentNode && (this.currentNode = null), t.parent.removeChild(t));
|
|
488
|
+
}
|
|
489
|
+
append(e, t) {
|
|
490
|
+
const o = Pe(t) ? this.root : this.getNode(t);
|
|
491
|
+
o && o.insertChild({ data: e });
|
|
492
|
+
}
|
|
493
|
+
_initDefaultCheckedNodes() {
|
|
494
|
+
const e = this.defaultCheckedKeys || [], t = this.nodesMap;
|
|
495
|
+
e.forEach((o) => {
|
|
496
|
+
const s = t[o];
|
|
497
|
+
s && s.setChecked(!0, !this.checkStrictly);
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
_initDefaultCheckedNode(e) {
|
|
501
|
+
const t = this.defaultCheckedKeys || [];
|
|
502
|
+
!we(e.key) && t.includes(e.key) && e.setChecked(!0, !this.checkStrictly);
|
|
503
|
+
}
|
|
504
|
+
setDefaultCheckedKey(e) {
|
|
505
|
+
e !== this.defaultCheckedKeys && (this.defaultCheckedKeys = e, this._initDefaultCheckedNodes());
|
|
506
|
+
}
|
|
507
|
+
registerNode(e) {
|
|
508
|
+
const t = this.key;
|
|
509
|
+
if (!(!e || !e.data))
|
|
510
|
+
if (!t) this.nodesMap[e.id] = e;
|
|
511
|
+
else {
|
|
512
|
+
const o = e.key;
|
|
513
|
+
we(o) || (this.nodesMap[o] = e);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
deregisterNode(e) {
|
|
517
|
+
!this.key || !e || !e.data || (e.childNodes.forEach((t) => {
|
|
518
|
+
this.deregisterNode(t);
|
|
519
|
+
}), delete this.nodesMap[e.key]);
|
|
520
|
+
}
|
|
521
|
+
getCheckedNodes(e = !1, t = !1) {
|
|
522
|
+
const o = [], s = function(n) {
|
|
523
|
+
(n.root ? n.root.childNodes : n.childNodes).forEach((a) => {
|
|
524
|
+
(a.checked || t && a.indeterminate) && (!e || e && a.isLeaf) && o.push(a.data), s(a);
|
|
525
|
+
});
|
|
526
|
+
};
|
|
527
|
+
return s(this), o;
|
|
528
|
+
}
|
|
529
|
+
getCheckedKeys(e = !1) {
|
|
530
|
+
return this.getCheckedNodes(e).map((t) => (t || {})[this.key]);
|
|
531
|
+
}
|
|
532
|
+
getHalfCheckedNodes() {
|
|
533
|
+
const e = [], t = function(o) {
|
|
534
|
+
(o.root ? o.root.childNodes : o.childNodes).forEach((s) => {
|
|
535
|
+
s.indeterminate && e.push(s.data), t(s);
|
|
536
|
+
});
|
|
537
|
+
};
|
|
538
|
+
return t(this), e;
|
|
539
|
+
}
|
|
540
|
+
getHalfCheckedKeys() {
|
|
541
|
+
return this.getHalfCheckedNodes().map((e) => (e || {})[this.key]);
|
|
542
|
+
}
|
|
543
|
+
_getAllNodes() {
|
|
544
|
+
const e = [], t = this.nodesMap;
|
|
545
|
+
for (const o in t) De(t, o) && e.push(t[o]);
|
|
546
|
+
return e;
|
|
547
|
+
}
|
|
548
|
+
updateChildren(e, t) {
|
|
549
|
+
const o = this.nodesMap[e];
|
|
550
|
+
if (!o) return;
|
|
551
|
+
const s = o.childNodes;
|
|
552
|
+
for (let n = s.length - 1; n >= 0; n--) {
|
|
553
|
+
const a = s[n];
|
|
554
|
+
this.remove(a.data);
|
|
555
|
+
}
|
|
556
|
+
for (let n = 0, a = t.length; n < a; n++) {
|
|
557
|
+
const d = t[n];
|
|
558
|
+
this.append(d, o.data);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
_setCheckedKeys(e, t = !1, o) {
|
|
562
|
+
const s = this._getAllNodes().sort((l, p) => l.level - p.level), n = /* @__PURE__ */ Object.create(null), a = Object.keys(o);
|
|
563
|
+
s.forEach((l) => l.setChecked(!1, !1));
|
|
564
|
+
const d = (l) => {
|
|
565
|
+
l.childNodes.forEach((p) => {
|
|
566
|
+
var h;
|
|
567
|
+
n[p.data[e]] = !0, (h = p.childNodes) != null && h.length && d(p);
|
|
568
|
+
});
|
|
569
|
+
};
|
|
570
|
+
for (let l = 0, p = s.length; l < p; l++) {
|
|
571
|
+
const h = s[l], u = h.data[e].toString();
|
|
572
|
+
if (!a.includes(u)) {
|
|
573
|
+
h.checked && !n[u] && h.setChecked(!1, !1);
|
|
574
|
+
continue;
|
|
575
|
+
}
|
|
576
|
+
if (h.childNodes.length && d(h), h.isLeaf || this.checkStrictly) {
|
|
577
|
+
h.setChecked(!0, !1);
|
|
578
|
+
continue;
|
|
579
|
+
}
|
|
580
|
+
if (h.setChecked(!0, !0), t) {
|
|
581
|
+
h.setChecked(!1, !1, !0);
|
|
582
|
+
const r = function(c) {
|
|
583
|
+
c.childNodes.forEach((y) => {
|
|
584
|
+
y.isLeaf || y.setChecked(!1, !1, !0), r(y);
|
|
585
|
+
}), c.reInitChecked();
|
|
586
|
+
};
|
|
587
|
+
r(h);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
setCheckedNodes(e, t = !1) {
|
|
592
|
+
const o = this.key, s = {};
|
|
593
|
+
e.forEach((n) => {
|
|
594
|
+
s[(n || {})[o]] = !0;
|
|
595
|
+
}), this._setCheckedKeys(o, t, s);
|
|
596
|
+
}
|
|
597
|
+
setCheckedKeys(e, t = !1) {
|
|
598
|
+
this.defaultCheckedKeys = e;
|
|
599
|
+
const o = this.key, s = {};
|
|
600
|
+
e.forEach((n) => {
|
|
601
|
+
s[n] = !0;
|
|
602
|
+
}), this._setCheckedKeys(o, t, s);
|
|
603
|
+
}
|
|
604
|
+
setDefaultExpandedKeys(e) {
|
|
605
|
+
e = e || [], this.defaultExpandedKeys = e, e.forEach((t) => {
|
|
606
|
+
const o = this.getNode(t);
|
|
607
|
+
o && o.expand(null, this.autoExpandParent);
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
setChecked(e, t, o) {
|
|
611
|
+
const s = this.getNode(e);
|
|
612
|
+
s && s.setChecked(!!t, o);
|
|
613
|
+
}
|
|
614
|
+
getCurrentNode() {
|
|
615
|
+
return this.currentNode;
|
|
616
|
+
}
|
|
617
|
+
setCurrentNode(e) {
|
|
618
|
+
const t = this.currentNode;
|
|
619
|
+
t && (t.isCurrent = !1), this.currentNode = e, this.currentNode.isCurrent = !0;
|
|
620
|
+
}
|
|
621
|
+
setUserCurrentNode(e, t = !0) {
|
|
622
|
+
var n;
|
|
623
|
+
const o = e[this.key], s = this.nodesMap[o];
|
|
624
|
+
this.setCurrentNode(s), t && this.currentNode && this.currentNode.level > 1 && ((n = this.currentNode.parent) == null || n.expand(null, !0));
|
|
625
|
+
}
|
|
626
|
+
setCurrentNodeKey(e, t = !0) {
|
|
627
|
+
var s;
|
|
628
|
+
if (this.currentNodeKey = e, Pe(e)) {
|
|
629
|
+
this.currentNode && (this.currentNode.isCurrent = !1), this.currentNode = null;
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
const o = this.getNode(e);
|
|
633
|
+
o && (this.setCurrentNode(o), t && this.currentNode && this.currentNode.level > 1 && ((s = this.currentNode.parent) == null || s.expand(null, !0)));
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
function Xe(e) {
|
|
637
|
+
const t = fe(He, null);
|
|
638
|
+
let o = {
|
|
639
|
+
treeNodeExpand: (s) => {
|
|
640
|
+
var n;
|
|
641
|
+
e.node !== s && ((n = e.node) == null || n.collapse());
|
|
642
|
+
},
|
|
643
|
+
children: /* @__PURE__ */ new Set()
|
|
644
|
+
};
|
|
645
|
+
return t && t.children.add(o), Ye(() => {
|
|
646
|
+
t && t.children.delete(o), o = null;
|
|
647
|
+
}), pe(He, o), { broadcastExpanded: (s) => {
|
|
648
|
+
if (e.accordion)
|
|
649
|
+
for (const n of o.children) n.treeNodeExpand(s);
|
|
650
|
+
} };
|
|
651
|
+
}
|
|
652
|
+
const Ze = Symbol("dragEvents");
|
|
653
|
+
function Mt({ props: e, ctx: t, el$: o, dropIndicator$: s, store: n }) {
|
|
654
|
+
const a = ae("tree"), d = w({
|
|
655
|
+
showDropIndicator: !1,
|
|
656
|
+
draggingNode: null,
|
|
657
|
+
dropNode: null,
|
|
658
|
+
allowDrop: !0,
|
|
659
|
+
dropType: null
|
|
660
|
+
});
|
|
661
|
+
return pe(Ze, {
|
|
662
|
+
treeNodeDragStart: ({ event: u, treeNode: r }) => {
|
|
663
|
+
if (u.dataTransfer) {
|
|
664
|
+
if (me(e.allowDrag) && !e.allowDrag(r.node))
|
|
665
|
+
return u.preventDefault(), !1;
|
|
666
|
+
u.dataTransfer.effectAllowed = "move";
|
|
667
|
+
try {
|
|
668
|
+
u.dataTransfer.setData("text/plain", "");
|
|
669
|
+
} catch {
|
|
670
|
+
}
|
|
671
|
+
d.value.draggingNode = r, t.emit("node-drag-start", r.node, u);
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
treeNodeDragOver: ({ event: u, treeNode: r }) => {
|
|
675
|
+
if (!u.dataTransfer) return;
|
|
676
|
+
const c = r, y = d.value.dropNode;
|
|
677
|
+
y && y.node.id !== c.node.id && Ee(y.$el, a.is("drop-inner"));
|
|
678
|
+
const E = d.value.draggingNode;
|
|
679
|
+
if (!E || !c) return;
|
|
680
|
+
let x = !0, N = !0, k = !0, S = !0;
|
|
681
|
+
me(e.allowDrop) && (x = e.allowDrop(E.node, c.node, "prev"), S = N = e.allowDrop(E.node, c.node, "inner"), k = e.allowDrop(E.node, c.node, "next")), u.dataTransfer.dropEffect = N || x || k ? "move" : "none", (x || N || k) && (y == null ? void 0 : y.node.id) !== c.node.id && (y && t.emit("node-drag-leave", E.node, y.node, u), t.emit("node-drag-enter", E.node, c.node, u)), x || N || k ? d.value.dropNode = c : d.value.dropNode = null, c.node.nextSibling === E.node && (k = !1), c.node.previousSibling === E.node && (x = !1), c.node.contains(E.node, !1) && (N = !1), (E.node === c.node || E.node.contains(c.node)) && (x = !1, N = !1, k = !1);
|
|
682
|
+
const j = c.$el, V = j.querySelector(`.${a.be("node", "content")}`).getBoundingClientRect(), H = o.value.getBoundingClientRect(), M = o.value.scrollTop;
|
|
683
|
+
let P;
|
|
684
|
+
const U = x ? N ? 0.25 : k ? 0.45 : 1 : Number.NEGATIVE_INFINITY, v = k ? N ? 0.75 : x ? 0.55 : 0 : Number.POSITIVE_INFINITY;
|
|
685
|
+
let b = -9999;
|
|
686
|
+
const B = u.clientY - V.top;
|
|
687
|
+
B < V.height * U ? P = "before" : B > V.height * v ? P = "after" : N ? P = "inner" : P = "none";
|
|
688
|
+
const O = j.querySelector(`.${a.be("node", "expand-icon")}`).getBoundingClientRect(), te = s.value;
|
|
689
|
+
P === "before" ? b = O.top - H.top + M : P === "after" && (b = O.bottom - H.top + M), te.style.top = `${b}px`, te.style.left = `${O.right - H.left}px`, P === "inner" ? at(j, a.is("drop-inner")) : Ee(j, a.is("drop-inner")), d.value.showDropIndicator = P === "before" || P === "after", d.value.allowDrop = d.value.showDropIndicator || S, d.value.dropType = P, t.emit("node-drag-over", E.node, c.node, u);
|
|
690
|
+
},
|
|
691
|
+
treeNodeDragEnd: (u) => {
|
|
692
|
+
var E, x;
|
|
693
|
+
const { draggingNode: r, dropType: c, dropNode: y } = d.value;
|
|
694
|
+
if (u.preventDefault(), u.dataTransfer && (u.dataTransfer.dropEffect = "move"), r != null && r.node.data && y) {
|
|
695
|
+
const N = { data: r.node.data };
|
|
696
|
+
c !== "none" && r.node.remove(), c === "before" ? (E = y.node.parent) == null || E.insertBefore(N, y.node) : c === "after" ? (x = y.node.parent) == null || x.insertAfter(N, y.node) : c === "inner" && y.node.insertChild(N), c !== "none" && (n.value.registerNode(N), n.value.key && r.node.eachNode((k) => {
|
|
697
|
+
var S;
|
|
698
|
+
(S = n.value.nodesMap[k.data[n.value.key]]) == null || S.setChecked(k.checked, !n.value.checkStrictly);
|
|
699
|
+
})), Ee(y.$el, a.is("drop-inner")), t.emit("node-drag-end", r.node, y.node, c, u), c !== "none" && t.emit("node-drop", r.node, y.node, c, u);
|
|
700
|
+
}
|
|
701
|
+
r && !y && t.emit("node-drag-end", r.node, null, c, u), d.value.showDropIndicator = !1, d.value.draggingNode = null, d.value.dropNode = null, d.value.allowDrop = !0;
|
|
702
|
+
}
|
|
703
|
+
}), { dragState: d };
|
|
704
|
+
}
|
|
705
|
+
var zt = de({
|
|
706
|
+
name: "ElTreeNodeContent",
|
|
707
|
+
props: {
|
|
708
|
+
node: {
|
|
709
|
+
type: Object,
|
|
710
|
+
required: !0
|
|
711
|
+
},
|
|
712
|
+
renderContent: Function
|
|
713
|
+
},
|
|
714
|
+
setup(e) {
|
|
715
|
+
const t = ae("tree"), o = fe(Je), s = fe(Le);
|
|
716
|
+
return () => {
|
|
717
|
+
const n = e.node, { data: a, store: d } = n;
|
|
718
|
+
return e.renderContent ? e.renderContent($e, {
|
|
719
|
+
_self: o,
|
|
720
|
+
node: n,
|
|
721
|
+
data: a,
|
|
722
|
+
store: d
|
|
723
|
+
}) : be(s.ctx.slots, "default", {
|
|
724
|
+
node: n,
|
|
725
|
+
data: a
|
|
726
|
+
}, () => [$e(Ot, {
|
|
727
|
+
tag: "span",
|
|
728
|
+
truncated: !0,
|
|
729
|
+
class: t.be("node", "label")
|
|
730
|
+
}, () => [n.label])]);
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
}), Ft = zt, Rt = de({
|
|
734
|
+
name: "ElTreeNode",
|
|
735
|
+
components: {
|
|
736
|
+
ElCollapseTransition: St,
|
|
737
|
+
ElCheckbox: dt,
|
|
738
|
+
NodeContent: Ft,
|
|
739
|
+
ElIcon: rt,
|
|
740
|
+
Loading: Dt
|
|
741
|
+
},
|
|
742
|
+
props: {
|
|
743
|
+
node: {
|
|
744
|
+
type: Se,
|
|
745
|
+
default: () => ({})
|
|
746
|
+
},
|
|
747
|
+
props: {
|
|
748
|
+
type: Object,
|
|
749
|
+
default: () => ({})
|
|
750
|
+
},
|
|
751
|
+
accordion: Boolean,
|
|
752
|
+
renderContent: Function,
|
|
753
|
+
renderAfterExpand: Boolean,
|
|
754
|
+
showCheckbox: Boolean
|
|
755
|
+
},
|
|
756
|
+
emits: ["node-expand"],
|
|
757
|
+
setup(e, t) {
|
|
758
|
+
const o = ae("tree"), { broadcastExpanded: s } = Xe(e), n = fe(Le), a = w(!1), d = w(!1), l = w(), p = w(), h = w(), u = fe(Ze), r = We();
|
|
759
|
+
pe(Je, r), n || it("Tree", "Can not find node's tree."), e.node.expanded && (a.value = !0, d.value = !0);
|
|
760
|
+
const c = n.props.props.children || "children";
|
|
761
|
+
q(() => {
|
|
762
|
+
var b;
|
|
763
|
+
const v = (b = e.node.data) == null ? void 0 : b[c];
|
|
764
|
+
return v && [...v];
|
|
765
|
+
}, () => {
|
|
766
|
+
e.node.updateChildren();
|
|
767
|
+
}), q(() => e.node.indeterminate, (v) => {
|
|
768
|
+
x(e.node.checked, v);
|
|
769
|
+
}), q(() => e.node.checked, (v) => {
|
|
770
|
+
x(v, e.node.indeterminate);
|
|
771
|
+
}), q(() => e.node.childNodes.length, () => e.node.reInitChecked()), q(() => e.node.expanded, (v) => {
|
|
772
|
+
re(() => a.value = v), v && (d.value = !0);
|
|
773
|
+
});
|
|
774
|
+
const y = (v) => n.props.nodeKey ? Oe(n.props.nodeKey, v.data) : v.id, E = (v) => {
|
|
775
|
+
const b = e.props.class;
|
|
776
|
+
if (!b) return {};
|
|
777
|
+
let B;
|
|
778
|
+
if (me(b)) {
|
|
779
|
+
const { data: O } = v;
|
|
780
|
+
B = b(O, v);
|
|
781
|
+
} else B = b;
|
|
782
|
+
return Fe(B) ? { [B]: !0 } : B;
|
|
783
|
+
}, x = (v, b) => {
|
|
784
|
+
(l.value !== v || p.value !== b) && n.ctx.emit("check-change", e.node.data, v, b), l.value = v, p.value = b;
|
|
785
|
+
}, N = (v) => {
|
|
786
|
+
Te(n.store, n.ctx.emit, () => {
|
|
787
|
+
var b;
|
|
788
|
+
if ((b = n == null ? void 0 : n.props) != null && b.nodeKey) {
|
|
789
|
+
const B = y(e.node);
|
|
790
|
+
n.store.value.setCurrentNodeKey(B);
|
|
791
|
+
} else n.store.value.setCurrentNode(e.node);
|
|
792
|
+
}), n.currentNode.value = e.node, n.props.expandOnClickNode && S(), (n.props.checkOnClickNode || e.node.isLeaf && n.props.checkOnClickLeaf && e.showCheckbox) && !e.node.disabled && j(!e.node.checked), n.ctx.emit("node-click", e.node.data, e.node, r, v);
|
|
793
|
+
}, k = (v) => {
|
|
794
|
+
var b;
|
|
795
|
+
(b = n.instance.vnode.props) != null && b.onNodeContextmenu && (v.stopPropagation(), v.preventDefault()), n.ctx.emit("node-contextmenu", v, e.node.data, e.node, r);
|
|
796
|
+
}, S = () => {
|
|
797
|
+
e.node.isLeaf || (a.value ? (n.ctx.emit("node-collapse", e.node.data, e.node, r), e.node.collapse()) : e.node.expand(() => {
|
|
798
|
+
t.emit("node-expand", e.node.data, e.node, r);
|
|
799
|
+
}));
|
|
800
|
+
}, j = (v) => {
|
|
801
|
+
const b = n == null ? void 0 : n.props.checkStrictly, B = e.node.childNodes;
|
|
802
|
+
!b && B.length && (v = B.some((O) => !O.isEffectivelyChecked)), e.node.setChecked(v, !b), re(() => {
|
|
803
|
+
const O = n.store.value;
|
|
804
|
+
n.ctx.emit("check", e.node.data, {
|
|
805
|
+
checkedNodes: O.getCheckedNodes(),
|
|
806
|
+
checkedKeys: O.getCheckedKeys(),
|
|
807
|
+
halfCheckedNodes: O.getHalfCheckedNodes(),
|
|
808
|
+
halfCheckedKeys: O.getHalfCheckedKeys()
|
|
809
|
+
});
|
|
810
|
+
});
|
|
811
|
+
};
|
|
812
|
+
return {
|
|
813
|
+
ns: o,
|
|
814
|
+
node$: h,
|
|
815
|
+
tree: n,
|
|
816
|
+
expanded: a,
|
|
817
|
+
childNodeRendered: d,
|
|
818
|
+
oldChecked: l,
|
|
819
|
+
oldIndeterminate: p,
|
|
820
|
+
getNodeKey: y,
|
|
821
|
+
getNodeClass: E,
|
|
822
|
+
handleSelectChange: x,
|
|
823
|
+
handleClick: N,
|
|
824
|
+
handleContextMenu: k,
|
|
825
|
+
handleExpandIconClick: S,
|
|
826
|
+
handleCheckChange: j,
|
|
827
|
+
handleChildNodeExpand: (v, b, B) => {
|
|
828
|
+
s(b), n.ctx.emit("node-expand", v, b, B);
|
|
829
|
+
},
|
|
830
|
+
handleDragStart: (v) => {
|
|
831
|
+
n.props.draggable && u.treeNodeDragStart({
|
|
832
|
+
event: v,
|
|
833
|
+
treeNode: e
|
|
834
|
+
});
|
|
835
|
+
},
|
|
836
|
+
handleDragOver: (v) => {
|
|
837
|
+
v.preventDefault(), n.props.draggable && u.treeNodeDragOver({
|
|
838
|
+
event: v,
|
|
839
|
+
treeNode: {
|
|
840
|
+
$el: h.value,
|
|
841
|
+
node: e.node
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
},
|
|
845
|
+
handleDrop: (v) => {
|
|
846
|
+
v.preventDefault();
|
|
847
|
+
},
|
|
848
|
+
handleDragEnd: (v) => {
|
|
849
|
+
n.props.draggable && u.treeNodeDragEnd(v);
|
|
850
|
+
},
|
|
851
|
+
CaretRight: wt
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
const qt = [
|
|
856
|
+
"aria-expanded",
|
|
857
|
+
"aria-disabled",
|
|
858
|
+
"aria-checked",
|
|
859
|
+
"draggable",
|
|
860
|
+
"data-key"
|
|
861
|
+
], Vt = ["aria-expanded"];
|
|
862
|
+
function Ut(e, t, o, s, n, a) {
|
|
863
|
+
const d = oe("el-icon"), l = oe("el-checkbox"), p = oe("loading"), h = oe("node-content"), u = oe("el-tree-node"), r = oe("el-collapse-transition");
|
|
864
|
+
return G((I(), $("div", {
|
|
865
|
+
ref: "node$",
|
|
866
|
+
class: F([
|
|
867
|
+
e.ns.b("node"),
|
|
868
|
+
e.ns.is("expanded", e.expanded),
|
|
869
|
+
e.ns.is("current", e.node.isCurrent),
|
|
870
|
+
e.ns.is("hidden", !e.node.visible),
|
|
871
|
+
e.ns.is("focusable", !e.node.disabled),
|
|
872
|
+
e.ns.is("checked", !e.node.disabled && e.node.checked),
|
|
873
|
+
e.getNodeClass(e.node)
|
|
874
|
+
]),
|
|
875
|
+
role: "treeitem",
|
|
876
|
+
tabindex: "-1",
|
|
877
|
+
"aria-expanded": e.expanded,
|
|
878
|
+
"aria-disabled": e.node.disabled,
|
|
879
|
+
"aria-checked": e.node.checked,
|
|
880
|
+
draggable: e.tree.props.draggable,
|
|
881
|
+
"data-key": e.getNodeKey(e.node),
|
|
882
|
+
onClick: t[2] || (t[2] = ee((...c) => e.handleClick && e.handleClick(...c), ["stop"])),
|
|
883
|
+
onContextmenu: t[3] || (t[3] = (...c) => e.handleContextMenu && e.handleContextMenu(...c)),
|
|
884
|
+
onDragstart: t[4] || (t[4] = ee((...c) => e.handleDragStart && e.handleDragStart(...c), ["stop"])),
|
|
885
|
+
onDragover: t[5] || (t[5] = ee((...c) => e.handleDragOver && e.handleDragOver(...c), ["stop"])),
|
|
886
|
+
onDragend: t[6] || (t[6] = ee((...c) => e.handleDragEnd && e.handleDragEnd(...c), ["stop"])),
|
|
887
|
+
onDrop: t[7] || (t[7] = ee((...c) => e.handleDrop && e.handleDrop(...c), ["stop"]))
|
|
888
|
+
}, [D("div", {
|
|
889
|
+
class: F(e.ns.be("node", "content")),
|
|
890
|
+
style: Ue({ paddingLeft: (e.node.level - 1) * e.tree.props.indent + "px" })
|
|
891
|
+
}, [
|
|
892
|
+
e.tree.props.icon || e.CaretRight ? (I(), Y(d, {
|
|
893
|
+
key: 0,
|
|
894
|
+
class: F([
|
|
895
|
+
e.ns.be("node", "expand-icon"),
|
|
896
|
+
e.ns.is("leaf", e.node.isLeaf),
|
|
897
|
+
{ expanded: !e.node.isLeaf && e.expanded }
|
|
898
|
+
]),
|
|
899
|
+
onClick: ee(e.handleExpandIconClick, ["stop"])
|
|
900
|
+
}, {
|
|
901
|
+
default: L(() => [(I(), Y(Ve(e.tree.props.icon || e.CaretRight)))]),
|
|
902
|
+
_: 1
|
|
903
|
+
}, 8, ["class", "onClick"])) : le("v-if", !0),
|
|
904
|
+
e.showCheckbox ? (I(), Y(l, {
|
|
905
|
+
key: 1,
|
|
906
|
+
"model-value": e.node.checked,
|
|
907
|
+
indeterminate: e.node.indeterminate,
|
|
908
|
+
disabled: !!e.node.disabled,
|
|
909
|
+
onClick: t[0] || (t[0] = ee(() => {
|
|
910
|
+
}, ["stop"])),
|
|
911
|
+
onChange: e.handleCheckChange
|
|
912
|
+
}, null, 8, [
|
|
913
|
+
"model-value",
|
|
914
|
+
"indeterminate",
|
|
915
|
+
"disabled",
|
|
916
|
+
"onChange"
|
|
917
|
+
])) : le("v-if", !0),
|
|
918
|
+
e.node.loading ? (I(), Y(d, {
|
|
919
|
+
key: 2,
|
|
920
|
+
class: F([e.ns.be("node", "loading-icon"), e.ns.is("loading")])
|
|
921
|
+
}, {
|
|
922
|
+
default: L(() => [A(p)]),
|
|
923
|
+
_: 1
|
|
924
|
+
}, 8, ["class"])) : le("v-if", !0),
|
|
925
|
+
A(h, {
|
|
926
|
+
node: e.node,
|
|
927
|
+
"render-content": e.renderContent
|
|
928
|
+
}, null, 8, ["node", "render-content"])
|
|
929
|
+
], 6), A(r, null, {
|
|
930
|
+
default: L(() => [!e.renderAfterExpand || e.childNodeRendered ? G((I(), $("div", {
|
|
931
|
+
key: 0,
|
|
932
|
+
class: F(e.ns.be("node", "children")),
|
|
933
|
+
role: "group",
|
|
934
|
+
"aria-expanded": e.expanded,
|
|
935
|
+
onClick: t[1] || (t[1] = ee(() => {
|
|
936
|
+
}, ["stop"]))
|
|
937
|
+
}, [(I(!0), $(ue, null, he(e.node.childNodes, (c) => (I(), Y(u, {
|
|
938
|
+
key: e.getNodeKey(c),
|
|
939
|
+
"render-content": e.renderContent,
|
|
940
|
+
"render-after-expand": e.renderAfterExpand,
|
|
941
|
+
"show-checkbox": e.showCheckbox,
|
|
942
|
+
node: c,
|
|
943
|
+
accordion: e.accordion,
|
|
944
|
+
props: e.props,
|
|
945
|
+
onNodeExpand: e.handleChildNodeExpand
|
|
946
|
+
}, null, 8, [
|
|
947
|
+
"render-content",
|
|
948
|
+
"render-after-expand",
|
|
949
|
+
"show-checkbox",
|
|
950
|
+
"node",
|
|
951
|
+
"accordion",
|
|
952
|
+
"props",
|
|
953
|
+
"onNodeExpand"
|
|
954
|
+
]))), 128))], 10, Vt)), [[Q, e.expanded]]) : le("v-if", !0)]),
|
|
955
|
+
_: 1
|
|
956
|
+
})], 42, qt)), [[Q, e.node.visible]]);
|
|
957
|
+
}
|
|
958
|
+
var Yt = /* @__PURE__ */ Re(Rt, [["render", Ut]]);
|
|
959
|
+
function Wt({ el$: e }, t) {
|
|
960
|
+
const o = ae("tree");
|
|
961
|
+
Ae(() => {
|
|
962
|
+
a();
|
|
963
|
+
}), qe(() => {
|
|
964
|
+
var d;
|
|
965
|
+
(d = e.value) == null || d.querySelectorAll("input[type=checkbox]").forEach((l) => {
|
|
966
|
+
l.setAttribute("tabindex", "-1");
|
|
967
|
+
});
|
|
968
|
+
});
|
|
969
|
+
function s(d, l) {
|
|
970
|
+
var h, u;
|
|
971
|
+
const p = t.value.getNode(d[l].dataset.key);
|
|
972
|
+
return p.canFocus && p.visible && (((h = p.parent) == null ? void 0 : h.expanded) || ((u = p.parent) == null ? void 0 : u.level) === 0);
|
|
973
|
+
}
|
|
974
|
+
lt(e, "keydown", (d) => {
|
|
975
|
+
const l = d.target;
|
|
976
|
+
if (!l.className.includes(o.b("node"))) return;
|
|
977
|
+
const p = ct(d), h = Array.from(e.value.querySelectorAll(`.${o.is("focusable")}[role=treeitem]`)), u = h.indexOf(l);
|
|
978
|
+
let r;
|
|
979
|
+
if ([Z.up, Z.down].includes(p)) {
|
|
980
|
+
if (d.preventDefault(), p === Z.up) {
|
|
981
|
+
r = u === -1 ? 0 : u !== 0 ? u - 1 : h.length - 1;
|
|
982
|
+
const y = r;
|
|
983
|
+
for (; !s(h, r); ) {
|
|
984
|
+
if (r--, r === y) {
|
|
985
|
+
r = -1;
|
|
986
|
+
break;
|
|
987
|
+
}
|
|
988
|
+
r < 0 && (r = h.length - 1);
|
|
989
|
+
}
|
|
990
|
+
} else {
|
|
991
|
+
r = u === -1 ? 0 : u < h.length - 1 ? u + 1 : 0;
|
|
992
|
+
const y = r;
|
|
993
|
+
for (; !s(h, r); ) {
|
|
994
|
+
if (r++, r === y) {
|
|
995
|
+
r = -1;
|
|
996
|
+
break;
|
|
997
|
+
}
|
|
998
|
+
r >= h.length && (r = 0);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
r !== -1 && h[r].focus();
|
|
1002
|
+
}
|
|
1003
|
+
[Z.left, Z.right].includes(p) && (d.preventDefault(), l.click());
|
|
1004
|
+
const c = l.querySelector('[type="checkbox"]');
|
|
1005
|
+
[
|
|
1006
|
+
Z.enter,
|
|
1007
|
+
Z.numpadEnter,
|
|
1008
|
+
Z.space
|
|
1009
|
+
].includes(p) && c && (d.preventDefault(), c.click());
|
|
1010
|
+
});
|
|
1011
|
+
const a = () => {
|
|
1012
|
+
var p;
|
|
1013
|
+
if (!e.value) return;
|
|
1014
|
+
const d = Array.from(e.value.querySelectorAll(`.${o.is("focusable")}[role=treeitem]`));
|
|
1015
|
+
Array.from(e.value.querySelectorAll("input[type=checkbox]")).forEach((h) => {
|
|
1016
|
+
h.setAttribute("tabindex", "-1");
|
|
1017
|
+
});
|
|
1018
|
+
const l = e.value.querySelectorAll(`.${o.is("checked")}[role=treeitem]`);
|
|
1019
|
+
if (l.length) {
|
|
1020
|
+
l[0].setAttribute("tabindex", "0");
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
(p = d[0]) == null || p.setAttribute("tabindex", "0");
|
|
1024
|
+
};
|
|
1025
|
+
}
|
|
1026
|
+
var Jt = de({
|
|
1027
|
+
name: "ElTree",
|
|
1028
|
+
components: { ElTreeNode: Yt },
|
|
1029
|
+
props: Pt,
|
|
1030
|
+
emits: jt,
|
|
1031
|
+
setup(e, t) {
|
|
1032
|
+
const { t: o } = ut(), s = ae("tree"), n = w(new Ht({
|
|
1033
|
+
key: e.nodeKey,
|
|
1034
|
+
data: e.data,
|
|
1035
|
+
lazy: e.lazy,
|
|
1036
|
+
props: e.props,
|
|
1037
|
+
load: e.load,
|
|
1038
|
+
currentNodeKey: e.currentNodeKey,
|
|
1039
|
+
checkStrictly: e.checkStrictly,
|
|
1040
|
+
checkDescendants: e.checkDescendants,
|
|
1041
|
+
defaultCheckedKeys: e.defaultCheckedKeys,
|
|
1042
|
+
defaultExpandedKeys: e.defaultExpandedKeys,
|
|
1043
|
+
autoExpandParent: e.autoExpandParent,
|
|
1044
|
+
defaultExpandAll: e.defaultExpandAll,
|
|
1045
|
+
filterNodeMethod: e.filterNodeMethod
|
|
1046
|
+
}));
|
|
1047
|
+
n.value.initialize();
|
|
1048
|
+
const a = w(n.value.root), d = w(null), l = w(null), p = w(null), { broadcastExpanded: h } = Xe(e), { dragState: u } = Mt({
|
|
1049
|
+
props: e,
|
|
1050
|
+
ctx: t,
|
|
1051
|
+
el$: l,
|
|
1052
|
+
dropIndicator$: p,
|
|
1053
|
+
store: n
|
|
1054
|
+
});
|
|
1055
|
+
Wt({ el$: l }, n);
|
|
1056
|
+
const r = We(), c = Ke(() => {
|
|
1057
|
+
let i = r == null ? void 0 : r.parent;
|
|
1058
|
+
for (; i; ) {
|
|
1059
|
+
if (i.type.name === "ElTreeSelect") return !0;
|
|
1060
|
+
i = i.parent;
|
|
1061
|
+
}
|
|
1062
|
+
return !1;
|
|
1063
|
+
}), y = Ke(() => {
|
|
1064
|
+
const { childNodes: i } = a.value;
|
|
1065
|
+
return (!i || i.length === 0 || i.every(({ visible: C }) => !C)) && !c.value;
|
|
1066
|
+
});
|
|
1067
|
+
q(() => e.currentNodeKey, (i) => {
|
|
1068
|
+
n.value.setCurrentNodeKey(i ?? null);
|
|
1069
|
+
}), q(() => e.defaultCheckedKeys, (i, C) => {
|
|
1070
|
+
ht(i, C) || n.value.setDefaultCheckedKey(i ?? []);
|
|
1071
|
+
}), q(() => e.defaultExpandedKeys, (i) => {
|
|
1072
|
+
n.value.setDefaultExpandedKeys(i ?? []);
|
|
1073
|
+
}), q(() => e.data, (i) => {
|
|
1074
|
+
n.value.setData(i);
|
|
1075
|
+
}, { deep: !0 }), q(() => e.checkStrictly, (i) => {
|
|
1076
|
+
n.value.checkStrictly = i;
|
|
1077
|
+
});
|
|
1078
|
+
const E = (i) => {
|
|
1079
|
+
if (!e.filterNodeMethod) throw new Error("[Tree] filterNodeMethod is required when filter");
|
|
1080
|
+
n.value.filter(i);
|
|
1081
|
+
}, x = (i) => e.nodeKey ? Oe(e.nodeKey, i.data) : i.id, N = (i) => {
|
|
1082
|
+
if (!e.nodeKey) throw new Error(`[Tree] nodeKey is required in ${i}`);
|
|
1083
|
+
}, k = (i) => {
|
|
1084
|
+
N("getNodePath");
|
|
1085
|
+
const C = n.value.getNode(i);
|
|
1086
|
+
if (!C) return [];
|
|
1087
|
+
const K = [C.data];
|
|
1088
|
+
let z = C.parent;
|
|
1089
|
+
for (; z && z !== a.value; )
|
|
1090
|
+
K.push(z.data), z = z.parent;
|
|
1091
|
+
return K.reverse();
|
|
1092
|
+
}, S = (i, C) => n.value.getCheckedNodes(i, C), j = (i) => n.value.getCheckedKeys(i), V = () => {
|
|
1093
|
+
const i = n.value.getCurrentNode();
|
|
1094
|
+
return i ? i.data : null;
|
|
1095
|
+
}, H = () => {
|
|
1096
|
+
N("getCurrentKey");
|
|
1097
|
+
const i = V();
|
|
1098
|
+
return i ? i[e.nodeKey] : null;
|
|
1099
|
+
}, M = (i, C) => {
|
|
1100
|
+
N("setCheckedNodes"), n.value.setCheckedNodes(i, C);
|
|
1101
|
+
}, P = (i, C) => {
|
|
1102
|
+
N("setCheckedKeys"), n.value.setCheckedKeys(i, C);
|
|
1103
|
+
}, U = (i, C, K = !1) => {
|
|
1104
|
+
n.value.setChecked(i, C, K);
|
|
1105
|
+
}, v = () => n.value.getHalfCheckedNodes(), b = () => n.value.getHalfCheckedKeys(), B = (i, C = !0) => {
|
|
1106
|
+
N("setCurrentNode"), Te(n, t.emit, () => {
|
|
1107
|
+
h(i), n.value.setUserCurrentNode(i, C);
|
|
1108
|
+
});
|
|
1109
|
+
}, O = (i = null, C = !0) => {
|
|
1110
|
+
N("setCurrentKey"), Te(n, t.emit, () => {
|
|
1111
|
+
h(), n.value.setCurrentNodeKey(i, C);
|
|
1112
|
+
});
|
|
1113
|
+
}, te = (i) => n.value.getNode(i), W = (i) => {
|
|
1114
|
+
n.value.remove(i);
|
|
1115
|
+
}, J = (i, C) => {
|
|
1116
|
+
n.value.append(i, C);
|
|
1117
|
+
}, ie = (i, C) => {
|
|
1118
|
+
n.value.insertBefore(i, C);
|
|
1119
|
+
}, f = (i, C) => {
|
|
1120
|
+
n.value.insertAfter(i, C);
|
|
1121
|
+
}, g = (i, C, K) => {
|
|
1122
|
+
h(C), t.emit("node-expand", i, C, K);
|
|
1123
|
+
}, _ = (i, C) => {
|
|
1124
|
+
N("updateKeyChildren"), n.value.updateChildren(i, C);
|
|
1125
|
+
};
|
|
1126
|
+
return pe(Le, {
|
|
1127
|
+
ctx: t,
|
|
1128
|
+
props: e,
|
|
1129
|
+
store: n,
|
|
1130
|
+
root: a,
|
|
1131
|
+
currentNode: d,
|
|
1132
|
+
instance: r
|
|
1133
|
+
}), pe(ft, void 0), {
|
|
1134
|
+
ns: s,
|
|
1135
|
+
store: n,
|
|
1136
|
+
root: a,
|
|
1137
|
+
currentNode: d,
|
|
1138
|
+
dragState: u,
|
|
1139
|
+
el$: l,
|
|
1140
|
+
dropIndicator$: p,
|
|
1141
|
+
isEmpty: y,
|
|
1142
|
+
filter: E,
|
|
1143
|
+
getNodeKey: x,
|
|
1144
|
+
getNodePath: k,
|
|
1145
|
+
getCheckedNodes: S,
|
|
1146
|
+
getCheckedKeys: j,
|
|
1147
|
+
getCurrentNode: V,
|
|
1148
|
+
getCurrentKey: H,
|
|
1149
|
+
setCheckedNodes: M,
|
|
1150
|
+
setCheckedKeys: P,
|
|
1151
|
+
setChecked: U,
|
|
1152
|
+
getHalfCheckedNodes: v,
|
|
1153
|
+
getHalfCheckedKeys: b,
|
|
1154
|
+
setCurrentNode: B,
|
|
1155
|
+
setCurrentKey: O,
|
|
1156
|
+
t: o,
|
|
1157
|
+
getNode: te,
|
|
1158
|
+
remove: W,
|
|
1159
|
+
append: J,
|
|
1160
|
+
insertBefore: ie,
|
|
1161
|
+
insertAfter: f,
|
|
1162
|
+
handleNodeExpand: g,
|
|
1163
|
+
updateKeyChildren: _
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
function Gt(e, t, o, s, n, a) {
|
|
1168
|
+
const d = oe("el-tree-node");
|
|
1169
|
+
return I(), $("div", {
|
|
1170
|
+
ref: "el$",
|
|
1171
|
+
class: F([
|
|
1172
|
+
e.ns.b(),
|
|
1173
|
+
e.ns.is("dragging", !!e.dragState.draggingNode),
|
|
1174
|
+
e.ns.is("drop-not-allow", !e.dragState.allowDrop),
|
|
1175
|
+
e.ns.is("drop-inner", e.dragState.dropType === "inner"),
|
|
1176
|
+
{ [e.ns.m("highlight-current")]: e.highlightCurrent }
|
|
1177
|
+
]),
|
|
1178
|
+
role: "tree"
|
|
1179
|
+
}, [
|
|
1180
|
+
(I(!0), $(ue, null, he(e.root.childNodes, (l) => (I(), Y(d, {
|
|
1181
|
+
key: e.getNodeKey(l),
|
|
1182
|
+
node: l,
|
|
1183
|
+
props: e.props,
|
|
1184
|
+
accordion: e.accordion,
|
|
1185
|
+
"render-after-expand": e.renderAfterExpand,
|
|
1186
|
+
"show-checkbox": e.showCheckbox,
|
|
1187
|
+
"render-content": e.renderContent,
|
|
1188
|
+
onNodeExpand: e.handleNodeExpand
|
|
1189
|
+
}, null, 8, [
|
|
1190
|
+
"node",
|
|
1191
|
+
"props",
|
|
1192
|
+
"accordion",
|
|
1193
|
+
"render-after-expand",
|
|
1194
|
+
"show-checkbox",
|
|
1195
|
+
"render-content",
|
|
1196
|
+
"onNodeExpand"
|
|
1197
|
+
]))), 128)),
|
|
1198
|
+
e.isEmpty ? (I(), $("div", {
|
|
1199
|
+
key: 0,
|
|
1200
|
+
class: F(e.ns.e("empty-block"))
|
|
1201
|
+
}, [be(e.$slots, "empty", {}, () => [D("span", { class: F(e.ns.e("empty-text")) }, R(e.emptyText ?? e.t("el.tree.emptyText")), 3)])], 2)) : le("v-if", !0),
|
|
1202
|
+
G(D("div", {
|
|
1203
|
+
ref: "dropIndicator$",
|
|
1204
|
+
class: F(e.ns.e("drop-indicator"))
|
|
1205
|
+
}, null, 2), [[Q, e.dragState.showDropIndicator]])
|
|
1206
|
+
], 2);
|
|
1207
|
+
}
|
|
1208
|
+
var Qt = /* @__PURE__ */ Re(Jt, [["render", Gt]]);
|
|
1209
|
+
const Xt = Be(Qt), Zt = {
|
|
1210
|
+
key: 0,
|
|
1211
|
+
class: "panel_content"
|
|
1212
|
+
}, en = { class: "types" }, tn = ["onClick"], nn = { class: "tree" }, on = {
|
|
1213
|
+
key: 1,
|
|
1214
|
+
class: "panel_content_null"
|
|
1215
|
+
}, sn = { class: "pc_tree_type_button" }, an = ["onClick"], rn = { class: "pc_tree_content" }, dn = { class: "tree-search-box" }, ln = { class: "tree-wrapper" }, cn = ["id"], un = { class: "tree-wrapper" }, hn = ["id"], fn = { class: "tree-wrapper" }, pn = ["id"], yn = {
|
|
1216
|
+
key: 2,
|
|
1217
|
+
class: "operate-tree-box"
|
|
1218
|
+
}, vn = { class: "operate-tree" }, gn = { class: "tree-title-box" }, kn = { class: "tree-title" }, Nn = { class: "tree-title-icon" }, Cn = { class: "tree-category-box" }, mn = { class: "tree-category-list" }, bn = ["onClick"], _n = { class: "tree-search-box" }, En = { class: "tree-content" }, xn = { class: "tree-wrapper" }, Dn = ["id"], wn = { class: "tree-wrapper" }, Kn = ["id"], Tn = { class: "tree-wrapper" }, In = ["id"], Sn = /* @__PURE__ */ de({
|
|
1219
|
+
__name: "StructureTree",
|
|
1220
|
+
props: ["componentId"],
|
|
1221
|
+
emits: ["closePanel", "emitHandler"],
|
|
1222
|
+
setup(e, { emit: t }) {
|
|
1223
|
+
const o = pt(), s = yt(), n = e, a = w(!1), d = w(!1), l = w(), p = w(), h = w(), u = w(), r = w(0), c = w(), y = w(), E = w(), x = w(), N = w();
|
|
1224
|
+
let k;
|
|
1225
|
+
const S = w(""), j = w(""), V = w("");
|
|
1226
|
+
q(
|
|
1227
|
+
() => s.isToolActive(n.componentId),
|
|
1228
|
+
(f) => {
|
|
1229
|
+
if (a.value && f) {
|
|
1230
|
+
if (d.value || O(ke[0]), j.value == V.value || j.value == "")
|
|
1231
|
+
return;
|
|
1232
|
+
B(j.value);
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
), q(S, (f) => {
|
|
1236
|
+
var g, _, i;
|
|
1237
|
+
r.value === 0 ? (g = l.value) == null || g.filter(f) : r.value === 1 ? (_ = p.value) == null || _.filter(f) : r.value === 2 && ((i = h.value) == null || i.filter(f));
|
|
1238
|
+
});
|
|
1239
|
+
const H = (f, g) => f ? g.title.includes(S.value) : !0, M = {
|
|
1240
|
+
children: "children",
|
|
1241
|
+
label: "title",
|
|
1242
|
+
value: "nodeId"
|
|
1243
|
+
}, P = t, U = (f) => {
|
|
1244
|
+
P("emitHandler", f);
|
|
1245
|
+
}, v = w(!1);
|
|
1246
|
+
Ae(() => {
|
|
1247
|
+
ne("userInfo").isInShare && ne("userInfo").isShareClient && (v.value = !0), s.setReadyById(n.componentId);
|
|
1248
|
+
});
|
|
1249
|
+
const b = () => {
|
|
1250
|
+
d.value = !1, k = window.bimViewer;
|
|
1251
|
+
const { eventTrigger: f } = k;
|
|
1252
|
+
f.on("treeAllReady", (g) => {
|
|
1253
|
+
a.value = !0, u.value = g, console.log("[Bimx Engine] 结构树数据已就绪"), k.SetShowSpaceModeActive(!1);
|
|
1254
|
+
}), ne("isMobile") || f.on("pickedEntity", (g) => {
|
|
1255
|
+
d.value && (j.value = g.id, s.isToolActive(n.componentId) && B(g.id));
|
|
1256
|
+
}), ne("isMobile") && (f.on("touchEntity", (g) => {
|
|
1257
|
+
d.value !== !1 && (j.value = g.id, s.isToolActive(n.componentId) && B(g.id));
|
|
1258
|
+
}), f.on("touchNothing", () => {
|
|
1259
|
+
re(() => {
|
|
1260
|
+
N.value = "";
|
|
1261
|
+
}), U({
|
|
1262
|
+
isTool: !0,
|
|
1263
|
+
event_target: "StructureTree",
|
|
1264
|
+
event_name: "touchNothing",
|
|
1265
|
+
content: {
|
|
1266
|
+
msg: "pickedNothing"
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
}));
|
|
1270
|
+
};
|
|
1271
|
+
ge.on("BimViewer", b), Ye(() => {
|
|
1272
|
+
ge.off("BimViewer", b);
|
|
1273
|
+
});
|
|
1274
|
+
const B = (f) => {
|
|
1275
|
+
let g, _;
|
|
1276
|
+
r.value === 0 ? g = k.objectsExplorer.objectList[f] ? k.objectsExplorer.objectList[f] : null : r.value === 1 ? g = k.classesExplorer.objectList[f] ? k.classesExplorer.objectList[f] : null : r.value === 2 && (g = k.storeysExplorer.objectList[f] ? k.storeysExplorer.objectList[f] : null), g && (N.value = g.nodeId, r.value === 0 ? (l.value.setCurrentKey(g.nodeId, !0), _ = document.getElementById(g.nodeId + "0")) : r.value === 1 ? (p.value.setCurrentKey(g.nodeId, !0), _ = document.getElementById(g.nodeId + "1")) : r.value === 2 && (h.value.setCurrentKey(g.nodeId, !0), _ = document.getElementById(g.nodeId + "2")), setTimeout(() => {
|
|
1277
|
+
_ && re(() => {
|
|
1278
|
+
_.scrollIntoView({ block: "center" });
|
|
1279
|
+
});
|
|
1280
|
+
}, 200), V.value = f, U({
|
|
1281
|
+
isTool: !0,
|
|
1282
|
+
event_target: "StructureTree",
|
|
1283
|
+
event_name: "pickedEntity",
|
|
1284
|
+
content: {
|
|
1285
|
+
entityId: f,
|
|
1286
|
+
viewer_nodeId: g.nodeId
|
|
1287
|
+
}
|
|
1288
|
+
}));
|
|
1289
|
+
}, O = (f) => {
|
|
1290
|
+
if (u.value) {
|
|
1291
|
+
if (f.id == 0) {
|
|
1292
|
+
if (!y.value) {
|
|
1293
|
+
if (y.value = u.value.objectsData ? u.value.objectsData : [], y.value[0]) {
|
|
1294
|
+
y.value[0].title = o("structure.all");
|
|
1295
|
+
const g = y.value.map((_) => _.nodeId);
|
|
1296
|
+
l.value.setCheckedKeys(g);
|
|
1297
|
+
}
|
|
1298
|
+
d.value = !0;
|
|
1299
|
+
}
|
|
1300
|
+
} else if (f.id == 1) {
|
|
1301
|
+
if (!x.value && (E.value = u.value.classesData ? u.value.classesData : [], E.value[0])) {
|
|
1302
|
+
E.value[0].title = o("structure.all");
|
|
1303
|
+
const g = E.value.map((_) => _.nodeId);
|
|
1304
|
+
p.value.setCheckedKeys(g);
|
|
1305
|
+
}
|
|
1306
|
+
} else if (f.id == 2 && !x.value && (x.value = u.value.storeysData ? u.value.storeysData : [], x.value[0])) {
|
|
1307
|
+
x.value[0].title = o("structure.all");
|
|
1308
|
+
const g = x.value.map((_) => _.nodeId);
|
|
1309
|
+
h.value.setCheckedKeys(g);
|
|
1310
|
+
}
|
|
1311
|
+
U({
|
|
1312
|
+
isTool: !0,
|
|
1313
|
+
event_target: "StructureTree",
|
|
1314
|
+
event_name: "changeTreeStructure",
|
|
1315
|
+
content: {
|
|
1316
|
+
item: f
|
|
1317
|
+
}
|
|
1318
|
+
}), r.value !== f.id && (r.value = f.id);
|
|
1319
|
+
}
|
|
1320
|
+
};
|
|
1321
|
+
let te = [];
|
|
1322
|
+
const W = (f, g) => {
|
|
1323
|
+
te.includes(f.nodeId) ? f.checked = !0 : f.checked = !f.checked;
|
|
1324
|
+
const _ = k.viewer.scene.objects[f.objectId];
|
|
1325
|
+
_ ? k.setEntityVisible(_, f.checked) : i(f, f.checked), C(f, f.checked), U({
|
|
1326
|
+
isTool: !0,
|
|
1327
|
+
event_target: "StructureTree",
|
|
1328
|
+
event_name: "clickTreeBox",
|
|
1329
|
+
content: {
|
|
1330
|
+
active_tree: r.value,
|
|
1331
|
+
nodeId: f.nodeId,
|
|
1332
|
+
status: f.checked
|
|
1333
|
+
}
|
|
1334
|
+
});
|
|
1335
|
+
function i(K, z) {
|
|
1336
|
+
if (K.checked = z, K.children.length == 0) {
|
|
1337
|
+
const X = k.viewer.scene.objects[K.objectId];
|
|
1338
|
+
X && k.setEntityVisible(X, K.checked);
|
|
1339
|
+
} else
|
|
1340
|
+
for (let X = 0; X < K.children.length; X++)
|
|
1341
|
+
i(K.children[X], z);
|
|
1342
|
+
}
|
|
1343
|
+
function C(K, z) {
|
|
1344
|
+
K.checked = z, K.parent && C(K.parent, z);
|
|
1345
|
+
}
|
|
1346
|
+
te = g.halfCheckedKeys;
|
|
1347
|
+
}, J = (f, g) => {
|
|
1348
|
+
const _ = k.viewer.scene.objects[f.objectId];
|
|
1349
|
+
_ && (k.setAllObjectsSelected(!1), k.setEntitySelected(_), k.viewFitEntity(_)), ge.emit("tree_clickNode", _), U({
|
|
1350
|
+
isTool: !0,
|
|
1351
|
+
event_target: "StructureTree",
|
|
1352
|
+
event_name: "clickTreeNode",
|
|
1353
|
+
content: {
|
|
1354
|
+
active_tree: r.value,
|
|
1355
|
+
objectId: f.objectId
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
}, ie = () => {
|
|
1359
|
+
ge.emit("hideToolbar", !1), P("closePanel");
|
|
1360
|
+
};
|
|
1361
|
+
return (f, g) => {
|
|
1362
|
+
const _ = Xt, i = Kt, C = vt, K = gt, z = Ct, X = kt;
|
|
1363
|
+
return !T(ne)("isMobile") && T(je).currentTheme == "blue" ? (I(), Y(i, {
|
|
1364
|
+
key: 0,
|
|
1365
|
+
class: "web_tree_container",
|
|
1366
|
+
width: 268,
|
|
1367
|
+
panelTitle: T(o)("structure.title"),
|
|
1368
|
+
"click-handle": ie
|
|
1369
|
+
}, {
|
|
1370
|
+
default: L(() => [
|
|
1371
|
+
d.value ? (I(), $("div", Zt, [
|
|
1372
|
+
D("div", en, [
|
|
1373
|
+
(I(!0), $(ue, null, he(T(ke), (m) => (I(), $("div", {
|
|
1374
|
+
key: m.id,
|
|
1375
|
+
class: F(["types-item", { "types-item-active": r.value === m.id }]),
|
|
1376
|
+
onClick: (_e) => O(m)
|
|
1377
|
+
}, R(T(o)(m.name)), 11, tn))), 128))
|
|
1378
|
+
]),
|
|
1379
|
+
D("div", nn, [
|
|
1380
|
+
A(_, {
|
|
1381
|
+
ref: "tree",
|
|
1382
|
+
height: 700,
|
|
1383
|
+
"node-key": "nodeId",
|
|
1384
|
+
data: c.value,
|
|
1385
|
+
"current-node-key": N.value,
|
|
1386
|
+
"highlight-current": !0,
|
|
1387
|
+
props: M,
|
|
1388
|
+
"show-checkbox": "",
|
|
1389
|
+
onCheck: W,
|
|
1390
|
+
onNodeClick: J,
|
|
1391
|
+
"empty-text": T(o)("common.noData")
|
|
1392
|
+
}, null, 8, ["data", "current-node-key", "empty-text"])
|
|
1393
|
+
])
|
|
1394
|
+
])) : (I(), $("div", on, [
|
|
1395
|
+
D("span", null, R(T(o)("common.loading")), 1)
|
|
1396
|
+
]))
|
|
1397
|
+
]),
|
|
1398
|
+
_: 1
|
|
1399
|
+
}, 8, ["panelTitle"])) : !T(ne)("isMobile") && T(je).currentTheme == "light-gray" ? (I(), Y(z, {
|
|
1400
|
+
key: 1,
|
|
1401
|
+
class: "pc_structure_container",
|
|
1402
|
+
width: 286,
|
|
1403
|
+
panelTitle: T(o)("structure.title"),
|
|
1404
|
+
"click-handle": ie,
|
|
1405
|
+
pos: T(ne)("treePos"),
|
|
1406
|
+
setWidth: ""
|
|
1407
|
+
}, {
|
|
1408
|
+
default: L(() => [
|
|
1409
|
+
D("div", sn, [
|
|
1410
|
+
(I(!0), $(ue, null, he(T(ke), (m) => (I(), $("div", {
|
|
1411
|
+
key: m.id,
|
|
1412
|
+
class: F(["type_button", { type_button_active: r.value === m.id }]),
|
|
1413
|
+
onClick: (_e) => O(m)
|
|
1414
|
+
}, R(T(o)(m.name)), 11, an))), 128))
|
|
1415
|
+
]),
|
|
1416
|
+
D("div", rn, [
|
|
1417
|
+
D("div", dn, [
|
|
1418
|
+
A(C, {
|
|
1419
|
+
modelValue: S.value,
|
|
1420
|
+
"onUpdate:modelValue": g[0] || (g[0] = (m) => S.value = m),
|
|
1421
|
+
placeholder: T(o)("structure.search"),
|
|
1422
|
+
"prefix-icon": "Search",
|
|
1423
|
+
clearable: ""
|
|
1424
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
1425
|
+
]),
|
|
1426
|
+
G(D("div", ln, [
|
|
1427
|
+
A(K, null, {
|
|
1428
|
+
default: L(() => [
|
|
1429
|
+
A(_, {
|
|
1430
|
+
ref_key: "tree0",
|
|
1431
|
+
ref: l,
|
|
1432
|
+
"node-key": "nodeId",
|
|
1433
|
+
data: y.value,
|
|
1434
|
+
"current-node-key": N.value,
|
|
1435
|
+
"highlight-current": !0,
|
|
1436
|
+
props: M,
|
|
1437
|
+
"filter-node-method": H,
|
|
1438
|
+
"show-checkbox": "",
|
|
1439
|
+
onCheck: W,
|
|
1440
|
+
onNodeClick: J,
|
|
1441
|
+
"empty-text": T(o)("common.noData")
|
|
1442
|
+
}, {
|
|
1443
|
+
default: L(({ node: m }) => [
|
|
1444
|
+
D("span", {
|
|
1445
|
+
id: m.key + "0",
|
|
1446
|
+
class: "tree_node_text"
|
|
1447
|
+
}, R(m.data.title), 9, cn)
|
|
1448
|
+
]),
|
|
1449
|
+
_: 1
|
|
1450
|
+
}, 8, ["data", "current-node-key", "empty-text"])
|
|
1451
|
+
]),
|
|
1452
|
+
_: 1
|
|
1453
|
+
})
|
|
1454
|
+
], 512), [
|
|
1455
|
+
[Q, r.value == 0]
|
|
1456
|
+
]),
|
|
1457
|
+
G(D("div", un, [
|
|
1458
|
+
A(K, null, {
|
|
1459
|
+
default: L(() => [
|
|
1460
|
+
A(_, {
|
|
1461
|
+
ref_key: "tree1",
|
|
1462
|
+
ref: p,
|
|
1463
|
+
"node-key": "nodeId",
|
|
1464
|
+
data: E.value,
|
|
1465
|
+
"current-node-key": N.value,
|
|
1466
|
+
"highlight-current": !0,
|
|
1467
|
+
props: M,
|
|
1468
|
+
"filter-node-method": H,
|
|
1469
|
+
"show-checkbox": "",
|
|
1470
|
+
onCheck: W,
|
|
1471
|
+
onNodeClick: J,
|
|
1472
|
+
"empty-text": T(o)("common.noData")
|
|
1473
|
+
}, {
|
|
1474
|
+
default: L(({ node: m }) => [
|
|
1475
|
+
D("span", {
|
|
1476
|
+
id: m.key + "1",
|
|
1477
|
+
class: "tree_node_text"
|
|
1478
|
+
}, R(m.data.title), 9, hn)
|
|
1479
|
+
]),
|
|
1480
|
+
_: 1
|
|
1481
|
+
}, 8, ["data", "current-node-key", "empty-text"])
|
|
1482
|
+
]),
|
|
1483
|
+
_: 1
|
|
1484
|
+
})
|
|
1485
|
+
], 512), [
|
|
1486
|
+
[Q, r.value == 1]
|
|
1487
|
+
]),
|
|
1488
|
+
G(D("div", fn, [
|
|
1489
|
+
A(K, null, {
|
|
1490
|
+
default: L(() => [
|
|
1491
|
+
A(_, {
|
|
1492
|
+
ref_key: "tree2",
|
|
1493
|
+
ref: h,
|
|
1494
|
+
"node-key": "nodeId",
|
|
1495
|
+
data: x.value,
|
|
1496
|
+
"current-node-key": N.value,
|
|
1497
|
+
"highlight-current": !0,
|
|
1498
|
+
props: M,
|
|
1499
|
+
"filter-node-method": H,
|
|
1500
|
+
"show-checkbox": "",
|
|
1501
|
+
onCheck: W,
|
|
1502
|
+
onNodeClick: J,
|
|
1503
|
+
"empty-text": T(o)("common.noData")
|
|
1504
|
+
}, {
|
|
1505
|
+
default: L(({ node: m }) => [
|
|
1506
|
+
D("span", {
|
|
1507
|
+
id: m.key + "2",
|
|
1508
|
+
class: "tree_node_text"
|
|
1509
|
+
}, R(m.data.title), 9, pn)
|
|
1510
|
+
]),
|
|
1511
|
+
_: 1
|
|
1512
|
+
}, 8, ["data", "current-node-key", "empty-text"])
|
|
1513
|
+
]),
|
|
1514
|
+
_: 1
|
|
1515
|
+
})
|
|
1516
|
+
], 512), [
|
|
1517
|
+
[Q, r.value == 2]
|
|
1518
|
+
])
|
|
1519
|
+
])
|
|
1520
|
+
]),
|
|
1521
|
+
_: 1
|
|
1522
|
+
}, 8, ["panelTitle", "pos"])) : (I(), $("div", yn, [
|
|
1523
|
+
D("div", vn, [
|
|
1524
|
+
D("div", gn, [
|
|
1525
|
+
D("div", kn, R(T(o)("structure.title")), 1),
|
|
1526
|
+
D("div", Nn, [
|
|
1527
|
+
A(X, {
|
|
1528
|
+
class: "close",
|
|
1529
|
+
width: 0.4,
|
|
1530
|
+
"size-type": "rem",
|
|
1531
|
+
"click-handle": ie
|
|
1532
|
+
})
|
|
1533
|
+
])
|
|
1534
|
+
]),
|
|
1535
|
+
D("div", Cn, [
|
|
1536
|
+
A(K, null, {
|
|
1537
|
+
default: L(() => [
|
|
1538
|
+
D("div", mn, [
|
|
1539
|
+
(I(!0), $(ue, null, he(T(ke), (m, _e) => (I(), $("div", {
|
|
1540
|
+
key: _e,
|
|
1541
|
+
class: F(["tree-category-item", {
|
|
1542
|
+
"tree-category-item-active": m.id === r.value
|
|
1543
|
+
}]),
|
|
1544
|
+
onClick: (Bn) => O(m)
|
|
1545
|
+
}, R(T(o)(m.name)), 11, bn))), 128))
|
|
1546
|
+
])
|
|
1547
|
+
]),
|
|
1548
|
+
_: 1
|
|
1549
|
+
})
|
|
1550
|
+
]),
|
|
1551
|
+
D("div", _n, [
|
|
1552
|
+
A(C, {
|
|
1553
|
+
modelValue: S.value,
|
|
1554
|
+
"onUpdate:modelValue": g[1] || (g[1] = (m) => S.value = m),
|
|
1555
|
+
placeholder: T(o)("structure.search"),
|
|
1556
|
+
"prefix-icon": "Search",
|
|
1557
|
+
clearable: ""
|
|
1558
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
1559
|
+
]),
|
|
1560
|
+
D("div", En, [
|
|
1561
|
+
G(D("div", xn, [
|
|
1562
|
+
A(K, null, {
|
|
1563
|
+
default: L(() => [
|
|
1564
|
+
A(_, {
|
|
1565
|
+
ref_key: "tree0",
|
|
1566
|
+
ref: l,
|
|
1567
|
+
"node-key": "nodeId",
|
|
1568
|
+
data: y.value,
|
|
1569
|
+
"current-node-key": N.value,
|
|
1570
|
+
"highlight-current": !0,
|
|
1571
|
+
props: M,
|
|
1572
|
+
"filter-node-method": H,
|
|
1573
|
+
"show-checkbox": "",
|
|
1574
|
+
onCheck: W,
|
|
1575
|
+
onNodeClick: J,
|
|
1576
|
+
"empty-text": T(o)("common.noData")
|
|
1577
|
+
}, {
|
|
1578
|
+
default: L(({ node: m }) => [
|
|
1579
|
+
D("span", {
|
|
1580
|
+
id: m.key + "0",
|
|
1581
|
+
class: "tree_node_text"
|
|
1582
|
+
}, R(m.data.title), 9, Dn)
|
|
1583
|
+
]),
|
|
1584
|
+
_: 1
|
|
1585
|
+
}, 8, ["data", "current-node-key", "empty-text"])
|
|
1586
|
+
]),
|
|
1587
|
+
_: 1
|
|
1588
|
+
})
|
|
1589
|
+
], 512), [
|
|
1590
|
+
[Q, r.value == 0]
|
|
1591
|
+
]),
|
|
1592
|
+
G(D("div", wn, [
|
|
1593
|
+
A(K, null, {
|
|
1594
|
+
default: L(() => [
|
|
1595
|
+
A(_, {
|
|
1596
|
+
ref_key: "tree1",
|
|
1597
|
+
ref: p,
|
|
1598
|
+
"node-key": "nodeId",
|
|
1599
|
+
data: E.value,
|
|
1600
|
+
"current-node-key": N.value,
|
|
1601
|
+
"highlight-current": !0,
|
|
1602
|
+
props: M,
|
|
1603
|
+
"filter-node-method": H,
|
|
1604
|
+
"show-checkbox": "",
|
|
1605
|
+
onCheck: W,
|
|
1606
|
+
onNodeClick: J,
|
|
1607
|
+
"empty-text": T(o)("common.noData")
|
|
1608
|
+
}, {
|
|
1609
|
+
default: L(({ node: m }) => [
|
|
1610
|
+
D("span", {
|
|
1611
|
+
id: m.key + "1",
|
|
1612
|
+
class: "tree_node_text"
|
|
1613
|
+
}, R(m.data.title), 9, Kn)
|
|
1614
|
+
]),
|
|
1615
|
+
_: 1
|
|
1616
|
+
}, 8, ["data", "current-node-key", "empty-text"])
|
|
1617
|
+
]),
|
|
1618
|
+
_: 1
|
|
1619
|
+
})
|
|
1620
|
+
], 512), [
|
|
1621
|
+
[Q, r.value == 1]
|
|
1622
|
+
]),
|
|
1623
|
+
G(D("div", Tn, [
|
|
1624
|
+
A(K, null, {
|
|
1625
|
+
default: L(() => [
|
|
1626
|
+
A(_, {
|
|
1627
|
+
ref_key: "tree2",
|
|
1628
|
+
ref: h,
|
|
1629
|
+
"node-key": "nodeId",
|
|
1630
|
+
data: x.value,
|
|
1631
|
+
"current-node-key": N.value,
|
|
1632
|
+
"highlight-current": !0,
|
|
1633
|
+
props: M,
|
|
1634
|
+
"filter-node-method": H,
|
|
1635
|
+
"show-checkbox": "",
|
|
1636
|
+
onCheck: W,
|
|
1637
|
+
onNodeClick: J,
|
|
1638
|
+
"empty-text": T(o)("common.noData")
|
|
1639
|
+
}, {
|
|
1640
|
+
default: L(({ node: m }) => [
|
|
1641
|
+
D("span", {
|
|
1642
|
+
id: m.key + "2",
|
|
1643
|
+
class: "tree_node_text"
|
|
1644
|
+
}, R(m.data.title), 9, In)
|
|
1645
|
+
]),
|
|
1646
|
+
_: 1
|
|
1647
|
+
}, 8, ["data", "current-node-key", "empty-text"])
|
|
1648
|
+
]),
|
|
1649
|
+
_: 1
|
|
1650
|
+
})
|
|
1651
|
+
], 512), [
|
|
1652
|
+
[Q, r.value == 2]
|
|
1653
|
+
])
|
|
1654
|
+
])
|
|
1655
|
+
])
|
|
1656
|
+
]));
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
}), Hn = /* @__PURE__ */ Nt(Sn, [["__scopeId", "data-v-70f2d3c0"]]);
|
|
1660
|
+
export {
|
|
1661
|
+
Hn as default
|
|
1662
|
+
};
|