@web-utils/component 2.70.0 → 3.0.1

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