@web-utils/component 2.7.29 → 2.7.31

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 (329) hide show
  1. package/dist/chunks/{config.7dec2bf2.js → config.75161c38.js} +29 -29
  2. package/dist/chunks/confirmable-mixin.851d6299.js +137 -0
  3. package/dist/chunks/dataformat.b8c8c01a.js +237 -0
  4. package/dist/chunks/detail.6135ade5.js +55 -0
  5. package/dist/chunks/dic.e57b75f2.js +215 -0
  6. package/dist/chunks/{event.fc358074.js → event.812c361c.js} +54 -23
  7. package/dist/chunks/{form-input-mixin.760cd65d.js → form-input-mixin.3e63b57f.js} +4 -4
  8. package/dist/chunks/{form-item-mixin.fa314b67.js → form-item-mixin.a56c101a.js} +44 -17
  9. package/dist/chunks/{form-pick-mixin.c4e0391b.js → form-pick-mixin.822300f3.js} +1 -1
  10. package/dist/chunks/{init.e0133910.js → init.38cbb3a2.js} +41 -21
  11. package/dist/chunks/{input-number-mixin.6849fa63.js → input-number-mixin.44b78389.js} +4 -4
  12. package/dist/chunks/{mixins.6a394a6c.js → mixins.e1939731.js} +3 -2
  13. package/dist/chunks/{packages.419bde01.js → packages.c4ea639d.js} +12 -6
  14. package/dist/chunks/{permission.07c49abf.js → permission.9c766972.js} +6 -1
  15. package/dist/chunks/slot.55598d0f.js +35 -0
  16. package/dist/chunks/{tab-mixin.9d568df9.js → tab-mixin.9d848bf6.js} +29 -11
  17. package/dist/chunks/util.b0d0b0ad.js +478 -0
  18. package/dist/chunks/{utils.d7f73f8d.js → utils.2a3ffac9.js} +89 -24
  19. package/dist/chunks/{utils.f44207f4.js → utils.a8891d2c.js} +9 -5
  20. package/dist/chunks/vueComponentNormalizer.9c6b8b3d.js +59 -0
  21. package/dist/components/address-input/index.js +30 -17
  22. package/dist/components/address-input/style.css +15 -1
  23. package/dist/components/affix/index.js +78 -28
  24. package/dist/components/affix/style.css +5 -1
  25. package/dist/components/aside-menu/index.js +14 -8
  26. package/dist/components/aside-menu/style.css +9 -1
  27. package/dist/components/avatar/index.js +33 -15
  28. package/dist/components/avatar/style.css +57 -1
  29. package/dist/components/awesome-button/index.js +45 -31
  30. package/dist/components/base.css +410 -1
  31. package/dist/components/capsule-tab/index.js +13 -7
  32. package/dist/components/capsule-tab/style.css +32 -1
  33. package/dist/components/card/index.js +33 -20
  34. package/dist/components/card/style.css +90 -1
  35. package/dist/components/carousel/index.js +18 -12
  36. package/dist/components/carousel/style.css +41 -1
  37. package/dist/components/chat/index.js +245 -139
  38. package/dist/components/chat/style.css +279 -1
  39. package/dist/components/chunk-file-uploader/index.js +63 -29
  40. package/dist/components/chunk-file-uploader/style.css +4 -1
  41. package/dist/components/chunk-file-uploader-button/index.js +15 -9
  42. package/dist/components/chunk-file-uploader-button/style.css +17 -1
  43. package/dist/components/chunk-file-uploader-drop/index.js +45 -27
  44. package/dist/components/chunk-file-uploader-drop/style.css +12 -1
  45. package/dist/components/chunk-file-uploader-file/index.js +150 -73
  46. package/dist/components/chunk-file-uploader-file/style.css +125 -1
  47. package/dist/components/chunk-file-uploader-files/index.js +15 -9
  48. package/dist/components/chunk-file-uploader-files/style.css +9 -1
  49. package/dist/components/chunk-file-uploader-list/index.js +16 -10
  50. package/dist/components/chunk-file-uploader-list/style.css +9 -1
  51. package/dist/components/chunk-file-uploader-un-support/index.js +18 -10
  52. package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
  53. package/dist/components/code-mirror-editor/index.js +75 -47
  54. package/dist/components/code-mirror-editor/style.css +17 -1
  55. package/dist/components/color-picker/index.js +62 -39
  56. package/dist/components/column/index.js +54 -29
  57. package/dist/components/column-default/index.js +47 -33
  58. package/dist/components/column-dynamic/index.js +26 -19
  59. package/dist/components/column-menu/index.js +98 -86
  60. package/dist/components/column-slot/index.js +135 -75
  61. package/dist/components/comment/index.js +28 -15
  62. package/dist/components/comment/style.css +92 -1
  63. package/dist/components/confirm-button/index.js +7 -5
  64. package/dist/components/confirmable/index.js +5 -4
  65. package/dist/components/context-menu/index.js +54 -32
  66. package/dist/components/context-menu/style.css +88 -1
  67. package/dist/components/count-up/index.js +55 -38
  68. package/dist/components/custom-scrollbar/index.js +45 -21
  69. package/dist/components/data-box/index.js +22 -16
  70. package/dist/components/data-box/style.css +58 -1
  71. package/dist/components/data-card/index.js +21 -15
  72. package/dist/components/data-card/style.css +46 -1
  73. package/dist/components/data-cardtext/index.js +19 -13
  74. package/dist/components/data-cardtext/style.css +36 -1
  75. package/dist/components/data-display/index.js +22 -16
  76. package/dist/components/data-display/style.css +37 -1
  77. package/dist/components/data-icons/index.js +23 -17
  78. package/dist/components/data-icons/style.css +53 -1
  79. package/dist/components/data-imgtext/index.js +26 -20
  80. package/dist/components/data-imgtext/style.css +70 -1
  81. package/dist/components/data-operatext/index.js +20 -14
  82. package/dist/components/data-operatext/style.css +81 -1
  83. package/dist/components/data-panel/index.js +21 -15
  84. package/dist/components/data-panel/style.css +37 -1
  85. package/dist/components/data-pay/index.js +29 -23
  86. package/dist/components/data-pay/style.css +102 -1
  87. package/dist/components/data-price/index.js +19 -13
  88. package/dist/components/data-price/style.css +81 -1
  89. package/dist/components/data-progress/index.js +26 -20
  90. package/dist/components/data-progress/style.css +30 -1
  91. package/dist/components/data-rotate/index.js +21 -15
  92. package/dist/components/data-rotate/style.css +50 -1
  93. package/dist/components/data-table-picker/index.js +47 -28
  94. package/dist/components/data-tabs/index.js +22 -16
  95. package/dist/components/data-tabs/style.css +70 -1
  96. package/dist/components/dialog-column/index.js +46 -33
  97. package/dist/components/dialog-excel/index.js +102 -53
  98. package/dist/components/dialog-filter/index.js +64 -51
  99. package/dist/components/dialog-form/index.js +56 -115
  100. package/dist/components/dialog-form/style.css +10 -1
  101. package/dist/components/dynamic-table/index.js +66 -42
  102. package/dist/components/dynamic-table/style.css +30 -1
  103. package/dist/components/e-charts/index.js +127 -46
  104. package/dist/components/e-charts/style.css +10 -1
  105. package/dist/components/easy-popup/index.js +32 -14
  106. package/dist/components/easy-popup/style.css +18 -1
  107. package/dist/components/editable-progress/index.js +64 -31
  108. package/dist/components/editable-progress/style.css +37 -1
  109. package/dist/components/editable-tree/index.js +513 -287
  110. package/dist/components/editable-tree/style.css +82 -1
  111. package/dist/components/egd-collapse/index.js +25 -12
  112. package/dist/components/egd-collapse-item/index.js +41 -25
  113. package/dist/components/element-dialog/index.js +101 -48
  114. package/dist/components/element-dialog/style.css +88 -1
  115. package/dist/components/empty-view/index.js +13 -7
  116. package/dist/components/empty-view/style.css +17 -1
  117. package/dist/components/error-view/index.js +12 -6
  118. package/dist/components/error-view/style.css +17 -1
  119. package/dist/components/flex-column/index.js +39 -17
  120. package/dist/components/flex-item/index.js +59 -24
  121. package/dist/components/flex-row/index.js +39 -17
  122. package/dist/components/flex-scroller/index.js +13 -7
  123. package/dist/components/flex-scroller/style.css +20 -1
  124. package/dist/components/flow/index.js +116 -64
  125. package/dist/components/flow/style.css +44 -1
  126. package/dist/components/flow-node/index.js +29 -21
  127. package/dist/components/flow-viewer/index.js +97 -52
  128. package/dist/components/flow-viewer/style.css +19 -1
  129. package/dist/components/form-button/index.js +12 -8
  130. package/dist/components/form-cascader/index.js +55 -40
  131. package/dist/components/form-checkbox-group/index.js +90 -60
  132. package/dist/components/form-checkbox-group/style.css +51 -1
  133. package/dist/components/form-date-picker/index.js +113 -44
  134. package/dist/components/form-group/index.js +23 -17
  135. package/dist/components/form-group/style.css +76 -1
  136. package/dist/components/form-holder/index.js +41 -30
  137. package/dist/components/form-input/index.js +42 -31
  138. package/dist/components/form-input-email/index.js +47 -30
  139. package/dist/components/form-input-id-card/index.js +40 -29
  140. package/dist/components/form-input-number/index.js +50 -38
  141. package/dist/components/form-input-number/style.css +12 -1
  142. package/dist/components/form-input-phone-number/index.js +40 -29
  143. package/dist/components/form-input-time/index.js +40 -29
  144. package/dist/components/form-item/index.js +99 -47
  145. package/dist/components/form-item/style.css +11 -1
  146. package/dist/components/form-item-config-provider/index.js +9 -8
  147. package/dist/components/form-item-group/index.js +69 -43
  148. package/dist/components/form-item-group/style.css +30 -1
  149. package/dist/components/form-radio-group/index.js +77 -53
  150. package/dist/components/form-radio-group/style.css +53 -1
  151. package/dist/components/form-select/index.js +71 -51
  152. package/dist/components/form-switch/index.js +41 -30
  153. package/dist/components/form-temp/index.js +49 -29
  154. package/dist/components/form-textarea/index.js +45 -34
  155. package/dist/components/form-view/index.js +152 -81
  156. package/dist/components/form-view/style.css +158 -1
  157. package/dist/components/fy-array/index.js +51 -43
  158. package/dist/components/fy-array/style.css +18 -1
  159. package/dist/components/fy-article/index.js +24 -13
  160. package/dist/components/fy-article/style.css +40 -1
  161. package/dist/components/fy-cascader/index.js +39 -29
  162. package/dist/components/fy-checkbox/index.js +38 -27
  163. package/dist/components/fy-checkbox/style.css +15 -1
  164. package/dist/components/fy-code/index.js +19 -12
  165. package/dist/components/fy-curd/index.js +290 -152
  166. package/dist/components/fy-curd/style.css +239 -1
  167. package/dist/components/fy-date/index.js +24 -18
  168. package/dist/components/fy-date/style.css +21 -1
  169. package/dist/components/fy-dialog-form/index.js +127 -54
  170. package/dist/components/fy-draggable/index.js +196 -73
  171. package/dist/components/fy-draggable/style.css +136 -1
  172. package/dist/components/fy-dynamic/index.js +116 -73
  173. package/dist/components/fy-dynamic/style.css +35 -1
  174. package/dist/components/fy-empty/index.js +15 -9
  175. package/dist/components/fy-empty/style.css +24 -1
  176. package/dist/components/fy-form/index.js +399 -221
  177. package/dist/components/fy-form/style.css +79 -1
  178. package/dist/components/fy-form-design/index.js +2267 -1630
  179. package/dist/components/fy-form-design/style.css +578 -1
  180. package/dist/components/fy-form-menu/index.js +43 -35
  181. package/dist/components/fy-input/index.js +46 -35
  182. package/dist/components/fy-input-color/index.js +40 -33
  183. package/dist/components/fy-input-icon/index.js +58 -37
  184. package/dist/components/fy-input-icon/style.css +39 -1
  185. package/dist/components/fy-input-map/index.js +113 -68
  186. package/dist/components/fy-input-map/style.css +50 -1
  187. package/dist/components/fy-input-number/index.js +29 -24
  188. package/dist/components/fy-input-table/index.js +82 -48
  189. package/dist/components/fy-input-table/style.css +10 -1
  190. package/dist/components/fy-input-tree/index.js +104 -60
  191. package/dist/components/fy-input-tree/style.css +25 -1
  192. package/dist/components/fy-progress/index.js +15 -10
  193. package/dist/components/fy-radio/index.js +20 -14
  194. package/dist/components/fy-radio/style.css +12 -1
  195. package/dist/components/fy-rate/index.js +21 -15
  196. package/dist/components/fy-rate/style.css +9 -1
  197. package/dist/components/fy-select/index.js +73 -55
  198. package/dist/components/fy-select/style.css +25 -1
  199. package/dist/components/fy-slider/index.js +22 -17
  200. package/dist/components/fy-switch/index.js +17 -12
  201. package/dist/components/fy-tabs/index.js +20 -12
  202. package/dist/components/fy-tabs/style.css +6 -0
  203. package/dist/components/fy-time/index.js +29 -18
  204. package/dist/components/fy-title/index.js +16 -8
  205. package/dist/components/fy-title/style.css +11 -1
  206. package/dist/components/fy-tree/index.js +135 -72
  207. package/dist/components/fy-tree/style.css +46 -1
  208. package/dist/components/fy-u-editor/index.js +172 -67
  209. package/dist/components/fy-u-editor/style.css +15 -1
  210. package/dist/components/fy-upload/index.js +317 -148
  211. package/dist/components/fy-upload/style.css +60 -1
  212. package/dist/components/guide-steps/index.js +31 -17
  213. package/dist/components/guide-steps/style.css +34 -1
  214. package/dist/components/header-menu/index.js +86 -66
  215. package/dist/components/header-search/index.js +92 -60
  216. package/dist/components/highlight-j-s/index.js +28 -15
  217. package/dist/components/highlight-j-s/style.css +21 -1
  218. package/dist/components/icon-card/index.js +13 -7
  219. package/dist/components/icon-card/style.css +56 -1
  220. package/dist/components/icon-temp/index.js +12 -6
  221. package/dist/components/icon-temp/style.css +21 -1
  222. package/dist/components/iframe-window/index.js +20 -14
  223. package/dist/components/iframe-window/style.css +20 -1
  224. package/dist/components/image-cropper/index.js +71 -162
  225. package/dist/components/image-cropper/style.css +34 -1
  226. package/dist/components/image-preview/index.js +78 -170
  227. package/dist/components/image-preview/style.css +72 -1
  228. package/dist/components/image-viewer/index.js +40 -22
  229. package/dist/components/image-viewer/style.css +21 -1
  230. package/dist/components/input-number/index.js +122 -56
  231. package/dist/components/input-number/style.css +15 -1
  232. package/dist/components/input-number-range/index.js +32 -20
  233. package/dist/components/input-number-range/style.css +12 -1
  234. package/dist/components/keep-view-alive/index.js +68 -21
  235. package/dist/components/keyboard/index.js +217 -132
  236. package/dist/components/keyboard/style.css +547 -1
  237. package/dist/components/license/index.js +81 -35
  238. package/dist/components/loading-view/index.js +12 -6
  239. package/dist/components/loading-view/style.css +17 -1
  240. package/dist/components/login/index.js +91 -62
  241. package/dist/components/login/style.css +25 -1
  242. package/dist/components/name-avatar/index.js +32 -10
  243. package/dist/components/name-avatar/style.css +35 -1
  244. package/dist/components/nav-bar/index.js +21 -11
  245. package/dist/components/nav-bar/style.css +17 -1
  246. package/dist/components/not-implement/index.js +16 -8
  247. package/dist/components/not-implement/style.css +15 -1
  248. package/dist/components/notice/index.js +40 -27
  249. package/dist/components/notice/style.css +54 -1
  250. package/dist/components/page/index.js +13 -7
  251. package/dist/components/page/style.css +12 -1
  252. package/dist/components/page-header/index.js +15 -9
  253. package/dist/components/page-header/style.css +14 -1
  254. package/dist/components/page-index/index.js +62 -37
  255. package/dist/components/page-index/style.css +23 -1
  256. package/dist/components/page-index-top/index.js +53 -34
  257. package/dist/components/page-skeleton/index.js +15 -9
  258. package/dist/components/page-skeleton/style.css +23 -1
  259. package/dist/components/page-skeleton-new/index.js +15 -9
  260. package/dist/components/page-skeleton-new/style.css +42 -1
  261. package/dist/components/pageable-table/index.js +187 -106
  262. package/dist/components/pageable-table/style.css +72 -1
  263. package/dist/components/pageable-view/index.js +164 -80
  264. package/dist/components/pageable-view/style.css +69 -1
  265. package/dist/components/photo-swipe/index.js +92 -46
  266. package/dist/components/process-designer/index.js +961 -772
  267. package/dist/components/process-designer/style.css +1186 -1
  268. package/dist/components/properties-panel/index.js +1488 -1044
  269. package/dist/components/properties-panel/style.css +122 -1
  270. package/dist/components/queue/index.js +24 -12
  271. package/dist/components/record-video/index.js +53 -27
  272. package/dist/components/record-video/style.css +53 -1
  273. package/dist/components/resize-observer/index.js +52 -18
  274. package/dist/components/resize-observer/style.css +31 -1
  275. package/dist/components/search/index.js +41 -22
  276. package/dist/components/search/style.css +57 -1
  277. package/dist/components/search-popover/index.js +153 -91
  278. package/dist/components/search-popover/style.css +93 -1
  279. package/dist/components/sign/index.js +138 -35
  280. package/dist/components/sign/style.css +12 -1
  281. package/dist/components/sign-panel/index.js +96 -46
  282. package/dist/components/sign-panel/style.css +97 -1
  283. package/dist/components/skeleton/index.js +22 -12
  284. package/dist/components/skeleton/style.css +61 -1
  285. package/dist/components/split-pane/index.js +125 -60
  286. package/dist/components/split-pane/style.css +100 -1
  287. package/dist/components/stateful/index.js +8 -5
  288. package/dist/components/stateful/style.css +33 -1
  289. package/dist/components/static-pageable-table/index.js +22 -15
  290. package/dist/components/static-pageable-table/style.css +9 -1
  291. package/dist/components/swiper/index.js +127 -58
  292. package/dist/components/swiper/style.css +43 -1
  293. package/dist/components/tab/index.js +34 -16
  294. package/dist/components/tab/style.css +122 -1
  295. package/dist/components/tab-item/index.js +14 -9
  296. package/dist/components/table-column/index.js +26 -17
  297. package/dist/components/table-page/index.js +42 -23
  298. package/dist/components/table-view/index.js +162 -87
  299. package/dist/components/table-view/style.css +95 -1
  300. package/dist/components/tag-render/index.js +41 -22
  301. package/dist/components/tag-render/style.css +33 -1
  302. package/dist/components/text-ellipsis/index.js +48 -26
  303. package/dist/components/text-ellipsis/style.css +9 -1
  304. package/dist/components/tinymce-editor/index.js +80 -60
  305. package/dist/components/tinymce-editor/style.css +43 -1
  306. package/dist/components/tinymce-wrapper/index.js +77 -41
  307. package/dist/components/tinymce-wrapper/style.css +36 -1
  308. package/dist/components/toolbar/index.js +46 -25
  309. package/dist/components/toolbar/style.css +39 -1
  310. package/dist/components/toolbar-button/index.js +46 -35
  311. package/dist/components/toolbar-button/style.css +21 -1
  312. package/dist/components/trigger/index.js +15 -8
  313. package/dist/components/verify/index.js +15 -8
  314. package/dist/components/verify/style.css +15 -1
  315. package/dist/components/vue-tags-input/index.js +233 -113
  316. package/dist/components/vue-tags-input/style.css +688 -1
  317. package/dist/components/watermark/index.js +33 -14
  318. package/dist/components/watermark/style.css +11 -1
  319. package/dist/index.css +2434 -1750
  320. package/dist/index.es.js +15982 -9409
  321. package/package.json +4 -4
  322. package/web-types.json +1 -1
  323. package/dist/chunks/confirmable-mixin.35bd1934.js +0 -104
  324. package/dist/chunks/dataformat.9cc4428a.js +0 -158
  325. package/dist/chunks/detail.544c52b0.js +0 -29
  326. package/dist/chunks/dic.9de2fe5a.js +0 -135
  327. package/dist/chunks/slot.a7387ecc.js +0 -27
  328. package/dist/chunks/util.89913643.js +0 -261
  329. package/dist/chunks/vueComponentNormalizer.77ec6792.js +0 -32
