@web-utils/component 2.0.14 → 2.7.0

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 (248) hide show
  1. package/dist/chunks/config.46422d7f.js +73 -0
  2. package/dist/chunks/{3a79781b.js → confirmable-mixin.3a79781b.js} +0 -0
  3. package/dist/chunks/dataformat.fb35ee10.js +61 -0
  4. package/dist/chunks/detail.a3249549.js +28 -0
  5. package/dist/chunks/dic.5f7e3523.js +132 -0
  6. package/dist/chunks/event.50c365eb.js +235 -0
  7. package/dist/chunks/{76680a03.js → form-input-mixin.ff5b58f7.js} +2 -2
  8. package/dist/chunks/{b4acd3a6.js → form-item-mixin.79f6eaff.js} +3 -1
  9. package/dist/chunks/{61ad06b2.js → form-pick-mixin.61ad06b2.js} +0 -0
  10. package/dist/chunks/init.352281f5.js +121 -0
  11. package/dist/chunks/{41a066be.js → input-number-mixin.41a066be.js} +0 -0
  12. package/dist/chunks/{5a78e0db.js → mixins.5a78e0db.js} +0 -0
  13. package/dist/chunks/packages.5d7a86c4.js +114 -0
  14. package/dist/chunks/permission.ce5d2121.js +16 -0
  15. package/dist/chunks/slot.1b8d2b1b.js +27 -0
  16. package/dist/chunks/{8c0142e0.js → tab-mixin.8c0142e0.js} +0 -0
  17. package/dist/chunks/util.5053d54e.js +264 -0
  18. package/dist/chunks/{97652d86.js → utils.97652d86.js} +0 -0
  19. package/dist/chunks/{f71045fc.js → utils.fa73de78.js} +1 -0
  20. package/dist/chunks/{5d4282fb.js → vueComponentNormalizer.71e2aa87.js} +3 -1
  21. package/dist/components/address-input/index.js +1 -1
  22. package/dist/components/affix/index.js +102 -0
  23. package/dist/components/affix/style.css +1 -0
  24. package/dist/components/array/index.js +156 -0
  25. package/dist/components/array/style.css +1 -0
  26. package/dist/components/article/index.js +93 -0
  27. package/dist/components/article/style.css +1 -0
  28. package/dist/components/aside-menu/index.js +1 -1
  29. package/dist/components/avatar/index.js +106 -0
  30. package/dist/components/avatar/style.css +1 -0
  31. package/dist/components/awesome-button/index.js +1 -1
  32. package/dist/components/base.css +1 -1
  33. package/dist/components/capsule-tab/index.js +1 -1
  34. package/dist/components/card/index.js +130 -0
  35. package/dist/components/card/style.css +1 -0
  36. package/dist/components/carousel/index.js +70 -0
  37. package/dist/components/carousel/style.css +1 -0
  38. package/dist/components/chat/index.js +567 -0
  39. package/dist/components/chat/style.css +1 -0
  40. package/dist/components/chunk-file-uploader/index.js +2 -2
  41. package/dist/components/chunk-file-uploader-button/index.js +2 -2
  42. package/dist/components/chunk-file-uploader-drop/index.js +2 -2
  43. package/dist/components/chunk-file-uploader-file/index.js +2 -2
  44. package/dist/components/chunk-file-uploader-files/index.js +2 -2
  45. package/dist/components/chunk-file-uploader-list/index.js +2 -2
  46. package/dist/components/chunk-file-uploader-un-support/index.js +2 -2
  47. package/dist/components/code/index.js +66 -0
  48. package/dist/components/code-mirror-editor/index.js +4 -1
  49. package/dist/components/color-picker/index.js +1 -1
  50. package/dist/components/column/index.js +114 -0
  51. package/dist/components/column-default/index.js +105 -0
  52. package/dist/components/column-dynamic/index.js +93 -0
  53. package/dist/components/column-menu/index.js +286 -0
  54. package/dist/components/column-slot/index.js +265 -0
  55. package/dist/components/comment/index.js +94 -0
  56. package/dist/components/comment/style.css +1 -0
  57. package/dist/components/confirm-button/index.js +2 -2
  58. package/dist/components/confirmable/index.js +2 -2
  59. package/dist/components/context-menu/index.js +11 -1
  60. package/dist/components/count-up/index.js +120 -0
  61. package/dist/components/custom-scrollbar/index.js +2 -2
  62. package/dist/components/data-box/index.js +97 -0
  63. package/dist/components/data-box/style.css +1 -0
  64. package/dist/components/data-card/index.js +98 -0
  65. package/dist/components/data-card/style.css +1 -0
  66. package/dist/components/data-cardtext/index.js +82 -0
  67. package/dist/components/data-cardtext/style.css +1 -0
  68. package/dist/components/data-display/index.js +93 -0
  69. package/dist/components/data-display/style.css +1 -0
  70. package/dist/components/data-icons/index.js +104 -0
  71. package/dist/components/data-icons/style.css +1 -0
  72. package/dist/components/data-imgtext/index.js +106 -0
  73. package/dist/components/data-imgtext/style.css +1 -0
  74. package/dist/components/data-operatext/index.js +99 -0
  75. package/dist/components/data-operatext/style.css +1 -0
  76. package/dist/components/data-panel/index.js +93 -0
  77. package/dist/components/data-panel/style.css +1 -0
  78. package/dist/components/data-pay/index.js +149 -0
  79. package/dist/components/data-pay/style.css +1 -0
  80. package/dist/components/data-price/index.js +84 -0
  81. package/dist/components/data-price/style.css +1 -0
  82. package/dist/components/data-progress/index.js +97 -0
  83. package/dist/components/data-progress/style.css +1 -0
  84. package/dist/components/data-rotate/index.js +96 -0
  85. package/dist/components/data-rotate/style.css +1 -0
  86. package/dist/components/data-table-picker/index.js +2 -2
  87. package/dist/components/data-tabs/index.js +94 -0
  88. package/dist/components/data-tabs/style.css +1 -0
  89. package/dist/components/dialog-column/index.js +138 -0
  90. package/dist/components/dialog-excel/index.js +214 -0
  91. package/dist/components/dialog-filter/index.js +245 -0
  92. package/dist/components/dialog-form/index.js +275 -0
  93. package/dist/components/draggable/index.js +384 -0
  94. package/dist/components/draggable/style.css +1 -0
  95. package/dist/components/dynamic-table/index.js +1 -1
  96. package/dist/components/e-charts/index.js +7 -1
  97. package/dist/components/editable-progress/index.js +1 -1
  98. package/dist/components/editable-tree/index.js +2 -2
  99. package/dist/components/egd-collapse/index.js +1 -1
  100. package/dist/components/egd-collapse-item/index.js +1 -1
  101. package/dist/components/element-dialog/index.js +1 -1
  102. package/dist/components/empty/index.js +59 -0
  103. package/dist/components/empty/style.css +1 -0
  104. package/dist/components/empty-view/index.js +1 -1
  105. package/dist/components/error-view/index.js +1 -1
  106. package/dist/components/flex-column/index.js +2 -2
  107. package/dist/components/flex-item/index.js +2 -2
  108. package/dist/components/flex-row/index.js +2 -2
  109. package/dist/components/flex-scroller/index.js +1 -1
  110. package/dist/components/flow/index.js +278 -0
  111. package/dist/components/flow/style.css +1 -0
  112. package/dist/components/flow-node/index.js +102 -0
  113. package/dist/components/form-button/index.js +2 -2
  114. package/dist/components/form-cascader/index.js +4 -4
  115. package/dist/components/form-checkbox-group/index.js +4 -4
  116. package/dist/components/form-date-picker/index.js +4 -4
  117. package/dist/components/form-group/index.js +122 -0
  118. package/dist/components/form-group/style.css +1 -0
  119. package/dist/components/form-holder/index.js +23 -2
  120. package/dist/components/form-input/index.js +3 -3
  121. package/dist/components/form-input-email/index.js +3 -3
  122. package/dist/components/form-input-id-card/index.js +3 -3
  123. package/dist/components/form-input-number/index.js +4 -4
  124. package/dist/components/form-input-phone-number/index.js +3 -3
  125. package/dist/components/form-input-time/index.js +3 -3
  126. package/dist/components/form-item/index.js +2 -2
  127. package/dist/components/form-item-config-provider/index.js +1 -1
  128. package/dist/components/form-item-group/index.js +1 -1
  129. package/dist/components/form-radio-group/index.js +4 -4
  130. package/dist/components/form-select/index.js +4 -4
  131. package/dist/components/form-switch/index.js +3 -3
  132. package/dist/components/form-temp/index.js +149 -0
  133. package/dist/components/form-textarea/index.js +3 -3
  134. package/dist/components/form-view/index.js +1 -1
  135. package/dist/components/fy-cascader/index.js +132 -0
  136. package/dist/components/fy-checkbox/index.js +116 -0
  137. package/dist/components/fy-checkbox/style.css +1 -0
  138. package/dist/components/fy-curd/index.js +846 -0
  139. package/dist/components/fy-curd/style.css +1 -0
  140. package/dist/components/fy-date/index.js +84 -0
  141. package/dist/components/fy-date/style.css +1 -0
  142. package/dist/components/fy-dialog-form/index.js +278 -0
  143. package/dist/components/fy-dialog-form/style.css +1 -0
  144. package/dist/components/fy-dynamic/index.js +335 -0
  145. package/dist/components/fy-dynamic/style.css +1 -0
  146. package/dist/components/fy-form/index.js +754 -0
  147. package/dist/components/fy-form/style.css +1 -0
  148. package/dist/components/fy-form-menu/index.js +95 -0
  149. package/dist/components/fy-input/index.js +162 -0
  150. package/dist/components/fy-input-color/index.js +96 -0
  151. package/dist/components/fy-input-icon/index.js +161 -0
  152. package/dist/components/fy-input-icon/style.css +1 -0
  153. package/dist/components/fy-input-map/index.js +275 -0
  154. package/dist/components/fy-input-map/style.css +1 -0
  155. package/dist/components/fy-input-number/index.js +87 -0
  156. package/dist/components/fy-input-table/index.js +172 -0
  157. package/dist/components/fy-input-table/style.css +1 -0
  158. package/dist/components/fy-input-tree/index.js +265 -0
  159. package/dist/components/fy-input-tree/style.css +1 -0
  160. package/dist/components/fy-radio/index.js +68 -0
  161. package/dist/components/fy-radio/style.css +1 -0
  162. package/dist/components/fy-rate/index.js +105 -0
  163. package/dist/components/fy-rate/style.css +1 -0
  164. package/dist/components/fy-select/index.js +223 -0
  165. package/dist/components/fy-select/style.css +1 -0
  166. package/dist/components/fy-slider/index.js +79 -0
  167. package/dist/components/fy-switch/index.js +73 -0
  168. package/dist/components/fy-time/index.js +95 -0
  169. package/dist/components/fy-title/index.js +40 -0
  170. package/dist/components/fy-title/style.css +1 -0
  171. package/dist/components/fy-upload/index.js +704 -0
  172. package/dist/components/fy-upload/style.css +1 -0
  173. package/dist/components/guide-steps/index.js +1 -1
  174. package/dist/components/header-menu/index.js +238 -0
  175. package/dist/components/header-search/index.js +246 -0
  176. package/dist/components/icon-card/index.js +1 -1
  177. package/dist/components/icon-temp/index.js +50 -0
  178. package/dist/components/icon-temp/style.css +1 -0
  179. package/dist/components/iframe-window/index.js +1 -1
  180. package/dist/components/image-viewer/index.js +1 -1
  181. package/dist/components/input-number/index.js +2 -2
  182. package/dist/components/input-number-range/index.js +1 -1
  183. package/dist/components/keep-view-alive/index.js +6 -2
  184. package/dist/components/keyboard/index.js +389 -0
  185. package/dist/components/keyboard/style.css +1 -0
  186. package/dist/components/license/index.js +134 -0
  187. package/dist/components/loading-view/index.js +1 -1
  188. package/dist/components/login/index.js +244 -0
  189. package/dist/components/login/style.css +1 -0
  190. package/dist/components/name-avatar/index.js +66 -0
  191. package/dist/components/name-avatar/style.css +1 -0
  192. package/dist/components/nav-bar/index.js +1 -1
  193. package/dist/components/not-implement/index.js +1 -1
  194. package/dist/components/notice/index.js +143 -0
  195. package/dist/components/notice/style.css +1 -0
  196. package/dist/components/page/index.js +1 -1
  197. package/dist/components/page-header/index.js +1 -1
  198. package/dist/components/page-index/index.js +1 -1
  199. package/dist/components/page-index-top/index.js +1 -1
  200. package/dist/components/page-skeleton/index.js +1 -1
  201. package/dist/components/page-skeleton-new/index.js +1 -1
  202. package/dist/components/pageable-table/index.js +6 -2
  203. package/dist/components/pageable-view/index.js +7 -2
  204. package/dist/components/photo-swipe/index.js +7 -1
  205. package/dist/components/progress/index.js +60 -0
  206. package/dist/components/queue/index.js +76 -0
  207. package/dist/components/record-video/index.js +173 -0
  208. package/dist/components/record-video/style.css +1 -0
  209. package/dist/components/resize-observer/index.js +2 -2
  210. package/dist/components/search/index.js +142 -0
  211. package/dist/components/search/style.css +1 -0
  212. package/dist/components/search-popover/index.js +1 -1
  213. package/dist/components/sign/index.js +128 -0
  214. package/dist/components/sign/style.css +1 -0
  215. package/dist/components/sign-panel/index.js +14 -1
  216. package/dist/components/skeleton/index.js +82 -0
  217. package/dist/components/skeleton/style.css +1 -0
  218. package/dist/components/split-pane/index.js +7 -1
  219. package/dist/components/stateful/index.js +1 -1
  220. package/dist/components/static-pageable-table/index.js +1 -1
  221. package/dist/components/swiper/index.js +1 -1
  222. package/dist/components/tab/index.js +4 -2
  223. package/dist/components/tab-item/index.js +2 -2
  224. package/dist/components/table-column/index.js +1 -1
  225. package/dist/components/table-page/index.js +129 -0
  226. package/dist/components/table-view/index.js +2 -2
  227. package/dist/components/tabs/index.js +90 -0
  228. package/dist/components/tabs/style.css +0 -0
  229. package/dist/components/tag-render/index.js +1 -1
  230. package/dist/components/text-ellipsis/index.js +107 -0
  231. package/dist/components/text-ellipsis/style.css +1 -0
  232. package/dist/components/tinymce-editor/index.js +1 -1
  233. package/dist/components/tinymce-wrapper/index.js +1 -1
  234. package/dist/components/toolbar/index.js +1 -1
  235. package/dist/components/toolbar-button/index.js +1 -1
  236. package/dist/components/tree/index.js +427 -0
  237. package/dist/components/tree/style.css +1 -0
  238. package/dist/components/trigger/index.js +1 -1
  239. package/dist/components/verify/index.js +80 -0
  240. package/dist/components/verify/style.css +1 -0
  241. package/dist/components/vue-tags-input/index.js +115 -1
  242. package/dist/components/watermark/index.js +20 -2
  243. package/dist/index.css +4128 -745
  244. package/dist/index.es.js +21634 -7064
  245. package/package.json +20 -4
  246. package/web-types.json +12777 -2788
  247. package/dist/components/x-dialog/index.js +0 -173
  248. package/dist/components/x-dialog/style.css +0 -1
