@web-utils/component 4.0.16 → 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 (314) hide show
  1. package/address-input/index.mjs +76 -74
  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 -69
  8. package/carousel/index.mjs +45 -32
  9. package/chat/index.mjs +441 -266
  10. package/chunk-file-uploader/index.mjs +2 -103
  11. package/chunks/ChunkFileUploader.C3EA0e5t.mjs +114 -0
  12. package/chunks/EditableTree.C_IJBL5b.mjs +648 -0
  13. package/chunks/ElementBaseInfo.DyuFR6fE.mjs +209 -0
  14. package/chunks/ElementDialog.C0IjriTW.mjs +681 -0
  15. package/chunks/ElementForm.ButuYDPA.mjs +627 -0
  16. package/chunks/ElementListeners.Dg3e_dmp.mjs +656 -0
  17. package/chunks/ElementMultiInstance.Dmi79FqA.mjs +290 -0
  18. package/chunks/ElementOtherConfig.C2AddGTp.mjs +51 -0
  19. package/chunks/ElementProperties.CfV8UF7L.mjs +196 -0
  20. package/chunks/ElementTaskConfig.Bn7ycGGn.mjs +446 -0
  21. package/chunks/FlowCondition.C6PdqOAW.mjs +194 -0
  22. package/chunks/FlowDesigner.uJYFfKpR.mjs +5101 -0
  23. package/chunks/FormBlock.BEENc22F.mjs +117 -0
  24. package/chunks/FormCascader.CaM-oEhv.mjs +1226 -0
  25. package/chunks/FormInputTime.Bg3UIP8H.mjs +1773 -0
  26. package/chunks/FormItem.H9OOvNzT.mjs +90 -0
  27. package/chunks/FormItemGroup.D9eRy-cZ.mjs +147 -0
  28. package/chunks/FormSelect.CanodoAI.mjs +1472 -0
  29. package/chunks/FormSwitch.DTqdaFjv.mjs +296 -0
  30. package/chunks/FormTemp.DiI5EfgK.mjs +139 -0
  31. package/chunks/FyCurd.DMj1dMK9.mjs +2622 -0
  32. package/chunks/FyForm.vgR8ujEF.mjs +904 -0
  33. package/chunks/FyFormDesign.DEWT6LsX.mjs +5600 -0
  34. package/chunks/FyUEditor.D_rEYfll.mjs +221 -0
  35. package/chunks/FyUpload.B2QKfTxF.mjs +504 -0
  36. package/chunks/Keyboard.ItiRy7Gb.mjs +379 -0
  37. package/chunks/MonacoEditor.Bd5Kui-Y.mjs +301 -0
  38. package/chunks/PageableTable.Bujb0NUx.mjs +658 -0
  39. package/chunks/RecordVideo.B35_dLty.mjs +116 -0
  40. package/chunks/SignalAndMessage.CYVzlFuL.mjs +198 -0
  41. package/chunks/SplitPane.Dw96M0Yf.mjs +219 -0
  42. package/chunks/TableColumn.DJYkznbJ.mjs +180 -0
  43. package/chunks/TableView.DyIdIxAg.mjs +484 -0
  44. package/chunks/Toolbar.DHuXJAoG.mjs +219 -0
  45. package/chunks/UserTaskListeners.Bp-2qkHs.mjs +599 -0
  46. package/chunks/VueCron.GfjodnyM.mjs +1766 -0
  47. package/chunks/VueTreeSelect.9Ywl-I8e.mjs +1872 -0
  48. package/chunks/_plugin-vue_export-helper.7vrlOII_.mjs +8 -0
  49. package/chunks/checkbox.emIuFmnt.mjs +437 -0
  50. package/chunks/confirmable-mixin.BBil7dto.mjs +1646 -0
  51. package/chunks/core.DJv6Qrae.mjs +51 -0
  52. package/chunks/dataformat.Bfr4nOcA.mjs +144 -0
  53. package/chunks/dic.DgDfnovD.mjs +116 -0
  54. package/chunks/dictionary.5eKjWeAp.mjs +19 -0
  55. package/chunks/dictionary.DxZxP0ej.mjs +87 -0
  56. package/chunks/event.B4iwtUNO.mjs +4 -0
  57. package/chunks/event.eJ-c1Z3a.mjs +224 -0
  58. package/chunks/focus-trap.DT4GnqQI.mjs +211 -0
  59. package/chunks/form-input.D25eDRMq.mjs +34 -0
  60. package/chunks/form-item.CgmUuw_n.mjs +714 -0
  61. package/chunks/form-pick.Axem0gOO.mjs +7 -0
  62. package/chunks/form-validate.B1KPCHqN.mjs +11 -0
  63. package/chunks/icon.CbS8-322.mjs +259 -0
  64. package/chunks/init.DwpukyOB.mjs +115 -0
  65. package/chunks/input.PejnqwSH.mjs +547 -0
  66. package/chunks/install.yLcn5MLL.mjs +84 -0
  67. package/chunks/message.BCmee5N0.mjs +400 -0
  68. package/chunks/overlay.DubSnqma.mjs +122 -0
  69. package/chunks/packages.BGjydzjm.mjs +56 -0
  70. package/chunks/permission.DgEVNWlh.mjs +16 -0
  71. package/chunks/photo-swipe.BB0SJZg9.mjs +55 -0
  72. package/chunks/radio.BotKXqJr.mjs +274 -0
  73. package/chunks/scroll.CzORc5Zk.mjs +28 -0
  74. package/chunks/scrollbar.CAmrlKi9.mjs +345 -0
  75. package/chunks/slot.C6Ozd2e7.mjs +25 -0
  76. package/chunks/style.BmlGmjpO.mjs +325 -0
  77. package/chunks/sub-table-plus-props.B_lLth3j.mjs +28 -0
  78. package/chunks/tab-mixin.u0EZpx3j.mjs +70 -0
  79. package/chunks/tag.DPi-PLbb.mjs +141 -0
  80. package/chunks/teleport._VGEzK4d.mjs +22 -0
  81. package/chunks/tooltip.D50x7Rva.mjs +1926 -0
  82. package/chunks/typescript.DiWBU4nj.mjs +4 -0
  83. package/chunks/use-aria.BW7nWOl1.mjs +17 -0
  84. package/chunks/use-composition.mUaomyno.mjs +47 -0
  85. package/chunks/use-deprecated.BfDSbZS9.mjs +12 -0
  86. package/chunks/use-empty-values.Dy_r78F6.mjs +263 -0
  87. package/chunks/use-form-item.wsRjehHp.mjs +47 -0
  88. package/chunks/use-global-config.C9hs-O_x.mjs +56 -0
  89. package/chunks/use-id.CFO5NeoV.mjs +15 -0
  90. package/chunks/use-size.DxrwTUwf.mjs +18 -0
  91. package/chunks/util.B3sjVZoZ.mjs +103 -0
  92. package/chunks/util.g-WQEec9.mjs +223 -0
  93. package/chunks/utilSelf.ZED4DmCU.mjs +46 -0
  94. package/chunks/utils.Cs2fYBrT.mjs +60 -0
  95. package/chunks/utils.DsGhtCIO.mjs +14 -0
  96. package/chunks/validator.C4-z_t9p.mjs +5 -0
  97. package/chunks/vnode.D_SioRnx.mjs +14 -0
  98. package/code-mirror-editor/index.mjs +89 -88
  99. package/comment/index.mjs +62 -57
  100. package/configComponents.mjs +40 -50
  101. package/confirm-button/index.mjs +34 -46
  102. package/confirmable/index.mjs +7 -17
  103. package/context-menu/index.mjs +195 -174
  104. package/count-up/index.mjs +97 -105
  105. package/custom-scrollbar/index.mjs +91 -98
  106. package/data-box/index.mjs +64 -44
  107. package/data-card/index.mjs +60 -47
  108. package/data-card-text/index.mjs +63 -49
  109. package/data-display/index.mjs +71 -51
  110. package/data-icons/index.mjs +70 -50
  111. package/data-imgtext/index.mjs +67 -43
  112. package/data-operatext/index.mjs +51 -40
  113. package/data-panel/index.mjs +57 -44
  114. package/data-pay/index.mjs +105 -48
  115. package/data-price/index.mjs +48 -40
  116. package/data-progress/index.mjs +67 -44
  117. package/data-rotate/index.mjs +61 -44
  118. package/data-table-picker/index.mjs +119 -71
  119. package/data-tabs/index.mjs +67 -44
  120. package/dialog-form/index.mjs +139 -87
  121. package/dynamic-table/index.mjs +166 -109
  122. package/e-charts/index.mjs +174 -200
  123. package/easy-popup/index.mjs +91 -102
  124. package/editable-progress/index.mjs +112 -83
  125. package/editable-tree/index.mjs +2 -481
  126. package/element-dialog/index.mjs +2 -306
  127. package/ellipsis/index.mjs +124 -148
  128. package/empty-view/index.mjs +48 -65
  129. package/error-view/index.mjs +39 -51
  130. package/flex-column/index.mjs +32 -51
  131. package/flex-item/index.mjs +54 -64
  132. package/flex-row/index.mjs +32 -39
  133. package/flex-scroller/index.mjs +29 -30
  134. package/flow/index.mjs +240 -247
  135. package/flow-designer/index.mjs +2 -4709
  136. package/flow-node/index.mjs +56 -64
  137. package/flow-viewer/index.mjs +159 -157
  138. package/form-block/index.mjs +2 -147
  139. package/form-button/index.mjs +35 -47
  140. package/form-card/index.mjs +14 -25
  141. package/form-cascader/index.mjs +2 -115
  142. package/form-checkbox/index.mjs +89 -70
  143. package/form-checkbox-group/index.mjs +161 -113
  144. package/form-date-picker/index.mjs +155 -142
  145. package/form-holder/index.mjs +137 -109
  146. package/form-input/index.mjs +113 -86
  147. package/form-input-cron-expression/index.mjs +97 -76
  148. package/form-input-email/index.mjs +64 -51
  149. package/form-input-id-card/index.mjs +72 -54
  150. package/form-input-phone-number/index.mjs +71 -56
  151. package/form-input-tag/index.mjs +88 -61
  152. package/form-input-time/index.mjs +2 -73
  153. package/form-item/index.mjs +2 -142
  154. package/form-item-config-provider/index.mjs +46 -60
  155. package/form-item-group/index.mjs +2 -157
  156. package/form-radio-group/index.mjs +161 -121
  157. package/form-select/index.mjs +2 -179
  158. package/form-switch/index.mjs +2 -54
  159. package/form-table/index.mjs +131 -84
  160. package/form-table-plus/index.mjs +164 -108
  161. package/form-textarea/index.mjs +90 -56
  162. package/form-tree-select/index.mjs +89 -71
  163. package/form-tree-select-multiple/index.mjs +92 -77
  164. package/form-view/index.mjs +275 -207
  165. package/fy-array/index.mjs +121 -70
  166. package/fy-article/index.mjs +73 -60
  167. package/fy-cascader/index.mjs +113 -90
  168. package/fy-checkbox/index.mjs +96 -64
  169. package/fy-code/index.mjs +48 -50
  170. package/fy-curd/index.mjs +2 -1879
  171. package/fy-date/index.mjs +76 -41
  172. package/fy-draggable/index.mjs +322 -317
  173. package/fy-dynamic/index.mjs +259 -224
  174. package/fy-empty/index.mjs +35 -36
  175. package/fy-form/index.mjs +2 -640
  176. package/fy-form-design/index.mjs +2 -2852
  177. package/fy-form-design/style.css +1 -1
  178. package/fy-from/crud/zh.d.ts +1 -1
  179. package/fy-input/index.mjs +117 -97
  180. package/fy-input-color/index.mjs +77 -54
  181. package/fy-input-icon/index.mjs +129 -82
  182. package/fy-input-map/index.mjs +242 -183
  183. package/fy-input-number/index.mjs +74 -49
  184. package/fy-input-table/index.mjs +160 -105
  185. package/fy-input-tree/index.mjs +259 -178
  186. package/fy-progress/index.mjs +36 -39
  187. package/fy-radio/index.mjs +53 -37
  188. package/fy-rate/index.mjs +86 -70
  189. package/fy-select/index.mjs +224 -137
  190. package/fy-slider/index.mjs +68 -43
  191. package/fy-switch/index.mjs +67 -41
  192. package/fy-tabs/index.mjs +46 -46
  193. package/fy-time/index.mjs +81 -53
  194. package/fy-title/index.mjs +18 -27
  195. package/fy-tree/index.mjs +382 -286
  196. package/fy-u-editor/index.mjs +2 -357
  197. package/fy-upload/index.mjs +2 -421
  198. package/guide-steps/index.mjs +72 -71
  199. package/helper-function.d.ts +2 -30
  200. package/helper-function.mjs +41 -67
  201. package/highlight-j-s/index.mjs +50 -59
  202. package/icon-card/index.mjs +34 -36
  203. package/icon-temp/index.mjs +27 -27
  204. package/iframe-window/index.mjs +39 -32
  205. package/image-cropper/index.mjs +171 -73
  206. package/image-preview/index.mjs +187 -116
  207. package/image-viewer/index.mjs +69 -66
  208. package/index.d.ts +3 -9
  209. package/index.mjs +174 -489
  210. package/input-number-range/index.mjs +78 -58
  211. package/j-s-x-component/index.mjs +13 -15
  212. package/keyboard/index.mjs +2 -369
  213. package/license/index.mjs +106 -115
  214. package/loading-view/index.mjs +39 -51
  215. package/login/index.mjs +252 -120
  216. package/monaco-editor/index.mjs +2 -7
  217. package/name-avatar/index.mjs +61 -53
  218. package/nav-bar/index.mjs +33 -30
  219. package/not-implement/index.mjs +10 -22
  220. package/notice/index.mjs +100 -93
  221. package/package.json +3 -3
  222. package/page/index.mjs +18 -25
  223. package/page-header/index.mjs +27 -33
  224. package/page-index/index.mjs +121 -99
  225. package/page-index-top/index.mjs +79 -74
  226. package/page-skeleton/index.mjs +47 -44
  227. package/page-skeleton-new/index.mjs +79 -49
  228. package/pageable-table/index.mjs +2 -512
  229. package/pageable-view/index.mjs +279 -274
  230. package/photo-swipe/index.d.ts +4 -0
  231. package/photo-swipe/index.mjs +33 -36
  232. package/picker-table-view/index.mjs +224 -117
  233. package/present-view/index.mjs +266 -196
  234. package/queue/index.mjs +45 -53
  235. package/record-video/index.mjs +2 -134
  236. package/resize-observer/index.mjs +43 -46
  237. package/search/index.mjs +116 -107
  238. package/sign/index.mjs +103 -110
  239. package/sign-panel/index.mjs +182 -141
  240. package/skeleton/index.mjs +51 -54
  241. package/skeleton-panel/index.mjs +33 -37
  242. package/split-pane/index.mjs +3 -196
  243. package/stateful/index.mjs +69 -73
  244. package/static-pageable-table/index.mjs +72 -64
  245. package/sub-table/index.mjs +508 -206
  246. package/sub-table-plus/index.mjs +592 -230
  247. package/swiper/index.mjs +128 -120
  248. package/tab/index.mjs +117 -119
  249. package/tab-item/index.mjs +48 -56
  250. package/table-column/index.mjs +2 -225
  251. package/table-view/index.mjs +3 -326
  252. package/tabs-view/index.mjs +109 -104
  253. package/tag-render/index.mjs +79 -67
  254. package/text-ellipsis/index.mjs +94 -77
  255. package/toolbar/index.mjs +2 -254
  256. package/toolbar-button/index.mjs +145 -120
  257. package/verify/index.mjs +58 -64
  258. package/vue-cron/index.mjs +2 -1180
  259. package/vue-qr-code/index.mjs +30 -54
  260. package/vue-quill-editor/index.mjs +123 -99
  261. package/vue-tags-input/index.mjs +348 -431
  262. package/vue-tree-select/index.mjs +2 -2627
  263. package/vue-video-player/index.mjs +135 -136
  264. package/watermark/index.mjs +46 -74
  265. package/web-types.json +197 -975
  266. package/x-input-tag/index.mjs +144 -106
  267. package/chunks/ElementBaseInfo.ZADwixb5.mjs +0 -125
  268. package/chunks/ElementForm.CQ3PN5qj.mjs +0 -223
  269. package/chunks/ElementListeners.De_PRuIm.mjs +0 -215
  270. package/chunks/ElementMultiInstance.DQo2wuAQ.mjs +0 -181
  271. package/chunks/ElementOtherConfig.B1NfMTYh.mjs +0 -60
  272. package/chunks/ElementProperties.CosfDrlW.mjs +0 -112
  273. package/chunks/ElementTaskConfig.Bko0kgTp.mjs +0 -317
  274. package/chunks/FlowCondition.Y6qEYi1T.mjs +0 -102
  275. package/chunks/FormTemp.BQxO5IQq.mjs +0 -123
  276. package/chunks/MonacoEditor.D31t4FTy.mjs +0 -327
  277. package/chunks/SignalAndMessage.Bb5PFX0N.mjs +0 -85
  278. package/chunks/UserTaskListeners.Bv3BDfEI.mjs +0 -169
  279. package/chunks/_plugin-vue2_normalizer.CeySl7Fu.mjs +0 -10
  280. package/chunks/confirmable-mixin.B2TtLAdk.mjs +0 -86
  281. package/chunks/core.0Exl13Mz.mjs +0 -54
  282. package/chunks/dataformat.CpqOeGBl.mjs +0 -154
  283. package/chunks/dic.Dkl-leRW.mjs +0 -128
  284. package/chunks/dictionary.DGt59Ir7.mjs +0 -68
  285. package/chunks/dictionary.DqiP9x2m.mjs +0 -25
  286. package/chunks/event.9aDS6jcw.mjs +0 -236
  287. package/chunks/form-input.CvFdwlEV.mjs +0 -31
  288. package/chunks/form-item.LWjePsPa.mjs +0 -233
  289. package/chunks/form-pick.BFTIVn_i.mjs +0 -11
  290. package/chunks/form-validate.CVarNHKX.mjs +0 -12
  291. package/chunks/helper.BiMLcEEk.mjs +0 -41
  292. package/chunks/index.9OxHjTIE.mjs +0 -16
  293. package/chunks/index.B2TRddqf.mjs +0 -184
  294. package/chunks/index.BmYCjxZQ.mjs +0 -47
  295. package/chunks/init.DAsXSoLW.mjs +0 -122
  296. package/chunks/packages.ByyangTp.mjs +0 -58
  297. package/chunks/permission.CO31YIkD.mjs +0 -16
  298. package/chunks/slot.DXIbhGat.mjs +0 -27
  299. package/chunks/sub-table-plus-props.BVsD71hT.mjs +0 -30
  300. package/chunks/tab-mixin.BNK6dxLN.mjs +0 -81
  301. package/chunks/util.DqFv_pWg.mjs +0 -241
  302. package/chunks/utilSelf.Csq1766E.mjs +0 -48
  303. package/chunks/utils.DRcxC1Fb.mjs +0 -60
  304. package/color-picker/index.mjs +0 -78
  305. package/egd-collapse/index.mjs +0 -62
  306. package/egd-collapse-item/index.mjs +0 -72
  307. package/form-input-number/index.mjs +0 -69
  308. package/form-input-number/style.css +0 -1
  309. package/input-number/index.mjs +0 -232
  310. package/input-number/style.css +0 -1
  311. package/keep-view-alive/index.mjs +0 -117
  312. package/search-popover/index.mjs +0 -118
  313. package/search-popover/style.css +0 -1
  314. /package/{base.css → utils/style.css} +0 -0
