dynamicformdjx 0.5.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +173 -2
- package/dist/elementPlus/EleZealCard.d.ts +9 -0
- package/dist/elementPlus/EleZealTableTool.d.ts +99 -8
- package/dist/elementPlus/hooks/useZealTool.d.ts +7 -0
- package/dist/elementPlus/index.cjs +1 -1
- package/dist/elementPlus/index.d.ts +6 -4
- package/dist/elementPlus/index.mjs +599 -485
- package/dist/hooks/useTool.d.ts +1 -1
- package/dist/index-BAqRAwDC.cjs +1 -0
- package/dist/index-Bsj3F9SM.js +213 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +495 -191
- package/dist/naiveUi/NaiZealCard.d.ts +9 -0
- package/dist/naiveUi/NaiZealTableTool.d.ts +54 -1
- package/dist/naiveUi/hooks/useZealTool.d.ts +7 -0
- package/dist/naiveUi/index.cjs +1 -1
- package/dist/naiveUi/index.d.ts +6 -4
- package/dist/naiveUi/index.mjs +469 -368
- package/dist/origin/LoadedScroll.d.ts +189 -0
- package/dist/types/index.d.ts +21 -1
- package/dist/types/slots.d.ts +8 -5
- package/dist/utils/tools.d.ts +5 -2
- package/dist/vite-env.d.ts +6 -0
- package/package.json +2 -1
- package/dist/index-BRJXkpNJ.cjs +0 -1
- package/dist/index-a2ON2stt.js +0 -180
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { ElInput as
|
|
4
|
-
const il = /* @__PURE__ */
|
|
1
|
+
import { t as N, r as $, f as Q, p as oe, s as ue, c as se, d as ie, k as de, h as ce, b as fe } from "../index-Bsj3F9SM.js";
|
|
2
|
+
import { defineComponent as A, ref as I, watch as _, toRaw as P, createVNode as r, createTextVNode as F, Fragment as O, nextTick as X, isVNode as M, computed as R, h as g, mergeProps as E, reactive as ye, shallowReactive as me, onMounted as be, toRef as pe, withDirectives as ve, resolveDirective as ge } from "vue";
|
|
3
|
+
import { ElInput as D, ElButton as C, ElForm as he, ElRow as Ce, ElCol as Se, ElFormItem as G, ElDialog as ke, ElCard as U, ElSelect as we, ElOptionGroup as Te, ElOption as Z, ElPopover as Fe, ElCheckboxGroup as Y, ElSpace as ee, ElCheckbox as L, ElDropdown as le, ElDropdownMenu as te, ElDropdownItem as ae, ElTreeSelect as Be, ElRadioGroup as ne, ElRadio as Ie, ElRadioButton as Oe, ElSwitch as Ae, ElDatePicker as xe, ElTimePicker as ze, ElInputTag as Re, ElSlider as je, ElInputNumber as Ee, ElDrawer as Pe, ElPagination as Ve, ElTable as De, ElTableColumn as Ne } from "element-plus";
|
|
4
|
+
const il = /* @__PURE__ */ A({
|
|
5
5
|
name: "EleDynamicInput",
|
|
6
6
|
props: {
|
|
7
7
|
size: {
|
|
@@ -40,9 +40,9 @@ const il = /* @__PURE__ */ I({
|
|
|
40
40
|
setup(e, {
|
|
41
41
|
emit: o,
|
|
42
42
|
expose: t,
|
|
43
|
-
slots:
|
|
43
|
+
slots: n
|
|
44
44
|
}) {
|
|
45
|
-
const
|
|
45
|
+
const s = {
|
|
46
46
|
resetTxt: "重置",
|
|
47
47
|
newTxt: "添加项",
|
|
48
48
|
mergeTxt: "合并",
|
|
@@ -55,53 +55,53 @@ const il = /* @__PURE__ */ I({
|
|
|
55
55
|
hideArrayBtn: !1,
|
|
56
56
|
hideNumberBtn: !1,
|
|
57
57
|
...e.configs
|
|
58
|
-
},
|
|
58
|
+
}, f = {
|
|
59
59
|
arraySplitSymbol: ",",
|
|
60
60
|
...e.dyListConfigs
|
|
61
|
-
}, l = e.size,
|
|
62
|
-
|
|
61
|
+
}, l = e.size, i = I(N(e.modelValue, e.randomFun, f.arraySplitSymbol)), b = I(null);
|
|
62
|
+
_(i, (m) => {
|
|
63
63
|
if (!e.isController) return;
|
|
64
|
-
const S =
|
|
65
|
-
o("update:modelValue", S), o("onMerge", S,
|
|
64
|
+
const S = $(m, f.arraySplitSymbol);
|
|
65
|
+
o("update:modelValue", S), o("onMerge", S, P(i.value));
|
|
66
66
|
}, {
|
|
67
67
|
deep: !0
|
|
68
68
|
}), t({
|
|
69
69
|
onSet: (m) => {
|
|
70
|
-
|
|
70
|
+
i.value = N(m ?? e.modelValue, e.randomFun, f.arraySplitSymbol);
|
|
71
71
|
},
|
|
72
|
-
getResult: (m = "res") => m === "ori" ?
|
|
72
|
+
getResult: (m = "res") => m === "ori" ? P(i.value) : $(i.value, f.arraySplitSymbol)
|
|
73
73
|
});
|
|
74
|
-
const
|
|
74
|
+
const a = () => i.value.push({
|
|
75
75
|
rId: e.randomFun(),
|
|
76
76
|
key: "",
|
|
77
77
|
value: ""
|
|
78
78
|
}), c = () => {
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
const m =
|
|
83
|
-
o("update:modelValue", m), o("onMerge", m,
|
|
79
|
+
i.value = N(e.modelValue, e.randomFun, f.arraySplitSymbol), o("onReset");
|
|
80
|
+
}, d = () => {
|
|
81
|
+
i.value.sort((S, p) => +S.rId - +p.rId);
|
|
82
|
+
const m = $(i.value, f.arraySplitSymbol);
|
|
83
|
+
o("update:modelValue", m), o("onMerge", m, P(i.value)), i.value = N(m, e.randomFun, f.arraySplitSymbol);
|
|
84
84
|
};
|
|
85
|
-
return () =>
|
|
85
|
+
return () => r("div", {
|
|
86
86
|
class: e.dyCls ?? `dynamicForm ${l}`,
|
|
87
87
|
style: {
|
|
88
88
|
maxHeight: u.maxHeight
|
|
89
89
|
}
|
|
90
|
-
}, [
|
|
91
|
-
class: `dyFormList ${
|
|
92
|
-
ref:
|
|
93
|
-
}, [
|
|
94
|
-
const
|
|
90
|
+
}, [r("div", {
|
|
91
|
+
class: `dyFormList ${i.value.length ? "" : "noList"}`,
|
|
92
|
+
ref: b
|
|
93
|
+
}, [i.value.map((m, S, p) => {
|
|
94
|
+
const v = {
|
|
95
95
|
row: m,
|
|
96
96
|
index: S,
|
|
97
|
-
isLast: S ===
|
|
97
|
+
isLast: S === p.length - 1,
|
|
98
98
|
addItem: () => {
|
|
99
|
-
|
|
99
|
+
i.value.push({
|
|
100
100
|
rId: e.randomFun(),
|
|
101
101
|
key: "",
|
|
102
102
|
value: ""
|
|
103
103
|
}), u.autoScroll && X(() => {
|
|
104
|
-
const h =
|
|
104
|
+
const h = b.value;
|
|
105
105
|
h?.scrollTo({
|
|
106
106
|
top: h.scrollHeight,
|
|
107
107
|
behavior: "smooth"
|
|
@@ -109,95 +109,95 @@ const il = /* @__PURE__ */ I({
|
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
111
|
removeItem: () => {
|
|
112
|
-
|
|
112
|
+
i.value = i.value.filter((h) => h.rId !== m.rId);
|
|
113
113
|
},
|
|
114
114
|
toggleArray: () => m.isArray = !m.isArray,
|
|
115
115
|
toggleNumber: () => m.isNumber = !m.isNumber
|
|
116
116
|
};
|
|
117
|
-
return
|
|
117
|
+
return r("div", {
|
|
118
118
|
class: "dItem",
|
|
119
119
|
key: m.rId
|
|
120
|
-
}, [
|
|
120
|
+
}, [r("div", {
|
|
121
121
|
class: "input"
|
|
122
|
-
}, [
|
|
122
|
+
}, [r(D, {
|
|
123
123
|
size: l,
|
|
124
124
|
modelValue: m.key,
|
|
125
125
|
class: "key",
|
|
126
126
|
onInput: (h) => {
|
|
127
127
|
m.key = h;
|
|
128
128
|
}
|
|
129
|
-
}, null),
|
|
129
|
+
}, null), F(":"), r(D, {
|
|
130
130
|
size: l,
|
|
131
131
|
modelValue: m.value,
|
|
132
132
|
class: "value",
|
|
133
133
|
onInput: (h) => {
|
|
134
|
-
u.allowFilter && m.isNumber ? m.value = Q(h, m.isArray,
|
|
134
|
+
u.allowFilter && m.isNumber ? m.value = Q(h, m.isArray, f.arraySplitSymbol) : m.value = h;
|
|
135
135
|
}
|
|
136
136
|
}, {
|
|
137
|
-
prefix: () =>
|
|
137
|
+
prefix: () => n.typeTools ? n.typeTools(v) : r(O, null, [!u.hideArrayBtn && r(C, {
|
|
138
138
|
class: "typeBtn",
|
|
139
139
|
type: m.isArray ? "success" : "default",
|
|
140
140
|
size: "small",
|
|
141
|
-
onClick:
|
|
141
|
+
onClick: v.toggleArray
|
|
142
142
|
}, {
|
|
143
|
-
default: () => [
|
|
144
|
-
}), !u.hideNumberBtn &&
|
|
143
|
+
default: () => [F("Array")]
|
|
144
|
+
}), !u.hideNumberBtn && r(C, {
|
|
145
145
|
class: "typeBtn",
|
|
146
146
|
type: m.isNumber ? "success" : "default",
|
|
147
147
|
size: "small",
|
|
148
|
-
onClick:
|
|
148
|
+
onClick: v.toggleNumber
|
|
149
149
|
}, {
|
|
150
|
-
default: () => [
|
|
150
|
+
default: () => [F("Number")]
|
|
151
151
|
})])
|
|
152
|
-
})]),
|
|
152
|
+
})]), r("div", {
|
|
153
153
|
class: "btn"
|
|
154
|
-
}, [
|
|
154
|
+
}, [n.rowActions ? n.rowActions(v) : r(O, null, [r(C, {
|
|
155
155
|
type: "success",
|
|
156
156
|
size: l,
|
|
157
|
-
disabled: !
|
|
158
|
-
onClick:
|
|
157
|
+
disabled: !v.isLast,
|
|
158
|
+
onClick: v.addItem
|
|
159
159
|
}, {
|
|
160
|
-
default: () => [
|
|
161
|
-
}),
|
|
160
|
+
default: () => [F("+")]
|
|
161
|
+
}), r(C, {
|
|
162
162
|
size: l,
|
|
163
163
|
type: "danger",
|
|
164
|
-
onClick:
|
|
164
|
+
onClick: v.removeItem
|
|
165
165
|
}, {
|
|
166
|
-
default: () => [
|
|
166
|
+
default: () => [F("-")]
|
|
167
167
|
})])])]);
|
|
168
|
-
})]),
|
|
169
|
-
class: `control ${
|
|
170
|
-
}, [!
|
|
171
|
-
newItem:
|
|
172
|
-
}) :
|
|
168
|
+
})]), r("div", {
|
|
169
|
+
class: `control ${i.value.length ? "" : "noList"}`
|
|
170
|
+
}, [!i.value.length && (n.newBtn ? n.newBtn({
|
|
171
|
+
newItem: a
|
|
172
|
+
}) : r(C, {
|
|
173
173
|
size: l,
|
|
174
174
|
type: "success",
|
|
175
|
-
onClick:
|
|
175
|
+
onClick: a
|
|
176
176
|
}, {
|
|
177
|
-
default: () => [
|
|
178
|
-
})), !e.isController &&
|
|
177
|
+
default: () => [s.newTxt]
|
|
178
|
+
})), !e.isController && r(O, null, [!u.hideReset && (n.resetBtn ? n.resetBtn({
|
|
179
179
|
reset: c
|
|
180
|
-
}) :
|
|
180
|
+
}) : r(C, {
|
|
181
181
|
size: l,
|
|
182
182
|
type: "default",
|
|
183
183
|
onClick: c
|
|
184
184
|
}, {
|
|
185
|
-
default: () => [
|
|
186
|
-
})),
|
|
187
|
-
merge:
|
|
188
|
-
}) :
|
|
185
|
+
default: () => [s.resetTxt]
|
|
186
|
+
})), n.mergeBtn ? n.mergeBtn({
|
|
187
|
+
merge: d
|
|
188
|
+
}) : r(C, {
|
|
189
189
|
size: l,
|
|
190
190
|
type: "info",
|
|
191
|
-
onClick:
|
|
191
|
+
onClick: d
|
|
192
192
|
}, {
|
|
193
|
-
default: () => [
|
|
193
|
+
default: () => [s.mergeTxt]
|
|
194
194
|
})])])]);
|
|
195
195
|
}
|
|
196
196
|
});
|
|
197
|
-
function
|
|
198
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" &&
|
|
197
|
+
function Me(e) {
|
|
198
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
199
199
|
}
|
|
200
|
-
const dl = /* @__PURE__ */
|
|
200
|
+
const dl = /* @__PURE__ */ A({
|
|
201
201
|
name: "EleDynamicCascadeInput",
|
|
202
202
|
props: {
|
|
203
203
|
modelValue: {
|
|
@@ -242,9 +242,9 @@ const dl = /* @__PURE__ */ I({
|
|
|
242
242
|
setup(e, {
|
|
243
243
|
emit: o,
|
|
244
244
|
expose: t,
|
|
245
|
-
slots:
|
|
245
|
+
slots: n
|
|
246
246
|
}) {
|
|
247
|
-
const
|
|
247
|
+
const s = {
|
|
248
248
|
resetTxt: "重置",
|
|
249
249
|
newTxt: "添加项",
|
|
250
250
|
mergeTxt: "合并",
|
|
@@ -260,182 +260,182 @@ const dl = /* @__PURE__ */ I({
|
|
|
260
260
|
retractLen: 0,
|
|
261
261
|
borderColors: [],
|
|
262
262
|
...e.configs
|
|
263
|
-
},
|
|
263
|
+
}, f = {
|
|
264
264
|
arraySplitSymbol: ",",
|
|
265
265
|
...e.dyListConfigs
|
|
266
|
-
}, l = (
|
|
267
|
-
let
|
|
268
|
-
const w = Array.isArray(
|
|
269
|
-
return l(typeof
|
|
266
|
+
}, l = (p) => ["string", "number"].includes(p), i = (p) => Object.keys(p).map((v, h) => {
|
|
267
|
+
let y = p[v];
|
|
268
|
+
const w = Array.isArray(y), z = w ? y.every((V) => typeof V == "number") : typeof y == "number", B = y === null;
|
|
269
|
+
return l(typeof y) && (y = p[v]), B && (y = ""), {
|
|
270
270
|
rId: e.randomFun(h),
|
|
271
|
-
key:
|
|
272
|
-
value: Object.prototype.toString.call(
|
|
271
|
+
key: v,
|
|
272
|
+
value: Object.prototype.toString.call(y) === "[object Object]" ? i(p[v]) : w ? y.join(f.arraySplitSymbol) : y,
|
|
273
273
|
isArray: w || void 0,
|
|
274
|
-
isNumber:
|
|
274
|
+
isNumber: z || void 0
|
|
275
275
|
};
|
|
276
|
-
}),
|
|
277
|
-
const
|
|
278
|
-
return h.key.trim().length && (
|
|
279
|
-
}, {}),
|
|
280
|
-
class: [`depth-${
|
|
276
|
+
}), b = (p) => p.reduce((v, h) => {
|
|
277
|
+
const y = h.value;
|
|
278
|
+
return h.key.trim().length && (v[h.key] = Array.isArray(y) ? b(y) : oe(h.value, h.isArray, h.isNumber, f.arraySplitSymbol)), v;
|
|
279
|
+
}, {}), a = I(i(e.modelValue)), c = (p, v = 1, h) => r("div", {
|
|
280
|
+
class: [`depth-${v}`, u.showBorder ? "" : "no-border", u.showPad ? "" : "no-pad"],
|
|
281
281
|
style: {
|
|
282
|
-
"--depth":
|
|
283
|
-
["--c" + [
|
|
282
|
+
"--depth": v,
|
|
283
|
+
["--c" + [v]]: ue(u.borderColors, v)
|
|
284
284
|
}
|
|
285
|
-
}, [
|
|
286
|
-
const B = Array.isArray(
|
|
287
|
-
row:
|
|
285
|
+
}, [p.map((y, w, z) => {
|
|
286
|
+
const B = Array.isArray(y.value), V = l(typeof y.value), x = {
|
|
287
|
+
row: y,
|
|
288
288
|
index: w,
|
|
289
|
-
isLast: w ===
|
|
289
|
+
isLast: w === z.length - 1,
|
|
290
290
|
addItem: () => {
|
|
291
|
-
|
|
291
|
+
p.push({
|
|
292
292
|
rId: e.randomFun(),
|
|
293
293
|
key: "",
|
|
294
294
|
value: ""
|
|
295
295
|
});
|
|
296
296
|
},
|
|
297
297
|
addChild: () => {
|
|
298
|
-
|
|
298
|
+
V && (y.value = [], y.isArray = void 0), y.value.push({
|
|
299
299
|
rId: e.randomFun(),
|
|
300
300
|
key: "",
|
|
301
301
|
value: ""
|
|
302
302
|
});
|
|
303
303
|
},
|
|
304
304
|
removeItem: () => {
|
|
305
|
-
if (
|
|
306
|
-
if (h === void 0) return
|
|
307
|
-
const
|
|
308
|
-
|
|
305
|
+
if (p.splice(w, 1), p.length < 1) {
|
|
306
|
+
if (h === void 0) return b([]);
|
|
307
|
+
const T = a.value.findIndex((re) => re.rId === h?.rId);
|
|
308
|
+
v < 1 ? a.value.splice(T, 1, {
|
|
309
309
|
...h,
|
|
310
310
|
value: ""
|
|
311
311
|
}) : h.value = "";
|
|
312
312
|
}
|
|
313
313
|
},
|
|
314
|
-
toggleArray: () =>
|
|
315
|
-
toggleNumber: () =>
|
|
314
|
+
toggleArray: () => y.isArray = !y.isArray,
|
|
315
|
+
toggleNumber: () => y.isNumber = !y.isNumber
|
|
316
316
|
};
|
|
317
|
-
return
|
|
317
|
+
return r("div", {
|
|
318
318
|
class: "dItem",
|
|
319
|
-
key:
|
|
319
|
+
key: y.rId,
|
|
320
320
|
style: {
|
|
321
|
-
marginLeft:
|
|
321
|
+
marginLeft: v > 1 ? `${v * u.retractLen}px` : "0"
|
|
322
322
|
}
|
|
323
|
-
}, [
|
|
323
|
+
}, [r("div", {
|
|
324
324
|
class: "input"
|
|
325
|
-
}, [!B &&
|
|
326
|
-
modelValue:
|
|
325
|
+
}, [!B && r(O, null, [r(D, {
|
|
326
|
+
modelValue: y.key,
|
|
327
327
|
class: "key",
|
|
328
|
-
onInput: (
|
|
329
|
-
}, null),
|
|
328
|
+
onInput: (T) => y.key = T
|
|
329
|
+
}, null), F(":")]), r(D, {
|
|
330
330
|
class: `value ${B ? "isKey" : ""}`,
|
|
331
|
-
modelValue:
|
|
332
|
-
onInput: (
|
|
331
|
+
modelValue: V ? y.value : y.key,
|
|
332
|
+
onInput: (T) => {
|
|
333
333
|
if (B) {
|
|
334
|
-
|
|
334
|
+
y.key = T;
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
|
-
u.allowFilter &&
|
|
337
|
+
u.allowFilter && y.isNumber ? y.value = Q(T, y.isArray, f.arraySplitSymbol) : y.value = T;
|
|
338
338
|
}
|
|
339
339
|
}, {
|
|
340
|
-
prefix: Array.isArray(
|
|
341
|
-
type:
|
|
340
|
+
prefix: Array.isArray(y.value) ? void 0 : () => n.typeTools ? n.typeTools(x) : r(O, null, [!u.hideArrayBtn && r(C, {
|
|
341
|
+
type: y.isArray ? "success" : "default",
|
|
342
342
|
size: "small",
|
|
343
|
-
onClick:
|
|
343
|
+
onClick: x.toggleArray
|
|
344
344
|
}, {
|
|
345
|
-
default: () => [
|
|
346
|
-
}),
|
|
347
|
-
type:
|
|
345
|
+
default: () => [F("Array")]
|
|
346
|
+
}), F(" "), !u.hideNumberBtn && r(C, {
|
|
347
|
+
type: y.isNumber ? "success" : "default",
|
|
348
348
|
size: "small",
|
|
349
|
-
onClick:
|
|
349
|
+
onClick: x.toggleNumber
|
|
350
350
|
}, {
|
|
351
|
-
default: () => [
|
|
351
|
+
default: () => [F("Number")]
|
|
352
352
|
})]),
|
|
353
353
|
suffix: () => {
|
|
354
|
-
let
|
|
355
|
-
return
|
|
354
|
+
let T;
|
|
355
|
+
return v < e.depth ? !B && (n.newChild ? n.newChild(x) : r(C, {
|
|
356
356
|
type: "success",
|
|
357
357
|
size: "small",
|
|
358
358
|
onClick: () => {
|
|
359
|
-
|
|
359
|
+
V && (y.value = [], y.isArray = void 0), y.value.push({
|
|
360
360
|
rId: e.randomFun(),
|
|
361
361
|
key: "",
|
|
362
362
|
value: ""
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
},
|
|
366
|
-
default: () => [
|
|
365
|
+
}, Me(T = e.newChildTxt(y)) ? T : {
|
|
366
|
+
default: () => [T]
|
|
367
367
|
})) : null;
|
|
368
368
|
}
|
|
369
|
-
})]),
|
|
369
|
+
})]), r("div", {
|
|
370
370
|
class: "btn"
|
|
371
|
-
}, [
|
|
371
|
+
}, [n.rowActions ? n.rowActions(x) : r(O, null, [r(C, {
|
|
372
372
|
type: "success",
|
|
373
|
-
disabled: !
|
|
374
|
-
onClick:
|
|
373
|
+
disabled: !x.isLast,
|
|
374
|
+
onClick: x.addItem
|
|
375
375
|
}, {
|
|
376
|
-
default: () => [
|
|
377
|
-
}),
|
|
376
|
+
default: () => [F("+")]
|
|
377
|
+
}), r(C, {
|
|
378
378
|
type: "danger",
|
|
379
|
-
onClick:
|
|
379
|
+
onClick: x.removeItem
|
|
380
380
|
}, {
|
|
381
|
-
default: () => [
|
|
382
|
-
})])]), Array.isArray(
|
|
381
|
+
default: () => [F("-")]
|
|
382
|
+
})])]), Array.isArray(y.value) && c(y.value, v + 1, y)]);
|
|
383
383
|
})]);
|
|
384
|
-
|
|
384
|
+
_(a, (p) => {
|
|
385
385
|
if (!e.isController) return;
|
|
386
|
-
const
|
|
387
|
-
o("update:modelValue",
|
|
386
|
+
const v = b(p);
|
|
387
|
+
o("update:modelValue", v), o("onMerge", v, P(a.value));
|
|
388
388
|
}, {
|
|
389
389
|
deep: !0
|
|
390
390
|
}), t({
|
|
391
|
-
onSet: (
|
|
392
|
-
|
|
391
|
+
onSet: (p) => {
|
|
392
|
+
a.value = i(p ?? e.modelValue);
|
|
393
393
|
},
|
|
394
|
-
getResult: (
|
|
394
|
+
getResult: (p = "res") => p === "ori" ? P(a.value) : b(a.value)
|
|
395
395
|
});
|
|
396
|
-
const
|
|
396
|
+
const d = () => a.value.push({
|
|
397
397
|
rId: e.randomFun(),
|
|
398
398
|
key: "",
|
|
399
399
|
value: ""
|
|
400
400
|
}), m = () => {
|
|
401
|
-
|
|
401
|
+
a.value = i(e.modelValue), o("onReset");
|
|
402
402
|
}, S = () => {
|
|
403
|
-
const
|
|
404
|
-
o("update:modelValue",
|
|
403
|
+
const p = b(a.value);
|
|
404
|
+
o("update:modelValue", p), o("onMerge", p, P(a.value)), a.value = i(p);
|
|
405
405
|
};
|
|
406
|
-
return () =>
|
|
406
|
+
return () => r("div", {
|
|
407
407
|
class: `dynamicCascadeForm ${e.dyCls}`
|
|
408
|
-
}, [
|
|
409
|
-
class: `dyFormList ${
|
|
408
|
+
}, [r("div", {
|
|
409
|
+
class: `dyFormList ${a.value.length ? "" : "noObj"}`,
|
|
410
410
|
style: {
|
|
411
411
|
maxHeight: u.maxHeight
|
|
412
412
|
}
|
|
413
|
-
}, [c(
|
|
414
|
-
class: `control ${
|
|
415
|
-
}, [!
|
|
416
|
-
newItem:
|
|
417
|
-
}) :
|
|
413
|
+
}, [c(a.value)]), r("div", {
|
|
414
|
+
class: `control ${a.value.length ? "" : "noObj"}`
|
|
415
|
+
}, [!a.value.length && (n.newBtn ? n.newBtn({
|
|
416
|
+
newItem: d
|
|
417
|
+
}) : r(C, {
|
|
418
418
|
type: "success",
|
|
419
|
-
onClick:
|
|
419
|
+
onClick: d
|
|
420
420
|
}, {
|
|
421
|
-
default: () => [
|
|
422
|
-
})), !e.isController &&
|
|
421
|
+
default: () => [s.newTxt]
|
|
422
|
+
})), !e.isController && r(O, null, [!u.hideReset && (n.resetBtn ? n.resetBtn({
|
|
423
423
|
reset: m
|
|
424
|
-
}) :
|
|
424
|
+
}) : r(C, {
|
|
425
425
|
type: "default",
|
|
426
426
|
onClick: m
|
|
427
427
|
}, {
|
|
428
|
-
default: () => [
|
|
429
|
-
})),
|
|
428
|
+
default: () => [s.resetTxt]
|
|
429
|
+
})), n.mergeBtn ? n.mergeBtn({
|
|
430
430
|
merge: S
|
|
431
|
-
}) :
|
|
431
|
+
}) : r(C, {
|
|
432
432
|
type: "info",
|
|
433
433
|
onClick: S
|
|
434
434
|
}, {
|
|
435
|
-
default: () => [
|
|
435
|
+
default: () => [s.mergeTxt]
|
|
436
436
|
})])])]);
|
|
437
437
|
}
|
|
438
|
-
}), q = /* @__PURE__ */
|
|
438
|
+
}), q = /* @__PURE__ */ A({
|
|
439
439
|
name: "EleDynamicForm",
|
|
440
440
|
props: {
|
|
441
441
|
formConfig: {
|
|
@@ -471,71 +471,71 @@ const dl = /* @__PURE__ */ I({
|
|
|
471
471
|
expose: o,
|
|
472
472
|
slots: t
|
|
473
473
|
}) {
|
|
474
|
-
const
|
|
475
|
-
...
|
|
476
|
-
let m =
|
|
477
|
-
return
|
|
474
|
+
const n = I(null), s = R(() => (e.items ?? []).filter((a) => !a.hidden)), u = R(() => s.value ? s.value.reduce((a, c) => (a[c.key] = c.value.value, a), {}) : {}), f = R(() => ({
|
|
475
|
+
...s.value?.reduce((c, d) => {
|
|
476
|
+
let m = d.rule;
|
|
477
|
+
return d.required && !d.rule && (m = {
|
|
478
478
|
required: !0,
|
|
479
|
-
message:
|
|
479
|
+
message: d.requiredHint?.(d.label ?? "") ?? `${d.label}不能为空`,
|
|
480
480
|
trigger: "blur"
|
|
481
|
-
}), c[
|
|
481
|
+
}), c[d.key] = m, c;
|
|
482
482
|
}, {}),
|
|
483
483
|
...e.rules
|
|
484
|
-
})), l =
|
|
485
|
-
const m = c.sort ?? 1 / 0, S =
|
|
484
|
+
})), l = R(() => [...s.value].sort((c, d) => {
|
|
485
|
+
const m = c.sort ?? 1 / 0, S = d.sort ?? 1 / 0;
|
|
486
486
|
return Number(m) - Number(S);
|
|
487
487
|
}));
|
|
488
|
-
function
|
|
489
|
-
|
|
490
|
-
c.value.value =
|
|
488
|
+
function i(a = null) {
|
|
489
|
+
s.value && s.value.forEach((c) => {
|
|
490
|
+
c.value.value = a;
|
|
491
491
|
});
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
return new Promise((
|
|
495
|
-
|
|
496
|
-
|
|
493
|
+
function b() {
|
|
494
|
+
return new Promise((a, c) => {
|
|
495
|
+
n.value?.validate((d, m) => {
|
|
496
|
+
d ? a(u.value) : c(m);
|
|
497
497
|
});
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
500
|
if (o({
|
|
501
|
-
reset:
|
|
502
|
-
validator:
|
|
503
|
-
getResult: (
|
|
501
|
+
reset: i,
|
|
502
|
+
validator: b,
|
|
503
|
+
getResult: (a = "res") => a === "ori" ? s.value : u.value
|
|
504
504
|
}), !e.items) throw new Error("prop items must be not null");
|
|
505
|
-
return () =>
|
|
505
|
+
return () => r("div", {
|
|
506
506
|
class: "naiDynamicForm"
|
|
507
|
-
}, [t.header &&
|
|
507
|
+
}, [t.header && r("div", {
|
|
508
508
|
class: "header"
|
|
509
|
-
}, [t.header?.()]),
|
|
510
|
-
ref:
|
|
509
|
+
}, [t.header?.()]), r(he, E({
|
|
510
|
+
ref: n
|
|
511
511
|
}, e.formConfig, {
|
|
512
512
|
model: u.value,
|
|
513
|
-
rules:
|
|
513
|
+
rules: f.value
|
|
514
514
|
}), {
|
|
515
515
|
default() {
|
|
516
|
-
const
|
|
517
|
-
return e.preset === "grid" ?
|
|
516
|
+
const a = l.value;
|
|
517
|
+
return e.preset === "grid" ? g(Ce, {
|
|
518
518
|
...e.rowConfig
|
|
519
519
|
}, {
|
|
520
|
-
default: () =>
|
|
520
|
+
default: () => a?.map((c) => g(Se, {
|
|
521
521
|
span: c.span ?? 24,
|
|
522
522
|
offset: c.offset ?? 0
|
|
523
523
|
}, {
|
|
524
|
-
default: () =>
|
|
524
|
+
default: () => g(G, {
|
|
525
525
|
label: c.label,
|
|
526
526
|
prop: c.path || c.key
|
|
527
527
|
}, {
|
|
528
528
|
default: W(c)
|
|
529
529
|
})
|
|
530
530
|
}))
|
|
531
|
-
}) :
|
|
531
|
+
}) : a?.map((c) => g(G, {
|
|
532
532
|
label: c.label,
|
|
533
533
|
prop: c.path || c.key
|
|
534
534
|
}, {
|
|
535
535
|
default: W(c)
|
|
536
536
|
}));
|
|
537
537
|
}
|
|
538
|
-
}), t.footer &&
|
|
538
|
+
}), t.footer && g("div", {
|
|
539
539
|
class: "footer"
|
|
540
540
|
}, t.footer?.())]);
|
|
541
541
|
}
|
|
@@ -546,9 +546,9 @@ function W(e) {
|
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
548
|
function K(e) {
|
|
549
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" &&
|
|
549
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
550
550
|
}
|
|
551
|
-
const cl = /* @__PURE__ */
|
|
551
|
+
const cl = /* @__PURE__ */ A({
|
|
552
552
|
name: "ElePopupModal",
|
|
553
553
|
props: {
|
|
554
554
|
title: {
|
|
@@ -593,30 +593,30 @@ const cl = /* @__PURE__ */ I({
|
|
|
593
593
|
setup(e, {
|
|
594
594
|
expose: o,
|
|
595
595
|
emit: t,
|
|
596
|
-
slots:
|
|
596
|
+
slots: n
|
|
597
597
|
}) {
|
|
598
|
-
const
|
|
598
|
+
const s = R(() => ({
|
|
599
599
|
alignCenter: !0,
|
|
600
600
|
draggable: !0,
|
|
601
601
|
appendToBody: !0,
|
|
602
602
|
...e.modalProps ?? {}
|
|
603
|
-
})), u =
|
|
603
|
+
})), u = I(!1), f = ye({
|
|
604
604
|
c: !1,
|
|
605
605
|
s: !1
|
|
606
|
-
}), l = (
|
|
607
|
-
u.value =
|
|
606
|
+
}), l = (a) => {
|
|
607
|
+
u.value = a ?? !u.value;
|
|
608
608
|
};
|
|
609
609
|
o({
|
|
610
610
|
toggle: l
|
|
611
611
|
});
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
},
|
|
615
|
-
|
|
612
|
+
const i = async () => {
|
|
613
|
+
f.c = !0, (await e.onCancel?.() ?? !0) && l(!1), f.c = !1;
|
|
614
|
+
}, b = async () => {
|
|
615
|
+
f.s = !0, (await e.onSubmit?.() ?? !0) && l(!1), f.s = !1;
|
|
616
616
|
};
|
|
617
|
-
return () =>
|
|
617
|
+
return () => r(ke, E({
|
|
618
618
|
modelValue: u.value,
|
|
619
|
-
"onUpdate:modelValue": (
|
|
619
|
+
"onUpdate:modelValue": (a) => u.value = a,
|
|
620
620
|
showClose: e.showClose,
|
|
621
621
|
closeOnClickModal: e.closeOnMask,
|
|
622
622
|
style: {
|
|
@@ -624,37 +624,37 @@ const cl = /* @__PURE__ */ I({
|
|
|
624
624
|
},
|
|
625
625
|
title: e.title,
|
|
626
626
|
appendTo: e.to
|
|
627
|
-
},
|
|
627
|
+
}, s.value), {
|
|
628
628
|
footer: () => {
|
|
629
|
-
const [
|
|
630
|
-
c:
|
|
629
|
+
const [a, c] = e.footerTxt, {
|
|
630
|
+
c: d,
|
|
631
631
|
s: m
|
|
632
|
-
} =
|
|
633
|
-
return
|
|
632
|
+
} = f;
|
|
633
|
+
return r("div", {
|
|
634
634
|
class: "flex justify-end align-center"
|
|
635
|
-
}, [
|
|
635
|
+
}, [r(C, {
|
|
636
636
|
size: "small",
|
|
637
|
-
onClick:
|
|
638
|
-
loading:
|
|
639
|
-
}, K(
|
|
640
|
-
default: () => [
|
|
641
|
-
}),
|
|
637
|
+
onClick: i,
|
|
638
|
+
loading: d
|
|
639
|
+
}, K(a) ? a : {
|
|
640
|
+
default: () => [a]
|
|
641
|
+
}), r(C, {
|
|
642
642
|
size: "small",
|
|
643
643
|
type: "success",
|
|
644
|
-
onClick:
|
|
644
|
+
onClick: b,
|
|
645
645
|
loading: m
|
|
646
646
|
}, K(c) ? c : {
|
|
647
647
|
default: () => [c]
|
|
648
648
|
})]);
|
|
649
649
|
},
|
|
650
|
-
...
|
|
650
|
+
...n
|
|
651
651
|
});
|
|
652
652
|
}
|
|
653
653
|
});
|
|
654
654
|
function J(e) {
|
|
655
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" &&
|
|
655
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
656
656
|
}
|
|
657
|
-
const fl = /* @__PURE__ */
|
|
657
|
+
const fl = /* @__PURE__ */ A({
|
|
658
658
|
name: "EleZealCard",
|
|
659
659
|
props: {
|
|
660
660
|
title: {
|
|
@@ -675,179 +675,187 @@ const fl = /* @__PURE__ */ I({
|
|
|
675
675
|
checkWindowSize: {
|
|
676
676
|
type: Array,
|
|
677
677
|
default: [756, 500]
|
|
678
|
+
},
|
|
679
|
+
observeDelay: {
|
|
680
|
+
type: Number,
|
|
681
|
+
default: 100
|
|
678
682
|
}
|
|
679
683
|
},
|
|
680
684
|
slots: Object,
|
|
681
685
|
setup(e, {
|
|
682
|
-
slots: o
|
|
686
|
+
slots: o,
|
|
687
|
+
expose: t
|
|
683
688
|
}) {
|
|
684
|
-
const
|
|
685
|
-
wrapRef:
|
|
686
|
-
cardRef:
|
|
687
|
-
restRef:
|
|
688
|
-
tableHeight:
|
|
689
|
-
} =
|
|
690
|
-
return (
|
|
691
|
-
|
|
692
|
-
|
|
689
|
+
const n = se(...e.checkWindowSize), {
|
|
690
|
+
wrapRef: s,
|
|
691
|
+
cardRef: u,
|
|
692
|
+
restRef: f,
|
|
693
|
+
tableHeight: l
|
|
694
|
+
} = ie(U, e.observeDelay);
|
|
695
|
+
return t({
|
|
696
|
+
tableHeight: l,
|
|
697
|
+
isMobile: R(() => n.isMobile)
|
|
698
|
+
}), () => {
|
|
699
|
+
const i = de(n);
|
|
700
|
+
return r("div", {
|
|
693
701
|
class: "zealCard",
|
|
694
702
|
style: {
|
|
695
703
|
height: `calc(${e.zealHeight} - ${e.outPadding * 2}px)`
|
|
696
704
|
},
|
|
697
|
-
ref:
|
|
698
|
-
}, [
|
|
699
|
-
ref:
|
|
705
|
+
ref: s
|
|
706
|
+
}, [r(U, {
|
|
707
|
+
ref: u
|
|
700
708
|
}, {
|
|
701
709
|
default: () => [o.default?.({
|
|
702
|
-
tableHeight:
|
|
703
|
-
...
|
|
710
|
+
tableHeight: l.value,
|
|
711
|
+
...i
|
|
704
712
|
})],
|
|
705
713
|
header: () => {
|
|
706
|
-
const [
|
|
707
|
-
return
|
|
714
|
+
const [b, a] = e.searchBtnTxt;
|
|
715
|
+
return r("div", {
|
|
708
716
|
class: "header"
|
|
709
|
-
}, [o.header?.(
|
|
717
|
+
}, [o.header?.(i) ?? r(O, null, [r("div", {
|
|
710
718
|
class: "title"
|
|
711
|
-
}, [e.title]),
|
|
719
|
+
}, [e.title]), r("div", {
|
|
712
720
|
class: "search"
|
|
713
|
-
}, [o.searchForm?.(), o.searchBtn?.() || o.searchForm &&
|
|
721
|
+
}, [o.searchForm?.(i), o.searchBtn?.(i) || o.searchForm && r("div", {
|
|
714
722
|
class: "searchBtn"
|
|
715
|
-
}, [
|
|
723
|
+
}, [r(C, {
|
|
716
724
|
size: "small"
|
|
717
|
-
}, J(
|
|
718
|
-
default: () => [
|
|
719
|
-
}),
|
|
725
|
+
}, J(b) ? b : {
|
|
726
|
+
default: () => [b]
|
|
727
|
+
}), r(C, {
|
|
720
728
|
type: "info",
|
|
721
729
|
size: "small"
|
|
722
|
-
}, J(
|
|
723
|
-
default: () => [
|
|
724
|
-
})])])]),
|
|
730
|
+
}, J(a) ? a : {
|
|
731
|
+
default: () => [a]
|
|
732
|
+
})])])]), r("div", {
|
|
725
733
|
class: "controlBtn"
|
|
726
|
-
}, [
|
|
734
|
+
}, [r("div", null, [o.controlBtn?.(i)]), o.toolBtn?.(i)])]);
|
|
727
735
|
},
|
|
728
|
-
footer: () =>
|
|
736
|
+
footer: o.footer ? () => r("div", {
|
|
729
737
|
class: "footer"
|
|
730
|
-
}, [o.footer?.(
|
|
731
|
-
}),
|
|
732
|
-
ref:
|
|
733
|
-
}, [o.rest?.()])]);
|
|
738
|
+
}, [o.footer?.(i)]) : null
|
|
739
|
+
}), r("div", {
|
|
740
|
+
ref: f
|
|
741
|
+
}, [o.rest?.(i)])]);
|
|
734
742
|
};
|
|
735
743
|
}
|
|
736
744
|
});
|
|
737
745
|
function k(e, o, t) {
|
|
738
746
|
return e?.[o] ?? t;
|
|
739
747
|
}
|
|
740
|
-
function
|
|
748
|
+
function $e(e) {
|
|
741
749
|
return !!e && (e.type === "group" || Array.isArray(e.children) || Array.isArray(e.options));
|
|
742
750
|
}
|
|
743
|
-
function
|
|
751
|
+
function H(e) {
|
|
744
752
|
return (e ?? []).map((o) => {
|
|
745
|
-
if (
|
|
753
|
+
if ($e(o)) {
|
|
746
754
|
const t = o.children ?? o.options ?? [];
|
|
747
755
|
return { ...o, __isGroup: !0, __children: t };
|
|
748
756
|
}
|
|
749
757
|
return { ...o, __isGroup: !1 };
|
|
750
758
|
});
|
|
751
759
|
}
|
|
752
|
-
function
|
|
753
|
-
const
|
|
754
|
-
for (const u of
|
|
760
|
+
function _e(e, o, t = "label", n = "value") {
|
|
761
|
+
const s = H(o);
|
|
762
|
+
for (const u of s)
|
|
755
763
|
if (u.__isGroup) {
|
|
756
|
-
for (const
|
|
757
|
-
if (k(
|
|
758
|
-
} else if (k(u,
|
|
764
|
+
for (const f of u.__children)
|
|
765
|
+
if (k(f, n, f.value) === e) return k(f, t, f.label);
|
|
766
|
+
} else if (k(u, n, u.value) === e) return k(u, t, u.label);
|
|
759
767
|
return "";
|
|
760
768
|
}
|
|
761
769
|
function Le(e, o = {}, t) {
|
|
762
|
-
const { onChange:
|
|
763
|
-
return
|
|
770
|
+
const { onChange: n, value: s, ...u } = t;
|
|
771
|
+
return g(D, {
|
|
764
772
|
...u,
|
|
765
773
|
modelValue: e.value,
|
|
766
|
-
"onUpdate:modelValue": (
|
|
767
|
-
e.value =
|
|
774
|
+
"onUpdate:modelValue": (f) => {
|
|
775
|
+
e.value = f, t?.onChange?.(f, t);
|
|
768
776
|
},
|
|
769
777
|
...o
|
|
770
778
|
});
|
|
771
779
|
}
|
|
772
|
-
function
|
|
773
|
-
const { onChange:
|
|
774
|
-
return
|
|
775
|
-
|
|
780
|
+
function He(e, o, t = {}, n) {
|
|
781
|
+
const { onChange: s, labelField: u, valueField: f, options: l, ...i } = n ?? {}, b = u ?? "label", a = f ?? "value", c = H(l ?? o);
|
|
782
|
+
return g(
|
|
783
|
+
we,
|
|
776
784
|
{
|
|
777
|
-
...
|
|
785
|
+
...i,
|
|
778
786
|
modelValue: e.value,
|
|
779
|
-
"onUpdate:modelValue": (
|
|
780
|
-
e.value =
|
|
787
|
+
"onUpdate:modelValue": (d) => {
|
|
788
|
+
e.value = d, n?.onChange?.(d, n, c);
|
|
781
789
|
},
|
|
782
790
|
...t
|
|
783
791
|
},
|
|
784
792
|
{
|
|
785
|
-
default: () => c.map((
|
|
786
|
-
if (
|
|
787
|
-
return
|
|
788
|
-
|
|
789
|
-
{ key:
|
|
793
|
+
default: () => c.map((d, m) => {
|
|
794
|
+
if (d.__isGroup)
|
|
795
|
+
return g(
|
|
796
|
+
Te,
|
|
797
|
+
{ key: d.key ?? `g-${m}`, label: k(d, b, d.label) },
|
|
790
798
|
{
|
|
791
|
-
default: () => (
|
|
792
|
-
const
|
|
793
|
-
return
|
|
794
|
-
key:
|
|
795
|
-
label:
|
|
799
|
+
default: () => (d.__children ?? []).map((v, h) => {
|
|
800
|
+
const y = k(v, b, v.label), w = k(v, a, v.value);
|
|
801
|
+
return g(Z, {
|
|
802
|
+
key: v.key ?? `${m}-${h}`,
|
|
803
|
+
label: y,
|
|
796
804
|
value: w,
|
|
797
|
-
disabled:
|
|
805
|
+
disabled: v.disabled
|
|
798
806
|
});
|
|
799
807
|
})
|
|
800
808
|
}
|
|
801
809
|
);
|
|
802
|
-
const S = k(
|
|
803
|
-
return
|
|
804
|
-
key:
|
|
810
|
+
const S = k(d, b, d.label), p = k(d, a, d.value);
|
|
811
|
+
return g(Z, {
|
|
812
|
+
key: d.key ?? `${m}`,
|
|
805
813
|
label: S,
|
|
806
|
-
value:
|
|
807
|
-
disabled:
|
|
814
|
+
value: p,
|
|
815
|
+
disabled: d.disabled
|
|
808
816
|
});
|
|
809
817
|
})
|
|
810
818
|
}
|
|
811
819
|
);
|
|
812
820
|
}
|
|
813
|
-
function
|
|
814
|
-
const { labelField: u, valueField:
|
|
815
|
-
if (
|
|
816
|
-
const
|
|
817
|
-
return
|
|
821
|
+
function Ge(e, o, t = {}, n, s) {
|
|
822
|
+
const { labelField: u, valueField: f, options: l, onChange: i, ...b } = n ?? {}, a = u ?? "label", c = f ?? "value", d = l ?? o, m = H(d), S = () => {
|
|
823
|
+
if (s) return s;
|
|
824
|
+
const p = Array.isArray(e.value) ? e.value.length ? `已选 ${e.value.length} 项` : "请选择" : e.value != null ? _e(e.value, d, a, c) || String(e.value) : "请选择";
|
|
825
|
+
return g(C, null, { default: () => p });
|
|
818
826
|
};
|
|
819
|
-
return Array.isArray(e.value) ?
|
|
820
|
-
|
|
827
|
+
return Array.isArray(e.value) ? r(
|
|
828
|
+
Fe,
|
|
821
829
|
{
|
|
822
830
|
trigger: "click",
|
|
823
|
-
...
|
|
831
|
+
...b,
|
|
824
832
|
...t
|
|
825
833
|
},
|
|
826
834
|
{
|
|
827
835
|
reference: () => S(),
|
|
828
|
-
default: () =>
|
|
836
|
+
default: () => g(
|
|
829
837
|
Y,
|
|
830
838
|
{
|
|
831
839
|
modelValue: e.value,
|
|
832
|
-
"onUpdate:modelValue": (
|
|
833
|
-
e.value =
|
|
840
|
+
"onUpdate:modelValue": (p) => {
|
|
841
|
+
e.value = p, n?.onChange?.(p, n, m);
|
|
834
842
|
}
|
|
835
843
|
},
|
|
836
844
|
{
|
|
837
|
-
default: () =>
|
|
845
|
+
default: () => g(
|
|
838
846
|
ee,
|
|
839
847
|
{ wrap: !0 },
|
|
840
848
|
{
|
|
841
|
-
default: () => m.flatMap((
|
|
842
|
-
const
|
|
843
|
-
return
|
|
849
|
+
default: () => m.flatMap((p, v) => (p.__isGroup ? p.__children ?? [] : [p]).map((y, w) => {
|
|
850
|
+
const z = k(y, a, y.label), B = k(y, c, y.value);
|
|
851
|
+
return g(
|
|
844
852
|
L,
|
|
845
853
|
{
|
|
846
|
-
key:
|
|
854
|
+
key: y.key ?? `${v}-${w}`,
|
|
847
855
|
label: B,
|
|
848
|
-
disabled:
|
|
856
|
+
disabled: y.disabled
|
|
849
857
|
},
|
|
850
|
-
{ default: () =>
|
|
858
|
+
{ default: () => z }
|
|
851
859
|
);
|
|
852
860
|
}))
|
|
853
861
|
}
|
|
@@ -855,122 +863,122 @@ function Ue(e, o, t = {}, a, i) {
|
|
|
855
863
|
}
|
|
856
864
|
)
|
|
857
865
|
}
|
|
858
|
-
) :
|
|
859
|
-
|
|
866
|
+
) : r(
|
|
867
|
+
le,
|
|
860
868
|
{
|
|
861
869
|
trigger: "click",
|
|
862
|
-
...
|
|
863
|
-
onCommand: (
|
|
864
|
-
e.value =
|
|
870
|
+
...b,
|
|
871
|
+
onCommand: (p) => {
|
|
872
|
+
e.value = p, n?.onChange?.(p, n, m);
|
|
865
873
|
},
|
|
866
874
|
...t
|
|
867
875
|
},
|
|
868
876
|
{
|
|
869
877
|
default: () => S(),
|
|
870
|
-
dropdown: () =>
|
|
871
|
-
default: () => m.flatMap((
|
|
872
|
-
const
|
|
873
|
-
return
|
|
874
|
-
|
|
875
|
-
{ key:
|
|
876
|
-
{ default: () =>
|
|
878
|
+
dropdown: () => g(te, null, {
|
|
879
|
+
default: () => m.flatMap((p, v) => (p.__isGroup ? p.__children ?? [] : [p]).map((y, w) => {
|
|
880
|
+
const z = k(y, a, y.label), B = k(y, c, y.value);
|
|
881
|
+
return g(
|
|
882
|
+
ae,
|
|
883
|
+
{ key: y.key ?? `${v}-${w}`, command: B, disabled: y.disabled },
|
|
884
|
+
{ default: () => z }
|
|
877
885
|
);
|
|
878
886
|
}))
|
|
879
887
|
})
|
|
880
888
|
}
|
|
881
889
|
);
|
|
882
890
|
}
|
|
883
|
-
function
|
|
891
|
+
function Ue(e, o, t = {}, n) {
|
|
884
892
|
const {
|
|
885
|
-
valueField:
|
|
893
|
+
valueField: s = "value",
|
|
886
894
|
labelField: u = "label",
|
|
887
|
-
childrenField:
|
|
895
|
+
childrenField: f = "children",
|
|
888
896
|
onChange: l,
|
|
889
|
-
options:
|
|
890
|
-
...
|
|
891
|
-
} =
|
|
892
|
-
return
|
|
893
|
-
...
|
|
894
|
-
data:
|
|
897
|
+
options: i,
|
|
898
|
+
...b
|
|
899
|
+
} = n ?? {}, a = i ?? o;
|
|
900
|
+
return g(Be, {
|
|
901
|
+
...b,
|
|
902
|
+
data: a,
|
|
895
903
|
modelValue: e.value,
|
|
896
904
|
"onUpdate:modelValue": (c) => {
|
|
897
|
-
e.value = c,
|
|
905
|
+
e.value = c, n?.onChange?.(c, n, a);
|
|
898
906
|
},
|
|
899
907
|
props: {
|
|
900
|
-
value:
|
|
908
|
+
value: s,
|
|
901
909
|
label: u,
|
|
902
|
-
children:
|
|
910
|
+
children: f,
|
|
903
911
|
disabled: "disabled"
|
|
904
912
|
},
|
|
905
913
|
...t
|
|
906
914
|
});
|
|
907
915
|
}
|
|
908
|
-
function Ze(e, o, t = {},
|
|
909
|
-
const { onChange:
|
|
910
|
-
return
|
|
911
|
-
|
|
916
|
+
function Ze(e, o, t = {}, n) {
|
|
917
|
+
const { onChange: s, labelField: u, valueField: f, options: l, ...i } = n ?? {}, b = u ?? "label", a = f ?? "value", c = l ?? o;
|
|
918
|
+
return g(
|
|
919
|
+
ne,
|
|
912
920
|
{
|
|
913
|
-
...
|
|
921
|
+
...i,
|
|
914
922
|
modelValue: e.value,
|
|
915
|
-
"onUpdate:modelValue": (
|
|
916
|
-
e.value =
|
|
923
|
+
"onUpdate:modelValue": (d) => {
|
|
924
|
+
e.value = d, n?.onChange?.(d, n, c);
|
|
917
925
|
},
|
|
918
926
|
...t
|
|
919
927
|
},
|
|
920
928
|
{
|
|
921
|
-
default: () => (c ?? []).map((
|
|
922
|
-
const S = k(
|
|
923
|
-
return
|
|
929
|
+
default: () => (c ?? []).map((d, m) => {
|
|
930
|
+
const S = k(d, b, d.label), p = k(d, a, d.value);
|
|
931
|
+
return g(Ie, { key: d.key ?? m, label: p, disabled: d.disabled }, () => S);
|
|
924
932
|
})
|
|
925
933
|
}
|
|
926
934
|
);
|
|
927
935
|
}
|
|
928
|
-
function qe(e, o, t = {},
|
|
929
|
-
const { onChange:
|
|
930
|
-
return
|
|
931
|
-
|
|
936
|
+
function qe(e, o, t = {}, n) {
|
|
937
|
+
const { onChange: s, labelField: u, valueField: f, options: l, ...i } = n ?? {}, b = u ?? "label", a = f ?? "value", c = l ?? o;
|
|
938
|
+
return g(
|
|
939
|
+
ne,
|
|
932
940
|
{
|
|
933
|
-
...
|
|
941
|
+
...i,
|
|
934
942
|
modelValue: e.value,
|
|
935
|
-
"onUpdate:modelValue": (
|
|
936
|
-
e.value =
|
|
943
|
+
"onUpdate:modelValue": (d) => {
|
|
944
|
+
e.value = d, n?.onChange?.(d, n, c);
|
|
937
945
|
},
|
|
938
946
|
...t
|
|
939
947
|
},
|
|
940
948
|
{
|
|
941
|
-
default: () => (c ?? []).map((
|
|
942
|
-
const S = k(
|
|
943
|
-
return
|
|
949
|
+
default: () => (c ?? []).map((d, m) => {
|
|
950
|
+
const S = k(d, b, d.label), p = k(d, a, d.value);
|
|
951
|
+
return g(
|
|
944
952
|
Oe,
|
|
945
|
-
{ key:
|
|
953
|
+
{ key: d.key ?? m, label: p, disabled: d.disabled },
|
|
946
954
|
() => S
|
|
947
955
|
);
|
|
948
956
|
})
|
|
949
957
|
}
|
|
950
958
|
);
|
|
951
959
|
}
|
|
952
|
-
function We(e, o, t = {},
|
|
953
|
-
const { onChange:
|
|
954
|
-
return
|
|
960
|
+
function We(e, o, t = {}, n) {
|
|
961
|
+
const { onChange: s, labelField: u, valueField: f, options: l, ...i } = n ?? {}, b = u ?? "label", a = f ?? "value", c = l ?? o;
|
|
962
|
+
return g(
|
|
955
963
|
Y,
|
|
956
964
|
{
|
|
957
|
-
...
|
|
965
|
+
...i,
|
|
958
966
|
modelValue: e.value,
|
|
959
|
-
"onUpdate:modelValue": (
|
|
960
|
-
e.value =
|
|
967
|
+
"onUpdate:modelValue": (d) => {
|
|
968
|
+
e.value = d, n?.onChange?.(d, n, c);
|
|
961
969
|
},
|
|
962
970
|
...t
|
|
963
971
|
},
|
|
964
972
|
{
|
|
965
|
-
default: () =>
|
|
973
|
+
default: () => g(
|
|
966
974
|
ee,
|
|
967
975
|
{ wrap: !0 },
|
|
968
976
|
{
|
|
969
|
-
default: () => (c ?? []).map((
|
|
970
|
-
const S = k(
|
|
971
|
-
return
|
|
977
|
+
default: () => (c ?? []).map((d, m) => {
|
|
978
|
+
const S = k(d, b, d.label), p = k(d, a, d.value);
|
|
979
|
+
return g(
|
|
972
980
|
L,
|
|
973
|
-
{ key:
|
|
981
|
+
{ key: d.key ?? m, label: p, disabled: d.disabled },
|
|
974
982
|
() => S
|
|
975
983
|
);
|
|
976
984
|
})
|
|
@@ -980,9 +988,9 @@ function We(e, o, t = {}, a) {
|
|
|
980
988
|
);
|
|
981
989
|
}
|
|
982
990
|
function Ke(e, o = {}, t) {
|
|
983
|
-
const { onChange:
|
|
984
|
-
return
|
|
985
|
-
...
|
|
991
|
+
const { onChange: n, ...s } = t ?? {};
|
|
992
|
+
return g(Ae, {
|
|
993
|
+
...s,
|
|
986
994
|
modelValue: e.value,
|
|
987
995
|
"onUpdate:modelValue": (u) => {
|
|
988
996
|
e.value = u, t?.onChange?.(u, t);
|
|
@@ -991,9 +999,9 @@ function Ke(e, o = {}, t) {
|
|
|
991
999
|
});
|
|
992
1000
|
}
|
|
993
1001
|
function Je(e, o = {}, t) {
|
|
994
|
-
const { onChange:
|
|
995
|
-
return
|
|
996
|
-
...
|
|
1002
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1003
|
+
return g(xe, {
|
|
1004
|
+
...s,
|
|
997
1005
|
modelValue: e.value,
|
|
998
1006
|
"onUpdate:modelValue": (u) => {
|
|
999
1007
|
e.value = u, t?.onChange?.(u, t);
|
|
@@ -1002,9 +1010,9 @@ function Je(e, o = {}, t) {
|
|
|
1002
1010
|
});
|
|
1003
1011
|
}
|
|
1004
1012
|
function Qe(e, o = {}, t) {
|
|
1005
|
-
const { onChange:
|
|
1006
|
-
return
|
|
1007
|
-
...
|
|
1013
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1014
|
+
return g(ze, {
|
|
1015
|
+
...s,
|
|
1008
1016
|
modelValue: e.value,
|
|
1009
1017
|
"onUpdate:modelValue": (u) => {
|
|
1010
1018
|
e.value = u, t?.onChange?.(u, t);
|
|
@@ -1013,9 +1021,9 @@ function Qe(e, o = {}, t) {
|
|
|
1013
1021
|
});
|
|
1014
1022
|
}
|
|
1015
1023
|
function Xe(e, o = {}, t) {
|
|
1016
|
-
const { onChange:
|
|
1017
|
-
return
|
|
1018
|
-
...
|
|
1024
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1025
|
+
return g(L, {
|
|
1026
|
+
...s,
|
|
1019
1027
|
label: o?.label ?? t?.label,
|
|
1020
1028
|
modelValue: e.value,
|
|
1021
1029
|
"onUpdate:modelValue": (u) => {
|
|
@@ -1025,23 +1033,23 @@ function Xe(e, o = {}, t) {
|
|
|
1025
1033
|
});
|
|
1026
1034
|
}
|
|
1027
1035
|
function Ye(e, o = {}, t) {
|
|
1028
|
-
const { onChange:
|
|
1029
|
-
return
|
|
1036
|
+
const { onChange: n, value: s, labelField: u = "label", valueField: f, ...l } = t ?? {};
|
|
1037
|
+
return g(Re, {
|
|
1030
1038
|
...l,
|
|
1031
|
-
modelValue:
|
|
1032
|
-
"onUpdate:modelValue": (
|
|
1033
|
-
e.value =
|
|
1034
|
-
[u]:
|
|
1035
|
-
[
|
|
1036
|
-
})) :
|
|
1039
|
+
modelValue: f ? e.value.map((i) => i[f]) : e.value,
|
|
1040
|
+
"onUpdate:modelValue": (i) => {
|
|
1041
|
+
e.value = f ? i.map((b) => ({
|
|
1042
|
+
[u]: b,
|
|
1043
|
+
[f]: b
|
|
1044
|
+
})) : i, t?.onChange?.(i, t);
|
|
1037
1045
|
},
|
|
1038
1046
|
...o
|
|
1039
1047
|
});
|
|
1040
1048
|
}
|
|
1041
1049
|
function el(e, o = {}, t) {
|
|
1042
|
-
const { onChange:
|
|
1043
|
-
return
|
|
1044
|
-
...
|
|
1050
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1051
|
+
return g(je, {
|
|
1052
|
+
...s,
|
|
1045
1053
|
modelValue: e.value,
|
|
1046
1054
|
"onUpdate:modelValue": (u) => {
|
|
1047
1055
|
e.value = u, t?.onChange?.(u, t);
|
|
@@ -1050,9 +1058,9 @@ function el(e, o = {}, t) {
|
|
|
1050
1058
|
});
|
|
1051
1059
|
}
|
|
1052
1060
|
function ll(e, o = {}, t) {
|
|
1053
|
-
const { onChange:
|
|
1054
|
-
return
|
|
1055
|
-
...
|
|
1061
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1062
|
+
return g(Ee, {
|
|
1063
|
+
...s,
|
|
1056
1064
|
modelValue: e.value,
|
|
1057
1065
|
"onUpdate:modelValue": (u) => {
|
|
1058
1066
|
e.value = u ?? null, t?.onChange?.(e.value, t);
|
|
@@ -1068,50 +1076,50 @@ const tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1068
1076
|
renderDynamicTags: Ye,
|
|
1069
1077
|
renderInput: Le,
|
|
1070
1078
|
renderInputNumber: ll,
|
|
1071
|
-
renderPopSelect:
|
|
1079
|
+
renderPopSelect: Ge,
|
|
1072
1080
|
renderRadioButtonGroup: qe,
|
|
1073
1081
|
renderRadioGroup: Ze,
|
|
1074
|
-
renderSelect:
|
|
1082
|
+
renderSelect: He,
|
|
1075
1083
|
renderSlider: el,
|
|
1076
1084
|
renderSwitch: Ke,
|
|
1077
1085
|
renderTimePicker: Qe,
|
|
1078
|
-
renderTreeSelect:
|
|
1086
|
+
renderTreeSelect: Ue
|
|
1079
1087
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1080
1088
|
function al(e) {
|
|
1081
|
-
return function(t,
|
|
1082
|
-
const
|
|
1083
|
-
renderInput: (l) =>
|
|
1084
|
-
renderSelect: (l) =>
|
|
1085
|
-
renderPopSelect: (l) =>
|
|
1086
|
-
renderTreeSelect: (l) =>
|
|
1087
|
-
renderRadioGroup: (l) =>
|
|
1088
|
-
renderRadioButtonGroup: (l) =>
|
|
1089
|
-
renderCheckboxGroup: (l) =>
|
|
1090
|
-
renderSwitch: (l) =>
|
|
1091
|
-
renderDatePicker: (l) =>
|
|
1092
|
-
renderTimePicker: (l) =>
|
|
1093
|
-
renderCheckbox: (l) =>
|
|
1094
|
-
renderDynamicTags: (l) =>
|
|
1095
|
-
renderSlider: (l) =>
|
|
1096
|
-
renderInputNumber: (l) =>
|
|
1089
|
+
return function(t, n = !0) {
|
|
1090
|
+
const s = e, u = {
|
|
1091
|
+
renderInput: (l) => s.renderInput(l.value, l.renderProps ?? {}, l),
|
|
1092
|
+
renderSelect: (l) => s.renderSelect(l.value, l.options ?? [], l.renderProps ?? {}, l),
|
|
1093
|
+
renderPopSelect: (l) => s.renderPopSelect(l.value, l.options ?? [], l.renderProps ?? {}, l),
|
|
1094
|
+
renderTreeSelect: (l) => s.renderTreeSelect(l.value, l.options ?? [], l.renderProps ?? {}, l),
|
|
1095
|
+
renderRadioGroup: (l) => s.renderRadioGroup(l.value, l.options ?? [], l.renderProps ?? {}, l),
|
|
1096
|
+
renderRadioButtonGroup: (l) => s.renderRadioButtonGroup(l.value, l.options ?? [], l.renderProps ?? {}, l),
|
|
1097
|
+
renderCheckboxGroup: (l) => s.renderCheckboxGroup(l.value, l.options ?? [], l.renderProps ?? {}, l),
|
|
1098
|
+
renderSwitch: (l) => s.renderSwitch(l.value, l.renderProps ?? {}, l),
|
|
1099
|
+
renderDatePicker: (l) => s.renderDatePicker(l.value, l.renderProps ?? {}, l),
|
|
1100
|
+
renderTimePicker: (l) => s.renderTimePicker(l.value, l.renderProps ?? {}, l),
|
|
1101
|
+
renderCheckbox: (l) => s.renderCheckbox(l.value, l.renderProps ?? {}, l),
|
|
1102
|
+
renderDynamicTags: (l) => s.renderDynamicTags(l.value, l.renderProps ?? {}, l),
|
|
1103
|
+
renderSlider: (l) => s.renderSlider(l.value, l.renderProps ?? {}, l),
|
|
1104
|
+
renderInputNumber: (l) => s.renderInputNumber(l.value, l.renderProps ?? {}, l)
|
|
1097
1105
|
};
|
|
1098
1106
|
return t.map((l) => {
|
|
1099
|
-
const
|
|
1100
|
-
if (
|
|
1101
|
-
|
|
1107
|
+
const i = l;
|
|
1108
|
+
if (i.value = ce(l.value), typeof l.render2 == "function")
|
|
1109
|
+
i.render2 = l.render2;
|
|
1102
1110
|
else {
|
|
1103
|
-
const
|
|
1104
|
-
|
|
1111
|
+
const b = l.renderType ?? "renderInput", a = u[b];
|
|
1112
|
+
a ? i.render2 = () => a(i) : (console.warn(`[useDecorateForm] unknown renderType: ${l.renderType}`), i.render2 = () => u.renderInput(i));
|
|
1105
1113
|
}
|
|
1106
|
-
return
|
|
1114
|
+
return n ? me(i) : i;
|
|
1107
1115
|
});
|
|
1108
1116
|
};
|
|
1109
1117
|
}
|
|
1110
1118
|
const yl = al(tl);
|
|
1111
|
-
function
|
|
1112
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" &&
|
|
1119
|
+
function j(e) {
|
|
1120
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
1113
1121
|
}
|
|
1114
|
-
const ml = /* @__PURE__ */
|
|
1122
|
+
const ml = /* @__PURE__ */ A({
|
|
1115
1123
|
name: "EleZealTableSearch",
|
|
1116
1124
|
props: {
|
|
1117
1125
|
title: {
|
|
@@ -1155,6 +1163,10 @@ const ml = /* @__PURE__ */ I({
|
|
|
1155
1163
|
isMobile: {
|
|
1156
1164
|
type: Boolean,
|
|
1157
1165
|
default: !1
|
|
1166
|
+
},
|
|
1167
|
+
formSize: {
|
|
1168
|
+
type: String,
|
|
1169
|
+
default: "default"
|
|
1158
1170
|
}
|
|
1159
1171
|
},
|
|
1160
1172
|
emits: {
|
|
@@ -1165,84 +1177,85 @@ const ml = /* @__PURE__ */ I({
|
|
|
1165
1177
|
setup(e, {
|
|
1166
1178
|
emit: o,
|
|
1167
1179
|
slots: t,
|
|
1168
|
-
expose:
|
|
1180
|
+
expose: n
|
|
1169
1181
|
}) {
|
|
1170
|
-
const
|
|
1171
|
-
|
|
1172
|
-
},
|
|
1173
|
-
e.copyDefault ?
|
|
1174
|
-
},
|
|
1175
|
-
const
|
|
1176
|
-
o("onSearch",
|
|
1182
|
+
const s = I(!1), u = I({}), f = fe(e.searchItems), l = (a) => {
|
|
1183
|
+
s.value = a ?? !s.value;
|
|
1184
|
+
}, i = () => {
|
|
1185
|
+
e.copyDefault ? f.setValues(u.value) : f.onReset(null), o("onReset"), l(!1);
|
|
1186
|
+
}, b = () => {
|
|
1187
|
+
const a = f.getValues();
|
|
1188
|
+
o("onSearch", a), l(!1);
|
|
1177
1189
|
};
|
|
1178
|
-
return
|
|
1179
|
-
e.closeDrawerAuto ||
|
|
1180
|
-
}),
|
|
1181
|
-
await X(), e.copyDefault && (u.value =
|
|
1182
|
-
}),
|
|
1183
|
-
onReset:
|
|
1184
|
-
onSearch:
|
|
1190
|
+
return _(() => e.isMobile, (a) => {
|
|
1191
|
+
e.closeDrawerAuto || a || l(!1);
|
|
1192
|
+
}), be(async () => {
|
|
1193
|
+
await X(), e.copyDefault && (u.value = f.getValues());
|
|
1194
|
+
}), n({
|
|
1195
|
+
onReset: i,
|
|
1196
|
+
onSearch: b,
|
|
1185
1197
|
toggleDrawer: l,
|
|
1186
|
-
getParams: () =>
|
|
1198
|
+
getParams: () => f.getValues()
|
|
1187
1199
|
}), () => {
|
|
1188
|
-
const [
|
|
1189
|
-
return
|
|
1200
|
+
const [a, c] = e.searchBtnTxt;
|
|
1201
|
+
return r("div", {
|
|
1190
1202
|
class: "eleZealTableSearch"
|
|
1191
|
-
}, [!e.mobileDrawer || !e.isMobile ?
|
|
1203
|
+
}, [!e.mobileDrawer || !e.isMobile ? r(O, null, [t.title?.() ?? r("div", {
|
|
1192
1204
|
class: "naiTitle"
|
|
1193
|
-
}, [e.title]),
|
|
1205
|
+
}, [e.title]), r("div", {
|
|
1194
1206
|
class: "searchForm",
|
|
1195
1207
|
style: {
|
|
1196
1208
|
maxHeight: e.searchFormMaxHeight
|
|
1197
1209
|
}
|
|
1198
|
-
}, [
|
|
1210
|
+
}, [r(q, {
|
|
1199
1211
|
items: e.searchItems,
|
|
1200
1212
|
preset: "grid",
|
|
1201
1213
|
formConfig: {
|
|
1202
1214
|
labelPosition: "left",
|
|
1203
|
-
showMessage: !1
|
|
1204
|
-
// showFeedback: false
|
|
1215
|
+
showMessage: !1,
|
|
1216
|
+
// showFeedback: false,
|
|
1217
|
+
size: e.formSize
|
|
1205
1218
|
}
|
|
1206
1219
|
}, null)]), t.searchBtn ? t.searchBtn?.({
|
|
1207
|
-
onSearch:
|
|
1208
|
-
onReset:
|
|
1209
|
-
}) :
|
|
1220
|
+
onSearch: b,
|
|
1221
|
+
onReset: i
|
|
1222
|
+
}) : r("div", {
|
|
1210
1223
|
class: "searchBtn"
|
|
1211
|
-
}, [
|
|
1224
|
+
}, [r(C, {
|
|
1212
1225
|
size: "small",
|
|
1213
|
-
onClick:
|
|
1214
|
-
},
|
|
1215
|
-
default: () => [
|
|
1216
|
-
}),
|
|
1226
|
+
onClick: i
|
|
1227
|
+
}, j(a) ? a : {
|
|
1228
|
+
default: () => [a]
|
|
1229
|
+
}), r(C, {
|
|
1217
1230
|
type: "primary",
|
|
1218
1231
|
size: "small",
|
|
1219
|
-
onClick:
|
|
1220
|
-
},
|
|
1232
|
+
onClick: b
|
|
1233
|
+
}, j(c) ? c : {
|
|
1221
1234
|
default: () => [c]
|
|
1222
|
-
})])]) :
|
|
1235
|
+
})])]) : r("div", {
|
|
1223
1236
|
class: "drawerSearchBtn"
|
|
1224
|
-
}, [t.title?.() ??
|
|
1237
|
+
}, [t.title?.() ?? r("div", {
|
|
1225
1238
|
class: "naiTitle"
|
|
1226
1239
|
}, [e.title]), t.drawerBtn ? t.drawerBtn?.({
|
|
1227
1240
|
openDrawer: () => l(!0)
|
|
1228
|
-
}) :
|
|
1241
|
+
}) : r(C, {
|
|
1229
1242
|
size: "small",
|
|
1230
1243
|
onClick: () => {
|
|
1231
1244
|
l(!0);
|
|
1232
1245
|
}
|
|
1233
1246
|
}, {
|
|
1234
1247
|
default: () => [e.drawerOpenTxt]
|
|
1235
|
-
})]),
|
|
1248
|
+
})]), r(Pe, {
|
|
1236
1249
|
class: "eleZealSearchDrawer",
|
|
1237
|
-
modelValue:
|
|
1238
|
-
"onUpdate:modelValue": (
|
|
1250
|
+
modelValue: s.value,
|
|
1251
|
+
"onUpdate:modelValue": (d) => s.value = d,
|
|
1239
1252
|
size: e.size,
|
|
1240
1253
|
trapFocus: !1,
|
|
1241
1254
|
direction: "ttb"
|
|
1242
1255
|
}, {
|
|
1243
|
-
default: () => [
|
|
1256
|
+
default: () => [r("div", {
|
|
1244
1257
|
class: "searchForm"
|
|
1245
|
-
}, [
|
|
1258
|
+
}, [r(q, {
|
|
1246
1259
|
formConfig: {
|
|
1247
1260
|
labelPosition: "left",
|
|
1248
1261
|
size: "small",
|
|
@@ -1250,28 +1263,28 @@ const ml = /* @__PURE__ */ I({
|
|
|
1250
1263
|
},
|
|
1251
1264
|
items: e.searchItems
|
|
1252
1265
|
}, null)])],
|
|
1253
|
-
header: () =>
|
|
1266
|
+
header: () => r("div", null, [e.drawerTitle ?? e.title]),
|
|
1254
1267
|
footer: () => t.searchBtn ? t.searchBtn?.({
|
|
1255
|
-
onSearch:
|
|
1256
|
-
onReset:
|
|
1257
|
-
}) :
|
|
1268
|
+
onSearch: b,
|
|
1269
|
+
onReset: i
|
|
1270
|
+
}) : r("div", {
|
|
1258
1271
|
class: "searchBtn"
|
|
1259
|
-
}, [
|
|
1272
|
+
}, [r(C, {
|
|
1260
1273
|
size: "small",
|
|
1261
|
-
onClick:
|
|
1262
|
-
},
|
|
1263
|
-
default: () => [
|
|
1264
|
-
}),
|
|
1274
|
+
onClick: i
|
|
1275
|
+
}, j(a) ? a : {
|
|
1276
|
+
default: () => [a]
|
|
1277
|
+
}), r(C, {
|
|
1265
1278
|
type: "primary",
|
|
1266
1279
|
size: "small",
|
|
1267
|
-
onClick:
|
|
1268
|
-
},
|
|
1280
|
+
onClick: b
|
|
1281
|
+
}, j(c) ? c : {
|
|
1269
1282
|
default: () => [c]
|
|
1270
1283
|
})])
|
|
1271
1284
|
})]);
|
|
1272
1285
|
};
|
|
1273
1286
|
}
|
|
1274
|
-
}),
|
|
1287
|
+
}), bl = /* @__PURE__ */ A({
|
|
1275
1288
|
name: "EleZealTablePaginationControl",
|
|
1276
1289
|
props: {
|
|
1277
1290
|
pagination: {
|
|
@@ -1290,21 +1303,21 @@ const ml = /* @__PURE__ */ I({
|
|
|
1290
1303
|
setup(e, {
|
|
1291
1304
|
slots: o
|
|
1292
1305
|
}) {
|
|
1293
|
-
const t =
|
|
1294
|
-
function
|
|
1306
|
+
const t = pe(e, "pagination");
|
|
1307
|
+
function n(u) {
|
|
1295
1308
|
t.value.pageNo = u, t.value?.onChange();
|
|
1296
1309
|
}
|
|
1297
|
-
function
|
|
1310
|
+
function s(u) {
|
|
1298
1311
|
t.value.pageNo = 1, t.value.pageSize = u, t.value?.onPageSizeChange();
|
|
1299
1312
|
}
|
|
1300
|
-
return () =>
|
|
1313
|
+
return () => r(Ve, E({
|
|
1301
1314
|
currentPage: t.value?.pageNo,
|
|
1302
1315
|
"page-size": t.value?.pageSize,
|
|
1303
1316
|
total: t.value?.total,
|
|
1304
1317
|
pageSizes: t.value?.pageSizes,
|
|
1305
1318
|
layout: !o.default && e.isMobile ? rl(t.value?.layout) : t.value?.layout,
|
|
1306
|
-
"onUpdate:current-page":
|
|
1307
|
-
"onUpdate:page-size":
|
|
1319
|
+
"onUpdate:current-page": n,
|
|
1320
|
+
"onUpdate:page-size": s
|
|
1308
1321
|
}, e.pageConfig), {
|
|
1309
1322
|
...o
|
|
1310
1323
|
});
|
|
@@ -1313,7 +1326,7 @@ const ml = /* @__PURE__ */ I({
|
|
|
1313
1326
|
if (!e || o.length === 0) return e;
|
|
1314
1327
|
const t = new RegExp(`(^|,\\s*)(${o.map(nl).join("|")})(?=\\s*,|$)`, "g");
|
|
1315
1328
|
return e.replace(t, "").replace(/^,|,$/g, "");
|
|
1316
|
-
}, pl = /* @__PURE__ */
|
|
1329
|
+
}, pl = /* @__PURE__ */ A({
|
|
1317
1330
|
name: "EleZealTable",
|
|
1318
1331
|
props: {
|
|
1319
1332
|
data: {
|
|
@@ -1351,29 +1364,128 @@ const ml = /* @__PURE__ */ I({
|
|
|
1351
1364
|
slots: o,
|
|
1352
1365
|
attrs: t
|
|
1353
1366
|
}) {
|
|
1354
|
-
return () =>
|
|
1367
|
+
return () => ve(r(De, E(e.tableConfig, t, {
|
|
1355
1368
|
data: e.data,
|
|
1356
1369
|
maxHeight: e.maxHeight,
|
|
1357
1370
|
stripe: e.stripe,
|
|
1358
1371
|
border: e.border
|
|
1359
1372
|
}), {
|
|
1360
|
-
default: () => [e.columns.map((
|
|
1361
|
-
const
|
|
1362
|
-
render2:
|
|
1373
|
+
default: () => [e.columns.map((n) => {
|
|
1374
|
+
const s = n.key ?? String(n.prop ?? n.label), u = n.align ?? e.columnAlign, {
|
|
1375
|
+
render2: f,
|
|
1363
1376
|
slot: l,
|
|
1364
|
-
...
|
|
1365
|
-
} =
|
|
1366
|
-
return
|
|
1377
|
+
...i
|
|
1378
|
+
} = n, b = l || (n.prop ? `cell-${String(n.prop)}` : void 0), a = b ? o[b] : void 0;
|
|
1379
|
+
return r(Ne, E(i, {
|
|
1367
1380
|
align: u,
|
|
1368
|
-
key:
|
|
1381
|
+
key: s
|
|
1369
1382
|
}), {
|
|
1370
|
-
default: (c) =>
|
|
1383
|
+
default: (c) => f ? f(c.row, c.$index) : a ? a(c) : n.prop ? c.row[n.prop] : null
|
|
1371
1384
|
});
|
|
1372
1385
|
})],
|
|
1373
1386
|
...o
|
|
1374
|
-
}), [[
|
|
1387
|
+
}), [[ge("loading"), e.loading]]);
|
|
1388
|
+
}
|
|
1389
|
+
}), vl = /* @__PURE__ */ A({
|
|
1390
|
+
name: "EleZealTableBtnControl",
|
|
1391
|
+
props: {
|
|
1392
|
+
isMobile: {
|
|
1393
|
+
type: Boolean,
|
|
1394
|
+
default: !1
|
|
1395
|
+
},
|
|
1396
|
+
btnItems: {
|
|
1397
|
+
type: Array,
|
|
1398
|
+
default: () => []
|
|
1399
|
+
},
|
|
1400
|
+
size: {
|
|
1401
|
+
type: String,
|
|
1402
|
+
default: "small"
|
|
1403
|
+
},
|
|
1404
|
+
dropDownProps: {
|
|
1405
|
+
type: Object
|
|
1406
|
+
},
|
|
1407
|
+
dropDownText: {
|
|
1408
|
+
type: String,
|
|
1409
|
+
default: "controls"
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
slots: Object,
|
|
1413
|
+
emits: {
|
|
1414
|
+
onSelect: (e) => !0
|
|
1415
|
+
},
|
|
1416
|
+
setup(e, {
|
|
1417
|
+
emit: o,
|
|
1418
|
+
slots: t
|
|
1419
|
+
}) {
|
|
1420
|
+
const n = (s) => {
|
|
1421
|
+
e.btnItems.find((u) => u.key === s)?.onSelect?.(s), o("onSelect", s);
|
|
1422
|
+
};
|
|
1423
|
+
return () => {
|
|
1424
|
+
const {
|
|
1425
|
+
btnItems: s,
|
|
1426
|
+
dropDownProps: u,
|
|
1427
|
+
dropDownText: f,
|
|
1428
|
+
isMobile: l,
|
|
1429
|
+
size: i
|
|
1430
|
+
} = e;
|
|
1431
|
+
return r("div", {
|
|
1432
|
+
class: "zealTableBtnControl"
|
|
1433
|
+
}, [l ? r(le, E(u, {
|
|
1434
|
+
size: i,
|
|
1435
|
+
trigger: "click",
|
|
1436
|
+
placement: "bottom",
|
|
1437
|
+
onCommand: n
|
|
1438
|
+
}), {
|
|
1439
|
+
default: () => [t.text?.() ?? r(C, {
|
|
1440
|
+
size: i
|
|
1441
|
+
}, j(f) ? f : {
|
|
1442
|
+
default: () => [f]
|
|
1443
|
+
})],
|
|
1444
|
+
dropdown: () => {
|
|
1445
|
+
let b;
|
|
1446
|
+
return r(te, null, j(b = s.map((a) => r(ae, {
|
|
1447
|
+
command: a.key,
|
|
1448
|
+
disabled: a.disabled,
|
|
1449
|
+
key: a.key
|
|
1450
|
+
}, {
|
|
1451
|
+
default: () => [a.title]
|
|
1452
|
+
}))) ? b : {
|
|
1453
|
+
default: () => [b]
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
}) : s.map((b) => {
|
|
1457
|
+
const {
|
|
1458
|
+
key: a,
|
|
1459
|
+
onSelect: c,
|
|
1460
|
+
title: d,
|
|
1461
|
+
...m
|
|
1462
|
+
} = b;
|
|
1463
|
+
return r(C, E(m, {
|
|
1464
|
+
size: i,
|
|
1465
|
+
key: a,
|
|
1466
|
+
onClick: () => {
|
|
1467
|
+
c?.(a), o("onSelect", a);
|
|
1468
|
+
}
|
|
1469
|
+
}), j(d) ? d : {
|
|
1470
|
+
default: () => [d]
|
|
1471
|
+
});
|
|
1472
|
+
})]);
|
|
1473
|
+
};
|
|
1375
1474
|
}
|
|
1376
1475
|
});
|
|
1476
|
+
function gl(e, o) {
|
|
1477
|
+
const t = I(null), n = R(() => {
|
|
1478
|
+
const s = t.value;
|
|
1479
|
+
return e({
|
|
1480
|
+
isMobile: s?.isMobile ?? I(!1),
|
|
1481
|
+
tableHeight: s?.tableHeight ?? I(0)
|
|
1482
|
+
}).map((u) => ({ ...o, ...u }));
|
|
1483
|
+
});
|
|
1484
|
+
return {
|
|
1485
|
+
eleZealCardRef: t,
|
|
1486
|
+
tableColumns: n
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1377
1489
|
export {
|
|
1378
1490
|
dl as EleDynamicCascadeInput,
|
|
1379
1491
|
q as EleDynamicForm,
|
|
@@ -1381,7 +1493,8 @@ export {
|
|
|
1381
1493
|
cl as ElePopupModal,
|
|
1382
1494
|
fl as EleZealCard,
|
|
1383
1495
|
pl as EleZealTable,
|
|
1384
|
-
vl as
|
|
1496
|
+
vl as EleZealTableBtnControl,
|
|
1497
|
+
bl as EleZealTablePaginationControl,
|
|
1385
1498
|
ml as EleZealTableSearch,
|
|
1386
1499
|
Xe as renderCheckbox,
|
|
1387
1500
|
We as renderCheckboxGroup,
|
|
@@ -1389,13 +1502,14 @@ export {
|
|
|
1389
1502
|
Ye as renderDynamicTags,
|
|
1390
1503
|
Le as renderInput,
|
|
1391
1504
|
ll as renderInputNumber,
|
|
1392
|
-
|
|
1505
|
+
Ge as renderPopSelect,
|
|
1393
1506
|
qe as renderRadioButtonGroup,
|
|
1394
1507
|
Ze as renderRadioGroup,
|
|
1395
|
-
|
|
1508
|
+
He as renderSelect,
|
|
1396
1509
|
el as renderSlider,
|
|
1397
1510
|
Ke as renderSwitch,
|
|
1398
1511
|
Qe as renderTimePicker,
|
|
1399
|
-
|
|
1400
|
-
yl as useDecorateForm
|
|
1512
|
+
Ue as renderTreeSelect,
|
|
1513
|
+
yl as useDecorateForm,
|
|
1514
|
+
gl as useZealColumnTool
|
|
1401
1515
|
};
|