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