@@ -1,59 +1,73 @@
1
- var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
2
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
6
9
  for (var prop in b || (b = {}))
7
- __hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
8
12
  if (__getOwnPropSymbols)
9
- for (var prop of __getOwnPropSymbols(b))
10
- __propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
11
- return a;
12
- }, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13
- var __async = (__this, __arguments, generator) => new Promise((resolve, reject) => {
14
- var fulfilled = (value) => {
15
- try {
16
- step(generator.next(value));
17
- } catch (e) {
18
- reject(e);
19
- }
20
- }, rejected = (value) => {
21
- try {
22
- step(generator.throw(value));
23
- } catch (e) {
24
- reject(e);
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
25
16
  }
26
- }, step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
27
- step((generator = generator.apply(__this, __arguments)).next());
28
- });
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __async = (__this, __arguments, generator) => {
21
+ return new Promise((resolve, reject) => {
22
+ var fulfilled = (value) => {
23
+ try {
24
+ step(generator.next(value));
25
+ } catch (e) {
26
+ reject(e);
27
+ }
28
+ };
29
+ var rejected = (value) => {
30
+ try {
31
+ step(generator.throw(value));
32
+ } catch (e) {
33
+ reject(e);
34
+ }
35
+ };
36
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
+ step((generator = generator.apply(__this, __arguments)).next());
38
+ });
39
+ };
29
40
  import { hasOwn, isVerticalScrollbarVisible, scrollbarWidth, computePosition, isPlainObject, isFunction, isUndefined, isNotEmpty, fastClone, delay, findTreeChildren } from "@web-utils/core";
