@web-utils/component 4.0.15 → 5.0.0-beta01

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 (307) hide show
  1. package/address-input/index.mjs +76 -76
  2. package/affix/index.mjs +71 -78
  3. package/aside-menu/index.mjs +20 -31
  4. package/avatar/index.mjs +94 -82
  5. package/awesome-button/index.mjs +54 -71
  6. package/capsule-tab/index.mjs +27 -32
  7. package/card/index.mjs +86 -71
  8. package/carousel/index.mjs +45 -34
  9. package/chat/index.mjs +440 -276
  10. package/chunk-file-uploader/index.mjs +2 -445
  11. package/chunk-file-uploader/style.css +1 -1
  12. package/chunks/ChunkFileUploader.C3EA0e5t.mjs +114 -0
  13. package/chunks/EditableTree.C_IJBL5b.mjs +648 -0
  14. package/chunks/ElementBaseInfo.DyuFR6fE.mjs +209 -0
  15. package/chunks/ElementDialog.C0IjriTW.mjs +681 -0
  16. package/chunks/ElementForm.ButuYDPA.mjs +627 -0
  17. package/chunks/ElementListeners.Dg3e_dmp.mjs +656 -0
  18. package/chunks/ElementMultiInstance.Dmi79FqA.mjs +290 -0
  19. package/chunks/ElementOtherConfig.C2AddGTp.mjs +51 -0
  20. package/chunks/ElementProperties.CfV8UF7L.mjs +196 -0
  21. package/chunks/ElementTaskConfig.Bn7ycGGn.mjs +446 -0
  22. package/chunks/FlowCondition.C6PdqOAW.mjs +194 -0
  23. package/chunks/FlowDesigner.uJYFfKpR.mjs +5101 -0
  24. package/chunks/FormBlock.BEENc22F.mjs +117 -0
  25. package/chunks/FormCascader.CaM-oEhv.mjs +1226 -0
  26. package/chunks/FormInputTime.Bg3UIP8H.mjs +1773 -0
  27. package/chunks/FormItem.H9OOvNzT.mjs +90 -0
  28. package/chunks/FormItemGroup.D9eRy-cZ.mjs +147 -0
  29. package/chunks/FormSelect.CanodoAI.mjs +1472 -0
  30. package/chunks/FormSwitch.DTqdaFjv.mjs +296 -0
  31. package/chunks/FormTemp.DiI5EfgK.mjs +139 -0
  32. package/chunks/FyCurd.DMj1dMK9.mjs +2622 -0
  33. package/chunks/FyForm.vgR8ujEF.mjs +904 -0
  34. package/chunks/FyFormDesign.DEWT6LsX.mjs +5600 -0
  35. package/chunks/FyUEditor.D_rEYfll.mjs +221 -0
  36. package/chunks/FyUpload.B2QKfTxF.mjs +504 -0
  37. package/chunks/Keyboard.ItiRy7Gb.mjs +379 -0
  38. package/chunks/MonacoEditor.Bd5Kui-Y.mjs +301 -0
  39. package/chunks/PageableTable.Bujb0NUx.mjs +658 -0
  40. package/chunks/RecordVideo.B35_dLty.mjs +116 -0
  41. package/chunks/SignalAndMessage.CYVzlFuL.mjs +198 -0
  42. package/chunks/SplitPane.Dw96M0Yf.mjs +219 -0
  43. package/chunks/TableColumn.DJYkznbJ.mjs +180 -0
  44. package/chunks/TableView.DyIdIxAg.mjs +484 -0
  45. package/chunks/Toolbar.DHuXJAoG.mjs +219 -0
  46. package/chunks/UserTaskListeners.Bp-2qkHs.mjs +599 -0
  47. package/chunks/VueCron.GfjodnyM.mjs +1766 -0
  48. package/chunks/VueTreeSelect.9Ywl-I8e.mjs +1872 -0
  49. package/chunks/_plugin-vue_export-helper.7vrlOII_.mjs +8 -0
  50. package/chunks/checkbox.emIuFmnt.mjs +437 -0
  51. package/chunks/confirmable-mixin.BBil7dto.mjs +1646 -0
  52. package/chunks/core.DJv6Qrae.mjs +51 -0
  53. package/chunks/dataformat.Bfr4nOcA.mjs +144 -0
  54. package/chunks/dic.DgDfnovD.mjs +116 -0
  55. package/chunks/dictionary.5eKjWeAp.mjs +19 -0
  56. package/chunks/dictionary.DxZxP0ej.mjs +87 -0
  57. package/chunks/event.B4iwtUNO.mjs +4 -0
  58. package/chunks/event.eJ-c1Z3a.mjs +224 -0
  59. package/chunks/focus-trap.DT4GnqQI.mjs +211 -0
  60. package/chunks/form-input.D25eDRMq.mjs +34 -0
  61. package/chunks/form-item.CgmUuw_n.mjs +714 -0
  62. package/chunks/form-pick.Axem0gOO.mjs +7 -0
  63. package/chunks/form-validate.B1KPCHqN.mjs +11 -0
  64. package/chunks/icon.CbS8-322.mjs +259 -0
  65. package/chunks/init.DwpukyOB.mjs +115 -0
  66. package/chunks/input.PejnqwSH.mjs +547 -0
  67. package/chunks/install.yLcn5MLL.mjs +84 -0
  68. package/chunks/message.BCmee5N0.mjs +400 -0
  69. package/chunks/overlay.DubSnqma.mjs +122 -0
  70. package/chunks/packages.BGjydzjm.mjs +56 -0
  71. package/chunks/permission.DgEVNWlh.mjs +16 -0
  72. package/chunks/photo-swipe.BB0SJZg9.mjs +55 -0
  73. package/chunks/radio.BotKXqJr.mjs +274 -0
  74. package/chunks/scroll.CzORc5Zk.mjs +28 -0
  75. package/chunks/scrollbar.CAmrlKi9.mjs +345 -0
  76. package/chunks/slot.C6Ozd2e7.mjs +25 -0
  77. package/chunks/style.BmlGmjpO.mjs +325 -0
  78. package/chunks/sub-table-plus-props.B_lLth3j.mjs +28 -0
  79. package/chunks/tab-mixin.u0EZpx3j.mjs +70 -0
  80. package/chunks/tag.DPi-PLbb.mjs +141 -0
  81. package/chunks/teleport._VGEzK4d.mjs +22 -0
  82. package/chunks/tooltip.D50x7Rva.mjs +1926 -0
  83. package/chunks/typescript.DiWBU4nj.mjs +4 -0
  84. package/chunks/use-aria.BW7nWOl1.mjs +17 -0
  85. package/chunks/use-composition.mUaomyno.mjs +47 -0
  86. package/chunks/use-deprecated.BfDSbZS9.mjs +12 -0
  87. package/chunks/use-empty-values.Dy_r78F6.mjs +263 -0
  88. package/chunks/use-form-item.wsRjehHp.mjs +47 -0
  89. package/chunks/use-global-config.C9hs-O_x.mjs +56 -0
  90. package/chunks/use-id.CFO5NeoV.mjs +15 -0
  91. package/chunks/use-size.DxrwTUwf.mjs +18 -0
  92. package/chunks/util.B3sjVZoZ.mjs +103 -0
  93. package/chunks/util.g-WQEec9.mjs +223 -0
  94. package/chunks/utilSelf.ZED4DmCU.mjs +46 -0
  95. package/chunks/utils.Cs2fYBrT.mjs +60 -0
  96. package/chunks/utils.DsGhtCIO.mjs +14 -0
  97. package/chunks/validator.C4-z_t9p.mjs +5 -0
  98. package/chunks/vnode.D_SioRnx.mjs +14 -0
  99. package/code-mirror-editor/index.mjs +89 -88
  100. package/comment/index.mjs +62 -57
  101. package/configComponents.mjs +40 -50
  102. package/confirm-button/index.mjs +34 -46
  103. package/confirmable/index.mjs +7 -17
  104. package/context-menu/index.mjs +195 -174
  105. package/count-up/index.mjs +97 -105
  106. package/custom-scrollbar/index.mjs +91 -98
  107. package/data-box/index.mjs +64 -47
  108. package/data-card/index.mjs +60 -49
  109. package/data-card-text/index.mjs +63 -51
  110. package/data-display/index.mjs +71 -53
  111. package/data-icons/index.mjs +70 -53
  112. package/data-imgtext/index.mjs +67 -46
  113. package/data-operatext/index.mjs +51 -42
  114. package/data-panel/index.mjs +57 -47
  115. package/data-pay/index.mjs +105 -52
  116. package/data-price/index.mjs +48 -42
  117. package/data-progress/index.mjs +67 -48
  118. package/data-rotate/index.mjs +61 -47
  119. package/data-table-picker/index.mjs +119 -74
  120. package/data-tabs/index.mjs +67 -47
  121. package/dialog-form/index.mjs +139 -89
  122. package/dynamic-table/index.mjs +166 -114
  123. package/e-charts/index.mjs +174 -200
  124. package/easy-popup/index.mjs +91 -102
  125. package/editable-progress/index.mjs +112 -85
  126. package/editable-tree/index.mjs +2 -485
  127. package/element-dialog/index.mjs +2 -307
  128. package/element-listeners/style.css +1 -0
  129. package/element-multi-instance/style.css +1 -0
  130. package/ellipsis/index.mjs +124 -148
  131. package/empty-view/index.mjs +48 -65
  132. package/error-view/index.mjs +39 -51
  133. package/flex-column/index.mjs +32 -51
  134. package/flex-item/index.mjs +54 -64
  135. package/flex-row/index.mjs +32 -39
  136. package/flex-scroller/index.mjs +29 -30
  137. package/flow/index.mjs +240 -248
  138. package/flow-designer/index.mjs +2 -5983
  139. package/flow-designer/style.css +1 -1
  140. package/flow-node/index.mjs +56 -64
  141. package/flow-viewer/index.mjs +159 -157
  142. package/form-block/index.mjs +2 -149
  143. package/form-button/index.mjs +35 -47
  144. package/form-card/index.mjs +14 -25
  145. package/form-cascader/index.mjs +2 -116
  146. package/form-checkbox/index.mjs +89 -71
  147. package/form-checkbox-group/index.mjs +161 -116
  148. package/form-date-picker/index.mjs +155 -144
  149. package/form-holder/index.mjs +137 -110
  150. package/form-input/index.mjs +113 -87
  151. package/form-input-cron-expression/index.mjs +97 -79
  152. package/form-input-email/index.mjs +64 -52
  153. package/form-input-id-card/index.mjs +72 -55
  154. package/form-input-phone-number/index.mjs +71 -57
  155. package/form-input-tag/index.mjs +88 -62
  156. package/form-input-time/index.mjs +2 -74
  157. package/form-item/index.mjs +2 -5
  158. package/form-item-config-provider/index.mjs +46 -60
  159. package/form-item-group/index.mjs +2 -160
  160. package/form-radio-group/index.mjs +161 -122
  161. package/form-select/index.mjs +2 -181
  162. package/form-switch/index.mjs +2 -55
  163. package/form-table/index.mjs +131 -85
  164. package/form-table-plus/index.mjs +164 -109
  165. package/form-textarea/index.mjs +90 -57
  166. package/form-tree-select/index.mjs +89 -72
  167. package/form-tree-select-multiple/index.mjs +92 -78
  168. package/form-view/index.mjs +275 -211
  169. package/fy-array/index.mjs +121 -74
  170. package/fy-article/index.mjs +73 -60
  171. package/fy-cascader/index.mjs +113 -91
  172. package/fy-checkbox/index.mjs +96 -66
  173. package/fy-code/index.mjs +48 -50
  174. package/fy-curd/index.mjs +2 -1903
  175. package/fy-date/index.mjs +76 -42
  176. package/fy-draggable/index.mjs +322 -318
  177. package/fy-dynamic/index.mjs +259 -227
  178. package/fy-empty/index.mjs +35 -36
  179. package/fy-form/index.mjs +2 -17
  180. package/fy-form-design/index.mjs +2 -2890
  181. package/fy-form-design/style.css +1 -1
  182. package/fy-from/crud/zh.d.ts +6 -6
  183. package/fy-input/index.mjs +117 -99
  184. package/fy-input-color/index.mjs +77 -56
  185. package/fy-input-icon/index.mjs +129 -85
  186. package/fy-input-map/index.mjs +242 -186
  187. package/fy-input-number/index.mjs +74 -50
  188. package/fy-input-table/index.mjs +160 -109
  189. package/fy-input-tree/index.mjs +259 -182
  190. package/fy-progress/index.mjs +36 -40
  191. package/fy-radio/index.mjs +53 -38
  192. package/fy-rate/index.mjs +86 -71
  193. package/fy-select/index.mjs +223 -140
  194. package/fy-slider/index.mjs +68 -44
  195. package/fy-switch/index.mjs +67 -42
  196. package/fy-tabs/index.mjs +46 -48
  197. package/fy-time/index.mjs +81 -53
  198. package/fy-title/index.mjs +18 -27
  199. package/fy-tree/index.mjs +382 -292
  200. package/fy-u-editor/index.mjs +2 -357
  201. package/fy-upload/index.mjs +2 -423
  202. package/guide-steps/index.mjs +72 -73
  203. package/helper-function.d.ts +2 -30
  204. package/helper-function.mjs +41 -67
  205. package/highlight-j-s/index.mjs +50 -59
  206. package/icon-card/index.mjs +34 -36
  207. package/icon-temp/index.mjs +27 -27
  208. package/iframe-window/index.mjs +39 -33
  209. package/image-cropper/index.mjs +171 -75
  210. package/image-preview/index.mjs +187 -118
  211. package/image-viewer/index.mjs +69 -66
  212. package/index.d.ts +3 -9
  213. package/index.mjs +173 -488
  214. package/input-number-range/index.mjs +78 -59
  215. package/j-s-x-component/index.mjs +13 -15
  216. package/keyboard/index.mjs +2 -369
  217. package/license/index.mjs +106 -115
  218. package/loading-view/index.mjs +39 -51
  219. package/login/index.mjs +252 -125
  220. package/monaco-editor/index.mjs +2 -7
  221. package/name-avatar/index.mjs +61 -53
  222. package/nav-bar/index.mjs +33 -31
  223. package/not-implement/index.mjs +10 -22
  224. package/notice/index.mjs +100 -94
  225. package/package.json +3 -3
  226. package/page/index.mjs +18 -25
  227. package/page-header/index.mjs +27 -33
  228. package/page-index/index.mjs +121 -100
  229. package/page-index-top/index.mjs +79 -79
  230. package/page-skeleton/index.mjs +48 -45
  231. package/page-skeleton-new/index.mjs +79 -50
  232. package/pageable-table/index.mjs +2 -522
  233. package/pageable-view/index.mjs +279 -275
  234. package/photo-swipe/index.d.ts +4 -0
  235. package/photo-swipe/index.mjs +33 -36
  236. package/picker-table-view/index.mjs +224 -126
  237. package/present-view/index.mjs +266 -200
  238. package/queue/index.mjs +45 -53
  239. package/record-video/index.mjs +2 -134
  240. package/resize-observer/index.mjs +43 -46
  241. package/search/index.mjs +116 -109
  242. package/sign/index.mjs +103 -110
  243. package/sign-panel/index.mjs +182 -141
  244. package/skeleton/index.mjs +51 -54
  245. package/skeleton-panel/index.mjs +33 -38
  246. package/split-pane/index.mjs +3 -197
  247. package/stateful/index.mjs +69 -73
  248. package/static-pageable-table/index.mjs +72 -66
  249. package/sub-table/index.mjs +508 -219
  250. package/sub-table-plus/index.mjs +592 -19
  251. package/swiper/index.mjs +128 -121
  252. package/tab/index.mjs +117 -119
  253. package/tab-item/index.mjs +48 -56
  254. package/table-column/index.mjs +2 -5
  255. package/table-view/index.mjs +3 -334
  256. package/tabs-view/index.mjs +109 -106
  257. package/tag-render/index.mjs +79 -69
  258. package/text-ellipsis/index.mjs +94 -78
  259. package/toolbar/index.mjs +2 -255
  260. package/toolbar-button/index.mjs +145 -121
  261. package/verify/index.mjs +58 -64
  262. package/vue-cron/index.mjs +2 -1188
  263. package/vue-qr-code/index.mjs +30 -54
  264. package/vue-quill-editor/index.mjs +123 -99
  265. package/vue-tags-input/index.mjs +348 -431
  266. package/vue-tree-select/index.mjs +2 -2627
  267. package/vue-video-player/index.mjs +135 -136
  268. package/watermark/index.mjs +46 -74
  269. package/web-types.json +197 -975
  270. package/x-input-tag/index.mjs +144 -109
  271. package/chunks/ElementTaskConfig.AvBOzAni.mjs +0 -325
  272. package/chunks/FormItem.Bhsy_O2B.mjs +0 -372
  273. package/chunks/FyForm.DriwCJ7b.mjs +0 -765
  274. package/chunks/MonacoEditor.D31t4FTy.mjs +0 -327
  275. package/chunks/SignalAndMessage.BpjOoKhK.mjs +0 -92
  276. package/chunks/SubTablePlus.BH0IIv3X.mjs +0 -270
  277. package/chunks/TableColumn.BzivvXMF.mjs +0 -337
  278. package/chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs +0 -10
  279. package/chunks/confirmable-mixin.BFZb6pcK.mjs +0 -86
  280. package/chunks/dataformat.DJoNBlmI.mjs +0 -154
  281. package/chunks/dic.BinnDitI.mjs +0 -128
  282. package/chunks/dictionary.DqiP9x2m.mjs +0 -25
  283. package/chunks/event.DSlcqYHL.mjs +0 -236
  284. package/chunks/form-input.BtS_J5a2.mjs +0 -31
  285. package/chunks/form-pick.BFTIVn_i.mjs +0 -11
  286. package/chunks/form-validate.CVarNHKX.mjs +0 -12
  287. package/chunks/helper.BiMLcEEk.mjs +0 -41
  288. package/chunks/index.BmYCjxZQ.mjs +0 -47
  289. package/chunks/index.CIfe3UB3.mjs +0 -16
  290. package/chunks/index.Cn7aq-Et.mjs +0 -184
  291. package/chunks/init.xOlFpTyZ.mjs +0 -122
  292. package/chunks/packages.ByyangTp.mjs +0 -58
  293. package/chunks/permission.CO31YIkD.mjs +0 -16
  294. package/chunks/slot.DXIbhGat.mjs +0 -27
  295. package/chunks/tab-mixin.BNK6dxLN.mjs +0 -81
  296. package/chunks/util.DI42t5GU.mjs +0 -241
  297. package/color-picker/index.mjs +0 -157
  298. package/egd-collapse/index.mjs +0 -62
  299. package/egd-collapse-item/index.mjs +0 -72
  300. package/form-input-number/index.mjs +0 -70
  301. package/form-input-number/style.css +0 -1
  302. package/input-number/index.mjs +0 -233
  303. package/input-number/style.css +0 -1
  304. package/keep-view-alive/index.mjs +0 -117
  305. package/search-popover/index.mjs +0 -118
  306. package/search-popover/style.css +0 -1
  307. /package/{base.css → utils/style.css} +0 -0
