@web-utils/component 2.0.2 → 2.0.4

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.
Files changed (103) hide show
  1. package/dist/chunks/{7af3ceb1.js → 3a79781b.js} +3 -3
  2. package/dist/chunks/{df803484.js → 41a066be.js} +0 -0
  3. package/dist/chunks/{163eed3b.js → 5a78e0db.js} +0 -0
  4. package/dist/chunks/{6499de3a.js → 5d4282fb.js} +0 -0
  5. package/dist/chunks/{a73fe8ee.js → 61ad06b2.js} +0 -0
  6. package/dist/chunks/{86bcadec.js → 76680a03.js} +2 -2
  7. package/dist/chunks/{8bbde9bf.js → 8c0142e0.js} +0 -0
  8. package/dist/chunks/{90bd3d52.js → 97652d86.js} +5 -5
  9. package/dist/chunks/{92404ceb.js → b4acd3a6.js} +3 -3
  10. package/dist/chunks/{2bd4e340.js → f71045fc.js} +0 -0
  11. package/dist/components/address-input/index.js +2 -2
  12. package/dist/components/aside-menu/index.js +1 -1
  13. package/dist/components/awesome-button/index.js +1 -1
  14. package/dist/components/capsule-tab/index.js +1 -1
  15. package/dist/components/chunk-file-uploader/index.js +2 -2
  16. package/dist/components/chunk-file-uploader-button/index.js +2 -2
  17. package/dist/components/chunk-file-uploader-drop/index.js +2 -2
  18. package/dist/components/chunk-file-uploader-file/index.js +3 -3
  19. package/dist/components/chunk-file-uploader-files/index.js +2 -2
  20. package/dist/components/chunk-file-uploader-list/index.js +2 -2
  21. package/dist/components/chunk-file-uploader-un-support/index.js +2 -2
  22. package/dist/components/code-mirror-editor/index.js +1 -1
  23. package/dist/components/color-picker/index.js +1 -1
  24. package/dist/components/confirm-button/index.js +3 -3
  25. package/dist/components/confirmable/index.js +2 -2
  26. package/dist/components/context-menu/index.js +1 -1
  27. package/dist/components/custom-scrollbar/index.js +2 -3
  28. package/dist/components/data-table-picker/index.js +5 -5
  29. package/dist/components/dynamic-table/index.js +6 -6
  30. package/dist/components/e-charts/index.js +1 -1
  31. package/dist/components/editable-progress/index.js +1 -1
  32. package/dist/components/editable-tree/index.js +192 -192
  33. package/dist/components/egd-collapse/index.js +1 -1
  34. package/dist/components/egd-collapse-item/index.js +1 -1
  35. package/dist/components/element-dialog/index.js +7 -6
  36. package/dist/components/empty-view/index.js +2 -2
  37. package/dist/components/error-view/index.js +2 -2
  38. package/dist/components/flex-column/index.js +2 -2
  39. package/dist/components/flex-item/index.js +2 -2
  40. package/dist/components/flex-row/index.js +2 -2
  41. package/dist/components/flex-scroller/index.js +1 -1
  42. package/dist/components/form-button/index.js +2 -2
  43. package/dist/components/form-cascader/index.js +4 -4
  44. package/dist/components/form-checkbox-group/index.js +13 -13
  45. package/dist/components/form-date-picker/index.js +9 -9
  46. package/dist/components/form-holder/index.js +3 -3
  47. package/dist/components/form-input/index.js +3 -3
  48. package/dist/components/form-input-email/index.js +4 -4
  49. package/dist/components/form-input-id-card/index.js +4 -4
  50. package/dist/components/form-input-number/index.js +4 -4
  51. package/dist/components/form-input-phone-number/index.js +4 -4
  52. package/dist/components/form-input-time/index.js +6 -6
  53. package/dist/components/form-item/index.js +4 -5
  54. package/dist/components/form-item-config-provider/index.js +1 -1
  55. package/dist/components/form-item-group/index.js +2 -2
  56. package/dist/components/form-radio-group/index.js +13 -13
  57. package/dist/components/form-select/index.js +14 -14
  58. package/dist/components/form-switch/index.js +3 -3
  59. package/dist/components/form-textarea/index.js +3 -3
  60. package/dist/components/form-view/index.js +7 -7
  61. package/dist/components/guide-steps/index.js +1 -1
  62. package/dist/components/icon-card/index.js +1 -1
  63. package/dist/components/iframe-window/index.js +22 -61
  64. package/dist/components/iframe-window/style.css +1 -1
  65. package/dist/components/input-number/index.js +2 -2
  66. package/dist/components/input-number-range/index.js +2 -2
  67. package/dist/components/keep-view-alive/index.js +1 -1
  68. package/dist/components/loading-view/index.js +2 -2
  69. package/dist/components/nav-bar/index.js +2 -2
  70. package/dist/components/not-implement/index.js +2 -2
  71. package/dist/components/page/index.js +1 -1
  72. package/dist/components/page-header/index.js +2 -2
  73. package/dist/components/page-index/index.js +4 -4
  74. package/dist/components/page-index-top/index.js +3 -3
  75. package/dist/components/page-skeleton/index.js +1 -1
  76. package/dist/components/page-skeleton-new/index.js +4 -4
  77. package/dist/components/pageable-table/index.js +8 -8
  78. package/dist/components/pageable-view/index.js +5 -5
  79. package/dist/components/photo-swipe/index.js +5 -5
  80. package/dist/components/resize-observer/index.js +2 -2
  81. package/dist/components/search-popover/index.js +6 -6
  82. package/dist/components/sign-panel/index.js +11 -11
  83. package/dist/components/split-pane/index.js +1 -1
  84. package/dist/components/stateful/index.js +1 -1
  85. package/dist/components/static-pageable-table/index.js +2 -2
  86. package/dist/components/swiper/index.js +1 -1
  87. package/dist/components/tab/index.js +2 -2
  88. package/dist/components/tab-item/index.js +2 -2
  89. package/dist/components/table-column/index.js +1 -1
  90. package/dist/components/table-view/index.js +12 -12
  91. package/dist/components/tag-render/index.js +3 -3
  92. package/dist/components/tinymce-editor/index.js +3 -3
  93. package/dist/components/tinymce-wrapper/index.js +393 -393
  94. package/dist/components/toolbar/index.js +40 -40
  95. package/dist/components/toolbar-button/index.js +1 -1
  96. package/dist/components/trigger/index.js +1 -1
  97. package/dist/components/vue-tags-input/index.js +3 -3
  98. package/dist/components/watermark/index.js +2 -2
  99. package/dist/components/x-dialog/index.js +6 -6
  100. package/dist/index.css +12 -68
  101. package/dist/index.es.js +617 -656
  102. package/package.json +163 -162
  103. package/web-types.json +18 -2
