@web-utils/form-ui 1.0.0-beta77 → 1.0.0-beta79
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.d.ts +52 -0
- package/affix/index.d.ts +30 -0
- package/awesome-button/index.d.ts +60 -0
- package/capsule-tab/index.d.ts +30 -0
- package/card/index.d.ts +41 -0
- package/chunks/{Dhdoa4M6.mjs → 22GsbC-1.mjs} +1 -1
- package/chunks/{DRXM1Mt22.mjs → B4GsYMXo.mjs} +1 -1
- package/chunks/{l5bfIjYm.mjs → B8NokGUg.mjs} +4715 -5034
- package/chunks/{CWaId08S2.mjs → BEghYt1s2.mjs} +1 -1
- package/chunks/{CGVBF4Ml.mjs → BQytQPLa.mjs} +58 -51
- package/chunks/{D5_ezGUV2.mjs → BVUClQOx.mjs} +2 -2
- package/chunks/{Dpzw7Rtp.mjs → BWTQ3qdg.mjs} +1 -1
- package/chunks/{uDwSrV7X2.mjs → Bo8lYN4n2.mjs} +2 -2
- package/chunks/{D6qJXu04.mjs → Bs926z902.mjs} +48 -49
- package/chunks/{BVsvRLea2.mjs → Bu1M7um22.mjs} +2 -2
- package/chunks/{CeEYChF4.mjs → Bvn6wnku.mjs} +2 -2
- package/chunks/{CyQmVphZ.mjs → C-zPVdz-.mjs} +35 -35
- package/chunks/{BZRmdKBG.mjs → CDalOJtl2.mjs} +65 -66
- package/chunks/{lPQBM7xc2.mjs → CGmbnjKL.mjs} +2 -2
- package/chunks/{kAaQhLJs2.mjs → COA3tHyu2.mjs} +1 -1
- package/chunks/{CVM0lwn22.mjs → CONqKD47.mjs} +2 -2
- package/chunks/{BTNnujZA2.mjs → CTYReSXN.mjs} +1 -1
- package/chunks/{BK6DiJfX2.mjs → ChP-pNSi2.mjs} +3 -3
- package/chunks/{DMDsZeqv.mjs → CiMBKxeJ.mjs} +1 -1
- package/chunks/{Dgwcljur.mjs → CkLpOk7H.mjs} +1 -1
- package/chunks/{CI-pH-gR2.mjs → Co0M4G3P.mjs} +1 -1
- package/chunks/{DS4Iw8Y42.mjs → D6mInNk02.mjs} +80 -78
- package/chunks/{BM8snKHN2.mjs → DH-B0Lkz2.mjs} +2 -2
- package/chunks/{Bq9KMIsC.mjs → DMSbDBCP.mjs} +143 -143
- package/chunks/{Cg6ahpHk.mjs → DQMWqQFe2.mjs} +2 -2
- package/chunks/{DFa2J7ul.mjs → D_q3C3v4.mjs} +130 -130
- package/chunks/{DyGddGTO.mjs → DbcxJ45j.mjs} +96 -97
- package/chunks/{B-WTB0ce2.mjs → DcgE9SF_2.mjs} +1 -1
- package/chunks/{Bh2SlzOo.mjs → DgH_4qOn2.mjs} +3 -0
- package/chunks/{CeI6Qrij.mjs → DhqOVe4S.mjs} +100 -99
- package/chunks/{285I1DfO.mjs → Dnb8jUG_.mjs} +14 -15
- package/chunks/{BaB0bq4I2.mjs → DxeRdYI82.mjs} +1 -1
- package/chunks/{JjnlFlI02.mjs → Dz_TTgwF2.mjs} +92 -90
- package/chunks/{C3pzNRoU2.mjs → T2V8nxIu.mjs} +363 -362
- package/chunks/{BLBHnUme2.mjs → Zdhb_SRi2.mjs} +1 -1
- package/chunks/{BvlU_Z6D2.mjs → eX0Esdvw2.mjs} +1 -1
- package/chunks/{CoPlnbwi2.mjs → hBvPGqka.mjs} +2 -2
- package/chunks/{BkoWiWEW.mjs → mqi8hesW2.mjs} +190 -191
- package/chunks/{DP7eF99m2.mjs → oXiNltCq.mjs} +1 -1
- package/chunks/{x2jJ6cfy2.mjs → shY1VkIE2.mjs} +1 -1
- package/chunks/{ohCkWdwS.mjs → tSaeUhnr.mjs} +1 -1
- package/chunks/{C0gLPKS8.mjs → tqW2DSco.mjs} +48 -47
- package/code-mirror-editor/index.d.ts +50 -0
- package/confirm-button/index.d.ts +122 -0
- package/confirmable/index.d.ts +93 -0
- package/context-menu/index.d.ts +183 -0
- package/count-up/index.d.ts +70 -0
- package/custom-scrollbar/index.d.ts +49 -0
- package/data-box/index.d.ts +30 -0
- package/data-card/index.d.ts +20 -0
- package/data-card-text/index.d.ts +21 -0
- package/data-display/index.d.ts +20 -0
- package/data-icons/index.d.ts +21 -0
- package/data-imgtext/index.d.ts +18 -0
- package/data-operatext/index.d.ts +17 -0
- package/data-panel/index.d.ts +19 -0
- package/data-pay/index.d.ts +19 -0
- package/data-price/index.d.ts +17 -0
- package/data-progress/index.d.ts +19 -0
- package/data-rotate/index.d.ts +21 -0
- package/data-table-picker/index.d.ts +61 -0
- package/data-table-picker/index.mjs +16 -15
- package/data-tabs/index.d.ts +21 -0
- package/dict-render/index.d.ts +28 -0
- package/e-charts/index.d.ts +79 -0
- package/easy-popup/index.d.ts +114 -0
- package/editable-progress/index.d.ts +68 -0
- package/editable-tree/index.d.ts +281 -0
- package/editable-tree/index.mjs +111 -110
- package/element-dialog/index.d.ts +376 -0
- package/element-resize-observer/index.d.ts +8 -0
- package/empty-view/index.d.ts +29 -0
- package/error-view/index.d.ts +25 -0
- package/flex-box/index.d.ts +44 -0
- package/flex-column/index.d.ts +41 -0
- package/flex-item/index.d.ts +77 -0
- package/flex-row/index.d.ts +41 -0
- package/flex-scroll-area/index.d.ts +22 -0
- package/flex-scroller/index.d.ts +26 -0
- package/flow-designer/index.d.ts +286 -0
- package/flow-designer/index.mjs +1 -1
- package/flow-designer/style.css +1 -1
- package/flow-viewer/index.d.ts +62 -0
- package/form-advice/index.d.ts +9 -0
- package/form-button/index.d.ts +123 -0
- package/form-card/index.d.ts +14 -0
- package/form-cascader/index.d.ts +478 -0
- package/form-cascader/index.mjs +1 -1
- package/form-cell/index.d.ts +25 -0
- package/form-checkbox/index.d.ts +314 -0
- package/form-checkbox/index.mjs +1 -1
- package/form-checkbox-group/index.d.ts +373 -0
- package/form-checkbox-group/index.mjs +1 -1
- package/form-date-picker/index.d.ts +480 -0
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +162 -0
- package/form-holder/index.mjs +1 -1
- package/form-image/index.d.ts +220 -0
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +378 -0
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.d.ts +223 -0
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-email/index.d.ts +376 -0
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +376 -0
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +329 -0
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +376 -0
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.d.ts +270 -0
- package/form-input-tag/index.mjs +1 -1
- package/form-input-time/index.d.ts +441 -0
- package/form-input-time/index.mjs +1 -1
- package/form-item-config-provider/index.d.ts +40 -0
- package/form-item-group/index.d.ts +92 -0
- package/form-item-group/index.mjs +1 -1
- package/form-item-x/index.d.ts +190 -0
- package/form-item-x/index.mjs +1 -1
- package/form-radio-group/index.d.ts +374 -0
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +325 -0
- package/form-rate/index.mjs +1 -1
- package/form-red-table/index.d.ts +21 -0
- package/form-row/index.d.ts +11 -0
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +606 -0
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +352 -0
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +343 -0
- package/form-switch/index.mjs +1 -1
- package/form-table/index.d.ts +287 -0
- package/form-table/index.mjs +1 -1
- package/form-table-plus/index.d.ts +266 -0
- package/form-table-plus/index.mjs +1 -1
- package/form-text/index.d.ts +235 -0
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.d.ts +351 -0
- package/form-textarea/index.mjs +1 -1
- package/form-time-select/index.d.ts +325 -0
- package/form-time-select/index.mjs +1 -1
- package/form-tree-select/index.d.ts +715 -0
- package/form-tree-select/index.mjs +1 -1
- package/form-tree-select-multiple/index.d.ts +717 -0
- package/form-tree-select-multiple/index.mjs +1 -1
- package/form-view/index.d.ts +226 -0
- package/form-view/index.mjs +2 -2
- package/guide-steps/index.d.ts +31 -0
- package/helper/input.mjs +1 -1
- package/highlight-j-s/index.d.ts +18 -0
- package/iframe-window/index.d.ts +9 -0
- package/image-cropper/index.d.ts +365 -0
- package/image-preview/index.d.ts +61 -0
- package/image-viewer/index.d.ts +25 -0
- package/index.css +1 -1
- package/index.d.ts +119 -119
- package/index.mjs +121 -121
- package/input-number-range/index.d.ts +41 -0
- package/keyboard/index.d.ts +64 -0
- package/keyboard/index.mjs +1 -1
- package/loading-view/index.d.ts +65 -0
- package/name-avatar/index.d.ts +62 -0
- package/nav-bar/index.d.ts +21 -0
- package/package.json +1 -1
- package/page/index.d.ts +21 -0
- package/page-header/index.d.ts +27 -0
- package/page-index/index.d.ts +82 -0
- package/page-index-top/index.d.ts +38 -0
- package/page-skeleton/index.d.ts +30 -0
- package/page-skeleton-new/index.d.ts +34 -0
- package/pageable-table/index.d.ts +400 -0
- package/photo-swipe/index.d.ts +18 -0
- package/photo-swipe/index.mjs +1 -1
- package/props/date.d.ts +1 -4
- package/props/date.mjs +18 -5
- package/sign-panel/index.d.ts +85 -0
- package/skeleton-panel/index.d.ts +27 -0
- package/split-pane/index.d.ts +106 -0
- package/split-pane/index.mjs +1 -1
- package/stateful/index.d.ts +92 -0
- package/sub-table/index.d.ts +109 -0
- package/sub-table/index.mjs +1 -1
- package/sub-table-plus/index.d.ts +109 -0
- package/sub-table-plus/index.mjs +1 -1
- package/swiper/index.d.ts +27 -0
- package/table-column/index.d.ts +163 -0
- package/table-column-def/index.d.ts +97 -0
- package/table-view/index.d.ts +346 -0
- package/table-view/index.mjs +92 -90
- package/tag-render/index.d.ts +48 -0
- package/text-ellipsis/index.d.ts +111 -0
- package/toolbar/index.d.ts +129 -0
- package/toolbar/index.mjs +1 -1
- package/toolbar-button/index.d.ts +189 -0
- package/vue-cron/index.d.ts +191 -0
- package/vue-cron/index.mjs +1 -1
- package/vue-qr-code/index.d.ts +47 -0
- package/vue-tags-input/index.d.ts +373 -0
- package/vue-tree-select/index.d.ts +1489 -0
- package/vue-tree-select/index.mjs +1 -1
- package/vue-video-player/index.d.ts +117 -0
- package/watermark/index.d.ts +97 -0
- package/watermark/index.mjs +1 -1
- package/web-types.json +1 -1
- package/x-input-tag/index.d.ts +2 -0
- package/year-calendar/index.d.ts +99 -0
- package/year-calendar/index.mjs +1 -1
- package/chunks/CjjJimnU.mjs +0 -20
- /package/chunks/{tJ_t87kJ.mjs → 6dNVtIN32.mjs} +0 -0
- /package/chunks/{CJ7Ai-mH2.mjs → B1luuf_A2.mjs} +0 -0
- /package/chunks/{B1jgu0ci.mjs → BAG_R87k2.mjs} +0 -0
- /package/chunks/{gNfZhMJk2.mjs → BM5LdxU72.mjs} +0 -0
- /package/chunks/{CZeL7oiY2.mjs → BhHMGhJ8.mjs} +0 -0
- /package/chunks/{z6tpYT0z.mjs → BwL9Xz1F.mjs} +0 -0
- /package/chunks/{B2Y1LWJ3.mjs → Dkw6LNCq2.mjs} +0 -0
- /package/chunks/{b_78-Wov2.mjs → FZqu01np2.mjs} +0 -0
- /package/chunks/{hPAfGilD.mjs → KOJEsarR2.mjs} +0 -0
- /package/chunks/{3UWcbJcG.mjs → PEU1JRcN2.mjs} +0 -0
package/editable-tree/index.mjs
CHANGED
|
@@ -2,18 +2,19 @@ import { m as e, t } from "../chunks/ClVh1Lek.mjs";
|
|
|
2
2
|
import { t as n } from "../chunks/B1MSrc6f.mjs";
|
|
3
3
|
import { t as r } from "../chunks/mnqSaATq.mjs";
|
|
4
4
|
import { allProps as i, predicate as a } from "../props/tree.mjs";
|
|
5
|
-
import { ElInput as o,
|
|
5
|
+
import { ElInput as o, ElMessage as s, ElMessageBox as c, ElPopconfirm as l, ElTree as u } from "element-plus/es";
|
|
6
6
|
import "element-plus/es/components/base/style/css";
|
|
7
7
|
import "element-plus/es/components/input/style/css";
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { computePosition as
|
|
8
|
+
import { Fragment as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, mergeProps as v, normalizeClass as y, normalizeStyle as b, openBlock as x, renderSlot as S, toDisplayString as C, toHandlers as w, vShow as T, withCtx as E, withDirectives as D, withModifiers as O } from "vue";
|
|
9
|
+
import { computePosition as k, delay as A, fastClone as j, findTreeChildren as M, isFunction as N, isNotEmpty as P, isPlainObject as F, isUndefined as I, isVerticalScrollbarVisible as L, patch as R, scrollbarWidth as z } from "@web-utils/core";
|
|
10
|
+
import "element-plus/es/components/message/style/css";
|
|
10
11
|
import "element-plus/es/components/message-box/style/css";
|
|
11
|
-
import { cloneDeep as
|
|
12
|
+
import { cloneDeep as B } from "@web-utils/integrations/lodash";
|
|
12
13
|
import "element-plus/es/components/tree/style/css";
|
|
13
14
|
import "element-plus/es/components/popconfirm/style/css";
|
|
14
|
-
import { addResizeListener as
|
|
15
|
+
import { addResizeListener as V, removeResizeListener as H } from "@web-utils/integrations/resize";
|
|
15
16
|
//#region src/components/form/EditableTree.vue
|
|
16
|
-
var
|
|
17
|
+
var U = {
|
|
17
18
|
name: "EditableTree",
|
|
18
19
|
props: { ...i },
|
|
19
20
|
emits: {
|
|
@@ -79,10 +80,10 @@ var H = {
|
|
|
79
80
|
this.tryFetch();
|
|
80
81
|
},
|
|
81
82
|
mounted() {
|
|
82
|
-
|
|
83
|
+
V(this.$refs.tree.$el, this.resize), V(this.$refs.treeWrapper, this.resize);
|
|
83
84
|
},
|
|
84
85
|
beforeUnmount() {
|
|
85
|
-
|
|
86
|
+
H(this.$refs.tree.$el, this.resize), H(this.$refs.treeWrapper, this.resize);
|
|
86
87
|
},
|
|
87
88
|
methods: {
|
|
88
89
|
addExpandKey(e) {
|
|
@@ -92,10 +93,10 @@ var H = {
|
|
|
92
93
|
this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((t) => t !== e[this.nodeKey]));
|
|
93
94
|
},
|
|
94
95
|
resize() {
|
|
95
|
-
|
|
96
|
+
L(this.$refs.treeWrapper) ? this.right = 4 + z : this.right = 4;
|
|
96
97
|
},
|
|
97
98
|
async showContextMenu(e, t, n) {
|
|
98
|
-
t.contextmenu === !1 || t.id === -1 || t.id === 0 || t.edit === !0 || this.readonly || this.contextMenu && (this.curNode = n, this.curData = t, this.showMenu = !0, this.$refs.tree.setCurrentKey(t.id), await this.$nextTick(), this.position =
|
|
99
|
+
t.contextmenu === !1 || t.id === -1 || t.id === 0 || t.edit === !0 || this.readonly || this.contextMenu && (this.curNode = n, this.curData = t, this.showMenu = !0, this.$refs.tree.setCurrentKey(t.id), await this.$nextTick(), this.position = k(e, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
|
|
99
100
|
},
|
|
100
101
|
hideContextMenu() {
|
|
101
102
|
this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
|
|
@@ -111,14 +112,14 @@ var H = {
|
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
114
|
let i = r.data.data;
|
|
114
|
-
|
|
115
|
+
F(i) && (i = [i]), i = i || [];
|
|
115
116
|
let a = [];
|
|
116
|
-
if (this.empty = i.length === 0,
|
|
117
|
-
let e =
|
|
117
|
+
if (this.empty = i.length === 0, F(this.customRootNode)) {
|
|
118
|
+
let e = B(this.customRootNode);
|
|
118
119
|
e[this.treeProps.children || "children"] = i, a = [e];
|
|
119
|
-
} else if (
|
|
120
|
+
} else if (N(this.customRootNode)) {
|
|
120
121
|
let e = this.customRootNode(i);
|
|
121
|
-
e[this.treeProps.children || "children"] = i, a =
|
|
122
|
+
e[this.treeProps.children || "children"] = i, a = F(e) ? [e] : e;
|
|
122
123
|
} else a = i;
|
|
123
124
|
if ((e = this.defaultExpandedKeys) != null && e.length) this.expandedKeys = [...this.defaultExpandedKeys];
|
|
124
125
|
else if (this.expandFirstNode) {
|
|
@@ -132,12 +133,12 @@ var H = {
|
|
|
132
133
|
if (e.level === 0) {
|
|
133
134
|
var n, r;
|
|
134
135
|
let o = (await this.fetchApi(((n = this.rootNode) == null ? void 0 : n.id) ?? -1, e)).data.data;
|
|
135
|
-
if (this.empty = o.length === 0,
|
|
136
|
-
let e =
|
|
136
|
+
if (this.empty = o.length === 0, F(this.customRootNode)) {
|
|
137
|
+
let e = B(this.customRootNode);
|
|
137
138
|
e[this.treeProps.children || "children"] = o, o = [e], t(o);
|
|
138
|
-
} else if (
|
|
139
|
+
} else if (N(this.customRootNode)) {
|
|
139
140
|
let e = this.customRootNode(o);
|
|
140
|
-
e[this.treeProps.children || "children"] = o, o =
|
|
141
|
+
e[this.treeProps.children || "children"] = o, o = F(e) ? [e] : e;
|
|
141
142
|
} else t(o);
|
|
142
143
|
if (await this.$nextTick(), this.$emit("root-node-loaded", o), (r = this.defaultExpandedKeys) != null && r.length) {
|
|
143
144
|
var i;
|
|
@@ -162,10 +163,10 @@ var H = {
|
|
|
162
163
|
this.newChild && this.newChild.id === -1 && (this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
|
|
163
164
|
},
|
|
164
165
|
cancelEdit() {
|
|
165
|
-
this.editData && (
|
|
166
|
+
this.editData && (I(this.editData.edit) ? this.editData.edit = !0 : this.editData.edit = !1);
|
|
166
167
|
},
|
|
167
168
|
async editNode(e, t) {
|
|
168
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = t, this.text = t[this.treeProps.label],
|
|
169
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = t, this.text = t[this.treeProps.label], I(t.edit), t.edit = !0, await this.$nextTick(), this.$refs.labelTxt.focus()) : await c.prompt(`请输入新的${this.label}名:`, {
|
|
169
170
|
...this.defaultOptions,
|
|
170
171
|
inputValue: t[this.treeProps.label],
|
|
171
172
|
beforeClose: async (e, t, n) => {
|
|
@@ -181,7 +182,7 @@ var H = {
|
|
|
181
182
|
}).catch((e) => e);
|
|
182
183
|
},
|
|
183
184
|
async appendRootNode() {
|
|
184
|
-
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), await this.scrollIntoView(!0)) : await
|
|
185
|
+
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), await this.scrollIntoView(!0)) : await c.prompt(`请输入${this.label}名:`, {
|
|
185
186
|
...this.defaultOptions,
|
|
186
187
|
beforeClose: async (e, n, r) => {
|
|
187
188
|
if (e === "confirm") {
|
|
@@ -201,7 +202,7 @@ var H = {
|
|
|
201
202
|
this.text = "";
|
|
202
203
|
let n = e.expanded;
|
|
203
204
|
e.expand(async () => {
|
|
204
|
-
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(n)) : await
|
|
205
|
+
!this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(n)) : await c.prompt(`请输入${this.label}名:`, {
|
|
205
206
|
...this.defaultOptions,
|
|
206
207
|
beforeClose: async (n, r, i) => {
|
|
207
208
|
if (n === "confirm") {
|
|
@@ -250,7 +251,7 @@ var H = {
|
|
|
250
251
|
},
|
|
251
252
|
updateNode(e) {
|
|
252
253
|
let t = this.$refs.tree.getNode(e);
|
|
253
|
-
t &&
|
|
254
|
+
t && R(t.data, e, !0);
|
|
254
255
|
},
|
|
255
256
|
setCurrentKey(e) {
|
|
256
257
|
var t;
|
|
@@ -267,7 +268,7 @@ var H = {
|
|
|
267
268
|
}, this.$emit("create-new-node", this.newChild);
|
|
268
269
|
},
|
|
269
270
|
async removeNodeModal(e) {
|
|
270
|
-
await
|
|
271
|
+
await c.confirm(`你确定要删除${this.label}[<span class="break-word" style="color: orange">${e.data[this.treeProps.label]}</span>]吗?`, "系统提示", {
|
|
271
272
|
type: "warning",
|
|
272
273
|
modal: !0,
|
|
273
274
|
dangerouslyUseHTMLString: !0,
|
|
@@ -280,7 +281,7 @@ var H = {
|
|
|
280
281
|
try {
|
|
281
282
|
n.confirmButtonLoading = !0, n.confirmButtonText = "删除...";
|
|
282
283
|
let t = e.parent, i = await this.deleteApi(e.data.id);
|
|
283
|
-
i.code === 0 ? (
|
|
284
|
+
i.code === 0 ? (s.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", t, e.data), r()) : s.error(i.message);
|
|
284
285
|
} catch {}
|
|
285
286
|
n.confirmButtonText = "确定", n.confirmButtonLoading = !1;
|
|
286
287
|
} else r();
|
|
@@ -292,19 +293,19 @@ var H = {
|
|
|
292
293
|
let t = e.parent;
|
|
293
294
|
if (this.deleteApi) {
|
|
294
295
|
let n = await this.deleteApi(e.data.id);
|
|
295
|
-
n.code === 0 ? (
|
|
296
|
+
n.code === 0 ? (s.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", t, e.data)) : s.error(n.message);
|
|
296
297
|
} else this.$refs.tree.remove(e);
|
|
297
298
|
} catch {}
|
|
298
299
|
},
|
|
299
300
|
async onConfirm(e, n) {
|
|
300
|
-
if (n[this.treeProps.label] === this.text || !
|
|
301
|
+
if (n[this.treeProps.label] === this.text || !P(this.text)) {
|
|
301
302
|
this.clear();
|
|
302
303
|
return;
|
|
303
304
|
}
|
|
304
|
-
|
|
305
|
+
I(n.loading), n.loading = !0;
|
|
305
306
|
try {
|
|
306
307
|
if (this.loading = !0, n.id === -1) {
|
|
307
|
-
let r = await this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), i =
|
|
308
|
+
let r = await this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), i = j(n);
|
|
308
309
|
t(n, {
|
|
309
310
|
...r.data,
|
|
310
311
|
isTempNode: !1
|
|
@@ -321,7 +322,7 @@ var H = {
|
|
|
321
322
|
t.id === -1 ? this.$refs.tree.remove(e) : t.edit = !1, this.text = "";
|
|
322
323
|
},
|
|
323
324
|
nodeClick(e, t, n) {
|
|
324
|
-
this.hideContextMenu(), (
|
|
325
|
+
this.hideContextMenu(), (I(e.loading) || !e.loading) && (this.curNode = t, this.curData = e, this.$emit("on-node-click", e, t, n));
|
|
325
326
|
},
|
|
326
327
|
getCurrentNode() {
|
|
327
328
|
return this.$refs.tree.getCurrentNode();
|
|
@@ -333,7 +334,7 @@ var H = {
|
|
|
333
334
|
},
|
|
334
335
|
async scrollIntoView(e) {
|
|
335
336
|
var t;
|
|
336
|
-
await this.$nextTick(), e || await
|
|
337
|
+
await this.$nextTick(), e || await A(300), (t = this.$refs) == null || (t = t.labelTxt) == null || t.focus();
|
|
337
338
|
},
|
|
338
339
|
inputKeyup(e, t, n) {
|
|
339
340
|
e.keyCode === 13 && this.onConfirm(t, n), e.keyCode === 27 && this.clear();
|
|
@@ -360,7 +361,7 @@ var H = {
|
|
|
360
361
|
return this.$refs.tree.root;
|
|
361
362
|
},
|
|
362
363
|
findTreeNode(e) {
|
|
363
|
-
return
|
|
364
|
+
return M(this.$refs.tree.root.childNodes, (t) => t.data === e || t.data.id === e, "childNodes");
|
|
364
365
|
},
|
|
365
366
|
registerNode(e) {
|
|
366
367
|
e.store.registerNode(e), delete e.store.nodesMap[-1];
|
|
@@ -369,32 +370,32 @@ var H = {
|
|
|
369
370
|
this.lazy ? this.treeKey = Date.now() : await this.tryFetch();
|
|
370
371
|
}
|
|
371
372
|
}
|
|
372
|
-
},
|
|
373
|
+
}, W = { class: "editable-tree" }, G = {
|
|
373
374
|
ref: "treeWrapper",
|
|
374
375
|
class: "et-tree-wrapper"
|
|
375
|
-
},
|
|
376
|
+
}, K = {
|
|
376
377
|
key: 0,
|
|
377
378
|
style: { "padding-left": "24px" }
|
|
378
|
-
},
|
|
379
|
+
}, q = ["data-id"], J = {
|
|
379
380
|
class: "node-label flex-row flex-item ellipsis-1",
|
|
380
381
|
style: { overflow: "hidden" }
|
|
381
|
-
},
|
|
382
|
+
}, Y = {
|
|
382
383
|
class: "flex-item-relative",
|
|
383
384
|
style: { height: "21px" }
|
|
384
|
-
},
|
|
385
|
+
}, X = ["title"], Z = {
|
|
385
386
|
key: 0,
|
|
386
387
|
class: "handle-actions"
|
|
387
|
-
},
|
|
388
|
+
}, Q = {
|
|
388
389
|
key: 1,
|
|
389
390
|
class: "handle-actions",
|
|
390
391
|
style: { display: "inline-block" }
|
|
391
|
-
},
|
|
392
|
-
function
|
|
393
|
-
let
|
|
394
|
-
return
|
|
392
|
+
}, $ = ["data-id"], ee = { class: "menu-list" };
|
|
393
|
+
function te(e, t, n, i, a, s) {
|
|
394
|
+
let c = r, k = l, A = o, j = u;
|
|
395
|
+
return x(), m("div", W, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? (x(), f(c, {
|
|
395
396
|
key: 0,
|
|
396
397
|
type: "primary",
|
|
397
|
-
style:
|
|
398
|
+
style: b([{
|
|
398
399
|
position: "absolute",
|
|
399
400
|
top: "4px",
|
|
400
401
|
"z-index": "1"
|
|
@@ -402,17 +403,17 @@ function ee(e, t, n, i, a, s) {
|
|
|
402
403
|
icon: "el-icon-plus",
|
|
403
404
|
circle: "",
|
|
404
405
|
plain: "",
|
|
405
|
-
onClick: t[0] || (t[0] =
|
|
406
|
-
}, null, 8, ["style"])) :
|
|
407
|
-
!e.readonly && e.addRootNodeButtonStyle === "top" ? (
|
|
406
|
+
onClick: t[0] || (t[0] = O((t) => e.$emit("add-root-node"), ["stop"]))
|
|
407
|
+
}, null, 8, ["style"])) : p("v-if", !0), h("div", G, [
|
|
408
|
+
!e.readonly && e.addRootNodeButtonStyle === "top" ? (x(), m("div", K, [_(c, {
|
|
408
409
|
disabled: a.loading,
|
|
409
410
|
type: "text",
|
|
410
411
|
onClick: s.appendRootNode
|
|
411
412
|
}, {
|
|
412
|
-
default:
|
|
413
|
+
default: E(() => [t[8] || (t[8] = h("i", { class: "el-icon-lx-add" }, null, -1)), g(" " + C(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`), 1)]),
|
|
413
414
|
_: 1
|
|
414
|
-
}, 8, ["disabled", "onClick"])])) :
|
|
415
|
-
(
|
|
415
|
+
}, 8, ["disabled", "onClick"])])) : p("v-if", !0),
|
|
416
|
+
(x(), f(j, v(i.autoBindProps, {
|
|
416
417
|
key: a.treeKey,
|
|
417
418
|
ref: "tree",
|
|
418
419
|
"default-expand-all": e.defaultExpandAll,
|
|
@@ -425,25 +426,25 @@ function ee(e, t, n, i, a, s) {
|
|
|
425
426
|
props: e.treeProps,
|
|
426
427
|
lazy: e.lazy,
|
|
427
428
|
"node-key": e.nodeKey
|
|
428
|
-
},
|
|
429
|
+
}, w(i.listeners), {
|
|
429
430
|
onNodeClick: s.nodeClick,
|
|
430
431
|
onNodeContextmenu: s.showContextMenu,
|
|
431
432
|
onNodeExpand: s.addExpandKey,
|
|
432
433
|
onNodeCollapse: s.removeExpandKey
|
|
433
434
|
}), {
|
|
434
|
-
default:
|
|
435
|
+
default: E(({ node: n, data: r }) => [S(e.$slots, "default", {
|
|
435
436
|
node: n,
|
|
436
437
|
data: r
|
|
437
|
-
}, () => [
|
|
438
|
+
}, () => [p("非编辑模式"), r.edit ? (x(), m(d, { key: 1 }, [p("编辑模式"), h("span", {
|
|
438
439
|
"data-id": r.id,
|
|
439
440
|
class: "custom-tree-node flex-row flex-item",
|
|
440
441
|
style: { overflow: "hidden" }
|
|
441
442
|
}, [
|
|
442
|
-
e.icon ? (
|
|
443
|
+
e.icon ? (x(), m("i", {
|
|
443
444
|
key: 0,
|
|
444
|
-
class:
|
|
445
|
-
}, null, 2)) :
|
|
446
|
-
|
|
445
|
+
class: y([r.loading ? "el-icon-loading" : "el-icon-edit-outline", "node-icon flex-not-shrink"])
|
|
446
|
+
}, null, 2)) : p("v-if", !0),
|
|
447
|
+
_(A, {
|
|
447
448
|
ref: "labelTxt",
|
|
448
449
|
modelValue: a.text,
|
|
449
450
|
"onUpdate:modelValue": t[2] || (t[2] = (e) => a.text = e),
|
|
@@ -451,91 +452,91 @@ function ee(e, t, n, i, a, s) {
|
|
|
451
452
|
placeholder: s.defaultOptions.inputPlaceholder,
|
|
452
453
|
onKeyup: (e) => s.inputKeyup(e, n, r),
|
|
453
454
|
onBlur: (e) => s.inputBlur(e, n, r),
|
|
454
|
-
onClick: t[3] || (t[3] =
|
|
455
|
+
onClick: t[3] || (t[3] = O(() => {}, ["stop"]))
|
|
455
456
|
}, null, 8, [
|
|
456
457
|
"modelValue",
|
|
457
458
|
"placeholder",
|
|
458
459
|
"onKeyup",
|
|
459
460
|
"onBlur"
|
|
460
461
|
]),
|
|
461
|
-
e.confirmButton ? (
|
|
462
|
+
e.confirmButton ? (x(), m(d, { key: 1 }, [D(_(c, {
|
|
462
463
|
class: "flex-not-shrink",
|
|
463
464
|
type: "text",
|
|
464
|
-
onClick:
|
|
465
|
+
onClick: O((e) => s.onConfirm(n, r), ["stop"])
|
|
465
466
|
}, {
|
|
466
|
-
default:
|
|
467
|
+
default: E(() => [...t[13] || (t[13] = [g(" 确定 ", -1)])]),
|
|
467
468
|
_: 1
|
|
468
|
-
}, 8, ["onClick"]), [[
|
|
469
|
+
}, 8, ["onClick"]), [[T, !r.loading]]), D(_(c, {
|
|
469
470
|
class: "flex-not-shrink",
|
|
470
471
|
type: "text",
|
|
471
|
-
onClick:
|
|
472
|
+
onClick: O((e) => s.onCancel(n, r), ["stop"])
|
|
472
473
|
}, {
|
|
473
|
-
default:
|
|
474
|
+
default: E(() => [...t[14] || (t[14] = [g(" 取消 ", -1)])]),
|
|
474
475
|
_: 1
|
|
475
|
-
}, 8, ["onClick"]), [[
|
|
476
|
-
], 8,
|
|
476
|
+
}, 8, ["onClick"]), [[T, !r.loading]])], 64)) : p("v-if", !0)
|
|
477
|
+
], 8, $)], 64)) : (x(), m("span", {
|
|
477
478
|
key: 0,
|
|
478
479
|
"data-id": r.id,
|
|
479
480
|
class: "custom-tree-node"
|
|
480
481
|
}, [
|
|
481
|
-
|
|
482
|
-
e.icon ? (
|
|
482
|
+
h("span", J, [
|
|
483
|
+
e.icon ? (x(), m("i", {
|
|
483
484
|
key: 0,
|
|
484
|
-
class:
|
|
485
|
-
}, null, 2)) :
|
|
486
|
-
|
|
485
|
+
class: y([r.loading ? "el-icon-loading" : e.icon(r, n), "node-icon"])
|
|
486
|
+
}, null, 2)) : p("v-if", !0),
|
|
487
|
+
h("span", Y, [h("span", {
|
|
487
488
|
class: "ellipsis-1 absolute-box et-tree-label",
|
|
488
489
|
title: n.label
|
|
489
|
-
}, [
|
|
490
|
+
}, [S(e.$slots, "label", {
|
|
490
491
|
data: r,
|
|
491
492
|
node: n
|
|
492
|
-
}, () => [
|
|
493
|
-
|
|
493
|
+
}, () => [g(C(n.label), 1)])], 8, X)]),
|
|
494
|
+
S(e.$slots, "label-suffix", {
|
|
494
495
|
node: n,
|
|
495
496
|
data: r
|
|
496
497
|
})
|
|
497
498
|
]),
|
|
498
|
-
!e.contextMenu && !e.readonly ?
|
|
499
|
-
|
|
499
|
+
!e.contextMenu && !e.readonly ? D((x(), m("span", Z, [
|
|
500
|
+
_(c, {
|
|
500
501
|
type: "text",
|
|
501
|
-
onClick:
|
|
502
|
+
onClick: O((e) => s.appendChildNode(n, r), ["stop"])
|
|
502
503
|
}, {
|
|
503
|
-
default:
|
|
504
|
+
default: E(() => [...t[9] || (t[9] = [g("添加", -1)])]),
|
|
504
505
|
_: 1
|
|
505
506
|
}, 8, ["onClick"]),
|
|
506
|
-
|
|
507
|
+
_(c, {
|
|
507
508
|
type: "text",
|
|
508
|
-
onClick:
|
|
509
|
+
onClick: O((e) => s.editNode(n, r), ["stop"])
|
|
509
510
|
}, {
|
|
510
|
-
default:
|
|
511
|
+
default: E(() => [...t[10] || (t[10] = [g("修改", -1)])]),
|
|
511
512
|
_: 1
|
|
512
513
|
}, 8, ["onClick"]),
|
|
513
|
-
|
|
514
|
+
_(k, {
|
|
514
515
|
class: "pop-confirm",
|
|
515
516
|
"icon-color": "red",
|
|
516
517
|
title: "你确定要删除吗?",
|
|
517
518
|
onConfirm: (e) => s.removeNode(n, r)
|
|
518
519
|
}, {
|
|
519
|
-
reference:
|
|
520
|
+
reference: E(() => [D(_(c, {
|
|
520
521
|
style: { "margin-left": "4px" },
|
|
521
522
|
type: "text",
|
|
522
|
-
onClick: t[1] || (t[1] =
|
|
523
|
+
onClick: t[1] || (t[1] = O(() => {}, ["stop"]))
|
|
523
524
|
}, {
|
|
524
|
-
default:
|
|
525
|
+
default: E(() => [...t[11] || (t[11] = [g(" 删除 ", -1)])]),
|
|
525
526
|
_: 1
|
|
526
|
-
}, 512), [[
|
|
527
|
+
}, 512), [[T, n.isLeaf]])]),
|
|
527
528
|
_: 2
|
|
528
529
|
}, 1032, ["onConfirm"])
|
|
529
|
-
], 512)), [[
|
|
530
|
-
e.contextMenuIcon && e.contextMenu && !e.readonly ?
|
|
530
|
+
], 512)), [[T, !r.loading && !a.loading]]) : p("v-if", !0),
|
|
531
|
+
e.contextMenuIcon && e.contextMenu && !e.readonly ? D((x(), m("span", Q, [_(c, {
|
|
531
532
|
style: { padding: "6px 10px 0" },
|
|
532
533
|
type: "text",
|
|
533
|
-
onClick:
|
|
534
|
+
onClick: O((e) => s.showContextMenu(e, r, n), ["stop"])
|
|
534
535
|
}, {
|
|
535
|
-
default:
|
|
536
|
+
default: E(() => [...t[12] || (t[12] = [g(" . . . ", -1)])]),
|
|
536
537
|
_: 1
|
|
537
|
-
}, 8, ["onClick"])], 512)), [[
|
|
538
|
-
], 8,
|
|
538
|
+
}, 8, ["onClick"])], 512)), [[T, !r.loading && !a.loading]]) : p("v-if", !0)
|
|
539
|
+
], 8, q))])]),
|
|
539
540
|
_: 3
|
|
540
541
|
}, 16, [
|
|
541
542
|
"default-expand-all",
|
|
@@ -550,46 +551,46 @@ function ee(e, t, n, i, a, s) {
|
|
|
550
551
|
"onNodeExpand",
|
|
551
552
|
"onNodeCollapse"
|
|
552
553
|
])),
|
|
553
|
-
e.contextMenu && !e.readonly ?
|
|
554
|
+
e.contextMenu && !e.readonly ? D((x(), m("div", {
|
|
554
555
|
key: 1,
|
|
555
556
|
ref: "contextMenu",
|
|
556
|
-
style:
|
|
557
|
+
style: b(a.position),
|
|
557
558
|
class: "menu"
|
|
558
|
-
}, [
|
|
559
|
+
}, [h("ul", ee, [S(e.$slots, "context-menu", {
|
|
559
560
|
curNode: a.curNode,
|
|
560
561
|
curData: a.curData
|
|
561
562
|
}, () => [
|
|
562
|
-
|
|
563
|
+
D(h("li", {
|
|
563
564
|
class: "menu-item",
|
|
564
565
|
onClick: t[4] || (t[4] = (e) => s.appendPeerNode(a.curNode, a.curData))
|
|
565
|
-
}, [t[15] || (t[15] =
|
|
566
|
+
}, [t[15] || (t[15] = h("i", {
|
|
566
567
|
class: "menu-item-icon el-icon-lx-add",
|
|
567
568
|
style: { color: "#228b22" }
|
|
568
|
-
}, null, -1)),
|
|
569
|
-
|
|
569
|
+
}, null, -1)), g(" " + C(e.menuLabel.appendPeer), 1)], 512), [[T, a.curData.id > -1]]),
|
|
570
|
+
h("li", {
|
|
570
571
|
class: "menu-item",
|
|
571
572
|
onClick: t[5] || (t[5] = (e) => s.appendChildNode(a.curNode, a.curData))
|
|
572
|
-
}, [t[16] || (t[16] =
|
|
573
|
+
}, [t[16] || (t[16] = h("i", {
|
|
573
574
|
class: "menu-item-icon el-icon-lx-add",
|
|
574
575
|
style: { color: "#228b22" }
|
|
575
|
-
}, null, -1)),
|
|
576
|
-
|
|
576
|
+
}, null, -1)), g(" " + C(e.menuLabel.appendChild), 1)]),
|
|
577
|
+
D(h("li", {
|
|
577
578
|
class: "menu-item",
|
|
578
579
|
onClick: t[6] || (t[6] = (e) => s.editNode(a.curNode, a.curData))
|
|
579
|
-
}, [t[17] || (t[17] =
|
|
580
|
+
}, [t[17] || (t[17] = h("i", {
|
|
580
581
|
class: "menu-item-icon el-icon-edit-outline",
|
|
581
582
|
style: { color: "#ffa500" }
|
|
582
|
-
}, null, -1)),
|
|
583
|
-
|
|
583
|
+
}, null, -1)), g(" " + C(e.menuLabel.editNode), 1)], 512), [[T, a.curData.id > -1]]),
|
|
584
|
+
D(h("li", {
|
|
584
585
|
class: "menu-item",
|
|
585
586
|
onClick: t[7] || (t[7] = (e) => s.removeNodeModal(a.curNode, a.curData))
|
|
586
|
-
}, [t[18] || (t[18] =
|
|
587
|
+
}, [t[18] || (t[18] = h("i", {
|
|
587
588
|
class: "menu-item-icon el-icon-delete",
|
|
588
589
|
style: { color: "#f00" }
|
|
589
|
-
}, null, -1)),
|
|
590
|
-
])])], 4)), [[
|
|
590
|
+
}, null, -1)), g(" " + C(e.menuLabel.removeNode), 1)], 512), [[T, a.curNode.isLeaf]])
|
|
591
|
+
])])], 4)), [[T, a.showMenu]]) : p("v-if", !0)
|
|
591
592
|
], 512)]);
|
|
592
593
|
}
|
|
593
|
-
var
|
|
594
|
+
var ne = /* @__PURE__ */ n(U, [["render", te]]);
|
|
594
595
|
//#endregion
|
|
595
|
-
export {
|
|
596
|
+
export { ne as default };
|