30
41
  import { addResizeListener, removeResizeListener } from "@web-utils/integrations/resize";
31
42
  import { cloneDeep } from "@web-utils/integrations/lodash";
32
- import { a as filterTreeProperties, b as filterTreeEvents, c as assignReactiveProperties } from "../../chunks/utils.d7f73f8d.js";
33
- import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.77ec6792.js";
43
+ import { a as filterTreeProperties, b as filterTreeEvents, c as assignReactiveProperties } from "../../chunks/utils.2a3ffac9.js";
44
+ import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.9c6b8b3d.js";
34
45
  var render = function() {
35
- var _vm = this, _h = _vm.$createElement, _c = _vm._self._c || _h;
46
+ var _vm = this;
47
+ var _h = _vm.$createElement;
48
+ var _c = _vm._self._c || _h;
36
49
  return _c("div", {
37
50
  staticClass: "editable-tree"
38
51
  }, [!_vm.readonly && _vm.addRootNodeButtonStyle === "top-right" ? _c("ElButton", {
39
52
  staticStyle: {
40
- position: "absolute",
41
- top: "4px",
53
+ "position": "absolute",
54
+ "top": "4px",
42
55
  "z-index": "1"
43
56
  },
44
57
  style: {
45
58
  right: `${_vm.right}px`
46
59
  },
47
60
  attrs: {
48
- type: "primary",
49
- size: "mini",
50
- icon: "el-icon-plus",
51
- circle: "",
52
- plain: ""
61
+ "type": "primary",
62
+ "size": "mini",
63
+ "icon": "el-icon-plus",
64
+ "circle": "",
65
+ "plain": ""
53
66
  },
54
67
  on: {
55
- click: function($event) {
56
- return $event.stopPropagation(), _vm.$emit("add-root-node");
68
+ "click": function($event) {
69
+ $event.stopPropagation();
70
+ return _vm.$emit("add-root-node");
57
71
  }
58
72
  }
59
73
  }) : _vm._e(), _c("div", {
@@ -65,12 +79,12 @@ var render = function() {
65
79
  }
66
80
  }, [_c("ElButton", {
67
81
  attrs: {
68
- disabled: _vm.loading,
69
- size: "mini",
70
- type: "text"
82
+ "disabled": _vm.loading,
83
+ "size": "mini",
84
+ "type": "text"
71
85
  },
72
86
  on: {
73
- click: _vm.appendRootNode
87
+ "click": _vm.appendRootNode
74
88
  }
75
89
  }, [_c("i", {
76
90
  staticClass: "el-icon-lx-add"
@@ -80,12 +94,12 @@ var render = function() {
80
94
  staticClass: "flex-item",
81
95
  attrs: {
82
96
  "default-expanded-keys": _vm.expandedKeys,
83
- "expand-on-click-node": !1,
97
+ "expand-on-click-node": false,
84
98
  "highlight-current": "",
85
- load: _vm.loadNode,
86
- data: _vm.innerTreeData,
87
- props: _vm.treeProps,
88
- lazy: _vm.lazy,
99
+ "load": _vm.loadNode,
100
+ "data": _vm.innerTreeData,
101
+ "props": _vm.treeProps,
102
+ "lazy": _vm.lazy,
89
103
  "node-key": _vm.nodeKey
90
104
  },
91
105
  on: {
@@ -99,78 +113,7 @@ var render = function() {
99
113
  fn: function(_ref) {
100
114
  var node = _ref.node, data = _ref.data;
101
115
  return [_vm._t("default", function() {
102
- return [data.edit ? [_c("span", {
103
- staticClass: "custom-tree-node flex-row flex-item oh",
104
- attrs: {
105
- "data-id": data.id
106
- }
107
- }, [_vm.icon ? _c("i", {
108
- staticClass: "node-icon shrink-0",
109
- class: data.loading ? "el-icon-loading" : "el-icon-edit-outline"
110
- }) : _vm._e(), _c("ElInput", {
111
- ref: "labelTxt",
112
- staticClass: "node-input flex-item",
113
- attrs: {
114
- size: "mini",
115
- placeholder: _vm.defaultOptions.inputPlaceholder
116
- },
117
- on: {
118
- blur: function(event) {
119
- return _vm.inputBlur(event, node, data);
120
- }
121
- },
122
- nativeOn: {
123
- keyup: function($event) {
124
- return function(event) {
125
- return _vm.inputKeyup(event, node, data);
126
- }.apply(null, arguments);
127
- },
128
- click: function($event) {
129
- $event.stopPropagation();
130
- }
131
- },
132
- model: {
133
- value: _vm.text,
134
- callback: function($$v) {
135
- _vm.text = $$v;
136
- },
137
- expression: "text"
138
- }
139
- }), _vm.confirmButton ? [_c("ElButton", {
140
- directives: [{
141
- name: "show",
142
- rawName: "v-show",
143
- value: !data.loading,
144
- expression: "!data.loading"
145
- }],
146
- staticClass: "shrink-0",
147
- attrs: {
148
- size: "mini",
149
- type: "text"
150
- },
151
- on: {
152
- click: function($event) {
153
- return $event.stopPropagation(), _vm.onConfirm(node, data);
154
- }
155
- }
156
- }, [_vm._v("确定")]), _c("ElButton", {
157
- directives: [{
158
- name: "show",
159
- rawName: "v-show",
160
- value: !data.loading,
161
- expression: "!data.loading"
162
- }],
163
- staticClass: "shrink-0",
164
- attrs: {
165
- size: "mini",
166
- type: "text"
167
- },
168
- on: {
169
- click: function($event) {
170
- return $event.stopPropagation(), _vm.onCancel(node, data);
171
- }
172
- }
173
- }, [_vm._v("取消")])] : _vm._e()], 2)] : [_c("span", {
116
+ return [!data.edit ? [_c("span", {
174
117
  staticClass: "custom-tree-node",
175
118
  attrs: {
176
119
  "data-id": data.id
@@ -183,21 +126,21 @@ var render = function() {
183
126
  }) : _vm._e(), _c("span", {
184
127
  staticClass: "flex-item-relative",
185
128
  staticStyle: {
186
- height: "21px"
129
+ "height": "21px"
187
130
  }
188
131
  }, [_c("span", {
189
132
  staticClass: "ellipsis-1 absolute-box et-tree-label",
190
133
  attrs: {
191
- title: node.label
134
+ "title": node.label
192
135
  }
193
136
  }, [_vm._t("label", function() {
194
137
  return [_vm._v(_vm._s(node.label))];
195
138
  }, {
196
- data,
197
- node
139
+ "data": data,
140
+ "node": node
198
141
  })], 2)]), _vm._t("label-suffix", null, {
199
- node,
200
- data
142
+ "node": node,
143
+ "data": data
201
144
  })], 2), !_vm.contextMenu && !_vm.readonly ? _c("span", {
202
145
  directives: [{
203
146
  name: "show",
@@ -208,32 +151,34 @@ var render = function() {
208
151
  staticClass: "handle-actions"
209
152
  }, [_c("ElButton", {
210
153
  attrs: {
211
- size: "mini",
212
- type: "text"
154
+ "size": "mini",
155
+ "type": "text"
213
156
  },
214
157
  on: {
215
- click: function($event) {
216
- return $event.stopPropagation(), _vm.appendChildNode(node, data);
158
+ "click": function($event) {
159
+ $event.stopPropagation();
160
+ return _vm.appendChildNode(node, data);
217
161
  }
218
162
  }
219
163
  }, [_vm._v("添加")]), _c("ElButton", {
220
164
  attrs: {
221
- size: "mini",
222
- type: "text"
165
+ "size": "mini",
166
+ "type": "text"
223
167
  },
224
168
  on: {
225
- click: function($event) {
226
- return $event.stopPropagation(), _vm.editNode(node, data);
169
+ "click": function($event) {
170
+ $event.stopPropagation();
171
+ return _vm.editNode(node, data);
227
172
  }
228
173
  }
229
174
  }, [_vm._v("修改")]), _c("ElPopconfirm", {
230
175
  staticClass: "pop-confirm",
231
176
  attrs: {
232
177
  "icon-color": "red",
233
- title: "你确定要删除吗?"
178
+ "title": "你确定要删除吗?"
234
179
  },
235
180
  on: {
236
- confirm: function($event) {
181
+ "confirm": function($event) {
237
182
  return _vm.removeNode(node, data);
238
183
  }
239
184
  },
@@ -251,18 +196,18 @@ var render = function() {
251
196
  "margin-left": "4px"
252
197
  },
253
198
  attrs: {
254
- size: "mini",
255
- type: "text"
199
+ "size": "mini",
200
+ "type": "text"
256
201
  },
257
202
  on: {
258
- click: function($event) {
203
+ "click": function($event) {
259
204
  $event.stopPropagation();
260
205
  }
261
206
  }
262
207
  }, [_vm._v("删除")])];
263
208
  },
264
- proxy: !0
265
- }], null, !0)
209
+ proxy: true
210
+ }], null, true)
266
211
  })], 1) : _vm._e(), _vm.contextMenuIcon && _vm.contextMenu && !_vm.readonly ? _c("span", {
267
212
  directives: [{
268
213
  name: "show",
@@ -272,29 +217,103 @@ var render = function() {
272
217
  }],
273
218
  staticClass: "handle-actions",
274
219
  staticStyle: {
275
- display: "inline-block"
220
+ "display": "inline-block"
276
221
  }
277
222
  }, [_c("ElButton", {
278
223
  staticStyle: {
279
- padding: "6px 10px 0"
224
+ "padding": "6px 10px 0"
225
+ },
226
+ attrs: {
227
+ "size": "mini",
228
+ "type": "text"
229
+ },
230
+ on: {
231
+ "click": function($event) {
232
+ $event.stopPropagation();
233
+ return _vm.showContextMenu($event, data, node);
234
+ }
235
+ }
236
+ }, [_vm._v(". . .")])], 1) : _vm._e()])] : [_c("span", {
237
+ staticClass: "custom-tree-node flex-row flex-item oh",
238
+ attrs: {
239
+ "data-id": data.id
240
+ }
241
+ }, [_vm.icon ? _c("i", {
242
+ staticClass: "node-icon shrink-0",
243
+ class: data.loading ? "el-icon-loading" : "el-icon-edit-outline"
244
+ }) : _vm._e(), _c("ElInput", {
245
+ ref: "labelTxt",
246
+ staticClass: "node-input flex-item",
247
+ attrs: {
248
+ "size": "mini",
249
+ "placeholder": _vm.defaultOptions.inputPlaceholder
250
+ },
251
+ on: {
252
+ "blur": function(event) {
253
+ return _vm.inputBlur(event, node, data);
254
+ }
255
+ },
256
+ nativeOn: {
257
+ "keyup": function($event) {
258
+ return function(event) {
259
+ return _vm.inputKeyup(event, node, data);
260
+ }.apply(null, arguments);
261
+ },
262
+ "click": function($event) {
263
+ $event.stopPropagation();
264
+ }
265
+ },
266
+ model: {
267
+ value: _vm.text,
268
+ callback: function($$v) {
269
+ _vm.text = $$v;
270
+ },
271
+ expression: "text"
272
+ }
273
+ }), _vm.confirmButton ? [_c("ElButton", {
274
+ directives: [{
275
+ name: "show",
276
+ rawName: "v-show",
277
+ value: !data.loading,
278
+ expression: "!data.loading"
279
+ }],
280
+ staticClass: "shrink-0",
281
+ attrs: {
282
+ "size": "mini",
283
+ "type": "text"
280
284
  },
285
+ on: {
286
+ "click": function($event) {
287
+ $event.stopPropagation();
288
+ return _vm.onConfirm(node, data);
289
+ }
290
+ }
291
+ }, [_vm._v("确定")]), _c("ElButton", {
292
+ directives: [{
293
+ name: "show",
294
+ rawName: "v-show",
295
+ value: !data.loading,
296
+ expression: "!data.loading"
297
+ }],
298
+ staticClass: "shrink-0",
281
299
  attrs: {
282
- size: "mini",
283
- type: "text"
300
+ "size": "mini",
301
+ "type": "text"
284
302
  },
285
303
  on: {
286
- click: function($event) {
287
- return $event.stopPropagation(), _vm.showContextMenu($event, data, node);
304
+ "click": function($event) {
305
+ $event.stopPropagation();
306
+ return _vm.onCancel(node, data);
288
307
  }
289
308
  }
290
- }, [_vm._v(". . .")])], 1) : _vm._e()])]];
309
+ }, [_vm._v("取消")])] : _vm._e()], 2)]];
291
310
  }, {
292
- node,
293
- data
311
+ "node": node,
312
+ "data": data
294
313
  })];
295
314
  }
296
- }], null, !0)
297
- }, "ElTree", _vm.filterTreeProperties(_vm.$attrs), !1), _vm.filterTreeEvents(_vm.$listeners))), _vm.contextMenu && !_vm.readonly ? _c("div", {
315
+ }], null, true)
316
+ }, "ElTree", _vm.filterTreeProperties(_vm.$attrs), false), _vm.filterTreeEvents(_vm.$listeners))), _vm.contextMenu && !_vm.readonly ? _c("div", {
298
317
  directives: [{
299
318
  name: "show",
300
319
  rawName: "v-show",
@@ -316,26 +335,26 @@ var render = function() {
316
335
  }],
317
336
  staticClass: "menu-item",
318
337
  on: {
319
- click: function($event) {
338
+ "click": function($event) {
320
339
  return _vm.appendPeerNode(_vm.curNode, _vm.curData);
321
340
  }
322
341
  }
323
342
  }, [_c("i", {
324
343
  staticClass: "menu-item-icon el-icon-lx-add",
325
344
  staticStyle: {
326
- color: "#228b22"
345
+ "color": "#228b22"
327
346
  }
328
347
  }), _vm._v(_vm._s(_vm.menuLabel.appendPeer) + " ")]), _c("li", {
329
348
  staticClass: "menu-item",
330
349
  on: {
331
- click: function($event) {
350
+ "click": function($event) {
332
351
  return _vm.appendChildNode(_vm.curNode, _vm.curData);
333
352
  }
334
353
  }
335
354
  }, [_c("i", {
336
355
  staticClass: "menu-item-icon el-icon-lx-add",
337
356
  staticStyle: {
338
- color: "#228b22"
357
+ "color": "#228b22"
339
358
  }
340
359
  }), _vm._v(_vm._s(_vm.menuLabel.appendChild) + " ")]), _c("li", {
341
360
  directives: [{
@@ -346,14 +365,14 @@ var render = function() {
346
365
  }],
347
366
  staticClass: "menu-item",
348
367
  on: {
349
- click: function($event) {
368
+ "click": function($event) {
350
369
  return _vm.editNode(_vm.curNode, _vm.curData);
351
370
  }
352
371
  }
353
372
  }, [_c("i", {
354
373
  staticClass: "menu-item-icon el-icon-edit-outline",
355
374
  staticStyle: {
356
- color: "#ffa500"
375
+ "color": "#ffa500"
357
376
  }
358
377
  }), _vm._v(_vm._s(_vm.menuLabel.editNode) + " ")]), _c("li", {
359
378
  directives: [{
@@ -364,21 +383,23 @@ var render = function() {
364
383
  }],
365
384
  staticClass: "menu-item",
366
385
  on: {
367
- click: function($event) {
386
+ "click": function($event) {
368
387
  return _vm.removeNodeModal(_vm.curNode, _vm.curData);
369
388
  }
370
389
  }
371
390
  }, [_c("i", {
372
391
  staticClass: "menu-item-icon el-icon-delete",
373
392
  staticStyle: {
374
- color: "#f00"
393
+ "color": "#f00"
375
394
  }
376
395
  }), _vm._v(_vm._s(_vm.menuLabel.removeNode) + " ")])];
377
396
  }, {
378
- curNode: _vm.curNode,
379
- curData: _vm.curData
397
+ "curNode": _vm.curNode,
398
+ "curData": _vm.curData
380
399
  })], 2)]) : _vm._e()], 1)], 1);