@@ -1,11 +1,11 @@
1
- import { hasOwn as c, addResizeListener as u, removeResizeListener as p, isVerticalScrollbarVisible as x, scrollbarWidth as w, computePosition as N, isPlainObject as l, cloneDeep as f, isFunction as m, isUndefined as d, isNotEmpty as C, fastClone as v, delay as g, findTreeChildren as $ } from "@web-utils/core";
2
- import { a as b, b as _, c as h } from "../../chunks/2bd4e340.js";
3
- import { n as k } from "../../chunks/6499de3a.js";
1
+ import { hasOwn as d, addResizeListener as h, removeResizeListener as u, isVerticalScrollbarVisible as x, scrollbarWidth as w, computePosition as N, isPlainObject as r, cloneDeep as p, isFunction as f, isUndefined as l, isNotEmpty as C, fastClone as v, delay as g, findTreeChildren as $ } from "@web-utils/core";
2
+ import { a as b, b as _, c } from "../../chunks/f71045fc.js";
3
+ import { n as k } from "../../chunks/5d4282fb.js";
4
4
  var B = function() {
5
- var e = this, i = e.$createElement, t = e._self._c || i;
6
- return t("div", {
5
+ var e = this, t = e.$createElement, i = e._self._c || t;
6
+ return i("div", {
7
7
  staticClass: "editable-tree"
8
- }, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? t("ElButton", {
8
+ }, [!e.readonly && e.addRootNodeButtonStyle === "top-right" ? i("ElButton", {
9
9
  staticStyle: {
10
10
  position: "absolute",
11
11
  top: "4px",
@@ -22,18 +22,18 @@ var B = function() {
22
22
  plain: ""
23
23
  },
24
24
  on: {
25
- click: function(s) {
26
- return s.stopPropagation(), e.$emit("add-root-node");
25
+ click: function(a) {
26
+ return a.stopPropagation(), e.$emit("add-root-node");
27
27
  }
28
28
  }
29
- }) : e._e(), t("div", {
29
+ }) : e._e(), i("div", {
30
30
  ref: "treeWrapper",
31
31
  staticClass: "et-tree-wrapper"
32
- }, [!e.readonly && e.addRootNodeButtonStyle === "top" ? t("div", {
32
+ }, [!e.readonly && e.addRootNodeButtonStyle === "top" ? i("div", {
33
33
  staticStyle: {
34
34
  "padding-left": "24px"
35
35
  }
36
- }, [t("ElButton", {
36
+ }, [i("ElButton", {
37
37
  attrs: {
38
38
  disabled: e.loading,
39
39
  size: "mini",
@@ -42,9 +42,9 @@ var B = function() {
42
42
  on: {
43
43
  click: e.appendRootNode
44
44
  }
45
- }, [t("i", {
45
+ }, [i("i", {
46
46
  staticClass: "el-icon-lx-add"
47
- }), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `\u6DFB\u52A0${e.label}`) + " ")])], 1) : e._e(), t("ElTree", e._g(e._b({
47
+ }), e._v(" " + e._s(e.addRootNodeLabel ? e.addRootNodeLabel : `添加${e.label}`) + " ")])], 1) : e._e(), i("ElTree", e._g(e._b({
48
48
  key: e.treeKey,
49
49
  ref: "tree",
50
50
  staticClass: "flex-item",
@@ -66,18 +66,18 @@ var B = function() {
66
66
  },
67
67
  scopedSlots: e._u([{
68
68
  key: "default",
69
- fn: function(s) {
70
- var o = s.node, n = s.data;
69
+ fn: function(a) {
70
+ var o = a.node, s = a.data;
71
71
  return [e._t("default", function() {
72
- return [n.edit ? [t("span", {
72
+ return [s.edit ? [i("span", {
73
73
  staticClass: "custom-tree-node flex-row flex-item oh",
74
74
  attrs: {
75
- "data-id": n.id
75
+ "data-id": s.id
76
76
  }
77
- }, [e.icon ? t("i", {
77
+ }, [e.icon ? i("i", {
78
78
  staticClass: "node-icon shrink-0",
79
- class: n.loading ? "el-icon-loading" : "el-icon-edit-outline"
80
- }) : e._e(), t("ElInput", {
79
+ class: s.loading ? "el-icon-loading" : "el-icon-edit-outline"
80
+ }) : e._e(), i("ElInput", {
81
81
  ref: "labelTxt",
82
82
  staticClass: "node-input flex-item",
83
83
  attrs: {
@@ -85,32 +85,32 @@ var B = function() {
85
85
  placeholder: e.defaultOptions.inputPlaceholder
86
86
  },
87
87
  on: {
88
- blur: function(a) {
89
- return e.inputBlur(a, o, n);
88
+ blur: function(n) {
89
+ return e.inputBlur(n, o, s);
90
90
  }
91
91
  },
92
92
  nativeOn: {
93
- keyup: function(a) {
94
- return function(r) {
95
- return e.inputKeyup(r, o, n);
93
+ keyup: function(n) {
94
+ return function(y) {
95
+ return e.inputKeyup(y, o, s);
96
96
  }.apply(null, arguments);
97
97
  },
98
- click: function(a) {
99
- a.stopPropagation();
98
+ click: function(n) {
99
+ n.stopPropagation();
100
100
  }
101
101
  },
102
102
  model: {
103
103
  value: e.text,
104
- callback: function(a) {
105
- e.text = a;
104
+ callback: function(n) {
105
+ e.text = n;
106
106
  },
107
107
  expression: "text"
108
108
  }
109
- }), e.confirmButton ? [t("ElButton", {
109
+ }), e.confirmButton ? [i("ElButton", {
110
110
  directives: [{
111
111
  name: "show",
112
112
  rawName: "v-show",
113
- value: !n.loading,
113
+ value: !s.loading,
114
114
  expression: "!data.loading"
115
115
  }],
116
116
  staticClass: "shrink-0",
@@ -119,15 +119,15 @@ var B = function() {
119
119
  type: "text"
120
120
  },
121
121
  on: {
122
- click: function(a) {
123
- return a.stopPropagation(), e.onConfirm(o, n);
122
+ click: function(n) {
123
+ return n.stopPropagation(), e.onConfirm(o, s);
124
124
  }
125
125
  }
126
- }, [e._v("\u786E\u5B9A")]), t("ElButton", {
126
+ }, [e._v("确定")]), i("ElButton", {
127
127
  directives: [{
128
128
  name: "show",
129
129
  rawName: "v-show",
130
- value: !n.loading,
130
+ value: !s.loading,
131
131
  expression: "!data.loading"
132
132
  }],
133
133
  staticClass: "shrink-0",
@@ -136,26 +136,26 @@ var B = function() {
136
136
  type: "text"
137
137
  },
138
138
  on: {
139
- click: function(a) {
140
- return a.stopPropagation(), e.onCancel(o, n);
139
+ click: function(n) {
140
+ return n.stopPropagation(), e.onCancel(o, s);
141
141
  }
142
142
  }
143
- }, [e._v("\u53D6\u6D88")])] : e._e()], 2)] : [t("span", {
143
+ }, [e._v("取消")])] : e._e()], 2)] : [i("span", {
144
144
  staticClass: "custom-tree-node",
145
145
  attrs: {
146
- "data-id": n.id
146
+ "data-id": s.id
147
147
  }
148
- }, [t("span", {
148
+ }, [i("span", {
149
149
  staticClass: "node-label flex-row flex-item oh ellipsis-1"
150
- }, [e.icon ? t("i", {
150
+ }, [e.icon ? i("i", {
151
151
  staticClass: "node-icon",
152
- class: n.loading ? "el-icon-loading" : e.icon(n, o)
153
- }) : e._e(), t("span", {
152
+ class: s.loading ? "el-icon-loading" : e.icon(s, o)
153
+ }) : e._e(), i("span", {
154
154
  staticClass: "flex-item-relative",
155
155
  staticStyle: {
156
156
  height: "21px"
157
157
  }
158
- }, [t("span", {
158
+ }, [i("span", {
159
159
  staticClass: "ellipsis-1 absolute-box et-tree-label",
160
160
  attrs: {
161
161
  title: o.label
@@ -163,54 +163,54 @@ var B = function() {
163
163
  }, [e._t("label", function() {
164
164
  return [e._v(e._s(o.label))];
165
165
  }, {
166
- data: n,
166
+ data: s,
167
167
  node: o
168
168
  })], 2)]), e._t("label-suffix", null, {
169
169
  node: o,
170
- data: n
171
- })], 2), !e.contextMenu && !e.readonly ? t("span", {
170
+ data: s
171
+ })], 2), !e.contextMenu && !e.readonly ? i("span", {
172
172
  directives: [{
173
173
  name: "show",
174
174
  rawName: "v-show",
175
- value: !n.loading && !e.loading,
175
+ value: !s.loading && !e.loading,
176
176
  expression: "!data.loading && !loading"
177
177
  }],
178
178
  staticClass: "handle-actions"
179
- }, [t("ElButton", {
179
+ }, [i("ElButton", {
180
180
  attrs: {
181
181
  size: "mini",
182
182
  type: "text"
183
183
  },
184
184
  on: {
185
- click: function(a) {
186
- return a.stopPropagation(), e.appendChildNode(o, n);
185
+ click: function(n) {
186
+ return n.stopPropagation(), e.appendChildNode(o, s);
187
187
  }
188
188
  }
189
- }, [e._v("\u6DFB\u52A0")]), t("ElButton", {
189
+ }, [e._v("添加")]), i("ElButton", {
190
190
  attrs: {
191
191
  size: "mini",
192
192
  type: "text"
193
193
  },
194
194
  on: {
195
- click: function(a) {
196
- return a.stopPropagation(), e.editNode(o, n);
195
+ click: function(n) {
196
+ return n.stopPropagation(), e.editNode(o, s);
197
197
  }
198
198
  }
199
- }, [e._v("\u4FEE\u6539")]), t("ElPopconfirm", {
199
+ }, [e._v("修改")]), i("ElPopconfirm", {
200
200
  staticClass: "pop-confirm",
201
201
  attrs: {
202
202
  "icon-color": "red",
203
- title: "\u4F60\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F"
203
+ title: "你确定要删除吗?"
204
204
  },
205
205
  on: {
206
- confirm: function(a) {
207
- return e.removeNode(o, n);
206
+ confirm: function(n) {
207
+ return e.removeNode(o, s);
208
208
  }
209
209
  },
210
210
  scopedSlots: e._u([{
211
211
  key: "reference",
212
212
  fn: function() {
213
- return [t("ElButton", {
213
+ return [i("ElButton", {
214
214
  directives: [{
215
215
  name: "show",
216
216
  rawName: "v-show",
@@ -225,26 +225,26 @@ var B = function() {
225
225
  type: "text"
226
226
  },
227
227
  on: {
228
- click: function(a) {
229
- a.stopPropagation();
228
+ click: function(n) {
229
+ n.stopPropagation();
230
230
  }
231
231
  }
232
- }, [e._v("\u5220\u9664")])];
232
+ }, [e._v("删除")])];
233
233
  },
234
234
  proxy: !0
235
235
  }], null, !0)
236
- })], 1) : e._e(), e.contextMenuIcon && e.contextMenu && !e.readonly ? t("span", {
236
+ })], 1) : e._e(), e.contextMenuIcon && e.contextMenu && !e.readonly ? i("span", {
237
237
  directives: [{
238
238
  name: "show",
239
239
  rawName: "v-show",
240
- value: !n.loading && !e.loading,
240
+ value: !s.loading && !e.loading,
241
241
  expression: "!data.loading && !loading"
242
242
  }],
243
243
  staticClass: "handle-actions",
244
244
  staticStyle: {
245
245
  display: "inline-block"
246
246
  }
247
- }, [t("ElButton", {
247
+ }, [i("ElButton", {
248
248
  staticStyle: {
249
249
  padding: "6px 10px 0"
250
250
  },
@@ -253,18 +253,18 @@ var B = function() {
253
253
  type: "text"
254
254
  },
255
255
  on: {
256
- click: function(a) {
257
- return a.stopPropagation(), e.showContextMenu(a, n, o);
256
+ click: function(n) {
257
+ return n.stopPropagation(), e.showContextMenu(n, s, o);
258
258
  }
259
259
  }
260
260
  }, [e._v(". . .")])], 1) : e._e()])]];
261
261
  }, {
262
262
  node: o,
263
- data: n
263
+ data: s
264
264
  })];
265
265
  }
266
266
  }], null, !0)
267
- }, "ElTree", e.filterTreeProperties(e.$attrs), !1), e.filterTreeEvents(e.$listeners))), e.contextMenu && !e.readonly ? t("div", {
267
+ }, "ElTree", e.filterTreeProperties(e.$attrs), !1), e.filterTreeEvents(e.$listeners))), e.contextMenu && !e.readonly ? i("div", {
268
268
  directives: [{
269
269
  name: "show",
270
270
  rawName: "v-show",
@@ -274,10 +274,10 @@ var B = function() {
274
274
  ref: "contextMenu",
275
275
  staticClass: "menu",
276
276
  style: e.position
277
- }, [t("ul", {
277
+ }, [i("ul", {
278
278
  staticClass: "menu-list"
279
279
  }, [e._t("context-menu", function() {
280
- return [t("li", {
280
+ return [i("li", {
281
281
  directives: [{
282
282
  name: "show",
283
283
  rawName: "v-show",
@@ -286,28 +286,28 @@ var B = function() {
286
286
  }],
287
287
  staticClass: "menu-item",
288
288
  on: {
289
- click: function(s) {
289
+ click: function(a) {
290
290
  return e.appendPeerNode(e.curNode, e.curData);
291
291
  }
292
292
  }
293
- }, [t("i", {
293
+ }, [i("i", {
294
294
  staticClass: "menu-item-icon el-icon-lx-add",
295
295
  staticStyle: {
296
296
  color: "#228b22"
297
297
  }
298
- }), e._v(e._s(e.menuLabel.appendPeer) + " ")]), t("li", {
298
+ }), e._v(e._s(e.menuLabel.appendPeer) + " ")]), i("li", {
299
299
  staticClass: "menu-item",
300
300
  on: {
301
- click: function(s) {
301
+ click: function(a) {
302
302
  return e.appendChildNode(e.curNode, e.curData);
303
303
  }
304
304
  }
305
- }, [t("i", {
305
+ }, [i("i", {
306
306
  staticClass: "menu-item-icon el-icon-lx-add",
307
307
  staticStyle: {
308
308
  color: "#228b22"
309
309
  }
310
- }), e._v(e._s(e.menuLabel.appendChild) + " ")]), t("li", {
310
+ }), e._v(e._s(e.menuLabel.appendChild) + " ")]), i("li", {
311
311
  directives: [{
312
312
  name: "show",
313
313
  rawName: "v-show",
@@ -316,16 +316,16 @@ var B = function() {
316
316
  }],
317
317
  staticClass: "menu-item",
318
318
  on: {
319
- click: function(s) {
319
+ click: function(a) {
320
320
  return e.editNode(e.curNode, e.curData);
321
321
  }
322
322
  }
323
- }, [t("i", {
323
+ }, [i("i", {
324
324
  staticClass: "menu-item-icon el-icon-edit-outline",
325
325
  staticStyle: {
326
326
  color: "#ffa500"
327
327
  }
328
- }), e._v(e._s(e.menuLabel.editNode) + " ")]), t("li", {
328
+ }), e._v(e._s(e.menuLabel.editNode) + " ")]), i("li", {
329
329
  directives: [{
330
330
  name: "show",
331
331
  rawName: "v-show",
@@ -334,11 +334,11 @@ var B = function() {
334
334
  }],
335
335
  staticClass: "menu-item",
336
336
  on: {
337
- click: function(s) {
337
+ click: function(a) {
338
338
  return e.removeNodeModal(e.curNode, e.curData);
339
339
  }
340
340
  }
341
- }, [t("i", {
341
+ }, [i("i", {
342
342
  staticClass: "menu-item-icon el-icon-delete",
343
343
  staticStyle: {
344
344
  color: "#f00"
@@ -354,7 +354,7 @@ const M = {
354
354
  props: {
355
355
  label: {
356
356
  type: String,
357
- default: "\u4E66\u7B7E"
357
+ default: "书签"
358
358
  },
359
359
  addRootNodeLabel: {
360
360
  type: String
@@ -365,9 +365,9 @@ const M = {
365
365
  },
366
366
  newNodeBuilder: {
367
367
  type: Function,
368
- default: (e, i) => ({
368
+ default: (e, t) => ({
369
369
  name: e,
370
- parentId: i.id
370
+ parentId: t.id
371
371
  })
372
372
  },
373
373
  contextMenu: Boolean,
@@ -408,16 +408,16 @@ const M = {
408
408
  default: () => ({
409
409
  children: "children",
410
410
  label: "name",
411
- isLeaf: (e) => c(e, "hasChildren") ? !e.hasChildren : c(e, "hasChild") ? !e.hasChild : c(e, "children") && e.children ? e.children.length === 0 : !0
411
+ isLeaf: (e) => d(e, "hasChildren") ? !e.hasChildren : d(e, "hasChild") ? !e.hasChild : d(e, "children") && e.children ? e.children.length === 0 : !0
412
412
  })
413
413
  },
414
414
  menuLabel: {
415
415
  type: Object,
416
416
  default: () => ({
417
- appendPeer: "\u6DFB\u52A0\u540C\u7EA7\u8282\u70B9",
418
- appendChild: "\u6DFB\u52A0",
419
- removeNode: "\u5220\u9664",
420
- editNode: "\u4FEE\u6539"
417
+ appendPeer: "添加同级节点",
418
+ appendChild: "添加",
419
+ removeNode: "删除",
420
+ editNode: "修改"
421
421
  })
422
422
  },
423
423
  icon: {
@@ -456,12 +456,12 @@ const M = {
456
456
  computed: {
457
457
  defaultOptions() {
458
458
  return {
459
- confirmButtonText: "\u786E\u5B9A",
460
- cancelButtonText: "\u53D6\u6D88",
459
+ confirmButtonText: "确定",
460
+ cancelButtonText: "取消",
461
461
  closeOnClickModal: !1,
462
462
  modal: !0,
463
- inputErrorMessage: `${this.label}\u540D\u4E0D\u80FD\u4E3A\u7A7A\uFF01`,
464
- inputPlaceholder: `\u8BF7\u8F93\u5165${this.label}\u540D...`,
463
+ inputErrorMessage: `${this.label}名不能为空!`,
464
+ inputPlaceholder: `请输入${this.label}名...`,
465
465
  inputValidator: (e) => e != null && e.trim().length > 0
466
466
  };
467
467
  },
@@ -482,10 +482,10 @@ const M = {
482
482
  this.tryFetch();
483
483
  },
484
484
  mounted() {
485
- u(this.$refs.tree.$el, this.resize), u(this.$refs.treeWrapper, this.resize);
485
+ h(this.$refs.tree.$el, this.resize), h(this.$refs.treeWrapper, this.resize);
486
486
  },
487
487
  beforeDestroy() {
488
- p(this.$refs.tree.$el, this.resize), p(this.$refs.treeWrapper, this.resize);
488
+ u(this.$refs.tree.$el, this.resize), u(this.$refs.treeWrapper, this.resize);
489
489
  },
490
490
  methods: {
491
491
  filterTreeProperties: b,
@@ -494,49 +494,49 @@ const M = {
494
494
  this.reserveExpandKey && this.expandedKeys.push(e[this.nodeKey]);
495
495
  },
496
496
  removeExpandKey(e) {
497
- this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((i) => i !== e[this.nodeKey]));
497
+ this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((t) => t !== e[this.nodeKey]));
498
498
  },
499
499
  resize() {
500
500
  x(this.$refs.treeWrapper) ? this.right = 4 + w : this.right = 4;
501
501
  },
502
- async showContextMenu(e, i, t) {
503
- i.contextmenu === !1 || i.id === -1 || i.id === 0 || i.edit === !0 || this.contextMenu && (this.curNode = t, this.curData = i, this.showMenu = !0, this.$refs.tree.setCurrentKey(i.id), await this.$nextTick(), this.position = N(e, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
502
+ async showContextMenu(e, t, i) {
503
+ 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), await this.$nextTick(), this.position = N(e, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
504
504
  },
505
505
  hideContextMenu() {
506
506
  this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
507
507
  },
508
508
  async tryFetch() {
509
- var e, i;
509
+ var e;
510
510
  if (this.lazy === !1 && this.fetchApi) {
511
- const t = await this.fetchApi((i = (e = this.rootNode) == null ? void 0 : e.id) != null ? i : -1, {});
512
- if (l(t.data) && (t.data = [t.data]), t.data = t.data || [], this.empty = t.data.length === 0, l(this.customRootNode)) {
513
- const s = f(this.customRootNode);
514
- s[this.treeProps.children || "children"] = t.data, this.treeData = [s];
515
- } else if (m(this.customRootNode)) {
516
- const s = this.customRootNode(t.data);
517
- s[this.treeProps.children || "children"] = t.data, this.treeData = l(s) ? [s] : s;
511
+ const t = await this.fetchApi(((e = this.rootNode) == null ? void 0 : e.id) ?? -1, {});
512
+ if (r(t.data) && (t.data = [t.data]), t.data = t.data || [], this.empty = t.data.length === 0, r(this.customRootNode)) {
513
+ const i = p(this.customRootNode);
514
+ i[this.treeProps.children || "children"] = t.data, this.treeData = [i];
515
+ } else if (f(this.customRootNode)) {
516
+ const i = this.customRootNode(t.data);
517
+ i[this.treeProps.children || "children"] = t.data, this.treeData = r(i) ? [i] : i;
518
518
  } else
519
519
  this.treeData = t.data;
520
520
  }
521
521
  },
522
- async loadNode(e, i) {
523
- var t, s, o, n;
522
+ async loadNode(e, t) {
523
+ var i, a, o;
524
524
  if (e.level === 0) {
525
- const a = await this.fetchApi((s = (t = this.rootNode) == null ? void 0 : t.id) != null ? s : -1, e);
526
- if (this.empty = a.data.length === 0, l(this.customRootNode)) {
527
- const r = f(this.customRootNode);
528
- r[this.treeProps.children || "children"] = a.data, i([r]);
529
- } else if (m(this.customRootNode)) {
530
- const r = this.customRootNode(a.data);
531
- r[this.treeProps.children || "children"] = a.data, this.treeData = l(r) ? [r] : r;
525
+ const s = await this.fetchApi(((i = this.rootNode) == null ? void 0 : i.id) ?? -1, e);
526
+ if (this.empty = s.data.length === 0, r(this.customRootNode)) {
527
+ const n = p(this.customRootNode);
528
+ n[this.treeProps.children || "children"] = s.data, t([n]);
529
+ } else if (f(this.customRootNode)) {
530
+ const n = this.customRootNode(s.data);
531
+ n[this.treeProps.children || "children"] = s.data, this.treeData = r(n) ? [n] : n;
532
532
  } else
533
- i(a.data);
534
- await this.$nextTick(), this.$emit("root-node-loaded", a.data), this.defaultExpandedKeys ? this.expandedKeys = [(o = a == null ? void 0 : a.data[0]) == null ? void 0 : o.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(n = a == null ? void 0 : a.data[0]) == null ? void 0 : n.id]);
533
+ t(s.data);
534
+ await this.$nextTick(), this.$emit("root-node-loaded", s.data), this.defaultExpandedKeys ? this.expandedKeys = [(a = s == null ? void 0 : s.data[0]) == null ? void 0 : a.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(o = s == null ? void 0 : s.data[0]) == null ? void 0 : o.id]);
535
535
  } else {
536
536
  if (e.leaf || e.data.isTempNode)
537
- return i([]);
538
- const a = await this.fetchApi(e.data.id, e);
539
- i(a.data), await this.$nextTick(), this.$emit("node-loaded", a.data);
537
+ return t([]);
538
+ const s = await this.fetchApi(e.data.id, e);
539
+ t(s.data), await this.$nextTick(), this.$emit("node-loaded", s.data);
540
540
  }
541
541
  },
542
542
  clear() {
@@ -549,77 +549,77 @@ const M = {
549
549
  this.newChild && this.newChild.id === -1 && (console.log(this.newChild), this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
550
550
  },
551
551
  cancelEdit() {
552
- this.editData && (d(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
552
+ this.editData && (l(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
553
553
  },
554
- async editNode(e, i) {
555
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = i, this.text = i[this.treeProps.label], d(i.edit) ? this.$set(i, "edit", !0) : i.edit = !0, await this.$nextTick(), this.$refs.labelTxt.focus()) : await this.$prompt(`\u8BF7\u8F93\u5165\u65B0\u7684${this.label}\u540D\uFF1A`, {
554
+ async editNode(e, t) {
555
+ !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = t, this.text = t[this.treeProps.label], l(t.edit) ? this.$set(t, "edit", !0) : t.edit = !0, await this.$nextTick(), this.$refs.labelTxt.focus()) : await this.$prompt(`请输入新的${this.label}名:`, {
556
556
  ...this.defaultOptions,
557
- inputValue: i[this.treeProps.label],
558
- beforeClose: async (t, s, o) => {
559
- if (t === "confirm") {
557
+ inputValue: t[this.treeProps.label],
558
+ beforeClose: async (i, a, o) => {
559
+ if (i === "confirm") {
560
560
  try {
561
- s.confirmButtonLoading = !0, s.confirmButtonText = "\u5904\u7406\u4E2D...", this.text = s.inputValue, await this.onConfirm(this.curNode, this.curData), o();
561
+ a.confirmButtonLoading = !0, a.confirmButtonText = "处理中...", this.text = a.inputValue, await this.onConfirm(this.curNode, this.curData), o();
562
562
  } catch {
563
- s.confirmButtonText = "\u786E\u5B9A";
563
+ a.confirmButtonText = "确定";
564
564
  }
565
- s.confirmButtonLoading = !1;
565
+ a.confirmButtonLoading = !1;
566
566
  } else
567
567
  o();
568
568
  }
569
- }).catch((t) => t);
569
+ }).catch((i) => i);
570
570
  },
571
571
  async appendRootNode() {
572
- 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 this.$prompt(`\u8BF7\u8F93\u5165${this.label}\u540D\uFF1A`, {
572
+ 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 this.$prompt(`请输入${this.label}名:`, {
573
573
  ...this.defaultOptions,
574
- beforeClose: async (e, i, t) => {
574
+ beforeClose: async (e, t, i) => {
575
575
  if (e === "confirm") {
576
576
  try {
577
- this.createNewChild(-1), i.confirmButtonLoading = !0, i.confirmButtonText = "\u5904\u7406\u4E2D...";
578
- const s = await this.saveApi(this.newNodeBuilder(i.inputValue, { id: -1 }));
579
- this.newChild[this.treeProps.label] = i.inputValue, this.newChild.edit = !1, h(this.newChild, s.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.locateView(), t();
577
+ this.createNewChild(-1), t.confirmButtonLoading = !0, t.confirmButtonText = "处理中...";
578
+ const a = await this.saveApi(this.newNodeBuilder(t.inputValue, { id: -1 }));
579
+ this.newChild[this.treeProps.label] = t.inputValue, this.newChild.edit = !1, c(this.newChild, a.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), await this.locateView(), i();
580
580
  } catch {
581
- i.confirmButtonText = "\u786E\u5B9A";
581
+ t.confirmButtonText = "确定";
582
582
  }
583
- i.confirmButtonLoading = !1;
583
+ t.confirmButtonLoading = !1;
584
584
  } else
585
- t();
585
+ i();
586
586
  }
587
587
  }).catch((e) => e);
588
588
  },
589
589
  appendChildNode(e) {
590
590
  this.text = "";
591
- const i = e.expanded;
591
+ const t = e.expanded;
592
592
  e.expand(async () => {
593
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(i)) : await this.$prompt(`\u8BF7\u8F93\u5165${this.label}\u540D\uFF1A`, {
593
+ !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(e.data.id), this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(t)) : await this.$prompt(`请输入${this.label}名:`, {
594
594
  ...this.defaultOptions,
595
- beforeClose: async (t, s, o) => {
596
- if (t === "confirm") {
595
+ beforeClose: async (i, a, o) => {
596
+ if (i === "confirm") {
597
597
  try {
598
- this.createNewChild(e.data.id), s.confirmButtonLoading = !0, s.confirmButtonText = "\u5904\u7406\u4E2D...";
599
- const n = await this.saveApi(this.newNodeBuilder(s.inputValue, e.data));
600
- this.newChild[this.treeProps.label] = s.inputValue, this.newChild.edit = !1, h(this.newChild, n.data), this.$refs.tree.append(this.newChild, e), await this.locateView(), o();
598
+ this.createNewChild(e.data.id), a.confirmButtonLoading = !0, a.confirmButtonText = "处理中...";
599
+ const s = await this.saveApi(this.newNodeBuilder(a.inputValue, e.data));
600
+ this.newChild[this.treeProps.label] = a.inputValue, this.newChild.edit = !1, c(this.newChild, s.data), this.$refs.tree.append(this.newChild, e), await this.locateView(), o();
601
601
  } catch {
602
- s.confirmButtonText = "\u786E\u5B9A";
602
+ a.confirmButtonText = "确定";
603
603
  }
604
- s.confirmButtonLoading = !1;
604
+ a.confirmButtonLoading = !1;
605
605
  } else
606
606
  o();
607
607
  }
608
- }).catch((t) => t);
608
+ }).catch((i) => i);
609
609
  });
610
610
  },
611
- appendChildNodeWithData(e, i, t) {
611
+ appendChildNodeWithData(e, t, i) {
612
612
  this.text = "";
613
- const s = e.expanded;
613
+ const a = e.expanded;
614
614
  e.expand(async () => {
615
615
  this.clear(), this.newChild = {
616
616
  id: -1,
617
- parentId: i,
618
- [this.treeProps.label]: t,
617
+ parentId: t,
618
+ [this.treeProps.label]: i,
619
619
  edit: !1,
620
620
  isTempNode: !0,
621
621
  hasChildren: !1
622
- }, this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(s);
622
+ }, this.$refs.tree.append(this.newChild, e), await this.scrollIntoView(a);
623
623
  });
624
624
  },
625
625
  appendPeerNode(e) {
@@ -639,8 +639,8 @@ const M = {
639
639
  }) : await this.addRootNode(e);
640
640
  },
641
641
  updateNode(e) {
642
- const i = this.$refs.tree.getNode(e);
643
- i && (i.data = e);
642
+ const t = this.$refs.tree.getNode(e);
643
+ t && (t.data = e);
644
644
  },
645
645
  setCurrentKey(e) {
646
646
  this.$refs.tree && this.$refs.tree.setCurrentKey(e);
@@ -657,8 +657,8 @@ const M = {
657
657
  },
658
658
  async removeNodeModal(e) {
659
659
  await this.$confirm(
660
- `\u4F60\u786E\u5B9A\u8981\u5220\u9664${this.label}[<span class="break-word" style="color: orange">${e.data[this.treeProps.label]}</span>]\u5417\uFF1F`,
661
- "\u7CFB\u7EDF\u63D0\u793A",
660
+ `你确定要删除${this.label}[<span class="break-word" style="color: orange">${e.data[this.treeProps.label]}</span>]吗?`,
661
+ "系统提示",
662
662
  {
663
663
  type: "warning",
664
664
  modal: !0,
@@ -667,54 +667,54 @@ const M = {
667
667
  closeOnClickModal: !1,
668
668
  confirmButtonClass: "el-button--danger",
669
669
  cancelButtonClass: "el-button--primary is-plain",
670
- beforeClose: async (i, t, s) => {
671
- if (i === "confirm") {
670
+ beforeClose: async (t, i, a) => {
671
+ if (t === "confirm") {
672
672
  try {
673
- t.confirmButtonLoading = !0, t.confirmButtonText = "\u5220\u9664...";
674
- const o = e.parent, n = await this.deleteApi(e.data.id);
675
- n.code === 0 ? (this.$message.success("\u5220\u9664\u6210\u529F!"), this.$refs.tree.remove(e), this.$emit("node-deleted", o, e.data), s()) : this.$message.error(n.message);
673
+ i.confirmButtonLoading = !0, i.confirmButtonText = "删除...";
674
+ const o = e.parent, s = await this.deleteApi(e.data.id);
675
+ s.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", o, e.data), a()) : this.$message.error(s.message);
676
676
  } catch {
677
677
  }
678
- t.confirmButtonText = "\u786E\u5B9A", t.confirmButtonLoading = !1;
678
+ i.confirmButtonText = "确定", i.confirmButtonLoading = !1;
679
679
  } else
680
- s();
680
+ a();
681
681
  }
682
682
  }
683
- ).catch((i) => i);
683
+ ).catch((t) => t);
684
684
  },
685
685
  async removeNode(e) {
686
686
  try {
687
- const i = e.parent;
687
+ const t = e.parent;
688
688
  if (this.deleteApi) {
689
- const t = await this.deleteApi(e.data.id);
690
- t.code === 0 ? (this.$message.success("\u5220\u9664\u6210\u529F!"), this.$refs.tree.remove(e), this.$emit("node-deleted", i, e.data)) : this.$message.error(t.message);
689
+ const i = await this.deleteApi(e.data.id);
690
+ i.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(e), this.$emit("node-deleted", t, e.data)) : this.$message.error(i.message);
691
691
  } else
692
692
  this.$refs.tree.remove(e);
693
693
  } catch {
694
694
  }
695
695
  },
696
- async onConfirm(e, i) {
697
- if (i[this.treeProps.label] === this.text || !C(this.text)) {
696
+ async onConfirm(e, t) {
697
+ if (t[this.treeProps.label] === this.text || !C(this.text)) {
698
698
  this.clear();
699
699
  return;
700
700
  }
701
- d(i.loading) ? this.$set(i, "loading", !0) : i.loading = !0;
701
+ l(t.loading) ? this.$set(t, "loading", !0) : t.loading = !0;
702
702
  try {
703
- if (this.loading = !0, i.id === -1) {
704
- const t = await this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), s = v(i);
705
- h(i, { ...t.data, isTempNode: !1 }), this.$emit("node-added", i, s, e), this.registerNode(e);
703
+ if (this.loading = !0, t.id === -1) {
704
+ const i = await this.saveApi(this.newNodeBuilder(this.text, e.parent.data || { id: -1 })), a = v(t);
705
+ c(t, { ...i.data, isTempNode: !1 }), this.$emit("node-added", t, a, e), this.registerNode(e);
706
706
  } else
707
- await this.updateApi({ ...i, [this.treeProps.label]: this.text });
708
- i[this.treeProps.label] = this.text, i.edit = !1, this.$emit("node-updated", i, e), this.text = "";
707
+ await this.updateApi({ ...t, [this.treeProps.label]: this.text });
708
+ t[this.treeProps.label] = this.text, t.edit = !1, this.$emit("node-updated", t, e), this.text = "";
709
709
  } catch {
710
710
  }
711
- i.loading = !1, this.loading = !1;
711
+ t.loading = !1, this.loading = !1;
712
712
  },
713
- onCancel(e, i) {
714
- i.id === -1 ? this.$refs.tree.remove(e) : i.edit = !1, this.text = "";
713
+ onCancel(e, t) {
714
+ t.id === -1 ? this.$refs.tree.remove(e) : t.edit = !1, this.text = "";
715
715
  },
716
- nodeClick(e, i, t) {
717
- this.hideContextMenu(), (d(e.loading) || !e.loading) && (this.curNode = i, this.curData = e, this.$emit("on-node-click", e, i, t));
716
+ nodeClick(e, t, i) {
717
+ this.hideContextMenu(), (l(e.loading) || !e.loading) && (this.curNode = t, this.curData = e, this.$emit("on-node-click", e, t, i));
718
718
  },
719
719
  getCurrentNode() {
720
720
  return this.$refs.tree.getCurrentNode();
@@ -725,14 +725,14 @@ const M = {
725
725
  e && e.scrollIntoView();
726
726
  },
727
727
  async scrollIntoView(e) {
728
- var i, t;
729
- await this.$nextTick(), e || await g(300), (t = (i = this.$refs) == null ? void 0 : i.labelTxt) == null || t.focus();
728
+ var t, i;
729
+ await this.$nextTick(), e || await g(300), (i = (t = this.$refs) == null ? void 0 : t.labelTxt) == null || i.focus();
730
730
  },
731
- inputKeyup(e, i, t) {
732
- e.keyCode === 13 && this.onConfirm(i, t), e.keyCode === 27 && this.clear();
731
+ inputKeyup(e, t, i) {
732
+ e.keyCode === 13 && this.onConfirm(t, i), e.keyCode === 27 && this.clear();
733
733
  },
734
- inputBlur(e, i, t) {
735
- this.confirmButton || this.onConfirm(i, t);
734
+ inputBlur(e, t, i) {
735
+ this.confirmButton || this.onConfirm(t, i);
736
736
  },
737
737
  getCheckedKeys() {
738
738
  return this.$refs.tree.getCheckedKeys();
@@ -755,7 +755,7 @@ const M = {
755
755
  findTreeNode(e) {
756
756
  return $(
757
757
  this.$refs.tree.root.childNodes,
758
- (i) => i.data === e || i.data.id === e,
758
+ (t) => t.data === e || t.data.id === e,
759
759
  "childNodes"
760
760
  );
761
761
  },
@@ -766,7 +766,7 @@ const M = {
766
766
  this.lazy ? this.treeKey = Date.now() : await this.tryFetch();
767
767
  }
768
768
  }
769
- }, y = {};
769
+ }, m = {};
770
770
  var K = /* @__PURE__ */ k(
771
771
  M,
772
772
  B,
@@ -778,8 +778,8 @@ var K = /* @__PURE__ */ k(
778
778
  null
779
779
  );
780
780
  function P(e) {
781
- for (let i in y)
782
- this[i] = y[i];
781
+ for (let t in m)
782
+ this[t] = m[t];
783
783
  }
784
784
  const R = /* @__PURE__ */ function() {
785
785
  return K.exports;