@es-plus/vue2 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/dist/components/es-crud-page/es-crud-page.vue.d.ts +107 -2
- package/dist/components/es-crud-page/es-crud-page.vue.d.ts.map +1 -1
- package/dist/components/es-dialog/component.vue.d.ts +361 -2
- package/dist/components/es-dialog/component.vue.d.ts.map +1 -1
- package/dist/components/es-dialog/render-jsx.vue.d.ts +91 -2
- package/dist/components/es-dialog/render-jsx.vue.d.ts.map +1 -1
- package/dist/components/es-form/es-form.vue.d.ts +299 -10
- package/dist/components/es-form/es-form.vue.d.ts.map +1 -1
- package/dist/components/es-table/column-item.vue.d.ts +35 -2
- package/dist/components/es-table/column-item.vue.d.ts.map +1 -1
- package/dist/components/es-table/component.vue.d.ts +507 -6
- package/dist/components/es-table/component.vue.d.ts.map +1 -1
- package/dist/components/es-table/table-btns.vue.d.ts +87 -2
- package/dist/components/es-table/table-btns.vue.d.ts.map +1 -1
- package/dist/composables/use-table-resize.d.ts.map +1 -1
- package/dist/es-plus-vue2.js +979 -935
- package/dist/es-plus-vue2.js.map +1 -1
- package/dist/es-plus-vue2.umd.cjs +1 -1
- package/dist/es-plus-vue2.umd.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/vue-compat.d.ts +60 -12
- package/dist/vue-compat.d.ts.map +1 -1
- package/package.json +82 -82
- package/CHANGELOG.md +0 -46
package/dist/es-plus-vue2.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { getNestedValue as G, setNestedValue as
|
|
2
|
-
import { configureEsPlus as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { getNestedValue as G, setNestedValue as K, resolveFormLayProps as Ae, getRowColsAlgorithm as Ct, configFormField as St, formatConfigOut as Bt, getEveryFormQueryField as kt, queryTableListMethod as xt, getGlobalConfig as me, getButtonPosition as nt, createSelectionState as Ft, restoreSelectionForPage as It, clearAllSelection as Rt, applySelectionChange as Ot, isObject as pe, findValueByKey as wt, configureEsPlus as Pt } from "@es-plus/core";
|
|
2
|
+
import { configureEsPlus as Mn } from "@es-plus/core";
|
|
3
|
+
import * as $t from "vue";
|
|
4
|
+
import ct from "vue";
|
|
5
|
+
import * as Ve from "@vue/composition-api";
|
|
6
|
+
import { MessageBox as ot } from "element-ui";
|
|
7
|
+
const Ht = ct.version || "", [Tt = "0", At = "0"] = Ht.split("."), Lt = Number(Tt), zt = Number(At), ut = Lt === 2 && zt >= 7, te = ut ? $t : Ve, z = te.ref, ze = te.reactive, S = te.computed, de = te.watch, Ue = te.onMounted, jt = te.onBeforeUnmount, Et = te.onUpdated, ie = te.defineComponent, ce = te.inject, dt = te.provide, Fe = te.nextTick, Ke = te.getCurrentInstance, ue = te.h;
|
|
8
|
+
var it;
|
|
9
|
+
const st = (it = Ve.default) != null ? it : Ve;
|
|
10
|
+
function Be(n) {
|
|
6
11
|
if (Array.isArray(n)) return n;
|
|
7
12
|
if (typeof n == "function") {
|
|
8
13
|
const e = n();
|
|
@@ -14,13 +19,13 @@ function Y(n) {
|
|
|
14
19
|
const e = { ...n.attrs || {} };
|
|
15
20
|
return typeof e.disabled == "function" && (e.disabled = e.disabled()), e;
|
|
16
21
|
}
|
|
17
|
-
function
|
|
22
|
+
function oe(n, e) {
|
|
18
23
|
const o = n.on || {}, t = {};
|
|
19
|
-
for (const [
|
|
20
|
-
typeof l == "function" && (t[
|
|
24
|
+
for (const [i, l] of Object.entries(o))
|
|
25
|
+
typeof l == "function" && (t[i] = l);
|
|
21
26
|
return typeof t.input != "function" && (t.input = e), t;
|
|
22
27
|
}
|
|
23
|
-
function
|
|
28
|
+
function Dt() {
|
|
24
29
|
return { formInputComponents: (e) => {
|
|
25
30
|
var k;
|
|
26
31
|
const o = /* @__PURE__ */ new Map([
|
|
@@ -29,11 +34,11 @@ function St() {
|
|
|
29
34
|
// ─────────────────────────────────────────────────────────────────
|
|
30
35
|
[
|
|
31
36
|
"Input",
|
|
32
|
-
(d, g, { row:
|
|
33
|
-
const f = Y(
|
|
37
|
+
(d, g, { row: a }) => {
|
|
38
|
+
const f = Y(a), p = G(g, a.prop), b = oe(a, (y) => K(g, a.prop, y));
|
|
34
39
|
return d("el-input", {
|
|
35
40
|
attrs: f,
|
|
36
|
-
props: { value: p, ...
|
|
41
|
+
props: { value: p, ...a.props },
|
|
37
42
|
on: b
|
|
38
43
|
});
|
|
39
44
|
}
|
|
@@ -43,11 +48,11 @@ function St() {
|
|
|
43
48
|
// ─────────────────────────────────────────────────────────────────
|
|
44
49
|
[
|
|
45
50
|
"InputNumber",
|
|
46
|
-
(d, g, { row:
|
|
47
|
-
const f = Y(
|
|
51
|
+
(d, g, { row: a }) => {
|
|
52
|
+
const f = Y(a), p = G(g, a.prop), b = oe(a, (y) => K(g, a.prop, y));
|
|
48
53
|
return d("el-input-number", {
|
|
49
54
|
attrs: f,
|
|
50
|
-
props: { value: p, ...
|
|
55
|
+
props: { value: p, ...a.props },
|
|
51
56
|
on: b
|
|
52
57
|
});
|
|
53
58
|
}
|
|
@@ -57,18 +62,18 @@ function St() {
|
|
|
57
62
|
// ─────────────────────────────────────────────────────────────────
|
|
58
63
|
[
|
|
59
64
|
"Select",
|
|
60
|
-
(d, g, { row:
|
|
61
|
-
const f = Y(
|
|
65
|
+
(d, g, { row: a }) => {
|
|
66
|
+
const f = Y(a), p = G(g, a.prop), b = Be(a.dataOptions), y = oe(a, (_) => K(g, a.prop, _));
|
|
62
67
|
return d(
|
|
63
68
|
"el-select",
|
|
64
69
|
{
|
|
65
70
|
attrs: f,
|
|
66
|
-
props: { value: p, ...
|
|
67
|
-
on:
|
|
71
|
+
props: { value: p, ...a.props },
|
|
72
|
+
on: y
|
|
68
73
|
},
|
|
69
74
|
b.map(
|
|
70
|
-
(_,
|
|
71
|
-
key:
|
|
75
|
+
(_, L) => d("el-option", {
|
|
76
|
+
key: L,
|
|
72
77
|
props: { value: _.value, label: _.label, disabled: _.disabled }
|
|
73
78
|
})
|
|
74
79
|
)
|
|
@@ -81,11 +86,11 @@ function St() {
|
|
|
81
86
|
// ─────────────────────────────────────────────────────────────────
|
|
82
87
|
[
|
|
83
88
|
"datePicker",
|
|
84
|
-
(d, g, { row:
|
|
85
|
-
const f = Y(
|
|
89
|
+
(d, g, { row: a }) => {
|
|
90
|
+
const f = Y(a), p = G(g, a.prop), b = oe(a, (y) => K(g, a.prop, y));
|
|
86
91
|
return d("el-date-picker", {
|
|
87
92
|
attrs: f,
|
|
88
|
-
props: { value: p, ...
|
|
93
|
+
props: { value: p, ...a.props },
|
|
89
94
|
on: b
|
|
90
95
|
});
|
|
91
96
|
}
|
|
@@ -95,11 +100,11 @@ function St() {
|
|
|
95
100
|
// ─────────────────────────────────────────────────────────────────
|
|
96
101
|
[
|
|
97
102
|
"timePicker",
|
|
98
|
-
(d, g, { row:
|
|
99
|
-
const f = Y(
|
|
103
|
+
(d, g, { row: a }) => {
|
|
104
|
+
const f = Y(a), p = G(g, a.prop), b = oe(a, (y) => K(g, a.prop, y));
|
|
100
105
|
return d("el-time-picker", {
|
|
101
106
|
attrs: f,
|
|
102
|
-
props: { value: p, ...
|
|
107
|
+
props: { value: p, ...a.props },
|
|
103
108
|
on: b
|
|
104
109
|
});
|
|
105
110
|
}
|
|
@@ -109,11 +114,11 @@ function St() {
|
|
|
109
114
|
// ─────────────────────────────────────────────────────────────────
|
|
110
115
|
[
|
|
111
116
|
"Slider",
|
|
112
|
-
(d, g, { row:
|
|
113
|
-
const f = Y(
|
|
117
|
+
(d, g, { row: a }) => {
|
|
118
|
+
const f = Y(a), p = G(g, a.prop), b = oe(a, (y) => K(g, a.prop, y));
|
|
114
119
|
return d("el-slider", {
|
|
115
120
|
attrs: f,
|
|
116
|
-
props: { value: p, ...
|
|
121
|
+
props: { value: p, ...a.props },
|
|
117
122
|
on: b
|
|
118
123
|
});
|
|
119
124
|
}
|
|
@@ -125,14 +130,14 @@ function St() {
|
|
|
125
130
|
// ─────────────────────────────────────────────────────────────────
|
|
126
131
|
[
|
|
127
132
|
"ColorPicker",
|
|
128
|
-
(d, g, { row:
|
|
129
|
-
const f = Y(
|
|
130
|
-
for (const [_,
|
|
131
|
-
typeof
|
|
132
|
-
return typeof
|
|
133
|
+
(d, g, { row: a }) => {
|
|
134
|
+
const f = Y(a), p = G(g, a.prop), b = a.on || {}, y = {};
|
|
135
|
+
for (const [_, L] of Object.entries(b))
|
|
136
|
+
typeof L == "function" && (y[_] = L);
|
|
137
|
+
return typeof y.change != "function" && (y.change = (_) => K(g, a.prop, _)), d("el-color-picker", {
|
|
133
138
|
attrs: f,
|
|
134
|
-
props: { value: p, ...
|
|
135
|
-
on:
|
|
139
|
+
props: { value: p, ...a.props },
|
|
140
|
+
on: y
|
|
136
141
|
});
|
|
137
142
|
}
|
|
138
143
|
],
|
|
@@ -142,16 +147,16 @@ function St() {
|
|
|
142
147
|
// ─────────────────────────────────────────────────────────────────
|
|
143
148
|
[
|
|
144
149
|
"Transfer",
|
|
145
|
-
(d, g, { row:
|
|
146
|
-
const f = Y(
|
|
150
|
+
(d, g, { row: a }) => {
|
|
151
|
+
const f = Y(a), p = G(g, a.prop), b = Be(a.dataOptions), y = oe(a, (_) => K(g, a.prop, _));
|
|
147
152
|
return d("el-transfer", {
|
|
148
153
|
attrs: f,
|
|
149
154
|
props: {
|
|
150
155
|
value: p,
|
|
151
156
|
data: b.map((_) => ({ key: _.value, label: _.label, disabled: _.disabled })),
|
|
152
|
-
...
|
|
157
|
+
...a.props
|
|
153
158
|
},
|
|
154
|
-
on:
|
|
159
|
+
on: y
|
|
155
160
|
});
|
|
156
161
|
}
|
|
157
162
|
],
|
|
@@ -160,8 +165,8 @@ function St() {
|
|
|
160
165
|
// ─────────────────────────────────────────────────────────────────
|
|
161
166
|
[
|
|
162
167
|
"Cascader",
|
|
163
|
-
(d, g, { row:
|
|
164
|
-
const f = Y(
|
|
168
|
+
(d, g, { row: a }) => {
|
|
169
|
+
const f = Y(a), p = G(g, a.prop), b = Be(a.dataOptions), y = oe(a, (_) => K(g, a.prop, _));
|
|
165
170
|
return d("el-cascader", {
|
|
166
171
|
// key 强制 dataOptions 变化时重渲染,Element UI 内部 cache 否则不刷新
|
|
167
172
|
key: JSON.stringify(b),
|
|
@@ -169,9 +174,9 @@ function St() {
|
|
|
169
174
|
props: {
|
|
170
175
|
value: p,
|
|
171
176
|
options: b,
|
|
172
|
-
...
|
|
177
|
+
...a.props
|
|
173
178
|
},
|
|
174
|
-
on:
|
|
179
|
+
on: y
|
|
175
180
|
});
|
|
176
181
|
}
|
|
177
182
|
],
|
|
@@ -180,20 +185,20 @@ function St() {
|
|
|
180
185
|
// ─────────────────────────────────────────────────────────────────
|
|
181
186
|
[
|
|
182
187
|
"Radio",
|
|
183
|
-
(d, g, { row:
|
|
184
|
-
const f = Y(
|
|
188
|
+
(d, g, { row: a }) => {
|
|
189
|
+
const f = Y(a), p = G(g, a.prop), b = Be(a.dataOptions), y = oe(a, (_) => K(g, a.prop, _));
|
|
185
190
|
return d(
|
|
186
191
|
"el-radio-group",
|
|
187
192
|
{
|
|
188
193
|
attrs: f,
|
|
189
|
-
props: { value: p, ...
|
|
190
|
-
on:
|
|
194
|
+
props: { value: p, ...a.props },
|
|
195
|
+
on: y
|
|
191
196
|
},
|
|
192
197
|
b.map(
|
|
193
|
-
(_,
|
|
198
|
+
(_, L) => d(
|
|
194
199
|
"el-radio",
|
|
195
200
|
{
|
|
196
|
-
key:
|
|
201
|
+
key: L,
|
|
197
202
|
// Element UI 中 el-radio 使用 :label 作为值
|
|
198
203
|
props: { label: _.value, disabled: _.disabled || f.disabled }
|
|
199
204
|
},
|
|
@@ -208,20 +213,20 @@ function St() {
|
|
|
208
213
|
// ─────────────────────────────────────────────────────────────────
|
|
209
214
|
[
|
|
210
215
|
"Checkbox",
|
|
211
|
-
(d, g, { row:
|
|
212
|
-
const f = Y(
|
|
216
|
+
(d, g, { row: a }) => {
|
|
217
|
+
const f = Y(a), p = G(g, a.prop), b = Be(a.dataOptions), y = oe(a, (_) => K(g, a.prop, _));
|
|
213
218
|
return d(
|
|
214
219
|
"el-checkbox-group",
|
|
215
220
|
{
|
|
216
221
|
attrs: f,
|
|
217
|
-
props: { value: p, ...
|
|
218
|
-
on:
|
|
222
|
+
props: { value: p, ...a.props },
|
|
223
|
+
on: y
|
|
219
224
|
},
|
|
220
225
|
b.map(
|
|
221
|
-
(_,
|
|
226
|
+
(_, L) => d(
|
|
222
227
|
"el-checkbox",
|
|
223
228
|
{
|
|
224
|
-
key:
|
|
229
|
+
key: L,
|
|
225
230
|
props: { label: _.value, disabled: _.disabled || f.disabled }
|
|
226
231
|
},
|
|
227
232
|
[_.label]
|
|
@@ -235,11 +240,11 @@ function St() {
|
|
|
235
240
|
// ─────────────────────────────────────────────────────────────────
|
|
236
241
|
[
|
|
237
242
|
"Switch",
|
|
238
|
-
(d, g, { row:
|
|
239
|
-
const f = Y(
|
|
243
|
+
(d, g, { row: a }) => {
|
|
244
|
+
const f = Y(a), p = G(g, a.prop), b = oe(a, (y) => K(g, a.prop, y));
|
|
240
245
|
return d("el-switch", {
|
|
241
246
|
attrs: f,
|
|
242
|
-
props: { value: p, ...
|
|
247
|
+
props: { value: p, ...a.props },
|
|
243
248
|
on: b
|
|
244
249
|
});
|
|
245
250
|
}
|
|
@@ -249,11 +254,11 @@ function St() {
|
|
|
249
254
|
// ─────────────────────────────────────────────────────────────────
|
|
250
255
|
[
|
|
251
256
|
"Rate",
|
|
252
|
-
(d, g, { row:
|
|
253
|
-
const f = Y(
|
|
257
|
+
(d, g, { row: a }) => {
|
|
258
|
+
const f = Y(a), p = G(g, a.prop), b = oe(a, (y) => K(g, a.prop, y));
|
|
254
259
|
return d("el-rate", {
|
|
255
260
|
attrs: f,
|
|
256
|
-
props: { value: p, ...
|
|
261
|
+
props: { value: p, ...a.props },
|
|
257
262
|
on: b
|
|
258
263
|
});
|
|
259
264
|
}
|
|
@@ -263,24 +268,24 @@ function St() {
|
|
|
263
268
|
// ─────────────────────────────────────────────────────────────────
|
|
264
269
|
[
|
|
265
270
|
"Upload",
|
|
266
|
-
(d, g, { row:
|
|
267
|
-
const f =
|
|
268
|
-
var
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
},
|
|
272
|
-
u.status = "fail", u.error =
|
|
273
|
-
},
|
|
274
|
-
const u =
|
|
271
|
+
(d, g, { row: a }) => {
|
|
272
|
+
const f = a.prop, p = Y(a), b = a.props || {}, y = a.on || {}, _ = G(g, f) || [], L = typeof a.httpRequest == "function", j = a.triggerRender, N = a.fileRender, M = j ? j(d) : d("el-button", { props: { size: "mini", type: "primary" } }, ["选择文件"]), V = (r, u, h) => {
|
|
273
|
+
var A, x;
|
|
274
|
+
const w = (r == null ? void 0 : r.link) || (r == null ? void 0 : r.url) || ((A = r == null ? void 0 : r.data) == null ? void 0 : A.link) || ((x = r == null ? void 0 : r.data) == null ? void 0 : x.url);
|
|
275
|
+
w && (u.url = w), u.status = "success", u.response = r, typeof y.success == "function" && y.success(r, u, h), K(g, f, [...h]);
|
|
276
|
+
}, W = (r, u, h) => {
|
|
277
|
+
u.status = "fail", u.error = r, typeof y.error == "function" && y.error(r, u, h), K(g, f, [...h]);
|
|
278
|
+
}, U = L ? (r) => {
|
|
279
|
+
const u = a.httpRequest;
|
|
275
280
|
u({
|
|
276
|
-
file:
|
|
277
|
-
filename:
|
|
278
|
-
onProgress:
|
|
279
|
-
}).then((
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
}).catch((
|
|
283
|
-
} : void 0,
|
|
281
|
+
file: r.file,
|
|
282
|
+
filename: r.file.name,
|
|
283
|
+
onProgress: r.onProgress
|
|
284
|
+
}).then((h) => {
|
|
285
|
+
const w = (h == null ? void 0 : h.data) || h;
|
|
286
|
+
r.onSuccess(w);
|
|
287
|
+
}).catch((h) => r.onError(h));
|
|
288
|
+
} : void 0, J = {
|
|
284
289
|
preview: "onPreview",
|
|
285
290
|
change: "onChange",
|
|
286
291
|
success: "onSuccess",
|
|
@@ -288,14 +293,14 @@ function St() {
|
|
|
288
293
|
progress: "onProgress",
|
|
289
294
|
remove: "onRemove",
|
|
290
295
|
exceed: "onExceed"
|
|
291
|
-
},
|
|
292
|
-
for (const [
|
|
293
|
-
if (typeof u != "function" ||
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
+
}, R = {};
|
|
297
|
+
for (const [r, u] of Object.entries(y)) {
|
|
298
|
+
if (typeof u != "function" || r === "success" || r === "error" || r === "remove") continue;
|
|
299
|
+
const h = J[r];
|
|
300
|
+
h && (R[h] = u);
|
|
296
301
|
}
|
|
297
|
-
return
|
|
298
|
-
typeof
|
|
302
|
+
return R.onSuccess = V, R.onError = W, R.onRemove = (r, u) => {
|
|
303
|
+
typeof y.remove == "function" && y.remove(r, u), K(g, f, [...u]);
|
|
299
304
|
}, d(
|
|
300
305
|
"el-upload",
|
|
301
306
|
{
|
|
@@ -308,87 +313,87 @@ function St() {
|
|
|
308
313
|
...b,
|
|
309
314
|
fileList: _,
|
|
310
315
|
// 自定义上传时禁用 auto-upload,由 httpRequest 接管
|
|
311
|
-
autoUpload:
|
|
312
|
-
httpRequest:
|
|
316
|
+
autoUpload: L ? !1 : b.autoUpload !== !1,
|
|
317
|
+
httpRequest: U,
|
|
313
318
|
// 把 row.on.* 转换为 onXxx prop(覆盖在 userProps 之上:
|
|
314
319
|
// 若用户已直接在 props 里给了 onPreview,这里仍以 row.on 为优先权来源)
|
|
315
|
-
...
|
|
320
|
+
...R
|
|
316
321
|
},
|
|
317
322
|
// Vue 2 的 scopedSlots 用于自定义文件项渲染
|
|
318
|
-
scopedSlots:
|
|
319
|
-
file: ({ file:
|
|
320
|
-
const u = _.filter((
|
|
321
|
-
|
|
323
|
+
scopedSlots: N ? {
|
|
324
|
+
file: ({ file: r }) => N(d, r, () => {
|
|
325
|
+
const u = _.filter((h) => h !== r);
|
|
326
|
+
K(g, f, u);
|
|
322
327
|
})
|
|
323
328
|
} : void 0
|
|
324
329
|
},
|
|
325
|
-
[
|
|
330
|
+
[M]
|
|
326
331
|
);
|
|
327
332
|
}
|
|
328
333
|
]
|
|
329
334
|
]), t = (k = e.formtype) != null ? k : "";
|
|
330
335
|
if (!t) return () => null;
|
|
331
|
-
const
|
|
332
|
-
if (
|
|
336
|
+
const i = o.get(t);
|
|
337
|
+
if (i) return i;
|
|
333
338
|
const l = t[0] ? t[0] === t[0].toLowerCase() ? t[0].toUpperCase() + t.slice(1) : t[0].toLowerCase() + t.slice(1) : t, c = o.get(l);
|
|
334
339
|
if (c) return c;
|
|
335
|
-
const
|
|
340
|
+
const B = t.toLowerCase();
|
|
336
341
|
for (const [d, g] of o)
|
|
337
|
-
if (d.toLowerCase() ===
|
|
342
|
+
if (d.toLowerCase() === B) return g;
|
|
338
343
|
return () => null;
|
|
339
344
|
} };
|
|
340
345
|
}
|
|
341
|
-
function
|
|
342
|
-
const e = z(!1), o =
|
|
343
|
-
var
|
|
344
|
-
const f =
|
|
346
|
+
function qt(n) {
|
|
347
|
+
const e = z(!1), o = S(() => {
|
|
348
|
+
var y;
|
|
349
|
+
const f = Ae(n.layoutFormProps);
|
|
345
350
|
if (!f || !Object.keys(f).length) return !1;
|
|
346
351
|
const p = f.isBtnHiden, b = f.isBtnHidden;
|
|
347
|
-
return !!((
|
|
348
|
-
}), t =
|
|
352
|
+
return !!((y = p != null ? p : b) != null && y);
|
|
353
|
+
}), t = S(() => {
|
|
349
354
|
var p;
|
|
350
355
|
return {
|
|
351
356
|
type: "flex",
|
|
352
357
|
gutter: 20,
|
|
353
358
|
...((p = n.layoutFormProps) == null ? void 0 : p.rowLayProps) || {}
|
|
354
359
|
};
|
|
355
|
-
}),
|
|
360
|
+
}), i = S(() => Ae(n.layoutFormProps)), l = S(() => {
|
|
356
361
|
var f;
|
|
357
362
|
return (f = n.layoutFormProps) == null ? void 0 : f.setOptions;
|
|
358
|
-
}), c =
|
|
359
|
-
() =>
|
|
360
|
-
),
|
|
361
|
-
var
|
|
362
|
-
const f =
|
|
363
|
+
}), c = S(
|
|
364
|
+
() => Ct(n.formItemList || [])
|
|
365
|
+
), B = () => {
|
|
366
|
+
var y;
|
|
367
|
+
const f = Ae(n.layoutFormProps);
|
|
363
368
|
if (!f || !Object.keys(f).length) return 0;
|
|
364
369
|
const p = f.minfoldRows, b = f.minFoldRows;
|
|
365
|
-
return Number((
|
|
366
|
-
}, k =
|
|
367
|
-
const f =
|
|
370
|
+
return Number((y = p != null ? p : b) != null ? y : 0) || 0;
|
|
371
|
+
}, k = S(() => {
|
|
372
|
+
const f = B();
|
|
368
373
|
return f > 0 && f < c.value.rowNum;
|
|
369
|
-
}), d =
|
|
370
|
-
var
|
|
371
|
-
const { rowNum: f, columnRow: p } = c.value, b = p[f - 1] || [],
|
|
372
|
-
(
|
|
373
|
-
var
|
|
374
|
-
return
|
|
374
|
+
}), d = S(() => {
|
|
375
|
+
var j;
|
|
376
|
+
const { rowNum: f, columnRow: p } = c.value, b = p[f - 1] || [], y = Number((j = Ae(n.layoutFormProps)) == null ? void 0 : j.btnColSpan) || 0, L = 24 - b.reduce(
|
|
377
|
+
(N, M) => {
|
|
378
|
+
var V;
|
|
379
|
+
return N + (((V = n.formItemList[M]) == null ? void 0 : V.span) || 24);
|
|
375
380
|
},
|
|
376
381
|
0
|
|
377
382
|
);
|
|
378
|
-
return !e.value &&
|
|
379
|
-
}), g =
|
|
380
|
-
var b,
|
|
381
|
-
const f =
|
|
383
|
+
return !e.value && y <= L ? L : 24;
|
|
384
|
+
}), g = S(() => {
|
|
385
|
+
var b, y;
|
|
386
|
+
const f = B(), { columnNodeIndex: p } = c.value;
|
|
382
387
|
if (e.value) {
|
|
383
|
-
const _ = (
|
|
384
|
-
return (n.formItemList || []).map((
|
|
385
|
-
...
|
|
386
|
-
isFold:
|
|
388
|
+
const _ = (y = (b = p[f - 1]) != null ? b : p[p.length - 1]) != null ? y : 9999;
|
|
389
|
+
return (n.formItemList || []).map((L, j) => ({
|
|
390
|
+
...L,
|
|
391
|
+
isFold: j > _
|
|
387
392
|
}));
|
|
388
393
|
}
|
|
389
394
|
return (n.formItemList || []).map((_) => ({ ..._, isFold: !1 }));
|
|
390
395
|
});
|
|
391
|
-
return
|
|
396
|
+
return de(
|
|
392
397
|
k,
|
|
393
398
|
(f) => {
|
|
394
399
|
e.value = f;
|
|
@@ -398,7 +403,7 @@ function Bt(n) {
|
|
|
398
403
|
folded: e,
|
|
399
404
|
isBtnHidden: o,
|
|
400
405
|
rowLayout: t,
|
|
401
|
-
formLayout:
|
|
406
|
+
formLayout: i,
|
|
402
407
|
getSetOptionsStatus: l,
|
|
403
408
|
getRowColsAlgorithm: c,
|
|
404
409
|
isFold: k,
|
|
@@ -409,15 +414,15 @@ function Bt(n) {
|
|
|
409
414
|
}
|
|
410
415
|
};
|
|
411
416
|
}
|
|
412
|
-
function
|
|
417
|
+
function Nt(n) {
|
|
413
418
|
return {
|
|
414
|
-
queryTableListMethod: (l, c = {}) =>
|
|
415
|
-
getEveryFormQueryField: (l, c) =>
|
|
416
|
-
formatConfigOut: (l, c,
|
|
417
|
-
configFormField: (l = {}, c) =>
|
|
419
|
+
queryTableListMethod: (l, c = {}) => xt(l, c, n),
|
|
420
|
+
getEveryFormQueryField: (l, c) => kt(l, n, c),
|
|
421
|
+
formatConfigOut: (l, c, B = {}, k) => Bt(l, c, B, k),
|
|
422
|
+
configFormField: (l = {}, c) => St(l, c)
|
|
418
423
|
};
|
|
419
424
|
}
|
|
420
|
-
const
|
|
425
|
+
const Mt = {
|
|
421
426
|
large: "medium",
|
|
422
427
|
default: "small",
|
|
423
428
|
small: "mini",
|
|
@@ -425,13 +430,13 @@ const kt = {
|
|
|
425
430
|
medium: "medium",
|
|
426
431
|
mini: "mini"
|
|
427
432
|
};
|
|
428
|
-
function
|
|
433
|
+
function je(n) {
|
|
429
434
|
if (n == null || n === "") return;
|
|
430
435
|
const e = String(n).trim();
|
|
431
436
|
if (e)
|
|
432
|
-
return
|
|
437
|
+
return Mt[e];
|
|
433
438
|
}
|
|
434
|
-
const
|
|
439
|
+
const Vt = ie({
|
|
435
440
|
name: "RenderDomForm",
|
|
436
441
|
functional: !0,
|
|
437
442
|
props: {
|
|
@@ -441,12 +446,12 @@ const xt = se({
|
|
|
441
446
|
model: { type: Object, default: () => ({}) }
|
|
442
447
|
},
|
|
443
448
|
render(n, e) {
|
|
444
|
-
const { row: o, index: t, model:
|
|
449
|
+
const { row: o, index: t, model: i, render: l } = e.props;
|
|
445
450
|
if (typeof l != "function") return null;
|
|
446
|
-
const
|
|
447
|
-
return typeof
|
|
451
|
+
const B = l(n, i || {}, { row: o || {}, index: t });
|
|
452
|
+
return typeof B == "string" ? n("span", B) : B;
|
|
448
453
|
}
|
|
449
|
-
}),
|
|
454
|
+
}), Ut = ie({
|
|
450
455
|
name: "RenderBtn",
|
|
451
456
|
functional: !0,
|
|
452
457
|
props: {
|
|
@@ -456,14 +461,14 @@ const xt = se({
|
|
|
456
461
|
render: { type: Function, default: void 0 }
|
|
457
462
|
},
|
|
458
463
|
render(n, e) {
|
|
459
|
-
const { formItemList: o, formModel: t, row:
|
|
464
|
+
const { formItemList: o, formModel: t, row: i, render: l } = e.props;
|
|
460
465
|
if (typeof l != "function") return null;
|
|
461
|
-
const c = l(
|
|
466
|
+
const c = l(i, t, o, n) || "";
|
|
462
467
|
return typeof c == "string" ? n("span", c) : c;
|
|
463
468
|
}
|
|
464
|
-
}),
|
|
469
|
+
}), Kt = ie({
|
|
465
470
|
name: "EsForm",
|
|
466
|
-
components: { RenderDomForm:
|
|
471
|
+
components: { RenderDomForm: Vt, RenderBtn: Ut },
|
|
467
472
|
props: {
|
|
468
473
|
/** 表单 model 数据 */
|
|
469
474
|
model: { type: Object, default: () => ({}) },
|
|
@@ -483,260 +488,263 @@ const xt = se({
|
|
|
483
488
|
fieldFieldOutput: { type: Function, default: void 0 }
|
|
484
489
|
},
|
|
485
490
|
setup(n, e) {
|
|
486
|
-
var
|
|
487
|
-
const o =
|
|
491
|
+
var Pe, $e, Ce, he, He;
|
|
492
|
+
const o = Ke(), t = () => {
|
|
488
493
|
const m = o == null ? void 0 : o.proxy;
|
|
489
494
|
return (m == null ? void 0 : m.$refs) || {};
|
|
490
|
-
},
|
|
491
|
-
var
|
|
492
|
-
const m = o == null ? void 0 : o.proxy, v = (
|
|
495
|
+
}, i = S(() => {
|
|
496
|
+
var T, H;
|
|
497
|
+
const m = o == null ? void 0 : o.proxy, v = (H = (T = m == null ? void 0 : m.$vnode) == null ? void 0 : T.data) == null ? void 0 : H.model;
|
|
493
498
|
return v && typeof v == "object" && typeof v.callback != "function" ? v : n.model;
|
|
494
|
-
}), l = (
|
|
499
|
+
}), l = ($e = (Pe = ce("$esPlusForm", null)) != null ? Pe : me().EsForm) != null ? $e : {}, c = (he = (Ce = ce("$EsPlus", null)) != null ? Ce : me()) != null ? he : {}, B = (m) => {
|
|
495
500
|
if (!m) return !0;
|
|
496
501
|
const v = c.permission;
|
|
497
502
|
return typeof v == "function" ? v(m) : !0;
|
|
498
|
-
}, k = (m) => m.labelKey && typeof c.t == "function" ? c.t(m.labelKey) : m.label, d =
|
|
503
|
+
}, k = (m) => m.labelKey && typeof c.t == "function" ? c.t(m.labelKey) : m.label, d = ce("getTableInstantce", null), g = S(() => {
|
|
499
504
|
if (d)
|
|
500
505
|
return typeof d == "function" ? d() : d;
|
|
501
506
|
const m = o == null ? void 0 : o.proxy, v = m == null ? void 0 : m.getTableInstantce;
|
|
502
507
|
return typeof v == "function" ? v() : v;
|
|
503
|
-
}),
|
|
508
|
+
}), a = S(() => {
|
|
504
509
|
const m = g.value;
|
|
505
510
|
return !!(m && Object.keys(m).length);
|
|
506
511
|
}), f = (m) => m ? m.startsWith("el-icon-") ? m : `el-icon-${m.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase()}` : void 0, p = (m) => {
|
|
507
|
-
const { icon: v,
|
|
508
|
-
if (
|
|
509
|
-
const
|
|
510
|
-
|
|
512
|
+
const { icon: v, ...T } = m;
|
|
513
|
+
if (T.size !== void 0) {
|
|
514
|
+
const H = je(T.size);
|
|
515
|
+
H !== void 0 && (T.size = H);
|
|
511
516
|
} else
|
|
512
|
-
|
|
513
|
-
return
|
|
517
|
+
T.size = "mini";
|
|
518
|
+
return T;
|
|
514
519
|
}, b = (m) => {
|
|
515
520
|
const v = m.disabled;
|
|
516
521
|
return typeof v == "function" ? !!v() : !!v;
|
|
517
|
-
},
|
|
522
|
+
}, y = z({}), _ = z(n.formItemList || []), { formInputComponents: L } = Dt(), j = (l == null ? void 0 : l.$httpRequest) || void 0, N = n.fieldFieldOutput || (l == null ? void 0 : l.fieldFieldOutput), { getEveryFormQueryField: M } = Nt(j), V = z(
|
|
523
|
+
((He = n.layoutFormProps) == null ? void 0 : He.fromLayProps) || {}
|
|
524
|
+
), W = S(() => {
|
|
518
525
|
const v = {
|
|
519
526
|
size: "mini",
|
|
520
|
-
...
|
|
521
|
-
model:
|
|
527
|
+
...V.value || {},
|
|
528
|
+
model: i.value,
|
|
522
529
|
rules: n.rules,
|
|
523
530
|
validateOnRuleChange: !1
|
|
524
|
-
},
|
|
525
|
-
return
|
|
526
|
-
}),
|
|
527
|
-
|
|
531
|
+
}, T = je(v.size);
|
|
532
|
+
return T !== void 0 && (v.size = T), (v.labelWidth === void 0 || v.labelWidth === "" || v.labelWidth === null) && (v.labelWidth = "auto"), v;
|
|
533
|
+
}), U = z(/* @__PURE__ */ new Set());
|
|
534
|
+
de(
|
|
528
535
|
() => n.formItemList,
|
|
529
536
|
async (m) => {
|
|
530
|
-
const v = Array.isArray(m) ? m : [],
|
|
531
|
-
(F) => F && F.isInitRun !== !1 && !
|
|
537
|
+
const v = Array.isArray(m) ? m : [], T = v.filter(
|
|
538
|
+
(F) => F && F.isInitRun !== !1 && !U.value.has(F.prop)
|
|
532
539
|
);
|
|
533
|
-
if (
|
|
540
|
+
if (!T.length) {
|
|
534
541
|
_.value = v.map((F) => {
|
|
535
|
-
var
|
|
542
|
+
var D;
|
|
536
543
|
if (!F) return null;
|
|
537
|
-
const
|
|
538
|
-
return (
|
|
544
|
+
const $ = _.value.find((X) => X && X.prop === F.prop);
|
|
545
|
+
return (D = $ == null ? void 0 : $.dataOptions) != null && D.length ? { ...F, dataOptions: $.dataOptions } : F;
|
|
539
546
|
}).filter((F) => !!F);
|
|
540
547
|
return;
|
|
541
548
|
}
|
|
542
|
-
const
|
|
543
|
-
|
|
549
|
+
const H = await M(T, N);
|
|
550
|
+
T.forEach((F) => U.value.add(F.prop)), _.value = v.map((F) => {
|
|
544
551
|
var X;
|
|
545
552
|
if (!F) return null;
|
|
546
|
-
const
|
|
547
|
-
return
|
|
553
|
+
const $ = H.find((ee) => ee && ee.prop === F.prop), D = _.value.find((ee) => ee && ee.prop === F.prop);
|
|
554
|
+
return $ ? {
|
|
548
555
|
...F,
|
|
549
|
-
dataOptions:
|
|
550
|
-
} : (X =
|
|
556
|
+
dataOptions: $.listData
|
|
557
|
+
} : (X = D == null ? void 0 : D.dataOptions) != null && X.length ? { ...F, dataOptions: D.dataOptions } : F;
|
|
551
558
|
}).filter((F) => !!F);
|
|
552
559
|
},
|
|
553
560
|
{ immediate: !0, deep: !0 }
|
|
554
561
|
);
|
|
555
|
-
const
|
|
556
|
-
const v = (_.value || []).map((
|
|
557
|
-
if (
|
|
558
|
-
const
|
|
559
|
-
return ee ? !ee(
|
|
560
|
-
}),
|
|
562
|
+
const J = S(() => {
|
|
563
|
+
const v = (_.value || []).map(($) => $ ? { ...$, dataOptions: $.dataOptions || [] } : null).filter(($) => {
|
|
564
|
+
if (!$) return !1;
|
|
565
|
+
const D = $.isHiden, X = $.isHidden, ee = typeof D == "function" ? D : typeof X == "function" ? X : null;
|
|
566
|
+
return ee ? !ee(i.value, $, W.value) : !0;
|
|
567
|
+
}), H = v.filter(($) => !$.span).length;
|
|
561
568
|
let F = 6;
|
|
562
|
-
if (
|
|
563
|
-
const
|
|
564
|
-
|
|
569
|
+
if (H > 0) {
|
|
570
|
+
const $ = v.reduce((X, ee) => X + (ee.span || 0), 0), D = 24 - ($ % 24 || ($ ? 24 : 0));
|
|
571
|
+
$ === 0 ? H === 1 ? F = 24 : H === 2 ? F = 12 : H === 3 ? F = 8 : F = 6 : (F = D >= H ? Math.floor(D / H) : 6, F > 12 && (F = 12), F < 4 && (F = 6));
|
|
565
572
|
}
|
|
566
|
-
return v.map((
|
|
567
|
-
}),
|
|
573
|
+
return v.map(($) => ({ ...$, span: $.span || F }));
|
|
574
|
+
}), R = qt({
|
|
568
575
|
layoutFormProps: n.layoutFormProps,
|
|
569
576
|
get formItemList() {
|
|
570
|
-
return
|
|
577
|
+
return J.value;
|
|
571
578
|
}
|
|
572
579
|
}), {
|
|
573
|
-
folded:
|
|
580
|
+
folded: r,
|
|
574
581
|
isBtnHidden: u,
|
|
575
|
-
rowLayout:
|
|
576
|
-
formLayout:
|
|
577
|
-
getRowColsAlgorithm:
|
|
582
|
+
rowLayout: h,
|
|
583
|
+
formLayout: w,
|
|
584
|
+
getRowColsAlgorithm: A,
|
|
578
585
|
isFold: x,
|
|
579
|
-
getBtnColSpan:
|
|
580
|
-
formItem:
|
|
581
|
-
changeFolded:
|
|
582
|
-
} =
|
|
583
|
-
|
|
584
|
-
|
|
586
|
+
getBtnColSpan: E,
|
|
587
|
+
formItem: Q,
|
|
588
|
+
changeFolded: q
|
|
589
|
+
} = R;
|
|
590
|
+
de(
|
|
591
|
+
w,
|
|
585
592
|
(m) => {
|
|
586
|
-
|
|
593
|
+
V.value = m;
|
|
587
594
|
},
|
|
588
595
|
{ immediate: !0 }
|
|
589
596
|
);
|
|
590
|
-
const
|
|
597
|
+
const se = S(() => ({
|
|
591
598
|
colRightBtn: n.configBtn.filter((m) => m.direction === "right" || !m.direction),
|
|
592
599
|
colLeftBtn: n.configBtn.filter((m) => m.direction === "left")
|
|
593
|
-
})),
|
|
594
|
-
var
|
|
595
|
-
const v = t().formRef,
|
|
596
|
-
(F = m.click) == null || F.call(m,
|
|
597
|
-
},
|
|
598
|
-
var F,
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
},
|
|
602
|
-
var
|
|
600
|
+
})), re = S(() => typeof n.renderBtn == "function"), ne = (m) => {
|
|
601
|
+
var H, F;
|
|
602
|
+
const v = t().formRef, T = (H = g.value) == null ? void 0 : H.httpRequestInstance;
|
|
603
|
+
(F = m.click) == null || F.call(m, i.value, v, T);
|
|
604
|
+
}, _e = (m, v, T) => {
|
|
605
|
+
var F, $, D;
|
|
606
|
+
const H = g.value;
|
|
607
|
+
T === "query" ? a.value && ((F = H == null ? void 0 : H.httpRequestInstance) == null || F.call(H, m)) : T === "rest" && v && (a.value && (($ = H == null ? void 0 : H.httpRequestInstance) == null || $.call(H, m)), (D = v.resetFields) == null || D.call(v));
|
|
608
|
+
}, De = (m) => {
|
|
609
|
+
var T, H, F;
|
|
603
610
|
const v = t().formRef;
|
|
604
611
|
if (m.triggerEvent && ["query", "rest"].includes(m.key || ""))
|
|
605
|
-
|
|
612
|
+
_e(i.value, v, m.key);
|
|
606
613
|
else {
|
|
607
|
-
m.key === "rest" && v && ((
|
|
608
|
-
const
|
|
609
|
-
(F = m.click) == null || F.call(m,
|
|
614
|
+
m.key === "rest" && v && ((T = v.resetFields) == null || T.call(v));
|
|
615
|
+
const $ = (H = g.value) == null ? void 0 : H.httpRequestInstance;
|
|
616
|
+
(F = m.click) == null || F.call(m, i.value, v, $);
|
|
610
617
|
}
|
|
611
|
-
},
|
|
612
|
-
if (
|
|
613
|
-
const { style: v,
|
|
614
|
-
return { style: { marginBottom: "10px", ...v || {} },
|
|
618
|
+
}, qe = (m) => {
|
|
619
|
+
if (a.value) {
|
|
620
|
+
const { style: v, ...T } = m;
|
|
621
|
+
return { style: { marginBottom: "10px", ...v || {} }, ...T };
|
|
615
622
|
}
|
|
616
623
|
return m;
|
|
617
|
-
},
|
|
618
|
-
const m =
|
|
624
|
+
}, fe = () => t().formRef, Ie = () => {
|
|
625
|
+
const m = fe();
|
|
619
626
|
return m ? new Promise((v) => {
|
|
620
627
|
try {
|
|
621
|
-
const
|
|
622
|
-
v(!!
|
|
628
|
+
const T = m.validate((H) => {
|
|
629
|
+
v(!!H);
|
|
623
630
|
});
|
|
624
|
-
|
|
625
|
-
} catch (
|
|
631
|
+
T && typeof T.then == "function" && T.then(v).catch(() => v(!1));
|
|
632
|
+
} catch (T) {
|
|
626
633
|
v(!1);
|
|
627
634
|
}
|
|
628
635
|
}) : Promise.resolve(!1);
|
|
629
|
-
},
|
|
636
|
+
}, Re = () => {
|
|
630
637
|
var m;
|
|
631
|
-
return (m =
|
|
632
|
-
},
|
|
638
|
+
return (m = fe()) == null ? void 0 : m.resetFields();
|
|
639
|
+
}, Oe = (m) => {
|
|
633
640
|
var v;
|
|
634
|
-
return (v =
|
|
635
|
-
},
|
|
641
|
+
return (v = fe()) == null ? void 0 : v.clearValidate(m);
|
|
642
|
+
}, we = (m) => {
|
|
636
643
|
var v;
|
|
637
|
-
return (v =
|
|
638
|
-
},
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
641
|
-
(await
|
|
644
|
+
return (v = fe()) == null ? void 0 : v.validateField(m);
|
|
645
|
+
}, ye = async (m) => {
|
|
646
|
+
const T = J.value.filter((F) => F && m.includes(F.prop));
|
|
647
|
+
if (!T.length) return;
|
|
648
|
+
(await M(T, N)).forEach((F) => {
|
|
642
649
|
if (!F) return;
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
..._.value[
|
|
650
|
+
const $ = _.value.findIndex((D) => D && D.prop === F.prop);
|
|
651
|
+
$ !== -1 && (_.value[$] = {
|
|
652
|
+
..._.value[$],
|
|
646
653
|
dataOptions: F.listData
|
|
647
654
|
});
|
|
648
655
|
});
|
|
649
656
|
};
|
|
650
657
|
return Fe(() => {
|
|
651
|
-
|
|
658
|
+
y.value = t().formRef;
|
|
652
659
|
const m = o == null ? void 0 : o.proxy, v = m == null ? void 0 : m.bodyFormInstance;
|
|
653
|
-
v == null || v(
|
|
660
|
+
v == null || v(y.value);
|
|
654
661
|
}), typeof e.expose == "function" && e.expose({
|
|
655
|
-
formItmeRequestInstance:
|
|
656
|
-
getFormRef:
|
|
657
|
-
validate:
|
|
658
|
-
resetFields:
|
|
659
|
-
clearValidate:
|
|
660
|
-
validateField:
|
|
662
|
+
formItmeRequestInstance: ye,
|
|
663
|
+
getFormRef: fe,
|
|
664
|
+
validate: Ie,
|
|
665
|
+
resetFields: Re,
|
|
666
|
+
clearValidate: Oe,
|
|
667
|
+
validateField: we
|
|
661
668
|
}), {
|
|
662
669
|
// 模板使用
|
|
663
|
-
formProps:
|
|
664
|
-
rowLayout:
|
|
665
|
-
formItem:
|
|
670
|
+
formProps: W,
|
|
671
|
+
rowLayout: h,
|
|
672
|
+
formItem: Q,
|
|
666
673
|
isBtnHidden: u,
|
|
667
674
|
isFold: x,
|
|
668
|
-
folded:
|
|
669
|
-
getBtnColSpan:
|
|
670
|
-
isRenderBtn:
|
|
671
|
-
colRightLeftList:
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
675
|
+
folded: r,
|
|
676
|
+
getBtnColSpan: E,
|
|
677
|
+
isRenderBtn: re,
|
|
678
|
+
colRightLeftList: se,
|
|
679
|
+
formInputComponents: L,
|
|
680
|
+
formInstance: y,
|
|
681
|
+
// 注意:不要在 setup return 中暴露与 props 同名的 key(configBtn / model /
|
|
682
|
+
// btnColSpanRow / renderBtn)——Vue 2 已自动把 props 挂到 vm 实例,
|
|
683
|
+
// 重复暴露会在 @vue/composition-api 下触发 "already declared as a prop" 警告。
|
|
684
|
+
// 模板中的 :model 引用 resolvedModel(用于解析 v-model 兼容),其它 props 直接使用名称。
|
|
685
|
+
resolvedModel: i,
|
|
686
|
+
getRowColsAlgorithm: A,
|
|
687
|
+
changeFolded: q,
|
|
680
688
|
// 方法
|
|
681
|
-
checkPermission:
|
|
689
|
+
checkPermission: B,
|
|
682
690
|
translateLabel: k,
|
|
683
691
|
getCompIcon: f,
|
|
684
692
|
filterOptions: p,
|
|
685
693
|
resolveDisabled: b,
|
|
686
|
-
handleBtnClick:
|
|
687
|
-
clickBtn:
|
|
688
|
-
initFormItemOptions:
|
|
694
|
+
handleBtnClick: ne,
|
|
695
|
+
clickBtn: De,
|
|
696
|
+
initFormItemOptions: qe,
|
|
689
697
|
noop: () => {
|
|
690
698
|
},
|
|
691
699
|
// expose 公开方法(供 $refs.<esForm>.validate() 直接调用,不经过 ctx.expose)
|
|
692
|
-
formItmeRequestInstance:
|
|
693
|
-
getFormRef:
|
|
694
|
-
validate:
|
|
695
|
-
resetFields:
|
|
696
|
-
clearValidate:
|
|
697
|
-
validateField:
|
|
700
|
+
formItmeRequestInstance: ye,
|
|
701
|
+
getFormRef: fe,
|
|
702
|
+
validate: Ie,
|
|
703
|
+
resetFields: Re,
|
|
704
|
+
clearValidate: Oe,
|
|
705
|
+
validateField: we
|
|
698
706
|
};
|
|
699
707
|
}
|
|
700
708
|
});
|
|
701
|
-
function
|
|
709
|
+
function ge(n, e, o, t, i, l, c, B) {
|
|
702
710
|
var k = typeof n == "function" ? n.options : n;
|
|
703
711
|
return e && (k.render = e, k.staticRenderFns = o, k._compiled = !0), l && (k._scopeId = "data-v-" + l), {
|
|
704
712
|
exports: n,
|
|
705
713
|
options: k
|
|
706
714
|
};
|
|
707
715
|
}
|
|
708
|
-
var
|
|
716
|
+
var Wt = function() {
|
|
709
717
|
var e = this, o = e._self._c;
|
|
710
|
-
return e._self._setupProxy, o("el-form", e._b({ ref: "formRef", staticClass: "es-form" }, "el-form", e.formProps, !1), [o("div", { staticClass: "flex-center" }, [o("el-row", e._b({}, "el-row", e.rowLayout, !1), [e._l(e.formItem, function(t,
|
|
711
|
-
return [o("el-col", { directives: [{ name: "show", rawName: "v-show", value: !t.isFold, expression: "!item.isFold" }], key: t.prop ||
|
|
718
|
+
return e._self._setupProxy, o("el-form", e._b({ ref: "formRef", staticClass: "es-form" }, "el-form", e.formProps, !1), [o("div", { staticClass: "flex-center" }, [o("el-row", e._b({}, "el-row", e.rowLayout, !1), [e._l(e.formItem, function(t, i) {
|
|
719
|
+
return [o("el-col", { directives: [{ name: "show", rawName: "v-show", value: !t.isFold, expression: "!item.isFold" }], key: t.prop || i, attrs: { span: t.span } }, [o("el-form-item", e._b({ attrs: { label: e.translateLabel(t), prop: t.prop }, nativeOn: { click: function(l) {
|
|
712
720
|
return l.stopPropagation(), e.noop.apply(null, arguments);
|
|
713
|
-
} } }, "el-form-item", e.initFormItemOptions(t.formItemOptions || {}), !1), [t.formtype ? [o("render-dom-form", { attrs: { row: t, render: e.formInputComponents(t), index:
|
|
714
|
-
}), e.isBtnHidden ? e._e() : [e.isRenderBtn ? o("render-btn", { attrs: { row: { isFold: e.isFold, folded: e.folded, getBtnColSpan: e.getBtnColSpan, getRowColsAlgorithm: e.getRowColsAlgorithm, changeFolded: e.changeFolded, refsForm: e.formInstance }, "form-model": e.
|
|
715
|
-
return [e.checkPermission(t.permissionValue) ? o("el-button", e._b({ key: t.key ||
|
|
721
|
+
} } }, "el-form-item", e.initFormItemOptions(t.formItemOptions || {}), !1), [t.formtype ? [o("render-dom-form", { attrs: { row: t, render: e.formInputComponents(t), index: i, model: e.resolvedModel } })] : t.render ? [o("render-dom-form", { attrs: { row: t, render: t.render, index: i, model: e.resolvedModel } })] : e._e()], 2)], 1)];
|
|
722
|
+
}), e.isBtnHidden ? e._e() : [e.isRenderBtn ? o("render-btn", { attrs: { row: { isFold: e.isFold, folded: e.folded, getBtnColSpan: e.getBtnColSpan, getRowColsAlgorithm: e.getRowColsAlgorithm, changeFolded: e.changeFolded, refsForm: e.formInstance }, "form-model": e.resolvedModel, "form-item-list": e.formItem, render: e.renderBtn } }) : o("el-col", { attrs: { span: e.btnColSpanRow ? 24 : e.getBtnColSpan } }, [e.btnColSpanRow && e.configBtn.length ? o("div", { staticClass: "buttonOperate leftRightBtn" }, [o("div", { staticClass: "btn-left" }, [o("el-form-item", { staticClass: "btn-formItem", attrs: { "label-width": "0px" } }, [e._l(e.colRightLeftList.colLeftBtn, function(t, i) {
|
|
723
|
+
return [e.checkPermission(t.permissionValue) ? o("el-button", e._b({ key: t.key || i, attrs: { icon: e.getCompIcon(t.icon), disabled: e.resolveDisabled(t) }, on: { click: function(l) {
|
|
716
724
|
return e.handleBtnClick(t);
|
|
717
725
|
} } }, "el-button", e.filterOptions(t), !1), [e._v(" " + e._s(t.name) + " ")]) : e._e()];
|
|
718
|
-
})], 2)], 1), o("div", { staticClass: "btn-right" }, [o("el-form-item", { staticClass: "btn-formItem", attrs: { "label-width": "0px" } }, [e._l(e.colRightLeftList.colRightBtn, function(t,
|
|
719
|
-
return [e.checkPermission(t.permissionValue) ? o("el-button", e._b({ key: t.key ||
|
|
726
|
+
})], 2)], 1), o("div", { staticClass: "btn-right" }, [o("el-form-item", { staticClass: "btn-formItem", attrs: { "label-width": "0px" } }, [e._l(e.colRightLeftList.colRightBtn, function(t, i) {
|
|
727
|
+
return [e.checkPermission(t.permissionValue) ? o("el-button", e._b({ key: t.key || i, attrs: { icon: e.getCompIcon(t.icon), disabled: e.resolveDisabled(t) }, on: { click: function(l) {
|
|
720
728
|
return e.clickBtn(t);
|
|
721
729
|
} } }, "el-button", e.filterOptions(t), !1), [e._v(" " + e._s(t.name) + " ")]) : e._e()];
|
|
722
|
-
}), e.isFold ? o("el-button", { staticStyle: { "padding-left": "0", border: "none" }, attrs: { type: "text", icon: e.folded ? "el-icon-arrow-down" : "el-icon-arrow-up" }, on: { click: e.changeFolded } }, [e._v(" " + e._s(e.folded ? "展开" : "收起") + " ")]) : e._e()], 2)], 1)]) : e._e(), !e.btnColSpanRow && e.configBtn.length ? o("el-form-item", { staticClass: "btn-formItem", class: { formItemCols: e.btnColSpanRow ? !0 : e.getBtnColSpan === 24 }, attrs: { label: " ", "label-width": e.formProps.labelBtnWidth ? e.formProps.labelBtnWidth : e.formProps.labelWidth } }, [o("div", { staticClass: "buttonOperate", style: { "text-align": e.getBtnColSpan === 24 ? "right" : "left" } }, [e._l(e.configBtn, function(t,
|
|
723
|
-
return [e.checkPermission(t.permissionValue) ? o("el-button", e._b({ key: t.key ||
|
|
730
|
+
}), e.isFold ? o("el-button", { staticStyle: { "padding-left": "0", border: "none" }, attrs: { type: "text", icon: e.folded ? "el-icon-arrow-down" : "el-icon-arrow-up" }, on: { click: e.changeFolded } }, [e._v(" " + e._s(e.folded ? "展开" : "收起") + " ")]) : e._e()], 2)], 1)]) : e._e(), !e.btnColSpanRow && e.configBtn.length ? o("el-form-item", { staticClass: "btn-formItem", class: { formItemCols: e.btnColSpanRow ? !0 : e.getBtnColSpan === 24 }, attrs: { label: " ", "label-width": e.formProps.labelBtnWidth ? e.formProps.labelBtnWidth : e.formProps.labelWidth } }, [o("div", { staticClass: "buttonOperate", style: { "text-align": e.getBtnColSpan === 24 ? "right" : "left" } }, [e._l(e.configBtn, function(t, i) {
|
|
731
|
+
return [e.checkPermission(t.permissionValue) ? o("el-button", e._b({ key: t.key || i, attrs: { icon: e.getCompIcon(t.icon), disabled: e.resolveDisabled(t) }, on: { click: function(l) {
|
|
724
732
|
return e.handleBtnClick(t);
|
|
725
733
|
} } }, "el-button", e.filterOptions(t), !1), [e._v(" " + e._s(t.name) + " ")]) : e._e()];
|
|
726
734
|
}), e.isFold ? o("el-button", { staticStyle: { "padding-left": "0", border: "none" }, attrs: { type: "text", icon: e.folded ? "el-icon-arrow-down" : "el-icon-arrow-up" }, on: { click: e.changeFolded } }, [e._v(" " + e._s(e.folded ? "展开" : "收起") + " ")]) : e._e()], 2)]) : e._e()], 1)]], 2)], 1)]);
|
|
727
|
-
},
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
735
|
+
}, Qt = [], Jt = /* @__PURE__ */ ge(
|
|
736
|
+
Kt,
|
|
737
|
+
Wt,
|
|
738
|
+
Qt,
|
|
731
739
|
!1,
|
|
732
740
|
null,
|
|
733
|
-
"
|
|
741
|
+
"4a462026"
|
|
734
742
|
);
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
n.component(
|
|
743
|
+
const be = Jt.exports;
|
|
744
|
+
be.install = function(n) {
|
|
745
|
+
n.component(be.name || "EsForm", be);
|
|
738
746
|
};
|
|
739
|
-
const
|
|
747
|
+
const Zt = ie({
|
|
740
748
|
name: "RenderDomTb",
|
|
741
749
|
props: {
|
|
742
750
|
row: { type: Object, default: () => ({}) },
|
|
@@ -746,20 +754,20 @@ const Ht = se({
|
|
|
746
754
|
},
|
|
747
755
|
setup(n) {
|
|
748
756
|
return () => {
|
|
749
|
-
const { row: e, index: o, dataKey: t, render:
|
|
750
|
-
if (!e) return
|
|
757
|
+
const { row: e, index: o, dataKey: t, render: i } = n;
|
|
758
|
+
if (!e) return ue("span", "-");
|
|
751
759
|
const l = t ? e[t] : null;
|
|
752
760
|
try {
|
|
753
|
-
const c =
|
|
754
|
-
return typeof c == "string" ?
|
|
761
|
+
const c = i(ue, { value: l, row: e, index: o });
|
|
762
|
+
return typeof c == "string" ? ue("span", c) : c;
|
|
755
763
|
} catch (c) {
|
|
756
|
-
return
|
|
764
|
+
return ue("span", "-");
|
|
757
765
|
}
|
|
758
766
|
};
|
|
759
767
|
}
|
|
760
|
-
}),
|
|
768
|
+
}), Gt = (n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase(), Yt = ie({
|
|
761
769
|
name: "EsTableColumnItem",
|
|
762
|
-
components: { RenderDomTb:
|
|
770
|
+
components: { RenderDomTb: Zt },
|
|
763
771
|
props: {
|
|
764
772
|
cols: {
|
|
765
773
|
type: Object,
|
|
@@ -768,46 +776,46 @@ const Ht = se({
|
|
|
768
776
|
},
|
|
769
777
|
setup() {
|
|
770
778
|
var o, t;
|
|
771
|
-
const n = (t = (o =
|
|
779
|
+
const n = (t = (o = ce("$EsPlus", null)) != null ? o : me()) != null ? t : {};
|
|
772
780
|
return {
|
|
773
|
-
columnBindAttr: (
|
|
781
|
+
columnBindAttr: (i) => {
|
|
774
782
|
const l = {};
|
|
775
|
-
for (const c in
|
|
783
|
+
for (const c in i)
|
|
776
784
|
if (!(c === "groups" || c === "scopedSlots" || c === "render"))
|
|
777
785
|
if (c.includes("-")) {
|
|
778
|
-
const
|
|
779
|
-
let k =
|
|
780
|
-
for (let d = 1; d <
|
|
781
|
-
k +=
|
|
782
|
-
l[k] =
|
|
783
|
-
} else c === "key" ? (l.prop =
|
|
786
|
+
const B = c.split("-");
|
|
787
|
+
let k = B[0];
|
|
788
|
+
for (let d = 1; d < B.length; d++)
|
|
789
|
+
k += Gt(B[d]);
|
|
790
|
+
l[k] = i[c];
|
|
791
|
+
} else c === "key" ? (l.prop = i[c], l[c] = i[c]) : c === "label" && i.labelKey && typeof n.t == "function" ? l.label = n.t(i.labelKey) : l[c] = i[c];
|
|
784
792
|
return l.align || (l.align = "center"), l;
|
|
785
793
|
}
|
|
786
794
|
};
|
|
787
795
|
}
|
|
788
796
|
});
|
|
789
|
-
var
|
|
797
|
+
var Xt = function() {
|
|
790
798
|
var e = this, o = e._self._c;
|
|
791
|
-
return e._self._setupProxy, e.cols.groups && Array.isArray(e.cols.groups) ? o("el-table-column", e._b({}, "el-table-column", e.columnBindAttr(e.cols), !1), e._l(e.cols.groups, function(t,
|
|
792
|
-
return o("el-table-column", e._b({ key: t.prop || t.key ||
|
|
799
|
+
return e._self._setupProxy, e.cols.groups && Array.isArray(e.cols.groups) ? o("el-table-column", e._b({}, "el-table-column", e.columnBindAttr(e.cols), !1), e._l(e.cols.groups, function(t, i) {
|
|
800
|
+
return o("el-table-column", e._b({ key: t.prop || t.key || i, scopedSlots: e._u([t.render && typeof t.render == "function" ? { key: "default", fn: function(l) {
|
|
793
801
|
return [l && l.row ? o("render-dom-tb", { attrs: { row: l.row, index: l.$index, "data-key": t.key, render: t.render } }) : o("span", [e._v("-")])];
|
|
794
802
|
} } : t.scopedSlots && t.scopedSlots.customRender ? { key: "default", fn: function(l) {
|
|
795
803
|
return [l && l.row ? e._t(t.scopedSlots.customRender, null, null, Object.assign({}, t, { row: l.row, column: l.column, scope: l })) : o("span", [e._v("-")])];
|
|
796
|
-
} } : null], null, !0) }, "el-table-column", e.columnBindAttr(Object.assign({}, t, { columnIndex:
|
|
804
|
+
} } : null], null, !0) }, "el-table-column", e.columnBindAttr(Object.assign({}, t, { columnIndex: i })), !1));
|
|
797
805
|
}), 1) : e.cols.render && typeof e.cols.render == "function" ? o("el-table-column", e._b({ scopedSlots: e._u([{ key: "default", fn: function(t) {
|
|
798
806
|
return [t && t.row ? o("render-dom-tb", { attrs: { row: t.row, index: t.$index, "data-key": e.cols.key, render: e.cols.render } }) : o("span", [e._v("-")])];
|
|
799
807
|
} }]) }, "el-table-column", e.columnBindAttr(e.cols), !1)) : e.cols.scopedSlots && e.cols.scopedSlots.customRender ? o("el-table-column", e._b({ scopedSlots: e._u([{ key: "default", fn: function(t) {
|
|
800
808
|
return [t && t.row ? e._t(e.cols.scopedSlots.customRender, null, null, Object.assign({}, e.cols, { row: t.row, column: t.column, scope: t })) : o("span", [e._v("-")])];
|
|
801
809
|
} }], null, !0) }, "el-table-column", e.columnBindAttr(e.cols), !1)) : e.cols.ellipsis && typeof e.cols.ellipsis == "boolean" ? o("el-table-column", e._b({ attrs: { "show-overflow-tooltip": "" } }, "el-table-column", e.columnBindAttr(e.cols), !1)) : o("el-table-column", e._b({}, "el-table-column", e.columnBindAttr(e.cols), !1));
|
|
802
|
-
},
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
810
|
+
}, en = [], tn = /* @__PURE__ */ ge(
|
|
811
|
+
Yt,
|
|
812
|
+
Xt,
|
|
813
|
+
en,
|
|
806
814
|
!1,
|
|
807
815
|
null,
|
|
808
816
|
null
|
|
809
817
|
);
|
|
810
|
-
const
|
|
818
|
+
const nn = tn.exports, ft = (n) => n ? n.startsWith("el-icon-") ? n : `el-icon-${n.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase()}` : void 0, on = ie({
|
|
811
819
|
name: "RenderDomTbBtn",
|
|
812
820
|
props: {
|
|
813
821
|
render: { type: Function, required: !0 }
|
|
@@ -822,9 +830,9 @@ const Et = zt.exports, nt = (n) => n ? n.startsWith("el-icon-") ? n : `el-icon-$
|
|
|
822
830
|
}
|
|
823
831
|
};
|
|
824
832
|
}
|
|
825
|
-
}),
|
|
833
|
+
}), sn = ie({
|
|
826
834
|
name: "EsTableBtns",
|
|
827
|
-
components: { RenderDom:
|
|
835
|
+
components: { RenderDom: on },
|
|
828
836
|
props: {
|
|
829
837
|
leftText: { type: String, default: "" },
|
|
830
838
|
btnConfig: {
|
|
@@ -837,21 +845,21 @@ const Et = zt.exports, nt = (n) => n ? n.startsWith("el-icon-") ? n : `el-icon-$
|
|
|
837
845
|
}
|
|
838
846
|
},
|
|
839
847
|
setup(n) {
|
|
840
|
-
var
|
|
841
|
-
const e = (f = (
|
|
848
|
+
var a, f;
|
|
849
|
+
const e = (f = (a = ce("$EsPlus", null)) != null ? a : me()) != null ? f : {}, o = (p, b) => {
|
|
842
850
|
if (!b) return !0;
|
|
843
|
-
const
|
|
844
|
-
return typeof
|
|
851
|
+
const y = e.permission;
|
|
852
|
+
return typeof y == "function" ? y(b) : !0;
|
|
845
853
|
}, t = (p) => p.map((b) => {
|
|
846
|
-
const
|
|
847
|
-
return o([], b.permissionValue) ? typeof b.isHide == "function" ?
|
|
848
|
-
}),
|
|
849
|
-
(n.btnConfig || []).filter((p) =>
|
|
850
|
-
).filter((p) => !p.isHide)), l =
|
|
851
|
-
(n.btnConfig || []).filter((p) =>
|
|
852
|
-
).filter((p) => !p.isHide)), c =
|
|
854
|
+
const y = { ...b };
|
|
855
|
+
return o([], b.permissionValue) ? typeof b.isHide == "function" ? y.isHide = b.isHide() : y.isHide = b.isHide || !1 : y.isHide = !0, y;
|
|
856
|
+
}), i = S(() => t(
|
|
857
|
+
(n.btnConfig || []).filter((p) => nt(p) === "left")
|
|
858
|
+
).filter((p) => !p.isHide)), l = S(() => t(
|
|
859
|
+
(n.btnConfig || []).filter((p) => nt(p) === "right")
|
|
860
|
+
).filter((p) => !p.isHide)), c = S(() => !!n.leftText || i.value.length > 0 || l.value.length > 0);
|
|
853
861
|
return {
|
|
854
|
-
processedBtnLeft:
|
|
862
|
+
processedBtnLeft: i,
|
|
855
863
|
processedBtnRight: l,
|
|
856
864
|
showContainer: c,
|
|
857
865
|
getDisabledState: (p) => typeof p.disabled == "function" ? p.disabled() : p.disabled || !1,
|
|
@@ -859,52 +867,52 @@ const Et = zt.exports, nt = (n) => n ? n.startsWith("el-icon-") ? n : `el-icon-$
|
|
|
859
867
|
display: "inline-block",
|
|
860
868
|
marginLeft: p !== 0 ? "8px" : "0px"
|
|
861
869
|
}),
|
|
862
|
-
getCompIcon:
|
|
870
|
+
getCompIcon: ft,
|
|
863
871
|
filterOptions: (p) => {
|
|
864
872
|
const {
|
|
865
873
|
render: b,
|
|
866
|
-
click:
|
|
874
|
+
click: y,
|
|
867
875
|
icon: _,
|
|
868
|
-
permissionValue:
|
|
869
|
-
code:
|
|
870
|
-
isHide:
|
|
871
|
-
name:
|
|
872
|
-
size:
|
|
873
|
-
...
|
|
876
|
+
permissionValue: L,
|
|
877
|
+
code: j,
|
|
878
|
+
isHide: N,
|
|
879
|
+
name: M,
|
|
880
|
+
size: V,
|
|
881
|
+
...W
|
|
874
882
|
} = p;
|
|
875
|
-
return
|
|
883
|
+
return W;
|
|
876
884
|
},
|
|
877
|
-
resolveBtnSize: (p) =>
|
|
885
|
+
resolveBtnSize: (p) => je(p.size) || "mini"
|
|
878
886
|
};
|
|
879
887
|
}
|
|
880
888
|
});
|
|
881
|
-
var
|
|
889
|
+
var rn = function() {
|
|
882
890
|
var e = this, o = e._self._c;
|
|
883
|
-
return e._self._setupProxy, e.showContainer ? o("div", { staticClass: "flex-float btns" }, [o("div", { staticClass: "left-text" }, [e._v(" " + e._s(e.leftText) + " ")]), o("div", { staticClass: "btn-container_block" }, [o("div", { staticClass: "btn-left" }, [e._l(e.processedBtnLeft, function(t,
|
|
884
|
-
return [t.isHide ? e._e() : o("div", { key: t.name ||
|
|
885
|
-
})], 2), o("div", { staticClass: "btn-right" }, [e._l(e.processedBtnRight, function(t,
|
|
886
|
-
return [t.isHide ? e._e() : o("div", { key: t.name ||
|
|
891
|
+
return e._self._setupProxy, e.showContainer ? o("div", { staticClass: "flex-float btns" }, [o("div", { staticClass: "left-text" }, [e._v(" " + e._s(e.leftText) + " ")]), o("div", { staticClass: "btn-container_block" }, [o("div", { staticClass: "btn-left" }, [e._l(e.processedBtnLeft, function(t, i) {
|
|
892
|
+
return [t.isHide ? e._e() : o("div", { key: t.name || i, style: e.buttonContainerStyle(i) }, [t.render && typeof t.render == "function" ? o("render-dom", { attrs: { render: t.render } }) : o("el-button", e._b({ attrs: { type: t.type || "", size: e.resolveBtnSize(t), icon: e.getCompIcon(t.icon), loading: t.loading || !1, disabled: e.getDisabledState(t) }, on: { click: () => t.click && t.click(e.instance) } }, "el-button", e.filterOptions(t), !1), [e._v(" " + e._s(t.name) + " ")])], 1)];
|
|
893
|
+
})], 2), o("div", { staticClass: "btn-right" }, [e._l(e.processedBtnRight, function(t, i) {
|
|
894
|
+
return [t.isHide ? e._e() : o("div", { key: t.name || i, style: e.buttonContainerStyle(i) }, [t.render && typeof t.render == "function" ? o("render-dom", { attrs: { render: t.render } }) : o("el-button", e._b({ attrs: { type: t.type || "", size: e.resolveBtnSize(t), icon: e.getCompIcon(t.icon), loading: t.loading || !1, disabled: e.getDisabledState(t) }, on: { click: () => t.click && t.click(e.instance) } }, "el-button", e.filterOptions(t), !1), [e._v(" " + e._s(t.name) + " ")])], 1)];
|
|
887
895
|
})], 2)])]) : e._e();
|
|
888
|
-
},
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
896
|
+
}, an = [], ln = /* @__PURE__ */ ge(
|
|
897
|
+
sn,
|
|
898
|
+
rn,
|
|
899
|
+
an,
|
|
892
900
|
!1,
|
|
893
901
|
null,
|
|
894
902
|
"2b641efd"
|
|
895
903
|
);
|
|
896
|
-
const
|
|
897
|
-
function
|
|
898
|
-
const l = z(400), c = z(null),
|
|
899
|
-
var
|
|
900
|
-
const f = ((
|
|
904
|
+
const cn = ln.exports;
|
|
905
|
+
function un(n, e, o, t, i) {
|
|
906
|
+
const l = z(400), c = z(null), B = (f) => Math.sign(f) === -1, k = () => {
|
|
907
|
+
var y, _, L, j;
|
|
908
|
+
const f = ((y = e.value) == null ? void 0 : y.offsetHeight) || 0, p = ((L = (_ = o.value) == null ? void 0 : _.$el) == null ? void 0 : L.offsetHeight) || 0, b = ((j = t.value) == null ? void 0 : j.offsetHeight) || 0;
|
|
901
909
|
return Math.round(b + f + p);
|
|
902
910
|
}, d = () => {
|
|
903
|
-
var
|
|
911
|
+
var V, W, U, J, R;
|
|
904
912
|
const f = n.value;
|
|
905
913
|
if (!f) return;
|
|
906
|
-
const p = typeof
|
|
907
|
-
l.value !==
|
|
914
|
+
const p = typeof i.tabHeight == "number" ? i.tabHeight : i.heightType === "height" ? ((V = f.parentElement) == null ? void 0 : V.offsetHeight) || f.offsetHeight : parseInt(i.tabHeight, 10) || 450, b = isNaN(p) ? 450 : p, y = b - k(), _ = B(y) ? k() + 300 : b, L = ((W = t.value) == null ? void 0 : W.offsetHeight) || 0, j = ((U = e.value) == null ? void 0 : U.offsetHeight) || 0, N = ((R = (J = o.value) == null ? void 0 : J.$el) == null ? void 0 : R.offsetHeight) || 0, M = Math.floor(_) - Math.round(L + j + N);
|
|
915
|
+
l.value !== M && (l.value = M);
|
|
908
916
|
}, g = () => {
|
|
909
917
|
Fe(() => {
|
|
910
918
|
if (!n.value || typeof ResizeObserver == "undefined") return;
|
|
@@ -913,43 +921,43 @@ function Kt(n, e, o, t, a) {
|
|
|
913
921
|
n.value && d();
|
|
914
922
|
});
|
|
915
923
|
});
|
|
916
|
-
const f =
|
|
917
|
-
c.value.observe(f), e.value && c.value.observe(e.value);
|
|
924
|
+
const f = i.heightType === "height" && n.value.parentElement || n.value;
|
|
925
|
+
c.value.observe(f), d(), e.value && c.value.observe(e.value), t.value && c.value.observe(t.value);
|
|
918
926
|
});
|
|
919
|
-
},
|
|
927
|
+
}, a = () => {
|
|
920
928
|
c.value && (c.value.disconnect(), c.value = null);
|
|
921
929
|
};
|
|
922
|
-
return
|
|
930
|
+
return Ue(() => g()), jt(() => a()), { tableHeight: l, resizeObservers: d, startObserver: g, stopObserver: a };
|
|
923
931
|
}
|
|
924
|
-
function
|
|
925
|
-
const e =
|
|
926
|
-
o.value = [...e.multipleSelection], t.value = { ...e.selectionsByPage },
|
|
932
|
+
function dn(n) {
|
|
933
|
+
const e = Ft(), o = z([]), t = z({}), i = z(!1), l = () => {
|
|
934
|
+
o.value = [...e.multipleSelection], t.value = { ...e.selectionsByPage }, i.value = e.isInitChange;
|
|
927
935
|
};
|
|
928
936
|
return {
|
|
929
937
|
multipleSelection: o,
|
|
930
938
|
selectionsByPage: t,
|
|
931
|
-
isInitChange:
|
|
939
|
+
isInitChange: i,
|
|
932
940
|
handleSelectionChange: (d, g) => {
|
|
933
|
-
e.isInitChange && n || (
|
|
941
|
+
e.isInitChange && n || (Ot(e, d, g, n), l());
|
|
934
942
|
},
|
|
935
943
|
clearAllSelection: (d) => {
|
|
936
|
-
d ?
|
|
944
|
+
d ? Rt(e, d) : (e.multipleSelection = [], e.selectionsByPage = {}), l();
|
|
937
945
|
},
|
|
938
946
|
initSelection: (d, g) => {
|
|
939
947
|
if (e.isInitChange = !0, l(), !g) {
|
|
940
948
|
e.isInitChange = !1, l();
|
|
941
949
|
return;
|
|
942
950
|
}
|
|
943
|
-
n ?
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
var
|
|
947
|
-
(
|
|
951
|
+
Fe(n ? () => {
|
|
952
|
+
It(e, d, g, n), e.isInitChange = !1, l();
|
|
953
|
+
} : () => {
|
|
954
|
+
var a;
|
|
955
|
+
(a = g.clearSelection) == null || a.call(g), e.isInitChange = !1, l();
|
|
948
956
|
});
|
|
949
957
|
}
|
|
950
958
|
};
|
|
951
959
|
}
|
|
952
|
-
const
|
|
960
|
+
const rt = {
|
|
953
961
|
multiSelect: !1,
|
|
954
962
|
expand: !1,
|
|
955
963
|
snIndex: !1,
|
|
@@ -959,7 +967,7 @@ const Ye = {
|
|
|
959
967
|
headerCellStyle: { background: "#f5f7fa" },
|
|
960
968
|
highlightCurrentRow: !0,
|
|
961
969
|
cachePageSelection: !0
|
|
962
|
-
},
|
|
970
|
+
}, fn = /* @__PURE__ */ new Set([
|
|
963
971
|
"multiSelect",
|
|
964
972
|
"expand",
|
|
965
973
|
"snIndex",
|
|
@@ -983,24 +991,24 @@ const Ye = {
|
|
|
983
991
|
"estimatedRowHeight",
|
|
984
992
|
"overscanCount",
|
|
985
993
|
"rowClassName"
|
|
986
|
-
]),
|
|
994
|
+
]), pn = (n) => n.toLowerCase().replace(/(\s|^)[a-z]/g, (e) => e.toUpperCase()), mn = (n) => {
|
|
987
995
|
const e = {};
|
|
988
996
|
for (const o in n)
|
|
989
997
|
if (!(o === "groups" || o === "scopedSlots" || o === "render"))
|
|
990
998
|
if (o.includes("-")) {
|
|
991
999
|
const t = o.split("-");
|
|
992
|
-
let
|
|
1000
|
+
let i = t[0];
|
|
993
1001
|
for (let l = 1; l < t.length; l++)
|
|
994
|
-
|
|
995
|
-
e[
|
|
1002
|
+
i += pn(t[l]);
|
|
1003
|
+
e[i] = n[o];
|
|
996
1004
|
} else o === "key" && (e.prop = n[o]), e[o] = n[o];
|
|
997
1005
|
return e.align || (e.align = "center"), e;
|
|
998
|
-
},
|
|
1006
|
+
}, at = (n) => {
|
|
999
1007
|
const e = ["total", "pageSize", "current", "tableData"];
|
|
1000
|
-
return
|
|
1001
|
-
},
|
|
1008
|
+
return pe(n) ? Object.keys(n).every((o) => e.find((t) => t === o) && n[o] && typeof n[o] == "string") : !1;
|
|
1009
|
+
}, gn = ie({
|
|
1002
1010
|
name: "EsTable",
|
|
1003
|
-
components: { ColumnItem:
|
|
1011
|
+
components: { ColumnItem: nn, TableBtns: cn },
|
|
1004
1012
|
// 关闭自动 attrs 继承,避免 fallthrough 重复绑定
|
|
1005
1013
|
inheritAttrs: !1,
|
|
1006
1014
|
props: {
|
|
@@ -1020,7 +1028,7 @@ const Ye = {
|
|
|
1020
1028
|
},
|
|
1021
1029
|
options: {
|
|
1022
1030
|
type: Object,
|
|
1023
|
-
default: () => ({ ...
|
|
1031
|
+
default: () => ({ ...rt })
|
|
1024
1032
|
},
|
|
1025
1033
|
pagination: {
|
|
1026
1034
|
type: Object,
|
|
@@ -1034,33 +1042,34 @@ const Ye = {
|
|
|
1034
1042
|
"size-change",
|
|
1035
1043
|
"change-table-sort"
|
|
1036
1044
|
],
|
|
1037
|
-
setup(n, { emit: e, slots: o, attrs: t, expose:
|
|
1038
|
-
var
|
|
1039
|
-
const l =
|
|
1045
|
+
setup(n, { emit: e, slots: o, attrs: t, expose: i }) {
|
|
1046
|
+
var Qe, Je, Ze, Ge;
|
|
1047
|
+
const l = Ke(), c = (Je = (Qe = ce(
|
|
1040
1048
|
"$esPlusTable",
|
|
1041
1049
|
null
|
|
1042
|
-
)) != null ?
|
|
1043
|
-
if (!
|
|
1044
|
-
const
|
|
1045
|
-
return typeof
|
|
1050
|
+
)) != null ? Qe : me().EsTable) != null ? Je : {}, B = (Ge = (Ze = ce("$EsPlus", null)) != null ? Ze : me()) != null ? Ge : {}, k = (s) => {
|
|
1051
|
+
if (!s) return !0;
|
|
1052
|
+
const O = B.permission;
|
|
1053
|
+
return typeof O == "function" ? O(s) : !0;
|
|
1046
1054
|
};
|
|
1047
1055
|
(n.options.virtual === !0 || n.options.engine === "virtual") && console.warn(
|
|
1048
1056
|
"[@es-plus/vue2] 虚拟滚动 (virtual: true) 在 Vue 2 + Element UI 下不可用,已降级为普通 el-table 渲染。如需虚拟滚动请使用 Vue 3 + Element Plus 版本(@es-plus/vue3)。"
|
|
1049
1057
|
);
|
|
1050
|
-
const d = z(null), g = z(null),
|
|
1051
|
-
|
|
1058
|
+
const d = z(null), g = z(null), a = z(null), f = z(null), p = z(null), b = z(`table_${Math.random().toString(36).substring(2, 12)}`), y = z([]), _ = S(() => y.value && y.value.length ? y.value : n.dataSource), L = z([...n.columns]);
|
|
1059
|
+
de(
|
|
1052
1060
|
() => n.columns,
|
|
1053
|
-
(
|
|
1054
|
-
|
|
1061
|
+
(s) => {
|
|
1062
|
+
L.value = [...s];
|
|
1055
1063
|
},
|
|
1056
1064
|
{ deep: !0 }
|
|
1057
1065
|
);
|
|
1058
|
-
const
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1066
|
+
const j = z(!1), N = z(!1), M = z(!1), V = () => {
|
|
1067
|
+
const s = l == null ? void 0 : l.proxy;
|
|
1068
|
+
!s || !s.$refs || (p.value = s.$refs.tableContainerEl || null, a.value = s.$refs.headBarRef || null, f.value = s.$refs.paginationRef || null);
|
|
1069
|
+
}, W = ce("bodyFormInstance", () => {
|
|
1070
|
+
}), U = ce("getVisibleShow", !1), J = S(
|
|
1071
|
+
() => typeof U == "function" ? U() : U
|
|
1072
|
+
), R = z({
|
|
1064
1073
|
pageSize: 10,
|
|
1065
1074
|
current: 1,
|
|
1066
1075
|
total: 0,
|
|
@@ -1068,20 +1077,20 @@ const Ye = {
|
|
|
1068
1077
|
size: "small",
|
|
1069
1078
|
isSmall: !0,
|
|
1070
1079
|
...n.pagination
|
|
1071
|
-
}),
|
|
1072
|
-
const
|
|
1073
|
-
return
|
|
1074
|
-
}),
|
|
1075
|
-
if (n.options.configTableOut &&
|
|
1080
|
+
}), r = z(null), u = S(() => {
|
|
1081
|
+
const s = n.options.entryQuery;
|
|
1082
|
+
return s && pe(s) && Object.keys(s).length ? s : {};
|
|
1083
|
+
}), h = S(() => {
|
|
1084
|
+
if (n.options.configTableOut && pe(n.options.configTableOut) && Object.keys(n.options.configTableOut).length && at(n.options.configTableOut))
|
|
1076
1085
|
return n.options.configTableOut;
|
|
1077
1086
|
if (c != null && c.configQueryFieldOutput && typeof c.configQueryFieldOutput == "function") {
|
|
1078
|
-
const
|
|
1087
|
+
const s = c.configQueryFieldOutput({
|
|
1079
1088
|
total: "records",
|
|
1080
1089
|
pageSize: "pageSize",
|
|
1081
1090
|
current: "pageNo",
|
|
1082
1091
|
tableData: "rows"
|
|
1083
1092
|
});
|
|
1084
|
-
if (
|
|
1093
|
+
if (at(s)) return s;
|
|
1085
1094
|
}
|
|
1086
1095
|
return {
|
|
1087
1096
|
total: "records",
|
|
@@ -1089,342 +1098,373 @@ const Ye = {
|
|
|
1089
1098
|
current: "pageNo",
|
|
1090
1099
|
tableData: "rows"
|
|
1091
1100
|
};
|
|
1092
|
-
}),
|
|
1093
|
-
const
|
|
1094
|
-
if (!
|
|
1095
|
-
const
|
|
1096
|
-
var
|
|
1097
|
-
return ((
|
|
1101
|
+
}), w = S(() => {
|
|
1102
|
+
const s = l == null ? void 0 : l.proxy;
|
|
1103
|
+
if (!s || !s.$children) return {};
|
|
1104
|
+
const O = s.$children.find((C) => {
|
|
1105
|
+
var I;
|
|
1106
|
+
return ((I = C == null ? void 0 : C.$options) == null ? void 0 : I.name) === "EsForm";
|
|
1098
1107
|
});
|
|
1099
|
-
return
|
|
1100
|
-
}),
|
|
1101
|
-
const
|
|
1102
|
-
if (typeof
|
|
1103
|
-
const C =
|
|
1108
|
+
return O ? (r.value = O, W(O), O) : {};
|
|
1109
|
+
}), A = S(() => {
|
|
1110
|
+
const s = o.default;
|
|
1111
|
+
if (typeof s == "function") {
|
|
1112
|
+
const C = s();
|
|
1104
1113
|
return Array.isArray(C) ? C.length > 0 : !!C;
|
|
1105
1114
|
}
|
|
1106
|
-
const
|
|
1107
|
-
return Array.isArray(
|
|
1108
|
-
}),
|
|
1115
|
+
const O = o.default;
|
|
1116
|
+
return Array.isArray(O) && O.length > 0;
|
|
1117
|
+
}), x = S(
|
|
1109
1118
|
() => n.options.heightType || "auto"
|
|
1110
|
-
),
|
|
1111
|
-
[
|
|
1112
|
-
})),
|
|
1119
|
+
), E = S(() => typeof n.options.tabHeight == "number" ? `${n.options.tabHeight}px` : x.value === "height" && typeof n.options.height == "number" ? `${n.options.height}px` : "100%"), Q = S(() => ({
|
|
1120
|
+
[x.value]: E.value
|
|
1121
|
+
})), q = S(() => n.headBarClass ? {
|
|
1113
1122
|
type: typeof n.headBarClass == "string" ? "string" : "object",
|
|
1114
1123
|
value: n.headBarClass
|
|
1115
|
-
} : { type: "string", value: "" }),
|
|
1116
|
-
const
|
|
1117
|
-
return
|
|
1118
|
-
}),
|
|
1124
|
+
} : { type: "string", value: "" }), se = S(() => {
|
|
1125
|
+
const s = q.value;
|
|
1126
|
+
return s.type === "object" && s.value && typeof s.value == "object" ? s.value : {};
|
|
1127
|
+
}), re = S(() => {
|
|
1128
|
+
const s = q.value;
|
|
1129
|
+
return s.type === "string" ? s.value : "";
|
|
1130
|
+
}), ne = S(() => {
|
|
1131
|
+
const s = c == null ? void 0 : c.paginationLayout;
|
|
1132
|
+
return s ? typeof s == "function" ? s() : s : null;
|
|
1133
|
+
}), _e = S(
|
|
1134
|
+
() => {
|
|
1135
|
+
var s;
|
|
1136
|
+
return ((s = ne.value) == null ? void 0 : s.layout) || "prev, pager, next, jumper, sizes, ->, total";
|
|
1137
|
+
}
|
|
1138
|
+
), De = S(
|
|
1139
|
+
() => {
|
|
1140
|
+
var s;
|
|
1141
|
+
return ((s = ne.value) == null ? void 0 : s.pageSizes) || R.value.pageSizes;
|
|
1142
|
+
}
|
|
1143
|
+
), qe = S(
|
|
1119
1144
|
() => {
|
|
1120
|
-
var
|
|
1121
|
-
return ((
|
|
1145
|
+
var s, O;
|
|
1146
|
+
return (O = (s = ne.value) == null ? void 0 : s.isSmall) != null ? O : R.value.isSmall;
|
|
1122
1147
|
}
|
|
1123
|
-
),
|
|
1148
|
+
), fe = S(
|
|
1124
1149
|
() => {
|
|
1125
|
-
var
|
|
1126
|
-
return ((
|
|
1150
|
+
var s, O;
|
|
1151
|
+
return (O = (s = ne.value) == null ? void 0 : s.background) != null ? O : !0;
|
|
1127
1152
|
}
|
|
1128
|
-
),
|
|
1153
|
+
), Ie = S(
|
|
1129
1154
|
() => {
|
|
1130
|
-
var
|
|
1131
|
-
return (
|
|
1155
|
+
var s;
|
|
1156
|
+
return ((s = ne.value) == null ? void 0 : s.prevText) || "";
|
|
1132
1157
|
}
|
|
1133
|
-
),
|
|
1158
|
+
), Re = S(
|
|
1134
1159
|
() => {
|
|
1135
|
-
var
|
|
1136
|
-
return (
|
|
1160
|
+
var s;
|
|
1161
|
+
return ((s = ne.value) == null ? void 0 : s.nextText) || "";
|
|
1137
1162
|
}
|
|
1138
|
-
),
|
|
1139
|
-
position:
|
|
1163
|
+
), Oe = S(() => ({
|
|
1164
|
+
position: x.value === "height" ? "absolute" : "static",
|
|
1140
1165
|
bottom: "0px",
|
|
1141
1166
|
left: "0px",
|
|
1142
|
-
|
|
1167
|
+
// z-index 必须高于 element-loading 蒙层(默认 2000),否则请求加载过程中分页会被蒙层遮挡。
|
|
1168
|
+
zIndex: 2001,
|
|
1143
1169
|
background: "#fff"
|
|
1144
|
-
})),
|
|
1145
|
-
() => !!n.options.actionUrl || n.options.apiParams &&
|
|
1146
|
-
),
|
|
1147
|
-
const
|
|
1148
|
-
if (
|
|
1170
|
+
})), we = S(() => n.options.loading || j.value), ye = S(
|
|
1171
|
+
() => !!n.options.actionUrl || n.options.apiParams && pe(n.options.apiParams) && Object.keys(n.options.apiParams).length > 0
|
|
1172
|
+
), Pe = S(() => {
|
|
1173
|
+
const s = L.value.filter((C) => !C.hidCol);
|
|
1174
|
+
if (s.forEach((C) => {
|
|
1149
1175
|
C.prop !== "operate" && C.key !== "operate" && (C.prop || C.key) && !C.formatter && (C.formatter = (P) => {
|
|
1150
|
-
const
|
|
1151
|
-
return
|
|
1152
|
-
}), (C.prop === "operate" || C.key === "operate") && C.btns && !C.render && (C.render = (P, { row:
|
|
1153
|
-
var
|
|
1154
|
-
return
|
|
1155
|
-
(
|
|
1156
|
-
(
|
|
1176
|
+
const I = P[C.prop] || P[C.key];
|
|
1177
|
+
return I == null || I === "" ? C.emptyPlaceholder || "-" : I;
|
|
1178
|
+
}), (C.prop === "operate" || C.key === "operate") && C.btns && !C.render && (C.render = (P, { row: I }) => {
|
|
1179
|
+
var ae;
|
|
1180
|
+
return ue("div", [
|
|
1181
|
+
(ae = C.btns) == null ? void 0 : ae.filter((Z) => k(Z.permissionValue)).map(
|
|
1182
|
+
(Z) => (
|
|
1157
1183
|
// Element UI text 按钮:type="text" 而非 text 属性
|
|
1158
|
-
|
|
1184
|
+
ue(
|
|
1159
1185
|
"el-button",
|
|
1160
1186
|
{
|
|
1161
1187
|
props: {
|
|
1162
1188
|
type: "text"
|
|
1163
1189
|
},
|
|
1164
1190
|
attrs: {
|
|
1165
|
-
...
|
|
1191
|
+
...Z.type ? { "data-btn-type": Z.type } : {}
|
|
1166
1192
|
},
|
|
1167
1193
|
on: {
|
|
1168
1194
|
click: () => {
|
|
1169
|
-
var
|
|
1170
|
-
return (
|
|
1195
|
+
var le;
|
|
1196
|
+
return (le = Z.clickEvent) == null ? void 0 : le.call(Z, I);
|
|
1171
1197
|
}
|
|
1172
1198
|
}
|
|
1173
1199
|
},
|
|
1174
|
-
|
|
1200
|
+
Z.name
|
|
1175
1201
|
)
|
|
1176
1202
|
)
|
|
1177
1203
|
)
|
|
1178
1204
|
]);
|
|
1179
1205
|
});
|
|
1180
|
-
}),
|
|
1206
|
+
}), s.length > 0 && s.every((C) => C.width && !C.minWidth)) {
|
|
1181
1207
|
let C = -1;
|
|
1182
|
-
for (let P =
|
|
1183
|
-
const
|
|
1184
|
-
if (!
|
|
1208
|
+
for (let P = s.length - 1; P >= 0; P--) {
|
|
1209
|
+
const I = s[P];
|
|
1210
|
+
if (!I.fixed && I.prop !== "operate" && I.key !== "operate") {
|
|
1185
1211
|
C = P;
|
|
1186
1212
|
break;
|
|
1187
1213
|
}
|
|
1188
1214
|
}
|
|
1189
|
-
if (C === -1 && (C =
|
|
1190
|
-
const P =
|
|
1215
|
+
if (C === -1 && (C = s.length - 1), C >= 0) {
|
|
1216
|
+
const P = s[C];
|
|
1191
1217
|
P.minWidth = P.width, delete P.width;
|
|
1192
1218
|
}
|
|
1193
1219
|
}
|
|
1194
|
-
return
|
|
1195
|
-
}),
|
|
1196
|
-
const
|
|
1197
|
-
for (const
|
|
1198
|
-
|
|
1220
|
+
return s;
|
|
1221
|
+
}), $e = S(() => {
|
|
1222
|
+
const s = mn({ ...rt, ...n.options }), { align: O, ...C } = s, P = {};
|
|
1223
|
+
for (const I in C)
|
|
1224
|
+
fn.has(I) || (P[I] = C[I]);
|
|
1199
1225
|
if (P.size !== void 0) {
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1226
|
+
const I = je(P.size);
|
|
1227
|
+
I !== void 0 && (P.size = I);
|
|
1202
1228
|
}
|
|
1203
1229
|
return P;
|
|
1204
|
-
}), { tableHeight:
|
|
1230
|
+
}), { tableHeight: Ce, resizeObservers: he } = un(
|
|
1205
1231
|
p,
|
|
1206
|
-
|
|
1232
|
+
a,
|
|
1207
1233
|
g,
|
|
1208
1234
|
f,
|
|
1209
1235
|
{
|
|
1210
|
-
heightType:
|
|
1236
|
+
heightType: x.value,
|
|
1211
1237
|
tabHeight: n.options.tabHeight
|
|
1212
1238
|
}
|
|
1213
|
-
),
|
|
1214
|
-
const
|
|
1215
|
-
return n.options.rowkey && (
|
|
1239
|
+
), He = S(() => {
|
|
1240
|
+
const s = { ...$e.value, ...t };
|
|
1241
|
+
return n.options.rowkey && (s.rowKey = n.options.rowkey), x.value === "height" ? s.height = Ce.value : x.value === "maxHeight" && (s.maxHeight = Ce.value), s;
|
|
1216
1242
|
}), {
|
|
1217
|
-
multipleSelection:
|
|
1218
|
-
handleSelectionChange:
|
|
1219
|
-
initSelection:
|
|
1220
|
-
clearAllSelection:
|
|
1221
|
-
} =
|
|
1222
|
-
|
|
1243
|
+
multipleSelection: m,
|
|
1244
|
+
handleSelectionChange: v,
|
|
1245
|
+
initSelection: T,
|
|
1246
|
+
clearAllSelection: H
|
|
1247
|
+
} = dn(n.options.rowkey), F = (s) => {
|
|
1248
|
+
v(s, R.value.current || 1);
|
|
1223
1249
|
};
|
|
1224
|
-
|
|
1250
|
+
de(J, async (s, O) => {
|
|
1225
1251
|
var C, P;
|
|
1226
|
-
|
|
1227
|
-
})
|
|
1252
|
+
s && s !== O && (n.options.actionUrl && await Te(), (P = (C = d.value) == null ? void 0 : C.doLayout) == null || P.call(C));
|
|
1253
|
+
});
|
|
1254
|
+
let $ = JSON.stringify(n.pagination || {});
|
|
1255
|
+
n.pagination && Object.keys(n.pagination).length && (R.value = { ...R.value, ...n.pagination }, M.value = n.pagination.total !== void 0);
|
|
1256
|
+
const D = () => {
|
|
1257
|
+
const s = { ...R.value };
|
|
1258
|
+
$ = JSON.stringify(s), e("update:pagination", s);
|
|
1259
|
+
};
|
|
1260
|
+
de(
|
|
1228
1261
|
() => n.pagination,
|
|
1229
|
-
(
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
),
|
|
1262
|
+
(s) => {
|
|
1263
|
+
const O = JSON.stringify(s || {});
|
|
1264
|
+
O !== $ && ($ = O, R.value = { ...R.value, ...s }, M.value = s.total !== void 0);
|
|
1265
|
+
}
|
|
1266
|
+
), de(
|
|
1234
1267
|
() => n.dataSource,
|
|
1235
|
-
(
|
|
1236
|
-
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
(
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
y.value;
|
|
1268
|
+
(s) => {
|
|
1269
|
+
T(s, d.value);
|
|
1270
|
+
}
|
|
1271
|
+
);
|
|
1272
|
+
let X = null;
|
|
1273
|
+
de(y, (s) => {
|
|
1274
|
+
Array.isArray(s) && s !== X && (X = s, e("update:dataSource", s));
|
|
1275
|
+
}), Ue(() => {
|
|
1276
|
+
V(), ye.value && n.options.isInitRun !== !1 && Te(), Fe(() => {
|
|
1277
|
+
V(), w.value, typeof requestAnimationFrame != "undefined" ? requestAnimationFrame(() => {
|
|
1278
|
+
V(), he();
|
|
1279
|
+
}) : he();
|
|
1248
1280
|
});
|
|
1249
1281
|
});
|
|
1250
|
-
const
|
|
1251
|
-
const C =
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1282
|
+
const ee = (s, O) => {
|
|
1283
|
+
const C = [
|
|
1284
|
+
{ eventName: "brcb", isReturn: !0 },
|
|
1285
|
+
{ eventName: "qrcb", isReturn: !0 }
|
|
1286
|
+
], P = C.findIndex((I) => I.eventName === s);
|
|
1287
|
+
if (n.options.listenToCallBack && n.options.listenToCallBack[s] && P !== -1 && C[P].isReturn)
|
|
1288
|
+
return n.options.listenToCallBack[s](O);
|
|
1289
|
+
}, Ne = (s, O) => {
|
|
1290
|
+
const C = h.value;
|
|
1291
|
+
if (pe(C) && Object.keys(C).length) {
|
|
1292
|
+
const P = {};
|
|
1293
|
+
Object.entries(C).forEach(([I, ae]) => {
|
|
1294
|
+
var Se;
|
|
1295
|
+
if (!O.includes(I)) return;
|
|
1296
|
+
const le = (Se = s[ae]) != null ? Se : wt(s, ae);
|
|
1297
|
+
I === "tableData" ? y.value = Array.isArray(le) ? le : [] : P[I] = typeof le == "number" ? le : parseInt(le, 10) || 0;
|
|
1298
|
+
}), Object.keys(P).length && (R.value = { ...R.value, ...P });
|
|
1299
|
+
}
|
|
1300
|
+
}, Me = (s, O = {}) => {
|
|
1301
|
+
var et, tt;
|
|
1302
|
+
const { success: C, fail: P } = O, I = ((et = n.options) == null ? void 0 : et.apiParams) || {}, ae = ((tt = n.options) == null ? void 0 : tt.actionUrl) || I.url || "";
|
|
1303
|
+
if (!ae || !Object.keys(I).length) return;
|
|
1304
|
+
const Z = w.value, le = Z && Z.props && Z.props.model ? { ...Z.props.model } : u.value || {}, Se = ee("brcb", {
|
|
1305
|
+
...le,
|
|
1306
|
+
...s,
|
|
1307
|
+
...I.model || {}
|
|
1308
|
+
}), vt = pe(Se) ? Se : { ...le, ...I.model || {}, ...s }, Ye = { ...I.options || {} };
|
|
1309
|
+
I != null && I.method && (Ye.method = I == null ? void 0 : I.method);
|
|
1310
|
+
const Xe = async (bt) => {
|
|
1311
|
+
if (!j.value) {
|
|
1312
|
+
j.value = !0;
|
|
1277
1313
|
try {
|
|
1278
|
-
const
|
|
1279
|
-
url:
|
|
1280
|
-
formParams:
|
|
1281
|
-
headers:
|
|
1282
|
-
...
|
|
1283
|
-
...
|
|
1284
|
-
}),
|
|
1285
|
-
|
|
1286
|
-
} catch (
|
|
1287
|
-
typeof P == "function" && P(
|
|
1314
|
+
const ve = await bt({
|
|
1315
|
+
url: ae,
|
|
1316
|
+
formParams: vt,
|
|
1317
|
+
headers: I.headers || {},
|
|
1318
|
+
...Ye,
|
|
1319
|
+
...s
|
|
1320
|
+
}), _t = ee("qrcb", ve) || ve;
|
|
1321
|
+
pe(ve) && Object.keys(ve).length && typeof C == "function" && C(_t);
|
|
1322
|
+
} catch (ve) {
|
|
1323
|
+
typeof P == "function" && P(ve);
|
|
1288
1324
|
} finally {
|
|
1289
|
-
|
|
1325
|
+
j.value = !1;
|
|
1290
1326
|
}
|
|
1291
1327
|
}
|
|
1292
1328
|
};
|
|
1293
|
-
n.options.httpRequest ?
|
|
1294
|
-
},
|
|
1295
|
-
|
|
1329
|
+
n.options.httpRequest ? Xe(n.options.httpRequest) : c.$httpRequest && Xe(c.$httpRequest);
|
|
1330
|
+
}, Te = (s) => new Promise((O, C) => {
|
|
1331
|
+
R.value = { ...R.value, current: 1 }, Me(
|
|
1296
1332
|
{
|
|
1297
|
-
...
|
|
1298
|
-
pageIndex:
|
|
1299
|
-
pageSize:
|
|
1333
|
+
...s || {},
|
|
1334
|
+
pageIndex: R.value.current,
|
|
1335
|
+
pageSize: R.value.pageSize
|
|
1300
1336
|
},
|
|
1301
1337
|
{
|
|
1302
1338
|
success: (P) => {
|
|
1303
|
-
|
|
1339
|
+
Ne(P, ["total", "tableData"]), Object.keys(n.pagination).length && D(), O(P);
|
|
1304
1340
|
},
|
|
1305
1341
|
fail: (P) => {
|
|
1306
1342
|
C(P);
|
|
1307
1343
|
}
|
|
1308
1344
|
}
|
|
1309
1345
|
);
|
|
1310
|
-
}),
|
|
1311
|
-
|
|
1346
|
+
}), pt = () => {
|
|
1347
|
+
Me(
|
|
1312
1348
|
{
|
|
1313
|
-
pageIndex:
|
|
1314
|
-
pageSize:
|
|
1349
|
+
pageIndex: R.value.current,
|
|
1350
|
+
pageSize: R.value.pageSize
|
|
1315
1351
|
},
|
|
1316
1352
|
{
|
|
1317
|
-
success: (
|
|
1318
|
-
|
|
1353
|
+
success: (s) => {
|
|
1354
|
+
Ne(s, ["total", "tableData"]), D(), e("pagination-current-change", R.value);
|
|
1319
1355
|
}
|
|
1320
1356
|
}
|
|
1321
1357
|
);
|
|
1322
|
-
},
|
|
1323
|
-
|
|
1358
|
+
}, mt = () => {
|
|
1359
|
+
Me(
|
|
1324
1360
|
{
|
|
1325
|
-
pageIndex:
|
|
1326
|
-
pageSize:
|
|
1361
|
+
pageIndex: R.value.current,
|
|
1362
|
+
pageSize: R.value.pageSize
|
|
1327
1363
|
},
|
|
1328
1364
|
{
|
|
1329
|
-
success: (
|
|
1330
|
-
|
|
1365
|
+
success: (s) => {
|
|
1366
|
+
Ne(s, ["total", "tableData"]), D();
|
|
1331
1367
|
}
|
|
1332
1368
|
}
|
|
1333
1369
|
);
|
|
1334
|
-
},
|
|
1335
|
-
|
|
1336
|
-
},
|
|
1337
|
-
|
|
1338
|
-
},
|
|
1339
|
-
e("change-table-sort",
|
|
1370
|
+
}, gt = (s) => {
|
|
1371
|
+
R.value = { ...R.value, pageSize: s, current: 1 }, ye.value ? mt() : (D(), e("size-change", R.value, s));
|
|
1372
|
+
}, yt = (s) => {
|
|
1373
|
+
R.value = { ...R.value, current: s }, ye.value ? pt() : (D(), e("pagination-current-change", R.value));
|
|
1374
|
+
}, ht = (s) => {
|
|
1375
|
+
e("change-table-sort", s);
|
|
1340
1376
|
};
|
|
1341
|
-
|
|
1377
|
+
dt("getTableInstantce", () => ({
|
|
1342
1378
|
tableRef: d,
|
|
1343
|
-
toggleSelection: (
|
|
1344
|
-
var
|
|
1345
|
-
|
|
1346
|
-
var
|
|
1347
|
-
(
|
|
1348
|
-
}) : (C = (
|
|
1379
|
+
toggleSelection: (s) => {
|
|
1380
|
+
var O, C;
|
|
1381
|
+
s ? s.forEach((P) => {
|
|
1382
|
+
var I, ae;
|
|
1383
|
+
(ae = (I = d.value) == null ? void 0 : I.toggleRowSelection) == null || ae.call(I, P);
|
|
1384
|
+
}) : (C = (O = d.value) == null ? void 0 : O.clearSelection) == null || C.call(O);
|
|
1349
1385
|
},
|
|
1350
|
-
clearAllSelection: () =>
|
|
1386
|
+
clearAllSelection: () => H(d.value),
|
|
1351
1387
|
refsInstance: () => d.value,
|
|
1352
|
-
httpRequestInstance:
|
|
1388
|
+
httpRequestInstance: Te
|
|
1353
1389
|
}));
|
|
1354
|
-
const
|
|
1355
|
-
httpRequestInstance:
|
|
1356
|
-
getSelectionRows: () =>
|
|
1390
|
+
const We = {
|
|
1391
|
+
httpRequestInstance: Te,
|
|
1392
|
+
getSelectionRows: () => m.value,
|
|
1357
1393
|
clearSelection: () => {
|
|
1358
|
-
var
|
|
1359
|
-
return (
|
|
1394
|
+
var s, O;
|
|
1395
|
+
return (O = (s = d.value) == null ? void 0 : s.clearSelection) == null ? void 0 : O.call(s);
|
|
1360
1396
|
},
|
|
1361
|
-
clearAllSelection: () =>
|
|
1397
|
+
clearAllSelection: () => H(d.value),
|
|
1362
1398
|
refresh: () => {
|
|
1363
|
-
var
|
|
1364
|
-
return (
|
|
1399
|
+
var s, O;
|
|
1400
|
+
return (O = (s = d.value) == null ? void 0 : s.doLayout) == null ? void 0 : O.call(s);
|
|
1365
1401
|
},
|
|
1366
1402
|
// virtual 滚动占位(保持 API 一致,Vue 2 版本无效)
|
|
1367
|
-
scrollToRow: (
|
|
1403
|
+
scrollToRow: (s) => {
|
|
1368
1404
|
}
|
|
1369
1405
|
};
|
|
1370
|
-
return typeof
|
|
1406
|
+
return typeof i == "function" && i(We), {
|
|
1371
1407
|
// refs
|
|
1372
1408
|
tableRef: d,
|
|
1373
1409
|
tbBtnRef: g,
|
|
1374
|
-
headBarRef:
|
|
1410
|
+
headBarRef: a,
|
|
1375
1411
|
paginationRef: f,
|
|
1376
1412
|
tableId: b,
|
|
1377
|
-
tableData:
|
|
1413
|
+
tableData: y,
|
|
1414
|
+
effectiveDataSource: _,
|
|
1378
1415
|
// state
|
|
1379
|
-
loadStatus:
|
|
1380
|
-
paginationConfig:
|
|
1381
|
-
formInstance:
|
|
1416
|
+
loadStatus: we,
|
|
1417
|
+
paginationConfig: R,
|
|
1418
|
+
formInstance: r,
|
|
1382
1419
|
// computeds
|
|
1383
|
-
filteredColumns:
|
|
1384
|
-
tableBindAttrs:
|
|
1385
|
-
hasDefaultSlot:
|
|
1386
|
-
heightType:
|
|
1387
|
-
tabHeight:
|
|
1388
|
-
slotStyles:
|
|
1389
|
-
|
|
1420
|
+
filteredColumns: Pe,
|
|
1421
|
+
tableBindAttrs: He,
|
|
1422
|
+
hasDefaultSlot: A,
|
|
1423
|
+
heightType: x,
|
|
1424
|
+
tabHeight: E,
|
|
1425
|
+
slotStyles: q,
|
|
1426
|
+
slotStyleValue: se,
|
|
1427
|
+
slotClassValue: re,
|
|
1428
|
+
slotState: N,
|
|
1390
1429
|
showPagination: M,
|
|
1391
|
-
containerStyle:
|
|
1392
|
-
paginationStyle:
|
|
1393
|
-
layout:
|
|
1394
|
-
paginationPageSizes:
|
|
1395
|
-
paginationIsSmall:
|
|
1396
|
-
paginationBackground:
|
|
1430
|
+
containerStyle: Q,
|
|
1431
|
+
paginationStyle: Oe,
|
|
1432
|
+
layout: _e,
|
|
1433
|
+
paginationPageSizes: De,
|
|
1434
|
+
paginationIsSmall: qe,
|
|
1435
|
+
paginationBackground: fe,
|
|
1436
|
+
paginationPrevText: Ie,
|
|
1437
|
+
paginationNextText: Re,
|
|
1397
1438
|
// handlers
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
handleIndexChange: ee,
|
|
1439
|
+
handleTableSelectionChange: F,
|
|
1440
|
+
changeTableSort: ht,
|
|
1441
|
+
handleSizeChange: gt,
|
|
1442
|
+
handleIndexChange: yt,
|
|
1403
1443
|
// exposed methods (also accessible via $refs.tableRef.xxx in Vue 2)
|
|
1404
|
-
...
|
|
1444
|
+
...We,
|
|
1405
1445
|
instance: l,
|
|
1406
|
-
resizeObservers:
|
|
1446
|
+
resizeObservers: he
|
|
1407
1447
|
};
|
|
1408
1448
|
}
|
|
1409
1449
|
});
|
|
1410
|
-
var
|
|
1450
|
+
var yn = function() {
|
|
1411
1451
|
var e = this, o = e._self._c;
|
|
1412
|
-
return e._self._setupProxy, o("div", { ref:
|
|
1452
|
+
return e._self._setupProxy, o("div", { ref: "tableContainerEl", staticClass: "table_component", style: e.containerStyle }, [o("div", { staticClass: "table_containers" }, [e.showHeaderBar ? o("div", { ref: "headBarRef", staticClass: "btn-slot", class: e.slotClassValue, style: e.slotStyleValue }, [e.hasDefaultSlot ? o("div", { staticClass: "headerBar", style: { paddingBottom: e.hasDefaultSlot ? "10px" : "0px" } }, [e._t("default")], 2) : e._e()]) : e._e(), o("div", { directives: [{ name: "loading", rawName: "v-loading", value: e.loadStatus, expression: "loadStatus" }], staticClass: "page-loading-con tableContainer", attrs: { "element-loading-background": "rgba(0, 0, 0, 0.03)", "element-loading-text": "努力加载中..." } }, [o("div", { staticClass: "table_inner_containers" }, [e.options.configBtn && e.options.configBtn.length || e.options.leftText ? o("table-btns", { ref: "tbBtnRef", attrs: { instance: { tableRef: e.instance, formInstance: e.formInstance }, "btn-config": e.options.configBtn, "left-text": e.options.leftText } }) : e._e(), o("el-table", e._b({ key: e.tableId, ref: "tableRef", staticClass: "el-dp_tables", staticStyle: { width: "100%" }, attrs: { id: e.tableId, data: e.effectiveDataSource }, on: { "sort-change": e.changeTableSort, "selection-change": e.handleTableSelectionChange }, scopedSlots: e._u([{ key: "empty", fn: function() {
|
|
1413
1453
|
return [o("div", { staticClass: "ant-empty ant-empty-normal" }, [o("div", { staticClass: "ant-empty-image" }, [o("svg", { staticClass: "ant-empty-img-simple", attrs: { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg" } }, [o("g", { attrs: { transform: "translate(0 1)", fill: "none", "fill-rule": "evenodd" } }, [o("ellipse", { staticClass: "ant-empty-img-simple-ellipse", attrs: { cx: "32", cy: "33", rx: "32", ry: "7" } }), o("g", { staticClass: "ant-empty-img-simple-g", attrs: { "fill-rule": "nonzero" } }, [o("path", { attrs: { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" } }), o("path", { staticClass: "ant-empty-img-simple-path", attrs: { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" } })])])])]), o("div", { staticClass: "ant-empty-description" }, [e._v("暂无数据")])])];
|
|
1414
|
-
}, proxy: !0 }]) }, "el-table", e.tableBindAttrs, !1), e._l(e.filteredColumns, function(t,
|
|
1415
|
-
return o("column-item", { key: t.prop || t.key ||
|
|
1454
|
+
}, proxy: !0 }]) }, "el-table", e.tableBindAttrs, !1), e._l(e.filteredColumns, function(t, i) {
|
|
1455
|
+
return o("column-item", { key: t.prop || t.key || i, attrs: { cols: Object.assign({}, t, { columnIndex: i }) }, scopedSlots: e._u([t.scopedSlots && t.scopedSlots.customRender ? { key: t.scopedSlots.customRender, fn: function({ scope: l }) {
|
|
1416
1456
|
return [e._t(
|
|
1417
1457
|
t.scopedSlots.customRender,
|
|
1418
1458
|
null,
|
|
1419
1459
|
{ scope: l },
|
|
1420
1460
|
Object.assign({}, t, {
|
|
1421
|
-
columnIndex:
|
|
1461
|
+
columnIndex: i,
|
|
1422
1462
|
row: l.row,
|
|
1423
1463
|
column: l.column
|
|
1424
1464
|
})
|
|
1425
1465
|
)];
|
|
1426
1466
|
} } : null], null, !0) });
|
|
1427
|
-
}), 1)], 1), e.showPagination ? o("div", { ref: "paginationRef", staticClass: "pagination_page"
|
|
1467
|
+
}), 1)], 1)]), e.showPagination ? o("div", { ref: "paginationRef", staticClass: "pagination_page" }, [o("el-pagination", { staticStyle: { padding: "0", margin: "10px 0", "text-align": "center" }, attrs: { background: e.paginationBackground, size: e.paginationIsSmall ? "small" : e.paginationConfig.size, total: e.paginationConfig.total, "page-size": e.paginationConfig.pageSize, "page-sizes": e.paginationPageSizes, "current-page": e.paginationConfig.current, layout: e.layout, "prev-text": e.paginationPrevText, "next-text": e.paginationNextText }, on: { "update:pageSize": function(t) {
|
|
1428
1468
|
return e.$set(e.paginationConfig, "pageSize", t);
|
|
1429
1469
|
}, "update:page-size": function(t) {
|
|
1430
1470
|
return e.$set(e.paginationConfig, "pageSize", t);
|
|
@@ -1432,20 +1472,20 @@ var Gt = function() {
|
|
|
1432
1472
|
return e.$set(e.paginationConfig, "current", t);
|
|
1433
1473
|
}, "update:current-page": function(t) {
|
|
1434
1474
|
return e.$set(e.paginationConfig, "current", t);
|
|
1435
|
-
}, "size-change": e.handleSizeChange, "current-change": e.handleIndexChange } })], 1) : e._e()])])
|
|
1436
|
-
},
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1475
|
+
}, "size-change": e.handleSizeChange, "current-change": e.handleIndexChange } })], 1) : e._e()])]);
|
|
1476
|
+
}, hn = [], vn = /* @__PURE__ */ ge(
|
|
1477
|
+
gn,
|
|
1478
|
+
yn,
|
|
1479
|
+
hn,
|
|
1440
1480
|
!1,
|
|
1441
1481
|
null,
|
|
1442
|
-
"
|
|
1482
|
+
"8e292dd6"
|
|
1443
1483
|
);
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1446
|
-
n.component(
|
|
1484
|
+
const ke = vn.exports;
|
|
1485
|
+
ke.install = function(n) {
|
|
1486
|
+
n.component(ke.name || "EsTable", ke);
|
|
1447
1487
|
};
|
|
1448
|
-
const
|
|
1488
|
+
const bn = ie({
|
|
1449
1489
|
name: "RenderJsx",
|
|
1450
1490
|
props: {
|
|
1451
1491
|
refs: { type: [Function, Object], default: null },
|
|
@@ -1457,43 +1497,43 @@ const en = se({
|
|
|
1457
1497
|
components: { type: Object, default: () => ({}) }
|
|
1458
1498
|
},
|
|
1459
1499
|
setup(n) {
|
|
1460
|
-
const e = n.refs && typeof n.refs == "object" ? n.refs :
|
|
1500
|
+
const e = n.refs && typeof n.refs == "object" ? n.refs : ze({});
|
|
1461
1501
|
let o = null;
|
|
1462
1502
|
function t() {
|
|
1463
1503
|
if (!o) return;
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1504
|
+
const i = o.componentInstance;
|
|
1505
|
+
i && (e.currentRef = i);
|
|
1466
1506
|
}
|
|
1467
|
-
return
|
|
1468
|
-
const { instance:
|
|
1469
|
-
...
|
|
1507
|
+
return Ue(() => t()), Et(() => t()), () => {
|
|
1508
|
+
const { instance: i } = n, l = {
|
|
1509
|
+
...i,
|
|
1470
1510
|
registerRef: (k, d) => {
|
|
1471
1511
|
d != null && (e[k] = d);
|
|
1472
1512
|
},
|
|
1473
1513
|
getRefs: () => e
|
|
1474
|
-
}, c = n.render,
|
|
1475
|
-
return typeof
|
|
1514
|
+
}, c = n.render, B = c && typeof c == "function" ? c(ue, l, n.components || {}) : "";
|
|
1515
|
+
return typeof B == "string" || typeof B == "number" ? (o = null, ue(
|
|
1476
1516
|
"span",
|
|
1477
1517
|
{
|
|
1478
1518
|
ref: "currentRef"
|
|
1479
1519
|
// Vue 2 的函数式 ref 通过 v-bind 不可直接传,用以下方式赋值
|
|
1480
1520
|
},
|
|
1481
|
-
[String(
|
|
1482
|
-
)) :
|
|
1521
|
+
[String(B)]
|
|
1522
|
+
)) : B && typeof B == "object" && "tag" in B ? B.componentOptions ? (o = B, B) : (o = null, ue("div", [B])) : (o = null, ue("div", [String(B || "")]));
|
|
1483
1523
|
};
|
|
1484
1524
|
}
|
|
1485
|
-
}),
|
|
1486
|
-
var
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1525
|
+
}), _n = null, Cn = null;
|
|
1526
|
+
var Sn = /* @__PURE__ */ ge(
|
|
1527
|
+
bn,
|
|
1528
|
+
_n,
|
|
1529
|
+
Cn,
|
|
1490
1530
|
!1,
|
|
1491
1531
|
null,
|
|
1492
1532
|
null
|
|
1493
1533
|
);
|
|
1494
|
-
const
|
|
1534
|
+
const Bn = Sn.exports, kn = ie({
|
|
1495
1535
|
name: "EsDialog",
|
|
1496
|
-
components: { RenderJsx:
|
|
1536
|
+
components: { RenderJsx: Bn },
|
|
1497
1537
|
inheritAttrs: !1,
|
|
1498
1538
|
props: {
|
|
1499
1539
|
title: { type: String, default: "" },
|
|
@@ -1521,185 +1561,185 @@ const sn = on.exports, rn = se({
|
|
|
1521
1561
|
components: { type: Object, default: () => ({}) }
|
|
1522
1562
|
},
|
|
1523
1563
|
emits: ["update:visible", "closed", "submit"],
|
|
1524
|
-
setup(n, { emit: e, attrs: o, slots: t, expose:
|
|
1525
|
-
var
|
|
1526
|
-
const l =
|
|
1564
|
+
setup(n, { emit: e, attrs: o, slots: t, expose: i }) {
|
|
1565
|
+
var w, A;
|
|
1566
|
+
const l = Ke(), c = z(null), B = ze({}), k = z(!1), d = l, g = (A = (w = ce("$EsPlus", null)) != null ? w : me()) != null ? A : {}, a = (x) => {
|
|
1527
1567
|
if (!x) return !0;
|
|
1528
|
-
const
|
|
1529
|
-
return typeof
|
|
1568
|
+
const E = g.permission;
|
|
1569
|
+
return typeof E == "function" ? E(x) : !0;
|
|
1530
1570
|
}, f = (x) => {
|
|
1531
1571
|
const {
|
|
1532
|
-
icon:
|
|
1533
|
-
click:
|
|
1534
|
-
permissionValue:
|
|
1535
|
-
name:
|
|
1536
|
-
disabled:
|
|
1537
|
-
key:
|
|
1538
|
-
...
|
|
1572
|
+
icon: E,
|
|
1573
|
+
click: Q,
|
|
1574
|
+
permissionValue: q,
|
|
1575
|
+
name: se,
|
|
1576
|
+
disabled: re,
|
|
1577
|
+
key: ne,
|
|
1578
|
+
..._e
|
|
1539
1579
|
} = x;
|
|
1540
|
-
return
|
|
1580
|
+
return _e;
|
|
1541
1581
|
}, p = (x) => {
|
|
1542
|
-
const
|
|
1543
|
-
return typeof
|
|
1582
|
+
const E = x.disabled;
|
|
1583
|
+
return typeof E == "function" ? E() : !!E;
|
|
1544
1584
|
}, b = () => {
|
|
1545
1585
|
setTimeout(() => {
|
|
1546
1586
|
k.value && (k.value = !1);
|
|
1547
1587
|
}, 500);
|
|
1548
|
-
},
|
|
1588
|
+
}, y = () => {
|
|
1549
1589
|
o != null && o.fullscreen || (k.value = !k.value);
|
|
1550
|
-
}, _ =
|
|
1590
|
+
}, _ = S({
|
|
1551
1591
|
get: () => n.visible || !1,
|
|
1552
1592
|
set: (x) => {
|
|
1553
1593
|
e("update:visible", x), x || (e("closed", x), b());
|
|
1554
1594
|
}
|
|
1555
|
-
}),
|
|
1595
|
+
}), L = () => {
|
|
1556
1596
|
_.value = !1, e("closed", !1), b();
|
|
1557
|
-
},
|
|
1597
|
+
}, j = () => {
|
|
1558
1598
|
e("closed", !1), b();
|
|
1559
|
-
},
|
|
1560
|
-
},
|
|
1599
|
+
}, N = () => {
|
|
1600
|
+
}, M = (x) => {
|
|
1561
1601
|
x();
|
|
1562
|
-
},
|
|
1602
|
+
}, V = S(() => ({ ...o })), W = S(() => k.value ? "dialogFull" : n.maxHeight ? "dialogShadow" : "dialogAuto"), U = () => {
|
|
1563
1603
|
const x = typeof window != "undefined" ? window.innerHeight : 800;
|
|
1564
1604
|
return Math.max(x - 135, 200);
|
|
1565
|
-
},
|
|
1566
|
-
const x =
|
|
1605
|
+
}, J = S(() => {
|
|
1606
|
+
const x = U();
|
|
1567
1607
|
return k.value ? { height: x + "px" } : n.maxHeight ? {
|
|
1568
1608
|
maxHeight: typeof n.maxHeight == "number" ? `${n.maxHeight}px` : n.maxHeight
|
|
1569
1609
|
} : { maxHeight: x + "px" };
|
|
1570
|
-
}),
|
|
1571
|
-
renderBodyRefs:
|
|
1572
|
-
renderBodyRefsObject:
|
|
1610
|
+
}), R = S(() => ({
|
|
1611
|
+
renderBodyRefs: B.currentRef,
|
|
1612
|
+
renderBodyRefsObject: B,
|
|
1573
1613
|
lyFormInstance: c,
|
|
1574
1614
|
dialogInstance: d,
|
|
1575
|
-
getRefs: () =>
|
|
1576
|
-
})),
|
|
1577
|
-
const
|
|
1578
|
-
typeof
|
|
1579
|
-
close:
|
|
1580
|
-
getRefs: (
|
|
1615
|
+
getRefs: () => B
|
|
1616
|
+
})), r = (x) => {
|
|
1617
|
+
const E = x.click;
|
|
1618
|
+
typeof E == "function" && E(B.currentRef, {
|
|
1619
|
+
close: L,
|
|
1620
|
+
getRefs: (Q) => Q ? B[Q] || null : B,
|
|
1581
1621
|
dialogInstance: d
|
|
1582
1622
|
});
|
|
1583
1623
|
};
|
|
1584
|
-
|
|
1624
|
+
dt("bodyFormInstance", (x) => {
|
|
1585
1625
|
c.value = x;
|
|
1586
1626
|
});
|
|
1587
|
-
const u =
|
|
1627
|
+
const u = S(() => ({
|
|
1588
1628
|
...n.components
|
|
1589
|
-
})),
|
|
1590
|
-
closed:
|
|
1629
|
+
})), h = {
|
|
1630
|
+
closed: L
|
|
1591
1631
|
};
|
|
1592
|
-
return typeof
|
|
1632
|
+
return typeof i == "function" && i(h), {
|
|
1593
1633
|
// state
|
|
1594
1634
|
dialogVisible: _,
|
|
1595
1635
|
isFullscreen: k,
|
|
1596
1636
|
lyFormInstance: c,
|
|
1597
|
-
renderBodyRefsObject:
|
|
1637
|
+
renderBodyRefsObject: B,
|
|
1598
1638
|
// computeds
|
|
1599
|
-
filteredAttrs:
|
|
1600
|
-
initDialogCls:
|
|
1601
|
-
initDialogHeight:
|
|
1602
|
-
getCurrentInstanceModel:
|
|
1639
|
+
filteredAttrs: V,
|
|
1640
|
+
initDialogCls: W,
|
|
1641
|
+
initDialogHeight: J,
|
|
1642
|
+
getCurrentInstanceModel: R,
|
|
1603
1643
|
dialogComponents: u,
|
|
1604
1644
|
// methods
|
|
1605
|
-
handleClose:
|
|
1606
|
-
handleFullscreen:
|
|
1607
|
-
handleBtnClick:
|
|
1608
|
-
onDialogClose:
|
|
1609
|
-
onDialogClosed:
|
|
1610
|
-
beforeCloseHandler:
|
|
1611
|
-
checkPermission:
|
|
1645
|
+
handleClose: L,
|
|
1646
|
+
handleFullscreen: y,
|
|
1647
|
+
handleBtnClick: r,
|
|
1648
|
+
onDialogClose: j,
|
|
1649
|
+
onDialogClosed: N,
|
|
1650
|
+
beforeCloseHandler: M,
|
|
1651
|
+
checkPermission: a,
|
|
1612
1652
|
filterOptions: f,
|
|
1613
1653
|
getDisabled: p,
|
|
1614
|
-
getCompIcon:
|
|
1654
|
+
getCompIcon: ft,
|
|
1615
1655
|
// exposed
|
|
1616
|
-
...
|
|
1656
|
+
...h
|
|
1617
1657
|
};
|
|
1618
1658
|
}
|
|
1619
1659
|
});
|
|
1620
|
-
var
|
|
1660
|
+
var xn = function() {
|
|
1621
1661
|
var e = this, o = e._self._c;
|
|
1622
1662
|
return e._self._setupProxy, o("div", { staticClass: "dp-dialog_wrapper" }, [o("el-dialog", e._b({ class: ["dg-dialog", e.initDialogCls], attrs: { visible: e.dialogVisible, width: typeof e.width == "number" ? e.width + "px" : e.width, "show-close": !1, fullscreen: e.filteredAttrs && e.filteredAttrs.fullscreen != null ? e.filteredAttrs.fullscreen : e.isFullscreen, "append-to-body": e.appendToBody, "modal-append-to-body": e.modalAppendToBody, "close-on-click-modal": e.closeOnClickModal, "close-on-press-escape": e.closeOnPressEscape, "destroy-on-close": e.destroyOnClose, "before-close": e.beforeCloseHandler }, on: { "update:visible": function(t) {
|
|
1623
1663
|
e.dialogVisible = t;
|
|
1624
1664
|
}, close: e.onDialogClose, closed: e.onDialogClosed }, scopedSlots: e._u([{ key: "title", fn: function() {
|
|
1625
1665
|
return [e.renderHeader && typeof e.renderHeader == "function" ? o("render-jsx", { attrs: { render: e.renderHeader, instance: e.getCurrentInstanceModel } }) : [o("div", { staticClass: "dialog-header" }, [o("span", { staticClass: "dialog-title" }, [e._v(e._s(e.title))]), o("div", { staticClass: "btns" }, [o("i", { directives: [{ name: "show", rawName: "v-show", value: !e.hiddenFullBtn, expression: "!hiddenFullBtn" }], class: e.isFullscreen ? "el-icon-copy-document" : "el-icon-full-screen", on: { click: e.handleFullscreen } }), o("i", { staticClass: "el-icon-close", on: { click: e.handleClose } })])])]];
|
|
1626
1666
|
}, proxy: !0 }, e.isHiddenFooter ? null : { key: "footer", fn: function() {
|
|
1627
|
-
return [e.$slots.footer ? e._t("footer") : o("span", { staticClass: "dialog-footer" }, [e.renderFooter && typeof e.renderFooter == "function" ? o("render-jsx", { attrs: { render: e.renderFooter, instance: e.getCurrentInstanceModel } }) : e.configBtn && e.configBtn.length ? [e._l(e.configBtn, function(t,
|
|
1628
|
-
return [e.checkPermission(t.permissionValue) ? o("el-button", e._b({ key: t.key ||
|
|
1667
|
+
return [e.$slots.footer ? e._t("footer") : o("span", { staticClass: "dialog-footer" }, [e.renderFooter && typeof e.renderFooter == "function" ? o("render-jsx", { attrs: { render: e.renderFooter, instance: e.getCurrentInstanceModel } }) : e.configBtn && e.configBtn.length ? [e._l(e.configBtn, function(t, i) {
|
|
1668
|
+
return [e.checkPermission(t.permissionValue) ? o("el-button", e._b({ key: t.key || i, attrs: { size: "small", icon: e.getCompIcon(t.icon), disabled: e.getDisabled(t) }, on: { click: () => e.handleBtnClick(t) } }, "el-button", e.filterOptions(t), !1), [e._v(" " + e._s(t.name) + " ")]) : e._e()];
|
|
1629
1669
|
})] : e._e()], 2)];
|
|
1630
1670
|
}, proxy: !0 }], null, !0) }, "el-dialog", e.filteredAttrs, !1), [o("div", { staticClass: "dialog_body_layouts", style: e.initDialogHeight }, [e.render && typeof e.render == "function" ? o("render-jsx", { attrs: { refs: e.renderBodyRefsObject, instance: e.getCurrentInstanceModel, render: e.render, components: e.dialogComponents } }) : e._e()], 1)])], 1);
|
|
1631
|
-
},
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1671
|
+
}, Fn = [], In = /* @__PURE__ */ ge(
|
|
1672
|
+
kn,
|
|
1673
|
+
xn,
|
|
1674
|
+
Fn,
|
|
1635
1675
|
!1,
|
|
1636
1676
|
null,
|
|
1637
1677
|
"1f2694c2"
|
|
1638
1678
|
);
|
|
1639
|
-
const
|
|
1679
|
+
const xe = In.exports, Rn = (n) => typeof n == "string" ? document.querySelector(n) || document.body : n instanceof HTMLElement ? n : document.body, On = (n) => {
|
|
1640
1680
|
const e = {}, o = {};
|
|
1641
|
-
return Object.entries(n).forEach(([t,
|
|
1642
|
-
if (t.startsWith("on") && typeof
|
|
1681
|
+
return Object.entries(n).forEach(([t, i]) => {
|
|
1682
|
+
if (t.startsWith("on") && typeof i == "function" && t.length > 2) {
|
|
1643
1683
|
const l = t.slice(2), c = l.charAt(0).toLowerCase() + l.slice(1);
|
|
1644
|
-
e[c] =
|
|
1684
|
+
e[c] = i;
|
|
1645
1685
|
} else
|
|
1646
|
-
o[t] =
|
|
1686
|
+
o[t] = i;
|
|
1647
1687
|
}), { propsData: o, events: e };
|
|
1648
|
-
},
|
|
1649
|
-
const { propsData: t, events:
|
|
1650
|
-
return Object.entries(
|
|
1688
|
+
}, lt = (n, e, o) => {
|
|
1689
|
+
const { propsData: t, events: i } = On(e), l = ct.extend(n), c = new l({ propsData: t });
|
|
1690
|
+
return Object.entries(i).forEach(([k, d]) => {
|
|
1651
1691
|
c.$on(k, d);
|
|
1652
|
-
}), c.$mount(),
|
|
1692
|
+
}), c.$mount(), Rn(o).appendChild(c.$el), c;
|
|
1653
1693
|
};
|
|
1654
|
-
function
|
|
1655
|
-
if (n = n ||
|
|
1694
|
+
function Ee(n, e = {}) {
|
|
1695
|
+
if (n = n || xe, Object.assign({ onlyInstance: !1 }, e).onlyInstance) {
|
|
1656
1696
|
let t = null;
|
|
1657
|
-
const
|
|
1697
|
+
const i = () => {
|
|
1658
1698
|
t && (t.visible = !1, setTimeout(() => {
|
|
1659
1699
|
t && (t.$destroy(), t.$el && t.$el.parentNode && t.$el.parentNode.removeChild(t.$el), t = null);
|
|
1660
1700
|
}, 300));
|
|
1661
1701
|
}, l = (c) => {
|
|
1662
1702
|
c.visible === void 0 && (c.visible = !0);
|
|
1663
|
-
const
|
|
1703
|
+
const B = c.onClosed, k = c.onSubmit;
|
|
1664
1704
|
return c.onClosed = (...d) => {
|
|
1665
|
-
|
|
1666
|
-
}, c.onSubmit = (d =
|
|
1705
|
+
B == null || B(...d), i();
|
|
1706
|
+
}, c.onSubmit = (d = i) => {
|
|
1667
1707
|
k == null || k(d);
|
|
1668
|
-
}, t =
|
|
1708
|
+
}, t = lt(n, c, c.appendTo), t;
|
|
1669
1709
|
};
|
|
1670
|
-
return l.close =
|
|
1710
|
+
return l.close = i, l;
|
|
1671
1711
|
} else {
|
|
1672
1712
|
let t = null;
|
|
1673
|
-
const
|
|
1713
|
+
const i = () => {
|
|
1674
1714
|
t && (t.visible = !1);
|
|
1675
1715
|
}, l = () => {
|
|
1676
1716
|
t && (t.$destroy(), t.$el && t.$el.parentNode && t.$el.parentNode.removeChild(t.$el), t = null);
|
|
1677
|
-
}, c = (
|
|
1717
|
+
}, c = (B) => {
|
|
1678
1718
|
if (t)
|
|
1679
|
-
return Object.entries(
|
|
1680
|
-
|
|
1719
|
+
return Object.entries(B).forEach(([a, f]) => {
|
|
1720
|
+
a.startsWith("on") || (t[a] = f);
|
|
1681
1721
|
}), t.visible = !0, t;
|
|
1682
1722
|
const k = {
|
|
1683
1723
|
visible: !0,
|
|
1684
1724
|
width: "50%",
|
|
1685
1725
|
destroyOnClose: !0,
|
|
1686
|
-
...
|
|
1726
|
+
...B
|
|
1687
1727
|
}, d = k.onClosed, g = k.onSubmit;
|
|
1688
1728
|
return k.onClosed = () => {
|
|
1689
|
-
d == null || d(),
|
|
1690
|
-
}, k.onSubmit = (
|
|
1691
|
-
g == null || g(
|
|
1692
|
-
}, t =
|
|
1729
|
+
d == null || d(), i();
|
|
1730
|
+
}, k.onSubmit = (a = i) => {
|
|
1731
|
+
g == null || g(a);
|
|
1732
|
+
}, t = lt(n, k, k.appendTo), t;
|
|
1693
1733
|
};
|
|
1694
|
-
return c.close =
|
|
1734
|
+
return c.close = i, c.destroy = l, c;
|
|
1695
1735
|
}
|
|
1696
1736
|
}
|
|
1697
|
-
|
|
1698
|
-
n.component(
|
|
1737
|
+
xe.install = function(n) {
|
|
1738
|
+
n.component(xe.name || "EsDialog", xe), n.prototype.$useDialog = Ee;
|
|
1699
1739
|
};
|
|
1700
|
-
const
|
|
1740
|
+
const wn = ie({
|
|
1701
1741
|
name: "EsCrudPage",
|
|
1702
|
-
components: { EsForm:
|
|
1742
|
+
components: { EsForm: be, EsTable: ke },
|
|
1703
1743
|
inheritAttrs: !1,
|
|
1704
1744
|
props: {
|
|
1705
1745
|
schema: { type: Object, required: !0 },
|
|
@@ -1723,103 +1763,103 @@ const fn = se({
|
|
|
1723
1763
|
"dialog-open"
|
|
1724
1764
|
],
|
|
1725
1765
|
setup(n, { emit: e, expose: o }) {
|
|
1726
|
-
const t = z(null),
|
|
1727
|
-
|
|
1766
|
+
const t = z(null), i = z(null), l = z([]), c = ze({});
|
|
1767
|
+
de(
|
|
1728
1768
|
() => n.schema.formItems,
|
|
1729
|
-
(
|
|
1730
|
-
|
|
1769
|
+
(r) => {
|
|
1770
|
+
r && r.forEach((u) => {
|
|
1731
1771
|
u.prop && !(u.prop in c) && (c[u.prop] = "");
|
|
1732
1772
|
});
|
|
1733
1773
|
},
|
|
1734
1774
|
{ immediate: !0 }
|
|
1735
1775
|
);
|
|
1736
|
-
const
|
|
1776
|
+
const B = z({
|
|
1737
1777
|
current: 1,
|
|
1738
1778
|
pageSize: 10,
|
|
1739
1779
|
total: 0,
|
|
1740
1780
|
...n.schema.pagination || {}
|
|
1741
|
-
}), k =
|
|
1742
|
-
var
|
|
1781
|
+
}), k = S(() => {
|
|
1782
|
+
var w, A;
|
|
1743
1783
|
if (n.schema.dialogs) return n.schema.dialogs;
|
|
1744
|
-
if (!((
|
|
1745
|
-
const
|
|
1746
|
-
width: ((
|
|
1784
|
+
if (!((w = n.schema.dialogFormItems) != null && w.length)) return {};
|
|
1785
|
+
const r = {
|
|
1786
|
+
width: ((A = n.schema.dialogOptions) == null ? void 0 : A.width) || "600px",
|
|
1747
1787
|
formItems: n.schema.dialogFormItems,
|
|
1748
1788
|
...n.schema.dialogOptions || {}
|
|
1749
|
-
}, u = {},
|
|
1750
|
-
return
|
|
1751
|
-
}), d =
|
|
1789
|
+
}, u = {}, h = n.schema.actions || ["add", "edit", "delete"];
|
|
1790
|
+
return h.includes("add") && (u.add = { ...r, title: "新增" }), h.includes("edit") && (u.edit = { ...r, title: "编辑" }), h.includes("view") && (u.view = { ...r, title: "查看", isHiddenFooter: !0 }), u;
|
|
1791
|
+
}), d = S(() => {
|
|
1752
1792
|
if (n.schema.toolbarBtns) return n.schema.toolbarBtns;
|
|
1753
1793
|
if (n.schema.dialogs || n.schema.operationColumn !== void 0) return [];
|
|
1754
|
-
const
|
|
1755
|
-
return
|
|
1794
|
+
const r = n.schema.actions || ["add", "edit", "delete"], u = [];
|
|
1795
|
+
return r.includes("add") && u.push({
|
|
1756
1796
|
name: "新增",
|
|
1757
1797
|
type: "primary",
|
|
1758
1798
|
key: "add",
|
|
1759
1799
|
icon: "Plus",
|
|
1760
1800
|
dialogKey: "add"
|
|
1761
|
-
}),
|
|
1801
|
+
}), r.includes("export") && u.push({
|
|
1762
1802
|
name: "导出",
|
|
1763
1803
|
key: "export",
|
|
1764
1804
|
icon: "Download",
|
|
1765
1805
|
actionType: "export"
|
|
1766
|
-
}),
|
|
1806
|
+
}), r.includes("import") && u.push({
|
|
1767
1807
|
name: "导入",
|
|
1768
1808
|
key: "import",
|
|
1769
1809
|
icon: "Upload",
|
|
1770
1810
|
actionType: "import"
|
|
1771
1811
|
}), u;
|
|
1772
|
-
}), g =
|
|
1812
|
+
}), g = S(
|
|
1773
1813
|
() => {
|
|
1774
|
-
var
|
|
1814
|
+
var A;
|
|
1775
1815
|
if (n.schema.operationColumn !== void 0) return n.schema.operationColumn;
|
|
1776
|
-
const
|
|
1777
|
-
if ((
|
|
1816
|
+
const r = n.schema.actions || ["add", "edit", "delete"];
|
|
1817
|
+
if ((A = n.schema.columns) == null ? void 0 : A.some(
|
|
1778
1818
|
(x) => x.prop === "action" || x.prop === "operate" || x.btns
|
|
1779
1819
|
)) return;
|
|
1780
|
-
if (
|
|
1781
|
-
const
|
|
1782
|
-
return
|
|
1820
|
+
if (r.filter((x) => ["edit", "delete", "view"].includes(x)).length === 0) return !1;
|
|
1821
|
+
const w = [];
|
|
1822
|
+
return r.includes("view") && w.push({ name: "查看", type: "primary", key: "view", dialogKey: "view" }), r.includes("edit") && w.push({ name: "编辑", type: "primary", key: "edit", dialogKey: "edit" }), r.includes("delete") && w.push({
|
|
1783
1823
|
name: "删除",
|
|
1784
1824
|
type: "danger",
|
|
1785
1825
|
key: "delete",
|
|
1786
1826
|
confirm: "确定删除该条数据吗?"
|
|
1787
1827
|
}), {
|
|
1788
1828
|
label: "操作",
|
|
1789
|
-
width:
|
|
1829
|
+
width: w.length * 80 + 20,
|
|
1790
1830
|
fixed: "right",
|
|
1791
|
-
btns:
|
|
1831
|
+
btns: w
|
|
1792
1832
|
};
|
|
1793
1833
|
}
|
|
1794
|
-
),
|
|
1834
|
+
), a = S(() => {
|
|
1795
1835
|
if (n.schema.queryBtns) return n.schema.queryBtns;
|
|
1796
|
-
const
|
|
1836
|
+
const r = [
|
|
1797
1837
|
{ name: "查询", type: "primary", key: "query", triggerEvent: !0 },
|
|
1798
1838
|
{ name: "重置", key: "rest", triggerEvent: !0 }
|
|
1799
|
-
], u = d.value.map((
|
|
1800
|
-
const
|
|
1801
|
-
return
|
|
1839
|
+
], u = d.value.map((h) => {
|
|
1840
|
+
const w = { ...h };
|
|
1841
|
+
return w.click || (w.click = () => _(h)), w;
|
|
1802
1842
|
});
|
|
1803
|
-
return [...
|
|
1804
|
-
}), f =
|
|
1805
|
-
const
|
|
1806
|
-
if (u === !1 || u === void 0) return
|
|
1807
|
-
const
|
|
1808
|
-
name:
|
|
1809
|
-
type:
|
|
1810
|
-
permissionValue:
|
|
1811
|
-
clickEvent: (
|
|
1843
|
+
return [...r, ...u];
|
|
1844
|
+
}), f = S(() => {
|
|
1845
|
+
const r = [...n.schema.columns || []], u = g.value;
|
|
1846
|
+
if (u === !1 || u === void 0) return r;
|
|
1847
|
+
const h = u.btns.map((w) => ({
|
|
1848
|
+
name: w.name,
|
|
1849
|
+
type: w.type,
|
|
1850
|
+
permissionValue: w.permissionValue,
|
|
1851
|
+
clickEvent: (A) => L(w, A)
|
|
1812
1852
|
}));
|
|
1813
|
-
return
|
|
1853
|
+
return r.push({
|
|
1814
1854
|
prop: "operate",
|
|
1815
1855
|
label: u.label || "操作",
|
|
1816
|
-
width: u.width ||
|
|
1856
|
+
width: u.width || h.length * 80 + 20,
|
|
1817
1857
|
fixed: u.fixed || "right",
|
|
1818
|
-
btns:
|
|
1819
|
-
}),
|
|
1820
|
-
}), p =
|
|
1821
|
-
var
|
|
1822
|
-
return (
|
|
1858
|
+
btns: h
|
|
1859
|
+
}), r;
|
|
1860
|
+
}), p = S(() => {
|
|
1861
|
+
var r;
|
|
1862
|
+
return (r = n.schema.tableBtns) != null && r.length ? n.schema.tableBtns.map((u) => ({
|
|
1823
1863
|
name: u.name,
|
|
1824
1864
|
type: u.type,
|
|
1825
1865
|
size: u.size || "small",
|
|
@@ -1830,206 +1870,206 @@ const fn = se({
|
|
|
1830
1870
|
disabled: u.disabled,
|
|
1831
1871
|
click: () => _(u)
|
|
1832
1872
|
})) : [];
|
|
1833
|
-
}), b =
|
|
1834
|
-
const
|
|
1873
|
+
}), b = S(() => {
|
|
1874
|
+
const r = {
|
|
1835
1875
|
border: !0,
|
|
1836
1876
|
isInitRun: n.autoLoad,
|
|
1837
1877
|
...n.schema.tableOptions || {}
|
|
1838
1878
|
};
|
|
1839
|
-
n.httpRequest && (
|
|
1879
|
+
n.httpRequest && (r.httpRequest = n.httpRequest);
|
|
1840
1880
|
const u = p.value;
|
|
1841
1881
|
if (u.length > 0) {
|
|
1842
|
-
const
|
|
1843
|
-
|
|
1882
|
+
const h = r.configBtn || [];
|
|
1883
|
+
r.configBtn = [...h, ...u];
|
|
1844
1884
|
}
|
|
1845
|
-
return
|
|
1846
|
-
}),
|
|
1847
|
-
const
|
|
1848
|
-
if (
|
|
1885
|
+
return r;
|
|
1886
|
+
}), y = S(() => {
|
|
1887
|
+
const r = n.schema.formLayout;
|
|
1888
|
+
if (r)
|
|
1849
1889
|
return {
|
|
1850
1890
|
rowLayProps: { gutter: 16 },
|
|
1851
1891
|
formLayProps: {
|
|
1852
|
-
labelBtnWidth:
|
|
1853
|
-
...
|
|
1892
|
+
labelBtnWidth: r.labelWidth,
|
|
1893
|
+
...r.minFoldRows ? { minFoldRows: r.minFoldRows } : {}
|
|
1854
1894
|
}
|
|
1855
1895
|
};
|
|
1856
1896
|
});
|
|
1857
|
-
async function _(
|
|
1858
|
-
const u =
|
|
1859
|
-
if (
|
|
1860
|
-
const
|
|
1897
|
+
async function _(r) {
|
|
1898
|
+
const u = r.key || r.actionType || "";
|
|
1899
|
+
if (r.confirm) {
|
|
1900
|
+
const h = typeof r.confirm == "string" ? r.confirm : "确定执行此操作吗?";
|
|
1861
1901
|
try {
|
|
1862
|
-
await
|
|
1863
|
-
} catch (
|
|
1902
|
+
await ot.confirm(h, "提示", { type: "warning" });
|
|
1903
|
+
} catch (w) {
|
|
1864
1904
|
return;
|
|
1865
1905
|
}
|
|
1866
1906
|
}
|
|
1867
|
-
if (
|
|
1868
|
-
u === "add" && e("add"),
|
|
1907
|
+
if (r.dialogKey) {
|
|
1908
|
+
u === "add" && e("add"), N(r.dialogKey);
|
|
1869
1909
|
return;
|
|
1870
1910
|
}
|
|
1871
|
-
u === "export" ||
|
|
1911
|
+
u === "export" || r.actionType === "export" ? e("export", { ...c }) : u === "add" && e("add"), e("btn-click", u, { ...c });
|
|
1872
1912
|
}
|
|
1873
|
-
async function
|
|
1874
|
-
const
|
|
1875
|
-
if (
|
|
1876
|
-
const
|
|
1913
|
+
async function L(r, u) {
|
|
1914
|
+
const h = r.key || "";
|
|
1915
|
+
if (r.confirm) {
|
|
1916
|
+
const w = typeof r.confirm == "string" ? r.confirm : "确定执行此操作吗?";
|
|
1877
1917
|
try {
|
|
1878
|
-
await
|
|
1879
|
-
} catch (
|
|
1918
|
+
await ot.confirm(w, "提示", { type: "warning" });
|
|
1919
|
+
} catch (A) {
|
|
1880
1920
|
return;
|
|
1881
1921
|
}
|
|
1882
1922
|
}
|
|
1883
|
-
if (
|
|
1884
|
-
|
|
1923
|
+
if (r.click) {
|
|
1924
|
+
r.click(u, { refresh: U, getSelectedRows: J, openDialog: N });
|
|
1885
1925
|
return;
|
|
1886
1926
|
}
|
|
1887
|
-
if (
|
|
1888
|
-
|
|
1927
|
+
if (r.dialogKey) {
|
|
1928
|
+
N(r.dialogKey, u);
|
|
1889
1929
|
return;
|
|
1890
1930
|
}
|
|
1891
|
-
|
|
1931
|
+
h === "edit" ? e("edit", u) : h === "delete" ? e("delete", u) : h === "view" && e("view", u), e("btn-click", h, u);
|
|
1892
1932
|
}
|
|
1893
|
-
const
|
|
1894
|
-
function
|
|
1895
|
-
var
|
|
1896
|
-
const
|
|
1897
|
-
if (!
|
|
1898
|
-
e("dialog-open",
|
|
1899
|
-
const
|
|
1900
|
-
|
|
1901
|
-
const
|
|
1902
|
-
|
|
1903
|
-
var
|
|
1904
|
-
|
|
1933
|
+
const j = /* @__PURE__ */ new Map();
|
|
1934
|
+
function N(r, u) {
|
|
1935
|
+
var Q;
|
|
1936
|
+
const h = k.value[r];
|
|
1937
|
+
if (!h) return;
|
|
1938
|
+
e("dialog-open", r, u);
|
|
1939
|
+
const w = Ee();
|
|
1940
|
+
j.set(r, w);
|
|
1941
|
+
const A = ze({});
|
|
1942
|
+
h.formItems && h.formItems.forEach((q) => {
|
|
1943
|
+
var se;
|
|
1944
|
+
q.prop && (A[q.prop] = (se = u == null ? void 0 : u[q.prop]) != null ? se : "");
|
|
1905
1945
|
});
|
|
1906
|
-
const x = typeof
|
|
1907
|
-
(
|
|
1908
|
-
const
|
|
1909
|
-
|
|
1946
|
+
const x = typeof h.title == "function" ? h.title(u) : h.title || "";
|
|
1947
|
+
(Q = h.onOpen) == null || Q.call(h, u);
|
|
1948
|
+
const E = V(r, h, A, u || {});
|
|
1949
|
+
w({
|
|
1910
1950
|
title: x,
|
|
1911
|
-
width:
|
|
1912
|
-
isDraggable:
|
|
1913
|
-
maxHeight:
|
|
1914
|
-
fullscreen:
|
|
1915
|
-
isHiddenFooter:
|
|
1951
|
+
width: h.width || "600px",
|
|
1952
|
+
isDraggable: h.isDraggable,
|
|
1953
|
+
maxHeight: h.maxHeight,
|
|
1954
|
+
fullscreen: h.fullscreen,
|
|
1955
|
+
isHiddenFooter: h.isHiddenFooter,
|
|
1916
1956
|
// 用户自定义 render
|
|
1917
|
-
render:
|
|
1957
|
+
render: h.render ? (q, se) => h.render(q, {
|
|
1918
1958
|
row: u || {},
|
|
1919
|
-
model:
|
|
1920
|
-
registerRef:
|
|
1921
|
-
close: () =>
|
|
1922
|
-
refresh:
|
|
1923
|
-
}) :
|
|
1924
|
-
const
|
|
1959
|
+
model: A,
|
|
1960
|
+
registerRef: se.registerRef,
|
|
1961
|
+
close: () => M(r),
|
|
1962
|
+
refresh: U
|
|
1963
|
+
}) : h.formItems ? (q, { registerRef: se }) => {
|
|
1964
|
+
const re = q(be, {
|
|
1925
1965
|
props: {
|
|
1926
|
-
model:
|
|
1927
|
-
formItemList:
|
|
1966
|
+
model: A,
|
|
1967
|
+
formItemList: h.formItems,
|
|
1928
1968
|
layoutFormProps: {
|
|
1929
1969
|
rowLayProps: { gutter: 16 },
|
|
1930
1970
|
formLayProps: {
|
|
1931
1971
|
isBtnHidden: !0,
|
|
1932
|
-
...
|
|
1972
|
+
...h.formLayout || {}
|
|
1933
1973
|
}
|
|
1934
1974
|
}
|
|
1935
1975
|
},
|
|
1936
1976
|
// Vue 2 函数式 ref:通过 RenderJsx 暴露的 registerRef 注册
|
|
1937
1977
|
ref: "dialogForm"
|
|
1938
1978
|
});
|
|
1939
|
-
return
|
|
1940
|
-
|
|
1941
|
-
}),
|
|
1979
|
+
return re && re.data && (re.data.hook = re.data.hook || {}, re.data.hook.insert = (ne) => {
|
|
1980
|
+
ne.componentInstance && se("dialogForm", ne.componentInstance);
|
|
1981
|
+
}), re;
|
|
1942
1982
|
} : void 0,
|
|
1943
|
-
configBtn:
|
|
1983
|
+
configBtn: E,
|
|
1944
1984
|
// useDialog 的 onClosed 通过 extractEventHandlers 转为 'closed' 事件
|
|
1945
1985
|
onClosed: () => {
|
|
1946
|
-
var
|
|
1947
|
-
|
|
1986
|
+
var q;
|
|
1987
|
+
j.delete(r), (q = h.onClose) == null || q.call(h);
|
|
1948
1988
|
}
|
|
1949
1989
|
});
|
|
1950
1990
|
}
|
|
1951
|
-
function
|
|
1952
|
-
const u =
|
|
1953
|
-
u && (u.close(),
|
|
1991
|
+
function M(r) {
|
|
1992
|
+
const u = j.get(r);
|
|
1993
|
+
u && (u.close(), j.delete(r));
|
|
1954
1994
|
}
|
|
1955
|
-
function
|
|
1995
|
+
function V(r, u, h, w) {
|
|
1956
1996
|
if (!u.isHiddenFooter)
|
|
1957
|
-
return u.configBtn ? u.configBtn.map((
|
|
1958
|
-
...
|
|
1959
|
-
click: (x, { close:
|
|
1960
|
-
e("dialog-cancel",
|
|
1997
|
+
return u.configBtn ? u.configBtn.map((A) => A.action === "cancel" ? {
|
|
1998
|
+
...A,
|
|
1999
|
+
click: (x, { close: E }) => {
|
|
2000
|
+
e("dialog-cancel", r), E();
|
|
1961
2001
|
}
|
|
1962
|
-
} :
|
|
1963
|
-
...
|
|
1964
|
-
click: async (x, { close:
|
|
1965
|
-
await
|
|
2002
|
+
} : A.action === "confirm" ? {
|
|
2003
|
+
...A,
|
|
2004
|
+
click: async (x, { close: E, getRefs: Q }) => {
|
|
2005
|
+
await W(r, u, h, w, E, Q);
|
|
1966
2006
|
}
|
|
1967
|
-
} :
|
|
2007
|
+
} : A) : [
|
|
1968
2008
|
{
|
|
1969
2009
|
name: "取消",
|
|
1970
|
-
click: (
|
|
1971
|
-
e("dialog-cancel",
|
|
2010
|
+
click: (A, { close: x }) => {
|
|
2011
|
+
e("dialog-cancel", r), x();
|
|
1972
2012
|
}
|
|
1973
2013
|
},
|
|
1974
2014
|
{
|
|
1975
2015
|
name: "确定",
|
|
1976
2016
|
type: "primary",
|
|
1977
|
-
click: async (
|
|
1978
|
-
await
|
|
2017
|
+
click: async (A, { close: x, getRefs: E }) => {
|
|
2018
|
+
await W(r, u, h, w, x, E);
|
|
1979
2019
|
}
|
|
1980
2020
|
}
|
|
1981
2021
|
];
|
|
1982
2022
|
}
|
|
1983
|
-
async function
|
|
1984
|
-
var
|
|
1985
|
-
if ((
|
|
1986
|
-
const
|
|
1987
|
-
|
|
2023
|
+
async function W(r, u, h, w, A, x) {
|
|
2024
|
+
var Q;
|
|
2025
|
+
if ((Q = u.formItems) != null && Q.length) {
|
|
2026
|
+
const q = x("dialogForm");
|
|
2027
|
+
q != null && q.validate && await q.validate();
|
|
1988
2028
|
}
|
|
1989
|
-
const
|
|
2029
|
+
const E = { close: A, refresh: U, getRefs: x, row: w };
|
|
1990
2030
|
if (u.onConfirm)
|
|
1991
|
-
await u.onConfirm(
|
|
2031
|
+
await u.onConfirm(h, E);
|
|
1992
2032
|
else {
|
|
1993
|
-
const
|
|
1994
|
-
e("btn-click",
|
|
2033
|
+
const q = r === "add" ? "add-confirm" : r === "edit" ? "edit-confirm" : `${r}-confirm`;
|
|
2034
|
+
e("btn-click", q, h), A(), U();
|
|
1995
2035
|
}
|
|
1996
|
-
e("dialog-confirm",
|
|
2036
|
+
e("dialog-confirm", r, h);
|
|
1997
2037
|
}
|
|
1998
|
-
function
|
|
1999
|
-
var
|
|
2000
|
-
(u = (
|
|
2038
|
+
function U() {
|
|
2039
|
+
var r, u;
|
|
2040
|
+
(u = (r = t.value) == null ? void 0 : r.httpRequestInstance) == null || u.call(r);
|
|
2001
2041
|
}
|
|
2002
|
-
function
|
|
2003
|
-
var
|
|
2004
|
-
return ((u = (
|
|
2042
|
+
function J() {
|
|
2043
|
+
var r, u;
|
|
2044
|
+
return ((u = (r = t.value) == null ? void 0 : r.getSelectionRows) == null ? void 0 : u.call(r)) || [];
|
|
2005
2045
|
}
|
|
2006
|
-
const
|
|
2007
|
-
refresh:
|
|
2008
|
-
getSelectedRows:
|
|
2046
|
+
const R = {
|
|
2047
|
+
refresh: U,
|
|
2048
|
+
getSelectedRows: J,
|
|
2009
2049
|
tableRef: t,
|
|
2010
|
-
formRef:
|
|
2050
|
+
formRef: i,
|
|
2011
2051
|
queryModel: c,
|
|
2012
|
-
openDialog:
|
|
2013
|
-
closeDialog:
|
|
2052
|
+
openDialog: N,
|
|
2053
|
+
closeDialog: M
|
|
2014
2054
|
};
|
|
2015
|
-
return typeof o == "function" && o(
|
|
2055
|
+
return typeof o == "function" && o(R), {
|
|
2016
2056
|
// refs
|
|
2017
2057
|
tableRef: t,
|
|
2018
|
-
formRef:
|
|
2058
|
+
formRef: i,
|
|
2019
2059
|
tableData: l,
|
|
2020
2060
|
queryModel: c,
|
|
2021
|
-
paginationState:
|
|
2061
|
+
paginationState: B,
|
|
2022
2062
|
// computeds
|
|
2023
2063
|
mergedColumns: f,
|
|
2024
2064
|
mergedOptions: b,
|
|
2025
|
-
mergedFormBtns:
|
|
2026
|
-
formLayoutProps:
|
|
2065
|
+
mergedFormBtns: a,
|
|
2066
|
+
formLayoutProps: y,
|
|
2027
2067
|
// exposed
|
|
2028
|
-
...
|
|
2068
|
+
...R
|
|
2029
2069
|
};
|
|
2030
2070
|
}
|
|
2031
2071
|
});
|
|
2032
|
-
var
|
|
2072
|
+
var Pn = function() {
|
|
2033
2073
|
var e = this, o = e._self._c;
|
|
2034
2074
|
return e._self._setupProxy, o("div", { staticClass: "es-crud-page" }, [o("es-table", e._b({ ref: "tableRef", attrs: { columns: e.mergedColumns, options: e.mergedOptions, "data-source": e.tableData, pagination: e.paginationState }, on: { "update:dataSource": function(t) {
|
|
2035
2075
|
e.tableData = t;
|
|
@@ -2037,65 +2077,69 @@ var pn = function() {
|
|
|
2037
2077
|
e.tableData = t;
|
|
2038
2078
|
}, "update:pagination": function(t) {
|
|
2039
2079
|
e.paginationState = t;
|
|
2040
|
-
} }, scopedSlots: e._u([e._l(e.$slots, function(t,
|
|
2041
|
-
return { key:
|
|
2042
|
-
return [e._t(
|
|
2080
|
+
} }, scopedSlots: e._u([e._l(e.$slots, function(t, i) {
|
|
2081
|
+
return { key: i, fn: function(l) {
|
|
2082
|
+
return [e._t(i, null, null, l || {})];
|
|
2043
2083
|
} };
|
|
2044
2084
|
})], null, !0) }, "es-table", e.$attrs, !1), [e.schema.formItems && e.schema.formItems.length ? o("es-form", { ref: "formRef", attrs: { model: e.queryModel, "form-item-list": e.schema.formItems, "config-btn": e.mergedFormBtns, "layout-form-props": e.formLayoutProps } }) : e._e()], 1)], 1);
|
|
2045
|
-
},
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2085
|
+
}, $n = [], Hn = /* @__PURE__ */ ge(
|
|
2086
|
+
wn,
|
|
2087
|
+
Pn,
|
|
2088
|
+
$n,
|
|
2049
2089
|
!1,
|
|
2050
2090
|
null,
|
|
2051
|
-
"
|
|
2091
|
+
"ad1d1cb8"
|
|
2052
2092
|
);
|
|
2053
|
-
const
|
|
2054
|
-
|
|
2093
|
+
const Le = Hn.exports;
|
|
2094
|
+
Le.install = function(n) {
|
|
2055
2095
|
n.component(
|
|
2056
|
-
|
|
2057
|
-
|
|
2096
|
+
Le.name || "EsCrudPage",
|
|
2097
|
+
Le
|
|
2058
2098
|
);
|
|
2059
2099
|
};
|
|
2060
|
-
const
|
|
2100
|
+
const Tn = [be, ke, xe, Le], An = (n) => {
|
|
2061
2101
|
const e = { ...n };
|
|
2062
2102
|
for (const o of ["EsTable", "EsForm", "EsDialog"]) {
|
|
2063
2103
|
const t = e[o];
|
|
2064
2104
|
if (!t || typeof t != "object") continue;
|
|
2065
|
-
const
|
|
2066
|
-
if (
|
|
2067
|
-
const { methods: c, ...
|
|
2068
|
-
e[o] = { ...
|
|
2105
|
+
const i = t.methods;
|
|
2106
|
+
if (i && typeof i == "object") {
|
|
2107
|
+
const { methods: c, ...B } = t;
|
|
2108
|
+
e[o] = { ...i, ...B };
|
|
2069
2109
|
}
|
|
2070
2110
|
const l = e[o];
|
|
2071
2111
|
typeof l.configQueryfieldOutput == "function" && typeof l.configQueryFieldOutput != "function" && (l.configQueryFieldOutput = l.configQueryfieldOutput);
|
|
2072
2112
|
}
|
|
2073
2113
|
return e;
|
|
2074
|
-
},
|
|
2075
|
-
const o =
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2114
|
+
}, Ln = (n, e = {}) => {
|
|
2115
|
+
const o = n.__composition_api_installed__ === !0;
|
|
2116
|
+
ut ? o && console.warn(
|
|
2117
|
+
'[@es-plus/vue2] Vue 2.7+ detected together with @vue/composition-api plugin already installed. This causes setup() to run twice (once natively, once via the polyfill\'s data() wrapper) and will produce "setup binding ... already declared" warnings. Remove `Vue.use(VueCompositionAPI)` from your main.js — Vue 2.7 has Composition API natively.'
|
|
2118
|
+
) : !o && st && n.use(st);
|
|
2119
|
+
const t = An(e);
|
|
2120
|
+
Pt(t), t.skipComponentRegistration || Tn.forEach((i) => {
|
|
2121
|
+
const l = i.name;
|
|
2122
|
+
l && n.component(l, i);
|
|
2123
|
+
}), t.globalProperties !== !1 && (n.prototype.$useDialog = Ee), n.mixin({
|
|
2080
2124
|
provide: {
|
|
2081
2125
|
$EsPlus: {
|
|
2082
|
-
useDialog:
|
|
2083
|
-
...
|
|
2126
|
+
useDialog: Ee,
|
|
2127
|
+
...t
|
|
2084
2128
|
}
|
|
2085
2129
|
}
|
|
2086
2130
|
});
|
|
2087
|
-
},
|
|
2088
|
-
version: "1.0
|
|
2089
|
-
install:
|
|
2131
|
+
}, Dn = {
|
|
2132
|
+
version: "1.1.0",
|
|
2133
|
+
install: Ln
|
|
2090
2134
|
};
|
|
2091
2135
|
export {
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2136
|
+
Le as EsCrudPage,
|
|
2137
|
+
xe as EsDialog,
|
|
2138
|
+
be as EsForm,
|
|
2139
|
+
ke as EsTable,
|
|
2140
|
+
Mn as configureEsPlus,
|
|
2141
|
+
Dn as default,
|
|
2142
|
+
Ln as install,
|
|
2143
|
+
Ee as useDialog
|
|
2100
2144
|
};
|
|
2101
2145
|
//# sourceMappingURL=es-plus-vue2.js.map
|