381
- }, staticRenderFns = [];
400
+ };
401
+ var staticRenderFns = [];
402
+ const EditableTree_vue_vue_type_style_index_0_lang = "";
382
403
  const __vue2_script = {
383
404
  name: "EditableTree",
384
405
  props: {
@@ -395,19 +416,21 @@ const __vue2_script = {
395
416
  },
396
417
  newNodeBuilder: {
397
418
  type: Function,
398
- default: (name, parent) => ({
399
- name,
400
- parentId: parent.id
401
- })
419
+ default: (name, parent) => {
420
+ return {
421
+ name,
422
+ parentId: parent.id
423
+ };
424
+ }
402
425
  },
403
426
  contextMenu: Boolean,
404
427
  lazy: {
405
428
  type: Boolean,
406
- default: !0
429
+ default: true
407
430
  },
408
431
  expandFirstNode: {
409
432
  type: Boolean,
410
- default: !0
433
+ default: true
411
434
  },
412
435
  readonly: Boolean,
413
436
  saveApi: {
@@ -435,11 +458,23 @@ const __vue2_script = {
435
458
  contextMenuInline: Boolean,
436
459
  treeProps: {
437
460
  type: Object,
438
- default: () => ({
439
- children: "children",
440
- label: "name",
441
- isLeaf: (data) => hasOwn(data, "hasChildren") ? !data.hasChildren : hasOwn(data, "hasChild") ? !data.hasChild : hasOwn(data, "children") && data.children ? data.children.length === 0 : !0
442
- })
461
+ default: () => {
462
+ return {
463
+ children: "children",
464
+ label: "name",
465
+ isLeaf: (data) => {
466
+ if (hasOwn(data, "hasChildren")) {
467
+ return !data.hasChildren;
468
+ } else if (hasOwn(data, "hasChild")) {
469
+ return !data.hasChild;
470
+ } else if (hasOwn(data, "children") && data.children) {
471
+ return data.children.length === 0;
472
+ } else {
473
+ return true;
474
+ }
475
+ }
476
+ };
477
+ }
443
478
  },
444
479
  menuLabel: {
445
480
  type: Object,
@@ -452,11 +487,13 @@ const __vue2_script = {
452
487
  },
453
488
  icon: {
454
489
  type: [Function, Boolean],
455
- default: () => "el-icon-collection-tag"
490
+ default: () => {
491
+ return "el-icon-collection-tag";
492
+ }
456
493
  },
457
494
  confirmButton: {
458
495
  type: Boolean,
459
- default: !0
496
+ default: true
460
497
  },
461
498
  addRootNodeButtonStyle: {
462
499
  type: String,
@@ -470,9 +507,9 @@ const __vue2_script = {
470
507
  },
471
508
  data() {
472
509
  return {
473
- loading: !1,
474
- showMenu: !1,
475
- empty: !0,
510
+ loading: false,
511
+ showMenu: false,
512
+ empty: true,
476
513
  expandedKeys: this.lazy ? [] : this.defaultExpandedKeys,
477
514
  treeData: [],
478
515
  curNode: {},
@@ -488,8 +525,8 @@ const __vue2_script = {
488
525
  return {
489
526
  confirmButtonText: "确定",
490
527
  cancelButtonText: "取消",
491
- closeOnClickModal: !1,
492
- modal: !0,
528
+ closeOnClickModal: false,
529
+ modal: true,
493
530
  inputErrorMessage: `${this.label}名不能为空!`,
494
531
  inputPlaceholder: `请输入${this.label}名...`,
495
532
  inputValidator: (value) => value != null && value.trim().length > 0
@@ -497,12 +534,12 @@ const __vue2_script = {
497
534
  },
498
535
  innerTreeData() {
499
536
  var _a;
500
- return (_a = this.$attrs.data) != null && _a.length ? this.$attrs.data : this.treeData;
537
+ return ((_a = this.$attrs.data) == null ? void 0 : _a.length) ? this.$attrs.data : this.treeData;
501
538
  }
502
539
  },
503
540
  watch: {
504
541
  defaultExpandedKeys: {
505
- immediate: !0,
542
+ immediate: true,
506
543
  handler(newVal) {
507
544
  this.expandedKeys = [...newVal];
508
545
  }
@@ -512,44 +549,74 @@ const __vue2_script = {
512
549
  this.tryFetch();
513
550
  },
514
551
  mounted() {
515
- addResizeListener(this.$refs.tree.$el, this.resize), addResizeListener(this.$refs.treeWrapper, this.resize);
552
+ addResizeListener(this.$refs.tree.$el, this.resize);
553
+ addResizeListener(this.$refs.treeWrapper, this.resize);
516
554
  },
517
555
  beforeDestroy() {
518
- removeResizeListener(this.$refs.tree.$el, this.resize), removeResizeListener(this.$refs.treeWrapper, this.resize);
556
+ removeResizeListener(this.$refs.tree.$el, this.resize);
557
+ removeResizeListener(this.$refs.treeWrapper, this.resize);
519
558
  },
520
559
  methods: {
521
560
  filterTreeProperties,
522
561
  filterTreeEvents,
523
562
  addExpandKey(data) {
524
- this.reserveExpandKey && this.expandedKeys.push(data[this.nodeKey]);
563
+ if (this.reserveExpandKey) {
564
+ this.expandedKeys.push(data[this.nodeKey]);
565
+ }
525
566
  },
526
567
  removeExpandKey(data) {
527
- this.reserveExpandKey && (this.expandedKeys = this.expandedKeys.filter((key) => key !== data[this.nodeKey]));
568
+ if (this.reserveExpandKey) {
569
+ this.expandedKeys = this.expandedKeys.filter((key) => key !== data[this.nodeKey]);
570
+ }
528
571
  },
529
572
  resize() {
530
- isVerticalScrollbarVisible(this.$refs.treeWrapper) ? this.right = 4 + scrollbarWidth : this.right = 4;
573
+ if (isVerticalScrollbarVisible(this.$refs.treeWrapper)) {
574
+ this.right = 4 + scrollbarWidth;
575
+ } else {
576
+ this.right = 4;
577
+ }
531
578
  },
532
579
  showContextMenu(event, data, node) {
533
580
  return __async(this, null, function* () {
534
- data.contextmenu === !1 || data.id === -1 || data.id === 0 || data.edit === !0 || this.contextMenu && (this.curNode = node, this.curData = data, this.showMenu = !0, this.$refs.tree.setCurrentKey(data.id), yield this.$nextTick(), this.position = computePosition(event, this.$refs.contextMenu), window.addEventListener("click", this.hideContextMenu));
581
+ if (data.contextmenu === false || data.id === -1 || data.id === 0 || data.edit === true) {
582
+ return;
583
+ }
584
+ if (this.contextMenu) {
585
+ this.curNode = node;
586
+ this.curData = data;
587
+ this.showMenu = true;
588
+ this.$refs.tree.setCurrentKey(data.id);
589
+ yield this.$nextTick();
590
+ this.position = computePosition(event, this.$refs.contextMenu);
591
+ window.addEventListener("click", this.hideContextMenu);
592
+ }
535
593
  });
536
594
  },
537
595
  hideContextMenu() {
538
- this.showMenu = !1, window.removeEventListener("click", this.hideContextMenu);
596
+ this.showMenu = false;
597
+ window.removeEventListener("click", this.hideContextMenu);
539
598
  },
540
599
  tryFetch() {
541
600
  return __async(this, null, function* () {
542
601
  var _a, _b;
543
- if (this.lazy === !1 && this.fetchApi) {
602
+ if (this.lazy === false && this.fetchApi) {
544
603
  const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, {});
545
- if (isPlainObject(res.data) && (res.data = [res.data]), res.data = res.data || [], this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
604
+ if (isPlainObject(res.data)) {
605
+ res.data = [res.data];
606
+ }
607
+ res.data = res.data || [];
608
+ this.empty = res.data.length === 0;
609
+ if (isPlainObject(this.customRootNode)) {
546
610
  const data = cloneDeep(this.customRootNode);
547
- data[this.treeProps.children || "children"] = res.data, this.treeData = [data];
611
+ data[this.treeProps.children || "children"] = res.data;
612
+ this.treeData = [data];
548
613
  } else if (isFunction(this.customRootNode)) {
549
614
  const data = this.customRootNode(res.data);
550
- data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
551
- } else
615
+ data[this.treeProps.children || "children"] = res.data;
616
+ this.treeData = isPlainObject(data) ? [data] : data;
617
+ } else {
552
618
  this.treeData = res.data;
619
+ }
553
620
  }
554
621
  });
555
622
  },
@@ -558,127 +625,223 @@ const __vue2_script = {
558
625
  var _a, _b, _c, _d;
559
626
  if (node.level === 0) {
560
627
  const res = yield this.fetchApi((_b = (_a = this.rootNode) == null ? void 0 : _a.id) != null ? _b : -1, node);
561
- if (this.empty = res.data.length === 0, isPlainObject(this.customRootNode)) {
628
+ this.empty = res.data.length === 0;
629
+ if (isPlainObject(this.customRootNode)) {
562
630
  const data = cloneDeep(this.customRootNode);
563
- data[this.treeProps.children || "children"] = res.data, resolve([data]);
631
+ data[this.treeProps.children || "children"] = res.data;
632
+ resolve([data]);
564
633
  } else if (isFunction(this.customRootNode)) {
565
634
  const data = this.customRootNode(res.data);
566
- data[this.treeProps.children || "children"] = res.data, this.treeData = isPlainObject(data) ? [data] : data;
567
- } else
635
+ data[this.treeProps.children || "children"] = res.data;
636
+ this.treeData = isPlainObject(data) ? [data] : data;
637
+ } else {
568
638
  resolve(res.data);
569
- yield this.$nextTick(), this.$emit("root-node-loaded", res.data), this.defaultExpandedKeys ? this.expandedKeys = [(_c = res == null ? void 0 : res.data[0]) == null ? void 0 : _c.id, ...this.defaultExpandedKeys] : this.expandFirstNode && (this.expandedKeys = [(_d = res == null ? void 0 : res.data[0]) == null ? void 0 : _d.id]);
639
+ }
640
+ yield this.$nextTick();
641
+ this.$emit("root-node-loaded", res.data);
642
+ if (this.defaultExpandedKeys) {
643
+ this.expandedKeys = [(_c = res == null ? void 0 : res.data[0]) == null ? void 0 : _c.id, ...this.defaultExpandedKeys];
644
+ } else {
645
+ if (this.expandFirstNode) {
646
+ this.expandedKeys = [(_d = res == null ? void 0 : res.data[0]) == null ? void 0 : _d.id];
647
+ }
648
+ }
570
649
  } else {
571
- if (node.leaf || node.data.isTempNode)
650
+ if (node.leaf || node.data.isTempNode) {
572
651
  return resolve([]);
652
+ }
573
653
  const res = yield this.fetchApi(node.data.id, node);
574
- resolve(res.data), yield this.$nextTick(), this.$emit("node-loaded", res.data);
654
+ resolve(res.data);
655
+ yield this.$nextTick();
656
+ this.$emit("node-loaded", res.data);
575
657
  }
576
658
  });
577
659
  },
578
660
  clear() {
579
- this.cancelEdit(), this.removeNewNode();
661
+ this.cancelEdit();
662
+ this.removeNewNode();
580
663
  },
581
664
  clearChecked() {
582
665
  this.$refs.tree.setCheckedKeys([]);
583
666
  },
584
667
  removeNewNode() {
585
- this.newChild && this.newChild.id === -1 && (console.log(this.newChild), this.$refs.tree.remove(this.newChild), this.$emit("remove-new-node"));
668
+ if (this.newChild && this.newChild.id === -1) {
669
+ console.log(this.newChild);
670
+ this.$refs.tree.remove(this.newChild);
671
+ this.$emit("remove-new-node");
672
+ }
586
673
  },
587
674
  cancelEdit() {
588
- this.editData && (isUndefined(this.editData.edit) ? this.$set(this.editData, "edit", !0) : this.editData.edit = !1);
675
+ if (this.editData) {
676
+ if (isUndefined(this.editData.edit)) {
677
+ this.$set(this.editData, "edit", true);
678
+ } else {
679
+ this.editData.edit = false;
680
+ }
681
+ }
589
682
  },
590
683
  editNode(node, data) {
591
684
  return __async(this, null, function* () {
592
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.editData = data, this.text = data[this.treeProps.label], isUndefined(data.edit) ? this.$set(data, "edit", !0) : data.edit = !0, yield this.$nextTick(), this.$refs.labelTxt.focus()) : yield this.$prompt(`请输入新的${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
593
- inputValue: data[this.treeProps.label],
594
- beforeClose: (action, instance, done) => __async(this, null, function* () {
595
- if (action === "confirm") {
596
- try {
597
- instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...", this.text = instance.inputValue, yield this.onConfirm(this.curNode, this.curData), done();
598
- } catch (e) {
599
- instance.confirmButtonText = "确定";
685
+ if (!this.contextMenu || this.contextMenuIcon || this.contextMenuInline) {
686
+ this.clear();
687
+ this.editData = data;
688
+ this.text = data[this.treeProps.label];
689
+ if (isUndefined(data.edit)) {
690
+ this.$set(data, "edit", true);
691
+ } else {
692
+ data.edit = true;
693
+ }
694
+ yield this.$nextTick();
695
+ this.$refs.labelTxt.focus();
696
+ } else {
697
+ yield this.$prompt(`请输入新的${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
698
+ inputValue: data[this.treeProps.label],
699
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
700
+ if (action === "confirm") {
701
+ try {
702
+ instance.confirmButtonLoading = true;
703
+ instance.confirmButtonText = "处理中...";
704
+ this.text = instance.inputValue;
705
+ yield this.onConfirm(this.curNode, this.curData);
706
+ done();
707
+ } catch (e) {
708
+ instance.confirmButtonText = "确定";
709
+ }
710
+ instance.confirmButtonLoading = false;
711
+ } else {
712
+ done();
600
713
  }
601
- instance.confirmButtonLoading = !1;
602
- } else
603
- done();
604
- })
605
- })).catch((_) => _);
714
+ })
715
+ })).catch((_) => _);
716
+ }
606
717
  });
