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