@@ -0,0 +1,2622 @@
1
+ import { t as e } from "./_plugin-vue_export-helper.7vrlOII_.mjs";
2
+ import { C as t, O as n, a as r, g as i, l as a, t as o, v as s, x as c } from "./util.g-WQEec9.mjs";
3
+ import { t as l } from "./slot.C6Ozd2e7.mjs";
4
+ import { c as u, o as d, r as f, t as p } from "./dataformat.Bfr4nOcA.mjs";
5
+ import { t as m } from "./packages.BGjydzjm.mjs";
6
+ import { t as h } from "./permission.DgEVNWlh.mjs";
7
+ import { i as g } from "./dic.DgDfnovD.mjs";
8
+ import { t as _ } from "./init.DwpukyOB.mjs";
9
+ import { n as v, t as y } from "./FormTemp.DiI5EfgK.mjs";
10
+ import b from "../icon-temp/index.mjs";
11
+ import { Fragment as x, createBlock as S, createCommentVNode as C, createElementBlock as w, createElementVNode as T, createSlots as E, createTextVNode as D, createVNode as O, guardReactiveProps as k, mergeProps as A, normalizeClass as j, normalizeProps as M, normalizeStyle as N, openBlock as P, renderList as F, renderSlot as I, resolveComponent as L, resolveDirective as R, resolveDynamicComponent as z, toDisplayString as B, vShow as ee, withCtx as V, withDirectives as H, withModifiers as U } from "vue";
12
+ import { isBlank as W } from "@web-utils/core";
13
+ //#region src/components/fy-from/crud/config.ts
14
+ var G = {
15
+ menuWidth: 220,
16
+ menuFixed: "right",
17
+ menuXsWidth: 100,
18
+ menuAlign: "center",
19
+ menuHeaderAlign: "center",
20
+ headerAlign: "left",
21
+ cancelBtnIcon: "el-icon-circle-close",
22
+ viewBtnIcon: "el-icon-view",
23
+ editBtnIcon: "el-icon-edit",
24
+ copyBtnIcon: "el-icon-document-add",
25
+ addBtnIcon: "el-icon-plus",
26
+ printBtnIcon: "el-icon-printer",
27
+ excelBtnIcon: "el-icon-download",
28
+ delBtnIcon: "el-icon-delete",
29
+ searchBtnIcon: "el-icon-search",
30
+ emptyBtnIcon: "el-icon-delete",
31
+ saveBtnIcon: "el-icon-circle-plus-outline",
32
+ updateBtnIcon: "el-icon-circle-check",
33
+ columnBtnIcon: "el-icon-s-operation",
34
+ filterBtnIcon: "el-icon-tickets",
35
+ refreshBtnIcon: "el-icon-refresh",
36
+ viewBtn: !1,
37
+ editBtn: !0,
38
+ copyBtn: !1,
39
+ cancelBtn: !0,
40
+ addBtn: !0,
41
+ addRowBtn: !1,
42
+ printBtn: !1,
43
+ excelBtn: !1,
44
+ delBtn: !0,
45
+ cellBtn: !1,
46
+ dateBtn: !1,
47
+ updateBtn: !0,
48
+ saveBtn: !0,
49
+ refreshBtn: !0,
50
+ columnBtn: !0,
51
+ filterBtn: !1,
52
+ queryBtn: !0,
53
+ menuBtn: !1,
54
+ searchBtn: !0,
55
+ clearBtn: !0,
56
+ selectClearBtn: !0,
57
+ searchShow: !0,
58
+ tip: !0,
59
+ dialogWidth: "60%",
60
+ dialogDrag: !1,
61
+ formFullscreen: !1,
62
+ pageBackground: !0,
63
+ page: !0,
64
+ menu: !0,
65
+ indexLabel: "#",
66
+ indexWidth: 50,
67
+ indexFixed: "left",
68
+ selectionWidth: 50,
69
+ selectionFixed: "left",
70
+ expandWidth: 60,
71
+ expandFixed: "left",
72
+ filterMultiple: !0,
73
+ calcHeight: 300,
74
+ width: "100%",
75
+ searchGutter: 20,
76
+ searchLabelWidth: 80,
77
+ searchSpan: 6,
78
+ dropRowClass: ".el-table__body-wrapper > table > tbody",
79
+ dropColClass: ".el-table__header-wrapper tr",
80
+ ghostClass: "avue-crud__ghost"
81
+ }, te = {
82
+ name: "HeaderSearch",
83
+ mixins: [l],
84
+ inject: ["crud"],
85
+ props: { search: Object },
86
+ data() {
87
+ return {
88
+ show: !1,
89
+ searchIndex: 2,
90
+ searchShow: !0
91
+ };
92
+ },
93
+ computed: {
94
+ searchForm: {
95
+ get() {
96
+ return this.crud.search;
97
+ },
98
+ set(e) {
99
+ this.crud.$emit("update:search", e);
100
+ }
101
+ },
102
+ option() {
103
+ let e = this.crud.option, t = (t = []) => {
104
+ t = r(t);
105
+ let n = [], i = 0;
106
+ return t = t.sort((e, t) => (t.searchOrder || 0) - (e.searchOrder || 0)), t.forEach((t) => {
107
+ if (t.search) {
108
+ let r = i < this.searchIndex, a = {};
109
+ Object.keys(t).forEach((e) => {
110
+ let n = "search";
111
+ if (e !== "searchProp" && e.includes(n)) {
112
+ let r = e.replace(n, "");
113
+ if (r.length === 0) return;
114
+ r = r.replace(r[0], r[0].toLowerCase()), a[r] = t[e];
115
+ }
116
+ }), t = Object.assign(t, a, {
117
+ type: d(t),
118
+ detail: !1,
119
+ dicFlag: t.cascader ? !0 : s(t.dicFlag, !1),
120
+ span: t.searchSpan || e.searchSpan || G.searchSpan,
121
+ control: t.searchControl,
122
+ gutter: t.searchGutter || e.searchGutter || G.searchGutter,
123
+ labelWidth: t.searchLabelWidth || e.searchLabelWidth || G.searchLabelWidth,
124
+ labelPosition: t.searchLabelPosition || e.searchLabelPosition,
125
+ size: t.searchSize || e.searchSize,
126
+ value: t.searchValue,
127
+ rules: t.searchRules,
128
+ row: t.searchRow,
129
+ bind: t.searchBin,
130
+ disabled: t.searchDisabled,
131
+ readonly: t.searchReadonly,
132
+ display: this.isSearchIcon ? this.show ? !0 : r : !0
133
+ }), n.push(t), i += 1;
134
+ }
135
+ }), n;
136
+ };
137
+ return ((n) => {
138
+ let i = r(n);
139
+ return i.column = t(this.crud.propOption), i = Object.assign(i, {
140
+ rowKey: e.searchRowKey || "null",
141
+ tabs: !1,
142
+ group: !1,
143
+ printBtn: !1,
144
+ mockBtn: !1,
145
+ filterDic: e.searchFilterDic,
146
+ filterNull: e.searchFilterNull,
147
+ filterParam: e.searchFilterParam,
148
+ enter: e.searchEnter,
149
+ size: e.searchSize,
150
+ submitText: e.searchBtnText || "搜 索",
151
+ submitBtn: s(e.searchBtn, G.searchSubBtn),
152
+ submitIcon: this.crud.getBtnIcon("searchBtn"),
153
+ emptyText: e.emptyBtnText || "清 空",
154
+ emptyBtn: s(e.emptyBtn, G.emptyBtn),
155
+ emptyIcon: this.crud.getBtnIcon("emptyBtn"),
156
+ menuSpan: this.show || !this.isSearchIcon || e.searchMenuSpan < 6 ? e.searchMenuSpan : 6,
157
+ menuPosition: e.searchMenuPosition || "center",
158
+ dicFlag: !1,
159
+ dicData: this.crud.DIC
160
+ }), i;
161
+ })(e);
162
+ },
163
+ isSearchIcon() {
164
+ return s(this.crud.option.searchIcon, this.$AVUE.searchIcon) && this.searchLen > this.searchIndex;
165
+ },
166
+ searchLen() {
167
+ let e = 0;
168
+ return this.crud.propOption.forEach((t) => {
169
+ t.search && e++;
170
+ }), e;
171
+ },
172
+ searchFlag() {
173
+ return !!this.crud.$slots.search || this.searchLen !== 0;
174
+ }
175
+ },
176
+ watch: {
177
+ "crud.propOption": {
178
+ handler() {
179
+ this.dataFormat();
180
+ },
181
+ deep: !0
182
+ },
183
+ show() {
184
+ this.crud.getTableHeight();
185
+ },
186
+ searchShow() {
187
+ this.crud.getTableHeight();
188
+ },
189
+ option: {
190
+ immediate: !0,
191
+ deep: !0,
192
+ handler() {
193
+ var e;
194
+ this.searchIndex = ((e = this.option) == null ? void 0 : e.searchIndex) || 2;
195
+ }
196
+ }
197
+ },
198
+ created() {
199
+ this.initFun(), this.dataFormat();
200
+ },
201
+ methods: {
202
+ initFun() {
203
+ ["searchReset", "searchChange"].forEach((e) => {
204
+ this.crud[e] = this[e];
205
+ });
206
+ },
207
+ getSlotName(e) {
208
+ return e.replace("Search", "");
209
+ },
210
+ searchChange(e, t) {
211
+ e = a(e), this.crud.propOption.forEach((t) => {
212
+ t.searchProp && (e[t.searchProp] = e[t.prop], delete e[t.prop]);
213
+ }), this.crud.$emit("search-change", e, t);
214
+ },
215
+ resetChange() {
216
+ this.crud.$emit("search-reset", this.searchForm);
217
+ },
218
+ searchReset() {
219
+ this.$refs.form.resetForm();
220
+ },
221
+ handleSearchShow() {
222
+ this.searchShow = !this.searchShow;
223
+ },
224
+ dataFormat() {
225
+ let e = this.crud.option;
226
+ this.searchShow = s(e.searchShow, G.searchShow);
227
+ }
228
+ }
229
+ };
230
+ function ne(e, t, n, r, i, a) {
231
+ let o = L("ElButton"), s = L("FyForm"), c = L("ElCard");
232
+ return a.searchFlag ? H((P(), S(c, {
233
+ key: 0,
234
+ shadow: a.crud.isCard,
235
+ class: "avue-crud__search"
236
+ }, {
237
+ default: V(() => [I(e.$slots, "search", {
238
+ row: a.searchForm,
239
+ search: a.searchForm,
240
+ size: a.crud.controlSize
241
+ }), O(s, {
242
+ ref: "form",
243
+ modelValue: a.searchForm,
244
+ "onUpdate:modelValue": t[2] || (t[2] = (e) => a.searchForm = e),
245
+ option: a.option,
246
+ onSubmit: a.searchChange,
247
+ onResetChange: a.resetChange
248
+ }, {
249
+ menuForm: V((n) => [I(e.$slots, "searchMenu", M(k(Object.assign(n, {
250
+ search: a.searchForm,
251
+ row: a.searchForm
252
+ })))), a.isSearchIcon ? (P(), w(x, { key: 0 }, [i.show === !1 ? (P(), S(o, {
253
+ key: 0,
254
+ type: "text",
255
+ icon: "el-icon-arrow-down",
256
+ onClick: t[0] || (t[0] = (e) => i.show = !0)
257
+ }, {
258
+ default: V(() => [...t[3] || (t[3] = [D(" 展 开 ", -1)])]),
259
+ _: 1
260
+ })) : C("v-if", !0), i.show === !0 ? (P(), S(o, {
261
+ key: 1,
262
+ type: "text",
263
+ icon: "el-icon-arrow-up",
264
+ onClick: t[1] || (t[1] = (e) => i.show = !1)
265
+ }, {
266
+ default: V(() => [...t[4] || (t[4] = [D(" 收 缩 ", -1)])]),
267
+ _: 1
268
+ })) : C("v-if", !0)], 64)) : C("v-if", !0)]),
269
+ default: V(() => [(P(!0), w(x, null, F(a.crud.searchSlot, (t) => I(e.$slots, t, A({ ref_for: !0 }, Object.assign(e.scope, {
270
+ search: a.searchForm,
271
+ row: a.searchForm
272
+ })))), 256))]),
273
+ _: 3
274
+ }, 8, [
275
+ "modelValue",
276
+ "option",
277
+ "onSubmit",
278
+ "onResetChange"
279
+ ])]),
280
+ _: 3
281
+ }, 8, ["shadow"])), [[ee, i.searchShow && a.searchFlag]]) : C("v-if", !0);
282
+ }
283
+ var re = /* @__PURE__ */ e(te, [["render", ne]]), K = {
284
+ name: "HeaderMenu",
285
+ directives: { permission: h },
286
+ inject: ["crud"],
287
+ data() {
288
+ return {
289
+ dateCreate: !1,
290
+ pickerOptions: { shortcuts: [
291
+ {
292
+ text: "今日",
293
+ onClick(e) {
294
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
295
+ n.setTime(n.getTime()), e.$emit("pick", [n, t]);
296
+ }
297
+ },
298
+ {
299
+ text: "昨日",
300
+ onClick(e) {
301
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
302
+ n.setTime(n.getTime() - 3600 * 1e3 * 24 * 1), e.$emit("pick", [n, t]);
303
+ }
304
+ },
305
+ {
306
+ text: "最近一周",
307
+ onClick(e) {
308
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
309
+ n.setTime(n.getTime() - 3600 * 1e3 * 24 * 7), e.$emit("pick", [n, t]);
310
+ }
311
+ },
312
+ {
313
+ text: "最近一个月",
314
+ onClick(e) {
315
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
316
+ n.setTime(n.getTime() - 3600 * 1e3 * 24 * 30), e.$emit("pick", [n, t]);
317
+ }
318
+ },
319
+ {
320
+ text: "最近三个月",
321
+ onClick(e) {
322
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
323
+ n.setTime(n.getTime() - 3600 * 1e3 * 24 * 90), e.$emit("pick", [n, t]);
324
+ }
325
+ }
326
+ ] },
327
+ config: G
328
+ };
329
+ },
330
+ created() {
331
+ this.initFun();
332
+ },
333
+ methods: {
334
+ optVal: s,
335
+ dateChange(e) {
336
+ this.dateCreate ? this.crud.$emit("date-change", e) : this.dateCreate = !0;
337
+ },
338
+ initFun() {
339
+ this.crud.rowExcel = this.rowExcel, this.crud.rowPrint = this.rowPrint;
340
+ },
341
+ rowExcel() {
342
+ this.crud.$refs.dialogExcel.handleShow();
343
+ },
344
+ rowPrint() {
345
+ this.$Print(this.crud.$refs.table);
346
+ }
347
+ }
348
+ }, q = { class: "avue-crud__menu" }, J = {
349
+ key: 0,
350
+ class: "avue-crud__left"
351
+ }, Y = {
352
+ key: 1,
353
+ class: "avue-crud__right"
354
+ };
355
+ function X(e, t, n, r, i, a) {
356
+ let o = L("ElButton"), s = L("FyDate"), c = R("permission");
357
+ return P(), w("div", q, [a.optVal(a.crud.tableOption.menuLeft, !0) ? (P(), w("div", J, [
358
+ a.optVal(a.crud.tableOption.addBtn, i.config.addBtn) ? H((P(), S(o, {
359
+ key: 0,
360
+ type: "primary",
361
+ icon: a.crud.getBtnIcon("addBtn"),
362
+ size: a.crud.isMediumSize,
363
+ onClick: a.crud.rowAdd
364
+ }, {
365
+ default: V(() => [a.crud.isIconMenu ? C("v-if", !0) : (P(), w(x, { key: 0 }, [D(B(a.crud.menuIcon("addBtn")), 1)], 64))]),
366
+ _: 1
367
+ }, 8, [
368
+ "icon",
369
+ "size",
370
+ "onClick"
371
+ ])), [[c, a.crud.getPermission("addBtn")]]) : C("v-if", !0),
372
+ a.optVal(a.crud.tableOption.addRowBtn, i.config.addRowBtn) ? H((P(), S(o, {
373
+ key: 1,
374
+ type: "primary",
375
+ icon: a.crud.getBtnIcon("addBtn"),
376
+ size: a.crud.isMediumSize,
377
+ onClick: a.crud.rowCellAdd
378
+ }, {
379
+ default: V(() => [a.crud.isIconMenu ? C("v-if", !0) : (P(), w(x, { key: 0 }, [D(B(a.crud.menuIcon("addBtn")), 1)], 64))]),
380
+ _: 1
381
+ }, 8, [
382
+ "icon",
383
+ "size",
384
+ "onClick"
385
+ ])), [[c, a.crud.getPermission("addRowBtn")]]) : C("v-if", !0),
386
+ I(e.$slots, "menuLeft", { size: a.crud.isMediumSize })
387
+ ])) : C("v-if", !0), a.optVal(a.crud.tableOption.menuRight, !0) ? (P(), w("div", Y, [
388
+ a.optVal(a.crud.tableOption.dateBtn, i.config.dateBtn) ? (P(), S(s, {
389
+ key: 0,
390
+ type: "datetimerange",
391
+ "value-format": "yyyy-MM-dd HH:mm:ss",
392
+ format: "yyyy-MM-dd HH:mm:ss",
393
+ "picker-options": i.pickerOptions,
394
+ style: {
395
+ display: "inline-block",
396
+ "margin-right": "20px"
397
+ },
398
+ size: a.crud.isMediumSize,
399
+ onChange: a.dateChange
400
+ }, null, 8, [
401
+ "picker-options",
402
+ "size",
403
+ "onChange"
404
+ ])) : C("v-if", !0),
405
+ I(e.$slots, "menuRight", { size: a.crud.isMediumSize }),
406
+ a.optVal(a.crud.tableOption.excelBtn, i.config.excelBtn) ? H((P(), S(o, {
407
+ key: 1,
408
+ icon: a.crud.getBtnIcon("excelBtn"),
409
+ circle: "",
410
+ size: a.crud.isMediumSize,
411
+ onClick: a.rowExcel
412
+ }, null, 8, [
413
+ "icon",
414
+ "size",
415
+ "onClick"
416
+ ])), [[c, a.crud.getPermission("excelBtn")]]) : C("v-if", !0),
417
+ a.optVal(a.crud.tableOption.printBtn, i.config.printBtn) ? H((P(), S(o, {
418
+ key: 2,
419
+ icon: a.crud.getBtnIcon("printBtn"),
420
+ circle: "",
421
+ size: a.crud.isMediumSize,
422
+ onClick: a.rowPrint
423
+ }, null, 8, [
424
+ "icon",
425
+ "size",
426
+ "onClick"
427
+ ])), [[c, a.crud.getPermission("printBtn")]]) : C("v-if", !0),
428
+ a.optVal(a.crud.tableOption.refreshBtn, i.config.refreshBtn) ? H((P(), S(o, {
429
+ key: 3,
430
+ icon: a.crud.getBtnIcon("refreshBtn"),
431
+ circle: "",
432
+ size: a.crud.isMediumSize,
433
+ onClick: a.crud.refreshChange
434
+ }, null, 8, [
435
+ "icon",
436
+ "size",
437
+ "onClick"
438
+ ])), [[c, a.crud.getPermission("refreshBtn")]]) : C("v-if", !0),
439
+ a.optVal(a.crud.tableOption.columnBtn, i.config.columnBtn) ? H((P(), S(o, {
440
+ key: 4,
441
+ icon: a.crud.getBtnIcon("columnBtn"),
442
+ circle: "",
443
+ size: a.crud.isMediumSize,
444
+ onClick: t[0] || (t[0] = (e) => a.crud.$refs.dialogColumn.handleShow())
445
+ }, null, 8, ["icon", "size"])), [[c, a.crud.getPermission("columnBtn")]]) : C("v-if", !0),
446
+ (a.crud.$refs.headerSearch || {}).searchFlag && a.optVal(a.crud.tableOption.searchShowBtn, !0) ? (P(), S(o, {
447
+ key: 5,
448
+ icon: a.crud.getBtnIcon("searchBtn"),
449
+ circle: "",
450
+ size: a.crud.isMediumSize,
451
+ onClick: t[1] || (t[1] = (e) => a.crud.$refs.headerSearch.handleSearchShow())
452
+ }, null, 8, ["icon", "size"])) : C("v-if", !0),
453
+ a.optVal(a.crud.tableOption.filterBtn, i.config.filterBtn) ? H((P(), S(o, {
454
+ key: 6,
455
+ icon: a.crud.getBtnIcon("filterBtn"),
456
+ circle: "",
457
+ size: a.crud.isMediumSize,
458
+ onClick: t[2] || (t[2] = (e) => a.crud.$refs.dialogFilter.handleShow())
459
+ }, null, 8, ["icon", "size"])), [[c, a.crud.getPermission("filterBtn")]]) : C("v-if", !0)
460
+ ])) : C("v-if", !0)]);
461
+ }
462
+ var ie = /* @__PURE__ */ e(K, [["render", X]]), Z = {}, ae = {
463
+ name: "ColumnSlot",
464
+ components: {
465
+ IconTemp: b,
466
+ FormTemp: y
467
+ },
468
+ inject: ["dynamic", "crud"],
469
+ props: {
470
+ column: Object,
471
+ columnOption: Array
472
+ },
473
+ created() {
474
+ let e = [
475
+ "getColumnProp",
476
+ "handleFilterMethod",
477
+ "handleFilters"
478
+ ];
479
+ Object.keys(this.dynamic).forEach((t) => {
480
+ e.includes(t) && (this[t] = this.dynamic[t]);
481
+ });
482
+ },
483
+ methods: {
484
+ isBlank: W,
485
+ optVal: s,
486
+ uploadFun: t,
487
+ isMediaType(e, t) {
488
+ return i(e, t);
489
+ },
490
+ vaildLabel(e, t, n) {
491
+ if (e.rules && t.$cellEdit) return n;
492
+ },
493
+ columnChange(e, t, n) {
494
+ let r = `${n}-${t.prop}`;
495
+ Z[r] || (this.handleChange(t, e), typeof t.change == "function" && t.cell === !0 && t.change({
496
+ row: e,
497
+ column: t,
498
+ index: n,
499
+ value: e[t.prop]
500
+ })), Z[r] = !0, this.$nextTick(() => {
501
+ Z[r] = !1;
502
+ });
503
+ },
504
+ handleChange(e, t) {
505
+ e.cascader && this.$nextTick(() => {
506
+ let r = e.cascader;
507
+ r.forEach((i) => {
508
+ let a = i, o = t[e.prop], s = t.$index, c = this.findObject(this.columnOption, a);
509
+ W(c) || (W(this.crud.cascaderDIC[s]) && this.$set(this.crud.cascaderDIC, s, {}), this.crud.cascaderIndexList.includes(s) && r.forEach((e) => {
510
+ this.$set(this.crud.cascaderDIC[s], e.prop, []), r.forEach((e) => t[e] = "");
511
+ }), !(W(r) || W(o) || W(c)) && g({
512
+ column: c,
513
+ value: o,
514
+ form: t
515
+ }).then((e) => {
516
+ let r = e || [];
517
+ this.crud.cascaderIndexList.includes(s) || this.crud.cascaderIndexList.push(s), this.crud.cascaderDicList[s] || this.$set(this.crud.cascaderDicList, s, {}), this.crud.cascaderDicList[s][a] || this.$set(this.crud.cascaderDicList[s], a, r), this.$set(this.crud.cascaderDIC[s], a, r), !W(r[c.cascaderIndex]) && !W(r) && !W(c.cascaderIndex) && (t[a] = r[c.cascaderIndex][(c.props || {}).value || n.value]);
518
+ }));
519
+ });
520
+ });
521
+ },
522
+ handleDetail(e, t) {
523
+ let n = t.parentProp ? (this.crud.cascaderDIC[e.$index] || {})[t.prop] : this.crud.DIC[t.prop], r = v(e, t, this.crud.tableOption, n);
524
+ return !W(n) && this.crud.tableOption.filterDic !== !0 && (e[`$${t.prop}`] = r), r;
525
+ },
526
+ corArray(e, t) {
527
+ let n = this.handleDetail(e, t);
528
+ return Array.isArray(n) || (n = W(n) ? [] : n.split(" | ")), r(n);
529
+ },
530
+ openImg(e, t, n) {
531
+ let r = this.getImgList(e, t);
532
+ r = r.map((e) => ({
533
+ thumbUrl: e,
534
+ url: e,
535
+ type: t.fileType
536
+ })), this.$ImagePreview(r, n);
537
+ },
538
+ getImgList(e, t) {
539
+ var r, i;
540
+ let a = ((r = t.propsHttp) == null ? void 0 : r.home) || "", o = ((i = t.props) == null ? void 0 : i.value) || n.value, s = this.corArray(e, t);
541
+ return s.forEach((e, t) => {
542
+ s[t] = a + (e[o] ? e[o] : e);
543
+ }), s;
544
+ }
545
+ }
546
+ }, oe = { key: 1 }, se = {
547
+ key: 0,
548
+ class: "avue-crud__img"
549
+ }, ce = ["src", "onClick"], le = { key: 1 }, ue = { key: 2 }, de = ["innerHTML"], fe = ["textContent"];
550
+ function pe(e, t, n, r, i, a) {
551
+ let o = L("FormTemp"), s = L("ElTooltip"), c = L("ElFormItem"), l = L("ElLink"), u = L("FyRate"), d = L("IconTemp"), f = L("ElTableColumn");
552
+ return e.getColumnProp(n.column, "hide") ? (P(), S(f, {
553
+ key: n.column.prop,
554
+ prop: n.column.prop,
555
+ label: n.column.label,
556
+ "column-key": n.column.prop,
557
+ "filter-placement": "bottom-end",
558
+ filters: e.getColumnProp(n.column, "filters"),
559
+ "filter-method": e.getColumnProp(n.column, "filterMethod") ? e.handleFilterMethod : void 0,
560
+ "filter-multiple": a.optVal(n.column.filterMultiple, !0),
561
+ "show-overflow-tooltip": n.column.overHidden,
562
+ "min-width": n.column.minWidth,
563
+ sortable: e.getColumnProp(n.column, "sortable"),
564
+ "sort-method": n.column.sortMethod,
565
+ "sort-orders": n.column.sortOrders,
566
+ "sort-by": n.column.sortBy,
567
+ resizable: n.column.resizable,
568
+ "render-header": n.column.renderHeader,
569
+ align: n.column.align || a.crud.tableOption.align,
570
+ "header-align": n.column.headerAlign || a.crud.tableOption.headerAlign,
571
+ width: e.getColumnProp(n.column, "width"),
572
+ fixed: e.getColumnProp(n.column, "fixed")
573
+ }, {
574
+ header: V(({ $index: t }) => [a.crud.getSlotName(n.column, "H", a.crud.$slots) ? I(e.$slots, a.crud.getSlotName(n.column, "H"), M(A({ key: 0 }, {
575
+ column: n.column,
576
+ $index: t
577
+ }))) : (P(), w("span", oe, B(n.column.label), 1))]),
578
+ default: V(({ row: t, $index: r }) => [t.$cellEdit && n.column.cell ? (P(), S(c, {
579
+ key: 0,
580
+ prop: a.crud.isTree ? "" : `list.${r}.${n.column.prop}`,
581
+ label: a.vaildLabel(n.column, t, " "),
582
+ "label-width": a.vaildLabel(n.column, t, "1px"),
583
+ rules: n.column.rules
584
+ }, {
585
+ default: V(() => [O(s, {
586
+ content: (a.crud.listError[`list.${r}.${n.column.prop}`] || {}).msg,
587
+ disabled: !(a.crud.listError[`list.${r}.${n.column.prop}`] || {}).valid,
588
+ placement: "top"
589
+ }, {
590
+ default: V(() => [a.crud.getSlotName(n.column, "F", a.crud.$slots) ? I(e.$slots, a.crud.getSlotName(n.column, "F"), M(A({ key: 0 }, {
591
+ row: t,
592
+ dic: a.crud.DIC[n.column.prop],
593
+ size: a.crud.isMediumSize,
594
+ index: r,
595
+ disabled: a.crud.btnDisabledList[r],
596
+ label: a.handleDetail(t, n.column),
597
+ $cell: t.$cellEdit
598
+ }))) : (P(), S(o, A({ key: 1 }, a.uploadFun(n.column, a.crud), {
599
+ modelValue: t[n.column.prop],
600
+ "onUpdate:modelValue": (e) => t[n.column.prop] = e,
601
+ column: n.column,
602
+ size: a.crud.isMediumSize,
603
+ "table-data": {
604
+ index: r,
605
+ row: t,
606
+ label: a.handleDetail(t, n.column)
607
+ },
608
+ dic: (a.crud.cascaderDIC[r] || {})[n.column.prop] || a.crud.DIC[n.column.prop],
609
+ props: n.column.props || a.crud.tableOption.props,
610
+ readonly: n.column.readonly,
611
+ disabled: a.crud.disabled || a.crud.tableOption.disabled || n.column.disabled || a.crud.btnDisabledList[r],
612
+ clearable: a.optVal(n.column.clearable, !1),
613
+ "column-slot": a.crud.mainSlot,
614
+ onChange: (e) => a.columnChange(t, n.column, r)
615
+ }), E({ _: 2 }, [F(a.crud.mainSlot, (t) => ({
616
+ name: t,
617
+ fn: V((n) => [I(e.$slots, t, M(k(n)))])
618
+ }))]), 1040, [
619
+ "modelValue",
620
+ "onUpdate:modelValue",
621
+ "column",
622
+ "size",
623
+ "table-data",
624
+ "dic",
625
+ "props",
626
+ "readonly",
627
+ "disabled",
628
+ "clearable",
629
+ "column-slot",
630
+ "onChange"
631
+ ]))]),
632
+ _: 2
633
+ }, 1032, ["content", "disabled"])]),
634
+ _: 2
635
+ }, 1032, [
636
+ "prop",
637
+ "label",
638
+ "label-width",
639
+ "rules"
640
+ ])) : a.crud.$slots[n.column.prop] ? I(e.$slots, n.column.prop, {
641
+ key: 1,
642
+ row: t,
643
+ index: r,
644
+ dic: a.crud.DIC[n.column.prop],
645
+ size: a.crud.isMediumSize,
646
+ label: a.handleDetail(t, n.column)
647
+ }) : (P(), w(x, { key: 2 }, [["img", "upload"].includes(n.column.type) ? (P(), w("span", se, [(P(!0), w(x, null, F(a.getImgList(t, n.column), (e, r) => (P(), w(x, null, [a.isMediaType(e, n.column.fileType) ? (P(), S(z(a.isMediaType(e, n.column.fileType)), {
648
+ key: r,
649
+ src: e,
650
+ onClick: U((e) => a.openImg(t, n.column, r), ["stop"])
651
+ }, null, 8, ["src", "onClick"])) : (P(), w("i", {
652
+ key: `e_${r}`,
653
+ src: e,
654
+ class: "el-icon-document",
655
+ onClick: U((e) => a.openImg(t, n.column, r), ["stop"])
656
+ }, null, 8, ce))], 64))), 256))])) : n.column.type === "url" ? (P(), w("span", le, [(P(!0), w(x, null, F(a.corArray(t, n.column), (e, t) => (P(), S(l, {
657
+ key: t,
658
+ type: "primary",
659
+ href: e,
660
+ target: n.column.target || "_blank"
661
+ }, {
662
+ default: V(() => [D(B(e), 1)]),
663
+ _: 2
664
+ }, 1032, ["href", "target"]))), 128))])) : n.column.type === "rate" ? (P(), w("span", ue, [O(u, {
665
+ modelValue: t[n.column.prop],
666
+ "onUpdate:modelValue": (e) => t[n.column.prop] = e,
667
+ disabled: ""
668
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])])) : n.column.type === "color" ? (P(), w("i", {
669
+ key: 3,
670
+ class: "avue-crud__color",
671
+ style: N({ backgroundColor: t[n.column.prop] })
672
+ }, null, 4)) : n.column.type === "icon" ? (P(), S(d, {
673
+ key: 4,
674
+ text: t[n.column.prop]
675
+ }, null, 8, ["text"])) : n.column.html ? (P(), w("span", {
676
+ key: 5,
677
+ innerHTML: a.handleDetail(t, n.column)
678
+ }, null, 8, de)) : (P(), w("span", {
679
+ key: 6,
680
+ textContent: B(a.handleDetail(t, n.column))
681
+ }, null, 8, fe))], 64))]),
682
+ _: 3
683
+ }, 8, [
684
+ "prop",
685
+ "label",
686
+ "column-key",
687
+ "filters",
688
+ "filter-method",
689
+ "filter-multiple",
690
+ "show-overflow-tooltip",
691
+ "min-width",
692
+ "sortable",
693
+ "sort-method",
694
+ "sort-orders",
695
+ "sort-by",
696
+ "resizable",
697
+ "render-header",
698
+ "align",
699
+ "header-align",
700
+ "width",
701
+ "fixed"
702
+ ])) : C("v-if", !0);
703
+ }
704
+ var Q = /* @__PURE__ */ e(ae, [["render", pe]]), me = {
705
+ name: "ColumnDynamic",
706
+ components: { ColumnSlot: Q },
707
+ inject: ["dynamic", "crud"],
708
+ props: { columnOption: Object },
709
+ created() {
710
+ let e = [
711
+ "getColumnProp",
712
+ "handleFilterMethod",
713
+ "handleFilters"
714
+ ];
715
+ Object.keys(this.dynamic).forEach((t) => {
716
+ e.includes(t) && (this[t] = this.dynamic[t]);
717
+ });
718
+ },
719
+ methods: { optVal: s }
720
+ };
721
+ function he(e, t, n, r, i, a) {
722
+ let o = L("ColumnDynamic", !0), s = L("ColumnSlot"), c = L("ElTableColumn");
723
+ return e.getColumnProp(n.columnOption, "hide") ? (P(), S(c, {
724
+ key: n.columnOption.prop,
725
+ prop: n.columnOption.prop,
726
+ label: n.columnOption.label,
727
+ "filter-placement": "bottom-end",
728
+ filters: e.getColumnProp(n.columnOption, "filters"),
729
+ "filter-method": e.getColumnProp(n.columnOption, "filterMethod") ? e.handleFilterMethod : void 0,
730
+ "filter-multiple": a.optVal(n.columnOption.filterMultiple, !0),
731
+ "show-overflow-tooltip": n.columnOption.overHidden,
732
+ "min-width": n.columnOption.minWidth,
733
+ sortable: e.getColumnProp(n.columnOption, "sortable"),
734
+ "render-header": n.columnOption.renderHeader,
735
+ align: n.columnOption.align || a.crud.tableOption.align,
736
+ "header-align": n.columnOption.headerAlign || a.crud.tableOption.headerAlign,
737
+ width: e.getColumnProp(n.columnOption, "width"),
738
+ fixed: e.getColumnProp(n.columnOption, "fixed")
739
+ }, {
740
+ default: V(() => [(P(!0), w(x, null, F(n.columnOption.children, (t) => (P(), w(x, null, [t.children && t.children.length > 0 ? (P(), S(o, {
741
+ key: t.prop,
742
+ "column-option": t
743
+ }, E({ _: 2 }, [F(a.crud.mainSlot, (t) => ({
744
+ name: t,
745
+ fn: V((n) => [I(e.$slots, t, A({ ref_for: !0 }, n))])
746
+ }))]), 1032, ["column-option"])) : (P(), S(s, {
747
+ key: t.prop,
748
+ column: t,
749
+ "column-option": n.columnOption.children
750
+ }, E({ _: 2 }, [F(a.crud.mainSlot, (t) => ({
751
+ name: t,
752
+ fn: V((n) => [I(e.$slots, t, A({ ref_for: !0 }, n))])
753
+ }))]), 1032, ["column", "column-option"]))], 64))), 256))]),
754
+ _: 3
755
+ }, 8, [
756
+ "prop",
757
+ "label",
758
+ "filters",
759
+ "filter-method",
760
+ "filter-multiple",
761
+ "show-overflow-tooltip",
762
+ "min-width",
763
+ "sortable",
764
+ "render-header",
765
+ "align",
766
+ "header-align",
767
+ "width",
768
+ "fixed"
769
+ ])) : C("v-if", !0);
770
+ }
771
+ //#endregion
772
+ //#region src/components/fy-from/crud/components/Column.vue
773
+ var ge = {
774
+ name: "Column",
775
+ components: {
776
+ ColumnDynamic: /* @__PURE__ */ e(me, [["render", he]]),
777
+ ColumnSlot: Q
778
+ },
779
+ inject: ["crud"],
780
+ provide() {
781
+ return {
782
+ crud: this.crud,
783
+ dynamic: this
784
+ };
785
+ },
786
+ props: { columnOption: Array },
787
+ computed: { list() {
788
+ let e = [...this.columnOption];
789
+ return e = o(e, "index", (e, t) => {
790
+ var n, r;
791
+ return ((n = this.crud.objectOption[e.prop]) == null ? void 0 : n.index) - ((r = this.crud.objectOption[t.prop]) == null ? void 0 : r.index);
792
+ }), e;
793
+ } },
794
+ methods: {
795
+ handleFilterMethod(e, t, n) {
796
+ let r = this.columnOption.filter((e) => e.prop === n.property)[0];
797
+ return typeof r.filterMethod == "function" ? r.filterMethod(e, t, r) : t[r.prop] === e;
798
+ },
799
+ handleFilters(e, t) {
800
+ if (t !== !0) return;
801
+ let r = this.crud.DIC[e.prop] || [], i = [];
802
+ return W(r) ? this.crud.cellForm.list.forEach((t) => {
803
+ i.map((e) => e.text).includes(t[e.prop]) || i.push({
804
+ text: t[e.prop],
805
+ value: t[e.prop]
806
+ });
807
+ }) : r.forEach((t) => {
808
+ let r = e.props || this.crud.tableOption.props || {};
809
+ i.push({
810
+ text: t[r.label || n.label],
811
+ value: t[r.value || n.value]
812
+ });
813
+ }), i;
814
+ },
815
+ getColumnProp(e, t) {
816
+ let n = this.crud.objectOption[e.prop] || {};
817
+ if (t === "filterMethod") return n == null ? void 0 : n.filters;
818
+ if (this.crud.isMobile && ["fixed"].includes(t)) return !1;
819
+ let r = n == null ? void 0 : n[t];
820
+ if (!(t === "width" && r === 0)) return t === "filters" ? this.handleFilters(e, r) : t === "hide" ? (n == null ? void 0 : n.hide) !== !0 : r;
821
+ }
822
+ }
823
+ };
824
+ function _e(e, t, n, r, i, a) {
825
+ let o = L("ColumnDynamic"), s = L("ColumnSlot");
826
+ return P(), w("div", null, [
827
+ I(e.$slots, "header"),
828
+ C(" 动态列 "),
829
+ (P(!0), w(x, null, F(a.list, (t) => (P(), w(x, null, [t.children && t.children.length > 0 ? (P(), S(o, {
830
+ key: t.pop,
831
+ "column-option": t
832
+ }, E({ _: 2 }, [F(a.crud.mainSlot, (t) => ({
833
+ name: t,
834
+ fn: V((n) => [I(e.$slots, t, A({ ref_for: !0 }, n))])
835
+ }))]), 1032, ["column-option"])) : (P(), S(s, {
836
+ key: t.prop,
837
+ column: t,
838
+ "column-option": n.columnOption
839
+ }, E({ _: 2 }, [F(a.crud.mainSlot, (t) => ({
840
+ name: t,
841
+ fn: V((n) => [I(e.$slots, t, A({ ref_for: !0 }, n))])
842
+ }))]), 1032, ["column", "column-option"]))], 64))), 256)),
843
+ I(e.$slots, "footer")
844
+ ]);
845
+ }
846
+ var ve = /* @__PURE__ */ e(ge, [["render", _e]]), ye = {
847
+ name: "ColumnDefault",
848
+ inject: ["crud"],
849
+ data() {
850
+ return { config: G };
851
+ },
852
+ mounted() {
853
+ this.setSort();
854
+ },
855
+ methods: {
856
+ optVal: s,
857
+ indexMethod(e) {
858
+ return e + 1 + ((this.crud.page.currentPage || 1) - 1) * (this.crud.page.pageSize || 10);
859
+ },
860
+ setSort() {
861
+ this.rowDrop(), this.columnDrop();
862
+ },
863
+ rowDrop() {
864
+ let e = this.crud.$refs.table.$el.querySelectorAll(this.config.dropRowClass)[0];
865
+ this.crud.tableDrop("row", e, (e) => {
866
+ let t = e.oldIndex, n = e.newIndex, r = this.crud.list.splice(t, 1)[0];
867
+ this.crud.list.splice(n, 0, r), this.crud.$emit("sortable-change", t, n), this.crud.refreshTable(() => this.rowDrop());
868
+ });
869
+ },
870
+ columnDrop() {
871
+ let e = this.crud.$refs.table.$el.querySelector(this.config.dropColClass), t = 0;
872
+ [
873
+ "selection",
874
+ "index",
875
+ "expand"
876
+ ].forEach((e) => {
877
+ this.crud.tableOption[e] && (t += 1);
878
+ }), this.crud.tableDrop("column", e, (e) => {
879
+ this.crud.headerSort(e.oldIndex - t, e.newIndex - t), this.columnDrop();
880
+ });
881
+ }
882
+ }
883
+ };
884
+ function be(e, t, n, r, i, a) {
885
+ let o = L("ElTableColumn");
886
+ return P(), w("div", null, [
887
+ O(o, { width: "1px" }),
888
+ C(" 折叠面板 "),
889
+ a.crud.tableOption.expand ? (P(), S(o, {
890
+ key: "expand",
891
+ type: "expand",
892
+ width: a.crud.tableOption.expandWidth || i.config.expandWidth,
893
+ fixed: a.optVal(a.crud.tableOption.expandFixed, i.config.expandFixed),
894
+ align: "center"
895
+ }, {
896
+ default: V(({ row: t }) => [I(e.$slots, "expand", {
897
+ row: t,
898
+ index: t.$index
899
+ })]),
900
+ _: 3
901
+ }, 8, ["width", "fixed"])) : C("v-if", !0),
902
+ C(" 选择框 "),
903
+ a.crud.tableOption.selection ? (P(), S(o, {
904
+ key: "selection",
905
+ fixed: a.optVal(a.crud.tableOption.selectionFixed, i.config.selectionFixed),
906
+ type: "selection",
907
+ selectable: a.crud.tableOption.selectable,
908
+ "reserve-selection": a.optVal(a.crud.tableOption.reserveSelection),
909
+ width: a.crud.tableOption.selectionWidth || i.config.selectionWidth,
910
+ align: "center"
911
+ }, null, 8, [
912
+ "fixed",
913
+ "selectable",
914
+ "reserve-selection",
915
+ "width"
916
+ ])) : C("v-if", !0),
917
+ C(" 序号 "),
918
+ a.optVal(a.crud.tableOption.index) ? (P(), S(o, {
919
+ key: "index",
920
+ fixed: a.optVal(a.crud.tableOption.indexFixed, i.config.indexFixed),
921
+ label: a.crud.tableOption.indexLabel || i.config.indexLabel,
922
+ type: "index",
923
+ width: a.crud.tableOption.indexWidth || i.config.indexWidth,
924
+ index: a.indexMethod,
925
+ align: "center"
926
+ }, null, 8, [
927
+ "fixed",
928
+ "label",
929
+ "width",
930
+ "index"
931
+ ])) : C("v-if", !0)
932
+ ]);
933
+ }
934
+ var xe = /* @__PURE__ */ e(ye, [["render", be]]), Se = {
935
+ name: "ColumnMenu",
936
+ directives: { permission: h },
937
+ inject: ["crud"],
938
+ data() {
939
+ return { config: G };
940
+ },
941
+ computed: {
942
+ menuType() {
943
+ return this.crud.tableOption.menuType || this.$AVUE.menuType || "button";
944
+ },
945
+ isIconMenu() {
946
+ return this.menuType === "icon";
947
+ },
948
+ isTextMenu() {
949
+ return this.menuType === "text";
950
+ },
951
+ isMenu() {
952
+ return this.menuType === "menu";
953
+ }
954
+ },
955
+ methods: {
956
+ optVal: s,
957
+ menuText(e) {
958
+ return ["text", "menu"].includes(this.menuType) ? "text" : e;
959
+ }
960
+ }
961
+ };
962
+ function Ce(e, t, n, r, i, a) {
963
+ let o = L("ElButton"), s = L("ElDropdownItem"), c = L("ElDropdownMenu"), l = L("ElDropdown"), u = L("ElTableColumn"), d = R("permission");
964
+ return P(), w(x, null, [C(" 操作栏 "), a.optVal(a.crud.tableOption.menu, i.config.menu) && a.crud.getPermission("menu") ? (P(), S(u, {
965
+ key: "menu",
966
+ class: "avue-crud__btn",
967
+ prop: "menu",
968
+ fixed: a.optVal(a.crud.tableOption.menuFixed, i.config.menuFixed),
969
+ label: a.crud.tableOption.menuTitle || "操作",
970
+ align: a.crud.tableOption.menuAlign || i.config.menuAlign,
971
+ "header-align": a.crud.tableOption.menuHeaderAlign || i.config.menuHeaderAlign,
972
+ width: a.crud.isMobile ? a.crud.tableOption.menuXsWidth || i.config.menuXsWidth : a.crud.tableOption.menuWidth || i.config.menuWidth
973
+ }, {
974
+ default: V(({ row: n, $index: r }) => [a.isMenu ? (P(), S(l, {
975
+ key: 0,
976
+ size: a.crud.isMediumSize
977
+ }, {
978
+ dropdown: V(() => [O(c, null, {
979
+ default: V(() => [
980
+ a.optVal(a.crud.tableOption.viewBtn, i.config.viewBtn) ? H((P(), S(s, {
981
+ key: 0,
982
+ icon: a.crud.getBtnIcon("viewBtn"),
983
+ onClick: (e) => a.crud.rowView(n, r)
984
+ }, {
985
+ default: V(() => [D(B(a.crud.menuIcon("viewBtn")), 1)]),
986
+ _: 1
987
+ }, 8, ["icon", "onClick"])), [[d, a.crud.getPermission("viewBtn", n, r)]]) : C("v-if", !0),
988
+ a.optVal(a.crud.tableOption.editBtn, i.config.editBtn) ? H((P(), S(s, {
989
+ key: 1,
990
+ icon: a.crud.getBtnIcon("editBtn"),
991
+ onClick: (e) => a.crud.rowEdit(n, r)
992
+ }, {
993
+ default: V(() => [D(B(a.crud.menuIcon("editBtn")), 1)]),
994
+ _: 1
995
+ }, 8, ["icon", "onClick"])), [[d, a.crud.getPermission("editBtn", n, r)]]) : C("v-if", !0),
996
+ a.optVal(a.crud.tableOption.copyBtn, i.config.copyBtn) ? H((P(), S(s, {
997
+ key: 2,
998
+ icon: a.crud.getBtnIcon("copyBtn"),
999
+ onClick: (e) => a.crud.rowCopy(n)
1000
+ }, {
1001
+ default: V(() => [D(B(a.crud.menuIcon("copyBtn")), 1)]),
1002
+ _: 1
1003
+ }, 8, ["icon", "onClick"])), [[d, a.crud.getPermission("copyBtn", n, r)]]) : C("v-if", !0),
1004
+ a.optVal(a.crud.tableOption.delBtn, i.config.delBtn) ? H((P(), S(s, {
1005
+ key: 3,
1006
+ icon: a.crud.getBtnIcon("delBtn"),
1007
+ onClick: (e) => a.crud.rowDel(n, r)
1008
+ }, {
1009
+ default: V(() => [D(B(a.crud.menuIcon("delBtn")), 1)]),
1010
+ _: 1
1011
+ }, 8, ["icon", "onClick"])), [[d, a.crud.getPermission("delBtn", n, r)]]) : C("v-if", !0),
1012
+ I(e.$slots, "menuBtn", {
1013
+ row: n,
1014
+ type: a.menuText("primary"),
1015
+ disabled: a.crud.btnDisabled,
1016
+ size: a.crud.isMediumSize,
1017
+ index: r
1018
+ })
1019
+ ]),
1020
+ _: 2
1021
+ }, 1024)]),
1022
+ default: V(() => [O(o, {
1023
+ type: "text",
1024
+ size: a.crud.isMediumSize
1025
+ }, {
1026
+ default: V(() => [D(B(a.crud.tableOption.menuBtnTitle || "按钮") + " ", 1), t[0] || (t[0] = T("i", { class: "el-icon-arrow-down el-icon--right" }, null, -1))]),
1027
+ _: 1
1028
+ }, 8, ["size"])]),
1029
+ _: 2
1030
+ }, 1032, ["size"])) : [
1031
+ "button",
1032
+ "text",
1033
+ "icon"
1034
+ ].includes(a.menuType) ? (P(), w(x, { key: 1 }, [
1035
+ a.optVal(a.crud.tableOption.cellBtn, i.config.cellBtn) ? (P(), w(x, { key: 0 }, [a.optVal(a.crud.tableOption.editBtn, i.config.editBtn) && !n.$cellEdit ? H((P(), S(o, {
1036
+ key: 0,
1037
+ type: a.menuText("primary"),
1038
+ icon: a.crud.getBtnIcon("editBtn"),
1039
+ size: a.crud.isMediumSize,
1040
+ disabled: a.crud.btnDisabledList[r],
1041
+ onClick: U((e) => a.crud.rowCell(n, r), ["stop"])
1042
+ }, {
1043
+ default: V(() => [a.isIconMenu ? C("v-if", !0) : (P(), w(x, { key: 0 }, [D(B(a.crud.menuIcon("editBtn")), 1)], 64))]),
1044
+ _: 1
1045
+ }, 8, [
1046
+ "type",
1047
+ "icon",
1048
+ "size",
1049
+ "disabled",
1050
+ "onClick"
1051
+ ])), [[d, a.crud.getPermission("editBtn", n, r)]]) : a.optVal(a.crud.tableOption.saveBtn, i.config.saveBtn) && n.$cellEdit ? H((P(), S(o, {
1052
+ key: 1,
1053
+ type: a.menuText("primary"),
1054
+ icon: a.crud.getBtnIcon("saveBtn"),
1055
+ size: a.crud.isMediumSize,
1056
+ disabled: a.crud.btnDisabledList[r],
1057
+ onClick: U((e) => a.crud.rowCell(n, r), ["stop"])
1058
+ }, {
1059
+ default: V(() => [a.isIconMenu ? C("v-if", !0) : (P(), w(x, { key: 0 }, [D(B(a.crud.menuIcon("saveBtn")), 1)], 64))]),
1060
+ _: 1
1061
+ }, 8, [
1062
+ "type",
1063
+ "icon",
1064
+ "size",
1065
+ "disabled",
1066
+ "onClick"
1067
+ ])), [[d, a.crud.getPermission("saveBtn", n, r)]]) : C("v-if", !0), n.$cellEdit ? (P(), S(o, {
1068
+ key: 2,
1069
+ type: a.menuText("danger"),
1070
+ icon: a.crud.getBtnIcon("cancelBtn"),
1071
+ size: a.crud.isMediumSize,
1072
+ disabled: a.crud.btnDisabledList[r],
1073
+ onClick: U((e) => a.crud.rowCancel(n, r), ["stop"])
1074
+ }, {
1075
+ default: V(() => [a.isIconMenu ? C("v-if", !0) : (P(), w(x, { key: 0 }, [D(B(a.crud.menuIcon("cancelBtn")), 1)], 64))]),
1076
+ _: 1
1077
+ }, 8, [
1078
+ "type",
1079
+ "icon",
1080
+ "size",
1081
+ "disabled",
1082
+ "onClick"
1083
+ ])) : C("v-if", !0)], 64)) : C("v-if", !0),
1084
+ a.optVal(a.crud.tableOption.viewBtn, i.config.viewBtn) ? H((P(), S(o, {
1085
+ key: 1,
1086
+ type: a.menuText("success"),
1087
+ icon: a.crud.getBtnIcon("viewBtn"),
1088
+ size: a.crud.isMediumSize,
1089
+ disabled: e.btnDisabled,
1090
+ onClick: U((e) => a.crud.rowView(n, r), ["stop"])
1091
+ }, {
1092
+ default: V(() => [a.isIconMenu ? C("v-if", !0) : (P(), w(x, { key: 0 }, [D(B(a.crud.menuIcon("viewBtn")), 1)], 64))]),
1093
+ _: 1
1094
+ }, 8, [
1095
+ "type",
1096
+ "icon",
1097
+ "size",
1098
+ "disabled",
1099
+ "onClick"
1100
+ ])), [[d, a.crud.getPermission("viewBtn", n, r)]]) : C("v-if", !0),
1101
+ a.optVal(a.crud.tableOption.editBtn, i.config.editBtn) && !a.crud.tableOption.cellBtn ? H((P(), S(o, {
1102
+ key: 2,
1103
+ type: a.menuText("primary"),
1104
+ icon: a.crud.getBtnIcon("editBtn"),
1105
+ size: a.crud.isMediumSize,
1106
+ disabled: e.btnDisabled,
1107
+ onClick: U((e) => a.crud.rowEdit(n, r), ["stop"])
1108
+ }, {
1109
+ default: V(() => [a.isIconMenu ? C("v-if", !0) : (P(), w(x, { key: 0 }, [D(B(a.crud.menuIcon("editBtn")), 1)], 64))]),
1110
+ _: 1
1111
+ }, 8, [
1112
+ "type",
1113
+ "icon",
1114
+ "size",
1115
+ "disabled",
1116
+ "onClick"
1117
+ ])), [[d, a.crud.getPermission("editBtn", n, r)]]) : C("v-if", !0),
1118
+ a.optVal(a.crud.tableOption.copyBtn, i.config.copyBtn) ? H((P(), S(o, {
1119
+ key: 3,
1120
+ type: a.menuText("primary"),
1121
+ icon: a.crud.getBtnIcon("copyBtn"),
1122
+ size: a.crud.isMediumSize,
1123
+ disabled: e.btnDisabled,
1124
+ onClick: U((e) => a.crud.rowCopy(n), ["stop"])
1125
+ }, {
1126
+ default: V(() => [a.isIconMenu ? C("v-if", !0) : (P(), w(x, { key: 0 }, [D(B(a.crud.menuIcon("copyBtn")), 1)], 64))]),
1127
+ _: 1
1128
+ }, 8, [
1129
+ "type",
1130
+ "icon",
1131
+ "size",
1132
+ "disabled",
1133
+ "onClick"
1134
+ ])), [[d, a.crud.getPermission("copyBtn", n, r)]]) : C("v-if", !0),
1135
+ a.optVal(a.crud.tableOption.delBtn, i.config.delBtn) && !n.$cellEdit ? H((P(), S(o, {
1136
+ key: 4,
1137
+ type: a.menuText("danger"),
1138
+ icon: a.crud.getBtnIcon("delBtn"),
1139
+ size: a.crud.isMediumSize,
1140
+ disabled: e.btnDisabled,
1141
+ onClick: U((e) => a.crud.rowDel(n, r), ["stop"])
1142
+ }, {
1143
+ default: V(() => [a.isIconMenu ? C("v-if", !0) : (P(), w(x, { key: 0 }, [D(B(a.crud.menuIcon("delBtn")), 1)], 64))]),
1144
+ _: 1
1145
+ }, 8, [
1146
+ "type",
1147
+ "icon",
1148
+ "size",
1149
+ "disabled",
1150
+ "onClick"
1151
+ ])), [[d, a.crud.getPermission("delBtn", n, r)]]) : C("v-if", !0)
1152
+ ], 64)) : C("v-if", !0), I(e.$slots, "menu", {
1153
+ row: n,
1154
+ type: a.menuText("primary"),
1155
+ disabled: a.crud.btnDisabled,
1156
+ size: a.crud.isMediumSize,
1157
+ index: r
1158
+ })]),
1159
+ _: 3
1160
+ }, 8, [
1161
+ "fixed",
1162
+ "label",
1163
+ "align",
1164
+ "header-align",
1165
+ "width"
1166
+ ])) : C("v-if", !0)], 2112);
1167
+ }
1168
+ var we = /* @__PURE__ */ e(Se, [["render", Ce]]), Te = {
1169
+ name: "TablePage",
1170
+ inject: ["crud"],
1171
+ data() {
1172
+ return { defaultPage: {
1173
+ single: !1,
1174
+ total: 0,
1175
+ pagerCount: 7,
1176
+ currentPage: 1,
1177
+ pageSize: 10,
1178
+ pageSizes: [
1179
+ 10,
1180
+ 20,
1181
+ 30,
1182
+ 40,
1183
+ 50,
1184
+ 100
1185
+ ],
1186
+ layout: "total, sizes, prev, pager, next, jumper",
1187
+ background: !0
1188
+ } };
1189
+ },
1190
+ computed: { pageFlag() {
1191
+ return this.defaultPage.total !== 0;
1192
+ } },
1193
+ watch: {
1194
+ "crud.page": {
1195
+ handler() {
1196
+ this.pageInit();
1197
+ },
1198
+ deep: !0
1199
+ },
1200
+ pageFlag() {
1201
+ this.crud.getTableHeight();
1202
+ },
1203
+ "defaultPage.total"() {
1204
+ 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));
1205
+ }
1206
+ },
1207
+ created() {
1208
+ this.crud.isMobile && (this.defaultPage.layout = "total, sizes, prev, pager, next"), this.pageInit(), this.crud.$emit("on-load", this.defaultPage);
1209
+ },
1210
+ methods: {
1211
+ optVal: s,
1212
+ pageInit() {
1213
+ this.defaultPage = Object.assign(this.defaultPage, this.crud.page), this.updateValue();
1214
+ },
1215
+ updateValue() {
1216
+ this.crud.$emit("update:page", this.defaultPage);
1217
+ },
1218
+ nextClick(e) {
1219
+ this.crud.$emit("next-click", e);
1220
+ },
1221
+ prevClick(e) {
1222
+ this.crud.$emit("prev-click", e);
1223
+ },
1224
+ sizeChange(e) {
1225
+ this.defaultPage.currentPage = 1, this.defaultPage.pageSize = e, this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("size-change", e);
1226
+ },
1227
+ currentChange(e) {
1228
+ this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("current-change", e);
1229
+ }
1230
+ }
1231
+ };
1232
+ function Ee(e, t, n, r, i, a) {
1233
+ let o = L("ElPagination"), s = L("ElCard");
1234
+ return a.pageFlag && a.optVal(a.crud.tableOption.page, !0) ? (P(), S(s, {
1235
+ key: 0,
1236
+ shadow: a.crud.isCard,
1237
+ class: "avue-pagination"
1238
+ }, {
1239
+ default: V(() => [I(e.$slots, "page"), O(o, {
1240
+ "current-page": i.defaultPage.currentPage,
1241
+ "onUpdate:currentPage": t[0] || (t[0] = (e) => i.defaultPage.currentPage = e),
1242
+ small: a.crud.size === "mini",
1243
+ style: { "margin-top": "25px" },
1244
+ disabled: i.defaultPage.disabled,
1245
+ "hide-on-single-page": i.defaultPage.single,
1246
+ "pager-count": i.defaultPage.pagerCount,
1247
+ background: i.defaultPage.background,
1248
+ "page-size": i.defaultPage.pageSize,
1249
+ "page-sizes": i.defaultPage.pageSizes,
1250
+ layout: i.defaultPage.layout,
1251
+ total: i.defaultPage.total,
1252
+ onSizeChange: a.sizeChange,
1253
+ onPrevClick: a.prevClick,
1254
+ onNextClick: a.nextClick,
1255
+ onCurrentChange: a.currentChange
1256
+ }, null, 8, [
1257
+ "current-page",
1258
+ "small",
1259
+ "disabled",
1260
+ "hide-on-single-page",
1261
+ "pager-count",
1262
+ "background",
1263
+ "page-size",
1264
+ "page-sizes",
1265
+ "layout",
1266
+ "total",
1267
+ "onSizeChange",
1268
+ "onPrevClick",
1269
+ "onNextClick",
1270
+ "onCurrentChange"
1271
+ ])]),
1272
+ _: 3
1273
+ }, 8, ["shadow"])) : C("v-if", !0);
1274
+ }
1275
+ var De = /* @__PURE__ */ e(Te, [["render", Ee]]), Oe = {
1276
+ name: "FyDialogForm",
1277
+ inject: ["crud"],
1278
+ data() {
1279
+ return {
1280
+ disabled: !1,
1281
+ boxType: "",
1282
+ fullscreen: !1,
1283
+ size: null,
1284
+ boxVisible: !1
1285
+ };
1286
+ },
1287
+ computed: {
1288
+ option() {
1289
+ let e = r(this.crud.tableOption);
1290
+ return e.boxType = this.boxType, e.column = r(this.crud.propOption), e.menuBtn = !1, this.isAdd ? (e.submitBtn = e.saveBtn, e.submitText = this.crud.menuIcon("saveBtn"), e.submitIcon = this.crud.getBtnIcon("saveBtn")) : this.isEdit ? (e.submitBtn = e.updateBtn, e.submitText = this.crud.menuIcon("updateBtn"), e.submitIcon = this.crud.getBtnIcon("updateBtn")) : this.isView && (e.detail = !0), e.emptyBtn = e.cancelBtn, e.emptyText = this.crud.menuIcon("cancelBtn"), e.emptyIcon = this.crud.getBtnIcon("cancelBtn"), this.crud.isGroup || (e.dicFlag = !1, e.dicData = this.crud.DIC), W(e.dicFlag) || e.column.forEach((t) => {
1291
+ t.boxType = this.boxType, t.dicFlag = t.dicFlag || e.dicFlag;
1292
+ }), e;
1293
+ },
1294
+ isView() {
1295
+ return this.boxType === "view";
1296
+ },
1297
+ isAdd() {
1298
+ return this.boxType === "add";
1299
+ },
1300
+ isEdit() {
1301
+ return this.boxType === "edit";
1302
+ },
1303
+ direction() {
1304
+ return this.crud.tableOption.dialogDirection;
1305
+ },
1306
+ width() {
1307
+ return s(`${this.crud.tableOption.dialogWidth}`, this.crud.isMobile ? "100%" : `${G.dialogWidth}`);
1308
+ },
1309
+ dialogType() {
1310
+ return this.isDrawer ? "ElDrawer" : "ElementDialog";
1311
+ },
1312
+ dialogTop() {
1313
+ return !this.isDrawer && !this.fullscreen ? this.crud.tableOption.dialogTop : "0";
1314
+ },
1315
+ isDrawer() {
1316
+ return this.crud.tableOption.dialogType === "drawer";
1317
+ },
1318
+ params() {
1319
+ return this.isDrawer ? {
1320
+ size: this.fullscreen ? "100%" : this.width,
1321
+ direction: this.crud.tableOption.dialogDirection
1322
+ } : {
1323
+ width: this.width,
1324
+ fullscreen: this.fullscreen
1325
+ };
1326
+ },
1327
+ dialogTitle() {
1328
+ let e = `${this.boxType}`;
1329
+ return W(this.boxType) ? "" : this.crud.tableOption[`${e}Title`] || {
1330
+ tipStartTitle: "当前表格已选择",
1331
+ tipEndTitle: "项",
1332
+ editTitle: "编 辑",
1333
+ copyTitle: "复 制",
1334
+ addTitle: "新 增",
1335
+ viewTitle: "查 看",
1336
+ filterTitle: "过滤条件",
1337
+ showTitle: "列显隐"
1338
+ }[`${e}Title`];
1339
+ },
1340
+ dialogMenuPosition() {
1341
+ return this.crud.option.dialogMenuPosition || "right";
1342
+ }
1343
+ },
1344
+ methods: {
1345
+ optVal: s,
1346
+ uploadFun: t,
1347
+ submit() {
1348
+ this.$refs.tableForm.submit();
1349
+ },
1350
+ reset() {
1351
+ this.$refs.tableForm.resetForm(!1);
1352
+ },
1353
+ getSlotName(e) {
1354
+ return e.replace("Form", "");
1355
+ },
1356
+ initFun() {
1357
+ [
1358
+ "clearValidate",
1359
+ "validate",
1360
+ "resetForm",
1361
+ "validateField"
1362
+ ].forEach((e) => {
1363
+ this.crud[e] = this.$refs.tableForm[e];
1364
+ });
1365
+ },
1366
+ handleChange() {
1367
+ this.crud.setVal();
1368
+ },
1369
+ handleTabClick(e, t) {
1370
+ this.crud.$emit("tab-click", e, t);
1371
+ },
1372
+ handleFullScreen() {
1373
+ this.isDrawer && (W(this.size) ? this.size = "100%" : this.size = ""), this.fullscreen = !this.fullscreen;
1374
+ },
1375
+ handleError(e) {
1376
+ this.crud.$emit("error", e);
1377
+ },
1378
+ handleSubmit(e, t) {
1379
+ this.isAdd ? this.rowSave(t) : this.isEdit && this.rowUpdate(t);
1380
+ },
1381
+ rowSave(e) {
1382
+ this.crud.$emit("row-save", a(this.crud.tableForm, ["$"]), this.closeDialog, e);
1383
+ },
1384
+ rowUpdate(e) {
1385
+ this.crud.$emit("row-update", a(this.crud.tableForm, ["$"]), this.crud.tableIndex, this.closeDialog, e);
1386
+ },
1387
+ closeDialog(e) {
1388
+ e = r(e), e && (() => {
1389
+ if (this.isEdit) {
1390
+ let { parentList: t, index: n } = this.crud.findData(e[this.crud.rowKey]);
1391
+ if (t) {
1392
+ let r = t.splice(n, 1)[0];
1393
+ e[this.crud.childrenKey] = r[this.crud.childrenKey], t.splice(n, 0, e);
1394
+ }
1395
+ } else if (this.isAdd) {
1396
+ let { item: t } = this.crud.findData(e[this.crud.rowParentKey]);
1397
+ t ? (t[this.crud.childrenKey] || this.$set(t, this.crud.childrenKey, []), this.crud.tableOption.lazy && this.$set(t, this.crud.hasChildrenKey, !0), t[this.crud.childrenKey].push(e)) : this.crud.list.push(e);
1398
+ }
1399
+ })(), this.hide();
1400
+ },
1401
+ hide(e) {
1402
+ let t = () => {
1403
+ e == null || e(), this.crud.tableIndex = -1, this.crud.tableForm = {}, this.crud.setVal(), this.boxVisible = !1;
1404
+ };
1405
+ typeof this.crud.beforeClose == "function" ? this.crud.beforeClose(t, this.boxType) : t();
1406
+ },
1407
+ show(e) {
1408
+ this.boxType = e;
1409
+ let t = () => {
1410
+ this.fullscreen = this.crud.tableOption.dialogFullscreen, this.boxVisible = !0, this.$nextTick(() => {
1411
+ this.initFun();
1412
+ });
1413
+ };
1414
+ typeof this.crud.beforeOpen == "function" ? this.crud.beforeOpen(t, this.boxType) : t();
1415
+ }
1416
+ }
1417
+ };
1418
+ function ke(e, t, n, r, i, a) {
1419
+ let o = L("FyForm"), s = L("ElButton");
1420
+ return i.boxVisible ? (P(), S(z(a.dialogType), A({
1421
+ key: 0,
1422
+ visible: i.boxVisible,
1423
+ "onUpdate:visible": t[2] || (t[2] = (e) => i.boxVisible = e),
1424
+ "lock-scroll": "",
1425
+ "show-full-screen": "",
1426
+ "destroy-on-close": a.crud.tableOption.dialogDestroy,
1427
+ "wrapper-closable": a.crud.tableOption.dialogClickModal,
1428
+ direction: a.direction,
1429
+ class: "dialog-form",
1430
+ "custom-class": a.crud.tableOption.dialogCustomClass,
1431
+ "modal-append-to-body": "",
1432
+ "append-to-body": "",
1433
+ top: a.dialogTop,
1434
+ title: a.dialogTitle,
1435
+ "close-on-press-escape": a.crud.tableOption.dialogEscape,
1436
+ "close-on-click-modal": a.optVal(a.crud.tableOption.dialogClickModal, !1),
1437
+ modal: a.crud.tableOption.dialogModal,
1438
+ "show-close": a.crud.tableOption.dialogCloseBtn
1439
+ }, a.params, { "before-close": a.hide }), {
1440
+ default: V(() => [O(o, A({
1441
+ ref: "tableForm",
1442
+ modelValue: a.crud.tableForm,
1443
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => a.crud.tableForm = e),
1444
+ status: i.disabled,
1445
+ "onUpdate:status": t[1] || (t[1] = (e) => i.disabled = e)
1446
+ }, a.uploadFun({}, a.crud), {
1447
+ option: a.option,
1448
+ onChange: a.handleChange,
1449
+ onSubmit: a.handleSubmit,
1450
+ onResetChange: a.hide,
1451
+ onTabClick: a.handleTabClick,
1452
+ onError: a.handleError
1453
+ }), E({ _: 2 }, [F(a.crud.formSlot, (t) => ({
1454
+ name: a.getSlotName(t),
1455
+ fn: V((n) => [I(e.$slots, t, M(k(Object.assign(n, { type: i.boxType }))))])
1456
+ }))]), 1040, [
1457
+ "modelValue",
1458
+ "status",
1459
+ "option",
1460
+ "onChange",
1461
+ "onSubmit",
1462
+ "onResetChange",
1463
+ "onTabClick",
1464
+ "onError"
1465
+ ]), T("span", { class: j(["avue-dialog__footer", `avue-dialog__footer--${a.dialogMenuPosition}`]) }, [
1466
+ a.optVal(a.option.submitBtn, !0) && !a.isView ? (P(), S(s, {
1467
+ key: 0,
1468
+ loading: i.disabled,
1469
+ size: a.crud.controlSize,
1470
+ icon: a.option.submitIcon,
1471
+ type: "primary",
1472
+ onClick: a.submit
1473
+ }, {
1474
+ default: V(() => [D(B(a.option.submitText), 1)]),
1475
+ _: 1
1476
+ }, 8, [
1477
+ "loading",
1478
+ "size",
1479
+ "icon",
1480
+ "onClick"
1481
+ ])) : C("v-if", !0),
1482
+ a.optVal(a.option.emptyBtn, !0) && !a.isView ? (P(), S(s, {
1483
+ key: 1,
1484
+ disabled: i.disabled,
1485
+ size: a.crud.controlSize,
1486
+ icon: a.option.emptyIcon,
1487
+ onClick: a.reset
1488
+ }, {
1489
+ default: V(() => [D(B(a.option.emptyText), 1)]),
1490
+ _: 1
1491
+ }, 8, [
1492
+ "disabled",
1493
+ "size",
1494
+ "icon",
1495
+ "onClick"
1496
+ ])) : C("v-if", !0),
1497
+ I(e.$slots, "menuForm", {
1498
+ disabled: i.disabled,
1499
+ size: a.crud.controlSize,
1500
+ type: i.boxType
1501
+ })
1502
+ ], 2)]),
1503
+ _: 3
1504
+ }, 16, [
1505
+ "visible",
1506
+ "destroy-on-close",
1507
+ "wrapper-closable",
1508
+ "direction",
1509
+ "custom-class",
1510
+ "top",
1511
+ "title",
1512
+ "close-on-press-escape",
1513
+ "close-on-click-modal",
1514
+ "modal",
1515
+ "show-close",
1516
+ "before-close"
1517
+ ])) : C("v-if", !0);
1518
+ }
1519
+ var Ae = /* @__PURE__ */ e(Oe, [["render", ke]]), je = {
1520
+ name: "DialogColumn",
1521
+ inject: ["crud"],
1522
+ data() {
1523
+ return {
1524
+ data: [],
1525
+ columnBox: !1
1526
+ };
1527
+ },
1528
+ computed: { defaultColumn() {
1529
+ return [
1530
+ {
1531
+ label: "隐藏",
1532
+ prop: "hide"
1533
+ },
1534
+ {
1535
+ label: "冻结",
1536
+ prop: "fixed"
1537
+ },
1538
+ {
1539
+ label: "过滤",
1540
+ prop: "filters"
1541
+ },
1542
+ {
1543
+ label: "排序",
1544
+ prop: "sortable"
1545
+ },
1546
+ {
1547
+ label: "序号",
1548
+ prop: "index",
1549
+ hide: !0
1550
+ },
1551
+ {
1552
+ label: "宽度",
1553
+ prop: "width",
1554
+ hide: !0
1555
+ }
1556
+ ];
1557
+ } },
1558
+ methods: {
1559
+ handleShow() {
1560
+ this.data = [], this.crud.propOption.forEach((e) => {
1561
+ e.showColumn !== !1 && this.data.push(e);
1562
+ }), this.columnBox = !0, this.$nextTick(() => this.rowDrop());
1563
+ },
1564
+ handleChange(e) {
1565
+ ["hide", "filters"].includes(e) && this.crud.refreshTable();
1566
+ },
1567
+ rowDrop() {
1568
+ let e = this.$refs.table.$el.querySelectorAll(G.dropRowClass)[0];
1569
+ this.crud.tableDrop("column", e, (e) => {
1570
+ let t = e.oldIndex, n = e.newIndex;
1571
+ this.crud.headerSort(t, n), this.crud.refreshTable(() => this.rowDrop());
1572
+ });
1573
+ }
1574
+ }
1575
+ }, Me = { key: 0 };
1576
+ function Ne(e, t, n, r, i, a) {
1577
+ let o = L("ElTableColumn"), s = L("ElCheckbox"), c = L("ElTable"), l = L("ElDrawer");
1578
+ return i.columnBox ? (P(), w("div", Me, [O(l, {
1579
+ visible: i.columnBox,
1580
+ "onUpdate:visible": t[0] || (t[0] = (e) => i.columnBox = e),
1581
+ class: "avue-crud__dialog avue-crud__column avue-dialog",
1582
+ "lock-scroll": "",
1583
+ "append-to-body": "",
1584
+ title: "列显隐",
1585
+ size: a.crud.isMobile ? "100%" : "40%"
1586
+ }, {
1587
+ default: V(() => [O(c, {
1588
+ ref: "table",
1589
+ data: i.data,
1590
+ height: "100%",
1591
+ size: "small",
1592
+ border: ""
1593
+ }, {
1594
+ default: V(() => [O(o, {
1595
+ key: "label",
1596
+ align: "center",
1597
+ width: "100",
1598
+ "header-align": "center",
1599
+ prop: "label",
1600
+ label: "列名"
1601
+ }), (P(!0), w(x, null, F(a.defaultColumn, (e, t) => (P(), w(x, null, [e.hide === !0 ? C("v-if", !0) : (P(), S(o, {
1602
+ key: t,
1603
+ label: e.label,
1604
+ prop: e.prop,
1605
+ align: "center",
1606
+ "header-align": "center"
1607
+ }, {
1608
+ default: V(({ row: t }) => [O(s, {
1609
+ modelValue: a.crud.objectOption[t.prop][e.prop],
1610
+ "onUpdate:modelValue": (n) => a.crud.objectOption[t.prop][e.prop] = n,
1611
+ onChange: (t) => a.handleChange(e.prop)
1612
+ }, null, 8, [
1613
+ "modelValue",
1614
+ "onUpdate:modelValue",
1615
+ "onChange"
1616
+ ])]),
1617
+ _: 2
1618
+ }, 1032, ["label", "prop"]))], 64))), 256))]),
1619
+ _: 1
1620
+ }, 8, ["data"])]),
1621
+ _: 1
1622
+ }, 8, ["visible", "size"])])) : C("v-if", !0);
1623
+ }
1624
+ var Pe = /* @__PURE__ */ e(je, [["render", Ne]]), $ = {
1625
+ name: "DialogExcel",
1626
+ inject: ["crud"],
1627
+ data() {
1628
+ return {
1629
+ option: {},
1630
+ columnOption: {},
1631
+ box: !1,
1632
+ form: { name: this.crud.tableOption.title }
1633
+ };
1634
+ },
1635
+ methods: {
1636
+ handleShow() {
1637
+ this.getColumnOption(), this.getOption(), this.box = !0;
1638
+ },
1639
+ handleSubmit() {
1640
+ this.$Export.excel({
1641
+ title: this.form.name,
1642
+ columns: this.getColumn(),
1643
+ data: this.handleSum()
1644
+ }), this.box = !1;
1645
+ },
1646
+ handleSum() {
1647
+ let e = this.crud.tableOption, t = this.crud.propOption, n = this.form.type ? this.crud.list : this.crud.tableSelect, i = [];
1648
+ return this.form.params.includes("data") && n.forEach((n) => {
1649
+ let a = r(n);
1650
+ t.forEach((t) => {
1651
+ let n = t.parentProp ? (this.crud.cascaderDIC[t.$index] || {})[t.prop] : this.crud.DIC[t.prop];
1652
+ a[t.prop] = v(a, t, e, n);
1653
+ }), i.push(a);
1654
+ }), this.form.params.includes("sum") && e.showSummary && i.push(this.crud.sumsList), i;
1655
+ },
1656
+ getOption() {
1657
+ this.option = {
1658
+ submitBtn: !1,
1659
+ emptyBtn: !1,
1660
+ column: [
1661
+ {
1662
+ label: "文件名",
1663
+ prop: "name",
1664
+ span: 24
1665
+ },
1666
+ {
1667
+ label: "选择数据",
1668
+ prop: "type",
1669
+ span: 24,
1670
+ type: "select",
1671
+ dicData: [{
1672
+ label: "当前数据(当前页全部的数据)",
1673
+ value: !0
1674
+ }, {
1675
+ label: "选中的数据(当前页选中的数据)",
1676
+ disabled: this.crud.tableOption.selection !== !0,
1677
+ value: !1
1678
+ }]
1679
+ },
1680
+ {
1681
+ label: "选择字段",
1682
+ prop: "prop",
1683
+ type: "tree",
1684
+ multiple: !0,
1685
+ checkStrictly: !0,
1686
+ span: 24,
1687
+ props: { value: "prop" },
1688
+ dicData: this.columnOption
1689
+ },
1690
+ {
1691
+ label: "参数设置",
1692
+ prop: "params",
1693
+ type: "checkbox",
1694
+ span: 24,
1695
+ value: ["header", "data"].concat((() => {
1696
+ let e = [];
1697
+ return this.crud.isHeader && e.push("headers"), this.crud.isShowSummary && e.push("sum"), e;
1698
+ })()),
1699
+ dicData: [{
1700
+ label: "表头",
1701
+ disabled: !0,
1702
+ value: "header"
1703
+ }, {
1704
+ label: "数据源",
1705
+ value: "data"
1706
+ }].concat((() => {
1707
+ let e = [];
1708
+ return e.push({
1709
+ label: "复杂表头",
1710
+ value: "headers",
1711
+ disabled: !this.crud.isHeader
1712
+ }), e.push({
1713
+ label: "合计统计",
1714
+ value: "sum",
1715
+ disabled: !this.crud.isShowSummary
1716
+ }), e;
1717
+ })())
1718
+ }
1719
+ ]
1720
+ }, this.form.type = this.crud.selectLen === 0;
1721
+ },
1722
+ getColumnOption() {
1723
+ let e = r(this.crud.columnOption), t = [], n = (e = []) => {
1724
+ e.forEach((r, i) => {
1725
+ let a = r.children;
1726
+ a && !Array.isArray(a) ? delete r.children : r.showColumn === !1 ? e.splice(i, 1) : (t.push(r.prop), r.children && n(a));
1727
+ });
1728
+ };
1729
+ n(e), this.columnOption = e, this.form.prop = t;
1730
+ },
1731
+ getColumn() {
1732
+ let e = r(this.columnOption), t = this.$refs.form.getPropRef("prop").$refs.temp.getHalfList();
1733
+ if (!this.form.params) return [];
1734
+ if (this.form.params.includes("headers")) {
1735
+ let n = (e = []) => {
1736
+ e.forEach((r, i) => {
1737
+ t.includes(r.prop) ? r.children && n(r.children) : e.splice(i, 1);
1738
+ });
1739
+ };
1740
+ return n(e), e;
1741
+ } else {
1742
+ let n = [], r = (e = []) => {
1743
+ e.forEach((e) => {
1744
+ e.children ? r(e.children) : t.includes(e.prop) && n.push(e);
1745
+ });
1746
+ };
1747
+ return r(e), n;
1748
+ }
1749
+ }
1750
+ }
1751
+ }, Fe = { key: 0 }, Ie = { class: "dialog-footer" };
1752
+ function Le(e, t, n, r, i, a) {
1753
+ let o = L("FyForm"), s = L("ElButton"), c = L("ElementDialog");
1754
+ return i.box ? (P(), w("div", Fe, [O(c, {
1755
+ visible: i.box,
1756
+ "onUpdate:visible": t[2] || (t[2] = (e) => i.box = e),
1757
+ title: "导出",
1758
+ "lock-scroll": "",
1759
+ class: "avue-dialog",
1760
+ width: a.crud.isMobile ? "100%" : "30%"
1761
+ }, {
1762
+ footer: V(() => [T("span", Ie, [O(s, {
1763
+ type: "primary",
1764
+ size: a.crud.isMediumSize,
1765
+ onClick: a.handleSubmit
1766
+ }, {
1767
+ default: V(() => [...t[3] || (t[3] = [D("确定", -1)])]),
1768
+ _: 1
1769
+ }, 8, ["size", "onClick"]), O(s, {
1770
+ size: a.crud.isMediumSize,
1771
+ onClick: t[1] || (t[1] = (e) => i.box = !1)
1772
+ }, {
1773
+ default: V(() => [...t[4] || (t[4] = [D("取消", -1)])]),
1774
+ _: 1
1775
+ }, 8, ["size"])])]),
1776
+ default: V(() => [O(o, {
1777
+ modelValue: i.form,
1778
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => i.form = e),
1779
+ option: i.option
1780
+ }, null, 8, ["modelValue", "option"])]),
1781
+ _: 1
1782
+ }, 8, ["visible", "width"])])) : C("v-if", !0);
1783
+ }
1784
+ var Re = /* @__PURE__ */ e($, [["render", Le]]), ze = {
1785
+ name: "DialogFilter",
1786
+ inject: ["crud"],
1787
+ data() {
1788
+ return {
1789
+ box: !1,
1790
+ columnObj: {},
1791
+ symbolDic: [
1792
+ {
1793
+ label: "=",
1794
+ value: "="
1795
+ },
1796
+ {
1797
+ label: "≠",
1798
+ value: "≠"
1799
+ },
1800
+ {
1801
+ label: "like",
1802
+ value: "like"
1803
+ },
1804
+ {
1805
+ label: ">",
1806
+ value: ">"
1807
+ },
1808
+ {
1809
+ label: "≥",
1810
+ value: "≥"
1811
+ },
1812
+ {
1813
+ label: "<",
1814
+ value: "<"
1815
+ },
1816
+ {
1817
+ label: "≤",
1818
+ value: "≤"
1819
+ },
1820
+ {
1821
+ label: "∈",
1822
+ value: "∈"
1823
+ }
1824
+ ],
1825
+ list: [],
1826
+ columnOption: {}
1827
+ };
1828
+ },
1829
+ methods: {
1830
+ handleShow() {
1831
+ this.getColumnOption(), this.box = !0;
1832
+ },
1833
+ getColumnOption() {
1834
+ let e = [];
1835
+ r(this.crud.propOption).forEach((t) => {
1836
+ t.showColumn !== !1 && e.push(Object.assign(t, { value: t.prop }));
1837
+ }), this.columnOption = e, this.columnObj = this.columnOption[0];
1838
+ },
1839
+ handleDelete(e) {
1840
+ this.list.splice(e, 1);
1841
+ },
1842
+ handleClear() {
1843
+ this.list = [];
1844
+ },
1845
+ handleValueClear() {
1846
+ this.list.forEach((e) => {
1847
+ e.value = "";
1848
+ });
1849
+ },
1850
+ handleSubmit() {
1851
+ let e = [];
1852
+ this.list.forEach((t) => {
1853
+ e.push([
1854
+ t.text,
1855
+ t.symbol,
1856
+ t.value
1857
+ ]);
1858
+ }), this.crud.$emit("filter", e), this.box = !1;
1859
+ },
1860
+ handleChange(e) {
1861
+ this.list[e].value = "";
1862
+ },
1863
+ handleAdd() {
1864
+ let e = this.columnObj.prop;
1865
+ this.list.push({
1866
+ text: e,
1867
+ value: "",
1868
+ symbol: this.symbolDic[0].value
1869
+ });
1870
+ }
1871
+ }
1872
+ }, Be = { key: 0 }, Ve = { class: "avue-crud__filter-menu" };
1873
+ function He(e, t, n, r, i, a) {
1874
+ let o = L("ElButton"), s = L("ElButtonGroup"), c = L("FySelect"), l = L("FyInput"), u = L("ElCol"), d = L("ElRow"), f = L("ElDrawer");
1875
+ return i.box ? (P(), w("div", Be, [O(f, {
1876
+ visible: i.box,
1877
+ "onUpdate:visible": t[1] || (t[1] = (e) => i.box = e),
1878
+ class: j([["avue-crud__dialog", "avue-crud__filter"], "avue-dialog"]),
1879
+ "lock-scroll": "",
1880
+ "append-to-body": "",
1881
+ title: "过滤条件",
1882
+ size: a.crud.isMobile ? "100%" : "60%"
1883
+ }, {
1884
+ default: V(() => [O(d, { span: 24 }, {
1885
+ default: V(() => [
1886
+ T("div", Ve, [O(s, null, {
1887
+ default: V(() => [
1888
+ O(o, {
1889
+ type: "primary",
1890
+ size: a.crud.isMediumSize,
1891
+ onClick: a.handleAdd
1892
+ }, {
1893
+ default: V(() => [...t[2] || (t[2] = [D(" 新增条件 ", -1)])]),
1894
+ _: 1
1895
+ }, 8, ["size", "onClick"]),
1896
+ O(o, {
1897
+ type: "primary",
1898
+ size: a.crud.isMediumSize,
1899
+ onClick: a.handleClear
1900
+ }, {
1901
+ default: V(() => [...t[3] || (t[3] = [D(" 清空条件 ", -1)])]),
1902
+ _: 1
1903
+ }, 8, ["size", "onClick"]),
1904
+ O(o, {
1905
+ type: "primary",
1906
+ size: a.crud.isMediumSize,
1907
+ onClick: a.handleValueClear
1908
+ }, {
1909
+ default: V(() => [...t[4] || (t[4] = [D(" 清空数据 ", -1)])]),
1910
+ _: 1
1911
+ }, 8, ["size", "onClick"])
1912
+ ]),
1913
+ _: 1
1914
+ })]),
1915
+ (P(!0), w(x, null, F(i.list, (e, t) => (P(), S(u, {
1916
+ key: t,
1917
+ md: 12,
1918
+ xs: 24,
1919
+ sm: 12,
1920
+ class: "avue-crud__filter-item"
1921
+ }, {
1922
+ default: V(() => [
1923
+ O(c, {
1924
+ modelValue: e.text,
1925
+ "onUpdate:modelValue": (t) => e.text = t,
1926
+ dic: i.columnOption,
1927
+ clearable: !1,
1928
+ size: a.crud.isMediumSize,
1929
+ class: "avue-crud__filter-label",
1930
+ onChange: (e) => a.handleChange(t)
1931
+ }, null, 8, [
1932
+ "modelValue",
1933
+ "onUpdate:modelValue",
1934
+ "dic",
1935
+ "size",
1936
+ "onChange"
1937
+ ]),
1938
+ O(c, {
1939
+ modelValue: e.symbol,
1940
+ "onUpdate:modelValue": (t) => e.symbol = t,
1941
+ class: "avue-crud__filter-symbol",
1942
+ dic: i.symbolDic,
1943
+ clearable: !1,
1944
+ size: a.crud.isMediumSize
1945
+ }, null, 8, [
1946
+ "modelValue",
1947
+ "onUpdate:modelValue",
1948
+ "dic",
1949
+ "size"
1950
+ ]),
1951
+ O(l, {
1952
+ modelValue: e.value,
1953
+ "onUpdate:modelValue": (t) => e.value = t,
1954
+ size: a.crud.isMediumSize,
1955
+ class: "avue-crud__filter-value"
1956
+ }, null, 8, [
1957
+ "modelValue",
1958
+ "onUpdate:modelValue",
1959
+ "size"
1960
+ ]),
1961
+ O(o, {
1962
+ type: "danger",
1963
+ class: "avue-crud__filter-icon",
1964
+ size: "mini",
1965
+ circle: "",
1966
+ icon: "el-icon-minus",
1967
+ onClick: (e) => a.handleDelete(t)
1968
+ }, null, 8, ["onClick"])
1969
+ ]),
1970
+ _: 2
1971
+ }, 1024))), 128)),
1972
+ O(u, {
1973
+ span: 24,
1974
+ class: "avue-form__menu avue-form__menu--right"
1975
+ }, {
1976
+ default: V(() => [O(o, {
1977
+ type: "primary",
1978
+ size: a.crud.isMediumSize,
1979
+ onClick: a.handleSubmit
1980
+ }, {
1981
+ default: V(() => [...t[5] || (t[5] = [D(" 确 定 ", -1)])]),
1982
+ _: 1
1983
+ }, 8, ["size", "onClick"]), O(o, {
1984
+ size: a.crud.isMediumSize,
1985
+ onClick: t[0] || (t[0] = (e) => i.box = !1)
1986
+ }, {
1987
+ default: V(() => [...t[6] || (t[6] = [D(" 取 消 ", -1)])]),
1988
+ _: 1
1989
+ }, 8, ["size"])]),
1990
+ _: 1
1991
+ })
1992
+ ]),
1993
+ _: 1
1994
+ })]),
1995
+ _: 1
1996
+ }, 8, ["visible", "size"])])) : C("v-if", !0);
1997
+ }
1998
+ //#endregion
1999
+ //#region src/components/fy-from/crud/FyCurd.vue
2000
+ var Ue = {
2001
+ name: "FyCurd",
2002
+ components: {
2003
+ DialogFilter: /* @__PURE__ */ e(ze, [["render", He]]),
2004
+ DialogExcel: Re,
2005
+ DialogColumn: Pe,
2006
+ FyDialogForm: Ae,
2007
+ TablePage: De,
2008
+ ColumnMenu: we,
2009
+ ColumnDefault: xe,
2010
+ Column: ve,
2011
+ HeaderMenu: ie,
2012
+ HeaderSearch: re
2013
+ },
2014
+ directives: { permission: h },
2015
+ mixins: [_],
2016
+ provide() {
2017
+ return { crud: this };
2018
+ },
2019
+ props: {
2020
+ spanMethod: Function,
2021
+ summaryMethod: Function,
2022
+ rowStyle: Function,
2023
+ cellStyle: Function,
2024
+ beforeClose: Function,
2025
+ beforeOpen: Function,
2026
+ rowClassName: Function,
2027
+ cellClassName: Function,
2028
+ headerCellClassName: Function,
2029
+ uploadBefore: Function,
2030
+ uploadAfter: Function,
2031
+ uploadDelete: Function,
2032
+ uploadPreview: Function,
2033
+ uploadError: Function,
2034
+ uploadExceed: Function,
2035
+ permission: {
2036
+ type: [Function, Object],
2037
+ default: () => ({})
2038
+ },
2039
+ value: {
2040
+ type: Object,
2041
+ default: () => ({})
2042
+ },
2043
+ search: {
2044
+ type: Object,
2045
+ default() {
2046
+ return {};
2047
+ }
2048
+ },
2049
+ page: {
2050
+ type: Object,
2051
+ default() {
2052
+ return {};
2053
+ }
2054
+ },
2055
+ tableLoading: {
2056
+ type: Boolean,
2057
+ default: !1
2058
+ },
2059
+ disabled: {
2060
+ type: Boolean,
2061
+ default: !1
2062
+ },
2063
+ data: {
2064
+ type: Array,
2065
+ default: () => []
2066
+ }
2067
+ },
2068
+ data() {
2069
+ return {
2070
+ reload: Math.random(),
2071
+ cellForm: { list: [] },
2072
+ config: G,
2073
+ list: [],
2074
+ listError: {},
2075
+ tableForm: {},
2076
+ tableHeight: void 0,
2077
+ tableIndex: -1,
2078
+ tableSelect: [],
2079
+ sumsList: {},
2080
+ cascaderIndexList: [],
2081
+ cascaderDicList: {},
2082
+ cascaderFormList: {},
2083
+ btnDisabledList: {},
2084
+ btnDisabled: !1,
2085
+ default: {}
2086
+ };
2087
+ },
2088
+ computed: {
2089
+ isHeightAuto() {
2090
+ return this.tableOption.height === "auto";
2091
+ },
2092
+ isSortable() {
2093
+ return this.tableOption.sortable;
2094
+ },
2095
+ isRowSort() {
2096
+ return this.tableOption.rowSort;
2097
+ },
2098
+ isColumnSort() {
2099
+ return this.tableOption.columnSort;
2100
+ },
2101
+ rowParentKey() {
2102
+ return this.option.rowParentKey || n.rowParentKey;
2103
+ },
2104
+ childrenKey() {
2105
+ return this.treeProps.children || n.children;
2106
+ },
2107
+ hasChildrenKey() {
2108
+ return this.treeProps.hasChildren || n.hasChildren;
2109
+ },
2110
+ treeProps() {
2111
+ return this.tableOption.treeProps || {};
2112
+ },
2113
+ isAutoHeight() {
2114
+ return this.tableOption.height === "auto";
2115
+ },
2116
+ formSlot() {
2117
+ return this.getSlotList([
2118
+ "Error",
2119
+ "Label",
2120
+ "Type",
2121
+ "Form"
2122
+ ], this.$slots, this.propOption);
2123
+ },
2124
+ searchSlot() {
2125
+ return this.getSlotList(["Search"], this.$slots, this.propOption);
2126
+ },
2127
+ mainSlot() {
2128
+ let e = [];
2129
+ return this.propOption.forEach((t) => {
2130
+ this.$slots[t.prop] && e.push(t.prop);
2131
+ }), this.getSlotList(["Header", "Form"], this.$slots, this.propOption).concat(e);
2132
+ },
2133
+ calcHeight() {
2134
+ return (this.tableOption.calcHeight || 0) + this.$AVUE.calcHeight;
2135
+ },
2136
+ propOption() {
2137
+ let e = [];
2138
+ function t(n = []) {
2139
+ Array.isArray(n) && n.forEach((n) => {
2140
+ Array.isArray(n.children) ? t(n.children) : e.push(n);
2141
+ });
2142
+ }
2143
+ return t(this.columnOption), e = p(e), e;
2144
+ },
2145
+ isShowSummary() {
2146
+ return this.option.showSummary;
2147
+ },
2148
+ isHeader() {
2149
+ let e = !1;
2150
+ return this.columnOption.forEach((t) => {
2151
+ t.children && (e = !0);
2152
+ }), e;
2153
+ },
2154
+ isTree() {
2155
+ let e = !1;
2156
+ return this.data.forEach((t) => {
2157
+ t.children && (e = !0);
2158
+ }), e;
2159
+ },
2160
+ isCard() {
2161
+ return this.option.card ? "always" : "never";
2162
+ },
2163
+ expandLevel() {
2164
+ return this.parentOption.expandLevel || 0;
2165
+ },
2166
+ expandAll() {
2167
+ return this.parentOption.expandAll || !1;
2168
+ },
2169
+ parentOption() {
2170
+ return this.tableOption || {};
2171
+ },
2172
+ columnOption() {
2173
+ return this.tableOption.column || [];
2174
+ },
2175
+ sumColumnList() {
2176
+ return this.tableOption.sumColumnList || [];
2177
+ },
2178
+ selectLen() {
2179
+ return this.tableSelect ? this.tableSelect.length : 0;
2180
+ }
2181
+ },
2182
+ watch: {
2183
+ value: {
2184
+ handler() {
2185
+ this.tableForm = this.value;
2186
+ },
2187
+ immediate: !0,
2188
+ deep: !0
2189
+ },
2190
+ list: {
2191
+ handler() {
2192
+ this.cellForm.list = this.list;
2193
+ },
2194
+ deep: !0
2195
+ },
2196
+ data: {
2197
+ handler() {
2198
+ this.dataInit();
2199
+ },
2200
+ deep: !0
2201
+ }
2202
+ },
2203
+ mounted() {
2204
+ this.dataInit(), this.getTableHeight(), this.refreshTable();
2205
+ },
2206
+ methods: {
2207
+ setPx: c,
2208
+ optVal: s,
2209
+ handleValidate(e, t, n) {
2210
+ this.listError[e] || this.$set(this.listError, e, {
2211
+ valid: !1,
2212
+ msg: ""
2213
+ }), this.listError[e].valid = !t, this.listError[e].msg = n;
2214
+ },
2215
+ getPermission(e, t, n) {
2216
+ return typeof this.permission == "function" ? this.permission(e, t, n) : W(this.permission[e]) ? !0 : this.permission[e];
2217
+ },
2218
+ getTableHeight() {
2219
+ this.isAutoHeight ? this.$nextTick(() => {
2220
+ let e = this.$refs.table, t = this.$refs.tablePage;
2221
+ if (!e) return;
2222
+ let n = e.$el, r = t.$el.offsetHeight || 20;
2223
+ this.tableHeight = document.documentElement.clientHeight - n.offsetTop - r - this.calcHeight;
2224
+ }) : this.tableHeight = this.tableOption.height;
2225
+ },
2226
+ doLayout() {
2227
+ this.$refs.table.doLayout();
2228
+ },
2229
+ refreshTable(e) {
2230
+ this.reload = Math.random(), this.$nextTick(() => {
2231
+ e == null || e();
2232
+ });
2233
+ },
2234
+ treeLoad(e, t, n) {
2235
+ this.$emit("tree-load", e, t, (t) => {
2236
+ e.children = t, n(t);
2237
+ });
2238
+ },
2239
+ menuIcon(e) {
2240
+ return s(this.tableOption[`${e}Text`], u(`crud.${e}`));
2241
+ },
2242
+ getBtnIcon(e) {
2243
+ let t = `${e}Icon`;
2244
+ return this.tableOption[t] || G[t];
2245
+ },
2246
+ validateField(e) {
2247
+ return this.$refs.dialogForm.$refs.tableForm.validateField(e);
2248
+ },
2249
+ selectClear() {
2250
+ this.$emit("selection-clear", r(this.tableSelect)), this.$refs.table.clearSelection();
2251
+ },
2252
+ toggleRowSelection(e, t) {
2253
+ this.$refs.table.toggleRowSelection(e, t);
2254
+ },
2255
+ toggleRowExpansion(e, t) {
2256
+ this.$refs.table.toggleRowExpansion(e, t);
2257
+ },
2258
+ setCurrentRow(e) {
2259
+ this.$refs.table.setCurrentRow(e);
2260
+ },
2261
+ dataInit() {
2262
+ this.list = this.data, this.list.forEach((e, t) => {
2263
+ e.$cellEdit && !this.cascaderFormList[t] && (this.cascaderFormList[t] = r(e)), this.$set(e, "$cellEdit", e.$cellEdit || !1), this.$set(e, "$index", t);
2264
+ });
2265
+ },
2266
+ headerDragend(e, t, n, r) {
2267
+ this.objectOption[n.property] && this.$set(this.objectOption[n.property], "width", e), this.$emit("header-dragend", e, t, n, r);
2268
+ },
2269
+ headerSort(e, t) {
2270
+ let n = this.columnOption, r = n.splice(e, 1)[0];
2271
+ n.splice(t, 0, r), this.refreshTable();
2272
+ },
2273
+ clearFilter(e) {
2274
+ this.$refs.table.clearFilter(e);
2275
+ },
2276
+ expandChange(e, t) {
2277
+ this.$emit("expand-change", e, t);
2278
+ },
2279
+ currentRowChange(e, t) {
2280
+ this.$emit("current-row-change", e, t);
2281
+ },
2282
+ refreshChange() {
2283
+ this.$emit("refresh-change");
2284
+ },
2285
+ toggleSelection(e) {
2286
+ e ? e.forEach((e) => {
2287
+ this.$refs.table.toggleRowSelection(e);
2288
+ }) : this.$refs.table.clearSelection();
2289
+ },
2290
+ selectionChange(e) {
2291
+ this.tableSelect = e, this.$emit("selection-change", this.tableSelect);
2292
+ },
2293
+ select(e, t) {
2294
+ this.$emit("select", e, t);
2295
+ },
2296
+ selectAll(e) {
2297
+ this.$emit("select-all", e);
2298
+ },
2299
+ filterChange(e) {
2300
+ this.$emit("filter-change", e);
2301
+ },
2302
+ sortChange(e) {
2303
+ this.$emit("sort-change", e);
2304
+ },
2305
+ rowDblclick(e, t) {
2306
+ this.$emit("row-dblclick", e, t);
2307
+ },
2308
+ rowClick(e, t, n) {
2309
+ this.$emit("row-click", e, t, n);
2310
+ },
2311
+ clearSort() {
2312
+ this.$refs.table.clearSort();
2313
+ },
2314
+ cellMouseEnter(e, t, n, r) {
2315
+ this.$emit("cell-mouse-enter", e, t, n, r);
2316
+ },
2317
+ cellMouseLeave(e, t, n, r) {
2318
+ this.$emit("cell-mouse-leave", e, t, n, r);
2319
+ },
2320
+ cellClick(e, t, n, r) {
2321
+ this.$emit("cell-click", e, t, n, r);
2322
+ },
2323
+ headerClick(e, t) {
2324
+ this.$emit("header-click", e, t);
2325
+ },
2326
+ rowContextmenu(e, t, n) {
2327
+ this.$emit("row-contextmenu", e, t, n);
2328
+ },
2329
+ headerContextmenu(e, t) {
2330
+ this.$emit("header-contextmenu", e, t);
2331
+ },
2332
+ cellDblclick(e, t, n, r) {
2333
+ this.$emit("cell-dblclick", e, t, n, r);
2334
+ },
2335
+ rowCellAdd(e = {}) {
2336
+ let t = this.list.length, n = f(this.propOption).tableForm;
2337
+ e = r({
2338
+ $cellEdit: !0,
2339
+ $index: t,
2340
+ ...n,
2341
+ ...e
2342
+ }), this.list.push(e);
2343
+ },
2344
+ rowCancel(e, t) {
2345
+ W(e[this.rowKey]) ? (this.list.splice(t, 1), delete this.cascaderDIC[t]) : (this.cascaderFormList[t].$cellEdit = !1, this.$set(this.cascaderDIC, t, this.cascaderDicList[t]), this.$set(this.list, t, this.cascaderFormList[t])), delete this.cascaderDicList[t], delete this.cascaderFormList[t], this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(t), 1);
2346
+ },
2347
+ rowCell(e, t) {
2348
+ e.$cellEdit ? this.rowCellUpdate(e, t) : this.rowCellEdit(e, t);
2349
+ },
2350
+ rowCellUpdate(e, t) {
2351
+ e = r(e);
2352
+ let n = this.validateCellField(t), i = () => {
2353
+ this.btnDisabledList[t] = !1, this.btnDisabled = !1, this.list[t].$cellEdit = !1, this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(t), 1), delete this.cascaderFormList[t];
2354
+ }, a = () => {
2355
+ this.btnDisabledList[t] = !1, this.btnDisabled = !1;
2356
+ };
2357
+ n && (this.btnDisabledList[t] = !0, this.btnDisabled = !0, W(e[this.rowKey]) ? this.$emit("row-save", e, i, a) : this.$emit("row-update", e, t, i, a));
2358
+ },
2359
+ rowCellEdit(e, t) {
2360
+ e.$cellEdit = !0, this.cascaderFormList[t] = r(e), this.cascaderDicList[t] = r(this.cascaderDIC[t]);
2361
+ },
2362
+ validateCellForm() {
2363
+ return new Promise((e) => {
2364
+ this.$refs.cellForm.validate((t, n) => {
2365
+ e(n);
2366
+ });
2367
+ });
2368
+ },
2369
+ validateCellField(e) {
2370
+ let t = !0;
2371
+ for (let n of this.$refs.cellForm.fields) if (n.prop.split(".")[1] === `${e}` && this.$refs.cellForm.validateField(n.prop, (e) => {
2372
+ e && (t = !1);
2373
+ }), !t) break;
2374
+ return t;
2375
+ },
2376
+ rowAdd() {
2377
+ this.$refs.dialogForm.show("add");
2378
+ },
2379
+ rowSave() {
2380
+ return this.$refs.dialogForm.$refs.tableForm.submit();
2381
+ },
2382
+ rowUpdate() {
2383
+ return this.$refs.dialogForm.$refs.tableForm.submit();
2384
+ },
2385
+ closeDialog() {
2386
+ return this.$refs.dialogForm.closeDialog();
2387
+ },
2388
+ getPropRef(e) {
2389
+ return this.$refs.dialogForm.$refs.tableForm.getPropRef(e);
2390
+ },
2391
+ setVal() {
2392
+ this.$emit("input", this.tableForm), this.$emit("change", this.tableForm);
2393
+ },
2394
+ rowEdit(e, t) {
2395
+ this.tableForm = r(e), this.tableIndex = t, this.setVal(), this.$refs.dialogForm.show("edit");
2396
+ },
2397
+ rowCopy(e) {
2398
+ this.tableForm = r(e), delete this.tableForm[this.rowKey], this.tableIndex = -1, this.setVal(), this.$refs.dialogForm.show("add");
2399
+ },
2400
+ rowView(e, t) {
2401
+ this.tableForm = r(e), this.tableIndex = t, this.setVal(), this.$refs.dialogForm.show("view");
2402
+ },
2403
+ rowDel(e, t) {
2404
+ this.$emit("row-del", e, t, () => {
2405
+ let { parentList: t, index: n } = this.findData(e[this.rowKey]);
2406
+ t && t.splice(n, 1);
2407
+ });
2408
+ },
2409
+ tableSpanMethod(e) {
2410
+ if (typeof this.spanMethod == "function") return this.spanMethod(e);
2411
+ },
2412
+ tableSummaryMethod(e) {
2413
+ let t = {};
2414
+ if (typeof this.summaryMethod == "function") return this.summaryMethod(e);
2415
+ let { columns: n, data: r } = e, i = [];
2416
+ return n.length > 0 && n.forEach((e, n) => {
2417
+ let a = this.sumColumnList.find((t) => t.name === e.property);
2418
+ if (a) {
2419
+ let o = a.decimals || 2, s = a.label || "", c = 1;
2420
+ switch (a.type) {
2421
+ case "count":
2422
+ i[n] = s + r.length;
2423
+ break;
2424
+ case "avg":
2425
+ i[n] = r.map((t) => Number(t[e.property])).reduce((e, t) => {
2426
+ let n = Number(t);
2427
+ return isNaN(n) ? e : (e * (c - 1) + t) / c++;
2428
+ }, 0), i[n] = s + i[n].toFixed(o);
2429
+ break;
2430
+ case "sum":
2431
+ i[n] = r.map((t) => Number(t[e.property])).reduce((e, t) => {
2432
+ let n = Number(t);
2433
+ return isNaN(n) ? e : e + t;
2434
+ }, 0), i[n] = s + i[n].toFixed(o);
2435
+ break;
2436
+ }
2437
+ t[e.property] = i[n];
2438
+ } else i[n] = "";
2439
+ }), this.sumsList = t, i;
2440
+ },
2441
+ tableDrop(e, t, n) {
2442
+ if (!(this.isSortable !== !0 && (e === "row" && !this.isRowSort || e === "column" && !this.isColumnSort))) {
2443
+ if (!window.Sortable) {
2444
+ m.logs("Sortable");
2445
+ return;
2446
+ }
2447
+ window.Sortable.create(t, {
2448
+ ghostClass: G.ghostClass,
2449
+ chosenClass: G.ghostClass,
2450
+ animation: 500,
2451
+ delay: 0,
2452
+ onEnd: (e) => n(e)
2453
+ });
2454
+ }
2455
+ },
2456
+ findData(e) {
2457
+ let t = {}, n = (r, i) => {
2458
+ r.forEach((a, o) => {
2459
+ a[this.rowKey] === e && (t = {
2460
+ item: a,
2461
+ index: o,
2462
+ parentList: r,
2463
+ parent: i
2464
+ }), a[this.childrenKey] && n(a[this.childrenKey], a);
2465
+ });
2466
+ };
2467
+ return n(this.list), t;
2468
+ }
2469
+ }
2470
+ }, We = { class: "avue-crud avue-crud--card" }, Ge = { class: "avue-crud__tip-name" }, Ke = { class: "avue-crud__tip-count" };
2471
+ function qe(e, t, n, r, i, a) {
2472
+ let o = L("HeaderSearch"), s = L("HeaderMenu"), c = L("ElButton"), l = L("ElTag"), u = L("ColumnDefault"), d = L("ColumnMenu"), f = L("Column"), p = L("ElEmpty"), m = L("ElTable"), h = L("ElForm"), g = L("TablePage"), _ = L("FyDialogForm"), v = L("DialogColumn"), y = L("DialogExcel"), b = L("DialogFilter"), x = R("permission"), A = R("loading");
2473
+ return P(), w("div", We, [
2474
+ e.tableOption.title ? (P(), S(z(e.tableOption.titleSize || "h2"), {
2475
+ key: 0,
2476
+ style: N(e.tableOption.titleStyle)
2477
+ }, {
2478
+ default: V(() => [D(B(e.tableOption.title), 1)]),
2479
+ _: 1
2480
+ }, 8, ["style"])) : C("v-if", !0),
2481
+ C(" 搜索组件 "),
2482
+ O(o, { ref: "headerSearch" }, E({
2483
+ search: V((t) => [I(e.$slots, "search", M(k(t)))]),
2484
+ searchMenu: V((t) => [I(e.$slots, "searchMenu", M(k(t)))]),
2485
+ _: 2
2486
+ }, [F(a.searchSlot, (t) => ({
2487
+ name: t,
2488
+ fn: V((n) => [I(e.$slots, t, M(k(n)))])
2489
+ }))]), 1536),
2490
+ C(" 表格功能列 "),
2491
+ a.optVal(e.tableOption.header, !0) ? (P(), S(s, {
2492
+ key: 1,
2493
+ ref: "headerMenu"
2494
+ }, {
2495
+ menuLeft: V((t) => [I(e.$slots, "menuLeft", M(k(t)))]),
2496
+ menuRight: V((t) => [I(e.$slots, "menuRight", M(k(t)))]),
2497
+ _: 3
2498
+ }, 512)) : C("v-if", !0),
2499
+ a.optVal(e.tableOption.tip, i.config.tip) && e.tableOption.selection ? (P(), S(l, {
2500
+ key: 2,
2501
+ class: "avue-crud__tip"
2502
+ }, {
2503
+ default: V(() => [
2504
+ T("span", Ge, [
2505
+ t[0] || (t[0] = D(" 当前表格已选择 ", -1)),
2506
+ T("span", Ke, B(a.selectLen), 1),
2507
+ t[1] || (t[1] = D(" 项 ", -1))
2508
+ ]),
2509
+ a.optVal(e.tableOption.selectClearBtn, i.config.selectClearBtn) && e.tableOption.selection ? H((P(), S(c, {
2510
+ key: 0,
2511
+ type: "text",
2512
+ size: "small",
2513
+ onClick: a.selectClear
2514
+ }, {
2515
+ default: V(() => [...t[2] || (t[2] = [D(" 清 空 ", -1)])]),
2516
+ _: 1
2517
+ }, 8, ["onClick"])), [[x, a.getPermission("selectClearBtn")]]) : C("v-if", !0),
2518
+ I(e.$slots, "tip")
2519
+ ]),
2520
+ _: 3
2521
+ })) : C("v-if", !0),
2522
+ I(e.$slots, "header"),
2523
+ O(h, {
2524
+ ref: "cellForm",
2525
+ model: i.cellForm,
2526
+ "show-message": !1,
2527
+ onValidate: a.handleValidate
2528
+ }, {
2529
+ default: V(() => [H((P(), S(m, {
2530
+ key: i.reload,
2531
+ ref: "table",
2532
+ data: i.cellForm.list,
2533
+ "row-key": e.rowKey,
2534
+ class: j({ "avue-crud--indeterminate": a.optVal(e.tableOption.indeterminate, !1) }),
2535
+ size: e.$AVUE.tableSize || e.controlSize,
2536
+ lazy: a.optVal(e.tableOption.lazy, !1),
2537
+ load: a.treeLoad,
2538
+ "tree-props": a.treeProps,
2539
+ "expand-row-keys": e.tableOption.expandRowKeys,
2540
+ "default-expand-all": e.tableOption.defaultExpandAll,
2541
+ "highlight-current-row": e.tableOption.highlightCurrentRow,
2542
+ "show-summary": e.tableOption.showSummary,
2543
+ "summary-method": a.tableSummaryMethod,
2544
+ "span-method": a.tableSpanMethod,
2545
+ stripe: e.tableOption.stripe,
2546
+ "show-header": e.tableOption.showHeader,
2547
+ "default-sort": e.tableOption.defaultSort,
2548
+ "row-class-name": n.rowClassName,
2549
+ "cell-class-name": n.cellClassName,
2550
+ "row-style": n.rowStyle,
2551
+ "cell-style": n.cellStyle,
2552
+ fit: e.tableOption.fit,
2553
+ "header-cell-class-name": n.headerCellClassName,
2554
+ "max-height": a.isAutoHeight ? i.tableHeight : e.tableOption.maxHeight,
2555
+ height: i.tableHeight,
2556
+ width: a.setPx(e.tableOption.width, i.config.width),
2557
+ border: e.tableOption.border,
2558
+ onCurrentChange: a.currentRowChange,
2559
+ onExpandChange: a.expandChange,
2560
+ onHeaderDragend: a.headerDragend,
2561
+ onRowClick: a.rowClick,
2562
+ onRowDblclick: a.rowDblclick,
2563
+ onCellMouseEnter: a.cellMouseEnter,
2564
+ onCellMouseLeave: a.cellMouseLeave,
2565
+ onCellClick: a.cellClick,
2566
+ onHeaderClick: a.headerClick,
2567
+ onRowContextmenu: a.rowContextmenu,
2568
+ onHeaderContextmenu: a.headerContextmenu,
2569
+ onCellDblclick: a.cellDblclick,
2570
+ onFilterChange: a.filterChange,
2571
+ onSelectionChange: a.selectionChange,
2572
+ onSelect: a.select,
2573
+ onSelectAll: a.selectAll,
2574
+ onSortChange: a.sortChange
2575
+ }, {
2576
+ empty: V(() => [e.$slots.empty ? I(e.$slots, "empty", { key: 0 }) : (P(), S(p, {
2577
+ key: 1,
2578
+ "image-size": 100,
2579
+ class: "avue-crud__empty",
2580
+ description: e.tableOption.emptyText
2581
+ }, null, 8, ["description"]))]),
2582
+ default: V(() => [O(f, { "column-option": a.columnOption }, E({
2583
+ header: V(() => [O(u, { ref: "columnDefault" }, {
2584
+ expand: V(({ row: t, index: n }) => [I(e.$slots, "expand", {
2585
+ row: t,
2586
+ index: n
2587
+ })]),
2588
+ _: 3
2589
+ }, 512)]),
2590
+ footer: V(() => [O(d, null, {
2591
+ menu: V((t) => [I(e.$slots, "menu", M(k(t)))]),
2592
+ menuBtn: V((t) => [I(e.$slots, "menuBtn", M(k(t)))]),
2593
+ _: 3
2594
+ })]),
2595
+ _: 2
2596
+ }, [F(a.mainSlot, (t) => ({
2597
+ name: t,
2598
+ fn: V((n) => [I(e.$slots, t, M(k(n)))])
2599
+ }))]), 1032, ["column-option"])]),
2600
+ _: 3
2601
+ }, 8, /* @__PURE__ */ "data.row-key.class.size.lazy.load.tree-props.expand-row-keys.default-expand-all.highlight-current-row.show-summary.summary-method.span-method.stripe.show-header.default-sort.row-class-name.cell-class-name.row-style.cell-style.fit.header-cell-class-name.max-height.height.width.border.onCurrentChange.onExpandChange.onHeaderDragend.onRowClick.onRowDblclick.onCellMouseEnter.onCellMouseLeave.onCellClick.onHeaderClick.onRowContextmenu.onHeaderContextmenu.onCellDblclick.onFilterChange.onSelectionChange.onSelect.onSelectAll.onSortChange".split("."))), [[A, n.tableLoading]])]),
2602
+ _: 3
2603
+ }, 8, ["model", "onValidate"]),
2604
+ I(e.$slots, "footer"),
2605
+ C(" 分页 "),
2606
+ O(g, { ref: "tablePage" }, null, 512),
2607
+ C(" 表单 "),
2608
+ O(_, { ref: "dialogForm" }, E({
2609
+ menuForm: V((t) => [I(e.$slots, "menuForm", M(k(t)))]),
2610
+ _: 2
2611
+ }, [F(a.formSlot, (t) => ({
2612
+ name: t,
2613
+ fn: V((n) => [I(e.$slots, t, M(k(n)))])
2614
+ }))]), 1536),
2615
+ O(v, { ref: "dialogColumn" }, null, 512),
2616
+ O(y, { ref: "dialogExcel" }, null, 512),
2617
+ O(b, { ref: "dialogFilter" }, null, 512)
2618
+ ]);
2619
+ }
2620
+ var Je = /* @__PURE__ */ e(Ue, [["render", qe]]);
2621
+ //#endregion
2622
+ export { Je as t };