607
718
  },
608
719
  appendRootNode() {
609
720
  return __async(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}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
611
- beforeClose: (action, instance, done) => __async(this, null, function* () {
612
- if (action === "confirm") {
613
- try {
614
- this.createNewChild(-1), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
615
- const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, { id: -1 }));
616
- this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, !0), yield this.locateView(), done();
617
- } catch (e) {
618
- instance.confirmButtonText = "确定";
721
+ this.text = "";
722
+ if (!this.contextMenu || this.contextMenuIcon || this.contextMenuInline) {
723
+ this.clear();
724
+ this.createNewChild(void 0);
725
+ this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, true);
726
+ yield this.scrollIntoView(true);
727
+ } else {
728
+ yield this.$prompt(`请输入${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
729
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
730
+ if (action === "confirm") {
731
+ try {
732
+ this.createNewChild(-1);
733
+ instance.confirmButtonLoading = true;
734
+ instance.confirmButtonText = "处理中...";
735
+ const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, { id: -1 }));
736
+ this.newChild[this.treeProps.label] = instance.inputValue;
737
+ this.newChild.edit = false;
738
+ assignReactiveProperties(this.newChild, res.data);
739
+ this.$refs.tree.root.insertChild({ data: this.newChild }, void 0, true);
740
+ yield this.locateView();
741
+ done();
742
+ } catch (e) {
743
+ instance.confirmButtonText = "确定";
744
+ }
745
+ instance.confirmButtonLoading = false;
746
+ } else {
747
+ done();
619
748
  }
620
- instance.confirmButtonLoading = !1;
621
- } else
622
- done();
623
- })
624
- })).catch((_) => _);
749
+ })
750
+ })).catch((_) => _);
751
+ }
625
752
  });
626
753
  },
627
754
  appendChildNode(node) {
628
755
  this.text = "";
629
756
  const expanded = node.expanded;
630
757
  node.expand(() => __async(this, null, function* () {
631
- !this.contextMenu || this.contextMenuIcon || this.contextMenuInline ? (this.clear(), this.createNewChild(node.data.id), this.$refs.tree.append(this.newChild, node), yield this.scrollIntoView(expanded)) : yield this.$prompt(`请输入${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
632
- beforeClose: (action, instance, done) => __async(this, null, function* () {
633
- if (action === "confirm") {
634
- try {
635
- this.createNewChild(node.data.id), instance.confirmButtonLoading = !0, instance.confirmButtonText = "处理中...";
636
- const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
637
- this.newChild[this.treeProps.label] = instance.inputValue, this.newChild.edit = !1, assignReactiveProperties(this.newChild, res.data), this.$refs.tree.append(this.newChild, node), yield this.locateView(), done();
638
- } catch (e) {
639
- instance.confirmButtonText = "确定";
758
+ if (!this.contextMenu || this.contextMenuIcon || this.contextMenuInline) {
759
+ this.clear();
760
+ this.createNewChild(node.data.id);
761
+ this.$refs.tree.append(this.newChild, node);
762
+ yield this.scrollIntoView(expanded);
763
+ } else {
764
+ yield this.$prompt(`请输入${this.label}名:`, __spreadProps(__spreadValues({}, this.defaultOptions), {
765
+ beforeClose: (action, instance, done) => __async(this, null, function* () {
766
+ if (action === "confirm") {
767
+ try {
768
+ this.createNewChild(node.data.id);
769
+ instance.confirmButtonLoading = true;
770
+ instance.confirmButtonText = "处理中...";
771
+ const res = yield this.saveApi(this.newNodeBuilder(instance.inputValue, node.data));
772
+ this.newChild[this.treeProps.label] = instance.inputValue;
773
+ this.newChild.edit = false;
774
+ assignReactiveProperties(this.newChild, res.data);
775
+ this.$refs.tree.append(this.newChild, node);
776
+ yield this.locateView();
777
+ done();
778
+ } catch (e) {
779
+ instance.confirmButtonText = "确定";
780
+ }
781
+ instance.confirmButtonLoading = false;
782
+ } else {
783
+ done();
640
784
  }
641
- instance.confirmButtonLoading = !1;
642
- } else
643
- done();
644
- })
645
- })).catch((_) => _);
785
+ })
786
+ })).catch((_) => _);
787
+ }
646
788
  }));