package/fy-curd/index.mjs CHANGED
@@ -1,1903 +1,2 @@
1
- import l from "element-ui/lib/button";
2
- import F from "element-ui/lib/col";
3
- import q from "../fy-input/index.mjs";
4
- import k from "../fy-select/index.mjs";
5
- import X from "element-ui/lib/button-group";
6
- import J from "element-ui/lib/row";
7
- import I from "element-ui/lib/drawer";
8
- import { d as c, u as P, o as m, i as S, k as b, c as Q, v as Y, x as Z, s as ee } from "../chunks/util.DI42t5GU.mjs";
9
- import { n as g } from "../chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs";
10
- import { F as O, d as D, _ as z } from "../chunks/FyForm.DriwCJ7b.mjs";
11
- import te from "../element-dialog/index.mjs";
12
- import ie from "element-ui/lib/checkbox";
13
- import _ from "element-ui/lib/table-column";
14
- import M from "element-ui/lib/table";
15
- import { isBlank as u } from "@web-utils/core";
16
- import ne from "element-ui/lib/pagination";
17
- import T from "element-ui/lib/card";
18
- import x from "element-ui/lib/dropdown-item";
19
- import re from "element-ui/lib/dropdown-menu";
20
- import se from "element-ui/lib/dropdown";
21
- import { p as B } from "../chunks/permission.CO31YIkD.mjs";
22
- import E from "../icon-temp/index.mjs";
23
- import oe from "../fy-rate/index.mjs";
24
- import le from "element-ui/lib/link";
25
- import ae from "element-ui/lib/tooltip";
26
- import ce from "element-ui/lib/form-item";
27
- import { s as ue } from "../chunks/dic.BinnDitI.mjs";
28
- import "../icon-temp/style.css";
29
- import de from "element-ui/lib/empty";
30
- import pe from "element-ui/lib/form";
31
- import he from "element-ui/lib/tag";
32
- import me from "../fy-date/index.mjs";
33
- import { s as fe } from "../chunks/slot.DXIbhGat.mjs";
34
- import { d as ge, f as _e, t as be, b as ve } from "../chunks/dataformat.DJoNBlmI.mjs";
35
- import { p as ye } from "../chunks/packages.ByyangTp.mjs";
36
- import { i as xe } from "../chunks/init.xOlFpTyZ.mjs";
37
- const $e = {
38
- name: "DialogFilter",
39
- inject: ["crud"],
40
- data() {
41
- return {
42
- box: !1,
43
- columnObj: {},
44
- symbolDic: [
45
- {
46
- label: "=",
47
- value: "="
48
- },
49
- {
50
- label: "≠",
51
- value: "≠"
52
- },
53
- {
54
- label: "like",
55
- value: "like"
56
- },
57
- {
58
- label: ">",
59
- value: ">"
60
- },
61
- {
62
- label: "≥",
63
- value: "≥"
64
- },
65
- {
66
- label: "<",
67
- value: "<"
68
- },
69
- {
70
- label: "≤",
71
- value: "≤"
72
- },
73
- {
74
- label: "∈",
75
- value: "∈"
76
- }
77
- ],
78
- list: [],
79
- columnOption: {}
80
- };
81
- },
82
- methods: {
83
- handleShow() {
84
- this.getColumnOption(), this.box = !0;
85
- },
86
- getColumnOption() {
87
- const t = [];
88
- c(this.crud.propOption).forEach((i) => {
89
- i.showColumn !== !1 && t.push(
90
- Object.assign(i, {
91
- value: i.prop
92
- })
93
- );
94
- }), this.columnOption = t, this.columnObj = this.columnOption[0];
95
- },
96
- handleDelete(t) {
97
- this.list.splice(t, 1);
98
- },
99
- handleClear() {
100
- this.list = [];
101
- },
102
- handleValueClear() {
103
- this.list.forEach((t) => {
104
- t.value = "";
105
- });
106
- },
107
- handleSubmit() {
108
- const t = [];
109
- this.list.forEach((e) => {
110
- t.push([e.text, e.symbol, e.value]);
111
- }), this.crud.$emit("filter", t), this.box = !1;
112
- },
113
- handleChange(t) {
114
- this.list[t].value = "";
115
- },
116
- handleAdd() {
117
- const t = this.columnObj.prop;
118
- this.list.push({
119
- text: t,
120
- value: "",
121
- symbol: this.symbolDic[0].value
122
- });
123
- }
124
- }
125
- };
126
- var Ce = function() {
127
- var e = this, i = e._self._c;
128
- return e.box ? i("div", [i(I, { staticClass: "avue-dialog", class: ["avue-crud__dialog", "avue-crud__filter"], attrs: { "lock-scroll": "", "append-to-body": "", title: "过滤条件", size: e.crud.isMobile ? "100%" : "60%", visible: e.box }, on: { "update:visible": function(n) {
129
- e.box = n;
130
- } } }, [i(J, { attrs: { span: 24 } }, [i("div", { staticClass: "avue-crud__filter-menu" }, [i(X, [i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleAdd } }, [e._v(" 新增条件 ")]), i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleClear } }, [e._v(" 清空条件 ")]), i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleValueClear } }, [e._v(" 清空数据 ")])], 1)], 1), e._l(e.list, function(n, r) {
131
- return i(F, { key: r, staticClass: "avue-crud__filter-item", attrs: { md: 12, xs: 24, sm: 12 } }, [i(k, { staticClass: "avue-crud__filter-label", attrs: { dic: e.columnOption, clearable: !1, size: e.crud.isMediumSize }, on: { change: function(s) {
132
- return e.handleChange(r);
133
- } }, model: { value: n.text, callback: function(s) {
134
- e.$set(n, "text", s);
135
- }, expression: "column.text" } }), i(k, { staticClass: "avue-crud__filter-symbol", attrs: { dic: e.symbolDic, clearable: !1, size: e.crud.isMediumSize }, model: { value: n.symbol, callback: function(s) {
136
- e.$set(n, "symbol", s);
137
- }, expression: "column.symbol" } }), i(q, { staticClass: "avue-crud__filter-value", attrs: { size: e.crud.isMediumSize }, model: { value: n.value, callback: function(s) {
138
- e.$set(n, "value", s);
139
- }, expression: "column.value" } }), i(l, { staticClass: "avue-crud__filter-icon", attrs: { type: "danger", size: "mini", circle: "", icon: "el-icon-minus" }, on: { click: function(s) {
140
- return e.handleDelete(r);
141
- } } })], 1);
142
- }), i(F, { staticClass: "avue-form__menu avue-form__menu--right", attrs: { span: 24 } }, [i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleSubmit } }, [e._v(" 确 定 ")]), i(l, { attrs: { size: e.crud.isMediumSize }, on: { click: function(n) {
143
- e.box = !1;
144
- } } }, [e._v(" 取 消 ")])], 1)], 2)], 1)], 1) : e._e();
145
- }, we = [], Se = /* @__PURE__ */ g(
146
- $e,
147
- Ce,
148
- we,
149
- !1,
150
- null,
151
- null
152
- );
153
- const L = Se.exports, Oe = {
154
- name: "DialogExcel",
155
- inject: ["crud"],
156
- data() {
157
- return {
158
- option: {},
159
- columnOption: {},
160
- box: !1,
161
- form: {
162
- name: this.crud.tableOption.title
163
- }
164
- };
165
- },
166
- methods: {
167
- handleShow() {
168
- this.getColumnOption(), this.getOption(), this.box = !0;
169
- },
170
- handleSubmit() {
171
- this.$Export.excel({
172
- title: this.form.name,
173
- columns: this.getColumn(),
174
- data: this.handleSum()
175
- }), this.box = !1;
176
- },
177
- // 计算统计
178
- handleSum() {
179
- const t = this.crud.tableOption, e = this.crud.propOption, i = this.form.type ? this.crud.list : this.crud.tableSelect, n = [];
180
- return this.form.params.includes("data") && i.forEach((r) => {
181
- const s = c(r);
182
- e.forEach((o) => {
183
- const a = o.parentProp ? (this.crud.cascaderDIC[o.$index] || {})[o.prop] : this.crud.DIC[o.prop];
184
- s[o.prop] = D(s, o, t, a);
185
- }), n.push(s);
186
- }), this.form.params.includes("sum") && t.showSummary && n.push(this.crud.sumsList), n;
187
- },
188
- getOption() {
189
- this.option = {
190
- submitBtn: !1,
191
- emptyBtn: !1,
192
- column: [
193
- {
194
- label: "文件名",
195
- prop: "name",
196
- span: 24
197
- },
198
- {
199
- label: "选择数据",
200
- prop: "type",
201
- span: 24,
202
- type: "select",
203
- dicData: [
204
- {
205
- label: "当前数据(当前页全部的数据)",
206
- value: !0
207
- },
208
- {
209
- label: "选中的数据(当前页选中的数据)",
210
- disabled: this.crud.tableOption.selection !== !0,
211
- value: !1
212
- }
213
- ]
214
- },
215
- {
216
- label: "选择字段",
217
- prop: "prop",
218
- type: "tree",
219
- multiple: !0,
220
- checkStrictly: !0,
221
- span: 24,
222
- props: {
223
- value: "prop"
224
- },
225
- dicData: this.columnOption
226
- },
227
- {
228
- label: "参数设置",
229
- prop: "params",
230
- type: "checkbox",
231
- span: 24,
232
- value: ["header", "data"].concat(
233
- (() => {
234
- const t = [];
235
- return this.crud.isHeader && t.push("headers"), this.crud.isShowSummary && t.push("sum"), t;
236
- })()
237
- ),
238
- dicData: [
239
- {
240
- label: "表头",
241
- disabled: !0,
242
- value: "header"
243
- },
244
- {
245
- label: "数据源",
246
- value: "data"
247
- }
248
- ].concat(
249
- (() => {
250
- const t = [];
251
- return t.push({
252
- label: "复杂表头",
253
- value: "headers",
254
- disabled: !this.crud.isHeader
255
- }), t.push({
256
- label: "合计统计",
257
- value: "sum",
258
- disabled: !this.crud.isShowSummary
259
- }), t;
260
- })()
261
- )
262
- }
263
- ]
264
- }, this.form.type = this.crud.selectLen === 0;
265
- },
266
- getColumnOption() {
267
- const t = c(this.crud.columnOption), e = [], i = (n = []) => {
268
- n.forEach((r, s) => {
269
- const o = r.children;
270
- o && !Array.isArray(o) ? delete r.children : r.showColumn === !1 ? n.splice(s, 1) : (e.push(r.prop), r.children && i(o));
271
- });
272
- };
273
- i(t), this.columnOption = t, this.form.prop = e;
274
- },
275
- getColumn() {
276
- const t = c(this.columnOption), e = this.$refs.form.getPropRef("prop").$refs.temp.getHalfList();
277
- if (!this.form.params) return [];
278
- if (this.form.params.includes("headers")) {
279
- const i = (n = []) => {
280
- n.forEach((r, s) => {
281
- e.includes(r.prop) ? r.children && i(r.children) : n.splice(s, 1);
282
- });
283
- };
284
- return i(t), t;
285
- } else {
286
- const i = [], n = (r = []) => {
287
- r.forEach((s) => {
288
- s.children ? n(s.children) : e.includes(s.prop) && i.push(s);
289
- });
290
- };
291
- return n(t), i;
292
- }
293
- }
294
- }
295
- };
296
- var Be = function() {
297
- var e = this, i = e._self._c;
298
- return e.box ? i("div", [i(te, { staticClass: "avue-dialog", attrs: { title: "导出", "lock-scroll": "", visible: e.box, width: e.crud.isMobile ? "100%" : "30%" }, on: { "update:visible": function(n) {
299
- e.box = n;
300
- } }, scopedSlots: e._u([{ key: "footer", fn: function() {
301
- return [i("span", { staticClass: "dialog-footer" }, [i(l, { attrs: { type: "primary", size: e.crud.isMediumSize }, on: { click: e.handleSubmit } }, [e._v("确定")]), i(l, { attrs: { size: e.crud.isMediumSize }, on: { click: function(n) {
302
- e.box = !1;
303
- } } }, [e._v("取消")])], 1)];
304
- }, proxy: !0 }], null, !1, 2375905330) }, [i(O, { attrs: { option: e.option }, model: { value: e.form, callback: function(n) {
305
- e.form = n;
306
- }, expression: "form" } })], 1)], 1) : e._e();
307
- }, Fe = [], ke = /* @__PURE__ */ g(
308
- Oe,
309
- Be,
310
- Fe,
311
- !1,
312
- null,
313
- null
314
- );
315
- const V = ke.exports, h = {
316
- menuWidth: 220,
317
- menuFixed: "right",
318
- menuXsWidth: 100,
319
- menuAlign: "center",
320
- menuHeaderAlign: "center",
321
- headerAlign: "left",
322
- // 图标
323
- cancelBtnIcon: "el-icon-circle-close",
324
- viewBtnIcon: "el-icon-view",
325
- editBtnIcon: "el-icon-edit",
326
- copyBtnIcon: "el-icon-document-add",
327
- addBtnIcon: "el-icon-plus",
328
- printBtnIcon: "el-icon-printer",
329
- excelBtnIcon: "el-icon-download",
330
- delBtnIcon: "el-icon-delete",
331
- searchBtnIcon: "el-icon-search",
332
- emptyBtnIcon: "el-icon-delete",
333
- saveBtnIcon: "el-icon-circle-plus-outline",
334
- updateBtnIcon: "el-icon-circle-check",
335
- columnBtnIcon: "el-icon-s-operation",
336
- filterBtnIcon: "el-icon-tickets",
337
- refreshBtnIcon: "el-icon-refresh",
338
- // 显隐
339
- viewBtn: !1,
340
- editBtn: !0,
341
- copyBtn: !1,
342
- cancelBtn: !0,
343
- addBtn: !0,
344
- addRowBtn: !1,
345
- printBtn: !1,
346
- excelBtn: !1,
347
- delBtn: !0,
348
- cellBtn: !1,
349
- dateBtn: !1,
350
- updateBtn: !0,
351
- saveBtn: !0,
352
- refreshBtn: !0,
353
- columnBtn: !0,
354
- filterBtn: !1,
355
- queryBtn: !0,
356
- menuBtn: !1,
357
- searchBtn: !0,
358
- clearBtn: !0,
359
- selectClearBtn: !0,
360
- searchShow: !0,
361
- tip: !0,
362
- dialogWidth: "60%",
363
- dialogDrag: !1,
364
- formFullscreen: !1,
365
- pageBackground: !0,
366
- page: !0,
367
- menu: !0,
368
- indexLabel: "#",
369
- indexWidth: 50,
370
- indexFixed: "left",
371
- selectionWidth: 50,
372
- selectionFixed: "left",
373
- expandWidth: 60,
374
- expandFixed: "left",
375
- filterMultiple: !0,
376
- calcHeight: 300,
377
- width: "100%",
378
- searchGutter: 20,
379
- searchLabelWidth: 80,
380
- searchSpan: 6,
381
- dropRowClass: ".el-table__body-wrapper > table > tbody",
382
- dropColClass: ".el-table__header-wrapper tr",
383
- ghostClass: "avue-crud__ghost"
384
- }, Ie = {
385
- name: "DialogColumn",
386
- inject: ["crud"],
387
- data() {
388
- return {
389
- data: [],
390
- columnBox: !1
391
- };
392
- },
393
- computed: {
394
- defaultColumn() {
395
- return [
396
- {
397
- label: "隐藏",
398
- prop: "hide"
399
- },
400
- {
401
- label: "冻结",
402
- prop: "fixed"
403
- },
404
- {
405
- label: "过滤",
406
- prop: "filters"
407
- },
408
- {
409
- label: "排序",
410
- prop: "sortable"
411
- },
412
- {
413
- label: "序号",
414
- prop: "index",
415
- hide: !0
416
- },
417
- {
418
- label: "宽度",
419
- prop: "width",
420
- hide: !0
421
- }
422
- ];
423
- }
424
- },
425
- methods: {
426
- handleShow() {
427
- this.data = [], this.crud.propOption.forEach((t) => {
428
- t.showColumn !== !1 && this.data.push(t);
429
- }), this.columnBox = !0, this.$nextTick(() => this.rowDrop());
430
- },
431
- handleChange(t) {
432
- ["hide", "filters"].includes(t) && this.crud.refreshTable();
433
- },
434
- rowDrop() {
435
- const t = this.$refs.table.$el.querySelectorAll(h.dropRowClass)[0];
436
- this.crud.tableDrop("column", t, (e) => {
437
- const i = e.oldIndex, n = e.newIndex;
438
- this.crud.headerSort(i, n), this.crud.refreshTable(() => this.rowDrop());
439
- });
440
- }
441
- }
442
- };
443
- var Pe = function() {
444
- var e = this, i = e._self._c;
445
- return e.columnBox ? i("div", [i(I, { staticClass: "avue-crud__dialog avue-crud__column avue-dialog", attrs: { "lock-scroll": "", "append-to-body": "", title: "列显隐", size: e.crud.isMobile ? "100%" : "40%", visible: e.columnBox }, on: { "update:visible": function(n) {
446
- e.columnBox = n;
447
- } } }, [i(M, { ref: "table", attrs: { data: e.data, height: "100%", size: "small", border: "" } }, [i(_, { key: "label", attrs: { align: "center", width: "100", "header-align": "center", prop: "label", label: "列名" } }), e._l(e.defaultColumn, function(n, r) {
448
- return [n.hide !== !0 ? i(_, { key: r, attrs: { label: n.label, prop: n.prop, align: "center", "header-align": "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: s }) {
449
- return [i(ie, { on: { change: function(o) {
450
- return e.handleChange(n.prop);
451
- } }, model: { value: e.crud.objectOption[s.prop][n.prop], callback: function(o) {
452
- e.$set(e.crud.objectOption[s.prop], n.prop, o);
453
- }, expression: "crud.objectOption[row.prop][item.prop]" } })];
454
- } }], null, !0) }) : e._e()];
455
- })], 2)], 1)], 1) : e._e();
456
- }, De = [], ze = /* @__PURE__ */ g(
457
- Ie,
458
- Pe,
459
- De,
460
- !1,
461
- null,
462
- null
463
- );
464
- const R = ze.exports, Me = {
465
- name: "FyDialogForm",
466
- inject: ["crud"],
467
- data() {
468
- return {
469
- disabled: !1,
470
- boxType: "",
471
- fullscreen: !1,
472
- size: null,
473
- boxVisible: !1
474
- };
475
- },
476
- computed: {
477
- option() {
478
- const t = c(this.crud.tableOption);
479
- return t.boxType = this.boxType, t.column = c(this.crud.propOption), t.menuBtn = !1, this.isAdd ? (t.submitBtn = t.saveBtn, t.submitText = this.crud.menuIcon("saveBtn"), t.submitIcon = this.crud.getBtnIcon("saveBtn")) : this.isEdit ? (t.submitBtn = t.updateBtn, t.submitText = this.crud.menuIcon("updateBtn"), t.submitIcon = this.crud.getBtnIcon("updateBtn")) : this.isView && (t.detail = !0), t.emptyBtn = t.cancelBtn, t.emptyText = this.crud.menuIcon("cancelBtn"), t.emptyIcon = this.crud.getBtnIcon("cancelBtn"), this.crud.isGroup || (t.dicFlag = !1, t.dicData = this.crud.DIC), u(t.dicFlag) || t.column.forEach((e) => {
480
- e.boxType = this.boxType, e.dicFlag = e.dicFlag || t.dicFlag;
481
- }), t;
482
- },
483
- isView() {
484
- return this.boxType === "view";
485
- },
486
- isAdd() {
487
- return this.boxType === "add";
488
- },
489
- isEdit() {
490
- return this.boxType === "edit";
491
- },
492
- direction() {
493
- return this.crud.tableOption.dialogDirection;
494
- },
495
- width() {
496
- return m(`${this.crud.tableOption.dialogWidth}`, this.crud.isMobile ? "100%" : `${h.dialogWidth}`);
497
- },
498
- dialogType() {
499
- return this.isDrawer ? "ElDrawer" : "ElementDialog";
500
- },
501
- dialogTop() {
502
- return !this.isDrawer && !this.fullscreen ? this.crud.tableOption.dialogTop : "0";
503
- },
504
- isDrawer() {
505
- return this.crud.tableOption.dialogType === "drawer";
506
- },
507
- params() {
508
- return this.isDrawer ? {
509
- size: this.fullscreen ? "100%" : this.width,
510
- direction: this.crud.tableOption.dialogDirection
511
- } : {
512
- width: this.width,
513
- fullscreen: this.fullscreen
514
- };
515
- },
516
- dialogTitle() {
517
- const t = `${this.boxType}`;
518
- if (!u(this.boxType)) {
519
- const e = {
520
- tipStartTitle: "当前表格已选择",
521
- tipEndTitle: "项",
522
- editTitle: "编 辑",
523
- copyTitle: "复 制",
524
- addTitle: "新 增",
525
- viewTitle: "查 看",
526
- filterTitle: "过滤条件",
527
- showTitle: "列显隐"
528
- };
529
- return this.crud.tableOption[`${t}Title`] || e[`${t}Title`];
530
- }
531
- return "";
532
- },
533
- dialogMenuPosition() {
534
- return this.crud.option.dialogMenuPosition || "right";
535
- }
536
- },
537
- methods: {
538
- optVal: m,
539
- uploadFun: P,
540
- submit() {
541
- this.$refs.tableForm.submit();
542
- },
543
- reset() {
544
- this.$refs.tableForm.resetForm(!1);
545
- },
546
- getSlotName(t) {
547
- return t.replace("Form", "");
548
- },
549
- initFun() {
550
- ["clearValidate", "validate", "resetForm", "validateField"].forEach((t) => {
551
- this.crud[t] = this.$refs.tableForm[t];
552
- });
553
- },
554
- handleChange() {
555
- this.crud.setVal();
556
- },
557
- handleTabClick(t, e) {
558
- this.crud.$emit("tab-click", t, e);
559
- },
560
- handleFullScreen() {
561
- this.isDrawer && (u(this.size) ? this.size = "100%" : this.size = ""), this.fullscreen = !this.fullscreen;
562
- },
563
- handleError(t) {
564
- this.crud.$emit("error", t);
565
- },
566
- handleSubmit(t, e) {
567
- this.isAdd ? this.rowSave(e) : this.isEdit && this.rowUpdate(e);
568
- },
569
- // 保存
570
- rowSave(t) {
571
- this.crud.$emit("row-save", S(this.crud.tableForm, ["$"]), this.closeDialog, t);
572
- },
573
- // 更新
574
- rowUpdate(t) {
575
- this.crud.$emit("row-update", S(this.crud.tableForm, ["$"]), this.crud.tableIndex, this.closeDialog, t);
576
- },
577
- closeDialog(t) {
578
- t = c(t), t && (() => {
579
- if (this.isEdit) {
580
- const { parentList: i, index: n } = this.crud.findData(t[this.crud.rowKey]);
581
- if (i) {
582
- const r = i.splice(n, 1)[0];
583
- t[this.crud.childrenKey] = r[this.crud.childrenKey], i.splice(n, 0, t);
584
- }
585
- } else if (this.isAdd) {
586
- const { item: i } = this.crud.findData(t[this.crud.rowParentKey]);
587
- i ? (i[this.crud.childrenKey] || this.$set(i, this.crud.childrenKey, []), this.crud.tableOption.lazy && this.$set(i, this.crud.hasChildrenKey, !0), i[this.crud.childrenKey].push(t)) : this.crud.list.push(t);
588
- }
589
- })(), this.hide();
590
- },
591
- // 隐藏表单
592
- hide(t) {
593
- const e = () => {
594
- t == null || t(), this.crud.tableIndex = -1, this.crud.tableForm = {}, this.crud.setVal(), this.boxVisible = !1;
595
- };
596
- typeof this.crud.beforeClose == "function" ? this.crud.beforeClose(e, this.boxType) : e();
597
- },
598
- // 显示表单
599
- show(t) {
600
- this.boxType = t;
601
- const e = () => {
602
- this.fullscreen = this.crud.tableOption.dialogFullscreen, this.boxVisible = !0, this.$nextTick(() => {
603
- this.initFun();
604
- });
605
- };
606
- typeof this.crud.beforeOpen == "function" ? this.crud.beforeOpen(e, this.boxType) : e();
607
- }
608
- }
609
- };
610
- var Te = function() {
611
- var e = this, i = e._self._c;
612
- return e.boxVisible ? i(e.dialogType, e._b({ tag: "Component", staticClass: "dialog-form", attrs: { "lock-scroll": "", "show-full-screen": "", "destroy-on-close": e.crud.tableOption.dialogDestroy, "wrapper-closable": e.crud.tableOption.dialogClickModal, direction: e.direction, "custom-class": e.crud.tableOption.dialogCustomClass, "modal-append-to-body": "", "append-to-body": "", top: e.dialogTop, title: e.dialogTitle, "close-on-press-escape": e.crud.tableOption.dialogEscape, "close-on-click-modal": e.optVal(e.crud.tableOption.dialogClickModal, !1), modal: e.crud.tableOption.dialogModal, "show-close": e.crud.tableOption.dialogCloseBtn, visible: e.boxVisible, "before-close": e.hide }, on: { "update:visible": function(n) {
613
- e.boxVisible = n;
614
- } } }, "Component", e.params, !1), [i(O, e._b({ ref: "tableForm", attrs: { status: e.disabled, option: e.option }, on: { "update:status": function(n) {
615
- e.disabled = n;
616
- }, change: e.handleChange, submit: e.handleSubmit, "reset-change": e.hide, "tab-click": e.handleTabClick, error: e.handleError }, scopedSlots: e._u([e._l(e.crud.formSlot, function(n) {
617
- return { key: e.getSlotName(n), fn: function(r) {
618
- return [e._t(n, null, null, Object.assign(r, { type: e.boxType }))];
619
- } };
620
- })], null, !0), model: { value: e.crud.tableForm, callback: function(n) {
621
- e.$set(e.crud, "tableForm", n);
622
- }, expression: "crud.tableForm" } }, "FyForm", e.uploadFun({}, e.crud), !1)), i("span", { staticClass: "avue-dialog__footer", class: `avue-dialog__footer--${e.dialogMenuPosition}` }, [e.optVal(e.option.submitBtn, !0) && !e.isView ? i(l, { attrs: { loading: e.disabled, size: e.crud.controlSize, icon: e.option.submitIcon, type: "primary" }, on: { click: e.submit } }, [e._v(" " + e._s(e.option.submitText) + " ")]) : e._e(), e.optVal(e.option.emptyBtn, !0) && !e.isView ? i(l, { attrs: { disabled: e.disabled, size: e.crud.controlSize, icon: e.option.emptyIcon }, on: { click: e.reset } }, [e._v(" " + e._s(e.option.emptyText) + " ")]) : e._e(), e._t("menuForm", null, { disabled: e.disabled, size: e.crud.controlSize, type: e.boxType })], 2)], 1) : e._e();
623
- }, Ee = [], Le = /* @__PURE__ */ g(
624
- Me,
625
- Te,
626
- Ee,
627
- !1,
628
- null,
629
- null
630
- );
631
- const A = Le.exports, Ve = {
632
- name: "TablePage",
633
- inject: ["crud"],
634
- data() {
635
- return {
636
- defaultPage: {
637
- single: !1,
638
- total: 0,
639
- // 总页数
640
- pagerCount: 7,
641
- // 超过多少条隐藏
642
- currentPage: 1,
643
- // 当前页数
644
- pageSize: 10,
645
- // 每页显示多少条
646
- pageSizes: [10, 20, 30, 40, 50, 100],
647
- layout: "total, sizes, prev, pager, next, jumper",
648
- background: !0
649
- // 背景颜色
650
- }
651
- };
652
- },
653
- computed: {
654
- pageFlag() {
655
- return this.defaultPage.total !== 0;
656
- }
657
- },
658
- watch: {
659
- "crud.page": {
660
- handler() {
661
- this.pageInit();
662
- },
663
- deep: !0
664
- },
665
- pageFlag() {
666
- this.crud.getTableHeight();
667
- },
668
- // 如果当前页面删除没数据了调用第一页
669
- "defaultPage.total"() {
670
- this.defaultPage.total === (this.defaultPage.currentPage - 1) * this.defaultPage.pageSize && this.defaultPage.total !== 0 && (this.defaultPage.currentPage = this.defaultPage.currentPage - 1, this.currentChange(this.defaultPage.currentPage));
671
- }
672
- },
673
- created() {
674
- this.crud.isMobile && (this.defaultPage.layout = "total, sizes, prev, pager, next"), this.pageInit(), this.crud.$emit("on-load", this.defaultPage);
675
- },
676
- methods: {
677
- optVal: m,
678
- pageInit() {
679
- this.defaultPage = Object.assign(this.defaultPage, this.crud.page), this.updateValue();
680
- },
681
- updateValue() {
682
- this.crud.$emit("update:page", this.defaultPage);
683
- },
684
- // 下一页事件
685
- nextClick(t) {
686
- this.crud.$emit("next-click", t);
687
- },
688
- // 上一页事件
689
- prevClick(t) {
690
- this.crud.$emit("prev-click", t);
691
- },
692
- // 页大小回调
693
- sizeChange(t) {
694
- this.defaultPage.currentPage = 1, this.defaultPage.pageSize = t, this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("size-change", t);
695
- },
696
- // 页码回调
697
- currentChange(t) {
698
- this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("current-change", t);
699
- }
700
- }
701
- };
702
- var Re = function() {
703
- var e = this, i = e._self._c;
704
- return e.pageFlag && e.optVal(e.crud.tableOption.page, !0) ? i(T, { staticClass: "avue-pagination", attrs: { shadow: e.crud.isCard } }, [e._t("page"), i(ne, { staticStyle: { "margin-top": "25px" }, attrs: { small: e.crud.size === "mini", disabled: e.defaultPage.disabled, "hide-on-single-page": e.defaultPage.single, "pager-count": e.defaultPage.pagerCount, "current-page": e.defaultPage.currentPage, background: e.defaultPage.background, "page-size": e.defaultPage.pageSize, "page-sizes": e.defaultPage.pageSizes, layout: e.defaultPage.layout, total: e.defaultPage.total }, on: { "update:currentPage": function(n) {
705
- return e.$set(e.defaultPage, "currentPage", n);
706
- }, "update:current-page": function(n) {
707
- return e.$set(e.defaultPage, "currentPage", n);
708
- }, "size-change": e.sizeChange, "prev-click": e.prevClick, "next-click": e.nextClick, "current-change": e.currentChange } })], 2) : e._e();
709
- }, Ae = [], He = /* @__PURE__ */ g(
710
- Ve,
711
- Re,
712
- Ae,
713
- !1,
714
- null,
715
- null
716
- );
717
- const H = He.exports, Ne = {
718
- name: "ColumnMenu",
719
- directives: {
720
- permission: B
721
- },
722
- inject: ["crud"],
723
- data() {
724
- return {
725
- config: h
726
- };
727
- },
728
- computed: {
729
- menuType() {
730
- return this.crud.tableOption.menuType || this.$AVUE.menuType || "button";
731
- },
732
- isIconMenu() {
733
- return this.menuType === "icon";
734
- },
735
- isTextMenu() {
736
- return this.menuType === "text";
737
- },
738
- isMenu() {
739
- return this.menuType === "menu";
740
- }
741
- },
742
- methods: {
743
- optVal: m,
744
- menuText(t) {
745
- return ["text", "menu"].includes(this.menuType) ? "text" : t;
746
- }
747
- }
748
- };
749
- var je = function() {
750
- var e = this, i = e._self._c;
751
- return e.optVal(e.crud.tableOption.menu, e.config.menu) && e.crud.getPermission("menu") ? i(_, { key: "menu", staticClass: "avue-crud__btn", attrs: { prop: "menu", fixed: e.optVal(e.crud.tableOption.menuFixed, e.config.menuFixed), label: e.crud.tableOption.menuTitle || "操作", align: e.crud.tableOption.menuAlign || e.config.menuAlign, "header-align": e.crud.tableOption.menuHeaderAlign || e.config.menuHeaderAlign, width: e.crud.isMobile ? e.crud.tableOption.menuXsWidth || e.config.menuXsWidth : e.crud.tableOption.menuWidth || e.config.menuWidth }, scopedSlots: e._u([{ key: "default", fn: function({ row: n, $index: r }) {
752
- return [e.isMenu ? i(se, { attrs: { size: e.crud.isMediumSize }, scopedSlots: e._u([{ key: "dropdown", fn: function() {
753
- return [i(re, [e.optVal(e.crud.tableOption.viewBtn, e.config.viewBtn) ? i(x, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("viewBtn", n, r), expression: "crud.getPermission('viewBtn', row, $index)" }], attrs: { icon: e.crud.getBtnIcon("viewBtn") }, nativeOn: { click: function(s) {
754
- return e.crud.rowView(n, r);
755
- } } }, [e._v(" " + e._s(e.crud.menuIcon("viewBtn")) + " ")]) : e._e(), e.optVal(e.crud.tableOption.editBtn, e.config.editBtn) ? i(x, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("editBtn", n, r), expression: "crud.getPermission('editBtn', row, $index)" }], attrs: { icon: e.crud.getBtnIcon("editBtn") }, nativeOn: { click: function(s) {
756
- return e.crud.rowEdit(n, r);
757
- } } }, [e._v(" " + e._s(e.crud.menuIcon("editBtn")) + " ")]) : e._e(), e.optVal(e.crud.tableOption.copyBtn, e.config.copyBtn) ? i(x, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("copyBtn", n, r), expression: "crud.getPermission('copyBtn', row, $index)" }], attrs: { icon: e.crud.getBtnIcon("copyBtn") }, nativeOn: { click: function(s) {
758
- return e.crud.rowCopy(n);
759
- } } }, [e._v(" " + e._s(e.crud.menuIcon("copyBtn")) + " ")]) : e._e(), e.optVal(e.crud.tableOption.delBtn, e.config.delBtn) ? i(x, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("delBtn", n, r), expression: "crud.getPermission('delBtn', row, $index)" }], attrs: { icon: e.crud.getBtnIcon("delBtn") }, nativeOn: { click: function(s) {
760
- return e.crud.rowDel(n, r);
761
- } } }, [e._v(" " + e._s(e.crud.menuIcon("delBtn")) + " ")]) : e._e(), e._t("menuBtn", null, { row: n, type: e.menuText("primary"), disabled: e.crud.btnDisabled, size: e.crud.isMediumSize, index: r })], 2)];
762
- }, proxy: !0 }], null, !0) }, [i(l, { attrs: { type: "text", size: e.crud.isMediumSize } }, [e._v(" " + e._s(e.crud.tableOption.menuBtnTitle || "按钮") + " "), i("i", { staticClass: "el-icon-arrow-down el-icon--right" })])], 1) : ["button", "text", "icon"].includes(e.menuType) ? [e.optVal(e.crud.tableOption.cellBtn, e.config.cellBtn) ? [e.optVal(e.crud.tableOption.editBtn, e.config.editBtn) && !n.$cellEdit ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("editBtn", n, r), expression: "crud.getPermission('editBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("editBtn"), size: e.crud.isMediumSize, disabled: e.crud.btnDisabledList[r] }, on: { click: function(s) {
763
- return s.stopPropagation(), e.crud.rowCell(n, r);
764
- } } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("editBtn")) + " ")]], 2) : e.optVal(e.crud.tableOption.saveBtn, e.config.saveBtn) && n.$cellEdit ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("saveBtn", n, r), expression: "crud.getPermission('saveBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("saveBtn"), size: e.crud.isMediumSize, disabled: e.crud.btnDisabledList[r] }, on: { click: function(s) {
765
- return s.stopPropagation(), e.crud.rowCell(n, r);
766
- } } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("saveBtn")) + " ")]], 2) : e._e(), n.$cellEdit ? i(l, { attrs: { type: e.menuText("danger"), icon: e.crud.getBtnIcon("cancelBtn"), size: e.crud.isMediumSize, disabled: e.crud.btnDisabledList[r] }, on: { click: function(s) {
767
- return s.stopPropagation(), e.crud.rowCancel(n, r);
768
- } } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("cancelBtn")) + " ")]], 2) : e._e()] : e._e(), e.optVal(e.crud.tableOption.viewBtn, e.config.viewBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("viewBtn", n, r), expression: "crud.getPermission('viewBtn', row, $index)" }], attrs: { type: e.menuText("success"), icon: e.crud.getBtnIcon("viewBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
769
- return s.stopPropagation(), e.crud.rowView(n, r);
770
- } } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("viewBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.editBtn, e.config.editBtn) && !e.crud.tableOption.cellBtn ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("editBtn", n, r), expression: "crud.getPermission('editBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("editBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
771
- return s.stopPropagation(), e.crud.rowEdit(n, r);
772
- } } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("editBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.copyBtn, e.config.copyBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("copyBtn", n, r), expression: "crud.getPermission('copyBtn', row, $index)" }], attrs: { type: e.menuText("primary"), icon: e.crud.getBtnIcon("copyBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
773
- return s.stopPropagation(), e.crud.rowCopy(n);
774
- } } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("copyBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.delBtn, e.config.delBtn) && !n.$cellEdit ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("delBtn", n, r), expression: "crud.getPermission('delBtn', row, $index)" }], attrs: { type: e.menuText("danger"), icon: e.crud.getBtnIcon("delBtn"), size: e.crud.isMediumSize, disabled: e.btnDisabled }, on: { click: function(s) {
775
- return s.stopPropagation(), e.crud.rowDel(n, r);
776
- } } }, [e.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("delBtn")) + " ")]], 2) : e._e()] : e._e(), e._t("menu", null, { row: n, type: e.menuText("primary"), disabled: e.crud.btnDisabled, size: e.crud.isMediumSize, index: r })];
777
- } }], null, !0) }) : e._e();
778
- }, We = [], Ke = /* @__PURE__ */ g(
779
- Ne,
780
- je,
781
- We,
782
- !1,
783
- null,
784
- null
785
- );
786
- const N = Ke.exports, Ue = {
787
- name: "ColumnDefault",
788
- inject: ["crud"],
789
- data() {
790
- return {
791
- config: h
792
- };
793
- },
794
- mounted() {
795
- this.setSort();
796
- },
797
- methods: {
798
- optVal: m,
799
- indexMethod(t) {
800
- return t + 1 + ((this.crud.page.currentPage || 1) - 1) * (this.crud.page.pageSize || 10);
801
- },
802
- setSort() {
803
- this.rowDrop(), this.columnDrop();
804
- },
805
- rowDrop() {
806
- const t = this.crud.$refs.table.$el.querySelectorAll(this.config.dropRowClass)[0];
807
- this.crud.tableDrop("row", t, (e) => {
808
- const i = e.oldIndex, n = e.newIndex, r = this.crud.list.splice(i, 1)[0];
809
- this.crud.list.splice(n, 0, r), this.crud.$emit("sortable-change", i, n), this.crud.refreshTable(() => this.rowDrop());
810
- });
811
- },
812
- columnDrop() {
813
- const t = this.crud.$refs.table.$el.querySelector(this.config.dropColClass);
814
- let e = 0;
815
- ["selection", "index", "expand"].forEach((i) => {
816
- this.crud.tableOption[i] && (e += 1);
817
- }), this.crud.tableDrop("column", t, (i) => {
818
- this.crud.headerSort(i.oldIndex - e, i.newIndex - e), this.columnDrop();
819
- });
820
- }
821
- }
822
- };
823
- var Ge = function() {
824
- var e = this, i = e._self._c;
825
- return i("div", [i(_, { attrs: { width: "1px" } }), e.crud.tableOption.expand ? i(_, { key: "expand", attrs: { type: "expand", width: e.crud.tableOption.expandWidth || e.config.expandWidth, fixed: e.optVal(e.crud.tableOption.expandFixed, e.config.expandFixed), align: "center" }, scopedSlots: e._u([{ key: "default", fn: function({ row: n }) {
826
- return [e._t("expand", null, { row: n, index: n.$index })];
827
- } }], null, !0) }) : e._e(), e.crud.tableOption.selection ? i(_, { key: "selection", attrs: { fixed: e.optVal(e.crud.tableOption.selectionFixed, e.config.selectionFixed), type: "selection", selectable: e.crud.tableOption.selectable, "reserve-selection": e.optVal(e.crud.tableOption.reserveSelection), width: e.crud.tableOption.selectionWidth || e.config.selectionWidth, align: "center" } }) : e._e(), e.optVal(e.crud.tableOption.index) ? i(_, { key: "index", attrs: { fixed: e.optVal(e.crud.tableOption.indexFixed, e.config.indexFixed), label: e.crud.tableOption.indexLabel || e.config.indexLabel, type: "index", width: e.crud.tableOption.indexWidth || e.config.indexWidth, index: e.indexMethod, align: "center" } }) : e._e()], 1);
828
- }, qe = [], Xe = /* @__PURE__ */ g(
829
- Ue,
830
- Ge,
831
- qe,
832
- !1,
833
- null,
834
- null
835
- );
836
- const j = Xe.exports, w = {}, Je = {
837
- name: "ColumnSlot",
838
- components: { IconTemp: E, FormTemp: z },
839
- inject: ["dynamic", "crud"],
840
- props: {
841
- column: Object,
842
- columnOption: Array
843
- },
844
- created() {
845
- const t = ["getColumnProp", "handleFilterMethod", "handleFilters"];
846
- Object.keys(this.dynamic).forEach((e) => {
847
- t.includes(e) && (this[e] = this.dynamic[e]);
848
- });
849
- },
850
- methods: {
851
- isBlank: u,
852
- optVal: m,
853
- uploadFun: P,
854
- isMediaType(t, e) {
855
- return Y(t, e);
856
- },
857
- vaildLabel(t, e, i) {
858
- if (t.rules && e.$cellEdit)
859
- return i;
860
- },
861
- columnChange(t, e, i) {
862
- const n = `${i}-${e.prop}`;
863
- w[n] || (this.handleChange(e, t), typeof e.change == "function" && e.cell === !0 && e.change({ row: t, column: e, index: i, value: t[e.prop] })), w[n] = !0, this.$nextTick(() => {
864
- w[n] = !1;
865
- });
866
- },
867
- handleChange(t, e) {
868
- t.cascader && this.$nextTick(() => {
869
- const i = t.cascader;
870
- i.forEach((n) => {
871
- const r = n, s = e[t.prop], o = e.$index, a = this.findObject(this.columnOption, r);
872
- u(a) || (u(this.crud.cascaderDIC[o]) && this.$set(this.crud.cascaderDIC, o, {}), this.crud.cascaderIndexList.includes(o) && i.forEach((f) => {
873
- this.$set(this.crud.cascaderDIC[o], f.prop, []), i.forEach((d) => e[d] = "");
874
- }), !(u(i) || u(s) || u(a)) && ue({
875
- column: a,
876
- value: s,
877
- form: e
878
- }).then((f) => {
879
- const d = f || [];
880
- this.crud.cascaderIndexList.includes(o) || this.crud.cascaderIndexList.push(o), this.crud.cascaderDicList[o] || this.$set(this.crud.cascaderDicList, o, {}), this.crud.cascaderDicList[o][r] || this.$set(this.crud.cascaderDicList[o], r, d), this.$set(this.crud.cascaderDIC[o], r, d), !u(d[a.cascaderIndex]) && !u(d) && !u(a.cascaderIndex) && (e[r] = d[a.cascaderIndex][(a.props || {}).value || b.value]);
881
- }));
882
- });
883
- });
884
- },
885
- handleDetail(t, e) {
886
- const i = e.parentProp ? (this.crud.cascaderDIC[t.$index] || {})[e.prop] : this.crud.DIC[e.prop], n = D(t, e, this.crud.tableOption, i);
887
- return !u(i) && this.crud.tableOption.filterDic !== !0 && (t[`$${e.prop}`] = n), n;
888
- },
889
- corArray(t, e) {
890
- let i = this.handleDetail(t, e);
891
- return Array.isArray(i) || (i = u(i) ? [] : i.split(Q)), c(i);
892
- },
893
- openImg(t, e, i) {
894
- let n = this.getImgList(t, e);
895
- n = n.map((r) => ({ thumbUrl: r, url: r, type: e.fileType })), this.$ImagePreview(n, i);
896
- },
897
- getImgList(t, e) {
898
- var s, o;
899
- const i = ((s = e.propsHttp) == null ? void 0 : s.home) || "", n = ((o = e.props) == null ? void 0 : o.value) || b.value, r = this.corArray(t, e);
900
- return r.forEach((a, f) => {
901
- r[f] = i + (a[n] ? a[n] : a);
902
- }), r;
903
- }
904
- }
905
- };
906
- var Qe = function() {
907
- var e = this, i = e._self._c;
908
- return e.getColumnProp(e.column, "hide") ? i(_, { key: e.column.prop, attrs: { prop: e.column.prop, label: e.column.label, "column-key": e.column.prop, "filter-placement": "bottom-end", filters: e.getColumnProp(e.column, "filters"), "filter-method": e.getColumnProp(e.column, "filterMethod") ? e.handleFilterMethod : void 0, "filter-multiple": e.optVal(e.column.filterMultiple, !0), "show-overflow-tooltip": e.column.overHidden, "min-width": e.column.minWidth, sortable: e.getColumnProp(e.column, "sortable"), "sort-method": e.column.sortMethod, "sort-orders": e.column.sortOrders, "sort-by": e.column.sortBy, resizable: e.column.resizable, "render-header": e.column.renderHeader, align: e.column.align || e.crud.tableOption.align, "header-align": e.column.headerAlign || e.crud.tableOption.headerAlign, width: e.getColumnProp(e.column, "width"), fixed: e.getColumnProp(e.column, "fixed") }, scopedSlots: e._u([{ key: "header", fn: function({ $index: n }) {
909
- return [e.crud.getSlotName(e.column, "H", e.crud.$scopedSlots) ? e._t(e.crud.getSlotName(e.column, "H"), null, null, { column: e.column, $index: n }) : i("span", [e._v(e._s(e.column.label))])];
910
- } }, { key: "default", fn: function({ row: n, $index: r }) {
911
- return [n.$cellEdit && e.column.cell ? i(ce, { attrs: { prop: e.crud.isTree ? "" : `list.${r}.${e.column.prop}`, label: e.vaildLabel(e.column, n, " "), "label-width": e.vaildLabel(e.column, n, "1px"), rules: e.column.rules } }, [i(ae, { attrs: { content: (e.crud.listError[`list.${r}.${e.column.prop}`] || {}).msg, disabled: !(e.crud.listError[`list.${r}.${e.column.prop}`] || {}).valid, placement: "top" } }, [e.crud.getSlotName(e.column, "F", e.crud.$scopedSlots) ? e._t(e.crud.getSlotName(e.column, "F"), null, null, {
912
- row: n,
913
- dic: e.crud.DIC[e.column.prop],
914
- size: e.crud.isMediumSize,
915
- index: r,
916
- disabled: e.crud.btnDisabledList[r],
917
- label: e.handleDetail(n, e.column),
918
- $cell: n.$cellEdit
919
- }) : i(z, e._b({ attrs: { column: e.column, size: e.crud.isMediumSize, "table-data": { index: r, row: n, label: e.handleDetail(n, e.column) }, dic: (e.crud.cascaderDIC[r] || {})[e.column.prop] || e.crud.DIC[e.column.prop], props: e.column.props || e.crud.tableOption.props, readonly: e.column.readonly, disabled: e.crud.disabled || e.crud.tableOption.disabled || e.column.disabled || e.crud.btnDisabledList[r], clearable: e.optVal(e.column.clearable, !1), "column-slot": e.crud.mainSlot }, on: { change: function(s) {
920
- return e.columnChange(n, e.column, r);
921
- } }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(s) {
922
- return { key: s, fn: function(o) {
923
- return [e._t(s, null, null, o)];
924
- } };
925
- })], null, !0), model: { value: n[e.column.prop], callback: function(s) {
926
- e.$set(n, e.column.prop, s);
927
- }, expression: "row[column.prop]" } }, "FormTemp", e.uploadFun(e.column, e.crud), !1))], 2)], 1) : e.crud.$scopedSlots[e.column.prop] ? e._t(e.column.prop, null, { row: n, index: r, dic: e.crud.DIC[e.column.prop], size: e.crud.isMediumSize, label: e.handleDetail(n, e.column) }) : [["img", "upload"].includes(e.column.type) ? i("span", { staticClass: "avue-crud__img" }, [e._l(e.getImgList(n, e.column), function(s, o) {
928
- return [e.isMediaType(s, e.column.fileType) ? i(e.isMediaType(s, e.column.fileType), { key: o, tag: "Component", attrs: { src: s }, on: { click: function(a) {
929
- return a.stopPropagation(), e.openImg(n, e.column, o);
930
- } } }) : i("i", { key: o, staticClass: "el-icon-document", attrs: { src: s }, on: { click: function(a) {
931
- return a.stopPropagation(), e.openImg(n, e.column, o);
932
- } } })];
933
- })], 2) : e.column.type === "url" ? i("span", e._l(e.corArray(n, e.column), function(s, o) {
934
- return i(le, { key: o, attrs: { type: "primary", href: s, target: e.column.target || "_blank" } }, [e._v(e._s(s))]);
935
- }), 1) : e.column.type === "rate" ? i("span", [i(oe, { attrs: { disabled: "" }, model: { value: n[e.column.prop], callback: function(s) {
936
- e.$set(n, e.column.prop, s);
937
- }, expression: "row[column.prop]" } })], 1) : e.column.type === "color" ? i("i", { staticClass: "avue-crud__color", style: { backgroundColor: n[e.column.prop] } }) : e.column.type === "icon" ? i(E, { attrs: { text: n[e.column.prop] } }) : e.column.html ? i("span", { domProps: { innerHTML: e._s(e.handleDetail(n, e.column)) } }) : i("span", { domProps: { textContent: e._s(e.handleDetail(n, e.column)) } })]];
938
- } }], null, !0) }) : e._e();
939
- }, Ye = [], Ze = /* @__PURE__ */ g(
940
- Je,
941
- Qe,
942
- Ye,
943
- !1,
944
- null,
945
- null
946
- );
947
- const $ = Ze.exports, et = {
948
- name: "ColumnDynamic",
949
- components: { ColumnSlot: $ },
950
- inject: ["dynamic", "crud"],
951
- props: {
952
- columnOption: Object
953
- },
954
- created() {
955
- const t = ["getColumnProp", "handleFilterMethod", "handleFilters"];
956
- Object.keys(this.dynamic).forEach((e) => {
957
- t.includes(e) && (this[e] = this.dynamic[e]);
958
- });
959
- },
960
- methods: {
961
- optVal: m
962
- }
963
- };
964
- var tt = function() {
965
- var e = this, i = e._self._c;
966
- return e.getColumnProp(e.columnOption, "hide") ? i(_, { key: e.columnOption.prop, attrs: { prop: e.columnOption.prop, label: e.columnOption.label, "filter-placement": "bottom-end", filters: e.getColumnProp(e.columnOption, "filters"), "filter-method": e.getColumnProp(e.columnOption, "filterMethod") ? e.handleFilterMethod : void 0, "filter-multiple": e.optVal(e.columnOption.filterMultiple, !0), "show-overflow-tooltip": e.columnOption.overHidden, "min-width": e.columnOption.minWidth, sortable: e.getColumnProp(e.columnOption, "sortable"), "render-header": e.columnOption.renderHeader, align: e.columnOption.align || e.crud.tableOption.align, "header-align": e.columnOption.headerAlign || e.crud.tableOption.headerAlign, width: e.getColumnProp(e.columnOption, "width"), fixed: e.getColumnProp(e.columnOption, "fixed") } }, [e._l(e.columnOption.children, function(n) {
967
- return [n.children && n.children.length > 0 ? i("ColumnDynamic", { key: n.prop, attrs: { "column-option": n }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
968
- return { key: r, fn: function(s) {
969
- return [e._t(r, null, null, s)];
970
- } };
971
- })], null, !0) }) : i($, { key: n.prop, attrs: { column: n, "column-option": e.columnOption.children }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
972
- return { key: r, fn: function(s) {
973
- return [e._t(r, null, null, s)];
974
- } };
975
- })], null, !0) })];
976
- })], 2) : e._e();
977
- }, it = [], nt = /* @__PURE__ */ g(
978
- et,
979
- tt,
980
- it,
981
- !1,
982
- null,
983
- null
984
- );
985
- const W = nt.exports, rt = {
986
- name: "Column",
987
- components: { ColumnDynamic: W, ColumnSlot: $ },
988
- inject: ["crud"],
989
- provide() {
990
- return {
991
- crud: this.crud,
992
- dynamic: this
993
- };
994
- },
995
- props: {
996
- columnOption: Array
997
- },
998
- computed: {
999
- list() {
1000
- let t = [...this.columnOption];
1001
- return t = Z(t, "index", (e, i) => {
1002
- var n, r;
1003
- return ((n = this.crud.objectOption[e.prop]) == null ? void 0 : n.index) - ((r = this.crud.objectOption[i.prop]) == null ? void 0 : r.index);
1004
- }), t;
1005
- }
1006
- },
1007
- methods: {
1008
- // 表格筛选逻辑
1009
- handleFilterMethod(t, e, i) {
1010
- const n = this.columnOption.filter((r) => r.prop === i.property)[0];
1011
- return typeof n.filterMethod == "function" ? n.filterMethod(t, e, n) : e[n.prop] === t;
1012
- },
1013
- // 表格筛选字典
1014
- handleFilters(t, e) {
1015
- if (e !== !0) return;
1016
- const i = this.crud.DIC[t.prop] || [], n = [];
1017
- return u(i) ? this.crud.cellForm.list.forEach((r) => {
1018
- n.map((s) => s.text).includes(r[t.prop]) || n.push({
1019
- text: r[t.prop],
1020
- value: r[t.prop]
1021
- });
1022
- }) : i.forEach((r) => {
1023
- const s = t.props || this.crud.tableOption.props || {};
1024
- n.push({
1025
- text: r[s.label || b.label],
1026
- value: r[s.value || b.value]
1027
- });
1028
- }), n;
1029
- },
1030
- getColumnProp(t, e) {
1031
- const i = this.crud.objectOption[t.prop] || {};
1032
- if (e === "filterMethod") return i == null ? void 0 : i.filters;
1033
- if (this.crud.isMobile && ["fixed"].includes(e)) return !1;
1034
- const n = i == null ? void 0 : i[e];
1035
- if (!(e === "width" && n === 0))
1036
- return e === "filters" ? this.handleFilters(t, n) : e === "hide" ? (i == null ? void 0 : i.hide) !== !0 : n;
1037
- }
1038
- }
1039
- };
1040
- var st = function() {
1041
- var e = this, i = e._self._c;
1042
- return i("div", [e._t("header"), e._l(e.list, function(n) {
1043
- return [n.children && n.children.length > 0 ? i(W, { key: n.pop, attrs: { "column-option": n }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
1044
- return { key: r, fn: function(s) {
1045
- return [e._t(r, null, null, s)];
1046
- } };
1047
- })], null, !0) }) : i($, { key: n.prop, attrs: { column: n, "column-option": e.columnOption }, scopedSlots: e._u([e._l(e.crud.mainSlot, function(r) {
1048
- return { key: r, fn: function(s) {
1049
- return [e._t(r, null, null, s)];
1050
- } };
1051
- })], null, !0) })];
1052
- }), e._t("footer")], 2);
1053
- }, ot = [], lt = /* @__PURE__ */ g(
1054
- rt,
1055
- st,
1056
- ot,
1057
- !1,
1058
- null,
1059
- null
1060
- );
1061
- const K = lt.exports, at = {
1062
- name: "HeaderMenu",
1063
- directives: {
1064
- permission: B
1065
- },
1066
- inject: ["crud"],
1067
- data() {
1068
- return {
1069
- dateCreate: !1,
1070
- pickerOptions: {
1071
- shortcuts: [
1072
- {
1073
- text: "今日",
1074
- onClick(t) {
1075
- const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
1076
- i.setTime(i.getTime()), t.$emit("pick", [i, e]);
1077
- }
1078
- },
1079
- {
1080
- text: "昨日",
1081
- onClick(t) {
1082
- const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
1083
- i.setTime(i.getTime() - 3600 * 1e3 * 24 * 1), t.$emit("pick", [i, e]);
1084
- }
1085
- },
1086
- {
1087
- text: "最近一周",
1088
- onClick(t) {
1089
- const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
1090
- i.setTime(i.getTime() - 3600 * 1e3 * 24 * 7), t.$emit("pick", [i, e]);
1091
- }
1092
- },
1093
- {
1094
- text: "最近一个月",
1095
- onClick(t) {
1096
- const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
1097
- i.setTime(i.getTime() - 3600 * 1e3 * 24 * 30), t.$emit("pick", [i, e]);
1098
- }
1099
- },
1100
- {
1101
- text: "最近三个月",
1102
- onClick(t) {
1103
- const e = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
1104
- i.setTime(i.getTime() - 3600 * 1e3 * 24 * 90), t.$emit("pick", [i, e]);
1105
- }
1106
- }
1107
- ]
1108
- },
1109
- config: h
1110
- };
1111
- },
1112
- created() {
1113
- this.initFun();
1114
- },
1115
- methods: {
1116
- optVal: m,
1117
- // 日期组件回调
1118
- dateChange(t) {
1119
- this.dateCreate ? this.crud.$emit("date-change", t) : this.dateCreate = !0;
1120
- },
1121
- initFun() {
1122
- this.crud.rowExcel = this.rowExcel, this.crud.rowPrint = this.rowPrint;
1123
- },
1124
- rowExcel() {
1125
- this.crud.$refs.dialogExcel.handleShow();
1126
- },
1127
- rowPrint() {
1128
- this.$Print(this.crud.$refs.table);
1129
- }
1130
- }
1131
- };
1132
- var ct = function() {
1133
- var e = this, i = e._self._c;
1134
- return i("div", { staticClass: "avue-crud__menu" }, [e.optVal(e.crud.tableOption.menuLeft, !0) ? i("div", { staticClass: "avue-crud__left" }, [e.optVal(e.crud.tableOption.addBtn, e.config.addBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("addBtn"), expression: "crud.getPermission('addBtn')" }], attrs: { type: "primary", icon: e.crud.getBtnIcon("addBtn"), size: e.crud.isMediumSize }, on: { click: e.crud.rowAdd } }, [e.crud.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("addBtn")) + " ")]], 2) : e._e(), e.optVal(e.crud.tableOption.addRowBtn, e.config.addRowBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("addRowBtn"), expression: "crud.getPermission('addRowBtn')" }], attrs: { type: "primary", icon: e.crud.getBtnIcon("addBtn"), size: e.crud.isMediumSize }, on: { click: e.crud.rowCellAdd } }, [e.crud.isIconMenu ? e._e() : [e._v(" " + e._s(e.crud.menuIcon("addBtn")) + " ")]], 2) : e._e(), e._t("menuLeft", null, { size: e.crud.isMediumSize })], 2) : e._e(), e.optVal(e.crud.tableOption.menuRight, !0) ? i("div", { staticClass: "avue-crud__right" }, [e.optVal(e.crud.tableOption.dateBtn, e.config.dateBtn) ? i(me, { staticStyle: { display: "inline-block", "margin-right": "20px" }, attrs: { type: "datetimerange", "value-format": "yyyy-MM-dd HH:mm:ss", format: "yyyy-MM-dd HH:mm:ss", "picker-options": e.pickerOptions, size: e.crud.isMediumSize }, on: { change: e.dateChange } }) : e._e(), e._t("menuRight", null, { size: e.crud.isMediumSize }), e.optVal(e.crud.tableOption.excelBtn, e.config.excelBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("excelBtn"), expression: "crud.getPermission('excelBtn')" }], attrs: { icon: e.crud.getBtnIcon("excelBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: e.rowExcel } }) : e._e(), e.optVal(e.crud.tableOption.printBtn, e.config.printBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("printBtn"), expression: "crud.getPermission('printBtn')" }], attrs: { icon: e.crud.getBtnIcon("printBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: e.rowPrint } }) : e._e(), e.optVal(e.crud.tableOption.refreshBtn, e.config.refreshBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("refreshBtn"), expression: "crud.getPermission('refreshBtn')" }], attrs: { icon: e.crud.getBtnIcon("refreshBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: e.crud.refreshChange } }) : e._e(), e.optVal(e.crud.tableOption.columnBtn, e.config.columnBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("columnBtn"), expression: "crud.getPermission('columnBtn')" }], attrs: { icon: e.crud.getBtnIcon("columnBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: function(n) {
1135
- return e.crud.$refs.dialogColumn.handleShow();
1136
- } } }) : e._e(), (e.crud.$refs.headerSearch || {}).searchFlag && e.optVal(e.crud.tableOption.searchShowBtn, !0) ? i(l, { attrs: { icon: e.crud.getBtnIcon("searchBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: function(n) {
1137
- return e.crud.$refs.headerSearch.handleSearchShow();
1138
- } } }) : e._e(), e.optVal(e.crud.tableOption.filterBtn, e.config.filterBtn) ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.crud.getPermission("filterBtn"), expression: "crud.getPermission('filterBtn')" }], attrs: { icon: e.crud.getBtnIcon("filterBtn"), circle: "", size: e.crud.isMediumSize }, on: { click: function(n) {
1139
- return e.crud.$refs.dialogFilter.handleShow();
1140
- } } }) : e._e()], 2) : e._e()]);
1141
- }, ut = [], dt = /* @__PURE__ */ g(
1142
- at,
1143
- ct,
1144
- ut,
1145
- !1,
1146
- null,
1147
- null
1148
- );
1149
- const U = dt.exports, pt = {
1150
- name: "HeaderSearch",
1151
- mixins: [fe],
1152
- inject: ["crud"],
1153
- props: {
1154
- search: Object
1155
- },
1156
- data() {
1157
- return {
1158
- show: !1,
1159
- searchIndex: 2,
1160
- searchShow: !0
1161
- };
1162
- },
1163
- computed: {
1164
- searchForm: {
1165
- get() {
1166
- return this.crud.search;
1167
- },
1168
- set(t) {
1169
- this.crud.$emit("update:search", t);
1170
- }
1171
- },
1172
- option() {
1173
- const t = this.crud.option, e = (n = []) => {
1174
- n = c(n);
1175
- const r = [];
1176
- let s = 0;
1177
- return n = n.sort((o, a) => (a.searchOrder || 0) - (o.searchOrder || 0)), n.forEach((o) => {
1178
- if (o.search) {
1179
- const a = s < this.searchIndex, f = {};
1180
- Object.keys(o).forEach((d) => {
1181
- const v = "search";
1182
- if (d !== "searchProp" && d.includes(v)) {
1183
- let p = d.replace(v, "");
1184
- if (p.length === 0) return;
1185
- p = p.replace(p[0], p[0].toLowerCase()), f[p] = o[d];
1186
- }
1187
- }), o = Object.assign(o, f, {
1188
- type: ge(o),
1189
- detail: !1,
1190
- dicFlag: o.cascader ? !0 : m(o.dicFlag, !1),
1191
- span: o.searchSpan || t.searchSpan || h.searchSpan,
1192
- control: o.searchControl,
1193
- gutter: o.searchGutter || t.searchGutter || h.searchGutter,
1194
- labelWidth: o.searchLabelWidth || t.searchLabelWidth || h.searchLabelWidth,
1195
- labelPosition: o.searchLabelPosition || t.searchLabelPosition,
1196
- size: o.searchSize || t.searchSize,
1197
- value: o.searchValue,
1198
- rules: o.searchRules,
1199
- row: o.searchRow,
1200
- bind: o.searchBin,
1201
- disabled: o.searchDisabled,
1202
- readonly: o.searchReadonly,
1203
- display: this.isSearchIcon ? this.show ? !0 : a : !0
1204
- }), r.push(o), s = s + 1;
1205
- }
1206
- }), r;
1207
- };
1208
- return ((n) => {
1209
- let r = c(n);
1210
- return r.column = e(this.crud.propOption), r = Object.assign(r, {
1211
- rowKey: t.searchRowKey || "null",
1212
- tabs: !1,
1213
- group: !1,
1214
- printBtn: !1,
1215
- mockBtn: !1,
1216
- filterDic: t.searchFilterDic,
1217
- filterNull: t.searchFilterNull,
1218
- filterParam: t.searchFilterParam,
1219
- enter: t.searchEnter,
1220
- size: t.searchSize,
1221
- submitText: t.searchBtnText || "搜 索",
1222
- submitBtn: m(t.searchBtn, h.searchSubBtn),
1223
- submitIcon: this.crud.getBtnIcon("searchBtn"),
1224
- emptyText: t.emptyBtnText || "清 空",
1225
- emptyBtn: m(t.emptyBtn, h.emptyBtn),
1226
- emptyIcon: this.crud.getBtnIcon("emptyBtn"),
1227
- menuSpan: this.show || !this.isSearchIcon || t.searchMenuSpan < 6 ? t.searchMenuSpan : 6,
1228
- menuPosition: t.searchMenuPosition || "center",
1229
- dicFlag: !1,
1230
- dicData: this.crud.DIC
1231
- }), r;
1232
- })(t);
1233
- },
1234
- isSearchIcon() {
1235
- return m(this.crud.option.searchIcon, this.$AVUE.searchIcon) && this.searchLen > this.searchIndex;
1236
- },
1237
- searchLen() {
1238
- let t = 0;
1239
- return this.crud.propOption.forEach((e) => {
1240
- e.search && t++;
1241
- }), t;
1242
- },
1243
- searchFlag() {
1244
- return !!this.crud.$scopedSlots.search || this.searchLen !== 0;
1245
- }
1246
- },
1247
- watch: {
1248
- "crud.propOption": {
1249
- handler() {
1250
- this.dataFormat();
1251
- },
1252
- deep: !0
1253
- },
1254
- show() {
1255
- this.crud.getTableHeight();
1256
- },
1257
- searchShow() {
1258
- this.crud.getTableHeight();
1259
- },
1260
- option: {
1261
- immediate: !0,
1262
- deep: !0,
1263
- handler() {
1264
- var t;
1265
- this.searchIndex = ((t = this.option) == null ? void 0 : t.searchIndex) || 2;
1266
- }
1267
- }
1268
- },
1269
- created() {
1270
- this.initFun(), this.dataFormat();
1271
- },
1272
- methods: {
1273
- initFun() {
1274
- ["searchReset", "searchChange"].forEach((t) => {
1275
- this.crud[t] = this[t];
1276
- });
1277
- },
1278
- getSlotName(t) {
1279
- return t.replace("Search", "");
1280
- },
1281
- // 搜索回调
1282
- searchChange(t, e) {
1283
- t = S(t), this.crud.propOption.forEach((i) => {
1284
- i.searchProp && (t[i.searchProp] = t[i.prop], delete t[i.prop]);
1285
- }), this.crud.$emit("search-change", t, e);
1286
- },
1287
- // 搜索清空
1288
- resetChange() {
1289
- this.crud.$emit("search-reset", this.searchForm);
1290
- },
1291
- // 搜索清空
1292
- searchReset() {
1293
- this.$refs.form.resetForm();
1294
- },
1295
- handleSearchShow() {
1296
- this.searchShow = !this.searchShow;
1297
- },
1298
- dataFormat() {
1299
- const t = this.crud.option;
1300
- this.searchShow = m(t.searchShow, h.searchShow);
1301
- }
1302
- }
1303
- };
1304
- var ht = function() {
1305
- var e = this, i = e._self._c;
1306
- return e.searchFlag ? i(T, { directives: [{ name: "show", rawName: "v-show", value: e.searchShow && e.searchFlag, expression: "searchShow && searchFlag" }], staticClass: "avue-crud__search", attrs: { shadow: e.crud.isCard } }, [e._t("search", null, { row: e.searchForm, search: e.searchForm, size: e.crud.controlSize }), i(O, { ref: "form", attrs: { option: e.option }, on: { submit: e.searchChange, "reset-change": e.resetChange }, scopedSlots: e._u([{ key: "menuForm", fn: function(n) {
1307
- return [e._t(
1308
- "searchMenu",
1309
- null,
1310
- null,
1311
- Object.assign(n, {
1312
- search: e.searchForm,
1313
- row: e.searchForm
1314
- })
1315
- ), e.isSearchIcon ? [e.show === !1 ? i(l, { attrs: { type: "text", icon: "el-icon-arrow-down" }, on: { click: function(r) {
1316
- e.show = !0;
1317
- } } }, [e._v(" 展 开 ")]) : e._e(), e.show === !0 ? i(l, { attrs: { type: "text", icon: "el-icon-arrow-up" }, on: { click: function(r) {
1318
- e.show = !1;
1319
- } } }, [e._v(" 收 缩 ")]) : e._e()] : e._e()];
1320
- } }, e._l(e.crud.searchSlot, function(n) {
1321
- return { key: e.getSlotName(n), fn: function(r) {
1322
- return [e._t(
1323
- n,
1324
- null,
1325
- null,
1326
- Object.assign(r, {
1327
- search: e.searchForm,
1328
- row: e.searchForm
1329
- })
1330
- )];
1331
- } };
1332
- })], null, !0), model: { value: e.searchForm, callback: function(n) {
1333
- e.searchForm = n;
1334
- }, expression: "searchForm" } })], 2) : e._e();
1335
- }, mt = [], ft = /* @__PURE__ */ g(
1336
- pt,
1337
- ht,
1338
- mt,
1339
- !1,
1340
- null,
1341
- null
1342
- );
1343
- const G = ft.exports, gt = {
1344
- name: "FyCurd",
1345
- components: {
1346
- DialogFilter: L,
1347
- DialogExcel: V,
1348
- DialogColumn: R,
1349
- FyDialogForm: A,
1350
- TablePage: H,
1351
- ColumnMenu: N,
1352
- ColumnDefault: j,
1353
- Column: K,
1354
- HeaderMenu: U,
1355
- HeaderSearch: G
1356
- },
1357
- directives: {
1358
- permission: B
1359
- },
1360
- mixins: [xe],
1361
- provide() {
1362
- return {
1363
- crud: this
1364
- };
1365
- },
1366
- props: {
1367
- spanMethod: Function,
1368
- summaryMethod: Function,
1369
- rowStyle: Function,
1370
- cellStyle: Function,
1371
- beforeClose: Function,
1372
- beforeOpen: Function,
1373
- rowClassName: Function,
1374
- cellClassName: Function,
1375
- headerCellClassName: Function,
1376
- uploadBefore: Function,
1377
- uploadAfter: Function,
1378
- uploadDelete: Function,
1379
- uploadPreview: Function,
1380
- uploadError: Function,
1381
- uploadExceed: Function,
1382
- permission: {
1383
- type: [Function, Object],
1384
- default: () => ({})
1385
- },
1386
- value: {
1387
- type: Object,
1388
- default: () => ({})
1389
- },
1390
- search: {
1391
- type: Object,
1392
- default() {
1393
- return {};
1394
- }
1395
- },
1396
- page: {
1397
- type: Object,
1398
- default() {
1399
- return {};
1400
- }
1401
- },
1402
- tableLoading: {
1403
- type: Boolean,
1404
- default: !1
1405
- },
1406
- disabled: {
1407
- type: Boolean,
1408
- default: !1
1409
- },
1410
- data: {
1411
- type: Array,
1412
- default: () => []
1413
- }
1414
- },
1415
- data() {
1416
- return {
1417
- reload: Math.random(),
1418
- cellForm: {
1419
- list: []
1420
- },
1421
- config: h,
1422
- list: [],
1423
- listError: {},
1424
- tableForm: {},
1425
- tableHeight: void 0,
1426
- tableIndex: -1,
1427
- tableSelect: [],
1428
- sumsList: {},
1429
- cascaderIndexList: [],
1430
- cascaderDicList: {},
1431
- cascaderFormList: {},
1432
- btnDisabledList: {},
1433
- btnDisabled: !1,
1434
- default: {}
1435
- };
1436
- },
1437
- computed: {
1438
- isHeightAuto() {
1439
- return this.tableOption.height === "auto";
1440
- },
1441
- isSortable() {
1442
- return this.tableOption.sortable;
1443
- },
1444
- isRowSort() {
1445
- return this.tableOption.rowSort;
1446
- },
1447
- isColumnSort() {
1448
- return this.tableOption.columnSort;
1449
- },
1450
- rowParentKey() {
1451
- return this.option.rowParentKey || b.rowParentKey;
1452
- },
1453
- childrenKey() {
1454
- return this.treeProps.children || b.children;
1455
- },
1456
- hasChildrenKey() {
1457
- return this.treeProps.hasChildren || b.hasChildren;
1458
- },
1459
- treeProps() {
1460
- return this.tableOption.treeProps || {};
1461
- },
1462
- isAutoHeight() {
1463
- return this.tableOption.height === "auto";
1464
- },
1465
- formSlot() {
1466
- return this.getSlotList(["Error", "Label", "Type", "Form"], this.$scopedSlots, this.propOption);
1467
- },
1468
- searchSlot() {
1469
- return this.getSlotList(["Search"], this.$scopedSlots, this.propOption);
1470
- },
1471
- mainSlot() {
1472
- const t = [];
1473
- return this.propOption.forEach((e) => {
1474
- this.$scopedSlots[e.prop] && t.push(e.prop);
1475
- }), this.getSlotList(["Header", "Form"], this.$scopedSlots, this.propOption).concat(t);
1476
- },
1477
- calcHeight() {
1478
- return (this.tableOption.calcHeight || 0) + this.$AVUE.calcHeight;
1479
- },
1480
- propOption() {
1481
- let t = [];
1482
- function e(i = []) {
1483
- Array.isArray(i) && i.forEach((n) => {
1484
- Array.isArray(n.children) ? e(n.children) : t.push(n);
1485
- });
1486
- }
1487
- return e(this.columnOption), t = ve(t), t;
1488
- },
1489
- isShowSummary() {
1490
- return this.option.showSummary;
1491
- },
1492
- isHeader() {
1493
- let t = !1;
1494
- return this.columnOption.forEach((e) => {
1495
- e.children && (t = !0);
1496
- }), t;
1497
- },
1498
- isTree() {
1499
- let t = !1;
1500
- return this.data.forEach((e) => {
1501
- e.children && (t = !0);
1502
- }), t;
1503
- },
1504
- isCard() {
1505
- return this.option.card ? "always" : "never";
1506
- },
1507
- expandLevel() {
1508
- return this.parentOption.expandLevel || 0;
1509
- },
1510
- expandAll() {
1511
- return this.parentOption.expandAll || !1;
1512
- },
1513
- parentOption() {
1514
- return this.tableOption || {};
1515
- },
1516
- columnOption() {
1517
- return this.tableOption.column || [];
1518
- },
1519
- sumColumnList() {
1520
- return this.tableOption.sumColumnList || [];
1521
- },
1522
- selectLen() {
1523
- return this.tableSelect ? this.tableSelect.length : 0;
1524
- }
1525
- },
1526
- watch: {
1527
- value: {
1528
- handler() {
1529
- this.tableForm = this.value;
1530
- },
1531
- immediate: !0,
1532
- deep: !0
1533
- },
1534
- list: {
1535
- handler() {
1536
- this.cellForm.list = this.list;
1537
- },
1538
- deep: !0
1539
- },
1540
- data: {
1541
- handler() {
1542
- this.dataInit();
1543
- },
1544
- deep: !0
1545
- }
1546
- },
1547
- mounted() {
1548
- this.dataInit(), this.getTableHeight(), this.refreshTable();
1549
- },
1550
- methods: {
1551
- setPx: ee,
1552
- optVal: m,
1553
- handleValidate(t, e, i) {
1554
- this.listError[t] || this.$set(this.listError, t, { valid: !1, msg: "" }), this.listError[t].valid = !e, this.listError[t].msg = i;
1555
- },
1556
- getPermission(t, e, i) {
1557
- return typeof this.permission == "function" ? this.permission(t, e, i) : u(this.permission[t]) ? !0 : this.permission[t];
1558
- },
1559
- getTableHeight() {
1560
- this.isAutoHeight ? this.$nextTick(() => {
1561
- const t = this.$refs.table, e = this.$refs.tablePage;
1562
- if (!t) return;
1563
- const i = t.$el, n = e.$el.offsetHeight || 20;
1564
- this.tableHeight = document.documentElement.clientHeight - i.offsetTop - n - this.calcHeight;
1565
- }) : this.tableHeight = this.tableOption.height;
1566
- },
1567
- doLayout() {
1568
- this.$refs.table.doLayout();
1569
- },
1570
- refreshTable(t) {
1571
- this.reload = Math.random(), this.$nextTick(() => {
1572
- t == null || t();
1573
- });
1574
- },
1575
- // 树懒加载
1576
- treeLoad(t, e, i) {
1577
- this.$emit("tree-load", t, e, (n) => {
1578
- t.children = n, i(n);
1579
- });
1580
- },
1581
- menuIcon(t) {
1582
- return m(this.tableOption[`${t}Text`], be(`crud.${t}`));
1583
- },
1584
- getBtnIcon(t) {
1585
- const e = `${t}Icon`;
1586
- return this.tableOption[e] || h[e];
1587
- },
1588
- // 对部分表单字段进行校验的方法
1589
- validateField(t) {
1590
- return this.$refs.dialogForm.$refs.tableForm.validateField(t);
1591
- },
1592
- selectClear() {
1593
- this.$emit("selection-clear", c(this.tableSelect)), this.$refs.table.clearSelection();
1594
- },
1595
- toggleRowSelection(t, e) {
1596
- this.$refs.table.toggleRowSelection(t, e);
1597
- },
1598
- toggleRowExpansion(t, e) {
1599
- this.$refs.table.toggleRowExpansion(t, e);
1600
- },
1601
- setCurrentRow(t) {
1602
- this.$refs.table.setCurrentRow(t);
1603
- },
1604
- dataInit() {
1605
- this.list = this.data, this.list.forEach((t, e) => {
1606
- t.$cellEdit && !this.cascaderFormList[e] && (this.cascaderFormList[e] = c(t)), this.$set(t, "$cellEdit", t.$cellEdit || !1), this.$set(t, "$index", e);
1607
- });
1608
- },
1609
- // 拖动表头事件
1610
- headerDragend(t, e, i, n) {
1611
- this.objectOption[i.property] && this.$set(this.objectOption[i.property], "width", t), this.$emit("header-dragend", t, e, i, n);
1612
- },
1613
- headerSort(t, e) {
1614
- const i = this.columnOption, n = i.splice(t, 1)[0];
1615
- i.splice(e, 0, n), this.refreshTable();
1616
- },
1617
- // 清除过滤器执行函数
1618
- clearFilter(t) {
1619
- this.$refs.table.clearFilter(t);
1620
- },
1621
- // 展开或则关闭
1622
- expandChange(t, e) {
1623
- this.$emit("expand-change", t, e);
1624
- },
1625
- // 设置单选
1626
- currentRowChange(t, e) {
1627
- this.$emit("current-row-change", t, e);
1628
- },
1629
- // 刷新事件
1630
- refreshChange() {
1631
- this.$emit("refresh-change");
1632
- },
1633
- // 选中实例
1634
- toggleSelection(t) {
1635
- t ? t.forEach((e) => {
1636
- this.$refs.table.toggleRowSelection(e);
1637
- }) : this.$refs.table.clearSelection();
1638
- },
1639
- // 选择回调
1640
- selectionChange(t) {
1641
- this.tableSelect = t, this.$emit("selection-change", this.tableSelect);
1642
- },
1643
- // 单个选择回调
1644
- select(t, e) {
1645
- this.$emit("select", t, e);
1646
- },
1647
- // 点击勾选全选 Checkbox
1648
- selectAll(t) {
1649
- this.$emit("select-all", t);
1650
- },
1651
- // 筛选回调用
1652
- filterChange(t) {
1653
- this.$emit("filter-change", t);
1654
- },
1655
- // 排序回调
1656
- sortChange(t) {
1657
- this.$emit("sort-change", t);
1658
- },
1659
- // 行双击
1660
- rowDblclick(t, e) {
1661
- this.$emit("row-dblclick", t, e);
1662
- },
1663
- // 行单机
1664
- rowClick(t, e, i) {
1665
- this.$emit("row-click", t, e, i);
1666
- },
1667
- // 清空排序
1668
- clearSort() {
1669
- this.$refs.table.clearSort();
1670
- },
1671
- // 当单元格 hover 进入时会触发该事件
1672
- cellMouseEnter(t, e, i, n) {
1673
- this.$emit("cell-mouse-enter", t, e, i, n);
1674
- },
1675
- // 当单元格 hover 退出时会触发该事件
1676
- cellMouseLeave(t, e, i, n) {
1677
- this.$emit("cell-mouse-leave", t, e, i, n);
1678
- },
1679
- // 当某个单元格被点击时会触发该事件
1680
- cellClick(t, e, i, n) {
1681
- this.$emit("cell-click", t, e, i, n);
1682
- },
1683
- // 当某一列的表头被点击时会触发该事件
1684
- headerClick(t, e) {
1685
- this.$emit("header-click", t, e);
1686
- },
1687
- // 当某一行被鼠标右键点击时会触发该事件
1688
- rowContextmenu(t, e, i) {
1689
- this.$emit("row-contextmenu", t, e, i);
1690
- },
1691
- // 当某一列的表头被鼠标右键点击时触发该事件
1692
- headerContextmenu(t, e) {
1693
- this.$emit("header-contextmenu", t, e);
1694
- },
1695
- // 当某个单元格被双击击时会触发该事件
1696
- cellDblclick(t, e, i, n) {
1697
- this.$emit("cell-dblclick", t, e, i, n);
1698
- },
1699
- // 单元格新增
1700
- rowCellAdd(t = {}) {
1701
- const e = this.list.length, i = _e(this.propOption).tableForm;
1702
- t = c({
1703
- $cellEdit: !0,
1704
- $index: e,
1705
- ...i,
1706
- ...t
1707
- }), this.list.push(t);
1708
- },
1709
- // 行取消
1710
- rowCancel(t, e) {
1711
- u(t[this.rowKey]) ? (this.list.splice(e, 1), delete this.cascaderDIC[e]) : (this.cascaderFormList[e].$cellEdit = !1, this.$set(this.cascaderDIC, e, this.cascaderDicList[e]), this.$set(this.list, e, this.cascaderFormList[e])), delete this.cascaderDicList[e], delete this.cascaderFormList[e], this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(e), 1);
1712
- },
1713
- // 行编辑点击
1714
- rowCell(t, e) {
1715
- t.$cellEdit ? this.rowCellUpdate(t, e) : this.rowCellEdit(t, e);
1716
- },
1717
- rowCellUpdate(t, e) {
1718
- t = c(t);
1719
- const i = this.validateCellField(e), n = () => {
1720
- this.btnDisabledList[e] = !1, this.btnDisabled = !1, this.list[e].$cellEdit = !1, this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(e), 1), delete this.cascaderFormList[e];
1721
- }, r = () => {
1722
- this.btnDisabledList[e] = !1, this.btnDisabled = !1;
1723
- };
1724
- i && (this.btnDisabledList[e] = !0, this.btnDisabled = !0, u(t[this.rowKey]) ? this.$emit("row-save", t, n, r) : this.$emit("row-update", t, e, n, r));
1725
- },
1726
- // 单元格编辑
1727
- rowCellEdit(t, e) {
1728
- t.$cellEdit = !0, this.cascaderFormList[e] = c(t), this.cascaderDicList[e] = c(this.cascaderDIC[e]);
1729
- },
1730
- // 对部分表单字段进行校验
1731
- validateCellForm() {
1732
- return new Promise((t) => {
1733
- this.$refs.cellForm.validate((e, i) => {
1734
- t(i);
1735
- });
1736
- });
1737
- },
1738
- validateCellField(t) {
1739
- let e = !0;
1740
- for (const i of this.$refs.cellForm.fields)
1741
- if (i.prop.split(".")[1] === `${t}` && this.$refs.cellForm.validateField(i.prop, (n) => {
1742
- n && (e = !1);
1743
- }), !e) break;
1744
- return e;
1745
- },
1746
- rowAdd() {
1747
- this.$refs.dialogForm.show("add");
1748
- },
1749
- rowSave() {
1750
- return this.$refs.dialogForm.$refs.tableForm.submit();
1751
- },
1752
- rowUpdate() {
1753
- return this.$refs.dialogForm.$refs.tableForm.submit();
1754
- },
1755
- closeDialog() {
1756
- return this.$refs.dialogForm.closeDialog();
1757
- },
1758
- getPropRef(t) {
1759
- return this.$refs.dialogForm.$refs.tableForm.getPropRef(t);
1760
- },
1761
- setVal() {
1762
- this.$emit("input", this.tableForm), this.$emit("change", this.tableForm);
1763
- },
1764
- // 编辑
1765
- rowEdit(t, e) {
1766
- this.tableForm = c(t), this.tableIndex = e, this.setVal(), this.$refs.dialogForm.show("edit");
1767
- },
1768
- // 复制
1769
- rowCopy(t) {
1770
- this.tableForm = c(t), delete this.tableForm[this.rowKey], this.tableIndex = -1, this.setVal(), this.$refs.dialogForm.show("add");
1771
- },
1772
- // 查看
1773
- rowView(t, e) {
1774
- this.tableForm = c(t), this.tableIndex = e, this.setVal(), this.$refs.dialogForm.show("view");
1775
- },
1776
- // 删除
1777
- rowDel(t, e) {
1778
- this.$emit("row-del", t, e, () => {
1779
- const { parentList: i, index: n } = this.findData(t[this.rowKey]);
1780
- i && i.splice(n, 1);
1781
- });
1782
- },
1783
- // 合并行
1784
- tableSpanMethod(t) {
1785
- if (typeof this.spanMethod == "function") return this.spanMethod(t);
1786
- },
1787
- // 合集统计逻辑
1788
- tableSummaryMethod(t) {
1789
- const e = {};
1790
- if (typeof this.summaryMethod == "function")
1791
- return this.summaryMethod(t);
1792
- const { columns: i, data: n } = t, r = [];
1793
- return i.length > 0 && i.forEach((s, o) => {
1794
- const a = this.sumColumnList.find((f) => f.name === s.property);
1795
- if (a) {
1796
- const f = a.decimals || 2, d = a.label || "";
1797
- let v = 1;
1798
- switch (a.type) {
1799
- case "count":
1800
- r[o] = d + n.length;
1801
- break;
1802
- case "avg":
1803
- r[o] = n.map((p) => Number(p[s.property])).reduce((p, y) => {
1804
- const C = Number(y);
1805
- return isNaN(C) ? p : (p * (v - 1) + y) / v++;
1806
- }, 0), r[o] = d + r[o].toFixed(f);
1807
- break;
1808
- case "sum":
1809
- r[o] = n.map((p) => Number(p[s.property])).reduce((p, y) => {
1810
- const C = Number(y);
1811
- return isNaN(C) ? p : p + y;
1812
- }, 0), r[o] = d + r[o].toFixed(f);
1813
- break;
1814
- }
1815
- e[s.property] = r[o];
1816
- } else
1817
- r[o] = "";
1818
- }), this.sumsList = e, r;
1819
- },
1820
- tableDrop(t, e, i) {
1821
- if (this.isSortable !== !0) {
1822
- if (t === "row" && !this.isRowSort)
1823
- return;
1824
- if (t === "column" && !this.isColumnSort)
1825
- return;
1826
- }
1827
- if (!window.Sortable) {
1828
- ye.logs("Sortable");
1829
- return;
1830
- }
1831
- window.Sortable.create(e, {
1832
- ghostClass: h.ghostClass,
1833
- chosenClass: h.ghostClass,
1834
- animation: 500,
1835
- delay: 0,
1836
- onEnd: (n) => i(n)
1837
- });
1838
- },
1839
- findData(t) {
1840
- let e = {};
1841
- const i = (n, r) => {
1842
- n.forEach((s, o) => {
1843
- s[this.rowKey] === t && (e = {
1844
- item: s,
1845
- index: o,
1846
- parentList: n,
1847
- parent: r
1848
- }), s[this.childrenKey] && i(s[this.childrenKey], s);
1849
- });
1850
- };
1851
- return i(this.list), e;
1852
- }
1853
- }
1854
- };
1855
- var _t = function() {
1856
- var e = this, i = e._self._c;
1857
- return i("div", { staticClass: "avue-crud avue-crud--card" }, [e.tableOption.title ? i(e.tableOption.titleSize || "h2", { tag: "Component", style: e.tableOption.titleStyle }, [e._v(" " + e._s(e.tableOption.title) + " ")]) : e._e(), i(G, { ref: "headerSearch", scopedSlots: e._u([{ key: "search", fn: function(n) {
1858
- return [e._t("search", null, null, n)];
1859
- } }, { key: "searchMenu", fn: function(n) {
1860
- return [e._t("searchMenu", null, null, n)];
1861
- } }, e._l(e.searchSlot, function(n) {
1862
- return { key: n, fn: function(r) {
1863
- return [e._t(n, null, null, r)];
1864
- } };
1865
- })], null, !0) }), e.optVal(e.tableOption.header, !0) ? i(U, { ref: "headerMenu", scopedSlots: e._u([{ key: "menuLeft", fn: function(n) {
1866
- return [e._t("menuLeft", null, null, n)];
1867
- } }, { key: "menuRight", fn: function(n) {
1868
- return [e._t("menuRight", null, null, n)];
1869
- } }], null, !0) }) : e._e(), e.optVal(e.tableOption.tip, e.config.tip) && e.tableOption.selection ? i(he, { staticClass: "avue-crud__tip" }, [i("span", { staticClass: "avue-crud__tip-name" }, [e._v(" 当前表格已选择 "), i("span", { staticClass: "avue-crud__tip-count" }, [e._v(e._s(e.selectLen))]), e._v(" 项 ")]), e.optVal(e.tableOption.selectClearBtn, e.config.selectClearBtn) && e.tableOption.selection ? i(l, { directives: [{ name: "permission", rawName: "v-permission", value: e.getPermission("selectClearBtn"), expression: "getPermission('selectClearBtn')" }], attrs: { type: "text", size: "small" }, on: { click: e.selectClear } }, [e._v(" 清 空 ")]) : e._e(), e._t("tip")], 2) : e._e(), e._t("header"), i(pe, { ref: "cellForm", attrs: { model: e.cellForm, "show-message": !1 }, on: { validate: e.handleValidate } }, [i(M, { directives: [{ name: "loading", rawName: "v-loading", value: e.tableLoading, expression: "tableLoading" }], key: e.reload, ref: "table", class: { "avue-crud--indeterminate": e.optVal(e.tableOption.indeterminate, !1) }, attrs: { data: e.cellForm.list, "row-key": e.rowKey, size: e.$AVUE.tableSize || e.controlSize, lazy: e.optVal(e.tableOption.lazy, !1), load: e.treeLoad, "tree-props": e.treeProps, "expand-row-keys": e.tableOption.expandRowKeys, "default-expand-all": e.tableOption.defaultExpandAll, "highlight-current-row": e.tableOption.highlightCurrentRow, "show-summary": e.tableOption.showSummary, "summary-method": e.tableSummaryMethod, "span-method": e.tableSpanMethod, stripe: e.tableOption.stripe, "show-header": e.tableOption.showHeader, "default-sort": e.tableOption.defaultSort, "row-class-name": e.rowClassName, "cell-class-name": e.cellClassName, "row-style": e.rowStyle, "cell-style": e.cellStyle, fit: e.tableOption.fit, "header-cell-class-name": e.headerCellClassName, "max-height": e.isAutoHeight ? e.tableHeight : e.tableOption.maxHeight, height: e.tableHeight, width: e.setPx(e.tableOption.width, e.config.width), border: e.tableOption.border }, on: { "current-change": e.currentRowChange, "expand-change": e.expandChange, "header-dragend": e.headerDragend, "row-click": e.rowClick, "row-dblclick": e.rowDblclick, "cell-mouse-enter": e.cellMouseEnter, "cell-mouse-leave": e.cellMouseLeave, "cell-click": e.cellClick, "header-click": e.headerClick, "row-contextmenu": e.rowContextmenu, "header-contextmenu": e.headerContextmenu, "cell-dblclick": e.cellDblclick, "filter-change": e.filterChange, "selection-change": e.selectionChange, select: e.select, "select-all": e.selectAll, "sort-change": e.sortChange }, scopedSlots: e._u([{ key: "empty", fn: function() {
1870
- return [e.$slots.empty ? e._t("empty") : i(de, { staticClass: "avue-crud__empty", attrs: { "image-size": 100, description: e.tableOption.emptyText } })];
1871
- }, proxy: !0 }], null, !0) }, [i(K, { attrs: { "column-option": e.columnOption }, scopedSlots: e._u([{ key: "header", fn: function() {
1872
- return [i(j, { ref: "columnDefault", scopedSlots: e._u([{ key: "expand", fn: function({ row: n, index: r }) {
1873
- return [e._t("expand", null, { row: n, index: r })];
1874
- } }], null, !0) })];
1875
- }, proxy: !0 }, e._l(e.mainSlot, function(n) {
1876
- return { key: n, fn: function(r) {
1877
- return [e._t(n, null, null, r)];
1878
- } };
1879
- }), { key: "footer", fn: function() {
1880
- return [i(N, { scopedSlots: e._u([{ key: "menu", fn: function(n) {
1881
- return [e._t("menu", null, null, n)];
1882
- } }, { key: "menuBtn", fn: function(n) {
1883
- return [e._t("menuBtn", null, null, n)];
1884
- } }], null, !0) })];
1885
- }, proxy: !0 }], null, !0) })], 1)], 1), e._t("footer"), i(H, { ref: "tablePage" }), i(A, { ref: "dialogForm", scopedSlots: e._u([e._l(e.formSlot, function(n) {
1886
- return { key: n, fn: function(r) {
1887
- return [e._t(n, null, null, r)];
1888
- } };
1889
- }), { key: "menuForm", fn: function(n) {
1890
- return [e._t("menuForm", null, null, n)];
1891
- } }], null, !0) }), i(R, { ref: "dialogColumn" }), i(V, { ref: "dialogExcel" }), i(L, { ref: "dialogFilter" })], 2);
1892
- }, bt = [], vt = /* @__PURE__ */ g(
1893
- gt,
1894
- _t,
1895
- bt,
1896
- !1,
1897
- null,
1898
- null
1899
- );
1900
- const ii = vt.exports;
1901
- export {
1902
- ii as default
1903
- };
1
+ import { t as e } from "../chunks/FyCurd.DMj1dMK9.mjs";
2
+ export { e as default };