@web-utils/form-ui 1.0.0-beta86 → 1.0.0-beta88

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 (212) hide show
  1. package/affix/index.mjs +1 -1
  2. package/chunks/{4kjeIiag2.mjs → 5RCAxanu2.mjs} +3 -3
  3. package/chunks/{vebd58-O.mjs → 9ec0Wti82.mjs} +1 -1
  4. package/chunks/{BxcsELcB2.mjs → B7BaAm4k2.mjs} +2 -2
  5. package/chunks/{DSTNXl142.mjs → BFhVUqpP2.mjs} +2 -2
  6. package/chunks/BLKcXIrX.mjs +517 -0
  7. package/chunks/{C8h_P_kl2.mjs → BSOrm2U4.mjs} +2 -2
  8. package/chunks/BbUUI4mF.mjs +204 -0
  9. package/chunks/{D_q3C3v4.mjs → BegZOXrr.mjs} +4 -4
  10. package/chunks/{BIy6bO4j.mjs → Bg01eBVa2.mjs} +2 -2
  11. package/chunks/{DJlgX5ty.mjs → BhPVs8Ju.mjs} +1 -1
  12. package/chunks/{DrvwVjzq2.mjs → BmbhIxPF2.mjs} +2 -2
  13. package/chunks/{BYu4QaK72.mjs → Br3whXEJ2.mjs} +2 -2
  14. package/chunks/{y1Q66LEa2.mjs → BuI82QMb2.mjs} +1 -1
  15. package/chunks/{CCpKg0cM.mjs → Bv7b2DXh2.mjs} +2 -2
  16. package/chunks/{ofu8wJKp.mjs → C-s-88fN2.mjs} +1 -1
  17. package/chunks/{CET31mBi.mjs → C54nZqvy2.mjs} +1 -1
  18. package/chunks/CBHGpbDK.mjs +56 -0
  19. package/chunks/CFpGTE5U2.mjs +221 -0
  20. package/chunks/CIihGrgY.mjs +30 -0
  21. package/chunks/{XQwnPkab2.mjs → CW021IPm2.mjs} +1 -1
  22. package/chunks/{CLn5E7NV.mjs → CW1nopZH.mjs} +1 -1
  23. package/chunks/CY2YrwMT.mjs +302 -0
  24. package/chunks/{DVF9q3oX.mjs → CdvD0NRo2.mjs} +2 -2
  25. package/chunks/Cf_h9S62.mjs +378 -0
  26. package/chunks/{8h-xBLL82.mjs → CixNVW_T2.mjs} +10 -10
  27. package/chunks/{By-W0XXn2.mjs → ClkLQjZ82.mjs} +1 -1
  28. package/chunks/CsNZt53l.mjs +4074 -0
  29. package/chunks/{HFLY8Wla.mjs → D1mQTnJ8.mjs} +181 -185
  30. package/chunks/{CjCNtCWd.mjs → D20CQ-B6.mjs} +1 -1
  31. package/chunks/{BxuM-fgJ.mjs → D2kLAzxW.mjs} +1 -1
  32. package/chunks/{tfaGdZX2.mjs → D8_fl5Oq.mjs} +4 -4
  33. package/chunks/{C28bnMcw.mjs → DC3DNg_r.mjs} +1 -1
  34. package/chunks/{DWN5uzm02.mjs → DL4xcGES2.mjs} +10 -10
  35. package/chunks/{SWO35fS42.mjs → Dd4RtBO02.mjs} +1 -1
  36. package/chunks/{3nLaRSbR2.mjs → DdHN2Nv72.mjs} +1 -1
  37. package/chunks/{BrSqLOi5.mjs → DmJaItEY.mjs} +6 -6
  38. package/chunks/{CkHQY4ME2.mjs → Dnapnskp2.mjs} +1 -1
  39. package/chunks/{vHsAJZRT.mjs → MUk_IdeO2.mjs} +2 -2
  40. package/chunks/NAZ8HFBg.mjs +340 -0
  41. package/chunks/{saZ_qJOT.mjs → aOv3rI7q.mjs} +1 -1
  42. package/chunks/{mqi8hesW2.mjs → dxZzZgUn.mjs} +2 -2
  43. package/chunks/{Tq3_dajC2.mjs → m5oFTe8Y2.mjs} +1 -1
  44. package/chunks/{Dst9_BmZ.mjs → n7IipIUY.mjs} +3 -3
  45. package/chunks/{SInS7QSL.mjs → vCOhFr2x.mjs} +1 -1
  46. package/constants/index.d.ts +2 -0
  47. package/constants/index.mjs +2 -2
  48. package/data-table-picker/index.mjs +1 -1
  49. package/dialog-form/index.d.ts +4 -0
  50. package/dialog-form/index.mjs +154 -0
  51. package/dialog-form/style.css +1 -0
  52. package/empty-view/index.d.ts +2 -2
  53. package/flex-box/index.mjs +1 -1
  54. package/flex-column/index.mjs +1 -1
  55. package/flex-item/index.mjs +1 -1
  56. package/flex-row/index.mjs +1 -1
  57. package/flow-designer/index.mjs +1 -1
  58. package/form-cascader/index.mjs +1 -1
  59. package/form-checkbox/index.mjs +1 -1
  60. package/form-checkbox-group/index.mjs +1 -1
  61. package/form-date-picker/index.d.ts +4 -4
  62. package/form-date-picker/index.mjs +1 -1
  63. package/form-holder/index.mjs +1 -1
  64. package/form-image/index.mjs +1 -1
  65. package/form-input/index.mjs +1 -1
  66. package/form-input-cron-expression/index.mjs +1 -1
  67. package/form-input-email/index.mjs +1 -1
  68. package/form-input-id-card/index.mjs +1 -1
  69. package/form-input-number/index.mjs +1 -1
  70. package/form-input-phone-number/index.mjs +1 -1
  71. package/form-input-tag/index.mjs +1 -1
  72. package/form-input-time/index.mjs +1 -1
  73. package/form-item/index.mjs +1 -1
  74. package/form-item-group/index.mjs +1 -1
  75. package/form-radio-group/index.mjs +1 -1
  76. package/form-rate/index.mjs +1 -1
  77. package/form-row/index.mjs +1 -1
  78. package/form-select/index.mjs +1 -1
  79. package/form-slider/index.mjs +1 -1
  80. package/form-switch/index.mjs +1 -1
  81. package/form-table/index.mjs +1 -1
  82. package/form-table-plus/index.mjs +1 -1
  83. package/form-text/index.mjs +1 -1
  84. package/form-textarea/index.mjs +1 -1
  85. package/form-time-select/index.mjs +1 -1
  86. package/form-tree-select/index.mjs +1 -1
  87. package/form-tree-select-multiple/index.mjs +1 -1
  88. package/form-view/index.mjs +2 -2
  89. package/fy-array/index.d.ts +234 -0
  90. package/fy-array/index.mjs +130 -0
  91. package/fy-array/style.css +1 -0
  92. package/fy-button/index.d.ts +18 -0
  93. package/fy-button/index.mjs +2 -0
  94. package/fy-button/style.css +1 -0
  95. package/fy-cascader/index.d.ts +298 -0
  96. package/fy-cascader/index.mjs +116 -0
  97. package/fy-checkbox/index.d.ts +231 -0
  98. package/fy-checkbox/index.mjs +100 -0
  99. package/fy-checkbox/style.css +1 -0
  100. package/fy-curd/index.d.ts +908 -0
  101. package/fy-curd/index.mjs +2 -0
  102. package/fy-date/index.d.ts +246 -0
  103. package/fy-date/index.mjs +79 -0
  104. package/fy-date/style.css +1 -0
  105. package/fy-dynamic/index.d.ts +268 -0
  106. package/fy-dynamic/index.mjs +2 -0
  107. package/fy-empty/index.d.ts +31 -0
  108. package/fy-empty/index.mjs +35 -0
  109. package/fy-empty/style.css +1 -0
  110. package/fy-form/index.d.ts +522 -0
  111. package/fy-form/index.mjs +2 -0
  112. package/fy-form/style.css +1 -0
  113. package/fy-input/index.d.ts +316 -0
  114. package/fy-input/index.mjs +122 -0
  115. package/fy-input-color/index.d.ts +235 -0
  116. package/fy-input-color/index.mjs +80 -0
  117. package/fy-input-icon/index.d.ts +244 -0
  118. package/fy-input-icon/index.mjs +133 -0
  119. package/fy-input-icon/style.css +1 -0
  120. package/fy-input-map/index.d.ts +266 -0
  121. package/fy-input-map/index.mjs +248 -0
  122. package/fy-input-map/style.css +1 -0
  123. package/fy-input-number/index.d.ts +266 -0
  124. package/fy-input-number/index.mjs +78 -0
  125. package/fy-input-table/index.d.ts +248 -0
  126. package/fy-input-table/index.mjs +166 -0
  127. package/fy-input-table/style.css +1 -0
  128. package/fy-input-tree/index.d.ts +351 -0
  129. package/fy-input-tree/index.mjs +266 -0
  130. package/fy-input-tree/style.css +1 -0
  131. package/fy-radio/index.d.ts +218 -0
  132. package/fy-radio/index.mjs +56 -0
  133. package/fy-radio/style.css +1 -0
  134. package/fy-rate/index.d.ts +288 -0
  135. package/fy-rate/index.mjs +90 -0
  136. package/fy-rate/style.css +1 -0
  137. package/fy-select/index.d.ts +324 -0
  138. package/fy-select/index.mjs +2 -0
  139. package/fy-select/style.css +1 -0
  140. package/fy-slider/index.d.ts +249 -0
  141. package/fy-slider/index.mjs +72 -0
  142. package/fy-switch/index.d.ts +229 -0
  143. package/fy-switch/index.mjs +71 -0
  144. package/fy-tabs/index.d.ts +20 -0
  145. package/fy-tabs/index.mjs +50 -0
  146. package/fy-time/index.d.ts +704 -0
  147. package/fy-time/index.mjs +85 -0
  148. package/fy-title/index.d.ts +224 -0
  149. package/fy-title/index.mjs +18 -0
  150. package/fy-title/style.css +1 -0
  151. package/fy-tree/index.d.ts +141 -0
  152. package/fy-tree/index.mjs +390 -0
  153. package/fy-tree/style.css +1 -0
  154. package/fy-u-editor/index.d.ts +116 -0
  155. package/fy-u-editor/index.mjs +2 -0
  156. package/fy-u-editor/style.css +1 -0
  157. package/fy-upload/index.d.ts +379 -0
  158. package/fy-upload/index.mjs +2 -0
  159. package/fy-upload/style.css +1 -0
  160. package/helper/avue.d.ts +36 -0
  161. package/helper/avue.mjs +35 -0
  162. package/helper/input.mjs +1 -1
  163. package/icon-temp/index.d.ts +19 -0
  164. package/icon-temp/index.mjs +27 -0
  165. package/icon-temp/style.css +1 -0
  166. package/image-viewer/index.d.ts +1 -1
  167. package/index.css +1 -1
  168. package/index.d.ts +31 -1
  169. package/index.mjs +118 -90
  170. package/keyboard/index.mjs +1 -1
  171. package/monaco-editor/index.d.ts +126 -0
  172. package/monaco-editor/index.mjs +2 -0
  173. package/monaco-editor/style.css +1 -0
  174. package/package.json +3 -1
  175. package/pageable-table/index.d.ts +1 -1
  176. package/pageable-table/index.mjs +1 -1
  177. package/photo-swipe/index.mjs +1 -1
  178. package/resolver/components.mjs +1 -1
  179. package/split-pane/index.mjs +1 -1
  180. package/sub-table/index.mjs +1 -1
  181. package/sub-table-plus/index.mjs +1 -1
  182. package/table-column-def/index.d.ts +6 -6
  183. package/table-view/index.mjs +4 -4
  184. package/tag-render/index.d.ts +1 -1
  185. package/toolbar/index.mjs +1 -1
  186. package/vue-cron/index.mjs +1 -1
  187. package/vue-tags-input/index.d.ts +1 -1
  188. package/vue-tree-select/index.mjs +1 -1
  189. package/watermark/index.mjs +1 -1
  190. package/web-types.json +1 -1
  191. package/x-input-tag/index.mjs +1 -1
  192. package/chunks/{DCqyZyF6.mjs → BCYFaOiB.mjs} +0 -0
  193. package/chunks/{B1luuf_A2.mjs → BJDeTpmp2.mjs} +0 -0
  194. package/chunks/{BhHMGhJ8.mjs → BcsscZAM.mjs} +0 -0
  195. package/chunks/{DbcxJ45j.mjs → BfW25VbY.mjs} +1 -1
  196. package/chunks/{6dNVtIN32.mjs → BjccroM8.mjs} +0 -0
  197. package/chunks/{BTGrh7dw2.mjs → Br0vC3nS2.mjs} +0 -0
  198. package/chunks/{BM5LdxU72.mjs → CB0zQsKV2.mjs} +0 -0
  199. package/chunks/{Bs926z902.mjs → CHqxWrj7.mjs} +1 -1
  200. package/chunks/{B5c0s3IR.mjs → CJwAjhLy.mjs} +1 -1
  201. package/chunks/{BAG_R87k2.mjs → CZnwC17w.mjs} +0 -0
  202. package/chunks/{tVHVSu5h.mjs → CbedyG4s.mjs} +4 -4
  203. package/chunks/{BwL9Xz1F.mjs → Cp1olyWc.mjs} +0 -0
  204. package/chunks/{KOJEsarR2.mjs → CpmWELPU.mjs} +0 -0
  205. package/chunks/{C-zPVdz-.mjs → D9ft-f6n.mjs} +1 -1
  206. package/chunks/{PEU1JRcN2.mjs → DEHzWyyp.mjs} +0 -0
  207. package/chunks/{CHmZyvFr.mjs → DJe2Reym.mjs} +0 -0
  208. package/chunks/{CpsHWpwH2.mjs → DNq7pbXh2.mjs} +0 -0
  209. package/chunks/{X-ckP2Hj.mjs → DOLQ28wD.mjs} +0 -0
  210. package/chunks/{tqW2DSco.mjs → fT8tFJVO.mjs} +1 -1
  211. /package/chunks/{Dkw6LNCq2.mjs → jG7vu3RX.mjs} +0 -0
  212. /package/chunks/{b0ve2YgF.mjs → mQG01w6Y.mjs} +0 -0