647
789
  },
648
790
  appendChildNodeWithData(node, parentId, label) {
649
791
  this.text = "";
650
792
  const expanded = node.expanded;
651
793
  node.expand(() => __async(this, null, function* () {
652
- this.clear(), this.newChild = {
794
+ this.clear();
795
+ this.newChild = {
653
796
  id: -1,
654
797
  parentId,
655
798
  [this.treeProps.label]: label,
656
- edit: !1,
657
- isTempNode: !0,
658
- hasChildren: !1
659
- }, this.$refs.tree.append(this.newChild, node), yield this.scrollIntoView(expanded);
799
+ edit: false,
800
+ isTempNode: true,
801
+ hasChildren: false
802
+ };
803
+ this.$refs.tree.append(this.newChild, node);
804
+ yield this.scrollIntoView(expanded);
660
805
  }));
661
806
  },
662
807
  appendPeerNode(node) {
663
- node.parent && node.parent.level !== 0 ? this.appendChildNode(node.parent) : this.appendRootNode();
808
+ if (node.parent && node.parent.level !== 0) {
809
+ this.appendChildNode(node.parent);
810
+ } else {
811
+ this.appendRootNode();
812
+ }
664
813
  },
665
814
  addRootNode(data) {
666
815
  return __async(this, null, function* () {
667
- this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.root.insertChild({ data }, void 0, !0);
816
+ this.$refs.tree.remove(data);
817
+ yield this.$nextTick();
818
+ this.$refs.tree.root.insertChild({ data }, void 0, true);
668
819
  });
669
820
  },
