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