@@ -0,0 +1,4074 @@
1
+ import { u as e } from "./ClVh1Lek.mjs";
2
+ import { t } from "./B1MSrc6f.mjs";
3
+ import { t as n } from "./V-Js6hNd.mjs";
4
+ import { avueConfigContextKey as r } from "../constants/index.mjs";
5
+ import { t as i } from "./CIihGrgY.mjs";
6
+ import { C as a, T as o, _ as s, a as c, b as l, c as u, d, g as f, h as p, l as m, m as h, n as g, p as ee, t as te, v as _, x as ne, y as re } from "./BbUUI4mF.mjs";
7
+ import { a as ie, c as v, i as ae, l as oe, n as se, o as ce, r as y, s as le, t as ue, u as de } from "./Cf_h9S62.mjs";
8
+ import fe from "../fy-array/index.mjs";
9
+ import pe from "../fy-cascader/index.mjs";
10
+ import me from "../fy-checkbox/index.mjs";
11
+ import he from "../fy-date/index.mjs";
12
+ import ge from "../fy-input/index.mjs";
13
+ import { a as b, i as _e, n as ve, r as ye, t as be } from "./NAZ8HFBg.mjs";
14
+ import { t as xe } from "./CBHGpbDK.mjs";
15
+ import Se from "../icon-temp/index.mjs";
16
+ import Ce from "../fy-rate/index.mjs";
17
+ import we from "../fy-input-color/index.mjs";
18
+ import Te from "../fy-input-icon/index.mjs";
19
+ import Ee from "../fy-input-map/index.mjs";
20
+ import De from "../fy-input-number/index.mjs";
21
+ import Oe from "../fy-radio/index.mjs";
22
+ import ke from "../fy-slider/index.mjs";
23
+ import Ae from "../fy-switch/index.mjs";
24
+ import je from "../fy-time/index.mjs";
25
+ import Me from "../fy-title/index.mjs";
26
+ import { t as Ne } from "./BLKcXIrX.mjs";
27
+ import Pe from "../fy-input-tree/index.mjs";
28
+ import { ElButtonGroup as Fe, ElCard as Ie, ElCheckbox as Le, ElCol as x, ElCollapse as Re, ElCollapseItem as ze, ElDrawer as S, ElDropdown as Be, ElDropdownItem as Ve, ElDropdownMenu as He, ElEmpty as Ue, ElForm as We, ElFormItem as C, ElLink as Ge, ElLoadingDirective as Ke, ElPagination as qe, ElRow as Je, ElTabPane as Ye, ElTable as Xe, ElTableColumn as w, ElTabs as Ze, ElTag as Qe, ElTooltip as $e } from "element-plus/es";
29
+ import "element-plus/es/components/base/style/css";
30
+ import { Fragment as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createSlots as A, createTextVNode as j, createVNode as M, defineAsyncComponent as et, guardReactiveProps as N, mergeProps as P, normalizeClass as F, normalizeProps as I, normalizeStyle as L, openBlock as R, renderList as z, renderSlot as B, resolveComponent as tt, resolveDirective as V, resolveDynamicComponent as H, toDisplayString as U, toHandlers as nt, vShow as rt, withCtx as W, withDirectives as G, withKeys as it, withModifiers as K } from "vue";
31
+ import { isBlank as q } from "@web-utils/core";
32
+ import "element-plus/es/components/row/style/css";
33
+ import "element-plus/es/components/col/style/css";
34
+ import "element-plus/es/components/loading/style/css";
35
+ import "element-plus/es/components/tooltip/style/css";
36
+ import "element-plus/es/components/drawer/style/css";
37
+ import "element-plus/es/components/table/style/css";
38
+ import "element-plus/es/components/checkbox/style/css";
39
+ import "element-plus/es/components/table-column/style/css";
40
+ import "element-plus/es/components/pagination/style/css";
41
+ import "element-plus/es/components/empty/style/css";
42
+ import "element-plus/es/components/form/style/css";
43
+ import "element-plus/es/components/collapse/style/css";
44
+ import "element-plus/es/components/collapse-item/style/css";
45
+ import "element-plus/es/components/form-item/style/css";
46
+ import "element-plus/es/components/link/style/css";
47
+ import "element-plus/es/components/button-group/style/css";
48
+ import { formatDate as J } from "@web-utils/integrations/dayjs";
49
+ import "element-plus/es/components/card/style/css";
50
+ import "element-plus/es/components/dropdown/style/css";
51
+ import "element-plus/es/components/dropdown-menu/style/css";
52
+ import "element-plus/es/components/dropdown-item/style/css";
53
+ import "element-plus/es/components/tag/style/css";
54
+ import "element-plus/es/components/tabs/style/css";
55
+ import "element-plus/es/components/tab-pane/style/css";
56
+ //#region src/components/avue/fy-from/components/FormGroup.vue
57
+ var at = {
58
+ name: "FormGroup",
59
+ props: {
60
+ arrow: {
61
+ type: Boolean,
62
+ default: !0
63
+ },
64
+ collapse: {
65
+ type: Boolean,
66
+ default: !0
67
+ },
68
+ header: {
69
+ type: Boolean,
70
+ default: !0
71
+ },
72
+ icon: { type: String },
73
+ display: {
74
+ type: Boolean,
75
+ default: !0
76
+ },
77
+ label: { type: String }
78
+ },
79
+ data() {
80
+ return { activeName: "" };
81
+ },
82
+ computed: {
83
+ text() {
84
+ return +!!this.collapse;
85
+ },
86
+ isHeader() {
87
+ return this.$slots.header && this.header || (this.label || this.icon) && this.header;
88
+ }
89
+ },
90
+ watch: { text(e) {
91
+ this.activeName = [e];
92
+ } },
93
+ created() {
94
+ this.activeName = [this.text];
95
+ },
96
+ methods: { handleChange(e) {
97
+ this.$emit("change", e);
98
+ } }
99
+ }, ot = { class: "avue-group__header" }, st = {
100
+ key: 1,
101
+ class: "avue-group__title"
102
+ };
103
+ function ct(e, t, n, r, i, a) {
104
+ let o = ze, s = Re;
105
+ return n.display ? (R(), O("div", {
106
+ key: 0,
107
+ class: F(["avue-group", {
108
+ "avue-group--header": !a.isHeader,
109
+ "avue-group__arrow": !n.arrow
110
+ }])
111
+ }, [B(e.$slots, "tabs"), M(s, {
112
+ modelValue: i.activeName,
113
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => i.activeName = e),
114
+ value: a.text,
115
+ onChange: a.handleChange
116
+ }, {
117
+ default: W(() => [M(o, {
118
+ name: 1,
119
+ disabled: !n.arrow
120
+ }, {
121
+ title: W(() => [k("div", ot, [B(e.$slots, "header", {}, () => [n.icon ? (R(), O("i", {
122
+ key: 0,
123
+ class: F([n.icon, "avue-group__icon"])
124
+ }, null, 2)) : D("v-if", !0), n.label ? (R(), O("h1", st, U(n.label), 1)) : D("v-if", !0)])])]),
125
+ default: W(() => [B(e.$slots, "default")]),
126
+ _: 3
127
+ }, 8, ["disabled"])]),
128
+ _: 3
129
+ }, 8, [
130
+ "modelValue",
131
+ "value",
132
+ "onChange"
133
+ ])], 2)) : D("v-if", !0);
134
+ }
135
+ var lt = /* @__PURE__ */ t(at, [["render", ct]]), ut = {
136
+ name: "FyFormMenu",
137
+ components: { FyButton: i },
138
+ inject: ["formSafe"],
139
+ computed: {
140
+ menuSpan() {
141
+ return this.formSafe.parentOption.menuSpan || 24;
142
+ },
143
+ styleName() {
144
+ return this.menuSpan === 24 ? {} : { padding: 0 };
145
+ }
146
+ }
147
+ };
148
+ function dt(e, t, n, r, a, o) {
149
+ let s = i, c = C, l = x;
150
+ return o.formSafe.parentOption.menuBtn === !1 ? D("v-if", !0) : (R(), E(l, {
151
+ key: 0,
152
+ span: o.menuSpan,
153
+ md: o.menuSpan,
154
+ style: L(o.styleName),
155
+ class: F([
156
+ "menu",
157
+ o.formSafe.menuPosition,
158
+ "no-print"
159
+ ])
160
+ }, {
161
+ default: W(() => [M(c, {
162
+ "label-width": "0px",
163
+ style: { "text-align": "center" }
164
+ }, {
165
+ default: W(() => [
166
+ o.formSafe.isMock ? (R(), E(s, {
167
+ key: 0,
168
+ type: "primary",
169
+ size: o.formSafe.controlSize,
170
+ disabled: o.formSafe.allDisabled,
171
+ onClick: o.formSafe.handleMock
172
+ }, {
173
+ icon: W(() => [...t[0] || (t[0] = [k("i", { class: "el-icon-edit-outline" }, null, -1)])]),
174
+ default: W(() => [j(U(o.formSafe.parentOption.mockText || "模拟") + " ", 1)]),
175
+ _: 1
176
+ }, 8, [
177
+ "size",
178
+ "disabled",
179
+ "onClick"
180
+ ])) : D("v-if", !0),
181
+ o.formSafe.isPrint ? (R(), E(s, {
182
+ key: 1,
183
+ type: "primary",
184
+ size: o.formSafe.controlSize,
185
+ icon: "el-icon-printer",
186
+ disabled: o.formSafe.allDisabled,
187
+ onClick: o.formSafe.handlePrint
188
+ }, {
189
+ icon: W(() => [...t[1] || (t[1] = [k("i", { class: "el-icon-printer" }, null, -1)])]),
190
+ default: W(() => [j(U(o.formSafe.parentOption.printText || "打印") + " ", 1)]),
191
+ _: 1
192
+ }, 8, [
193
+ "size",
194
+ "disabled",
195
+ "onClick"
196
+ ])) : D("v-if", !0),
197
+ o.formSafe.parentOption.submitBtn === !1 ? D("v-if", !0) : (R(), E(s, {
198
+ key: 2,
199
+ type: "primary",
200
+ size: o.formSafe.controlSize,
201
+ loading: o.formSafe.allDisabled,
202
+ onClick: o.formSafe.submit
203
+ }, {
204
+ icon: W(() => [k("i", { class: F(o.formSafe.parentOption.submitIcon || "el-icon-check") }, null, 2)]),
205
+ default: W(() => [j(U(o.formSafe.parentOption.submitText || "提交") + " ", 1)]),
206
+ _: 1
207
+ }, 8, [
208
+ "size",
209
+ "loading",
210
+ "onClick"
211
+ ])),
212
+ o.formSafe.parentOption.emptyBtn === !1 ? D("v-if", !0) : (R(), E(s, {
213
+ key: 3,
214
+ size: o.formSafe.controlSize,
215
+ disabled: o.formSafe.allDisabled,
216
+ onClick: o.formSafe.resetForm
217
+ }, {
218
+ icon: W(() => [k("i", { class: F(o.formSafe.parentOption.emptyIcon || "el-icon-delete") }, null, 2)]),
219
+ default: W(() => [j(U(o.formSafe.parentOption.emptyText || "清空") + " ", 1)]),
220
+ _: 1
221
+ }, 8, [
222
+ "size",
223
+ "disabled",
224
+ "onClick"
225
+ ])),
226
+ B(e.$slots, "menuForm", {
227
+ disabled: o.formSafe.allDisabled,
228
+ size: o.formSafe.controlSize
229
+ })
230
+ ]),
231
+ _: 3
232
+ })]),
233
+ _: 3
234
+ }, 8, [
235
+ "span",
236
+ "md",
237
+ "style",
238
+ "class"
239
+ ]));
240
+ }
241
+ var ft = /* @__PURE__ */ t(ut, [["render", dt]]), pt = {
242
+ name: "DialogFilter",
243
+ inject: ["crud"],
244
+ data() {
245
+ return {
246
+ box: !1,
247
+ columnObj: {},
248
+ symbolDic: [
249
+ {
250
+ label: "=",
251
+ value: "="
252
+ },
253
+ {
254
+ label: "≠",
255
+ value: "≠"
256
+ },
257
+ {
258
+ label: "like",
259
+ value: "like"
260
+ },
261
+ {
262
+ label: ">",
263
+ value: ">"
264
+ },
265
+ {
266
+ label: "≥",
267
+ value: "≥"
268
+ },
269
+ {
270
+ label: "<",
271
+ value: "<"
272
+ },
273
+ {
274
+ label: "≤",
275
+ value: "≤"
276
+ },
277
+ {
278
+ label: "∈",
279
+ value: "∈"
280
+ }
281
+ ],
282
+ list: [],
283
+ columnOption: {}
284
+ };
285
+ },
286
+ methods: {
287
+ handleShow() {
288
+ this.getColumnOption(), this.box = !0;
289
+ },
290
+ getColumnOption() {
291
+ let e = [];
292
+ c(this.crud.propOption).forEach((t) => {
293
+ t.showColumn !== !1 && e.push(Object.assign(t, { value: t.prop }));
294
+ }), this.columnOption = e, this.columnObj = this.columnOption[0];
295
+ },
296
+ handleDelete(e) {
297
+ this.list.splice(e, 1);
298
+ },
299
+ handleClear() {
300
+ this.list = [];
301
+ },
302
+ handleValueClear() {
303
+ this.list.forEach((e) => {
304
+ e.value = "";
305
+ });
306
+ },
307
+ handleSubmit() {
308
+ let e = [];
309
+ this.list.forEach((t) => {
310
+ e.push([
311
+ t.text,
312
+ t.symbol,
313
+ t.value
314
+ ]);
315
+ }), this.crud.$emit("filter", e), this.box = !1;
316
+ },
317
+ handleChange(e) {
318
+ this.list[e].value = "";
319
+ },
320
+ handleAdd() {
321
+ let e = this.columnObj.prop;
322
+ this.list.push({
323
+ text: e,
324
+ value: "",
325
+ symbol: this.symbolDic[0].value
326
+ });
327
+ }
328
+ }
329
+ }, mt = { key: 0 }, ht = { class: "avue-crud__filter-menu" };
330
+ function gt(e, t, n, r, a, o) {
331
+ let s = i, c = Fe, l = be, u = ge, d = x, f = Je, p = S;
332
+ return a.box ? (R(), O("div", mt, [M(p, {
333
+ modelValue: a.box,
334
+ "onUpdate:modelValue": t[1] || (t[1] = (e) => a.box = e),
335
+ class: F([["avue-crud__dialog", "avue-crud__filter"], "avue-dialog"]),
336
+ "lock-scroll": "",
337
+ "append-to-body": "",
338
+ title: "过滤条件",
339
+ size: o.crud.isMobile ? "100%" : "60%"
340
+ }, {
341
+ default: W(() => [M(f, { span: 24 }, {
342
+ default: W(() => [
343
+ k("div", ht, [M(c, null, {
344
+ default: W(() => [
345
+ M(s, {
346
+ type: "primary",
347
+ size: o.crud.isMediumSize,
348
+ onClick: o.handleAdd
349
+ }, {
350
+ default: W(() => [...t[2] || (t[2] = [j("新增条件", -1)])]),
351
+ _: 1
352
+ }, 8, ["size", "onClick"]),
353
+ M(s, {
354
+ type: "primary",
355
+ size: o.crud.isMediumSize,
356
+ onClick: o.handleClear
357
+ }, {
358
+ default: W(() => [...t[3] || (t[3] = [j("清空条件", -1)])]),
359
+ _: 1
360
+ }, 8, ["size", "onClick"]),
361
+ M(s, {
362
+ type: "primary",
363
+ size: o.crud.isMediumSize,
364
+ onClick: o.handleValueClear
365
+ }, {
366
+ default: W(() => [...t[4] || (t[4] = [j("清空数据", -1)])]),
367
+ _: 1
368
+ }, 8, ["size", "onClick"])
369
+ ]),
370
+ _: 1
371
+ })]),
372
+ (R(!0), O(T, null, z(a.list, (e, t) => (R(), E(d, {
373
+ key: t,
374
+ md: 12,
375
+ xs: 24,
376
+ sm: 12,
377
+ class: "avue-crud__filter-item"
378
+ }, {
379
+ default: W(() => [
380
+ M(l, {
381
+ modelValue: e.text,
382
+ "onUpdate:modelValue": (t) => e.text = t,
383
+ dic: a.columnOption,
384
+ clearable: !1,
385
+ size: o.crud.isMediumSize,
386
+ class: "avue-crud__filter-label",
387
+ onChange: (e) => o.handleChange(t)
388
+ }, null, 8, [
389
+ "modelValue",
390
+ "onUpdate:modelValue",
391
+ "dic",
392
+ "size",
393
+ "onChange"
394
+ ]),
395
+ M(l, {
396
+ modelValue: e.symbol,
397
+ "onUpdate:modelValue": (t) => e.symbol = t,
398
+ class: "avue-crud__filter-symbol",
399
+ dic: a.symbolDic,
400
+ clearable: !1,
401
+ size: o.crud.isMediumSize
402
+ }, null, 8, [
403
+ "modelValue",
404
+ "onUpdate:modelValue",
405
+ "dic",
406
+ "size"
407
+ ]),
408
+ M(u, {
409
+ modelValue: e.value,
410
+ "onUpdate:modelValue": (t) => e.value = t,
411
+ size: o.crud.isMediumSize,
412
+ class: "avue-crud__filter-value"
413
+ }, null, 8, [
414
+ "modelValue",
415
+ "onUpdate:modelValue",
416
+ "size"
417
+ ]),
418
+ M(s, {
419
+ type: "danger",
420
+ class: "avue-crud__filter-icon",
421
+ circle: "",
422
+ icon: "el-icon-minus",
423
+ onClick: (e) => o.handleDelete(t)
424
+ }, null, 8, ["onClick"])
425
+ ]),
426
+ _: 2
427
+ }, 1024))), 128)),
428
+ M(d, {
429
+ span: 24,
430
+ class: "avue-form__menu avue-form__menu--right"
431
+ }, {
432
+ default: W(() => [M(s, {
433
+ type: "primary",
434
+ size: o.crud.isMediumSize,
435
+ onClick: o.handleSubmit
436
+ }, {
437
+ default: W(() => [...t[5] || (t[5] = [j("确 定", -1)])]),
438
+ _: 1
439
+ }, 8, ["size", "onClick"]), M(s, {
440
+ size: o.crud.isMediumSize,
441
+ onClick: t[0] || (t[0] = (e) => a.box = !1)
442
+ }, {
443
+ default: W(() => [...t[6] || (t[6] = [j("取 消", -1)])]),
444
+ _: 1
445
+ }, 8, ["size"])]),
446
+ _: 1
447
+ })
448
+ ]),
449
+ _: 1
450
+ })]),
451
+ _: 1
452
+ }, 8, ["modelValue", "size"])])) : D("v-if", !0);
453
+ }
454
+ var _t = /* @__PURE__ */ t(pt, [["render", gt]]), Y = (e = {}, t = {}, n = {}, r = []) => {
455
+ let i = e[t.prop], a = t.type, c = t.separator;
456
+ if (t.bind && (i = d(e, t.bind)), q(i)) i = "";
457
+ else {
458
+ let e = o.includes(t.type) && t.multiple, u = l.includes(t.type);
459
+ if ((["string", "number"].includes(t.dataType) || e || u) && !Array.isArray(i) && (i = `${i}`.split(c || ","), t.dataType === "number" && (i = s(i))), re.includes(a)) i = Array.isArray(i) ? i.join(c || " | ") : i.split(c || ",").join(c || " | ");
460
+ else if (a === "password") i = ee(i, "*");
461
+ else if (ne.includes(a) && t.format) {
462
+ let e = t.format.replace("dd", "DD").replace("yyyy", "YYYY"), n = J(Date.now(), "YYYY-MM-DD");
463
+ if (a.indexOf("range") !== -1) {
464
+ let r = i[0] || "", o = i[1] || "";
465
+ a === "timerange" && r.length <= 8 && o.length < 8 && (r = `${n} ${r}`, o = `${n} ${o}`), i = [J(r, e), J(o, e)].join(t.separator || "~");
466
+ } else a === "time" && i.length <= 8 && (i = `${n} ${i}`), i = J(i, e);
467
+ }
468
+ i = m(r, i, t.props || n.props);
469
+ }
470
+ return t.formatter && typeof t.formatter == "function" && (i = t.formatter(e, e[t.prop], i, t)), i;
471
+ }, vt = {
472
+ name: "DialogExcel",
473
+ inject: ["crud"],
474
+ data() {
475
+ return {
476
+ option: {},
477
+ columnOption: {},
478
+ box: !1,
479
+ form: { name: this.crud.tableOption.title }
480
+ };
481
+ },
482
+ methods: {
483
+ handleShow() {
484
+ this.getColumnOption(), this.getOption(), this.box = !0;
485
+ },
486
+ handleSubmit() {
487
+ this.$Export.excel({
488
+ title: this.form.name,
489
+ columns: this.getColumn(),
490
+ data: this.handleSum()
491
+ }), this.box = !1;
492
+ },
493
+ handleSum() {
494
+ let e = this.crud.tableOption, t = this.crud.propOption, n = this.form.type ? this.crud.list : this.crud.tableSelect, r = [];
495
+ return this.form.params.includes("data") && n.forEach((n) => {
496
+ let i = c(n);
497
+ t.forEach((t) => {
498
+ let n = t.parentProp ? (this.crud.cascaderDIC[t.$index] || {})[t.prop] : this.crud.DIC[t.prop];
499
+ i[t.prop] = Y(i, t, e, n);
500
+ }), r.push(i);
501
+ }), this.form.params.includes("sum") && e.showSummary && r.push(this.crud.sumsList), r;
502
+ },
503
+ getOption() {
504
+ this.option = {
505
+ submitBtn: !1,
506
+ emptyBtn: !1,
507
+ column: [
508
+ {
509
+ label: "文件名",
510
+ prop: "name",
511
+ span: 24
512
+ },
513
+ {
514
+ label: "选择数据",
515
+ prop: "type",
516
+ span: 24,
517
+ type: "select",
518
+ dicData: [{
519
+ label: "当前数据(当前页全部的数据)",
520
+ value: !0
521
+ }, {
522
+ label: "选中的数据(当前页选中的数据)",
523
+ disabled: this.crud.tableOption.selection !== !0,
524
+ value: !1
525
+ }]
526
+ },
527
+ {
528
+ label: "选择字段",
529
+ prop: "prop",
530
+ type: "tree",
531
+ multiple: !0,
532
+ checkStrictly: !0,
533
+ span: 24,
534
+ props: { value: "prop" },
535
+ dicData: this.columnOption
536
+ },
537
+ {
538
+ label: "参数设置",
539
+ prop: "params",
540
+ type: "checkbox",
541
+ span: 24,
542
+ value: ["header", "data"].concat((() => {
543
+ let e = [];
544
+ return this.crud.isHeader && e.push("headers"), this.crud.isShowSummary && e.push("sum"), e;
545
+ })()),
546
+ dicData: [{
547
+ label: "表头",
548
+ disabled: !0,
549
+ value: "header"
550
+ }, {
551
+ label: "数据源",
552
+ value: "data"
553
+ }].concat((() => {
554
+ let e = [];
555
+ return e.push({
556
+ label: "复杂表头",
557
+ value: "headers",
558
+ disabled: !this.crud.isHeader
559
+ }), e.push({
560
+ label: "合计统计",
561
+ value: "sum",
562
+ disabled: !this.crud.isShowSummary
563
+ }), e;
564
+ })())
565
+ }
566
+ ]
567
+ }, this.form.type = this.crud.selectLen === 0;
568
+ },
569
+ getColumnOption() {
570
+ let e = c(this.crud.columnOption), t = [], n = (e = []) => {
571
+ e.forEach((r, i) => {
572
+ let a = r.children;
573
+ a && !Array.isArray(a) ? delete r.children : r.showColumn === !1 ? e.splice(i, 1) : (t.push(r.prop), r.children && n(a));
574
+ });
575
+ };
576
+ n(e), this.columnOption = e, this.form.prop = t;
577
+ },
578
+ getColumn() {
579
+ let e = c(this.columnOption), t = this.$refs.form.getPropRef("prop").$refs.temp.getHalfList();
580
+ if (!this.form.params) return [];
581
+ if (this.form.params.includes("headers")) {
582
+ let n = (e = []) => {
583
+ e.forEach((r, i) => {
584
+ t.includes(r.prop) ? r.children && n(r.children) : e.splice(i, 1);
585
+ });
586
+ };
587
+ return n(e), e;
588
+ } else {
589
+ let n = [], r = (e = []) => {
590
+ e.forEach((e) => {
591
+ e.children ? r(e.children) : t.includes(e.prop) && n.push(e);
592
+ });
593
+ };
594
+ return r(e), n;
595
+ }
596
+ }
597
+ }
598
+ }, yt = { key: 0 }, bt = { class: "dialog-footer" };
599
+ function xt(e, t, r, a, o, s) {
600
+ let c = $, l = i, u = n;
601
+ return o.box ? (R(), O("div", yt, [M(u, {
602
+ modelValue: o.box,
603
+ "onUpdate:modelValue": t[2] || (t[2] = (e) => o.box = e),
604
+ title: "导出",
605
+ "lock-scroll": "",
606
+ class: "avue-dialog",
607
+ width: s.crud.isMobile ? "100%" : "30%"
608
+ }, {
609
+ footer: W(() => [k("span", bt, [M(l, {
610
+ type: "primary",
611
+ size: s.crud.isMediumSize,
612
+ onClick: s.handleSubmit
613
+ }, {
614
+ default: W(() => [...t[3] || (t[3] = [j("确定", -1)])]),
615
+ _: 1
616
+ }, 8, ["size", "onClick"]), M(l, {
617
+ size: s.crud.isMediumSize,
618
+ onClick: t[1] || (t[1] = (e) => o.box = !1)
619
+ }, {
620
+ default: W(() => [...t[4] || (t[4] = [j("取消", -1)])]),
621
+ _: 1
622
+ }, 8, ["size"])])]),
623
+ default: W(() => [M(c, {
624
+ modelValue: o.form,
625
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => o.form = e),
626
+ option: o.option
627
+ }, null, 8, ["modelValue", "option"])]),
628
+ _: 1
629
+ }, 8, ["modelValue", "width"])])) : D("v-if", !0);
630
+ }
631
+ var St = /* @__PURE__ */ t(vt, [["render", xt]]), X = {
632
+ menuWidth: 220,
633
+ menuFixed: "right",
634
+ menuXsWidth: 100,
635
+ menuAlign: "center",
636
+ menuHeaderAlign: "center",
637
+ headerAlign: "left",
638
+ cancelBtnIcon: "el-icon-circle-close",
639
+ viewBtnIcon: "el-icon-view",
640
+ editBtnIcon: "el-icon-edit",
641
+ copyBtnIcon: "el-icon-document-add",
642
+ addBtnIcon: "el-icon-plus",
643
+ printBtnIcon: "el-icon-printer",
644
+ excelBtnIcon: "el-icon-download",
645
+ delBtnIcon: "el-icon-delete",
646
+ searchBtnIcon: "el-icon-search",
647
+ emptyBtnIcon: "el-icon-delete",
648
+ saveBtnIcon: "el-icon-circle-plus-outline",
649
+ updateBtnIcon: "el-icon-circle-check",
650
+ columnBtnIcon: "el-icon-s-operation",
651
+ filterBtnIcon: "el-icon-tickets",
652
+ refreshBtnIcon: "el-icon-refresh",
653
+ viewBtn: !1,
654
+ editBtn: !0,
655
+ copyBtn: !1,
656
+ cancelBtn: !0,
657
+ addBtn: !0,
658
+ addRowBtn: !1,
659
+ printBtn: !1,
660
+ excelBtn: !1,
661
+ delBtn: !0,
662
+ cellBtn: !1,
663
+ dateBtn: !1,
664
+ updateBtn: !0,
665
+ saveBtn: !0,
666
+ refreshBtn: !0,
667
+ columnBtn: !0,
668
+ filterBtn: !1,
669
+ queryBtn: !0,
670
+ menuBtn: !1,
671
+ searchBtn: !0,
672
+ clearBtn: !0,
673
+ selectClearBtn: !0,
674
+ searchShow: !0,
675
+ tip: !0,
676
+ dialogWidth: "60%",
677
+ dialogDrag: !1,
678
+ formFullscreen: !1,
679
+ pageBackground: !0,
680
+ page: !0,
681
+ menu: !0,
682
+ indexLabel: "#",
683
+ indexWidth: 50,
684
+ indexFixed: "left",
685
+ selectionWidth: 50,
686
+ selectionFixed: "left",
687
+ expandWidth: 60,
688
+ expandFixed: "left",
689
+ filterMultiple: !0,
690
+ calcHeight: 300,
691
+ width: "100%",
692
+ searchGutter: 20,
693
+ searchLabelWidth: 80,
694
+ searchSpan: 6,
695
+ dropRowClass: ".el-table__body-wrapper > table > tbody",
696
+ dropColClass: ".el-table__header-wrapper tr",
697
+ ghostClass: "avue-crud__ghost"
698
+ }, Ct = {
699
+ name: "DialogColumn",
700
+ inject: ["crud"],
701
+ data() {
702
+ return {
703
+ data: [],
704
+ columnBox: !1
705
+ };
706
+ },
707
+ computed: { defaultColumn() {
708
+ return [
709
+ {
710
+ label: "隐藏",
711
+ prop: "hide"
712
+ },
713
+ {
714
+ label: "冻结",
715
+ prop: "fixed"
716
+ },
717
+ {
718
+ label: "过滤",
719
+ prop: "filters"
720
+ },
721
+ {
722
+ label: "排序",
723
+ prop: "sortable"
724
+ },
725
+ {
726
+ label: "序号",
727
+ prop: "index",
728
+ hide: !0
729
+ },
730
+ {
731
+ label: "宽度",
732
+ prop: "width",
733
+ hide: !0
734
+ }
735
+ ];
736
+ } },
737
+ methods: {
738
+ handleShow() {
739
+ this.data = [], this.crud.propOption.forEach((e) => {
740
+ e.showColumn !== !1 && this.data.push(e);
741
+ }), this.columnBox = !0, this.$nextTick(() => this.rowDrop());
742
+ },
743
+ handleChange(e) {
744
+ ["hide", "filters"].includes(e) && this.crud.refreshTable();
745
+ },
746
+ rowDrop() {
747
+ let e = this.$refs.table.$el.querySelectorAll(X.dropRowClass)[0];
748
+ this.crud.tableDrop("column", e, (e) => {
749
+ let t = e.oldIndex, n = e.newIndex;
750
+ this.crud.headerSort(t, n), this.crud.refreshTable(() => this.rowDrop());
751
+ });
752
+ }
753
+ }
754
+ }, wt = { key: 0 };
755
+ function Tt(e, t, n, r, i, a) {
756
+ let o = w, s = Le, c = Xe, l = S;
757
+ return i.columnBox ? (R(), O("div", wt, [M(l, {
758
+ modelValue: i.columnBox,
759
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => i.columnBox = e),
760
+ class: "avue-crud__dialog avue-crud__column avue-dialog",
761
+ "lock-scroll": "",
762
+ "append-to-body": "",
763
+ title: "列显隐",
764
+ size: a.crud.isMobile ? "100%" : "40%"
765
+ }, {
766
+ default: W(() => [M(c, {
767
+ ref: "table",
768
+ data: i.data,
769
+ height: "100%",
770
+ border: ""
771
+ }, {
772
+ default: W(() => [M(o, {
773
+ key: "label",
774
+ align: "center",
775
+ width: "100",
776
+ "header-align": "center",
777
+ prop: "label",
778
+ label: "列名"
779
+ }), (R(!0), O(T, null, z(a.defaultColumn, (e, t) => (R(), O(T, null, [e.hide === !0 ? D("v-if", !0) : (R(), E(o, {
780
+ key: t,
781
+ label: e.label,
782
+ prop: e.prop,
783
+ align: "center",
784
+ "header-align": "center"
785
+ }, {
786
+ default: W(({ row: t }) => [M(s, {
787
+ modelValue: a.crud.objectOption[t.prop][e.prop],
788
+ "onUpdate:modelValue": (n) => a.crud.objectOption[t.prop][e.prop] = n,
789
+ onChange: (t) => a.handleChange(e.prop)
790
+ }, null, 8, [
791
+ "modelValue",
792
+ "onUpdate:modelValue",
793
+ "onChange"
794
+ ])]),
795
+ _: 2
796
+ }, 1032, ["label", "prop"]))], 64))), 256))]),
797
+ _: 1
798
+ }, 8, ["data"])]),
799
+ _: 1
800
+ }, 8, ["modelValue", "size"])])) : D("v-if", !0);
801
+ }
802
+ var Et = /* @__PURE__ */ t(Ct, [["render", Tt]]), Dt = {
803
+ name: "FyDialogForm",
804
+ components: { ElementDialog: n },
805
+ inject: ["crud"],
806
+ data() {
807
+ return {
808
+ disabled: !1,
809
+ boxType: "",
810
+ fullscreen: !1,
811
+ size: null,
812
+ boxVisible: !1
813
+ };
814
+ },
815
+ computed: {
816
+ option() {
817
+ let e = c(this.crud.tableOption);
818
+ return e.boxType = this.boxType, e.column = c(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), q(e.dicFlag) || e.column.forEach((t) => {
819
+ t.boxType = this.boxType, t.dicFlag = t.dicFlag || e.dicFlag;
820
+ }), e;
821
+ },
822
+ isView() {
823
+ return this.boxType === "view";
824
+ },
825
+ isAdd() {
826
+ return this.boxType === "add";
827
+ },
828
+ isEdit() {
829
+ return this.boxType === "edit";
830
+ },
831
+ direction() {
832
+ return this.crud.tableOption.dialogDirection;
833
+ },
834
+ width() {
835
+ return h(`${this.crud.tableOption.dialogWidth}`, this.crud.isMobile ? "100%" : `${X.dialogWidth}`);
836
+ },
837
+ dialogType() {
838
+ return this.isDrawer ? S : n;
839
+ },
840
+ dialogTop() {
841
+ return !this.isDrawer && !this.fullscreen ? this.crud.tableOption.dialogTop : "0";
842
+ },
843
+ isDrawer() {
844
+ return this.crud.tableOption.dialogType === "drawer";
845
+ },
846
+ params() {
847
+ return this.isDrawer ? {
848
+ size: this.fullscreen ? "100%" : this.width,
849
+ direction: this.crud.tableOption.dialogDirection
850
+ } : {
851
+ width: this.width,
852
+ fullscreen: this.fullscreen
853
+ };
854
+ },
855
+ dialogTitle() {
856
+ let e = `${this.boxType}`;
857
+ return q(this.boxType) ? "" : this.crud.tableOption[`${e}Title`] || {
858
+ tipStartTitle: "当前表格已选择",
859
+ tipEndTitle: "项",
860
+ editTitle: "编 辑",
861
+ copyTitle: "复 制",
862
+ addTitle: "新 增",
863
+ viewTitle: "查 看",
864
+ filterTitle: "过滤条件",
865
+ showTitle: "列显隐"
866
+ }[`${e}Title`];
867
+ },
868
+ dialogMenuPosition() {
869
+ return this.crud.option.dialogMenuPosition || "right";
870
+ }
871
+ },
872
+ methods: {
873
+ optVal: h,
874
+ uploadFun: _,
875
+ submit() {
876
+ this.$refs.tableForm.submit();
877
+ },
878
+ reset() {
879
+ this.$refs.tableForm.resetForm(!1);
880
+ },
881
+ getSlotName(e) {
882
+ return e.replace("Form", "");
883
+ },
884
+ initFun() {
885
+ [
886
+ "clearValidate",
887
+ "validate",
888
+ "resetForm",
889
+ "validateField"
890
+ ].forEach((e) => {
891
+ var t;
892
+ this.crud[e] = (t = this.$refs.tableForm) == null ? void 0 : t[e];
893
+ });
894
+ },
895
+ handleChange() {
896
+ this.crud.setVal();
897
+ },
898
+ handleTabClick(e, t) {
899
+ this.crud.$emit("tab-click", e, t);
900
+ },
901
+ handleFullScreen() {
902
+ this.isDrawer && (q(this.size) ? this.size = "100%" : this.size = ""), this.fullscreen = !this.fullscreen;
903
+ },
904
+ handleError(e) {
905
+ this.crud.$emit("error", e);
906
+ },
907
+ handleSubmit(e, t) {
908
+ this.isAdd ? this.rowSave(t) : this.isEdit && this.rowUpdate(t);
909
+ },
910
+ rowSave(e) {
911
+ this.crud.$emit("row-save", u(this.crud.tableForm, ["$"]), this.closeDialog, e);
912
+ },
913
+ rowUpdate(e) {
914
+ this.crud.$emit("row-update", u(this.crud.tableForm, ["$"]), this.crud.tableIndex, this.closeDialog, e);
915
+ },
916
+ closeDialog(e) {
917
+ e = c(e), e && (() => {
918
+ if (this.isEdit) {
919
+ let { parentList: t, index: n } = this.crud.findData(e[this.crud.rowKey]);
920
+ if (t) {
921
+ let r = t.splice(n, 1)[0];
922
+ e[this.crud.childrenKey] = r[this.crud.childrenKey], t.splice(n, 0, e);
923
+ }
924
+ } else if (this.isAdd) {
925
+ let { item: t } = this.crud.findData(e[this.crud.rowParentKey]);
926
+ t ? (t[this.crud.childrenKey] || (t[this.crud.childrenKey] = []), this.crud.tableOption.lazy && (t[this.crud.hasChildrenKey] = !0), t[this.crud.childrenKey].push(e)) : this.crud.list.push(e);
927
+ }
928
+ })(), this.hide();
929
+ },
930
+ hide(e) {
931
+ let t = () => {
932
+ e == null || e(), this.crud.tableIndex = -1, this.crud.tableForm = {}, this.crud.setVal(), this.boxVisible = !1;
933
+ };
934
+ typeof this.crud.beforeClose == "function" ? this.crud.beforeClose(t, this.boxType) : t();
935
+ },
936
+ show(e) {
937
+ this.boxType = e;
938
+ let t = () => {
939
+ this.fullscreen = this.crud.tableOption.dialogFullscreen, this.boxVisible = !0, this.$nextTick(() => {
940
+ this.initFun();
941
+ });
942
+ };
943
+ typeof this.crud.beforeOpen == "function" ? this.crud.beforeOpen(t, this.boxType) : t();
944
+ }
945
+ }
946
+ };
947
+ function Ot(e, t, n, r, a, o) {
948
+ let s = $, c = i;
949
+ return a.boxVisible ? (R(), E(H(o.dialogType), P({
950
+ key: 0,
951
+ modelValue: a.boxVisible,
952
+ "onUpdate:modelValue": t[2] || (t[2] = (e) => a.boxVisible = e),
953
+ "lock-scroll": "",
954
+ "show-full-screen": "",
955
+ "destroy-on-close": o.crud.tableOption.dialogDestroy,
956
+ "wrapper-closable": o.crud.tableOption.dialogClickModal,
957
+ direction: o.direction,
958
+ class: "dialog-form",
959
+ "custom-class": o.crud.tableOption.dialogCustomClass,
960
+ "modal-append-to-body": "",
961
+ "append-to-body": "",
962
+ top: o.dialogTop,
963
+ title: o.dialogTitle,
964
+ "close-on-press-escape": o.crud.tableOption.dialogEscape,
965
+ "close-on-click-modal": o.optVal(o.crud.tableOption.dialogClickModal, !1),
966
+ modal: o.crud.tableOption.dialogModal,
967
+ "show-close": o.crud.tableOption.dialogCloseBtn
968
+ }, o.params, { "before-close": o.hide }), {
969
+ footer: W(() => [k("span", { class: F(["avue-dialog__footer", `avue-dialog__footer--${o.dialogMenuPosition}`]) }, [
970
+ o.optVal(o.option.submitBtn, !0) && !o.isView ? (R(), E(c, {
971
+ key: 0,
972
+ loading: a.disabled,
973
+ size: o.crud.controlSize,
974
+ icon: o.option.submitIcon,
975
+ type: "primary",
976
+ onClick: o.submit
977
+ }, {
978
+ default: W(() => [j(U(o.option.submitText), 1)]),
979
+ _: 1
980
+ }, 8, [
981
+ "loading",
982
+ "size",
983
+ "icon",
984
+ "onClick"
985
+ ])) : D("v-if", !0),
986
+ o.optVal(o.option.emptyBtn, !0) && !o.isView ? (R(), E(c, {
987
+ key: 1,
988
+ disabled: a.disabled,
989
+ size: o.crud.controlSize,
990
+ icon: o.option.emptyIcon,
991
+ onClick: o.reset
992
+ }, {
993
+ default: W(() => [j(U(o.option.emptyText), 1)]),
994
+ _: 1
995
+ }, 8, [
996
+ "disabled",
997
+ "size",
998
+ "icon",
999
+ "onClick"
1000
+ ])) : D("v-if", !0),
1001
+ B(e.$slots, "menuForm", {
1002
+ disabled: a.disabled,
1003
+ size: o.crud.controlSize,
1004
+ type: a.boxType
1005
+ })
1006
+ ], 2)]),
1007
+ default: W(() => [M(s, P({
1008
+ ref: "tableForm",
1009
+ modelValue: o.crud.tableForm,
1010
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => o.crud.tableForm = e),
1011
+ status: a.disabled,
1012
+ "onUpdate:status": t[1] || (t[1] = (e) => a.disabled = e)
1013
+ }, o.uploadFun({}, o.crud), {
1014
+ option: o.option,
1015
+ onChange: o.handleChange,
1016
+ onSubmit: o.handleSubmit,
1017
+ onResetChange: o.hide,
1018
+ onTabClick: o.handleTabClick,
1019
+ onError: o.handleError
1020
+ }), A({ _: 2 }, [z(o.crud.formSlot, (t) => ({
1021
+ name: o.getSlotName(t),
1022
+ fn: W((n) => [B(e.$slots, t, I(N(Object.assign(n, { type: a.boxType }))))])
1023
+ }))]), 1040, [
1024
+ "modelValue",
1025
+ "status",
1026
+ "option",
1027
+ "onChange",
1028
+ "onSubmit",
1029
+ "onResetChange",
1030
+ "onTabClick",
1031
+ "onError"
1032
+ ])]),
1033
+ _: 3
1034
+ }, 16, [
1035
+ "modelValue",
1036
+ "destroy-on-close",
1037
+ "wrapper-closable",
1038
+ "direction",
1039
+ "custom-class",
1040
+ "top",
1041
+ "title",
1042
+ "close-on-press-escape",
1043
+ "close-on-click-modal",
1044
+ "modal",
1045
+ "show-close",
1046
+ "before-close"
1047
+ ])) : D("v-if", !0);
1048
+ }
1049
+ var kt = /* @__PURE__ */ t(Dt, [["render", Ot]]), At = {
1050
+ name: "TablePage",
1051
+ inject: ["crud"],
1052
+ data() {
1053
+ return { defaultPage: {
1054
+ single: !0,
1055
+ total: 0,
1056
+ pagerCount: 7,
1057
+ currentPage: 1,
1058
+ pageSize: 10,
1059
+ pageSizes: [
1060
+ 10,
1061
+ 20,
1062
+ 30,
1063
+ 40,
1064
+ 50,
1065
+ 100
1066
+ ],
1067
+ layout: "total, sizes, prev, pager, next, jumper",
1068
+ background: !0
1069
+ } };
1070
+ },
1071
+ computed: { pageFlag() {
1072
+ return this.defaultPage.total !== 0;
1073
+ } },
1074
+ watch: {
1075
+ "crud.page": {
1076
+ handler() {
1077
+ this.pageInit();
1078
+ },
1079
+ deep: !0
1080
+ },
1081
+ pageFlag() {
1082
+ this.crud.getTableHeight();
1083
+ },
1084
+ "defaultPage.total"() {
1085
+ 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));
1086
+ }
1087
+ },
1088
+ created() {
1089
+ this.crud.isMobile && (this.defaultPage.layout = "total, sizes, prev, pager, next"), this.pageInit(), this.crud.$emit("on-load", this.defaultPage);
1090
+ },
1091
+ methods: {
1092
+ optVal: h,
1093
+ pageInit() {
1094
+ this.defaultPage = Object.assign(this.defaultPage, this.crud.page), this.updateValue();
1095
+ },
1096
+ updateValue() {
1097
+ this.crud.$emit("update:page", this.defaultPage);
1098
+ },
1099
+ nextClick(e) {
1100
+ this.crud.$emit("next-click", e);
1101
+ },
1102
+ prevClick(e) {
1103
+ this.crud.$emit("prev-click", e);
1104
+ },
1105
+ sizeChange(e) {
1106
+ this.defaultPage.currentPage = 1, this.defaultPage.pageSize = e, this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("size-change", e);
1107
+ },
1108
+ currentChange(e) {
1109
+ this.updateValue(), this.crud.$emit("on-load", this.defaultPage), this.crud.$emit("current-change", e);
1110
+ }
1111
+ }
1112
+ };
1113
+ function jt(e, t, n, r, i, a) {
1114
+ let o = qe, s = Ie;
1115
+ return a.pageFlag && a.optVal(a.crud.tableOption.page, !0) ? (R(), E(s, {
1116
+ key: 0,
1117
+ shadow: a.crud.isCard,
1118
+ class: "avue-pagination"
1119
+ }, {
1120
+ default: W(() => [B(e.$slots, "page"), M(o, {
1121
+ "current-page": i.defaultPage.currentPage,
1122
+ "onUpdate:currentPage": t[0] || (t[0] = (e) => i.defaultPage.currentPage = e),
1123
+ small: a.crud.size === "mini",
1124
+ style: { "margin-top": "25px" },
1125
+ disabled: i.defaultPage.disabled,
1126
+ "hide-on-single-page": i.defaultPage.single,
1127
+ "pager-count": i.defaultPage.pagerCount,
1128
+ background: i.defaultPage.background,
1129
+ "page-size": i.defaultPage.pageSize,
1130
+ "page-sizes": i.defaultPage.pageSizes,
1131
+ layout: i.defaultPage.layout,
1132
+ total: i.defaultPage.total,
1133
+ onSizeChange: a.sizeChange,
1134
+ onPrevClick: a.prevClick,
1135
+ onNextClick: a.nextClick,
1136
+ onCurrentChange: a.currentChange
1137
+ }, null, 8, [
1138
+ "current-page",
1139
+ "small",
1140
+ "disabled",
1141
+ "hide-on-single-page",
1142
+ "pager-count",
1143
+ "background",
1144
+ "page-size",
1145
+ "page-sizes",
1146
+ "layout",
1147
+ "total",
1148
+ "onSizeChange",
1149
+ "onPrevClick",
1150
+ "onNextClick",
1151
+ "onCurrentChange"
1152
+ ])]),
1153
+ _: 3
1154
+ }, 8, ["shadow"])) : D("v-if", !0);
1155
+ }
1156
+ var Mt = /* @__PURE__ */ t(At, [["render", jt]]), Z = {}, Nt = {
1157
+ name: "ColumnSlot",
1158
+ inject: ["dynamic", "crud"],
1159
+ props: {
1160
+ column: Object,
1161
+ columnOption: Array
1162
+ },
1163
+ created() {
1164
+ let e = [
1165
+ "getColumnProp",
1166
+ "handleFilterMethod",
1167
+ "handleFilters"
1168
+ ];
1169
+ Object.keys(this.dynamic).forEach((t) => {
1170
+ e.includes(t) && (this[t] = this.dynamic[t]);
1171
+ });
1172
+ },
1173
+ methods: {
1174
+ isBlank: q,
1175
+ optVal: h,
1176
+ uploadFun: _,
1177
+ isMediaType(t, n) {
1178
+ return e(t, n);
1179
+ },
1180
+ vaildLabel(e, t, n) {
1181
+ if (e.rules && t.$cellEdit) return n;
1182
+ },
1183
+ columnChange(e, t, n) {
1184
+ let r = `${n}-${t.prop}`;
1185
+ Z[r] || (this.handleChange(t, e), typeof t.change == "function" && t.cell === !0 && t.change({
1186
+ row: e,
1187
+ column: t,
1188
+ index: n,
1189
+ value: e[t.prop]
1190
+ })), Z[r] = !0, this.$nextTick(() => {
1191
+ Z[r] = !1;
1192
+ });
1193
+ },
1194
+ handleChange(e, t) {
1195
+ e.cascader && this.$nextTick(() => {
1196
+ let n = e.cascader;
1197
+ n.forEach((r) => {
1198
+ let i = r, o = t[e.prop], s = t.$index, c = this.findObject(this.columnOption, i);
1199
+ q(c) || (q(this.crud.cascaderDIC[s]) && (this.crud.cascaderDIC[s] = {}), this.crud.cascaderIndexList.includes(s) && n.forEach((e) => {
1200
+ this.crud.cascaderDIC[s][e.prop] = [], n.forEach((e) => t[e] = "");
1201
+ }), !(q(n) || q(o) || q(c)) && b({
1202
+ column: c,
1203
+ value: o,
1204
+ form: t
1205
+ }).then((e) => {
1206
+ let n = e || [];
1207
+ this.crud.cascaderIndexList.includes(s) || this.crud.cascaderIndexList.push(s), this.crud.cascaderDicList[s] || (this.crud.cascaderDicList[s] = {}), this.crud.cascaderDicList[s][i] || (this.crud.cascaderDicList[s][i] = n), this.crud.cascaderDIC[s][i] = n, !q(n[c.cascaderIndex]) && !q(n) && !q(c.cascaderIndex) && (t[i] = n[c.cascaderIndex][(c.props || {}).value || a.value]);
1208
+ }));
1209
+ });
1210
+ });
1211
+ },
1212
+ handleDetail(e, t) {
1213
+ let n = t.parentProp ? (this.crud.cascaderDIC[e.$index] || {})[t.prop] : this.crud.DIC[t.prop], r = Y(e, t, this.crud.tableOption, n);
1214
+ return !q(n) && this.crud.tableOption.filterDic !== !0 && (e[`$${t.prop}`] = r), r;
1215
+ },
1216
+ corArray(e, t) {
1217
+ let n = this.handleDetail(e, t);
1218
+ return Array.isArray(n) || (n = q(n) ? [] : n.split(" | ")), c(n);
1219
+ },
1220
+ openImg(e, t, n) {
1221
+ let r = this.getImgList(e, t);
1222
+ r = r.map((e) => ({
1223
+ thumbUrl: e,
1224
+ url: e,
1225
+ type: t.fileType
1226
+ })), this.$ImagePreview(r, n);
1227
+ },
1228
+ getImgList(e, t) {
1229
+ var n, r;
1230
+ let i = ((n = t.propsHttp) == null ? void 0 : n.home) || "", o = ((r = t.props) == null ? void 0 : r.value) || a.value, s = this.corArray(e, t);
1231
+ return s.forEach((e, t) => {
1232
+ s[t] = i + (e[o] ? e[o] : e);
1233
+ }), s;
1234
+ }
1235
+ }
1236
+ }, Pt = { key: 1 }, Ft = {
1237
+ key: 0,
1238
+ class: "avue-crud__img"
1239
+ }, It = ["src", "onClick"], Lt = { key: 1 }, Rt = { key: 2 }, zt = ["innerHTML"], Bt = ["textContent"];
1240
+ function Vt(e, t, n, r, i, a) {
1241
+ let o = Dn, s = $e, c = C, l = Ge, u = Ce, d = Se, f = w;
1242
+ return e.getColumnProp(n.column, "hide") ? (R(), E(f, {
1243
+ key: n.column.prop,
1244
+ prop: n.column.prop,
1245
+ label: n.column.label,
1246
+ "column-key": n.column.prop,
1247
+ "filter-placement": "bottom-end",
1248
+ filters: e.getColumnProp(n.column, "filters"),
1249
+ "filter-method": e.getColumnProp(n.column, "filterMethod") ? e.handleFilterMethod : void 0,
1250
+ "filter-multiple": a.optVal(n.column.filterMultiple, !0),
1251
+ "show-overflow-tooltip": n.column.overHidden,
1252
+ "min-width": n.column.minWidth,
1253
+ sortable: e.getColumnProp(n.column, "sortable"),
1254
+ "sort-method": n.column.sortMethod,
1255
+ "sort-orders": n.column.sortOrders,
1256
+ "sort-by": n.column.sortBy,
1257
+ resizable: n.column.resizable,
1258
+ "render-header": n.column.renderHeader,
1259
+ align: n.column.align || a.crud.tableOption.align,
1260
+ "header-align": n.column.headerAlign || a.crud.tableOption.headerAlign,
1261
+ width: e.getColumnProp(n.column, "width"),
1262
+ fixed: e.getColumnProp(n.column, "fixed")
1263
+ }, {
1264
+ header: W(({ $index: t }) => [a.crud.getSlotName(n.column, "H", a.crud.$slots) ? B(e.$slots, a.crud.getSlotName(n.column, "H"), I(P({ key: 0 }, {
1265
+ column: n.column,
1266
+ $index: t
1267
+ }))) : (R(), O("span", Pt, U(n.column.label), 1))]),
1268
+ default: W(({ row: t, $index: r }) => [t.$cellEdit && n.column.cell ? (R(), E(c, {
1269
+ key: 0,
1270
+ prop: a.crud.isTree ? "" : `list.${r}.${n.column.prop}`,
1271
+ label: a.vaildLabel(n.column, t, " "),
1272
+ "label-width": a.vaildLabel(n.column, t, "1px"),
1273
+ rules: n.column.rules
1274
+ }, {
1275
+ default: W(() => [M(s, {
1276
+ content: (a.crud.listError[`list.${r}.${n.column.prop}`] || {}).msg,
1277
+ disabled: !(a.crud.listError[`list.${r}.${n.column.prop}`] || {}).valid,
1278
+ placement: "top"
1279
+ }, {
1280
+ default: W(() => [a.crud.getSlotName(n.column, "F", a.crud.$slots) ? B(e.$slots, a.crud.getSlotName(n.column, "F"), I(P({ key: 0 }, {
1281
+ row: t,
1282
+ dic: a.crud.DIC[n.column.prop],
1283
+ size: a.crud.isMediumSize,
1284
+ index: r,
1285
+ disabled: a.crud.btnDisabledList[r],
1286
+ label: a.handleDetail(t, n.column),
1287
+ $cell: t.$cellEdit
1288
+ }))) : (R(), E(o, P({ key: 1 }, a.uploadFun(n.column, a.crud), {
1289
+ modelValue: t[n.column.prop],
1290
+ "onUpdate:modelValue": (e) => t[n.column.prop] = e,
1291
+ column: n.column,
1292
+ size: a.crud.isMediumSize,
1293
+ "table-data": {
1294
+ index: r,
1295
+ row: t,
1296
+ label: a.handleDetail(t, n.column)
1297
+ },
1298
+ dic: (a.crud.cascaderDIC[r] || {})[n.column.prop] || a.crud.DIC[n.column.prop],
1299
+ props: n.column.props || a.crud.tableOption.props,
1300
+ readonly: n.column.readonly,
1301
+ disabled: a.crud.disabled || a.crud.tableOption.disabled || n.column.disabled || a.crud.btnDisabledList[r],
1302
+ clearable: a.optVal(n.column.clearable, !1),
1303
+ "column-slot": a.crud.mainSlot,
1304
+ onChange: (e) => a.columnChange(t, n.column, r)
1305
+ }), A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
1306
+ name: t,
1307
+ fn: W((n) => [B(e.$slots, t, I(N(n)))])
1308
+ }))]), 1040, [
1309
+ "modelValue",
1310
+ "onUpdate:modelValue",
1311
+ "column",
1312
+ "size",
1313
+ "table-data",
1314
+ "dic",
1315
+ "props",
1316
+ "readonly",
1317
+ "disabled",
1318
+ "clearable",
1319
+ "column-slot",
1320
+ "onChange"
1321
+ ]))]),
1322
+ _: 2
1323
+ }, 1032, ["content", "disabled"])]),
1324
+ _: 2
1325
+ }, 1032, [
1326
+ "prop",
1327
+ "label",
1328
+ "label-width",
1329
+ "rules"
1330
+ ])) : a.crud.$slots[n.column.prop] ? B(e.$slots, n.column.prop, {
1331
+ key: 1,
1332
+ row: t,
1333
+ index: r,
1334
+ dic: a.crud.DIC[n.column.prop],
1335
+ size: a.crud.isMediumSize,
1336
+ label: a.handleDetail(t, n.column)
1337
+ }) : (R(), O(T, { key: 2 }, [["img", "upload"].includes(n.column.type) ? (R(), O("span", Ft, [(R(!0), O(T, null, z(a.getImgList(t, n.column), (e, r) => (R(), O(T, null, [a.isMediaType(e, n.column.fileType) ? (R(), E(H(a.isMediaType(e, n.column.fileType)), {
1338
+ key: r,
1339
+ src: e,
1340
+ onClick: K((e) => a.openImg(t, n.column, r), ["stop"])
1341
+ }, null, 8, ["src", "onClick"])) : (R(), O("i", {
1342
+ key: `e_${r}`,
1343
+ src: e,
1344
+ class: "el-icon-document",
1345
+ onClick: K((e) => a.openImg(t, n.column, r), ["stop"])
1346
+ }, null, 8, It))], 64))), 256))])) : n.column.type === "url" ? (R(), O("span", Lt, [(R(!0), O(T, null, z(a.corArray(t, n.column), (e, t) => (R(), E(l, {
1347
+ key: t,
1348
+ type: "primary",
1349
+ href: e,
1350
+ target: n.column.target || "_blank"
1351
+ }, {
1352
+ default: W(() => [j(U(e), 1)]),
1353
+ _: 2
1354
+ }, 1032, ["href", "target"]))), 128))])) : n.column.type === "rate" ? (R(), O("span", Rt, [M(u, {
1355
+ modelValue: t[n.column.prop],
1356
+ "onUpdate:modelValue": (e) => t[n.column.prop] = e,
1357
+ disabled: ""
1358
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])])) : n.column.type === "color" ? (R(), O("i", {
1359
+ key: 3,
1360
+ class: "avue-crud__color",
1361
+ style: L({ backgroundColor: t[n.column.prop] })
1362
+ }, null, 4)) : n.column.type === "icon" ? (R(), E(d, {
1363
+ key: 4,
1364
+ text: t[n.column.prop]
1365
+ }, null, 8, ["text"])) : n.column.html ? (R(), O("span", {
1366
+ key: 5,
1367
+ innerHTML: a.handleDetail(t, n.column)
1368
+ }, null, 8, zt)) : (R(), O("span", {
1369
+ key: 6,
1370
+ textContent: U(a.handleDetail(t, n.column))
1371
+ }, null, 8, Bt))], 64))]),
1372
+ _: 3
1373
+ }, 8, [
1374
+ "prop",
1375
+ "label",
1376
+ "column-key",
1377
+ "filters",
1378
+ "filter-method",
1379
+ "filter-multiple",
1380
+ "show-overflow-tooltip",
1381
+ "min-width",
1382
+ "sortable",
1383
+ "sort-method",
1384
+ "sort-orders",
1385
+ "sort-by",
1386
+ "resizable",
1387
+ "render-header",
1388
+ "align",
1389
+ "header-align",
1390
+ "width",
1391
+ "fixed"
1392
+ ])) : D("v-if", !0);
1393
+ }
1394
+ var Ht = /* @__PURE__ */ t(Nt, [["render", Vt]]), Ut = {
1395
+ name: "ColumnDynamic",
1396
+ inject: ["dynamic", "crud"],
1397
+ props: { columnOption: Object },
1398
+ created() {
1399
+ let e = [
1400
+ "getColumnProp",
1401
+ "handleFilterMethod",
1402
+ "handleFilters"
1403
+ ];
1404
+ Object.keys(this.dynamic).forEach((t) => {
1405
+ e.includes(t) && (this[t] = this.dynamic[t]);
1406
+ });
1407
+ },
1408
+ methods: { optVal: h }
1409
+ };
1410
+ function Wt(e, t, n, r, i, a) {
1411
+ let o = tt("ColumnDynamic", !0), s = Ht, c = w;
1412
+ return e.getColumnProp(n.columnOption, "hide") ? (R(), E(c, {
1413
+ key: n.columnOption.prop,
1414
+ prop: n.columnOption.prop,
1415
+ label: n.columnOption.label,
1416
+ "filter-placement": "bottom-end",
1417
+ filters: e.getColumnProp(n.columnOption, "filters"),
1418
+ "filter-method": e.getColumnProp(n.columnOption, "filterMethod") ? e.handleFilterMethod : void 0,
1419
+ "filter-multiple": a.optVal(n.columnOption.filterMultiple, !0),
1420
+ "show-overflow-tooltip": n.columnOption.overHidden,
1421
+ "min-width": n.columnOption.minWidth,
1422
+ sortable: e.getColumnProp(n.columnOption, "sortable"),
1423
+ "render-header": n.columnOption.renderHeader,
1424
+ align: n.columnOption.align || a.crud.tableOption.align,
1425
+ "header-align": n.columnOption.headerAlign || a.crud.tableOption.headerAlign,
1426
+ width: e.getColumnProp(n.columnOption, "width"),
1427
+ fixed: e.getColumnProp(n.columnOption, "fixed")
1428
+ }, {
1429
+ default: W(() => [(R(!0), O(T, null, z(n.columnOption.children, (t) => (R(), O(T, null, [t.children && t.children.length > 0 ? (R(), E(o, {
1430
+ key: t.prop,
1431
+ "column-option": t
1432
+ }, A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
1433
+ name: t,
1434
+ fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
1435
+ }))]), 1032, ["column-option"])) : (R(), E(s, {
1436
+ key: t.prop,
1437
+ column: t,
1438
+ "column-option": n.columnOption.children
1439
+ }, A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
1440
+ name: t,
1441
+ fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
1442
+ }))]), 1032, ["column", "column-option"]))], 64))), 256))]),
1443
+ _: 3
1444
+ }, 8, [
1445
+ "prop",
1446
+ "label",
1447
+ "filters",
1448
+ "filter-method",
1449
+ "filter-multiple",
1450
+ "show-overflow-tooltip",
1451
+ "min-width",
1452
+ "sortable",
1453
+ "render-header",
1454
+ "align",
1455
+ "header-align",
1456
+ "width",
1457
+ "fixed"
1458
+ ])) : D("v-if", !0);
1459
+ }
1460
+ var Gt = /* @__PURE__ */ t(Ut, [["render", Wt]]), Kt = {
1461
+ name: "Column",
1462
+ inject: ["crud"],
1463
+ provide() {
1464
+ return {
1465
+ crud: this.crud,
1466
+ dynamic: this
1467
+ };
1468
+ },
1469
+ props: { columnOption: Array },
1470
+ computed: { list() {
1471
+ let e = [...this.columnOption];
1472
+ return e = te(e, "index", (e, t) => {
1473
+ var n, r;
1474
+ return ((n = this.crud.objectOption[e.prop]) == null ? void 0 : n.index) - ((r = this.crud.objectOption[t.prop]) == null ? void 0 : r.index);
1475
+ }), e;
1476
+ } },
1477
+ methods: {
1478
+ handleFilterMethod(e, t, n) {
1479
+ let r = this.columnOption.filter((e) => e.prop === n.property)[0];
1480
+ return typeof r.filterMethod == "function" ? r.filterMethod(e, t, r) : t[r.prop] === e;
1481
+ },
1482
+ handleFilters(e, t) {
1483
+ if (t !== !0) return;
1484
+ let n = this.crud.DIC[e.prop] || [], r = [];
1485
+ return q(n) ? this.crud.cellForm.list.forEach((t) => {
1486
+ r.map((e) => e.text).includes(t[e.prop]) || r.push({
1487
+ text: t[e.prop],
1488
+ value: t[e.prop]
1489
+ });
1490
+ }) : n.forEach((t) => {
1491
+ let n = e.props || this.crud.tableOption.props || {};
1492
+ r.push({
1493
+ text: t[n.label || a.label],
1494
+ value: t[n.value || a.value]
1495
+ });
1496
+ }), r;
1497
+ },
1498
+ getColumnProp(e, t) {
1499
+ let n = this.crud.objectOption[e.prop] || {};
1500
+ if (t === "filterMethod") return n == null ? void 0 : n.filters;
1501
+ if (this.crud.isMobile && ["fixed"].includes(t)) return !1;
1502
+ let r = n == null ? void 0 : n[t];
1503
+ if (!(t === "width" && r === 0)) return t === "filters" ? this.handleFilters(e, r) : t === "hide" ? (n == null ? void 0 : n.hide) !== !0 : r;
1504
+ }
1505
+ }
1506
+ };
1507
+ function qt(e, t, n, r, i, a) {
1508
+ let o = Gt, s = Ht;
1509
+ return R(), O(T, null, [
1510
+ B(e.$slots, "header"),
1511
+ D(" 动态列 "),
1512
+ (R(!0), O(T, null, z(a.list, (t) => (R(), O(T, null, [t.children && t.children.length > 0 ? (R(), E(o, {
1513
+ key: t.pop,
1514
+ "column-option": t
1515
+ }, A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
1516
+ name: t,
1517
+ fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
1518
+ }))]), 1032, ["column-option"])) : (R(), E(s, {
1519
+ key: t.prop,
1520
+ column: t,
1521
+ "column-option": n.columnOption
1522
+ }, A({ _: 2 }, [z(a.crud.mainSlot, (t) => ({
1523
+ name: t,
1524
+ fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
1525
+ }))]), 1032, ["column", "column-option"]))], 64))), 256)),
1526
+ B(e.$slots, "footer")
1527
+ ], 64);
1528
+ }
1529
+ var Jt = /* @__PURE__ */ t(Kt, [["render", qt]]), Q = (() => {
1530
+ function e(e, t) {
1531
+ t.value === !1 ? e.style.display = "none" : e.style.display = "";
1532
+ }
1533
+ return {
1534
+ bind(t, n) {
1535
+ e(t, n);
1536
+ },
1537
+ update(t, n) {
1538
+ e(t, n);
1539
+ }
1540
+ };
1541
+ })(), Yt = {
1542
+ name: "ColumnMenu",
1543
+ directives: { permission: Q },
1544
+ inject: {
1545
+ crud: { from: "crud" },
1546
+ AVUE: {
1547
+ from: r,
1548
+ default: null
1549
+ }
1550
+ },
1551
+ data() {
1552
+ return { config: X };
1553
+ },
1554
+ computed: {
1555
+ menuType() {
1556
+ var e;
1557
+ return this.crud.tableOption.menuType || ((e = this.AVUE) == null ? void 0 : e.menuType) || "button";
1558
+ },
1559
+ isIconMenu() {
1560
+ return this.menuType === "icon";
1561
+ },
1562
+ isTextMenu() {
1563
+ return this.menuType === "text";
1564
+ },
1565
+ isMenu() {
1566
+ return this.menuType === "menu";
1567
+ }
1568
+ },
1569
+ methods: {
1570
+ optVal: h,
1571
+ menuText(e) {
1572
+ return ["text", "menu"].includes(this.menuType) ? "text" : e;
1573
+ }
1574
+ }
1575
+ };
1576
+ function Xt(e, t, n, r, a, o) {
1577
+ let s = i, c = Ve, l = He, u = Be, d = w, f = V("permission");
1578
+ return R(), O(T, null, [D(" 操作栏 "), o.optVal(o.crud.tableOption.menu, a.config.menu) && o.crud.getPermission("menu") ? (R(), E(d, {
1579
+ key: "menu",
1580
+ class: "avue-crud__btn",
1581
+ prop: "menu",
1582
+ fixed: o.optVal(o.crud.tableOption.menuFixed, a.config.menuFixed),
1583
+ label: o.crud.tableOption.menuTitle || "操作",
1584
+ align: o.crud.tableOption.menuAlign || a.config.menuAlign,
1585
+ "header-align": o.crud.tableOption.menuHeaderAlign || a.config.menuHeaderAlign,
1586
+ width: o.crud.isMobile ? o.crud.tableOption.menuXsWidth || a.config.menuXsWidth : o.crud.tableOption.menuWidth || a.config.menuWidth
1587
+ }, {
1588
+ default: W(({ row: n, $index: r }) => [o.isMenu ? (R(), E(u, {
1589
+ key: 0,
1590
+ size: o.crud.isMediumSize
1591
+ }, {
1592
+ dropdown: W(() => [M(l, null, {
1593
+ default: W(() => [
1594
+ o.optVal(o.crud.tableOption.viewBtn, a.config.viewBtn) ? G((R(), E(c, {
1595
+ key: 0,
1596
+ icon: o.crud.getBtnIcon("viewBtn"),
1597
+ onClick: (e) => o.crud.rowView(n, r)
1598
+ }, {
1599
+ default: W(() => [j(U(o.crud.menuIcon("viewBtn")), 1)]),
1600
+ _: 1
1601
+ }, 8, ["icon", "onClick"])), [[f, o.crud.getPermission("viewBtn", n, r)]]) : D("v-if", !0),
1602
+ o.optVal(o.crud.tableOption.editBtn, a.config.editBtn) ? G((R(), E(c, {
1603
+ key: 1,
1604
+ icon: o.crud.getBtnIcon("editBtn"),
1605
+ onClick: (e) => o.crud.rowEdit(n, r)
1606
+ }, {
1607
+ default: W(() => [j(U(o.crud.menuIcon("editBtn")), 1)]),
1608
+ _: 1
1609
+ }, 8, ["icon", "onClick"])), [[f, o.crud.getPermission("editBtn", n, r)]]) : D("v-if", !0),
1610
+ o.optVal(o.crud.tableOption.copyBtn, a.config.copyBtn) ? G((R(), E(c, {
1611
+ key: 2,
1612
+ icon: o.crud.getBtnIcon("copyBtn"),
1613
+ onClick: (e) => o.crud.rowCopy(n)
1614
+ }, {
1615
+ default: W(() => [j(U(o.crud.menuIcon("copyBtn")), 1)]),
1616
+ _: 1
1617
+ }, 8, ["icon", "onClick"])), [[f, o.crud.getPermission("copyBtn", n, r)]]) : D("v-if", !0),
1618
+ o.optVal(o.crud.tableOption.delBtn, a.config.delBtn) ? G((R(), E(c, {
1619
+ key: 3,
1620
+ icon: o.crud.getBtnIcon("delBtn"),
1621
+ onClick: (e) => o.crud.rowDel(n, r)
1622
+ }, {
1623
+ default: W(() => [j(U(o.crud.menuIcon("delBtn")), 1)]),
1624
+ _: 1
1625
+ }, 8, ["icon", "onClick"])), [[f, o.crud.getPermission("delBtn", n, r)]]) : D("v-if", !0),
1626
+ B(e.$slots, "menuBtn", {
1627
+ row: n,
1628
+ type: o.menuText("primary"),
1629
+ disabled: o.crud.btnDisabled,
1630
+ size: o.crud.isMediumSize,
1631
+ index: r
1632
+ })
1633
+ ]),
1634
+ _: 2
1635
+ }, 1024)]),
1636
+ default: W(() => [M(s, {
1637
+ text: "",
1638
+ size: o.crud.isMediumSize
1639
+ }, {
1640
+ default: W(() => [j(U(o.crud.tableOption.menuBtnTitle || "按钮") + " ", 1), t[0] || (t[0] = k("i", { class: "el-icon-arrow-down el-icon--right" }, null, -1))]),
1641
+ _: 1
1642
+ }, 8, ["size"])]),
1643
+ _: 2
1644
+ }, 1032, ["size"])) : [
1645
+ "button",
1646
+ "text",
1647
+ "icon"
1648
+ ].includes(o.menuType) ? (R(), O(T, { key: 1 }, [
1649
+ o.optVal(o.crud.tableOption.cellBtn, a.config.cellBtn) ? (R(), O(T, { key: 0 }, [o.optVal(o.crud.tableOption.editBtn, a.config.editBtn) && !n.$cellEdit ? G((R(), E(s, {
1650
+ key: 0,
1651
+ type: o.menuText("primary"),
1652
+ icon: o.crud.getBtnIcon("editBtn"),
1653
+ size: o.crud.isMediumSize,
1654
+ disabled: o.crud.btnDisabledList[r],
1655
+ onClick: K((e) => o.crud.rowCell(n, r), ["stop"])
1656
+ }, {
1657
+ default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("editBtn")), 1)], 64))]),
1658
+ _: 1
1659
+ }, 8, [
1660
+ "type",
1661
+ "icon",
1662
+ "size",
1663
+ "disabled",
1664
+ "onClick"
1665
+ ])), [[f, o.crud.getPermission("editBtn", n, r)]]) : o.optVal(o.crud.tableOption.saveBtn, a.config.saveBtn) && n.$cellEdit ? G((R(), E(s, {
1666
+ key: 1,
1667
+ type: o.menuText("primary"),
1668
+ icon: o.crud.getBtnIcon("saveBtn"),
1669
+ size: o.crud.isMediumSize,
1670
+ disabled: o.crud.btnDisabledList[r],
1671
+ onClick: K((e) => o.crud.rowCell(n, r), ["stop"])
1672
+ }, {
1673
+ default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("saveBtn")), 1)], 64))]),
1674
+ _: 1
1675
+ }, 8, [
1676
+ "type",
1677
+ "icon",
1678
+ "size",
1679
+ "disabled",
1680
+ "onClick"
1681
+ ])), [[f, o.crud.getPermission("saveBtn", n, r)]]) : D("v-if", !0), n.$cellEdit ? (R(), E(s, {
1682
+ key: 2,
1683
+ type: o.menuText("danger"),
1684
+ icon: o.crud.getBtnIcon("cancelBtn"),
1685
+ size: o.crud.isMediumSize,
1686
+ disabled: o.crud.btnDisabledList[r],
1687
+ onClick: K((e) => o.crud.rowCancel(n, r), ["stop"])
1688
+ }, {
1689
+ default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("cancelBtn")), 1)], 64))]),
1690
+ _: 1
1691
+ }, 8, [
1692
+ "type",
1693
+ "icon",
1694
+ "size",
1695
+ "disabled",
1696
+ "onClick"
1697
+ ])) : D("v-if", !0)], 64)) : D("v-if", !0),
1698
+ o.optVal(o.crud.tableOption.viewBtn, a.config.viewBtn) ? G((R(), E(s, {
1699
+ key: 1,
1700
+ type: o.menuText("success"),
1701
+ icon: o.crud.getBtnIcon("viewBtn"),
1702
+ size: o.crud.isMediumSize,
1703
+ disabled: e.btnDisabled,
1704
+ onClick: K((e) => o.crud.rowView(n, r), ["stop"])
1705
+ }, {
1706
+ default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("viewBtn")), 1)], 64))]),
1707
+ _: 1
1708
+ }, 8, [
1709
+ "type",
1710
+ "icon",
1711
+ "size",
1712
+ "disabled",
1713
+ "onClick"
1714
+ ])), [[f, o.crud.getPermission("viewBtn", n, r)]]) : D("v-if", !0),
1715
+ o.optVal(o.crud.tableOption.editBtn, a.config.editBtn) && !o.crud.tableOption.cellBtn ? G((R(), E(s, {
1716
+ key: 2,
1717
+ type: o.menuText("primary"),
1718
+ icon: o.crud.getBtnIcon("editBtn"),
1719
+ size: o.crud.isMediumSize,
1720
+ disabled: e.btnDisabled,
1721
+ onClick: K((e) => o.crud.rowEdit(n, r), ["stop"])
1722
+ }, {
1723
+ default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("editBtn")), 1)], 64))]),
1724
+ _: 1
1725
+ }, 8, [
1726
+ "type",
1727
+ "icon",
1728
+ "size",
1729
+ "disabled",
1730
+ "onClick"
1731
+ ])), [[f, o.crud.getPermission("editBtn", n, r)]]) : D("v-if", !0),
1732
+ o.optVal(o.crud.tableOption.copyBtn, a.config.copyBtn) ? G((R(), E(s, {
1733
+ key: 3,
1734
+ type: o.menuText("primary"),
1735
+ icon: o.crud.getBtnIcon("copyBtn"),
1736
+ size: o.crud.isMediumSize,
1737
+ disabled: e.btnDisabled,
1738
+ onClick: K((e) => o.crud.rowCopy(n), ["stop"])
1739
+ }, {
1740
+ default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("copyBtn")), 1)], 64))]),
1741
+ _: 1
1742
+ }, 8, [
1743
+ "type",
1744
+ "icon",
1745
+ "size",
1746
+ "disabled",
1747
+ "onClick"
1748
+ ])), [[f, o.crud.getPermission("copyBtn", n, r)]]) : D("v-if", !0),
1749
+ o.optVal(o.crud.tableOption.delBtn, a.config.delBtn) && !n.$cellEdit ? G((R(), E(s, {
1750
+ key: 4,
1751
+ type: o.menuText("danger"),
1752
+ icon: o.crud.getBtnIcon("delBtn"),
1753
+ size: o.crud.isMediumSize,
1754
+ disabled: e.btnDisabled,
1755
+ onClick: K((e) => o.crud.rowDel(n, r), ["stop"])
1756
+ }, {
1757
+ default: W(() => [o.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("delBtn")), 1)], 64))]),
1758
+ _: 1
1759
+ }, 8, [
1760
+ "type",
1761
+ "icon",
1762
+ "size",
1763
+ "disabled",
1764
+ "onClick"
1765
+ ])), [[f, o.crud.getPermission("delBtn", n, r)]]) : D("v-if", !0)
1766
+ ], 64)) : D("v-if", !0), B(e.$slots, "menu", {
1767
+ row: n,
1768
+ type: o.menuText("primary"),
1769
+ disabled: o.crud.btnDisabled,
1770
+ size: o.crud.isMediumSize,
1771
+ index: r
1772
+ })]),
1773
+ _: 3
1774
+ }, 8, [
1775
+ "fixed",
1776
+ "label",
1777
+ "align",
1778
+ "header-align",
1779
+ "width"
1780
+ ])) : D("v-if", !0)], 2112);
1781
+ }
1782
+ var Zt = /* @__PURE__ */ t(Yt, [["render", Xt]]), Qt = {
1783
+ name: "ColumnDefault",
1784
+ inject: ["crud"],
1785
+ data() {
1786
+ return { config: X };
1787
+ },
1788
+ mounted() {
1789
+ this.setSort();
1790
+ },
1791
+ methods: {
1792
+ optVal: h,
1793
+ indexMethod(e) {
1794
+ return e + 1 + ((this.crud.page.currentPage || 1) - 1) * (this.crud.page.pageSize || 10);
1795
+ },
1796
+ setSort() {
1797
+ this.rowDrop(), this.columnDrop();
1798
+ },
1799
+ rowDrop() {
1800
+ let e = this.crud.$refs.table.$el.querySelectorAll(this.config.dropRowClass)[0];
1801
+ this.crud.tableDrop("row", e, (e) => {
1802
+ let t = e.oldIndex, n = e.newIndex, r = this.crud.list.splice(t, 1)[0];
1803
+ this.crud.list.splice(n, 0, r), this.crud.$emit("sortable-change", t, n), this.crud.refreshTable(() => this.rowDrop());
1804
+ });
1805
+ },
1806
+ columnDrop() {
1807
+ let e = this.crud.$refs.table.$el.querySelector(this.config.dropColClass), t = 0;
1808
+ [
1809
+ "selection",
1810
+ "index",
1811
+ "expand"
1812
+ ].forEach((e) => {
1813
+ this.crud.tableOption[e] && (t += 1);
1814
+ }), this.crud.tableDrop("column", e, (e) => {
1815
+ this.crud.headerSort(e.oldIndex - t, e.newIndex - t), this.columnDrop();
1816
+ });
1817
+ }
1818
+ }
1819
+ };
1820
+ function $t(e, t, n, r, i, a) {
1821
+ let o = w;
1822
+ return R(), O(T, null, [
1823
+ M(o, { width: "1px" }),
1824
+ D(" 折叠面板 "),
1825
+ a.crud.tableOption.expand ? (R(), E(o, {
1826
+ key: "expand",
1827
+ type: "expand",
1828
+ width: a.crud.tableOption.expandWidth || i.config.expandWidth,
1829
+ fixed: a.optVal(a.crud.tableOption.expandFixed, i.config.expandFixed),
1830
+ align: "center"
1831
+ }, {
1832
+ default: W(({ row: t }) => [B(e.$slots, "expand", {
1833
+ row: t,
1834
+ index: t.$index
1835
+ })]),
1836
+ _: 3
1837
+ }, 8, ["width", "fixed"])) : D("v-if", !0),
1838
+ D(" 选择框 "),
1839
+ a.crud.tableOption.selection ? (R(), E(o, {
1840
+ key: "selection",
1841
+ fixed: a.optVal(a.crud.tableOption.selectionFixed, i.config.selectionFixed),
1842
+ type: "selection",
1843
+ selectable: a.crud.tableOption.selectable,
1844
+ "reserve-selection": a.optVal(a.crud.tableOption.reserveSelection),
1845
+ width: a.crud.tableOption.selectionWidth || i.config.selectionWidth,
1846
+ align: "center"
1847
+ }, null, 8, [
1848
+ "fixed",
1849
+ "selectable",
1850
+ "reserve-selection",
1851
+ "width"
1852
+ ])) : D("v-if", !0),
1853
+ D(" 序号 "),
1854
+ a.optVal(a.crud.tableOption.index) ? (R(), E(o, {
1855
+ key: "index",
1856
+ fixed: a.optVal(a.crud.tableOption.indexFixed, i.config.indexFixed),
1857
+ label: a.crud.tableOption.indexLabel || i.config.indexLabel,
1858
+ type: "index",
1859
+ width: a.crud.tableOption.indexWidth || i.config.indexWidth,
1860
+ index: a.indexMethod,
1861
+ align: "center"
1862
+ }, null, 8, [
1863
+ "fixed",
1864
+ "label",
1865
+ "width",
1866
+ "index"
1867
+ ])) : D("v-if", !0)
1868
+ ], 64);
1869
+ }
1870
+ var en = /* @__PURE__ */ t(Qt, [["render", $t]]), tn = {
1871
+ name: "HeaderMenu",
1872
+ directives: { permission: Q },
1873
+ inject: ["crud"],
1874
+ data() {
1875
+ return {
1876
+ dateCreate: !1,
1877
+ pickerOptions: { shortcuts: [
1878
+ {
1879
+ text: "今日",
1880
+ onClick(e) {
1881
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
1882
+ n.setTime(n.getTime()), e.$emit("pick", [n, t]);
1883
+ }
1884
+ },
1885
+ {
1886
+ text: "昨日",
1887
+ onClick(e) {
1888
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
1889
+ n.setTime(n.getTime() - 3600 * 1e3 * 24 * 1), e.$emit("pick", [n, t]);
1890
+ }
1891
+ },
1892
+ {
1893
+ text: "最近一周",
1894
+ onClick(e) {
1895
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
1896
+ n.setTime(n.getTime() - 3600 * 1e3 * 24 * 7), e.$emit("pick", [n, t]);
1897
+ }
1898
+ },
1899
+ {
1900
+ text: "最近一个月",
1901
+ onClick(e) {
1902
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
1903
+ n.setTime(n.getTime() - 3600 * 1e3 * 24 * 30), e.$emit("pick", [n, t]);
1904
+ }
1905
+ },
1906
+ {
1907
+ text: "最近三个月",
1908
+ onClick(e) {
1909
+ let t = /* @__PURE__ */ new Date(), n = /* @__PURE__ */ new Date();
1910
+ n.setTime(n.getTime() - 3600 * 1e3 * 24 * 90), e.$emit("pick", [n, t]);
1911
+ }
1912
+ }
1913
+ ] },
1914
+ config: X
1915
+ };
1916
+ },
1917
+ created() {
1918
+ this.initFun();
1919
+ },
1920
+ methods: {
1921
+ optVal: h,
1922
+ dateChange(e) {
1923
+ this.dateCreate ? this.crud.$emit("date-change", e) : this.dateCreate = !0;
1924
+ },
1925
+ initFun() {
1926
+ this.crud.rowExcel = this.rowExcel, this.crud.rowPrint = this.rowPrint;
1927
+ },
1928
+ rowExcel() {
1929
+ this.crud.$refs.dialogExcel.handleShow();
1930
+ },
1931
+ rowPrint() {
1932
+ this.$Print(this.crud.$refs.table);
1933
+ }
1934
+ }
1935
+ }, nn = { class: "avue-crud__menu" }, rn = {
1936
+ key: 0,
1937
+ class: "avue-crud__left"
1938
+ }, an = {
1939
+ key: 1,
1940
+ class: "avue-crud__right"
1941
+ };
1942
+ function on(e, t, n, r, a, o) {
1943
+ let s = i, c = he, l = V("permission");
1944
+ return R(), O("div", nn, [o.optVal(o.crud.tableOption.menuLeft, !0) ? (R(), O("div", rn, [
1945
+ o.optVal(o.crud.tableOption.addBtn, a.config.addBtn) ? G((R(), E(s, {
1946
+ key: 0,
1947
+ type: "primary",
1948
+ icon: o.crud.getBtnIcon("addBtn"),
1949
+ size: o.crud.isMediumSize,
1950
+ onClick: o.crud.rowAdd
1951
+ }, {
1952
+ default: W(() => [o.crud.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("addBtn")), 1)], 64))]),
1953
+ _: 1
1954
+ }, 8, [
1955
+ "icon",
1956
+ "size",
1957
+ "onClick"
1958
+ ])), [[l, o.crud.getPermission("addBtn")]]) : D("v-if", !0),
1959
+ o.optVal(o.crud.tableOption.addRowBtn, a.config.addRowBtn) ? G((R(), E(s, {
1960
+ key: 1,
1961
+ type: "primary",
1962
+ icon: o.crud.getBtnIcon("addBtn"),
1963
+ size: o.crud.isMediumSize,
1964
+ onClick: o.crud.rowCellAdd
1965
+ }, {
1966
+ default: W(() => [o.crud.isIconMenu ? D("v-if", !0) : (R(), O(T, { key: 0 }, [j(U(o.crud.menuIcon("addBtn")), 1)], 64))]),
1967
+ _: 1
1968
+ }, 8, [
1969
+ "icon",
1970
+ "size",
1971
+ "onClick"
1972
+ ])), [[l, o.crud.getPermission("addRowBtn")]]) : D("v-if", !0),
1973
+ B(e.$slots, "menuLeft", { size: o.crud.isMediumSize })
1974
+ ])) : D("v-if", !0), o.optVal(o.crud.tableOption.menuRight, !0) ? (R(), O("div", an, [
1975
+ o.optVal(o.crud.tableOption.dateBtn, a.config.dateBtn) ? (R(), E(c, {
1976
+ key: 0,
1977
+ type: "datetimerange",
1978
+ "value-format": "yyyy-MM-dd HH:mm:ss",
1979
+ format: "yyyy-MM-dd HH:mm:ss",
1980
+ "picker-options": a.pickerOptions,
1981
+ style: {
1982
+ display: "inline-block",
1983
+ "margin-right": "20px"
1984
+ },
1985
+ size: o.crud.isMediumSize,
1986
+ onChange: o.dateChange
1987
+ }, null, 8, [
1988
+ "picker-options",
1989
+ "size",
1990
+ "onChange"
1991
+ ])) : D("v-if", !0),
1992
+ B(e.$slots, "menuRight", { size: o.crud.isMediumSize }),
1993
+ o.optVal(o.crud.tableOption.excelBtn, a.config.excelBtn) ? G((R(), E(s, {
1994
+ key: 1,
1995
+ icon: o.crud.getBtnIcon("excelBtn"),
1996
+ circle: "",
1997
+ size: o.crud.isMediumSize,
1998
+ onClick: o.rowExcel
1999
+ }, null, 8, [
2000
+ "icon",
2001
+ "size",
2002
+ "onClick"
2003
+ ])), [[l, o.crud.getPermission("excelBtn")]]) : D("v-if", !0),
2004
+ o.optVal(o.crud.tableOption.printBtn, a.config.printBtn) ? G((R(), E(s, {
2005
+ key: 2,
2006
+ icon: o.crud.getBtnIcon("printBtn"),
2007
+ circle: "",
2008
+ size: o.crud.isMediumSize,
2009
+ onClick: o.rowPrint
2010
+ }, null, 8, [
2011
+ "icon",
2012
+ "size",
2013
+ "onClick"
2014
+ ])), [[l, o.crud.getPermission("printBtn")]]) : D("v-if", !0),
2015
+ o.optVal(o.crud.tableOption.refreshBtn, a.config.refreshBtn) ? G((R(), E(s, {
2016
+ key: 3,
2017
+ icon: o.crud.getBtnIcon("refreshBtn"),
2018
+ circle: "",
2019
+ size: o.crud.isMediumSize,
2020
+ onClick: o.crud.refreshChange
2021
+ }, null, 8, [
2022
+ "icon",
2023
+ "size",
2024
+ "onClick"
2025
+ ])), [[l, o.crud.getPermission("refreshBtn")]]) : D("v-if", !0),
2026
+ o.optVal(o.crud.tableOption.columnBtn, a.config.columnBtn) ? G((R(), E(s, {
2027
+ key: 4,
2028
+ icon: o.crud.getBtnIcon("columnBtn"),
2029
+ circle: "",
2030
+ size: o.crud.isMediumSize,
2031
+ onClick: t[0] || (t[0] = (e) => o.crud.$refs.dialogColumn.handleShow())
2032
+ }, null, 8, ["icon", "size"])), [[l, o.crud.getPermission("columnBtn")]]) : D("v-if", !0),
2033
+ (o.crud.$refs.headerSearch || {}).searchFlag && o.optVal(o.crud.tableOption.searchShowBtn, !0) ? (R(), E(s, {
2034
+ key: 5,
2035
+ icon: o.crud.getBtnIcon("searchBtn"),
2036
+ circle: "",
2037
+ size: o.crud.isMediumSize,
2038
+ onClick: t[1] || (t[1] = (e) => o.crud.$refs.headerSearch.handleSearchShow())
2039
+ }, null, 8, ["icon", "size"])) : D("v-if", !0),
2040
+ o.optVal(o.crud.tableOption.filterBtn, a.config.filterBtn) ? G((R(), E(s, {
2041
+ key: 6,
2042
+ icon: o.crud.getBtnIcon("filterBtn"),
2043
+ circle: "",
2044
+ size: o.crud.isMediumSize,
2045
+ onClick: t[2] || (t[2] = (e) => o.crud.$refs.dialogFilter.handleShow())
2046
+ }, null, 8, ["icon", "size"])), [[l, o.crud.getPermission("filterBtn")]]) : D("v-if", !0)
2047
+ ])) : D("v-if", !0)]);
2048
+ }
2049
+ var sn = /* @__PURE__ */ t(tn, [["render", on]]), cn = {
2050
+ name: "HeaderSearch",
2051
+ mixins: [y],
2052
+ inject: {
2053
+ crud: { from: "crud" },
2054
+ AVUE: {
2055
+ from: r,
2056
+ default: null
2057
+ }
2058
+ },
2059
+ props: { search: Object },
2060
+ data() {
2061
+ return {
2062
+ show: !1,
2063
+ searchIndex: 2,
2064
+ searchShow: !0
2065
+ };
2066
+ },
2067
+ computed: {
2068
+ searchForm: {
2069
+ get() {
2070
+ return this.crud.search;
2071
+ },
2072
+ set(e) {
2073
+ this.crud.$emit("update:search", e);
2074
+ }
2075
+ },
2076
+ option() {
2077
+ let e = this.crud.option, t = (t = []) => {
2078
+ t = c(t);
2079
+ let n = [], r = 0;
2080
+ return t = t.sort((e, t) => (t.searchOrder || 0) - (e.searchOrder || 0)), t.forEach((t) => {
2081
+ if (t.search) {
2082
+ let i = r < this.searchIndex, a = {};
2083
+ Object.keys(t).forEach((e) => {
2084
+ let n = "search";
2085
+ if (e !== "searchProp" && e.includes(n)) {
2086
+ let r = e.replace(n, "");
2087
+ if (r.length === 0) return;
2088
+ r = r.replace(r[0], r[0].toLowerCase()), a[r] = t[e];
2089
+ }
2090
+ }), t = Object.assign(t, a, {
2091
+ type: oe(t),
2092
+ detail: !1,
2093
+ dicFlag: t.cascader ? !0 : h(t.dicFlag, !1),
2094
+ span: t.searchSpan || e.searchSpan || X.searchSpan,
2095
+ control: t.searchControl,
2096
+ gutter: t.searchGutter || e.searchGutter || X.searchGutter,
2097
+ labelWidth: t.searchLabelWidth || e.searchLabelWidth || X.searchLabelWidth,
2098
+ labelPosition: t.searchLabelPosition || e.searchLabelPosition,
2099
+ size: t.searchSize || e.searchSize,
2100
+ value: t.searchValue,
2101
+ rules: t.searchRules,
2102
+ row: t.searchRow,
2103
+ bind: t.searchBin,
2104
+ disabled: t.searchDisabled,
2105
+ readonly: t.searchReadonly,
2106
+ display: this.isSearchIcon ? this.show ? !0 : i : !0
2107
+ }), n.push(t), r += 1;
2108
+ }
2109
+ }), n;
2110
+ };
2111
+ return ((n) => {
2112
+ let r = c(n);
2113
+ return r.column = t(this.crud.propOption), r = Object.assign(r, {
2114
+ rowKey: e.searchRowKey || "null",
2115
+ tabs: !1,
2116
+ group: !1,
2117
+ printBtn: !1,
2118
+ mockBtn: !1,
2119
+ filterDic: e.searchFilterDic,
2120
+ filterNull: e.searchFilterNull,
2121
+ filterParam: e.searchFilterParam,
2122
+ enter: e.searchEnter,
2123
+ size: e.searchSize,
2124
+ submitText: e.searchBtnText || "搜 索",
2125
+ submitBtn: h(e.searchBtn, X.searchSubBtn),
2126
+ submitIcon: this.crud.getBtnIcon("searchBtn"),
2127
+ emptyText: e.emptyBtnText || "清 空",
2128
+ emptyBtn: h(e.emptyBtn, X.emptyBtn),
2129
+ emptyIcon: this.crud.getBtnIcon("emptyBtn"),
2130
+ menuSpan: this.show || !this.isSearchIcon || e.searchMenuSpan < 6 ? e.searchMenuSpan : 6,
2131
+ menuPosition: e.searchMenuPosition || "center",
2132
+ dicFlag: !1,
2133
+ dicData: this.crud.DIC
2134
+ }), r;
2135
+ })(e);
2136
+ },
2137
+ isSearchIcon() {
2138
+ var e;
2139
+ return h(this.crud.option.searchIcon, (e = this.AVUE) == null ? void 0 : e.searchIcon) && this.searchLen > this.searchIndex;
2140
+ },
2141
+ searchLen() {
2142
+ let e = 0;
2143
+ return this.crud.propOption.forEach((t) => {
2144
+ t.search && e++;
2145
+ }), e;
2146
+ },
2147
+ searchFlag() {
2148
+ return !!this.crud.$slots.search || this.searchLen !== 0;
2149
+ }
2150
+ },
2151
+ watch: {
2152
+ "crud.propOption": {
2153
+ handler() {
2154
+ this.dataFormat();
2155
+ },
2156
+ deep: !0
2157
+ },
2158
+ show() {
2159
+ this.crud.getTableHeight();
2160
+ },
2161
+ searchShow() {
2162
+ this.crud.getTableHeight();
2163
+ },
2164
+ option: {
2165
+ immediate: !0,
2166
+ deep: !0,
2167
+ handler() {
2168
+ var e;
2169
+ this.searchIndex = ((e = this.option) == null ? void 0 : e.searchIndex) || 2;
2170
+ }
2171
+ }
2172
+ },
2173
+ created() {
2174
+ this.initFun(), this.dataFormat();
2175
+ },
2176
+ methods: {
2177
+ initFun() {
2178
+ ["searchReset", "searchChange"].forEach((e) => {
2179
+ this.crud[e] = this[e];
2180
+ });
2181
+ },
2182
+ getSlotName(e) {
2183
+ return e.replace("Search", "");
2184
+ },
2185
+ searchChange(e, t) {
2186
+ e = u(e), this.crud.propOption.forEach((t) => {
2187
+ t.searchProp && (e[t.searchProp] = e[t.prop], delete e[t.prop]);
2188
+ }), this.crud.$emit("search-change", e, t);
2189
+ },
2190
+ resetChange() {
2191
+ this.crud.$emit("search-reset", this.searchForm);
2192
+ },
2193
+ searchReset() {
2194
+ this.$refs.form.resetForm();
2195
+ },
2196
+ handleSearchShow() {
2197
+ this.searchShow = !this.searchShow;
2198
+ },
2199
+ dataFormat() {
2200
+ let e = this.crud.option;
2201
+ this.searchShow = h(e.searchShow, X.searchShow);
2202
+ }
2203
+ }
2204
+ };
2205
+ function ln(e, t, n, r, a, o) {
2206
+ let s = i, c = $, l = Ie;
2207
+ return o.searchFlag ? G((R(), E(l, {
2208
+ key: 0,
2209
+ shadow: o.crud.isCard,
2210
+ class: "avue-crud__search"
2211
+ }, {
2212
+ default: W(() => [B(e.$slots, "search", {
2213
+ row: o.searchForm,
2214
+ search: o.searchForm,
2215
+ size: o.crud.controlSize
2216
+ }), M(c, {
2217
+ ref: "form",
2218
+ modelValue: o.searchForm,
2219
+ "onUpdate:modelValue": t[2] || (t[2] = (e) => o.searchForm = e),
2220
+ option: o.option,
2221
+ onSubmit: o.searchChange,
2222
+ onResetChange: o.resetChange
2223
+ }, {
2224
+ menuForm: W((n) => [B(e.$slots, "searchMenu", I(N(Object.assign(n, {
2225
+ search: o.searchForm,
2226
+ row: o.searchForm
2227
+ })))), o.isSearchIcon ? (R(), O(T, { key: 0 }, [a.show === !1 ? (R(), E(s, {
2228
+ key: 0,
2229
+ text: "",
2230
+ icon: "el-icon-arrow-down",
2231
+ onClick: t[0] || (t[0] = (e) => a.show = !0)
2232
+ }, {
2233
+ default: W(() => [...t[3] || (t[3] = [j("展 开", -1)])]),
2234
+ _: 1
2235
+ })) : D("v-if", !0), a.show === !0 ? (R(), E(s, {
2236
+ key: 1,
2237
+ text: "",
2238
+ icon: "el-icon-arrow-up",
2239
+ onClick: t[1] || (t[1] = (e) => a.show = !1)
2240
+ }, {
2241
+ default: W(() => [...t[4] || (t[4] = [j("收 缩", -1)])]),
2242
+ _: 1
2243
+ })) : D("v-if", !0)], 64)) : D("v-if", !0)]),
2244
+ default: W(() => [(R(!0), O(T, null, z(o.crud.searchSlot, (t) => B(e.$slots, t, P({ ref_for: !0 }, Object.assign(e.scope, {
2245
+ search: o.searchForm,
2246
+ row: o.searchForm
2247
+ })))), 256))]),
2248
+ _: 3
2249
+ }, 8, [
2250
+ "modelValue",
2251
+ "option",
2252
+ "onSubmit",
2253
+ "onResetChange"
2254
+ ])]),
2255
+ _: 3
2256
+ }, 8, ["shadow"])), [[rt, a.searchShow && o.searchFlag]]) : D("v-if", !0);
2257
+ }
2258
+ var un = /* @__PURE__ */ t(cn, [["render", ln]]), dn = {
2259
+ mixins: [y],
2260
+ inject: { AVUE: {
2261
+ from: r,
2262
+ default: null
2263
+ } },
2264
+ props: {
2265
+ defaults: {
2266
+ type: Object,
2267
+ default() {
2268
+ return {};
2269
+ }
2270
+ },
2271
+ option: {
2272
+ type: Object,
2273
+ required: !0,
2274
+ default: () => ({})
2275
+ }
2276
+ },
2277
+ watch: {
2278
+ defaults: {
2279
+ handler(e) {
2280
+ this.objectOption = e;
2281
+ },
2282
+ deep: !0
2283
+ },
2284
+ objectOption: {
2285
+ handler(e) {
2286
+ this.$emit("update:defaults", e);
2287
+ },
2288
+ deep: !0
2289
+ },
2290
+ propOption: {
2291
+ handler(e) {
2292
+ let t = {};
2293
+ e.forEach((e) => {
2294
+ t[e.prop] = e;
2295
+ }), this.objectOption = t;
2296
+ },
2297
+ deep: !0
2298
+ },
2299
+ option: {
2300
+ handler() {
2301
+ this.init(!1);
2302
+ },
2303
+ deep: !0
2304
+ }
2305
+ },
2306
+ data() {
2307
+ return {
2308
+ DIC: {},
2309
+ cascaderDIC: {},
2310
+ tableOption: {},
2311
+ isMobile: "",
2312
+ objectOption: {}
2313
+ };
2314
+ },
2315
+ created() {
2316
+ this.init();
2317
+ },
2318
+ computed: {
2319
+ resultOption() {
2320
+ return Object.assign(c(this.tableOption), { column: this.propOption });
2321
+ },
2322
+ rowKey() {
2323
+ return this.tableOption.rowKey || a.rowKey;
2324
+ },
2325
+ formRules() {
2326
+ let e = {};
2327
+ return this.propOption.forEach((t) => {
2328
+ t.rules && t.display !== !1 && (e[t.prop] = t.rules);
2329
+ }), e;
2330
+ },
2331
+ isMediumSize() {
2332
+ return this.controlSize;
2333
+ },
2334
+ controlSize() {
2335
+ var e;
2336
+ return this.tableOption.size || ((e = this.AVUE) == null ? void 0 : e.size);
2337
+ }
2338
+ },
2339
+ methods: {
2340
+ init(e) {
2341
+ this.tableOption = this.option, this.getIsMobile(), this.handleLocalDic(), e !== !1 && this.handleLoadDic();
2342
+ },
2343
+ dicInit(e) {
2344
+ e === "cascader" ? this.handleLoadCascaderDic() : this.handleLoadDic();
2345
+ },
2346
+ getIsMobile() {
2347
+ this.isMobile = document.body.clientWidth <= 768;
2348
+ },
2349
+ updateDic(e, t) {
2350
+ let n = this.findObject(this.propOption, e);
2351
+ q(t) && q(e) ? this.handleLoadDic() : q(t) && !q(n.dicUrl) ? b({ column: n }).then((t) => {
2352
+ this.DIC[e] = t;
2353
+ }) : this.DIC[e] = t;
2354
+ },
2355
+ handleSetDic(e, t = {}) {
2356
+ Object.keys(t).forEach((n) => {
2357
+ e[n] = t[n];
2358
+ });
2359
+ },
2360
+ handleLocalDic() {
2361
+ this.handleSetDic(this.DIC, _e(this.resultOption));
2362
+ },
2363
+ handleLoadDic() {
2364
+ ye(this.resultOption).then((e) => this.handleSetDic(this.DIC, e));
2365
+ },
2366
+ handleLoadCascaderDic() {
2367
+ ve(this.propOption, this.data).then((e) => this.handleSetDic(this.cascaderDIC, e));
2368
+ }
2369
+ }
2370
+ }, fn = {
2371
+ name: "FyCurd",
2372
+ directives: { permission: Q },
2373
+ mixins: [dn],
2374
+ provide() {
2375
+ return { crud: this };
2376
+ },
2377
+ props: {
2378
+ spanMethod: Function,
2379
+ summaryMethod: Function,
2380
+ rowStyle: Function,
2381
+ cellStyle: Function,
2382
+ beforeClose: Function,
2383
+ beforeOpen: Function,
2384
+ rowClassName: Function,
2385
+ cellClassName: Function,
2386
+ headerCellClassName: Function,
2387
+ uploadBefore: Function,
2388
+ uploadAfter: Function,
2389
+ uploadDelete: Function,
2390
+ uploadPreview: Function,
2391
+ uploadError: Function,
2392
+ uploadExceed: Function,
2393
+ permission: {
2394
+ type: [Function, Object],
2395
+ default: () => ({})
2396
+ },
2397
+ modelValue: {
2398
+ type: Object,
2399
+ default: () => ({})
2400
+ },
2401
+ search: {
2402
+ type: Object,
2403
+ default() {
2404
+ return {};
2405
+ }
2406
+ },
2407
+ page: {
2408
+ type: Object,
2409
+ default() {
2410
+ return {};
2411
+ }
2412
+ },
2413
+ tableLoading: {
2414
+ type: Boolean,
2415
+ default: !1
2416
+ },
2417
+ disabled: {
2418
+ type: Boolean,
2419
+ default: !1
2420
+ },
2421
+ data: {
2422
+ type: Array,
2423
+ default: () => []
2424
+ }
2425
+ },
2426
+ data() {
2427
+ return {
2428
+ reload: Math.random(),
2429
+ cellForm: { list: [] },
2430
+ config: X,
2431
+ list: [],
2432
+ listError: {},
2433
+ tableForm: {},
2434
+ tableHeight: void 0,
2435
+ tableIndex: -1,
2436
+ tableSelect: [],
2437
+ sumsList: {},
2438
+ cascaderIndexList: [],
2439
+ cascaderDicList: {},
2440
+ cascaderFormList: {},
2441
+ btnDisabledList: {},
2442
+ btnDisabled: !1,
2443
+ default: {}
2444
+ };
2445
+ },
2446
+ computed: {
2447
+ isHeightAuto() {
2448
+ return this.tableOption.height === "auto";
2449
+ },
2450
+ isSortable() {
2451
+ return this.tableOption.sortable;
2452
+ },
2453
+ isRowSort() {
2454
+ return this.tableOption.rowSort;
2455
+ },
2456
+ isColumnSort() {
2457
+ return this.tableOption.columnSort;
2458
+ },
2459
+ rowParentKey() {
2460
+ return this.option.rowParentKey || a.rowParentKey;
2461
+ },
2462
+ childrenKey() {
2463
+ return this.treeProps.children || a.children;
2464
+ },
2465
+ hasChildrenKey() {
2466
+ return this.treeProps.hasChildren || a.hasChildren;
2467
+ },
2468
+ treeProps() {
2469
+ return this.tableOption.treeProps || {};
2470
+ },
2471
+ isAutoHeight() {
2472
+ return this.tableOption.height === "auto";
2473
+ },
2474
+ formSlot() {
2475
+ return this.getSlotList([
2476
+ "Error",
2477
+ "Label",
2478
+ "Type",
2479
+ "Form"
2480
+ ], this.$slots, this.propOption);
2481
+ },
2482
+ searchSlot() {
2483
+ return this.getSlotList(["Search"], this.$slots, this.propOption);
2484
+ },
2485
+ mainSlot() {
2486
+ let e = [];
2487
+ return this.propOption.forEach((t) => {
2488
+ this.$slots[t.prop] && e.push(t.prop);
2489
+ }), this.getSlotList(["Header", "Form"], this.$slots, this.propOption).concat(e);
2490
+ },
2491
+ calcHeight() {
2492
+ var e;
2493
+ return (this.tableOption.calcHeight || 0) + ((e = this.AVUE) == null ? void 0 : e.calcHeight);
2494
+ },
2495
+ propOption() {
2496
+ let e = [];
2497
+ function t(n = []) {
2498
+ Array.isArray(n) && n.forEach((n) => {
2499
+ Array.isArray(n.children) ? t(n.children) : e.push(n);
2500
+ });
2501
+ }
2502
+ return t(this.columnOption), e = ae(e), e;
2503
+ },
2504
+ isShowSummary() {
2505
+ return this.option.showSummary;
2506
+ },
2507
+ isHeader() {
2508
+ let e = !1;
2509
+ return this.columnOption.forEach((t) => {
2510
+ t.children && (e = !0);
2511
+ }), e;
2512
+ },
2513
+ isTree() {
2514
+ let e = !1;
2515
+ return this.data.forEach((t) => {
2516
+ t.children && (e = !0);
2517
+ }), e;
2518
+ },
2519
+ isCard() {
2520
+ return this.option.card ? "always" : "never";
2521
+ },
2522
+ expandLevel() {
2523
+ return this.parentOption.expandLevel || 0;
2524
+ },
2525
+ expandAll() {
2526
+ return this.parentOption.expandAll || !1;
2527
+ },
2528
+ parentOption() {
2529
+ return this.tableOption || {};
2530
+ },
2531
+ columnOption() {
2532
+ return this.tableOption.column || [];
2533
+ },
2534
+ sumColumnList() {
2535
+ return this.tableOption.sumColumnList || [];
2536
+ },
2537
+ selectLen() {
2538
+ return this.tableSelect ? this.tableSelect.length : 0;
2539
+ }
2540
+ },
2541
+ watch: {
2542
+ modelValue: {
2543
+ handler() {
2544
+ this.tableForm = this.modelValue;
2545
+ },
2546
+ immediate: !0,
2547
+ deep: !0
2548
+ },
2549
+ list: {
2550
+ handler() {
2551
+ this.cellForm.list = this.list;
2552
+ },
2553
+ deep: !0
2554
+ },
2555
+ data: {
2556
+ handler() {
2557
+ this.dataInit();
2558
+ },
2559
+ deep: !0
2560
+ }
2561
+ },
2562
+ mounted() {
2563
+ this.dataInit(), this.getTableHeight(), this.refreshTable();
2564
+ },
2565
+ methods: {
2566
+ setPx: f,
2567
+ optVal: h,
2568
+ handleValidate(e, t, n) {
2569
+ this.listError[e] || (this.listError[e] = {
2570
+ valid: !1,
2571
+ msg: ""
2572
+ }), this.listError[e].valid = !t, this.listError[e].msg = n;
2573
+ },
2574
+ getPermission(e, t, n) {
2575
+ return typeof this.permission == "function" ? this.permission(e, t, n) : q(this.permission[e]) ? !0 : this.permission[e];
2576
+ },
2577
+ getTableHeight() {
2578
+ this.isAutoHeight ? this.$nextTick(() => {
2579
+ let e = this.$refs.table, t = this.$refs.tablePage;
2580
+ if (!e) return;
2581
+ let n = e.$el, r = t.$el.offsetHeight || 20;
2582
+ this.tableHeight = document.documentElement.clientHeight - n.offsetTop - r - this.calcHeight;
2583
+ }) : this.tableHeight = this.tableOption.height;
2584
+ },
2585
+ doLayout() {
2586
+ this.$refs.table.doLayout();
2587
+ },
2588
+ refreshTable(e) {
2589
+ this.reload = Math.random(), this.$nextTick(() => {
2590
+ e == null || e();
2591
+ });
2592
+ },
2593
+ treeLoad(e, t, n) {
2594
+ this.$emit("tree-load", e, t, (t) => {
2595
+ e.children = t, n(t);
2596
+ });
2597
+ },
2598
+ menuIcon(e) {
2599
+ return h(this.tableOption[`${e}Text`], de(`crud.${e}`));
2600
+ },
2601
+ getBtnIcon(e) {
2602
+ let t = `${e}Icon`;
2603
+ return this.tableOption[t] || X[t];
2604
+ },
2605
+ validateField(e) {
2606
+ return this.$refs.dialogForm.$refs.tableForm.validateField(e);
2607
+ },
2608
+ selectClear() {
2609
+ this.$emit("selection-clear", c(this.tableSelect)), this.$refs.table.clearSelection();
2610
+ },
2611
+ toggleRowSelection(e, t) {
2612
+ this.$refs.table.toggleRowSelection(e, t);
2613
+ },
2614
+ toggleRowExpansion(e, t) {
2615
+ this.$refs.table.toggleRowExpansion(e, t);
2616
+ },
2617
+ setCurrentRow(e) {
2618
+ this.$refs.table.setCurrentRow(e);
2619
+ },
2620
+ dataInit() {
2621
+ this.list = this.data, this.list.forEach((e, t) => {
2622
+ e.$cellEdit && !this.cascaderFormList[t] && (this.cascaderFormList[t] = c(e)), e.$cellEdit = e.$cellEdit || !1, e.$index = t;
2623
+ });
2624
+ },
2625
+ headerDragend(e, t, n, r) {
2626
+ this.objectOption[n.property] && (this.objectOption[n.property].width = e), this.$emit("header-dragend", e, t, n, r);
2627
+ },
2628
+ headerSort(e, t) {
2629
+ let n = this.columnOption, r = n.splice(e, 1)[0];
2630
+ n.splice(t, 0, r), this.refreshTable();
2631
+ },
2632
+ clearFilter(e) {
2633
+ this.$refs.table.clearFilter(e);
2634
+ },
2635
+ expandChange(e, t) {
2636
+ this.$emit("expand-change", e, t);
2637
+ },
2638
+ currentRowChange(e, t) {
2639
+ this.$emit("current-row-change", e, t);
2640
+ },
2641
+ refreshChange() {
2642
+ this.$emit("refresh-change");
2643
+ },
2644
+ toggleSelection(e) {
2645
+ e ? e.forEach((e) => {
2646
+ this.$refs.table.toggleRowSelection(e);
2647
+ }) : this.$refs.table.clearSelection();
2648
+ },
2649
+ selectionChange(e) {
2650
+ this.tableSelect = e, this.$emit("selection-change", this.tableSelect);
2651
+ },
2652
+ select(e, t) {
2653
+ this.$emit("select", e, t);
2654
+ },
2655
+ selectAll(e) {
2656
+ this.$emit("select-all", e);
2657
+ },
2658
+ filterChange(e) {
2659
+ this.$emit("filter-change", e);
2660
+ },
2661
+ sortChange(e) {
2662
+ this.$emit("sort-change", e);
2663
+ },
2664
+ rowDblclick(e, t) {
2665
+ this.$emit("row-dblclick", e, t);
2666
+ },
2667
+ rowClick(e, t, n) {
2668
+ this.$emit("row-click", e, t, n);
2669
+ },
2670
+ clearSort() {
2671
+ this.$refs.table.clearSort();
2672
+ },
2673
+ cellMouseEnter(e, t, n, r) {
2674
+ this.$emit("cell-mouse-enter", e, t, n, r);
2675
+ },
2676
+ cellMouseLeave(e, t, n, r) {
2677
+ this.$emit("cell-mouse-leave", e, t, n, r);
2678
+ },
2679
+ cellClick(e, t, n, r) {
2680
+ this.$emit("cell-click", e, t, n, r);
2681
+ },
2682
+ headerClick(e, t) {
2683
+ this.$emit("header-click", e, t);
2684
+ },
2685
+ rowContextmenu(e, t, n) {
2686
+ this.$emit("row-contextmenu", e, t, n);
2687
+ },
2688
+ headerContextmenu(e, t) {
2689
+ this.$emit("header-contextmenu", e, t);
2690
+ },
2691
+ cellDblclick(e, t, n, r) {
2692
+ this.$emit("cell-dblclick", e, t, n, r);
2693
+ },
2694
+ rowCellAdd(e = {}) {
2695
+ let t = this.list.length, n = ce(this.propOption).tableForm;
2696
+ e = c({
2697
+ $cellEdit: !0,
2698
+ $index: t,
2699
+ ...n,
2700
+ ...e
2701
+ }), this.list.push(e);
2702
+ },
2703
+ rowCancel(e, t) {
2704
+ q(e[this.rowKey]) ? (this.list.splice(t, 1), delete this.cascaderDIC[t]) : (this.cascaderFormList[t].$cellEdit = !1, this.cascaderDIC[t] = this.cascaderDicList[t], this.list[t] = this.cascaderFormList[t]), delete this.cascaderDicList[t], delete this.cascaderFormList[t], this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(t), 1);
2705
+ },
2706
+ rowCell(e, t) {
2707
+ e.$cellEdit ? this.rowCellUpdate(e, t) : this.rowCellEdit(e, t);
2708
+ },
2709
+ rowCellUpdate(e, t) {
2710
+ e = c(e);
2711
+ let n = this.validateCellField(t), r = () => {
2712
+ this.btnDisabledList[t] = !1, this.btnDisabled = !1, this.list[t].$cellEdit = !1, this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(t), 1), delete this.cascaderFormList[t];
2713
+ }, i = () => {
2714
+ this.btnDisabledList[t] = !1, this.btnDisabled = !1;
2715
+ };
2716
+ n && (this.btnDisabledList[t] = !0, this.btnDisabled = !0, q(e[this.rowKey]) ? this.$emit("row-save", e, r, i) : this.$emit("row-update", e, t, r, i));
2717
+ },
2718
+ rowCellEdit(e, t) {
2719
+ e.$cellEdit = !0, this.cascaderFormList[t] = c(e), this.cascaderDicList[t] = c(this.cascaderDIC[t]);
2720
+ },
2721
+ validateCellForm() {
2722
+ return new Promise((e) => {
2723
+ this.$refs.cellForm.validate((t, n) => {
2724
+ e(n);
2725
+ });
2726
+ });
2727
+ },
2728
+ validateCellField(e) {
2729
+ let t = !0;
2730
+ for (let n of this.$refs.cellForm.fields) if (n.prop.split(".")[1] === `${e}` && this.$refs.cellForm.validateField(n.prop, (e) => {
2731
+ e && (t = !1);
2732
+ }), !t) break;
2733
+ return t;
2734
+ },
2735
+ rowAdd() {
2736
+ this.$refs.dialogForm.show("add");
2737
+ },
2738
+ rowSave() {
2739
+ return this.$refs.dialogForm.$refs.tableForm.submit();
2740
+ },
2741
+ rowUpdate() {
2742
+ return this.$refs.dialogForm.$refs.tableForm.submit();
2743
+ },
2744
+ closeDialog() {
2745
+ return this.$refs.dialogForm.closeDialog();
2746
+ },
2747
+ getPropRef(e) {
2748
+ return this.$refs.dialogForm.$refs.tableForm.getPropRef(e);
2749
+ },
2750
+ setVal() {
2751
+ this.$emit("update:modelValue", this.tableForm), this.$emit("change", this.tableForm);
2752
+ },
2753
+ rowEdit(e, t) {
2754
+ this.tableForm = c(e), this.tableIndex = t, this.setVal(), this.$refs.dialogForm.show("edit");
2755
+ },
2756
+ rowCopy(e) {
2757
+ this.tableForm = c(e), delete this.tableForm[this.rowKey], this.tableIndex = -1, this.setVal(), this.$refs.dialogForm.show("add");
2758
+ },
2759
+ rowView(e, t) {
2760
+ this.tableForm = c(e), this.tableIndex = t, this.setVal(), this.$refs.dialogForm.show("view");
2761
+ },
2762
+ rowDel(e, t) {
2763
+ this.$emit("row-del", e, t, () => {
2764
+ let { parentList: t, index: n } = this.findData(e[this.rowKey]);
2765
+ t && t.splice(n, 1);
2766
+ });
2767
+ },
2768
+ tableSpanMethod(e) {
2769
+ if (typeof this.spanMethod == "function") return this.spanMethod(e);
2770
+ },
2771
+ tableSummaryMethod(e) {
2772
+ let t = {};
2773
+ if (typeof this.summaryMethod == "function") return this.summaryMethod(e);
2774
+ let { columns: n, data: r } = e, i = [];
2775
+ return n.length > 0 && n.forEach((e, n) => {
2776
+ let a = this.sumColumnList.find((t) => t.name === e.property);
2777
+ if (a) {
2778
+ let o = a.decimals || 2, s = a.label || "", c = 1;
2779
+ switch (a.type) {
2780
+ case "count":
2781
+ i[n] = s + r.length;
2782
+ break;
2783
+ case "avg":
2784
+ i[n] = r.map((t) => Number(t[e.property])).reduce((e, t) => {
2785
+ let n = Number(t);
2786
+ return isNaN(n) ? e : (e * (c - 1) + t) / c++;
2787
+ }, 0), i[n] = s + i[n].toFixed(o);
2788
+ break;
2789
+ case "sum":
2790
+ i[n] = r.map((t) => Number(t[e.property])).reduce((e, t) => {
2791
+ let n = Number(t);
2792
+ return isNaN(n) ? e : e + t;
2793
+ }, 0), i[n] = s + i[n].toFixed(o);
2794
+ break;
2795
+ }
2796
+ t[e.property] = i[n];
2797
+ } else i[n] = "";
2798
+ }), this.sumsList = t, i;
2799
+ },
2800
+ tableDrop(e, t, n) {
2801
+ if (!(this.isSortable !== !0 && (e === "row" && !this.isRowSort || e === "column" && !this.isColumnSort))) {
2802
+ if (!window.Sortable) {
2803
+ xe.logs("Sortable");
2804
+ return;
2805
+ }
2806
+ window.Sortable.create(t, {
2807
+ ghostClass: X.ghostClass,
2808
+ chosenClass: X.ghostClass,
2809
+ animation: 500,
2810
+ delay: 0,
2811
+ onEnd: (e) => n(e)
2812
+ });
2813
+ }
2814
+ },
2815
+ findData(e) {
2816
+ let t = {}, n = (r, i) => {
2817
+ r.forEach((a, o) => {
2818
+ a[this.rowKey] === e && (t = {
2819
+ item: a,
2820
+ index: o,
2821
+ parentList: r,
2822
+ parent: i
2823
+ }), a[this.childrenKey] && n(a[this.childrenKey], a);
2824
+ });
2825
+ };
2826
+ return n(this.list), t;
2827
+ }
2828
+ }
2829
+ }, pn = { class: "avue-crud avue-crud--card" }, mn = { class: "avue-crud__tip-name" }, hn = { class: "avue-crud__tip-count" };
2830
+ function gn(e, t, n, r, a, o) {
2831
+ let s = un, c = sn, l = i, u = Qe, d = en, f = Zt, p = Jt, m = Ue, h = Xe, g = We, ee = Mt, te = kt, _ = Et, ne = St, re = _t, ie = V("permission"), v = Ke;
2832
+ return R(), O("div", pn, [
2833
+ e.tableOption.title ? (R(), E(H(e.tableOption.titleSize || "h2"), {
2834
+ key: 0,
2835
+ style: L(e.tableOption.titleStyle)
2836
+ }, {
2837
+ default: W(() => [j(U(e.tableOption.title), 1)]),
2838
+ _: 1
2839
+ }, 8, ["style"])) : D("v-if", !0),
2840
+ D(" 搜索组件 "),
2841
+ M(s, { ref: "headerSearch" }, A({
2842
+ search: W((t) => [B(e.$slots, "search", I(N(t)))]),
2843
+ searchMenu: W((t) => [B(e.$slots, "searchMenu", I(N(t)))]),
2844
+ _: 2
2845
+ }, [z(o.searchSlot, (t) => ({
2846
+ name: t,
2847
+ fn: W((n) => [B(e.$slots, t, I(N(n)))])
2848
+ }))]), 1536),
2849
+ D(" 表格功能列 "),
2850
+ o.optVal(e.tableOption.header, !0) ? (R(), E(c, {
2851
+ key: 1,
2852
+ ref: "headerMenu"
2853
+ }, {
2854
+ menuLeft: W((t) => [B(e.$slots, "menuLeft", I(N(t)))]),
2855
+ menuRight: W((t) => [B(e.$slots, "menuRight", I(N(t)))]),
2856
+ _: 3
2857
+ }, 512)) : D("v-if", !0),
2858
+ o.optVal(e.tableOption.tip, a.config.tip) && e.tableOption.selection ? (R(), E(u, {
2859
+ key: 2,
2860
+ "disable-transitions": "",
2861
+ class: "avue-crud__tip"
2862
+ }, {
2863
+ default: W(() => [
2864
+ k("span", mn, [
2865
+ t[0] || (t[0] = j(" 当前表格已选择 ", -1)),
2866
+ k("span", hn, U(o.selectLen), 1),
2867
+ t[1] || (t[1] = j(" 项 ", -1))
2868
+ ]),
2869
+ o.optVal(e.tableOption.selectClearBtn, a.config.selectClearBtn) && e.tableOption.selection ? G((R(), E(l, {
2870
+ key: 0,
2871
+ text: "",
2872
+ onClick: o.selectClear
2873
+ }, {
2874
+ default: W(() => [...t[2] || (t[2] = [j(" 清 空 ", -1)])]),
2875
+ _: 1
2876
+ }, 8, ["onClick"])), [[ie, o.getPermission("selectClearBtn")]]) : D("v-if", !0),
2877
+ B(e.$slots, "tip")
2878
+ ]),
2879
+ _: 3
2880
+ })) : D("v-if", !0),
2881
+ B(e.$slots, "header"),
2882
+ M(g, {
2883
+ ref: "cellForm",
2884
+ model: a.cellForm,
2885
+ "show-message": !1,
2886
+ onValidate: o.handleValidate
2887
+ }, {
2888
+ default: W(() => {
2889
+ var t;
2890
+ return [G((R(), E(h, {
2891
+ key: a.reload,
2892
+ ref: "table",
2893
+ data: a.cellForm.list,
2894
+ "row-key": e.rowKey,
2895
+ class: F({ "avue-crud--indeterminate": o.optVal(e.tableOption.indeterminate, !1) }),
2896
+ size: ((t = e.AVUE) == null ? void 0 : t.tableSize) || e.controlSize,
2897
+ lazy: o.optVal(e.tableOption.lazy, !1),
2898
+ load: o.treeLoad,
2899
+ "tree-props": o.treeProps,
2900
+ "expand-row-keys": e.tableOption.expandRowKeys,
2901
+ "default-expand-all": e.tableOption.defaultExpandAll,
2902
+ "highlight-current-row": e.tableOption.highlightCurrentRow,
2903
+ "show-summary": e.tableOption.showSummary,
2904
+ "summary-method": o.tableSummaryMethod,
2905
+ "span-method": o.tableSpanMethod,
2906
+ stripe: e.tableOption.stripe,
2907
+ "show-header": e.tableOption.showHeader,
2908
+ "default-sort": e.tableOption.defaultSort,
2909
+ "row-class-name": n.rowClassName,
2910
+ "cell-class-name": n.cellClassName,
2911
+ "row-style": n.rowStyle,
2912
+ "cell-style": n.cellStyle,
2913
+ fit: e.tableOption.fit,
2914
+ "header-cell-class-name": n.headerCellClassName,
2915
+ "max-height": o.isAutoHeight ? a.tableHeight : e.tableOption.maxHeight,
2916
+ height: a.tableHeight,
2917
+ width: o.setPx(e.tableOption.width, a.config.width),
2918
+ border: e.tableOption.border,
2919
+ onCurrentChange: o.currentRowChange,
2920
+ onExpandChange: o.expandChange,
2921
+ onHeaderDragend: o.headerDragend,
2922
+ onRowClick: o.rowClick,
2923
+ onRowDblclick: o.rowDblclick,
2924
+ onCellMouseEnter: o.cellMouseEnter,
2925
+ onCellMouseLeave: o.cellMouseLeave,
2926
+ onCellClick: o.cellClick,
2927
+ onHeaderClick: o.headerClick,
2928
+ onRowContextmenu: o.rowContextmenu,
2929
+ onHeaderContextmenu: o.headerContextmenu,
2930
+ onCellDblclick: o.cellDblclick,
2931
+ onFilterChange: o.filterChange,
2932
+ onSelectionChange: o.selectionChange,
2933
+ onSelect: o.select,
2934
+ onSelectAll: o.selectAll,
2935
+ onSortChange: o.sortChange
2936
+ }, {
2937
+ empty: W(() => [e.$slots.empty ? B(e.$slots, "empty", { key: 0 }) : (R(), E(m, {
2938
+ key: 1,
2939
+ "image-size": 100,
2940
+ class: "avue-crud__empty",
2941
+ description: e.tableOption.emptyText
2942
+ }, null, 8, ["description"]))]),
2943
+ default: W(() => [M(p, { "column-option": o.columnOption }, A({
2944
+ header: W(() => [M(d, { ref: "columnDefault" }, {
2945
+ expand: W(({ row: t, index: n }) => [B(e.$slots, "expand", {
2946
+ row: t,
2947
+ index: n
2948
+ })]),
2949
+ _: 3
2950
+ }, 512)]),
2951
+ footer: W(() => [M(f, null, {
2952
+ menu: W((t) => [B(e.$slots, "menu", I(N(t)))]),
2953
+ menuBtn: W((t) => [B(e.$slots, "menuBtn", I(N(t)))]),
2954
+ _: 3
2955
+ })]),
2956
+ _: 2
2957
+ }, [z(o.mainSlot, (t) => ({
2958
+ name: t,
2959
+ fn: W((n) => [B(e.$slots, t, I(N(n)))])
2960
+ }))]), 1032, ["column-option"])]),
2961
+ _: 3
2962
+ }, 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("."))), [[v, n.tableLoading]])];
2963
+ }),
2964
+ _: 3
2965
+ }, 8, ["model", "onValidate"]),
2966
+ B(e.$slots, "footer"),
2967
+ D(" 分页 "),
2968
+ M(ee, { ref: "tablePage" }, null, 512),
2969
+ D(" 表单 "),
2970
+ M(te, { ref: "dialogForm" }, A({
2971
+ menuForm: W((t) => [B(e.$slots, "menuForm", I(N(t)))]),
2972
+ _: 2
2973
+ }, [z(o.formSlot, (t) => ({
2974
+ name: t,
2975
+ fn: W((n) => [B(e.$slots, t, I(N(n)))])
2976
+ }))]), 1536),
2977
+ M(_, { ref: "dialogColumn" }, null, 512),
2978
+ M(ne, { ref: "dialogExcel" }, null, 512),
2979
+ M(re, { ref: "dialogFilter" }, null, 512)
2980
+ ]);
2981
+ }
2982
+ var _n = /* @__PURE__ */ t(fn, [["render", gn]]), vn = {
2983
+ name: "FyDynamic",
2984
+ mixins: [se, ue],
2985
+ props: {
2986
+ max: Number,
2987
+ columnSlot: {
2988
+ type: Array,
2989
+ default: () => []
2990
+ },
2991
+ children: {
2992
+ type: Object,
2993
+ default: () => ({})
2994
+ }
2995
+ },
2996
+ data() {
2997
+ return {
2998
+ reload: Math.random(),
2999
+ hoverList: []
3000
+ };
3001
+ },
3002
+ computed: {
3003
+ textLen() {
3004
+ return this.text.length;
3005
+ },
3006
+ maxFlag() {
3007
+ return this.max ? this.text.length !== this.max : !0;
3008
+ },
3009
+ showIndex() {
3010
+ return h(this.children.index, !0);
3011
+ },
3012
+ showType() {
3013
+ return this.children.type || "crud";
3014
+ },
3015
+ isForm() {
3016
+ return this.showType === "form";
3017
+ },
3018
+ isCrud() {
3019
+ return this.showType === "crud";
3020
+ },
3021
+ selectionChange() {
3022
+ return this.children.selectionChange;
3023
+ },
3024
+ sortableChange() {
3025
+ return this.children.sortableChange;
3026
+ },
3027
+ rowAdd() {
3028
+ return this.children.rowAdd;
3029
+ },
3030
+ rowDel() {
3031
+ return this.children.rowDel;
3032
+ },
3033
+ viewBtn() {
3034
+ return this.children.viewBtn === !1;
3035
+ },
3036
+ addBtn() {
3037
+ return this.children.addBtn === !1;
3038
+ },
3039
+ delBtn() {
3040
+ return this.children.delBtn === !1;
3041
+ },
3042
+ valueOption() {
3043
+ let e = {};
3044
+ return this.columnOption.forEach((t) => {
3045
+ t.value && (e[t.prop] = t.value);
3046
+ }), e;
3047
+ },
3048
+ rulesOption() {
3049
+ let e = {};
3050
+ return this.columnOption.forEach((t) => {
3051
+ t.rules && (e[t.prop] = t.rules);
3052
+ }), e;
3053
+ },
3054
+ columnOption() {
3055
+ return this.children.column || [];
3056
+ },
3057
+ option() {
3058
+ return {
3059
+ border: !0,
3060
+ header: !1,
3061
+ menu: !1,
3062
+ size: this.size,
3063
+ disabled: this.disabled,
3064
+ readonly: this.readonly,
3065
+ emptyBtn: !1,
3066
+ submitBtn: !1,
3067
+ ...(() => {
3068
+ let e = c(this.children);
3069
+ return delete e.column, e;
3070
+ })(),
3071
+ ...(() => {
3072
+ let e = [{
3073
+ label: this.children.indexLabel || "#",
3074
+ prop: "_index",
3075
+ display: this.showIndex,
3076
+ hide: !this.showIndex,
3077
+ fixed: !0,
3078
+ align: "center",
3079
+ headerAlign: "center",
3080
+ span: 24,
3081
+ width: 50
3082
+ }];
3083
+ return this.columnOption.forEach((t) => {
3084
+ e.push(Object.assign(t, { cell: h(t.cell, this.isCrud) }));
3085
+ }), { column: e };
3086
+ })()
3087
+ };
3088
+ }
3089
+ },
3090
+ watch: { text() {
3091
+ this.initData();
3092
+ } },
3093
+ mounted() {
3094
+ this.initData();
3095
+ },
3096
+ methods: {
3097
+ deepClone: c,
3098
+ handleSelectionChange(e) {
3099
+ var t;
3100
+ (t = this.selectionChange) == null || t.call(this, e);
3101
+ },
3102
+ handleSortableChange(e, t, n, r) {
3103
+ var i;
3104
+ (i = this.sortableChange) == null || i.call(this, e, t, n, r);
3105
+ },
3106
+ cellMouseenter(e) {
3107
+ let t = e.$index;
3108
+ this.mouseoverRow(t);
3109
+ },
3110
+ cellMouseLeave(e) {
3111
+ let t = e.$index;
3112
+ this.mouseoutRow(t);
3113
+ },
3114
+ initData() {
3115
+ this.text.forEach((e, t) => {
3116
+ e = Object.assign(e, {
3117
+ $cellEdit: !0,
3118
+ $index: t
3119
+ });
3120
+ });
3121
+ },
3122
+ mouseoverRow(e) {
3123
+ this.delBtn || (this.flagList(), this.hoverList[e] = !0);
3124
+ },
3125
+ mouseoutRow(e) {
3126
+ this.delBtn || (this.flagList(), this.hoverList[e] = !1);
3127
+ },
3128
+ flagList() {
3129
+ this.hoverList.forEach((e, t) => {
3130
+ this.hoverList[t] = !1;
3131
+ });
3132
+ },
3133
+ delRow(e) {
3134
+ let t = () => {
3135
+ let t = c(this.text);
3136
+ t.splice(e, 1), this.text = t, this.reload = Math.random();
3137
+ };
3138
+ typeof this.rowDel == "function" ? this.rowDel(this.text[e], t) : t();
3139
+ },
3140
+ addRow() {
3141
+ let e = (e = {}) => {
3142
+ e = Object.assign(this.valueOption, e, { $index: this.textLen }), this.isCrud ? this.$refs.main.rowCellAdd(e) : this.isForm && this.text.push(e);
3143
+ };
3144
+ typeof this.rowAdd == "function" ? this.rowAdd(e) : e();
3145
+ }
3146
+ }
3147
+ }, yn = { class: "avue-dynamic__header" }, bn = ["onMouseenter", "onMouseleave"], xn = { key: 1 };
3148
+ function Sn(e, t, n, r, a, o) {
3149
+ let s = i, c = $, l = _n;
3150
+ return R(), O("div", {
3151
+ key: a.reload,
3152
+ class: "avue-dynamic"
3153
+ }, [o.isForm ? (R(), O(T, { key: 0 }, [k("div", yn, [!e.readonly && !e.disabled && !o.addBtn ? (R(), E(s, {
3154
+ key: 0,
3155
+ circle: "",
3156
+ disabled: e.disabled,
3157
+ type: "primary",
3158
+ icon: "el-icon-plus",
3159
+ onClick: o.addRow
3160
+ }, null, 8, ["disabled", "onClick"])) : D("v-if", !0)]), k("div", null, [(R(!0), O(T, null, z(e.text, (t, r) => (R(), O("div", {
3161
+ key: r,
3162
+ class: "avue-dynamic__row",
3163
+ onMouseenter: (e) => o.cellMouseenter({ $index: r }),
3164
+ onMouseleave: (e) => o.cellMouseLeave({ $index: r })
3165
+ }, [!e.readonly && !e.disabled && !o.delBtn && a.hoverList[r] ? (R(), E(s, {
3166
+ key: 0,
3167
+ type: "danger",
3168
+ class: "avue-dynamic__menu",
3169
+ disabled: e.disabled,
3170
+ icon: "el-icon-delete",
3171
+ circle: "",
3172
+ onClick: (e) => o.delRow(t.$index)
3173
+ }, null, 8, ["disabled", "onClick"])) : D("v-if", !0), (R(), E(c, {
3174
+ key: r,
3175
+ ref_for: !0,
3176
+ ref: "main",
3177
+ modelValue: e.text[r],
3178
+ "onUpdate:modelValue": (t) => e.text[r] = t,
3179
+ option: o.deepClone(o.option)
3180
+ }, A({
3181
+ _index: W(({}) => [k("div", null, [k("span", null, U(t.$index + 1), 1)])]),
3182
+ _: 2
3183
+ }, [z(n.columnSlot, (t) => ({
3184
+ name: t,
3185
+ fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, Object.assign(n, { row: e.text[r] })))])
3186
+ }))]), 1032, [
3187
+ "modelValue",
3188
+ "onUpdate:modelValue",
3189
+ "option"
3190
+ ]))], 40, bn))), 128))])], 64)) : o.isCrud ? (R(), E(l, {
3191
+ key: 1,
3192
+ ref: "main",
3193
+ option: o.option,
3194
+ disabled: e.disabled,
3195
+ data: e.text,
3196
+ onCellMouseEnter: o.cellMouseenter,
3197
+ onCellMouseLeave: o.cellMouseLeave,
3198
+ onSelectionChange: o.handleSelectionChange,
3199
+ onSortableChange: o.handleSortableChange
3200
+ }, {
3201
+ _indexHeader: W(() => [!(o.addBtn || e.readonly) && o.maxFlag ? (R(), E(s, {
3202
+ key: 0,
3203
+ type: "primary",
3204
+ disabled: e.disabled,
3205
+ icon: "el-icon-plus",
3206
+ circle: "",
3207
+ onClick: t[0] || (t[0] = (e) => o.addRow())
3208
+ }, null, 8, ["disabled"])) : D("v-if", !0)]),
3209
+ _index: W((t) => [!e.readonly && !e.disabled && !o.delBtn && a.hoverList[t.row.$index] ? (R(), E(s, {
3210
+ key: 0,
3211
+ type: "danger",
3212
+ disabled: e.disabled,
3213
+ icon: "el-icon-delete",
3214
+ circle: "",
3215
+ onClick: (e) => o.delRow(t.row.$index)
3216
+ }, null, 8, ["disabled", "onClick"])) : (R(), O("div", xn, U(t.row.$index + 1), 1))]),
3217
+ default: W(() => [(R(!0), O(T, null, z(n.columnSlot, (t) => B(e.$slots, t, P({ ref_for: !0 }, e.scope))), 256))]),
3218
+ _: 3
3219
+ }, 8, [
3220
+ "option",
3221
+ "disabled",
3222
+ "data",
3223
+ "onCellMouseEnter",
3224
+ "onCellMouseLeave",
3225
+ "onSelectionChange",
3226
+ "onSortableChange"
3227
+ ])) : D("v-if", !0)]);
3228
+ }
3229
+ var Cn = /* @__PURE__ */ t(vn, [["render", Sn]]), wn = {
3230
+ name: "FormTemp",
3231
+ components: {
3232
+ FyUEditor: et(() => import("../fy-u-editor/index.mjs")),
3233
+ FyInputTable: et(() => import("../fy-input-table/index.mjs")),
3234
+ FyInputTree: Pe,
3235
+ FyArray: fe,
3236
+ FyCascader: pe,
3237
+ FyCheckbox: me,
3238
+ FyDate: he,
3239
+ FyDynamic: Cn,
3240
+ FyInput: ge,
3241
+ FyInputColor: we,
3242
+ FyInputIcon: Te,
3243
+ FyInputMap: Ee,
3244
+ FyInputNumber: De,
3245
+ FyRadio: Oe,
3246
+ FyRate: Ce,
3247
+ FySelect: be,
3248
+ FySlider: ke,
3249
+ FySwitch: Ae,
3250
+ FyTime: je,
3251
+ FyTitle: Me,
3252
+ FyUpload: Ne
3253
+ },
3254
+ mixins: [y],
3255
+ props: {
3256
+ modelValue: [
3257
+ String,
3258
+ Object,
3259
+ Number,
3260
+ Boolean,
3261
+ Array
3262
+ ],
3263
+ columnSlot: {
3264
+ type: Array,
3265
+ default: () => []
3266
+ },
3267
+ tableData: {
3268
+ type: Object,
3269
+ default: () => ({})
3270
+ },
3271
+ enter: {
3272
+ type: Boolean,
3273
+ default: !1
3274
+ },
3275
+ type: { type: String },
3276
+ propsHttp: {
3277
+ type: Object,
3278
+ default: () => ({})
3279
+ },
3280
+ props: { type: Object },
3281
+ dic: { type: Array },
3282
+ size: { type: String },
3283
+ disabled: { type: Boolean },
3284
+ readonly: { type: Boolean },
3285
+ column: {
3286
+ type: Object,
3287
+ default: () => ({})
3288
+ }
3289
+ },
3290
+ emits: [
3291
+ "enter",
3292
+ "change",
3293
+ "update:modelValue"
3294
+ ],
3295
+ computed: {
3296
+ params() {
3297
+ return this.column.params || {};
3298
+ },
3299
+ event() {
3300
+ return this.column.event || {};
3301
+ },
3302
+ text: {
3303
+ get() {
3304
+ return this.modelValue;
3305
+ },
3306
+ set(e) {
3307
+ this.$emit("update:modelValue", e), this.$emit("change", e);
3308
+ }
3309
+ }
3310
+ },
3311
+ methods: {
3312
+ uploadFun: _,
3313
+ getComponent: le,
3314
+ getPlaceholder: v,
3315
+ enterChange() {
3316
+ typeof this.column.enter == "function" ? this.column.enter({
3317
+ value: this.text,
3318
+ column: this.column
3319
+ }) : this.enter && this.$emit("enter");
3320
+ }
3321
+ }
3322
+ }, Tn = ["innerHTML"];
3323
+ function En(e, t, n, r, i, a) {
3324
+ return R(), E(H(a.getComponent(n.column.type, n.column.component)), P(Object.assign(n.column, a.uploadFun(n.column)), {
3325
+ ref: "temp",
3326
+ modelValue: a.text,
3327
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => a.text = e),
3328
+ column: Object.assign(n.column, a.params),
3329
+ dic: n.dic,
3330
+ disabled: n.column.disabled || n.disabled,
3331
+ readonly: n.column.readonly || n.readonly,
3332
+ placeholder: a.getPlaceholder(n.column),
3333
+ props: n.column.props || n.props,
3334
+ "props-http": n.column.propsHttp || n.propsHttp,
3335
+ size: n.column.size || n.size,
3336
+ "table-data": n.tableData,
3337
+ type: n.type || n.column.type,
3338
+ "column-slot": n.columnSlot
3339
+ }, nt(a.event), { onKeyup: it(a.enterChange, ["enter"]) }), A({
3340
+ default: W(() => [a.params.html ? (R(), O("span", {
3341
+ key: 0,
3342
+ innerHTML: a.params.html
3343
+ }, null, 8, Tn)) : D("v-if", !0)]),
3344
+ _: 2
3345
+ }, [z(e.getSlotName(n.column, "T", e.$slots) ? [n.column] : [], (t) => ({
3346
+ name: t,
3347
+ fn: W((n) => [B(e.$slots, e.getSlotName(t, "T"), I(N(n)))])
3348
+ })), z(n.columnSlot, (t) => ({
3349
+ name: t,
3350
+ fn: W((n) => [B(e.$slots, t, I(N(n || {})))])
3351
+ }))]), 1040, [
3352
+ "modelValue",
3353
+ "column",
3354
+ "dic",
3355
+ "disabled",
3356
+ "readonly",
3357
+ "placeholder",
3358
+ "props",
3359
+ "props-http",
3360
+ "size",
3361
+ "table-data",
3362
+ "type",
3363
+ "column-slot",
3364
+ "onKeyup"
3365
+ ]);
3366
+ }
3367
+ var Dn = /* @__PURE__ */ t(wn, [["render", En]]), On = (e, t, n, r) => {
3368
+ if (!r) return;
3369
+ if (!window.Mock) {
3370
+ xe.logs("mock");
3371
+ return;
3372
+ }
3373
+ let i = (window.Mock || {}).Random, a = {};
3374
+ function o({ en: e }) {
3375
+ return e ? i.name(!0) : i.cname();
3376
+ }
3377
+ function s({ max: e, min: t, precision: n }) {
3378
+ if (n) {
3379
+ let r = `${i.float(t, e, n)}`, a = r.indexOf(".") + 1;
3380
+ return Number(r.substring(0, a + n));
3381
+ } else return i.integer(t, e);
3382
+ }
3383
+ function c({ header: e }) {
3384
+ let t = i.url(), n = t.indexOf("://");
3385
+ return t = e === !1 ? t.substring(n + 3) : `http://${t.substring(n + 3)}`, t;
3386
+ }
3387
+ function l({ format: e, now: t }) {
3388
+ return t ? i.now(e) : i.datetime(e);
3389
+ }
3390
+ function u({ min: e, max: t }) {
3391
+ return i.csentence(e, t);
3392
+ }
3393
+ function d() {
3394
+ return i.county(!0);
3395
+ }
3396
+ function f({ dic: e, props: t, columnType: n, multiple: r }) {
3397
+ let i = t.value || "value", a = e.length;
3398
+ if (["checkbox"].includes(n) || r) {
3399
+ let t = s({
3400
+ min: 1,
3401
+ max: a
3402
+ }), n = [];
3403
+ for (let r = 0; r < t; r++) {
3404
+ let t = !0;
3405
+ for (; t;) {
3406
+ let r = e[s({
3407
+ min: 0,
3408
+ max: a - 1
3409
+ })][i];
3410
+ n.includes(r) || (n.push(r), t = !1);
3411
+ }
3412
+ }
3413
+ return n;
3414
+ } else return e[s({
3415
+ min: 0,
3416
+ max: a - 1
3417
+ })][i];
3418
+ }
3419
+ function p() {
3420
+ Object.keys(e).forEach((r) => {
3421
+ let i = e[r];
3422
+ if (i.mock && typeof i.mock == "object") {
3423
+ let e = i.mock;
3424
+ switch (e.dic = typeof i.dicData == "string" ? t[i.dicData] : i.dicData || [], e.props = i.props || {}, e.columnType = i.type, e.multiple = i.multiple, e.type) {
3425
+ case "name":
3426
+ a[i.prop] = o(e);
3427
+ break;
3428
+ case "number":
3429
+ a[i.prop] = s(e);
3430
+ break;
3431
+ case "datetime":
3432
+ a[i.prop] = l(e);
3433
+ break;
3434
+ case "word":
3435
+ a[i.prop] = u(e);
3436
+ break;
3437
+ case "url":
3438
+ a[i.prop] = c(e);
3439
+ break;
3440
+ case "county":
3441
+ a[i.prop] = d();
3442
+ break;
3443
+ case "dic":
3444
+ a[i.prop] = f(e);
3445
+ break;
3446
+ }
3447
+ } else i.mock instanceof Function && (a[i.prop] = i.mock(n));
3448
+ });
3449
+ }
3450
+ return p(), a;
3451
+ }, kn = {
3452
+ name: "FyForm",
3453
+ mixins: [dn],
3454
+ provide() {
3455
+ return { formSafe: this };
3456
+ },
3457
+ props: {
3458
+ uploadBefore: Function,
3459
+ uploadAfter: Function,
3460
+ uploadDelete: Function,
3461
+ uploadPreview: Function,
3462
+ uploadError: Function,
3463
+ uploadExceed: Function,
3464
+ status: {
3465
+ type: Boolean,
3466
+ default: !1
3467
+ },
3468
+ isCrud: {
3469
+ type: Boolean,
3470
+ default: !1
3471
+ },
3472
+ modelValue: {
3473
+ type: Object,
3474
+ default: () => ({})
3475
+ }
3476
+ },
3477
+ emits: [
3478
+ "submit",
3479
+ "error",
3480
+ "tab-click",
3481
+ "change",
3482
+ "update:modelValue",
3483
+ "reset-change"
3484
+ ],
3485
+ data() {
3486
+ return {
3487
+ activeName: "",
3488
+ labelWidth: 90,
3489
+ allDisabled: !1,
3490
+ optionIndex: [],
3491
+ optionBox: !1,
3492
+ tableOption: {},
3493
+ itemSpanDefault: 12,
3494
+ form: {},
3495
+ formCreate: !1,
3496
+ formList: [],
3497
+ formBind: {}
3498
+ };
3499
+ },
3500
+ computed: {
3501
+ columnSlot() {
3502
+ return Object.keys(this.$slots).filter((e) => !this.propOption.map((e) => e.prop).includes(e));
3503
+ },
3504
+ labelSuffix() {
3505
+ return this.parentOption.labelSuffix || ":";
3506
+ },
3507
+ isMenu() {
3508
+ return this.columnOption.length !== 1;
3509
+ },
3510
+ isDetail() {
3511
+ return this.detail === !0;
3512
+ },
3513
+ isTabs() {
3514
+ return this.parentOption.tabs === !0;
3515
+ },
3516
+ isAdd() {
3517
+ return this.boxType === "add";
3518
+ },
3519
+ isEdit() {
3520
+ return this.boxType === "edit";
3521
+ },
3522
+ isView() {
3523
+ return this.boxType === "view";
3524
+ },
3525
+ gutter() {
3526
+ return f((this.parentOption.gutter || 10) / 2);
3527
+ },
3528
+ detail() {
3529
+ return this.parentOption.detail;
3530
+ },
3531
+ disabled() {
3532
+ return this.parentOption.disabled;
3533
+ },
3534
+ readonly() {
3535
+ return this.parentOption.readonly;
3536
+ },
3537
+ tabsType() {
3538
+ return this.parentOption.tabsType;
3539
+ },
3540
+ columnLen() {
3541
+ return this.columnOption.length;
3542
+ },
3543
+ dynamicOption() {
3544
+ let e = [];
3545
+ return this.propOption.forEach((t) => {
3546
+ t.type === "dynamic" && this.vaildDisplay(t) && e.push(t);
3547
+ }), e;
3548
+ },
3549
+ propOption() {
3550
+ let e = [];
3551
+ return this.columnOption.forEach((t) => {
3552
+ t.display !== !1 && t.column.forEach((t) => {
3553
+ e.push(t);
3554
+ });
3555
+ }), e;
3556
+ },
3557
+ parentOption() {
3558
+ return this.tableOption || {};
3559
+ },
3560
+ columnOption() {
3561
+ let e = this.tableOption.column || [], t = c(this.tableOption.group) || [], n = this.tableOption.footer || [];
3562
+ return t.unshift({
3563
+ header: !1,
3564
+ column: e
3565
+ }), n.length !== 0 && t.push({
3566
+ header: !1,
3567
+ column: n
3568
+ }), t.forEach((e) => {
3569
+ e.column = e.column || [], e.column.forEach((e, t) => {
3570
+ e.display !== !1 && !this.isMobile && (e = ie(e, this.itemSpanDefault, t === 0));
3571
+ }), e.column = ae(e.column), e.column = e.column.sort((e, t) => (t.order || 0) - (e.order || 0));
3572
+ }), t;
3573
+ },
3574
+ menuPosition() {
3575
+ return this.parentOption.menuPosition ? this.parentOption.menuPosition : "center";
3576
+ },
3577
+ boxType() {
3578
+ return this.parentOption.boxType;
3579
+ },
3580
+ isPrint() {
3581
+ return this.parentOption.printBtn === !0;
3582
+ },
3583
+ tabsActive() {
3584
+ return this.tableOption.tabsActive || "1";
3585
+ },
3586
+ isMock() {
3587
+ return this.parentOption.mockBtn === !0;
3588
+ }
3589
+ },
3590
+ watch: {
3591
+ modelValue: {
3592
+ handler() {
3593
+ this.formCreate && this.setForm();
3594
+ },
3595
+ deep: !0
3596
+ },
3597
+ form: {
3598
+ handler() {
3599
+ this.formCreate && (this.setLabel(), this.setVal());
3600
+ },
3601
+ deep: !0
3602
+ },
3603
+ tabsActive: {
3604
+ handler() {
3605
+ this.activeName = this.tabsActive;
3606
+ },
3607
+ immediate: !0
3608
+ },
3609
+ DIC: {
3610
+ handler() {
3611
+ this.setLabel();
3612
+ },
3613
+ deep: !0,
3614
+ immediate: !0
3615
+ },
3616
+ allDisabled: {
3617
+ handler(e) {
3618
+ this.$emit("update:status", e);
3619
+ },
3620
+ deep: !0,
3621
+ immediate: !0
3622
+ }
3623
+ },
3624
+ mounted() {
3625
+ setTimeout(() => {
3626
+ this.dataFormat();
3627
+ });
3628
+ },
3629
+ beforeUnmount() {
3630
+ Object.keys(this.formBind).forEach((e) => {
3631
+ this.formBind[e].forEach((e) => {
3632
+ e();
3633
+ });
3634
+ });
3635
+ },
3636
+ methods: {
3637
+ setPx: f,
3638
+ deepClone: c,
3639
+ getComponent: le,
3640
+ getPlaceholder: v,
3641
+ uploadFun: _,
3642
+ getDisabled(e) {
3643
+ return this.vaildDetail(e) || this.isDetail || this.vaildDisabled(e) || this.allDisabled;
3644
+ },
3645
+ getSpan(e) {
3646
+ return e.span || this.parentOption.span || this.itemSpanDefault;
3647
+ },
3648
+ isGroupShow(e, t) {
3649
+ return this.isTabs ? `${t}` === this.activeName || t === 0 : !0;
3650
+ },
3651
+ dataFormat() {
3652
+ let e = ce(this.propOption).tableForm, t = this.modelValue, n = {};
3653
+ Object.entries(Object.assign(e, t)).forEach((e) => {
3654
+ let r = e[0], i = e[1];
3655
+ q(t[r]) ? n[r] = i : n[r] = t[r];
3656
+ }), this.form = n, this.setLabel(), this.setControl(), this.setVal(), setTimeout(() => {
3657
+ this.formCreate = !0, this.clearValidate();
3658
+ });
3659
+ },
3660
+ setControl() {
3661
+ this.propOption.forEach((e) => {
3662
+ let t = e.prop, n = e.bind, r = e.control;
3663
+ if (!this.formBind[t]) {
3664
+ let i = [];
3665
+ if (n) {
3666
+ let e = this.$watch(`form.${t}`, (e, t) => {
3667
+ e !== t && p(this.form, n, e);
3668
+ }), r = this.$watch(`form.${n}`, (e, n) => {
3669
+ e !== n && (this.form[t] = e);
3670
+ });
3671
+ i.push(e), i.push(r), this.form[t] = d(this.form, n);
3672
+ }
3673
+ if (r) {
3674
+ let n = () => {
3675
+ let t = r(this.form[e.prop], this.form) || {};
3676
+ Object.keys(t).forEach((e) => {
3677
+ let n = Object.assign(this.objectOption[e] || {}, t[e]);
3678
+ this.objectOption[e] = n, t[e].dicData && (this.DIC[e] = t[e].dicData);
3679
+ });
3680
+ }, a = this.$watch(`form.${t}`, () => {
3681
+ n();
3682
+ });
3683
+ i.push(a), n();
3684
+ }
3685
+ this.formBind[t] = i;
3686
+ }
3687
+ });
3688
+ },
3689
+ setForm() {
3690
+ Object.keys(this.modelValue).forEach((e) => {
3691
+ this.form[e] = this.modelValue[e];
3692
+ });
3693
+ },
3694
+ setVal() {
3695
+ this.$emit("update:modelValue", this.form), this.$emit("change", this.form);
3696
+ },
3697
+ setLabel() {
3698
+ this.tableOption.filterNull === !0 && (this.form = u(this.form, [""], !1)), this.tableOption.filterDic === !0 ? this.form = u(this.form, ["$"], !1) : this.propOption.forEach((e) => {
3699
+ let t = this.DIC[e.prop];
3700
+ if (q(t)) return;
3701
+ let n = Y(this.form, e, this.tableOption, t);
3702
+ n ? this.form[`$${e.prop}`] = n : delete this.form[`$${e.prop}`];
3703
+ });
3704
+ },
3705
+ handleGroupClick(e) {
3706
+ this.$emit("tab-click", e);
3707
+ },
3708
+ handleTabClick(e, t) {
3709
+ this.$emit("tab-click", e, t);
3710
+ },
3711
+ getLabelWidth(e, t) {
3712
+ let n;
3713
+ return n = q(e.labelWidth) ? q(t.labelWidth) ? this.parentOption.labelWidth : t.labelWidth : e.labelWidth, f(n, this.labelWidth);
3714
+ },
3715
+ validateField(e) {
3716
+ return this.$refs.form.validateField(e);
3717
+ },
3718
+ validTip(e) {
3719
+ return !e.tip || e.type === "upload";
3720
+ },
3721
+ getPropRef(e) {
3722
+ return this.$refs[e][0];
3723
+ },
3724
+ handleChange(e, t) {
3725
+ this.$nextTick(() => {
3726
+ let n = t.cascader, r = n.join(",");
3727
+ n.forEach((i) => {
3728
+ let o = i, s = this.form[t.prop], c = this.findObject(e, o);
3729
+ q(c) || (this.formList.includes(r) && n.forEach((e) => {
3730
+ this.form[e] = "", this.DIC[e] = [];
3731
+ }), !(q(n) || q(s) || q(c)) && b({
3732
+ column: c,
3733
+ value: s,
3734
+ form: this.form
3735
+ }).then((e) => {
3736
+ this.formList.includes(r) || this.formList.push(r);
3737
+ let t = e || [];
3738
+ this.DIC[o] = t, !q(t) && !q(t) && !q(c.cascaderIndex) && q(this.form[o]) && (this.form[o] = t[c.cascaderIndex][(c.props || {}).value || a.value]);
3739
+ }));
3740
+ });
3741
+ });
3742
+ },
3743
+ handlePrint() {
3744
+ this.$Print(this.$el);
3745
+ },
3746
+ propChange(e, t) {
3747
+ t.cascader && this.handleChange(e, t);
3748
+ },
3749
+ handleMock() {
3750
+ this.isMock && (this.columnOption.forEach((e) => {
3751
+ let t = On(e.column, this.DIC, this.form, this.isMock);
3752
+ q(t) || Object.keys(t).forEach((e) => {
3753
+ this.form[e] = t[e];
3754
+ });
3755
+ }), this.$nextTick(() => {
3756
+ this.clearValidate(), this.$emit("mock-change", this.form);
3757
+ }));
3758
+ },
3759
+ vaildDetail(e) {
3760
+ let t;
3761
+ if (this.detail) return !1;
3762
+ if (!q(e.detail)) t = "detail";
3763
+ else if (this.isAdd) t = "addDetail";
3764
+ else if (this.isEdit) t = "editDetail";
3765
+ else if (this.isView) return !1;
3766
+ return t ? e[t] === !0 : !1;
3767
+ },
3768
+ vaildDisabled(e) {
3769
+ let t;
3770
+ if (this.disabled) return !0;
3771
+ if (!q(e.disabled)) t = "disabled";
3772
+ else if (this.isAdd) t = "addDisabled";
3773
+ else if (this.isEdit) t = "editDisabled";
3774
+ else if (this.isView) return !0;
3775
+ return t ? e[t] === !0 : !1;
3776
+ },
3777
+ vaildDisplay(e) {
3778
+ let t;
3779
+ return q(e.display) ? this.isAdd ? t = "addDisplay" : this.isEdit ? t = "editDisplay" : this.isView && (t = "viewDisplay") : t = "display", t ? h(e[t], !0) : !0;
3780
+ },
3781
+ clearValidate(e) {
3782
+ var t;
3783
+ (t = this.$refs.form) == null || t.clearValidate(e);
3784
+ },
3785
+ validateCellForm() {
3786
+ return new Promise((e) => {
3787
+ this.$refs.form.validate((t, n) => {
3788
+ e(n);
3789
+ });
3790
+ });
3791
+ },
3792
+ validate(e) {
3793
+ this.$refs.form.validate((t, n) => {
3794
+ let r = [], i = [], a = {};
3795
+ this.dynamicOption.forEach((e) => {
3796
+ let t = e.children.type === "form";
3797
+ i.push(e.prop), t ? q(this.$refs[e.prop][0].$refs.temp.$refs.main) || this.$refs[e.prop][0].$refs.temp.$refs.main.forEach((e) => {
3798
+ r.push(e.validateCellForm());
3799
+ }) : r.push(this.$refs[e.prop][0].$refs.temp.$refs.main.validateCellForm());
3800
+ }), Promise.all(r).then((t) => {
3801
+ t.forEach((e, t) => {
3802
+ q(e) || (a[i[t]] = e);
3803
+ });
3804
+ let r = Object.assign(a, n);
3805
+ q(r) ? (this.show(), e(!0, this.hide)) : e(!1, this.hide, r);
3806
+ });
3807
+ });
3808
+ },
3809
+ resetForm(e = !0) {
3810
+ if (e) {
3811
+ let e = this.propOption.map((e) => e.prop);
3812
+ this.form = g(this.form, e, (this.tableOption.filterParams || []).concat([this.rowKey]));
3813
+ }
3814
+ this.$nextTick(() => {
3815
+ this.clearValidate(), this.$emit("reset-change");
3816
+ });
3817
+ },
3818
+ resetFields() {
3819
+ this.$refs.form.resetFields();
3820
+ },
3821
+ show() {
3822
+ this.allDisabled = !0;
3823
+ },
3824
+ hide() {
3825
+ this.allDisabled = !1;
3826
+ },
3827
+ submit() {
3828
+ this.validate((e, t) => {
3829
+ e ? this.$emit("submit", u(this.form, ["$"]), this.hide) : this.$emit("error", t);
3830
+ });
3831
+ }
3832
+ }
3833
+ }, An = ["innerHTML"];
3834
+ function jn(e, t, n, r, i, a) {
3835
+ var o;
3836
+ let s = Ye, c = Ze, l = $e, u = Dn, d = C, f = x, p = ft, m = lt, h = Je, g = We;
3837
+ return R(), O("div", {
3838
+ class: F(["avue-form", { "avue--detail": a.isDetail }]),
3839
+ style: L({ width: a.setPx(a.parentOption.formWidth, "100%") })
3840
+ }, [M(g, {
3841
+ ref: "form",
3842
+ "status-icon": a.parentOption.statusIcon,
3843
+ model: i.form,
3844
+ "label-suffix": a.labelSuffix,
3845
+ size: ((o = e.AVUE) == null ? void 0 : o.formSize) || e.controlSize,
3846
+ "label-position": a.parentOption.labelPosition,
3847
+ "label-width": a.setPx(a.parentOption.labelWidth, i.labelWidth),
3848
+ onSubmit: t[1] || (t[1] = K(() => {}, ["prevent"]))
3849
+ }, {
3850
+ default: W(() => [M(h, {
3851
+ span: 24,
3852
+ class: F({ "avue-form__tabs": a.isTabs })
3853
+ }, {
3854
+ default: W(() => [(R(!0), O(T, null, z(a.columnOption, (n, r) => (R(), E(m, {
3855
+ key: n.prop,
3856
+ tabs: a.isTabs,
3857
+ arrow: n.arrow,
3858
+ collapse: n.collapse,
3859
+ display: a.vaildDisplay(n),
3860
+ icon: n.icon,
3861
+ index: r,
3862
+ header: !a.isTabs,
3863
+ active: i.activeName,
3864
+ label: n.label,
3865
+ onChange: a.handleGroupClick
3866
+ }, A({
3867
+ tabs: W(() => [a.isTabs && r === 1 ? (R(), E(c, {
3868
+ key: 0,
3869
+ modelValue: i.activeName,
3870
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => i.activeName = e),
3871
+ class: "avue-form__tabs",
3872
+ type: a.tabsType,
3873
+ onTabClick: a.handleTabClick
3874
+ }, {
3875
+ default: W(() => [(R(!0), O(T, null, z(a.columnOption, (t, n) => (R(), O(T, null, [a.vaildDisplay(t) && n !== 0 ? (R(), E(s, {
3876
+ key: n,
3877
+ name: `${n}`
3878
+ }, {
3879
+ label: W(() => [k("span", null, [e.getSlotName(t, "H", e.$slots) ? B(e.$slots, e.getSlotName(t, "H"), {
3880
+ key: 0,
3881
+ column: e.column
3882
+ }) : (R(), O(T, { key: 1 }, [k("i", { class: F(t.icon) }, "\xA0", 2), j(" " + U(t.label), 1)], 64))])]),
3883
+ _: 2
3884
+ }, 1032, ["name"])) : D("v-if", !0)], 64))), 256))]),
3885
+ _: 3
3886
+ }, 8, [
3887
+ "modelValue",
3888
+ "type",
3889
+ "onTabClick"
3890
+ ])) : D("v-if", !0)]),
3891
+ default: W(() => [G(k("div", { class: F(["avue-form__group", { "avue-form__group--flex": n.flex === !1 }]) }, [(R(!0), O(T, null, z(n.column, (r, o) => (R(), O(T, null, [a.vaildDisplay(r) ? (R(), E(f, {
3892
+ key: o,
3893
+ style: L({
3894
+ paddingLeft: a.gutter,
3895
+ paddingRight: a.gutter
3896
+ }),
3897
+ span: a.getSpan(r),
3898
+ md: a.getSpan(r),
3899
+ sm: r.smSpan || n.smSpan || 12,
3900
+ xs: r.xsSpan || n.xmSpan || 24,
3901
+ offset: r.offset || n.offset,
3902
+ push: r.push || n.push,
3903
+ pull: r.pull || n.pull,
3904
+ class: F([
3905
+ "avue-form__row",
3906
+ { "avue--detail avue--detail__column": a.vaildDetail(r) },
3907
+ r.className
3908
+ ])
3909
+ }, {
3910
+ default: W(() => [M(d, {
3911
+ prop: r.prop,
3912
+ label: r.label,
3913
+ rules: r.rules,
3914
+ class: F(`avue-form__item--${r.labelPosition || n.labelPosition || ""}`),
3915
+ "label-position": r.labelPosition || n.labelPosition || a.parentOption.labelPosition,
3916
+ "label-width": a.getLabelWidth(r, n)
3917
+ }, A({
3918
+ default: W(() => [(R(), E(H(a.validTip(r) ? "div" : "elTooltip"), {
3919
+ class: "avue-form-item-input-wrapper",
3920
+ disabled: a.validTip(r),
3921
+ content: r.tip || a.getPlaceholder(r),
3922
+ placement: r.tipPlacement
3923
+ }, {
3924
+ default: W(() => [e.$slots[r.prop] ? B(e.$slots, r.prop, {
3925
+ key: 0,
3926
+ modelValue: i.form[r.prop],
3927
+ column: r,
3928
+ label: i.form[`$${r.prop}`],
3929
+ size: r.size || e.controlSize,
3930
+ readonly: a.readonly || r.readonly,
3931
+ disabled: a.getDisabled(r),
3932
+ dic: e.DIC[r.prop]
3933
+ }) : (R(), E(u, P({
3934
+ key: 1,
3935
+ ref_for: !0,
3936
+ ref: r.prop
3937
+ }, { ref_for: !0 }, a.uploadFun(r), {
3938
+ modelValue: i.form[r.prop],
3939
+ "onUpdate:modelValue": (e) => i.form[r.prop] = e,
3940
+ column: r,
3941
+ dic: e.DIC[r.prop],
3942
+ props: a.parentOption.props,
3943
+ "props-http": a.parentOption.propsHttp,
3944
+ disabled: a.getDisabled(r),
3945
+ readonly: r.readonly || a.readonly,
3946
+ enter: a.parentOption.enter,
3947
+ size: r.size || e.controlSize,
3948
+ "column-slot": a.columnSlot,
3949
+ onEnter: a.submit,
3950
+ onChange: (e) => a.propChange(n.column, r)
3951
+ }), A({
3952
+ default: W(() => [(R(!0), O(T, null, z(e.getSlotName(r, "T", e.$slots) ? [r] : [], (t) => B(e.$slots, e.getSlotName(t, "T"), P({ ref_for: !0 }, e.scope))), 256))]),
3953
+ _: 2
3954
+ }, [z(a.columnSlot, (t) => ({
3955
+ name: t,
3956
+ fn: W((n) => [B(e.$slots, t, P({ ref_for: !0 }, n))])
3957
+ }))]), 1040, [
3958
+ "modelValue",
3959
+ "onUpdate:modelValue",
3960
+ "column",
3961
+ "dic",
3962
+ "props",
3963
+ "props-http",
3964
+ "disabled",
3965
+ "readonly",
3966
+ "enter",
3967
+ "size",
3968
+ "column-slot",
3969
+ "onEnter",
3970
+ "onChange"
3971
+ ]))]),
3972
+ _: 2
3973
+ }, 1032, [
3974
+ "disabled",
3975
+ "content",
3976
+ "placement"
3977
+ ]))]),
3978
+ _: 2
3979
+ }, [e.getSlotName(r, "L", e.$slots) ? {
3980
+ name: "label",
3981
+ fn: W(() => [B(e.$slots, e.getSlotName(r, "L"), {
3982
+ column: r,
3983
+ modelValue: i.form[r.prop],
3984
+ readonly: r.readonly || a.readonly,
3985
+ disabled: a.getDisabled(r),
3986
+ size: r.size || e.controlSize,
3987
+ dic: e.DIC[r.prop]
3988
+ })]),
3989
+ key: "0"
3990
+ } : r.labelTip ? {
3991
+ name: "label",
3992
+ fn: W(() => [M(l, {
3993
+ class: "item",
3994
+ effect: "dark",
3995
+ placement: r.labelTipPlacement || "top-start"
3996
+ }, {
3997
+ content: W(() => [k("div", { innerHTML: r.labelTip }, null, 8, An)]),
3998
+ default: W(() => [t[2] || (t[2] = k("i", { class: "el-icon-info" }, null, -1))]),
3999
+ _: 2
4000
+ }, 1032, ["placement"]), k("span", null, U(r.label) + U(a.labelSuffix), 1)]),
4001
+ key: "1"
4002
+ } : void 0, e.getSlotName(r, "E", e.$slots) ? {
4003
+ name: "error",
4004
+ fn: W((t) => [B(e.$slots, e.getSlotName(r, "E"), P({ ref_for: !0 }, Object.assign(t, {
4005
+ column: r,
4006
+ value: i.form[r.prop],
4007
+ readonly: a.readonly || r.readonly,
4008
+ disabled: a.getDisabled(r),
4009
+ size: r.size || e.controlSize,
4010
+ dic: e.DIC[r.prop]
4011
+ })))]),
4012
+ key: "2"
4013
+ } : void 0]), 1032, [
4014
+ "prop",
4015
+ "label",
4016
+ "rules",
4017
+ "class",
4018
+ "label-position",
4019
+ "label-width"
4020
+ ])]),
4021
+ _: 2
4022
+ }, 1032, [
4023
+ "style",
4024
+ "span",
4025
+ "md",
4026
+ "sm",
4027
+ "xs",
4028
+ "offset",
4029
+ "push",
4030
+ "pull",
4031
+ "class"
4032
+ ])) : D("v-if", !0), a.vaildDisplay(r) && r.row && r.span !== 24 && r.count ? (R(), O("div", {
4033
+ key: `line${o}`,
4034
+ class: "avue-form__line",
4035
+ style: L({ width: `${r.count / 24 * 100}%` })
4036
+ }, null, 4)) : D("v-if", !0)], 64))), 256)), !a.isDetail && !a.isMenu ? (R(), E(p, { key: 0 }, {
4037
+ menuForm: W((t) => [B(e.$slots, "menuForm", P({ ref_for: !0 }, t))]),
4038
+ _: 3
4039
+ })) : D("v-if", !0)], 2), [[rt, a.isGroupShow(n, r)]])]),
4040
+ _: 2
4041
+ }, [e.getSlotName(n, "H", e.$slots) ? {
4042
+ name: "header",
4043
+ fn: W(() => [B(e.$slots, e.getSlotName(n, "H"), { column: n })]),
4044
+ key: "0"
4045
+ } : void 0]), 1032, [
4046
+ "tabs",
4047
+ "arrow",
4048
+ "collapse",
4049
+ "display",
4050
+ "icon",
4051
+ "index",
4052
+ "header",
4053
+ "active",
4054
+ "label",
4055
+ "onChange"
4056
+ ]))), 128)), !a.isDetail && a.isMenu ? (R(), E(p, { key: 0 }, {
4057
+ menuForm: W((t) => [B(e.$slots, "menuForm", I(N(t)))]),
4058
+ _: 3
4059
+ })) : D("v-if", !0)]),
4060
+ _: 3
4061
+ }, 8, ["class"])]),
4062
+ _: 3
4063
+ }, 8, [
4064
+ "status-icon",
4065
+ "model",
4066
+ "label-suffix",
4067
+ "size",
4068
+ "label-position",
4069
+ "label-width"
4070
+ ])], 6);
4071
+ }
4072
+ var $ = /* @__PURE__ */ t(kn, [["render", jn]]);
4073
+ //#endregion
4074
+ export { Q as i, Cn as n, _n as r, $ as t };