670
821
  addChildNode(data) {
671
822
  return __async(this, null, function* () {
672
- this.curNode && this.curNode.level !== 0 ? this.curNode.expand(() => __async(this, null, function* () {
673
- this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode);
674
- })) : yield this.addRootNode(data);
823
+ if (this.curNode && this.curNode.level !== 0) {
824
+ this.curNode.expand(() => __async(this, null, function* () {
825
+ this.$refs.tree.remove(data);
826
+ yield this.$nextTick();
827
+ this.$refs.tree.append(data, this.curNode);
828
+ }));
829
+ } else {
830
+ yield this.addRootNode(data);
831
+ }
675
832
  });
676
833
  },
677
834
  addPeerNode(data) {
678
835
  return __async(this, null, function* () {
679
- this.curNode && this.curNode.parent && this.curNode.parent.level !== 0 ? this.curNode.parent.expand(() => __async(this, null, function* () {
680
- this.$refs.tree.remove(data), yield this.$nextTick(), this.$refs.tree.append(data, this.curNode.parent);
681
- })) : yield this.addRootNode(data);
836
+ if (this.curNode && this.curNode.parent && this.curNode.parent.level !== 0) {
837
+ this.curNode.parent.expand(() => __async(this, null, function* () {
838
+ this.$refs.tree.remove(data);
839
+ yield this.$nextTick();
840
+ this.$refs.tree.append(data, this.curNode.parent);
841
+ }));
842
+ } else {
843
+ yield this.addRootNode(data);
844
+ }
682
845
  });
683
846
  },
684
847
  updateNode(data) {
@@ -693,10 +856,11 @@ const __vue2_script = {
693
856
  id: -1,
694
857
  parentId,
695
858
  [this.treeProps.label]: "",
696
- edit: !0,
697
- isTempNode: !0,
698
- hasChildren: !1
699
- }, this.$emit("create-new-node", this.newChild);
859
+ edit: true,
860
+ isTempNode: true,
861
+ hasChildren: false
862
+ };
863
+ this.$emit("create-new-node", this.newChild);
700
864
  },