@@ -0,0 +1,754 @@
1
+ import { d as P } from "../../chunks/detail.a3249549.js";
2
+ import { i as N } from "../../chunks/init.352281f5.js";
3
+ import { s as _, k as $, u as j, c as h, l as I, m as L, n as O, a as V, o as z, p as M } from "../../chunks/util.5053d54e.js";
4
+ import { c as A, b as B, g as W, a as R, f as G } from "../../chunks/dataformat.fb35ee10.js";
5
+ import { s as H } from "../../chunks/dic.5f7e3523.js";
6
+ import { p as U } from "../../chunks/packages.5d7a86c4.js";
7
+ import { n as q } from "../../chunks/vueComponentNormalizer.71e2aa87.js";
8
+ const K = (t, i, s, r) => {
9
+ if (!r)
10
+ return;
11
+ if (!window.Mock) {
12
+ U.logs("mock");
13
+ return;
14
+ }
15
+ let e = (window.Mock || {}).Random, a = {};
16
+ function o({ en: u }) {
17
+ return u ? e.name(!0) : e.cname();
18
+ }
19
+ function l({ max: u, min: n, precision: p }) {
20
+ if (p) {
21
+ const c = e.float(n, u, p) + "", m = c.indexOf(".") + 1;
22
+ return Number(c.substring(0, m + p));
23
+ } else
24
+ return e.integer(n, u);
25
+ }
26
+ function d({ header: u, footer: n }) {
27
+ let p = e.url();
28
+ const c = p.indexOf("://");
29
+ return u === !1 ? p = p.substring(c + 3) : p = "http://" + p.substring(c + 3), p;
30
+ }
31
+ function F({ format: u, now: n }) {
32
+ return n ? e.now(u) : e.datetime(u);
33
+ }
34
+ function C({ min: u, max: n }) {
35
+ return e.csentence(u, n);
36
+ }
37
+ function x() {
38
+ return e.county(!0);
39
+ }
40
+ function T({ dic: u, props: n, columnType: p, multiple: c }) {
41
+ const m = n.value || "value", b = u.length;
42
+ if (["checkbox"].includes(p) || c) {
43
+ const v = l({
44
+ min: 1,
45
+ max: b
46
+ });
47
+ let y = [];
48
+ for (let g = 0; g < v; g++) {
49
+ let D = !0;
50
+ for (; D; ) {
51
+ const E = l({
52
+ min: 0,
53
+ max: b - 1
54
+ }), k = u[E][m];
55
+ y.includes(k) || (y.push(k), D = !1);
56
+ }
57
+ }
58
+ return y;
59
+ } else {
60
+ const v = l({
61
+ min: 0,
62
+ max: b - 1
63
+ });
64
+ return u[v][m];
65
+ }
66
+ }
67
+ function w() {
68
+ Object.keys(t).forEach((u) => {
69
+ const n = t[u];
70
+ if (n.mock && typeof n.mock == "object") {
71
+ let p = n.mock;
72
+ switch (p.dic = typeof n.dicData == "string" ? i[n.dicData] : n.dicData || [], p.props = n.props || {}, p.columnType = n.type, p.multiple = n.multiple, p.type) {
73
+ case "name":
74
+ a[n.prop] = o(p);
75
+ break;
76
+ case "number":
77
+ a[n.prop] = l(p);
78
+ break;
79
+ case "datetime":
80
+ a[n.prop] = F(p);
81
+ break;
82
+ case "word":
83
+ a[n.prop] = C(p);
84
+ break;
85
+ case "url":
86
+ a[n.prop] = d(p);
87
+ break;
88
+ case "county":
89
+ a[n.prop] = x();
90
+ break;
91
+ case "dic":
92
+ a[n.prop] = T(p);
93
+ break;
94
+ }
95
+ } else
96
+ n.mock instanceof Function && (a[n.prop] = n.mock(s));
97
+ });
98
+ }
99
+ return w(), a;
100
+ };
101
+ var J = function() {
102
+ var t = this, i = t.$createElement, s = t._self._c || i;
103
+ return s("div", {
104
+ class: ["avue-form", {
105
+ "avue--detail": t.isDetail
106
+ }],
107
+ style: {
108
+ width: t.setPx(t.parentOption.formWidth, "100%")
109
+ }
110
+ }, [s("ElForm", {
111
+ ref: "form",
112
+ attrs: {
113
+ "status-icon": t.parentOption.statusIcon,
114
+ model: t.form,
115
+ "label-suffix": t.labelSuffix,
116
+ size: t.$AVUE.formSize || t.controlSize,
117
+ "label-position": t.parentOption.labelPosition,
118
+ "label-width": t.setPx(t.parentOption.labelWidth, t.labelWidth)
119
+ },
120
+ nativeOn: {
121
+ submit: function(r) {
122
+ r.preventDefault();
123
+ }
124
+ }
125
+ }, [s("ElRow", {
126
+ class: {
127
+ "avue-form__tabs": t.isTabs
128
+ },
129
+ attrs: {
130
+ span: 24
131
+ }
132
+ }, [t._l(t.columnOption, function(r, f) {
133
+ return s("FormGroup", {
134
+ key: r.prop,
135
+ attrs: {
136
+ tabs: t.isTabs,
137
+ arrow: r.arrow,
138
+ collapse: r.collapse,
139
+ display: t.vaildDisplay(r),
140
+ icon: r.icon,
141
+ index: f,
142
+ header: !t.isTabs,
143
+ active: t.activeName,
144
+ label: r.label
145
+ },
146
+ on: {
147
+ change: t.handleGroupClick
148
+ }
149
+ }, [t.isTabs && f == 1 ? s("ElTabs", {
150
+ staticClass: "avue-form__tabs",
151
+ attrs: {
152
+ slot: "tabs",
153
+ type: t.tabsType
154
+ },
155
+ on: {
156
+ "tab-click": t.handleTabClick
157
+ },
158
+ slot: "tabs",
159
+ model: {
160
+ value: t.activeName,
161
+ callback: function(e) {
162
+ t.activeName = e;
163
+ },
164
+ expression: "activeName"
165
+ }
166
+ }, [t._l(t.columnOption, function(e, a) {
167
+ return [t.vaildDisplay(e) && a != 0 ? s("ElTabPane", {
168
+ key: a,
169
+ attrs: {
170
+ name: a + ""
171
+ }
172
+ }, [s("span", {
173
+ attrs: {
174
+ slot: "label"
175
+ },
176
+ slot: "label"
177
+ }, [t.getSlotName(e, "H", t.$scopedSlots) ? t._t(t.getSlotName(e, "H"), null, {
178
+ column: t.column
179
+ }) : [s("i", {
180
+ class: e.icon
181
+ }, [t._v(" ")]), t._v(" " + t._s(e.label) + " ")]], 2)]) : t._e()];
182
+ })], 2) : t._e(), t.getSlotName(r, "H", t.$scopedSlots) ? s("template", {
183
+ slot: "header"
184
+ }, [t._t(t.getSlotName(r, "H"), null, {
185
+ column: r
186
+ })], 2) : t._e(), s("div", {
187
+ directives: [{
188
+ name: "show",
189
+ rawName: "v-show",
190
+ value: t.isGroupShow(r, f),
191
+ expression: "isGroupShow(item,index)"
192
+ }],
193
+ class: ["avue-form__group", {
194
+ "avue-form__group--flex": r.flex === !1
195
+ }]
196
+ }, [t._l(r.column, function(e, a) {
197
+ return [t.vaildDisplay(e) ? s("ElCol", {
198
+ key: a,
199
+ class: ["avue-form__row", {
200
+ "avue--detail avue--detail__column": t.vaildDetail(e)
201
+ }, e.className],
202
+ style: {
203
+ paddingLeft: t.gutter,
204
+ paddingRight: t.gutter
205
+ },
206
+ attrs: {
207
+ span: t.getSpan(e),
208
+ md: t.getSpan(e),
209
+ sm: e.smSpan || r.smSpan || 12,
210
+ xs: e.xsSpan || r.xmSpan || 24,
211
+ offset: e.offset || r.offset,
212
+ push: e.push || r.push,
213
+ pull: e.pull || r.pull
214
+ }
215
+ }, [s("ElFormItem", {
216
+ class: "avue-form__item--" + (e.labelPosition || r.labelPosition || ""),
217
+ attrs: {
218
+ prop: e.prop,
219
+ label: e.label,
220
+ rules: e.rules,
221
+ "label-position": e.labelPosition || r.labelPosition || t.parentOption.labelPosition,
222
+ "label-width": t.getLabelWidth(e, r)
223
+ },
224
+ scopedSlots: t._u([{
225
+ key: "error",
226
+ fn: function(o) {
227
+ return t.getSlotName(e, "E", t.$scopedSlots) ? [t._t(t.getSlotName(e, "E"), null, null, Object.assign(o, {
228
+ column: e,
229
+ value: t.form[e.prop],
230
+ readonly: t.readonly || e.readonly,
231
+ disabled: t.getDisabled(e),
232
+ size: e.size || t.controlSize,
233
+ dic: t.DIC[e.prop]
234
+ }))] : void 0;
235
+ }
236
+ }], null, !0)
237
+ }, [t.getSlotName(e, "L", t.$scopedSlots) ? s("template", {
238
+ slot: "label"
239
+ }, [t._t(t.getSlotName(e, "L"), null, {
240
+ column: e,
241
+ value: t.form[e.prop],
242
+ readonly: e.readonly || t.readonly,
243
+ disabled: t.getDisabled(e),
244
+ size: e.size || t.controlSize,
245
+ dic: t.DIC[e.prop]
246
+ })], 2) : e.labelTip ? s("template", {
247
+ slot: "label"
248
+ }, [s("ElTooltip", {
249
+ staticClass: "item",
250
+ attrs: {
251
+ effect: "dark",
252
+ placement: e.labelTipPlacement || "top-start"
253
+ }
254
+ }, [s("div", {
255
+ attrs: {
256
+ slot: "content"
257
+ },
258
+ domProps: {
259
+ innerHTML: t._s(e.labelTip)
260
+ },
261
+ slot: "content"
262
+ }), s("i", {
263
+ staticClass: "el-icon-info"
264
+ })]), s("span", [t._v(" " + t._s(e.label) + t._s(t.labelSuffix))])], 1) : t._e(), s(t.validTip(e) ? "div" : "elTooltip", {
265
+ tag: "Component",
266
+ attrs: {
267
+ disabled: t.validTip(e),
268
+ content: e.tip || t.getPlaceholder(e),
269
+ placement: e.tipPlacement
270
+ }
271
+ }, [t.$scopedSlots[e.prop] ? t._t(e.prop, null, {
272
+ value: t.form[e.prop],
273
+ column: e,
274
+ label: t.form["$" + e.prop],
275
+ size: e.size || t.controlSize,
276
+ readonly: t.readonly || e.readonly,
277
+ disabled: t.getDisabled(e),
278
+ dic: t.DIC[e.prop]
279
+ }) : s("FormTemp", t._b({
280
+ ref: e.prop,
281
+ refInFor: !0,
282
+ attrs: {
283
+ column: e,
284
+ dic: t.DIC[e.prop],
285
+ props: t.parentOption.props,
286
+ "props-http": t.parentOption.propsHttp,
287
+ disabled: t.getDisabled(e),
288
+ readonly: e.readonly || t.readonly,
289
+ enter: t.parentOption.enter,
290
+ size: e.size || t.controlSize,
291
+ "column-slot": t.columnSlot
292
+ },
293
+ on: {
294
+ enter: t.submit,
295
+ change: function(o) {
296
+ return t.propChange(r.column, e);
297
+ }
298
+ },
299
+ scopedSlots: t._u([t._l(t.getSlotName(e, "T", t.$scopedSlots) ? [e] : [], function(o) {
300
+ return {
301
+ key: t.getSlotName(e, "T"),
302
+ fn: function(l) {
303
+ return [t._t(t.getSlotName(o, "T"), null, null, l)];
304
+ }
305
+ };
306
+ }), t._l(t.columnSlot, function(o) {
307
+ return {
308
+ key: o,
309
+ fn: function(l) {
310
+ return [t._t(o, null, null, l)];
311
+ }
312
+ };
313
+ })], null, !0),
314
+ model: {
315
+ value: t.form[e.prop],
316
+ callback: function(o) {
317
+ t.$set(t.form, e.prop, o);
318
+ },
319
+ expression: "form[column.prop]"
320
+ }
321
+ }, "FormTemp", t.uploadFun(e), !1))], 2)], 2)], 1) : t._e(), t.vaildDisplay(e) && e.row && e.span !== 24 && e.count ? s("div", {
322
+ key: `line${a}`,
323
+ staticClass: "avue-form__line",
324
+ style: {
325
+ width: e.count / 24 * 100 + "%"
326
+ }
327
+ }) : t._e()];
328
+ }), !t.isDetail && !t.isMenu ? s("FyFormMenu", {
329
+ scopedSlots: t._u([{
330
+ key: "menuForm",
331
+ fn: function(e) {
332
+ return [t._t("menuForm", null, null, e)];
333
+ }
334
+ }], null, !0)
335
+ }) : t._e()], 2)], 2);
336
+ }), !t.isDetail && t.isMenu ? s("FyFormMenu", {
337
+ scopedSlots: t._u([{
338
+ key: "menuForm",
339
+ fn: function(r) {
340
+ return [t._t("menuForm", null, null, r)];
341
+ }
342
+ }], null, !0)
343
+ }) : t._e()], 2)], 1)], 1);
344
+ }, Q = [];
345
+ const X = {
346
+ name: "FyForm",
347
+ mixins: [N],
348
+ provide() {
349
+ return {
350
+ formSafe: this
351
+ };
352
+ },
353
+ props: {
354
+ uploadBefore: Function,
355
+ uploadAfter: Function,
356
+ uploadDelete: Function,
357
+ uploadPreview: Function,
358
+ uploadError: Function,
359
+ uploadExceed: Function,
360
+ status: {
361
+ type: Boolean,
362
+ default: !1
363
+ },
364
+ isCrud: {
365
+ type: Boolean,
366
+ default: !1
367
+ },
368
+ value: {
369
+ type: Object,
370
+ required: !0,
371
+ default: () => ({})
372
+ }
373
+ },
374
+ data() {
375
+ return {
376
+ activeName: "",
377
+ labelWidth: 90,
378
+ allDisabled: !1,
379
+ optionIndex: [],
380
+ optionBox: !1,
381
+ tableOption: {},
382
+ itemSpanDefault: 12,
383
+ form: {},
384
+ formCreate: !1,
385
+ formList: [],
386
+ formBind: {}
387
+ };
388
+ },
389
+ computed: {
390
+ columnSlot() {
391
+ return Object.keys(this.$scopedSlots).filter((t) => !this.propOption.map((i) => i.prop).includes(t));
392
+ },
393
+ labelSuffix() {
394
+ return this.parentOption.labelSuffix || ":";
395
+ },
396
+ isMenu() {
397
+ return this.columnOption.length !== 1;
398
+ },
399
+ isDetail() {
400
+ return this.detail === !0;
401
+ },
402
+ isTabs() {
403
+ return this.parentOption.tabs === !0;
404
+ },
405
+ isAdd() {
406
+ return this.boxType === "add";
407
+ },
408
+ isEdit() {
409
+ return this.boxType === "edit";
410
+ },
411
+ isView() {
412
+ return this.boxType === "view";
413
+ },
414
+ gutter() {
415
+ return _((this.parentOption.gutter || 10) / 2);
416
+ },
417
+ detail() {
418
+ return this.parentOption.detail;
419
+ },
420
+ disabled() {
421
+ return this.parentOption.disabled;
422
+ },
423
+ readonly() {
424
+ return this.parentOption.readonly;
425
+ },
426
+ tabsType() {
427
+ return this.parentOption.tabsType;
428
+ },
429
+ columnLen() {
430
+ return this.columnOption.length;
431
+ },
432
+ dynamicOption() {
433
+ let t = [];
434
+ return this.propOption.forEach((i) => {
435
+ i.type === "dynamic" && this.vaildDisplay(i) && t.push(i);
436
+ }), t;
437
+ },
438
+ propOption() {
439
+ let t = [];
440
+ return this.columnOption.forEach((i) => {
441
+ i.display !== !1 && i.column.forEach((s) => {
442
+ t.push(s);
443
+ });
444
+ }), t;
445
+ },
446
+ parentOption() {
447
+ return this.tableOption || {};
448
+ },
449
+ columnOption() {
450
+ let t = this.tableOption.column || [], i = $(this.tableOption.group) || [], s = this.tableOption.footer || [];
451
+ return i.unshift({
452
+ header: !1,
453
+ column: t
454
+ }), s.length !== 0 && i.push({
455
+ header: !1,
456
+ column: s
457
+ }), i.forEach((r, f) => {
458
+ r.column = r.column || [], r.column.forEach((e, a) => {
459
+ e.display !== !1 && !this.isMobile && (e = A(e, this.itemSpanDefault, a === 0));
460
+ }), r.column = B(r.column), r.column = r.column.sort((e, a) => (a.order || 0) - (e.order || 0));
461
+ }), i;
462
+ },
463
+ menuPosition: function() {
464
+ return this.parentOption.menuPosition ? this.parentOption.menuPosition : "center";
465
+ },
466
+ boxType: function() {
467
+ return this.parentOption.boxType;
468
+ },
469
+ isPrint() {
470
+ return this.parentOption.printBtn === !0;
471
+ },
472
+ tabsActive() {
473
+ return this.tableOption.tabsActive || "1";
474
+ },
475
+ isMock() {
476
+ return this.parentOption.mockBtn === !0;
477
+ }
478
+ },
479
+ watch: {
480
+ value: {
481
+ handler(t) {
482
+ this.formCreate && this.setForm();
483
+ },
484
+ deep: !0
485
+ },
486
+ form: {
487
+ handler(t) {
488
+ this.formCreate && (this.setLabel(), this.setVal());
489
+ },
490
+ deep: !0
491
+ },
492
+ tabsActive: {
493
+ handler(t) {
494
+ this.activeName = this.tabsActive;
495
+ },
496
+ immediate: !0
497
+ },
498
+ DIC: {
499
+ handler() {
500
+ this.setLabel();
501
+ },
502
+ deep: !0,
503
+ immediate: !0
504
+ },
505
+ allDisabled: {
506
+ handler(t) {
507
+ this.$emit("update:status", t);
508
+ },
509
+ deep: !0,
510
+ immediate: !0
511
+ }
512
+ },
513
+ mounted() {
514
+ setTimeout(() => {
515
+ this.dataFormat();
516
+ });
517
+ },
518
+ beforeDestroy() {
519
+ Object.keys(this.formBind).forEach((t) => {
520
+ this.formBind[t].forEach((i) => {
521
+ i();
522
+ });
523
+ });
524
+ },
525
+ methods: {
526
+ setPx: _,
527
+ deepClone: $,
528
+ getComponent: W,
529
+ getPlaceholder: R,
530
+ uploadFun: j,
531
+ getDisabled(t) {
532
+ return this.vaildDetail(t) || this.isDetail || this.vaildDisabled(t) || this.allDisabled;
533
+ },
534
+ getSpan(t) {
535
+ return t.span || this.parentOption.span || this.itemSpanDefault;
536
+ },
537
+ isGroupShow(t, i) {
538
+ return this.isTabs ? i == this.activeName || i == 0 : !0;
539
+ },
540
+ //初始化表单
541
+ dataFormat() {
542
+ let t = G(this.propOption).tableForm, i = this.value, s = {};
543
+ Object.entries(Object.assign(t, i)).forEach((r) => {
544
+ let f = r[0], e = r[1];
545
+ h(i[f]) ? s[f] = e : s[f] = i[f];
546
+ }), this.$set(this, "form", s), this.setLabel(), this.setControl(), this.setVal(), setTimeout(() => {
547
+ this.formCreate = !0, this.clearValidate();
548
+ });
549
+ },
550
+ setControl() {
551
+ this.propOption.forEach((t) => {
552
+ let i = t.prop, s = t.bind, r = t.control;
553
+ if (this.form, !this.formBind[i]) {
554
+ let f = [];
555
+ if (s) {
556
+ let e = this.$watch("form." + i, (o, l) => {
557
+ o != l && I(this.form, s, o);
558
+ }), a = this.$watch("form." + s, (o, l) => {
559
+ o != l && this.$set(this.form, i, o);
560
+ });
561
+ f.push(e), f.push(a), this.$set(this.form, i, L(this.form, s));
562
+ }
563
+ if (r) {
564
+ const e = () => {
565
+ let o = r(this.form[t.prop], this.form) || {};
566
+ Object.keys(o).forEach((l) => {
567
+ let d = Object.assign(this.objectOption[l] || {}, o[l]);
568
+ this.$set(this.objectOption, l, d), o[l].dicData && (this.DIC[l] = o[l].dicData);
569
+ });
570
+ };
571
+ let a = this.$watch("form." + i, (o, l) => {
572
+ e();
573
+ });
574
+ f.push(a), e();
575
+ }
576
+ this.formBind[i] = f;
577
+ }
578
+ });
579
+ },
580
+ setForm() {
581
+ Object.keys(this.value).forEach((t) => {
582
+ this.$set(this.form, t, this.value[t]);
583
+ });
584
+ },
585
+ setVal() {
586
+ this.$emit("input", this.form), this.$emit("change", this.form);
587
+ },
588
+ setLabel() {
589
+ this.tableOption.filterNull === !0 && (this.form = O(this.form, [""], !1)), this.tableOption.filterDic == !0 ? this.form = O(this.form, ["$"], !1) : this.propOption.forEach((t) => {
590
+ let i, s = this.DIC[t.prop];
591
+ h(s) || (i = P(this.form, t, this.tableOption, s), i ? this.$set(this.form, `$${t.prop}`, i) : this.$delete(this.form, `$${t.prop}`));
592
+ });
593
+ },
594
+ handleGroupClick(t) {
595
+ this.$emit("tab-click", t);
596
+ },
597
+ handleTabClick(t, i) {
598
+ this.$emit("tab-click", t, i);
599
+ },
600
+ getLabelWidth(t, i) {
601
+ let s;
602
+ return h(t.labelWidth) ? h(i.labelWidth) ? s = this.parentOption.labelWidth : s = i.labelWidth : s = t.labelWidth, _(s, this.labelWidth);
603
+ },
604
+ //对部分表单字段进行校验的方法
605
+ validateField(t) {
606
+ return this.$refs.form.validateField(t);
607
+ },
608
+ validTip(t) {
609
+ return !t.tip || t.type === "upload";
610
+ },
611
+ getPropRef(t) {
612
+ return this.$refs[t][0];
613
+ },
614
+ handleChange(t, i) {
615
+ this.$nextTick(() => {
616
+ const s = i.cascader, r = s.join(",");
617
+ s.forEach((f) => {
618
+ const e = f, a = this.form[i.prop], o = this.findObject(t, e);
619
+ h(o) || (this.formList.includes(r) && s.forEach((l) => {
620
+ this.form[l] = "", this.$set(this.DIC, l, []);
621
+ }), !(h(s) || h(a) || h(o)) && H({
622
+ column: o,
623
+ value: a,
624
+ form: this.form
625
+ }).then((l) => {
626
+ this.formList.includes(r) || this.formList.push(r);
627
+ const d = l || [];
628
+ this.$set(this.DIC, e, d), !h(d) && !h(d) && !h(o.cascaderIndex) && h(this.form[e]) && (this.form[e] = d[o.cascaderIndex][(o.props || {}).value || V.value]);
629
+ }));
630
+ });
631
+ });
632
+ },
633
+ handlePrint() {
634
+ this.$Print(this.$el);
635
+ },
636
+ propChange(t, i) {
637
+ i.cascader && this.handleChange(t, i);
638
+ },
639
+ handleMock() {
640
+ this.isMock && (this.columnOption.forEach((t) => {
641
+ const i = K(t.column, this.DIC, this.form, this.isMock);
642
+ h(i) || Object.keys(i).forEach((s) => {
643
+ this.form[s] = i[s];
644
+ });
645
+ }), this.$nextTick(() => {
646
+ this.clearValidate(), this.$emit("mock-change", this.form);
647
+ }));
648
+ },
649
+ vaildDetail(t) {
650
+ let i;
651
+ if (this.detail)
652
+ return !1;
653
+ if (!h(t.detail))
654
+ i = "detail";
655
+ else if (this.isAdd)
656
+ i = "addDetail";
657
+ else if (this.isEdit)
658
+ i = "editDetail";
659
+ else if (this.isView)
660
+ return !1;
661
+ return i ? t[i] === !0 : !1;
662
+ },
663
+ // 验证表单是否禁止
664
+ vaildDisabled(t) {
665
+ let i;
666
+ if (this.disabled)
667
+ return !0;
668
+ if (!h(t.disabled))
669
+ i = "disabled";
670
+ else if (this.isAdd)
671
+ i = "addDisabled";
672
+ else if (this.isEdit)
673
+ i = "editDisabled";
674
+ else if (this.isView)
675
+ return !0;
676
+ return i ? t[i] === !0 : !1;
677
+ },
678
+ // 验证表单是否显隐
679
+ vaildDisplay(t) {
680
+ let i;
681
+ return h(t.display) ? this.isAdd ? i = "addDisplay" : this.isEdit ? i = "editDisplay" : this.isView && (i = "viewDisplay") : i = "display", i ? z(t[i], !0) : !0;
682
+ },
683
+ clearValidate(t) {
684
+ this.$refs.form.clearValidate(t);
685
+ },
686
+ validateCellForm() {
687
+ return new Promise((t) => {
688
+ this.$refs.form.validate((i, s) => {
689
+ t(s);
690
+ });
691
+ });
692
+ },
693
+ validate(t) {
694
+ this.$refs.form.validate((i, s) => {
695
+ let r = [], f = [], e = {};
696
+ this.dynamicOption.forEach((a) => {
697
+ let o = a.children.type === "form";
698
+ f.push(a.prop), o ? h(this.$refs[a.prop][0].$refs.temp.$refs.main) || this.$refs[a.prop][0].$refs.temp.$refs.main.forEach((l) => {
699
+ r.push(l.validateCellForm());
700
+ }) : r.push(this.$refs[a.prop][0].$refs.temp.$refs.main.validateCellForm());
701
+ }), Promise.all(r).then((a) => {
702
+ a.forEach((l, d) => {
703
+ h(l) || (e[f[d]] = l);
704
+ });
705
+ let o = Object.assign(e, s);
706
+ h(o) ? (this.show(), t(!0, this.hide)) : t(!1, this.hide, o);
707
+ });
708
+ });
709
+ },
710
+ resetForm(t = !0) {
711
+ if (t) {
712
+ let i = this.propOption.map((s) => s.prop);
713
+ this.form = M(this.form, i, (this.tableOption.filterParams || []).concat([this.rowKey]));
714
+ }
715
+ this.$nextTick(() => {
716
+ this.clearValidate(), this.$emit("reset-change");
717
+ });
718
+ },
719
+ resetFields() {
720
+ this.$refs.form.resetFields();
721
+ },
722
+ show() {
723
+ this.allDisabled = !0;
724
+ },
725
+ hide() {
726
+ this.allDisabled = !1;
727
+ },
728
+ submit() {
729
+ this.validate((t, i) => {
730
+ t ? this.$emit("submit", O(this.form, ["$"]), this.hide) : this.$emit("error", i);
731
+ });
732
+ }
733
+ }
734
+ }, S = {};
735
+ var Y = /* @__PURE__ */ q(
736
+ X,
737
+ J,
738
+ Q,
739
+ !1,
740
+ Z,
741
+ null,
742
+ null,
743
+ null
744
+ );
745
+ function Z(t) {
746
+ for (let i in S)
747
+ this[i] = S[i];
748
+ }
749
+ const lt = /* @__PURE__ */ function() {
750
+ return Y.exports;
751
+ }();
752
+ export {
753
+ lt as default
754
+ };