@web-utils/component 2.70.0 → 3.0.1
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/address-input/index.mjs +16 -14
- package/awesome-button/index.mjs +30 -29
- package/card/index.mjs +42 -40
- package/carousel/index.mjs +27 -25
- package/chat/index.mjs +70 -59
- package/chunk-file-uploader/index.mjs +594 -35
- package/chunk-file-uploader/style.css +1 -1
- package/chunks/CountUp.f1a19f35.mjs +124 -0
- package/chunks/CountUp.vue_vue_type_template_lang.1f68c96e.mjs +8 -0
- package/chunks/EasyPopup.vue_vue_type_style_index_0_lang.89350bda.mjs +32 -0
- package/chunks/EditableTree.vue_vue_type_style_index_0_lang.5dba9f89.mjs +356 -0
- package/chunks/ElementDialog.d8f3105c.mjs +211 -0
- package/chunks/ElementDialog.vue_vue_type_style_index_0_lang.57cb8e07.mjs +95 -0
- package/chunks/EmptyView.e2430422.mjs +51 -0
- package/chunks/EmptyView.vue_vue_type_style_index_0_lang.ffa84770.mjs +23 -0
- package/chunks/FlowNode.vue_vue_type_template_lang.662bdcfa.mjs +37 -0
- package/chunks/FormInput.vue_vue_type_template_lang.3cb79386.mjs +65 -0
- package/chunks/FormItem.2920ac0c.mjs +45 -0
- package/chunks/FormItem.vue_vue_type_style_index_0_lang.970bd712.mjs +258 -0
- package/chunks/FormItemGroup.41daddb6.mjs +64 -0
- package/chunks/FormItemGroup.vue_vue_type_style_index_0_lang.b588a8ea.mjs +155 -0
- package/chunks/FyCurd.8acd2983.mjs +548 -0
- package/chunks/FyCurd.vue_vue_type_style_index_0_lang.4fbd4b30.mjs +2945 -0
- package/chunks/FyDate.vue_vue_type_style_index_0_lang.429c03e3.mjs +47 -0
- package/chunks/FyDynamic.vue_vue_type_style_index_0_lang.304417ce.mjs +151 -0
- package/chunks/FyEmpty.vue_vue_type_style_index_0_lang.fc8bd24c.mjs +22 -0
- package/chunks/FyForm.0294e494.mjs +439 -0
- package/chunks/FyForm.vue_vue_type_style_index_0_lang.6e64daee.mjs +737 -0
- package/chunks/FyInput.vue_vue_type_template_lang.d2c56811.mjs +93 -0
- package/chunks/FyInputColor.vue_vue_type_template_lang.6eca0ddd.mjs +56 -0
- package/chunks/FyInputIcon.vue_vue_type_style_index_0_lang.11a6a221.mjs +158 -0
- package/chunks/FyRate.vue_vue_type_style_index_0_lang.82174185.mjs +39 -0
- package/chunks/FySelect.vue_vue_type_style_index_0_lang.5f0f3244.mjs +102 -0
- package/chunks/FyTabs.vue_vue_type_template_lang.66af5ac9.mjs +41 -0
- package/chunks/HighlightJS.vue_vue_type_style_index_0_lang.fefeaa3b.mjs +15 -0
- package/chunks/IconTemp.42c48e1f.mjs +32 -0
- package/chunks/IconTemp.vue_vue_type_style_index_0_lang.a0777b31.mjs +23 -0
- package/chunks/InputNumber.vue_vue_type_style_index_0_lang.18046bd3.mjs +172 -0
- package/chunks/LoadingView.vue_vue_type_style_index_0_lang.4c3fff2a.mjs +23 -0
- package/chunks/NavBar.vue_vue_type_style_index_0_lang.e21b57f3.mjs +21 -0
- package/chunks/Page.81f4b8d9.mjs +32 -0
- package/chunks/Page.vue_vue_type_style_index_0_lang.cb4f9bf2.mjs +13 -0
- package/chunks/PageHeader.vue_vue_type_style_index_0_lang.3bcca5aa.mjs +26 -0
- package/chunks/PageSkeleton.vue_vue_type_style_index_0_lang.8621381f.mjs +88 -0
- package/chunks/PageableTable.333cbdc1.mjs +335 -0
- package/chunks/PageableTable.vue_vue_type_style_index_0_lang.fd89fb43.mjs +148 -0
- package/chunks/ResizeObserver.60f728f0.mjs +54 -0
- package/chunks/ResizeObserver.vue_vue_type_style_index_0_lang.7079029c.mjs +13 -0
- package/chunks/TableColumn.8503272e.mjs +106 -0
- package/chunks/Toolbar.5c539dbb.mjs +24 -0
- package/chunks/Toolbar.vue_vue_type_style_index_0_lang.7594243c.mjs +275 -0
- package/chunks/ToolbarButton.vue_vue_type_style_index_0_lang.e2cb14ba.mjs +31 -0
- package/chunks/XInputTag.vue_vue_type_style_index_0_lang.7ad045b3.mjs +74 -0
- package/chunks/confirmable-mixin.26e1d0e0.mjs +197 -0
- package/chunks/{dataformat.f995e2f9.mjs → dataformat.816df805.mjs} +5 -5
- package/chunks/{dic.eaac0823.mjs → dic.3b4ba802.mjs} +40 -40
- package/chunks/{event.b5d855dd.mjs → event.4377230d.mjs} +2 -2
- package/chunks/{index.57f871af.mjs → index.d91bd77a.mjs} +7 -7
- package/chunks/{init.47f219b4.mjs → init.f0a03127.mjs} +2 -2
- package/chunks/{util.ae730cde.mjs → util.7844e2c2.mjs} +21 -21
- package/color-picker/index.mjs +200 -32
- package/confirm-button/index.mjs +1 -1
- package/confirmable/index.mjs +1 -1
- package/count-up/index.mjs +14 -17
- package/data-box/index.mjs +36 -33
- package/data-card/index.mjs +35 -33
- package/data-cardtext/index.mjs +29 -27
- package/data-display/index.mjs +37 -34
- package/data-icons/index.mjs +32 -29
- package/data-imgtext/index.mjs +30 -27
- package/data-operatext/index.mjs +41 -39
- package/data-panel/index.mjs +39 -36
- package/data-pay/index.mjs +26 -22
- package/data-price/index.mjs +34 -32
- package/data-progress/index.mjs +32 -28
- package/data-rotate/index.mjs +38 -35
- package/data-table-picker/index.mjs +25 -22
- package/data-tabs/index.mjs +35 -32
- package/dialog-form/index.mjs +41 -32
- package/dynamic-table/index.mjs +47 -42
- package/easy-popup/index.mjs +29 -56
- package/editable-progress/index.mjs +16 -14
- package/editable-tree/index.mjs +129 -476
- package/egd-collapse-item/index.mjs +1 -2
- package/element-dialog/index.mjs +37 -126
- package/empty-view/index.mjs +13 -31
- package/flex-column/index.mjs +1 -1
- package/flex-item/index.mjs +1 -1
- package/flex-row/index.mjs +1 -1
- package/flow/index.mjs +105 -40
- package/flow-designer/index.mjs +1190 -1114
- package/flow-node/index.mjs +15 -47
- package/flow-viewer/index.mjs +167 -78
- package/form-block/index.mjs +24 -22
- package/form-cascader/index.mjs +29 -29
- package/form-checkbox-group/index.mjs +76 -31
- package/form-date-picker/index.mjs +21 -20
- package/form-holder/index.mjs +16 -15
- package/form-input/index.mjs +30 -88
- package/form-input-email/index.mjs +28 -28
- package/form-input-id-card/index.mjs +37 -37
- package/form-input-number/index.mjs +219 -59
- package/form-input-phone-number/index.mjs +25 -25
- package/form-input-tag/index.mjs +160 -38
- package/form-input-time/index.mjs +23 -23
- package/form-item/index.mjs +15 -144
- package/form-item-group/index.mjs +15 -163
- package/form-radio-group/index.mjs +39 -38
- package/form-select/index.mjs +33 -32
- package/form-switch/index.mjs +26 -26
- package/form-textarea/index.mjs +26 -26
- package/form-view/index.mjs +46 -42
- package/fy-array/index.mjs +65 -61
- package/fy-cascader/index.mjs +14 -13
- package/fy-checkbox/index.mjs +37 -32
- package/fy-code/index.mjs +11 -14
- package/fy-curd/index.mjs +206 -2795
- package/fy-date/index.mjs +16 -57
- package/fy-draggable/index.mjs +21 -20
- package/fy-dynamic/index.mjs +64 -207
- package/fy-empty/index.mjs +12 -29
- package/fy-form/index.mjs +178 -732
- package/fy-form-design/index.mjs +1738 -1179
- package/fy-input/index.mjs +15 -101
- package/fy-input-color/index.mjs +17 -66
- package/fy-input-icon/index.mjs +21 -116
- package/fy-input-map/index.mjs +27 -24
- package/fy-input-number/index.mjs +23 -22
- package/fy-input-table/index.mjs +22 -18
- package/fy-input-tree/index.mjs +32 -28
- package/fy-progress/index.mjs +24 -23
- package/fy-radio/index.mjs +23 -18
- package/fy-rate/index.mjs +16 -49
- package/fy-select/index.mjs +29 -122
- package/fy-slider/index.mjs +18 -17
- package/fy-switch/index.mjs +21 -20
- package/fy-tabs/index.mjs +14 -48
- package/fy-time/index.mjs +20 -14
- package/fy-title/index.mjs +1 -1
- package/fy-tree/index.mjs +26 -20
- package/fy-u-editor/index.mjs +1 -1
- package/fy-upload/index.mjs +76 -74
- package/guide-steps/index.mjs +24 -22
- package/highlight-j-s/index.mjs +19 -29
- package/icon-temp/index.mjs +12 -30
- package/iframe-window/index.mjs +19 -18
- package/image-cropper/index.mjs +53 -51
- package/image-preview/index.mjs +27 -25
- package/input-number/index.mjs +63 -172
- package/input-number-range/index.mjs +24 -23
- package/license/index.mjs +1 -1
- package/loading-view/index.mjs +15 -33
- package/login/index.mjs +40 -35
- package/nav-bar/index.mjs +15 -30
- package/notice/index.mjs +19 -18
- package/package.json +1 -1
- package/page/index.mjs +12 -20
- package/page-header/index.mjs +13 -34
- package/page-index/index.mjs +34 -33
- package/page-index-top/index.mjs +100 -51
- package/page-skeleton/index.mjs +18 -35
- package/page-skeleton-new/index.mjs +16 -15
- package/pageable-table/index.mjs +85 -223
- package/pageable-view/index.mjs +34 -33
- package/present-view/index.mjs +75 -71
- package/record-video/index.mjs +1 -1
- package/resize-observer/index.mjs +21 -29
- package/search/index.mjs +29 -27
- package/search-popover/index.mjs +1 -1
- package/sign/index.mjs +1 -1
- package/split-pane/index.mjs +40 -45
- package/static-pageable-table/index.mjs +20 -18
- package/swiper/index.mjs +27 -25
- package/table-view/index.mjs +627 -89
- package/tag-render/index.mjs +21 -19
- package/text-ellipsis/index.mjs +13 -12
- package/tinymce-editor/index.mjs +73 -72
- package/toolbar/index.mjs +15 -208
- package/toolbar-button/index.mjs +32 -57
- package/verify/index.mjs +1 -1
- package/vue-cron/index.mjs +112 -104
- package/watermark/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.mjs +51 -117
- package/chunks/FormTemp.7f91629d.mjs +0 -165
- package/chunks/confirmable-mixin.817b542f.mjs +0 -116
- package/chunks/form-input-mixin.4632ad36.mjs +0 -24
- package/chunks/form-item-mixin.ad148e7b.mjs +0 -140
- package/chunks/input-number-mixin.41a066be.mjs +0 -60
package/editable-tree/index.mjs
CHANGED
|
@@ -1,384 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var B = Object.defineProperty, T = Object.defineProperties;
|
|
2
|
+
var v = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var w = Object.getOwnPropertySymbols;
|
|
4
|
+
var K = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var x = (e, t, i) => t in e ? B(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, l = (e, t) => {
|
|
6
|
+
for (var i in t || (t = {}))
|
|
7
|
+
K.call(t, i) && x(e, i, t[i]);
|
|
8
|
+
if (w)
|
|
9
|
+
for (var i of w(t))
|
|
10
|
+
M.call(t, i) && x(e, i, t[i]);
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
13
|
-
var r = (e,
|
|
14
|
-
var n = (
|
|
12
|
+
}, c = (e, t) => T(e, v(t));
|
|
13
|
+
var r = (e, t, i) => new Promise((s, a) => {
|
|
14
|
+
var n = (h) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
16
|
+
d(i.next(h));
|
|
17
|
+
} catch (p) {
|
|
18
|
+
a(p);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, o = (h) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
22
|
+
d(i.throw(h));
|
|
23
|
+
} catch (p) {
|
|
24
|
+
a(p);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, d = (h) => h.done ? s(h.value) : Promise.resolve(h.value).then(n, o);
|
|
27
|
+
d((i = i.apply(e, t)).next());
|
|
28
28
|
});
|
|
29
|
-
import { hasOwn as m, isVerticalScrollbarVisible as
|
|
30
|
-
import { addResizeListener as
|
|
29
|
+
import { hasOwn as m, isVerticalScrollbarVisible as k, scrollbarWidth as P, computePosition as D, isPlainObject as u, isFunction as N, isUndefined as f, isNotEmpty as R, fastClone as E, delay as V, findTreeChildren as A } from "@web-utils/core";
|
|
30
|
+
import { addResizeListener as $, removeResizeListener as C } from "@web-utils/integrations/resize";
|
|
31
31
|
import { cloneDeep as g } from "@web-utils/integrations/lodash";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
var e = this, i = e.$createElement, t = e._self._c || i;
|
|
36
|
-
return t("div", {
|
|
37
|
-
staticClass: "editable-tree"
|
|
38
|
-
}, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? t("ElButton", {
|
|
39
|
-
staticStyle: {
|
|
40
|
-
position: "absolute",
|
|
41
|
-
top: "4px",
|
|
42
|
-
"z-index": "1"
|
|
43
|
-
},
|
|
44
|
-
style: {
|
|
45
|
-
right: `${e.right}px`
|
|
46
|
-
},
|
|
47
|
-
attrs: {
|
|
48
|
-
type: "primary",
|
|
49
|
-
size: "mini",
|
|
50
|
-
icon: "el-icon-plus",
|
|
51
|
-
circle: "",
|
|
52
|
-
plain: ""
|
|
53
|
-
},
|
|
54
|
-
on: {
|
|
55
|
-
click: function(s) {
|
|
56
|
-
return s.stopPropagation(), e.$emit("add-root-node");
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}) : e._e(), t("div", {
|
|
60
|
-
ref: "treeWrapper",
|
|
61
|
-
staticClass: "et-tree-wrapper"
|
|
62
|
-
}, [!e.readonly && e.addRootNodeButtonStyle === "top" ? t("div", {
|
|
63
|
-
staticStyle: {
|
|
64
|
-
"padding-left": "24px"
|
|
65
|
-
}
|
|
66
|
-
}, [t("ElButton", {
|
|
67
|
-
attrs: {
|
|
68
|
-
disabled: e.loading,
|
|
69
|
-
size: "mini",
|
|
70
|
-
type: "text"
|
|
71
|
-
},
|
|
72
|
-
on: {
|
|
73
|
-
click: e.appendRootNode
|
|
74
|
-
}
|
|
75
|
-
}, [t("i", {
|
|
76
|
-
staticClass: "el-icon-lx-add"
|
|
77
|
-
}), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`) + " ")])], 1) : e._e(), t("ElTree", e._g(e._b({
|
|
78
|
-
key: e.treeKey,
|
|
79
|
-
ref: "tree",
|
|
80
|
-
staticClass: "flex-item",
|
|
81
|
-
attrs: {
|
|
82
|
-
"default-expanded-keys": e.expandedKeys,
|
|
83
|
-
"expand-on-click-node": !1,
|
|
84
|
-
"highlight-current": "",
|
|
85
|
-
load: e.loadNode,
|
|
86
|
-
data: e.innerTreeData,
|
|
87
|
-
props: e.treeProps,
|
|
88
|
-
lazy: e.lazy,
|
|
89
|
-
"node-key": e.nodeKey
|
|
90
|
-
},
|
|
91
|
-
on: {
|
|
92
|
-
"node-click": e.nodeClick,
|
|
93
|
-
"node-contextmenu": e.showContextMenu,
|
|
94
|
-
"node-expand": e.addExpandKey,
|
|
95
|
-
"node-collapse": e.removeExpandKey
|
|
96
|
-
},
|
|
97
|
-
scopedSlots: e._u([{
|
|
98
|
-
key: "default",
|
|
99
|
-
fn: function(s) {
|
|
100
|
-
var o = s.node, n = s.data;
|
|
101
|
-
return [e._t("default", function() {
|
|
102
|
-
return [n.edit ? [t("span", {
|
|
103
|
-
staticClass: "custom-tree-node flex-row flex-item oh",
|
|
104
|
-
attrs: {
|
|
105
|
-
"data-id": n.id
|
|
106
|
-
}
|
|
107
|
-
}, [e.icon ? t("i", {
|
|
108
|
-
staticClass: "node-icon shrink-0",
|
|
109
|
-
class: n.loading ? "el-icon-loading" : "el-icon-edit-outline"
|
|
110
|
-
}) : e._e(), t("ElInput", {
|
|
111
|
-
ref: "labelTxt",
|
|
112
|
-
staticClass: "node-input flex-item",
|
|
113
|
-
attrs: {
|
|
114
|
-
size: "mini",
|
|
115
|
-
placeholder: e.defaultOptions.inputPlaceholder
|
|
116
|
-
},
|
|
117
|
-
on: {
|
|
118
|
-
blur: function(a) {
|
|
119
|
-
return e.inputBlur(a, o, n);
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
nativeOn: {
|
|
123
|
-
keyup: function(a) {
|
|
124
|
-
return function(l) {
|
|
125
|
-
return e.inputKeyup(l, o, n);
|
|
126
|
-
}.apply(null, arguments);
|
|
127
|
-
},
|
|
128
|
-
click: function(a) {
|
|
129
|
-
a.stopPropagation();
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
model: {
|
|
133
|
-
value: e.text,
|
|
134
|
-
callback: function(a) {
|
|
135
|
-
e.text = a;
|
|
136
|
-
},
|
|
137
|
-
expression: "text"
|
|
138
|
-
}
|
|
139
|
-
}), e.confirmButton ? [t("ElButton", {
|
|
140
|
-
directives: [{
|
|
141
|
-
name: "show",
|
|
142
|
-
rawName: "v-show",
|
|
143
|
-
value: !n.loading,
|
|
144
|
-
expression: "!data.loading"
|
|
145
|
-
}],
|
|
146
|
-
staticClass: "shrink-0",
|
|
147
|
-
attrs: {
|
|
148
|
-
size: "mini",
|
|
149
|
-
type: "text"
|
|
150
|
-
},
|
|
151
|
-
on: {
|
|
152
|
-
click: function(a) {
|
|
153
|
-
return a.stopPropagation(), e.onConfirm(o, n);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}, [e._v("确定")]), t("ElButton", {
|
|
157
|
-
directives: [{
|
|
158
|
-
name: "show",
|
|
159
|
-
rawName: "v-show",
|
|
160
|
-
value: !n.loading,
|
|
161
|
-
expression: "!data.loading"
|
|
162
|
-
}],
|
|
163
|
-
staticClass: "shrink-0",
|
|
164
|
-
attrs: {
|
|
165
|
-
size: "mini",
|
|
166
|
-
type: "text"
|
|
167
|
-
},
|
|
168
|
-
on: {
|
|
169
|
-
click: function(a) {
|
|
170
|
-
return a.stopPropagation(), e.onCancel(o, n);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}, [e._v("取消")])] : e._e()], 2)] : [t("span", {
|
|
174
|
-
staticClass: "custom-tree-node",
|
|
175
|
-
attrs: {
|
|
176
|
-
"data-id": n.id
|
|
177
|
-
}
|
|
178
|
-
}, [t("span", {
|
|
179
|
-
staticClass: "node-label flex-row flex-item oh ellipsis-1"
|
|
180
|
-
}, [e.icon ? t("i", {
|
|
181
|
-
staticClass: "node-icon",
|
|
182
|
-
class: n.loading ? "el-icon-loading" : e.icon(n, o)
|
|
183
|
-
}) : e._e(), t("span", {
|
|
184
|
-
staticClass: "flex-item-relative",
|
|
185
|
-
staticStyle: {
|
|
186
|
-
height: "21px"
|
|
187
|
-
}
|
|
188
|
-
}, [t("span", {
|
|
189
|
-
staticClass: "ellipsis-1 absolute-box et-tree-label",
|
|
190
|
-
attrs: {
|
|
191
|
-
title: o.label
|
|
192
|
-
}
|
|
193
|
-
}, [e._t("label", function() {
|
|
194
|
-
return [e._v(e._s(o.label))];
|
|
195
|
-
}, {
|
|
196
|
-
data: n,
|
|
197
|
-
node: o
|
|
198
|
-
})], 2)]), e._t("label-suffix", null, {
|
|
199
|
-
node: o,
|
|
200
|
-
data: n
|
|
201
|
-
})], 2), !e.contextMenu && !e.readonly ? t("span", {
|
|
202
|
-
directives: [{
|
|
203
|
-
name: "show",
|
|
204
|
-
rawName: "v-show",
|
|
205
|
-
value: !n.loading && !e.loading,
|
|
206
|
-
expression: "!data.loading && !loading"
|
|
207
|
-
}],
|
|
208
|
-
staticClass: "handle-actions"
|
|
209
|
-
}, [t("ElButton", {
|
|
210
|
-
attrs: {
|
|
211
|
-
size: "mini",
|
|
212
|
-
type: "text"
|
|
213
|
-
},
|
|
214
|
-
on: {
|
|
215
|
-
click: function(a) {
|
|
216
|
-
return a.stopPropagation(), e.appendChildNode(o, n);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}, [e._v("添加")]), t("ElButton", {
|
|
220
|
-
attrs: {
|
|
221
|
-
size: "mini",
|
|
222
|
-
type: "text"
|
|
223
|
-
},
|
|
224
|
-
on: {
|
|
225
|
-
click: function(a) {
|
|
226
|
-
return a.stopPropagation(), e.editNode(o, n);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}, [e._v("修改")]), t("ElPopconfirm", {
|
|
230
|
-
staticClass: "pop-confirm",
|
|
231
|
-
attrs: {
|
|
232
|
-
"icon-color": "red",
|
|
233
|
-
title: "你确定要删除吗?"
|
|
234
|
-
},
|
|
235
|
-
on: {
|
|
236
|
-
confirm: function(a) {
|
|
237
|
-
return e.removeNode(o, n);
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
scopedSlots: e._u([{
|
|
241
|
-
key: "reference",
|
|
242
|
-
fn: function() {
|
|
243
|
-
return [t("ElButton", {
|
|
244
|
-
directives: [{
|
|
245
|
-
name: "show",
|
|
246
|
-
rawName: "v-show",
|
|
247
|
-
value: o.isLeaf,
|
|
248
|
-
expression: "node.isLeaf"
|
|
249
|
-
}],
|
|
250
|
-
staticStyle: {
|
|
251
|
-
"margin-left": "4px"
|
|
252
|
-
},
|
|
253
|
-
attrs: {
|
|
254
|
-
size: "mini",
|
|
255
|
-
type: "text"
|
|
256
|
-
},
|
|
257
|
-
on: {
|
|
258
|
-
click: function(a) {
|
|
259
|
-
a.stopPropagation();
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}, [e._v("删除")])];
|
|
263
|
-
},
|
|
264
|
-
proxy: !0
|
|
265
|
-
}], null, !0)
|
|
266
|
-
})], 1) : e._e(), e.contextMenuIcon && e.contextMenu && !e.readonly ? t("span", {
|
|
267
|
-
directives: [{
|
|
268
|
-
name: "show",
|
|
269
|
-
rawName: "v-show",
|
|
270
|
-
value: !n.loading && !e.loading,
|
|
271
|
-
expression: "!data.loading && !loading"
|
|
272
|
-
}],
|
|
273
|
-
staticClass: "handle-actions",
|
|
274
|
-
staticStyle: {
|
|
275
|
-
display: "inline-block"
|
|
276
|
-
}
|
|
277
|
-
}, [t("ElButton", {
|
|
278
|
-
staticStyle: {
|
|
279
|
-
padding: "6px 10px 0"
|
|
280
|
-
},
|
|
281
|
-
attrs: {
|
|
282
|
-
size: "mini",
|
|
283
|
-
type: "text"
|
|
284
|
-
},
|
|
285
|
-
on: {
|
|
286
|
-
click: function(a) {
|
|
287
|
-
return a.stopPropagation(), e.showContextMenu(a, n, o);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
}, [e._v(". . .")])], 1) : e._e()])]];
|
|
291
|
-
}, {
|
|
292
|
-
node: o,
|
|
293
|
-
data: n
|
|
294
|
-
})];
|
|
295
|
-
}
|
|
296
|
-
}], null, !0)
|
|
297
|
-
}, "ElTree", e.filterTreeProperties(e.$attrs), !1), e.filterTreeEvents(e.$listeners))), e.contextMenu && !e.readonly ? t("div", {
|
|
298
|
-
directives: [{
|
|
299
|
-
name: "show",
|
|
300
|
-
rawName: "v-show",
|
|
301
|
-
value: e.showMenu,
|
|
302
|
-
expression: "showMenu"
|
|
303
|
-
}],
|
|
304
|
-
ref: "contextMenu",
|
|
305
|
-
staticClass: "menu",
|
|
306
|
-
style: e.position
|
|
307
|
-
}, [t("ul", {
|
|
308
|
-
staticClass: "menu-list"
|
|
309
|
-
}, [e._t("context-menu", function() {
|
|
310
|
-
return [t("li", {
|
|
311
|
-
directives: [{
|
|
312
|
-
name: "show",
|
|
313
|
-
rawName: "v-show",
|
|
314
|
-
value: e.curData.id > -1,
|
|
315
|
-
expression: "curData.id > -1"
|
|
316
|
-
}],
|
|
317
|
-
staticClass: "menu-item",
|
|
318
|
-
on: {
|
|
319
|
-
click: function(s) {
|
|
320
|
-
return e.appendPeerNode(e.curNode, e.curData);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}, [t("i", {
|
|
324
|
-
staticClass: "menu-item-icon el-icon-lx-add",
|
|
325
|
-
staticStyle: {
|
|
326
|
-
color: "#228b22"
|
|
327
|
-
}
|
|
328
|
-
}), e._v(e._s(e.menuLabel.appendPeer) + " ")]), t("li", {
|
|
329
|
-
staticClass: "menu-item",
|
|
330
|
-
on: {
|
|
331
|
-
click: function(s) {
|
|
332
|
-
return e.appendChildNode(e.curNode, e.curData);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}, [t("i", {
|
|
336
|
-
staticClass: "menu-item-icon el-icon-lx-add",
|
|
337
|
-
staticStyle: {
|
|
338
|
-
color: "#228b22"
|
|
339
|
-
}
|
|
340
|
-
}), e._v(e._s(e.menuLabel.appendChild) + " ")]), t("li", {
|
|
341
|
-
directives: [{
|
|
342
|
-
name: "show",
|
|
343
|
-
rawName: "v-show",
|
|
344
|
-
value: e.curData.id > -1,
|
|
345
|
-
expression: "curData.id > -1"
|
|
346
|
-
}],
|
|
347
|
-
staticClass: "menu-item",
|
|
348
|
-
on: {
|
|
349
|
-
click: function(s) {
|
|
350
|
-
return e.editNode(e.curNode, e.curData);
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
}, [t("i", {
|
|
354
|
-
staticClass: "menu-item-icon el-icon-edit-outline",
|
|
355
|
-
staticStyle: {
|
|
356
|
-
color: "#ffa500"
|
|
357
|
-
}
|
|
358
|
-
}), e._v(e._s(e.menuLabel.editNode) + " ")]), t("li", {
|
|
359
|
-
directives: [{
|
|
360
|
-
name: "show",
|
|
361
|
-
rawName: "v-show",
|
|
362
|
-
value: e.curNode.isLeaf,
|
|
363
|
-
expression: "curNode.isLeaf"
|
|
364
|
-
}],
|
|
365
|
-
staticClass: "menu-item",
|
|
366
|
-
on: {
|
|
367
|
-
click: function(s) {
|
|
368
|
-
return e.removeNodeModal(e.curNode, e.curData);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}, [t("i", {
|
|
372
|
-
staticClass: "menu-item-icon el-icon-delete",
|
|
373
|
-
staticStyle: {
|
|
374
|
-
color: "#f00"
|
|
375
|
-
}
|
|
376
|
-
}), e._v(e._s(e.menuLabel.removeNode) + " ")])];
|
|
377
|
-
}, {
|
|
378
|
-
curNode: e.curNode,
|
|
379
|
-
curData: e.curData
|
|
380
|
-
})], 2)]) : e._e()], 1)], 1);
|
|
381
|
-
}, I = [];
|
|
32
|
+
import { c as L, d as I, e as y } from "../chunks/index.d91bd77a.mjs";
|
|
33
|
+
import { s as F, r as _ } from "../chunks/EditableTree.vue_vue_type_style_index_0_lang.5dba9f89.mjs";
|
|
34
|
+
import { n as z } from "../chunks/vueComponentNormalizer.446f5dc4.mjs";
|
|
382
35
|
const O = {
|
|
383
36
|
name: "EditableTree",
|
|
384
37
|
props: {
|
|
@@ -395,9 +48,9 @@ const O = {
|
|
|
395
48
|
},
|
|
396
49
|
newNodeBuilder: {
|
|
397
50
|
type: Function,
|
|
398
|
-
default: (e,
|
|
51
|
+
default: (e, t) => ({
|
|
399
52
|
name: e,
|
|
400
|
-
parentId:
|
|
53
|
+
parentId: t.id
|
|
401
54
|
})
|
|
402
55
|
},
|
|
403
56
|
contextMenu: Boolean,
|
|
@@ -512,26 +165,26 @@ const O = {
|
|
|
512
165
|
this.tryFetch();
|
|
513
166
|
},
|
|
514
167
|
mounted() {
|
|
515
|
-
|
|
168
|
+
$(this.$refs.tree.$el, this.resize), $(this.$refs.treeWrapper, this.resize);
|
|
516
169
|
},
|
|
517
170
|
beforeDestroy() {
|
|
518
|
-
|
|
171
|
+
C(this.$refs.tree.$el, this.resize), C(this.$refs.treeWrapper, this.resize);
|
|
519
172
|
},
|
|
520
173
|
methods: {
|
|
521
|
-
filterTreeProperties:
|
|
522
|
-
filterTreeEvents:
|
|
174
|
+
filterTreeProperties: L,
|
|
175
|
+
filterTreeEvents: I,
|
|
523
176
|
addExpandKey(e) {
|
|
524
177
|
this.reserveExpandKey && this.expandedKeys.push(e[this.nodeKey]);
|
|
525
178
|
},
|
|
526
179
|
removeExpandKey(e) {
|
|
527
|
-
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((
|
|
180
|
+
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((t) => t !== e[this.nodeKey]));
|
|
528
181
|
},
|
|
529
182
|
resize() {
|
|
530
|
-
|
|
183
|
+
k(this.$refs.treeWrapper) ? this.right = 4 + P : this.right = 4;
|
|
531
184
|
},
|
|
532
|
-
showContextMenu(e,
|
|
185
|
+
showContextMenu(e, t, i) {
|
|
533
186
|
return r(this, null, function* () {
|
|
534
|
-
|
|
187
|
+
t.contextmenu === !1 || t.id === -1 || t.id === 0 || t.edit === !0 || this.contextMenu && (this.curNode = i, this.curData = t, this.showMenu = !0, this.$refs.tree.setCurrentKey(t.id), yield this.$nextTick(), this.position = D(e, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
|
|
535
188
|
});
|
|
536
189
|
},
|
|
537
190
|
hideContextMenu() {
|
|
@@ -539,39 +192,39 @@ const O = {
|
|
|
539
192
|
},
|
|
540
193
|
tryFetch() {
|
|
541
194
|
return r(this, null, function* () {
|
|
542
|
-
var e,
|
|
195
|
+
var e, t;
|
|
543
196
|
if (this.lazy === !1 && this.fetchApi) {
|
|
544
|
-
const
|
|
545
|
-
if (u(
|
|
197
|
+
const i = yield this.fetchApi((t = (e = this.rootNode) == null ? void 0 : e.id) != null ? t : -1, {});
|
|
198
|
+
if (u(i.data) && (i.data = [i.data]), i.data = i.data || [], this.empty = i.data.length === 0, u(this.customRootNode)) {
|
|
546
199
|
const s = g(this.customRootNode);
|
|
547
|
-
s[this.treeProps.children || "children"] =
|
|
200
|
+
s[this.treeProps.children || "children"] = i.data, this.treeData = [s];
|
|
548
201
|
} else if (N(this.customRootNode)) {
|
|
549
|
-
const s = this.customRootNode(
|
|
550
|
-
s[this.treeProps.children || "children"] =
|
|
202
|
+
const s = this.customRootNode(i.data);
|
|
203
|
+
s[this.treeProps.children || "children"] = i.data, this.treeData = u(s) ? [s] : s;
|
|
551
204
|
} else
|
|
552
|
-
this.treeData =
|
|
205
|
+
this.treeData = i.data;
|
|
553
206
|
}
|
|
554
207
|
});
|
|
555
208
|
},
|
|
556
|
-
loadNode(e,
|
|
209
|
+
loadNode(e, t) {
|
|
557
210
|
return r(this, null, function* () {
|
|
558
|
-
var
|
|
211
|
+
var i, s, a, n;
|
|
559
212
|
if (e.level === 0) {
|
|
560
|
-
const
|
|
561
|
-
if (this.empty =
|
|
562
|
-
const
|
|
563
|
-
|
|
213
|
+
const o = yield this.fetchApi((s = (i = this.rootNode) == null ? void 0 : i.id) != null ? s : -1, e);
|
|
214
|
+
if (this.empty = o.data.length === 0, u(this.customRootNode)) {
|
|
215
|
+
const d = g(this.customRootNode);
|
|
216
|
+
d[this.treeProps.children || "children"] = o.data, t([d]);
|
|
564
217
|
} else if (N(this.customRootNode)) {
|
|
565
|
-
const
|
|
566
|
-
|
|
218
|
+
const d = this.customRootNode(o.data);
|
|
219
|
+
d[this.treeProps.children || "children"] = o.data, this.treeData = u(d) ? [d] : d;
|
|
567
220
|
} else
|
|
568
|
-
|
|
569
|
-
yield this.$nextTick(), this.$emit("root-node-loaded",
|
|
221
|
+
t(o.data);
|
|
222
|
+
yield this.$nextTick(), this.$emit("root-node-loaded", o.data), this.defaultExpandedKeys ? this.expandedKeys = [(a = o == null ? void 0 : o.data[0]) == null ? void 0 : a.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(n = o == null ? void 0 : o.data[0]) == null ? void 0 : n.id]);
|
|
570
223
|
} else {
|
|
571
224
|
if (e.leaf || e.data.isTempNode)
|
|
572
|
-
return
|
|
573
|
-
const
|
|
574
|
-
|
|
225
|
+
return t([]);
|
|
226
|
+
const o = yield this.fetchApi(e.data.id, e);
|
|
227
|
+
t(o.data), yield this.$nextTick(), this.$emit("node-loaded", o.data);
|
|
575
228
|
}
|
|
576
229
|
});
|
|
577
230
|
},
|
|
@@ -585,74 +238,74 @@ const O = {
|
|
|
585
238
|
this.newChild && this.newChild.id === -1 && (console.log(this.newChild), this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
|
|
586
239
|
},
|
|
587
240
|
cancelEdit() {
|
|
588
|
-
this.editData && (
|
|
241
|
+
this.editData && (f(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
|
|
589
242
|
},
|
|
590
|
-
editNode(e,
|
|
243
|
+
editNode(e, t) {
|
|
591
244
|
return r(this, null, function* () {
|
|
592
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData =
|
|
593
|
-
inputValue:
|
|
594
|
-
beforeClose: (
|
|
595
|
-
if (
|
|
245
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = t, this.text = t[this.treeProps.label], f(t.edit) ? this.$set(t, "edit", !0) : t.edit = !0, yield this.$nextTick(), this.$refs.labelTxt.focus()) : yield this.$prompt(`请输入新的${this.label}名:`, c(l({}, this.defaultOptions), {
|
|
246
|
+
inputValue: t[this.treeProps.label],
|
|
247
|
+
beforeClose: (i, s, a) => r(this, null, function* () {
|
|
248
|
+
if (i === "confirm") {
|
|
596
249
|
try {
|
|
597
|
-
s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...", this.text = s.inputValue, yield this.onConfirm(this.curNode, this.curData),
|
|
250
|
+
s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...", this.text = s.inputValue, yield this.onConfirm(this.curNode, this.curData), a();
|
|
598
251
|
} catch (n) {
|
|
599
252
|
s.confirmButtonText = "确定";
|
|
600
253
|
}
|
|
601
254
|
s.confirmButtonLoading = !1;
|
|
602
255
|
} else
|
|
603
|
-
|
|
256
|
+
a();
|
|
604
257
|
})
|
|
605
|
-
})).catch((
|
|
258
|
+
})).catch((i) => i);
|
|
606
259
|
});
|
|
607
260
|
},
|
|
608
261
|
appendRootNode() {
|
|
609
262
|
return r(this, null, function* () {
|
|
610
|
-
this.text = "", !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(void 0), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.scrollIntoView(!0)) : yield this.$prompt(`请输入${this.label}名:`,
|
|
611
|
-
beforeClose: (e,
|
|
263
|
+
this.text = "", !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(void 0), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.scrollIntoView(!0)) : yield this.$prompt(`请输入${this.label}名:`, c(l({}, this.defaultOptions), {
|
|
264
|
+
beforeClose: (e, t, i) => r(this, null, function* () {
|
|
612
265
|
if (e === "confirm") {
|
|
613
266
|
try {
|
|
614
|
-
this.createNewChild(-1),
|
|
615
|
-
const s = yield this.saveApi(this.newNodeBuilder(
|
|
616
|
-
this.newChild[this.treeProps.label] =
|
|
267
|
+
this.createNewChild(-1), t.confirmButtonLoading = !0, t.confirmButtonText = "处理中...";
|
|
268
|
+
const s = yield this.saveApi(this.newNodeBuilder(t.inputValue, { id: -1 }));
|
|
269
|
+
this.newChild[this.treeProps.label] = t.inputValue, this.newChild.edit = !1, y(this.newChild, s.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.locateView(), i();
|
|
617
270
|
} catch (s) {
|
|
618
|
-
|
|
271
|
+
t.confirmButtonText = "确定";
|
|
619
272
|
}
|
|
620
|
-
|
|
273
|
+
t.confirmButtonLoading = !1;
|
|
621
274
|
} else
|
|
622
|
-
|
|
275
|
+
i();
|
|
623
276
|
})
|
|
624
277
|
})).catch((e) => e);
|
|
625
278
|
});
|
|
626
279
|
},
|
|
627
280
|
appendChildNode(e) {
|
|
628
281
|
this.text = "";
|
|
629
|
-
const
|
|
282
|
+
const t = e.expanded;
|
|
630
283
|
e.expand(() => r(this, null, function* () {
|
|
631
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), yield this.scrollIntoView(
|
|
632
|
-
beforeClose: (
|
|
633
|
-
if (
|
|
284
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), yield this.scrollIntoView(t)) : yield this.$prompt(`请输入${this.label}名:`, c(l({}, this.defaultOptions), {
|
|
285
|
+
beforeClose: (i, s, a) => r(this, null, function* () {
|
|
286
|
+
if (i === "confirm") {
|
|
634
287
|
try {
|
|
635
288
|
this.createNewChild(e.data.id), s.confirmButtonLoading = !0, s.confirmButtonText = "处理中...";
|
|
636
289
|
const n = yield this.saveApi(this.newNodeBuilder(s.inputValue, e.data));
|
|
637
|
-
this.newChild[this.treeProps.label] = s.inputValue, this.newChild.edit = !1, y(this.newChild, n.data), this.$refs.tree.append(this.newChild, e), yield this.locateView(),
|
|
290
|
+
this.newChild[this.treeProps.label] = s.inputValue, this.newChild.edit = !1, y(this.newChild, n.data), this.$refs.tree.append(this.newChild, e), yield this.locateView(), a();
|
|
638
291
|
} catch (n) {
|
|
639
292
|
s.confirmButtonText = "确定";
|
|
640
293
|
}
|
|
641
294
|
s.confirmButtonLoading = !1;
|
|
642
295
|
} else
|
|
643
|
-
|
|
296
|
+
a();
|
|
644
297
|
})
|
|
645
|
-
})).catch((
|
|
298
|
+
})).catch((i) => i);
|
|
646
299
|
}));
|
|
647
300
|
},
|
|
648
|
-
appendChildNodeWithData(e,
|
|
301
|
+
appendChildNodeWithData(e, t, i) {
|
|
649
302
|
this.text = "";
|
|
650
303
|
const s = e.expanded;
|
|
651
304
|
e.expand(() => r(this, null, function* () {
|
|
652
305
|
this.clear(), this.newChild = {
|
|
653
306
|
id: -1,
|
|
654
|
-
parentId:
|
|
655
|
-
[this.treeProps.label]:
|
|
307
|
+
parentId: t,
|
|
308
|
+
[this.treeProps.label]: i,
|
|
656
309
|
edit: !1,
|
|
657
310
|
isTempNode: !0,
|
|
658
311
|
hasChildren: !1
|
|
@@ -682,8 +335,8 @@ const O = {
|
|
|
682
335
|
});
|
|
683
336
|
},
|
|
684
337
|
updateNode(e) {
|
|
685
|
-
const
|
|
686
|
-
|
|
338
|
+
const t = this.$refs.tree.getNode(e);
|
|
339
|
+
t && (t.data = e);
|
|
687
340
|
},
|
|
688
341
|
setCurrentKey(e) {
|
|
689
342
|
this.$refs.tree && this.$refs.tree.setCurrentKey(e);
|
|
@@ -711,59 +364,59 @@ const O = {
|
|
|
711
364
|
closeOnClickModal: !1,
|
|
712
365
|
confirmButtonClass: "el-button--danger",
|
|
713
366
|
cancelButtonClass: "el-button--primary is-plain",
|
|
714
|
-
beforeClose: (
|
|
715
|
-
if (
|
|
367
|
+
beforeClose: (t, i, s) => r(this, null, function* () {
|
|
368
|
+
if (t === "confirm") {
|
|
716
369
|
try {
|
|
717
|
-
|
|
718
|
-
const
|
|
719
|
-
n.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted",
|
|
720
|
-
} catch (
|
|
370
|
+
i.confirmButtonLoading = !0, i.confirmButtonText = "删除...";
|
|
371
|
+
const a = e.parent, n = yield this.deleteApi(e.data.id);
|
|
372
|
+
n.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", a, e.data), s()) : this.$message.error(n.message);
|
|
373
|
+
} catch (a) {
|
|
721
374
|
}
|
|
722
|
-
|
|
375
|
+
i.confirmButtonText = "确定", i.confirmButtonLoading = !1;
|
|
723
376
|
} else
|
|
724
377
|
s();
|
|
725
378
|
})
|
|
726
379
|
}
|
|
727
|
-
).catch((
|
|
380
|
+
).catch((t) => t);
|
|
728
381
|
});
|
|
729
382
|
},
|
|
730
383
|
removeNode(e) {
|
|
731
384
|
return r(this, null, function* () {
|
|
732
385
|
try {
|
|
733
|
-
const
|
|
386
|
+
const t = e.parent;
|
|
734
387
|
if (this.deleteApi) {
|
|
735
|
-
const
|
|
736
|
-
|
|
388
|
+
const i = yield this.deleteApi(e.data.id);
|
|
389
|
+
i.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", t, e.data)) : this.$message.error(i.message);
|
|
737
390
|
} else
|
|
738
391
|
this.$refs.tree.remove(e);
|
|
739
|
-
} catch (
|
|
392
|
+
} catch (t) {
|
|
740
393
|
}
|
|
741
394
|
});
|
|
742
395
|
},
|
|
743
|
-
onConfirm(e,
|
|
396
|
+
onConfirm(e, t) {
|
|
744
397
|
return r(this, null, function* () {
|
|
745
|
-
if (
|
|
398
|
+
if (t[this.treeProps.label] === this.text || !R(this.text)) {
|
|
746
399
|
this.clear();
|
|
747
400
|
return;
|
|
748
401
|
}
|
|
749
|
-
|
|
402
|
+
f(t.loading) ? this.$set(t, "loading", !0) : t.loading = !0;
|
|
750
403
|
try {
|
|
751
|
-
if (this.loading = !0,
|
|
752
|
-
const
|
|
753
|
-
y(
|
|
404
|
+
if (this.loading = !0, t.id === -1) {
|
|
405
|
+
const i = yield this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), s = E(t);
|
|
406
|
+
y(t, c(l({}, i.data), { isTempNode: !1 })), this.$emit("node-added", t, s, e), this.registerNode(e);
|
|
754
407
|
} else
|
|
755
|
-
yield this.updateApi(
|
|
756
|
-
|
|
757
|
-
} catch (
|
|
408
|
+
yield this.updateApi(c(l({}, t), { [this.treeProps.label]: this.text }));
|
|
409
|
+
t[this.treeProps.label] = this.text, t.edit = !1, this.$emit("node-updated", t, e), this.text = "";
|
|
410
|
+
} catch (i) {
|
|
758
411
|
}
|
|
759
|
-
|
|
412
|
+
t.loading = !1, this.loading = !1;
|
|
760
413
|
});
|
|
761
414
|
},
|
|
762
|
-
onCancel(e,
|
|
763
|
-
|
|
415
|
+
onCancel(e, t) {
|
|
416
|
+
t.id === -1 ? this.$refs.tree.remove(e) : t.edit = !1, this.text = "";
|
|
764
417
|
},
|
|
765
|
-
nodeClick(e,
|
|
766
|
-
this.hideContextMenu(), (
|
|
418
|
+
nodeClick(e, t, i) {
|
|
419
|
+
this.hideContextMenu(), (f(e.loading) || !e.loading) && (this.curNode = t, this.curData = e, this.$emit("on-node-click", e, t, i));
|
|
767
420
|
},
|
|
768
421
|
getCurrentNode() {
|
|
769
422
|
return this.$refs.tree.getCurrentNode();
|
|
@@ -777,15 +430,15 @@ const O = {
|
|
|
777
430
|
},
|
|
778
431
|
scrollIntoView(e) {
|
|
779
432
|
return r(this, null, function* () {
|
|
780
|
-
var
|
|
781
|
-
yield this.$nextTick(), e || (yield
|
|
433
|
+
var t, i;
|
|
434
|
+
yield this.$nextTick(), e || (yield V(300)), (i = (t = this.$refs) == null ? void 0 : t.labelTxt) == null || i.focus();
|
|
782
435
|
});
|
|
783
436
|
},
|
|
784
|
-
inputKeyup(e,
|
|
785
|
-
e.keyCode === 13 && this.onConfirm(
|
|
437
|
+
inputKeyup(e, t, i) {
|
|
438
|
+
e.keyCode === 13 && this.onConfirm(t, i), e.keyCode === 27 && this.clear();
|
|
786
439
|
},
|
|
787
|
-
inputBlur(e,
|
|
788
|
-
this.confirmButton || this.onConfirm(
|
|
440
|
+
inputBlur(e, t, i) {
|
|
441
|
+
this.confirmButton || this.onConfirm(t, i);
|
|
789
442
|
},
|
|
790
443
|
getCheckedKeys() {
|
|
791
444
|
return this.$refs.tree.getCheckedKeys();
|
|
@@ -806,9 +459,9 @@ const O = {
|
|
|
806
459
|
return this.$refs.tree.root;
|
|
807
460
|
},
|
|
808
461
|
findTreeNode(e) {
|
|
809
|
-
return
|
|
462
|
+
return A(
|
|
810
463
|
this.$refs.tree.root.childNodes,
|
|
811
|
-
(
|
|
464
|
+
(t) => t.data === e || t.data.id === e,
|
|
812
465
|
"childNodes"
|
|
813
466
|
);
|
|
814
467
|
},
|
|
@@ -821,11 +474,11 @@ const O = {
|
|
|
821
474
|
});
|
|
822
475
|
}
|
|
823
476
|
}
|
|
824
|
-
},
|
|
825
|
-
var
|
|
477
|
+
}, b = {};
|
|
478
|
+
var S = /* @__PURE__ */ z(
|
|
826
479
|
O,
|
|
827
|
-
|
|
828
|
-
|
|
480
|
+
_,
|
|
481
|
+
F,
|
|
829
482
|
!1,
|
|
830
483
|
j,
|
|
831
484
|
null,
|
|
@@ -833,12 +486,12 @@ var F = /* @__PURE__ */ V(
|
|
|
833
486
|
null
|
|
834
487
|
);
|
|
835
488
|
function j(e) {
|
|
836
|
-
for (let
|
|
837
|
-
this[
|
|
489
|
+
for (let t in b)
|
|
490
|
+
this[t] = b[t];
|
|
838
491
|
}
|
|
839
|
-
const
|
|
840
|
-
return
|
|
492
|
+
const X = /* @__PURE__ */ function() {
|
|
493
|
+
return S.exports;
|
|
841
494
|
}();
|
|
842
495
|
export {
|
|
843
|
-
|
|
496
|
+
X as default
|
|
844
497
|
};
|