701
865
  removeNodeModal(node) {
702
866
  return __async(this, null, function* () {
@@ -705,23 +869,34 @@ const __vue2_script = {
705
869
  "系统提示",
706
870
  {
707
871
  type: "warning",
708
- modal: !0,
709
- dangerouslyUseHTMLString: !0,
872
+ modal: true,
873
+ dangerouslyUseHTMLString: true,
710
874
  iconClass: "el-icon-question",
711
- closeOnClickModal: !1,
875
+ closeOnClickModal: false,
712
876
  confirmButtonClass: "el-button--danger",
713
877
  cancelButtonClass: "el-button--primary is-plain",
714
878
  beforeClose: (action, instance, done) => __async(this, null, function* () {
715
879
  if (action === "confirm") {
716
880
  try {
717
- instance.confirmButtonLoading = !0, instance.confirmButtonText = "删除...";
718
- const parentNode = node.parent, res = yield this.deleteApi(node.data.id);
719
- res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data), done()) : this.$message.error(res.message);
881
+ instance.confirmButtonLoading = true;
882
+ instance.confirmButtonText = "删除...";
883
+ const parentNode = node.parent;
884
+ const res = yield this.deleteApi(node.data.id);
885
+ if (res.code === 0) {
886
+ this.$message.success("删除成功!");
887
+ this.$refs.tree.remove(node);
888
+ this.$emit("node-deleted", parentNode, node.data);
889
+ done();
890
+ } else {
891
+ this.$message.error(res.message);
892
+ }
720
893
  } catch (_) {
721
894
  }
722
- instance.confirmButtonText = "确定", instance.confirmButtonLoading = !1;
723
- } else
895
+ instance.confirmButtonText = "确定";
896
+ instance.confirmButtonLoading = false;
897
+ } else {
724
898
  done();
899
+ }
725
900
  })
726
901
  }
727
902
  ).catch((_) => _);
@@ -733,9 +908,16 @@ const __vue2_script = {
733
908
  const parentNode = node.parent;
734
909
  if (this.deleteApi) {
735
910
  const res = yield this.deleteApi(node.data.id);
736
- res.code === 0 ? (this.$message.success("删除成功!"), this.$refs.tree.remove(node), this.$emit("node-deleted", parentNode, node.data)) : this.$message.error(res.message);
737
- } else
911
+ if (res.code === 0) {
912
+ this.$message.success("删除成功!");
913
+ this.$refs.tree.remove(node);
914
+ this.$emit("node-deleted", parentNode, node.data);
915
+ } else {
916
+ this.$message.error(res.message);
917
+ }
918
+ } else {
738
919
  this.$refs.tree.remove(node);
920
+ }
739
921
  } catch (e) {
740
922
  }
741
923
  });
@@ -746,24 +928,47 @@ const __vue2_script = {
746
928
  this.clear();
747
929
  return;
748
930
  }
749
- isUndefined(data.loading) ? this.$set(data, "loading", !0) : data.loading = !0;
931
+ if (isUndefined(data.loading)) {
932
+ this.$set(data, "loading", true);
933
+ } else {
934
+ data.loading = true;
935
+ }
750
936
  try {
751
- if (this.loading = !0, data.id === -1) {
752
- const res = yield this.saveApi(this.newNodeBuilder(this.text, node.parent.data || { id: -1 })), old = fastClone(data);
753
- assignReactiveProperties(data, __spreadProps(__spreadValues({}, res.data), { isTempNode: !1 })), this.$emit("node-added", data, old, node), this.registerNode(node);
754
- } else
937
+ this.loading = true;
938
+ if (data.id === -1) {
939
+ const res = yield this.saveApi(this.newNodeBuilder(this.text, node.parent.data || { id: -1 }));
940
+ const old = fastClone(data);
941
+ assignReactiveProperties(data, __spreadProps(__spreadValues({}, res.data), { isTempNode: false }));
942
+ this.$emit("node-added", data, old, node);
943
+ this.registerNode(node);
944
+ } else {
755
945
  yield this.updateApi(__spreadProps(__spreadValues({}, data), { [this.treeProps.label]: this.text }));
756
- data[this.treeProps.label] = this.text, data.edit = !1, this.$emit("node-updated", data, node), this.text = "";
946
+ }
947
+ data[this.treeProps.label] = this.text;
948
+ data.edit = false;
949
+ this.$emit("node-updated", data, node);
950
+ this.text = "";
757
951
  } catch (e) {
758
952
  }
759
- data.loading = !1, this.loading = !1;
953
+ data.loading = false;
954
+ this.loading = false;
760
955
  });
761
956
  },
762
957
  onCancel(node, data) {
763
- data.id === -1 ? this.$refs.tree.remove(node) : data.edit = !1, this.text = "";
958
+ if (data.id === -1) {
959
+ this.$refs.tree.remove(node);
960
+ } else {
961
+ data.edit = false;
962
+ }
963
+ this.text = "";
764
964
  },
765
965
  nodeClick(data, node, tree) {
766
- this.hideContextMenu(), (isUndefined(data.loading) || !data.loading) && (this.curNode = node, this.curData = data, this.$emit("on-node-click", data, node, tree));
966
+ this.hideContextMenu();
967
+ if (isUndefined(data.loading) || !data.loading) {
968
+ this.curNode = node;
969
+ this.curData = data;
970
+ this.$emit("on-node-click", data, node, tree);
971
+ }
767
972
  },
768
973
  getCurrentNode() {
769
974
  return this.$refs.tree.getCurrentNode();
@@ -772,20 +977,34 @@ const __vue2_script = {
772
977
  return __async(this, null, function* () {
773
978
  yield this.$nextTick();
774
979
  const el = this.$el.querySelector(`[data-id="${this.newChild.id}"]`);
775
- el && el.scrollIntoView();
980
+ if (el) {
981
+ el.scrollIntoView();
982
+ }
776
983
  });
777
984
  },
778
985
  scrollIntoView(expanded) {
779
986
  return __async(this, null, function* () {
780
987
  var _a, _b;
781
- yield this.$nextTick(), expanded || (yield delay(300)), (_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null || _b.focus();
988
+ yield this.$nextTick();
989
+ if (!expanded) {
990
+ yield delay(300);
991
+ }
992
+ (_b = (_a = this.$refs) == null ? void 0 : _a.labelTxt) == null ? void 0 : _b.focus();
782
993
  });
783
994
  },
784
995
  inputKeyup(event, node, data) {
785
- event.keyCode === 13 && this.onConfirm(node, data), event.keyCode === 27 && this.clear();
996
+ if (event.keyCode === 13) {
997
+ this.onConfirm(node, data);
998
+ }
999
+ if (event.keyCode === 27) {
1000
+ this.clear();
1001
+ }
786
1002
  },
787
1003
  inputBlur(event, node, data) {
788
- this.confirmButton || this.onConfirm(node, data);
1004
+ if (this.confirmButton) {
1005
+ return;
1006
+ }
1007
+ this.onConfirm(node, data);
789
1008
  },
790
1009
  getCheckedKeys() {
791
1010
  return this.$refs.tree.getCheckedKeys();
@@ -813,28 +1032,35 @@ const __vue2_script = {
813
1032
  );
814
1033
  },
815
1034
  registerNode(node) {
816
- node.store.registerNode(node), delete node.store.nodesMap[-1];
1035
+ node.store.registerNode(node);
1036
+ delete node.store.nodesMap[-1];
817
1037
  },
818
1038
  reloadTree() {
819
1039
  return __async(this, null, function* () {
820
- this.lazy ? this.treeKey = Date.now() : yield this.tryFetch();
1040
+ if (this.lazy) {
1041
+ this.treeKey = Date.now();
1042
+ } else {
1043
+ yield this.tryFetch();
1044
+ }
821
1045
  });
822
1046
  }
823
1047
  }
824
- }, __cssModules = {};
1048
+ };
1049
+ const __cssModules = {};
825
1050
  var __component__ = /* @__PURE__ */ normalizeComponent(
826
1051
  __vue2_script,
827
1052
  render,
828
1053
  staticRenderFns,
829
- !1,
1054
+ false,
830
1055
  __vue2_injectStyles,
831
1056
  null,
832
1057
  null,
833
1058
  null
834
1059
  );
835
1060
  function __vue2_injectStyles(context) {
836
- for (let o in __cssModules)
1061
+ for (let o in __cssModules) {
837
1062
  this[o] = __cssModules[o];
1063
+ }
838
1064
  }
839
1065
  const EditableTree = /* @__PURE__ */ function() {
840
1066
  return __component__.exports;