dynamicformdjx 0.6.1 → 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/dist/elementPlus/EleZealTableTool.d.ts +11 -2
- package/dist/elementPlus/index.cjs +1 -1
- package/dist/elementPlus/index.mjs +313 -301
- package/dist/{index-BQKYL550.js → index-Bsj3F9SM.js} +9 -9
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.mjs +347 -320
- package/dist/naiveUi/index.cjs +1 -1
- package/dist/naiveUi/index.mjs +306 -300
- package/dist/origin/LoadedScroll.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as N, r as $, f as Q, p as oe, s as ue,
|
|
2
|
-
import { defineComponent as A, ref as
|
|
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
|
|
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
4
|
const il = /* @__PURE__ */ A({
|
|
5
5
|
name: "EleDynamicInput",
|
|
6
6
|
props: {
|
|
@@ -40,7 +40,7 @@ const il = /* @__PURE__ */ A({
|
|
|
40
40
|
setup(e, {
|
|
41
41
|
emit: o,
|
|
42
42
|
expose: t,
|
|
43
|
-
slots:
|
|
43
|
+
slots: n
|
|
44
44
|
}) {
|
|
45
45
|
const s = {
|
|
46
46
|
resetTxt: "重置",
|
|
@@ -58,7 +58,7 @@ const il = /* @__PURE__ */ A({
|
|
|
58
58
|
}, f = {
|
|
59
59
|
arraySplitSymbol: ",",
|
|
60
60
|
...e.dyListConfigs
|
|
61
|
-
}, l = e.size, i =
|
|
61
|
+
}, l = e.size, i = I(N(e.modelValue, e.randomFun, f.arraySplitSymbol)), b = I(null);
|
|
62
62
|
_(i, (m) => {
|
|
63
63
|
if (!e.isController) return;
|
|
64
64
|
const S = $(m, f.arraySplitSymbol);
|
|
@@ -71,37 +71,37 @@ const il = /* @__PURE__ */ A({
|
|
|
71
71
|
},
|
|
72
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
79
|
i.value = N(e.modelValue, e.randomFun, f.arraySplitSymbol), o("onReset");
|
|
80
80
|
}, d = () => {
|
|
81
|
-
i.value.sort((S,
|
|
81
|
+
i.value.sort((S, p) => +S.rId - +p.rId);
|
|
82
82
|
const m = $(i.value, f.arraySplitSymbol);
|
|
83
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
|
-
}, [
|
|
90
|
+
}, [r("div", {
|
|
91
91
|
class: `dyFormList ${i.value.length ? "" : "noList"}`,
|
|
92
|
-
ref:
|
|
93
|
-
}, [i.value.map((m, S,
|
|
92
|
+
ref: b
|
|
93
|
+
}, [i.value.map((m, S, p) => {
|
|
94
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"
|
|
@@ -114,19 +114,19 @@ const il = /* @__PURE__ */ A({
|
|
|
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), F(":"),
|
|
129
|
+
}, null), F(":"), r(D, {
|
|
130
130
|
size: l,
|
|
131
131
|
modelValue: m.value,
|
|
132
132
|
class: "value",
|
|
@@ -134,14 +134,14 @@ const il = /* @__PURE__ */ A({
|
|
|
134
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
141
|
onClick: v.toggleArray
|
|
142
142
|
}, {
|
|
143
143
|
default: () => [F("Array")]
|
|
144
|
-
}), !u.hideNumberBtn &&
|
|
144
|
+
}), !u.hideNumberBtn && r(C, {
|
|
145
145
|
class: "typeBtn",
|
|
146
146
|
type: m.isNumber ? "success" : "default",
|
|
147
147
|
size: "small",
|
|
@@ -149,43 +149,43 @@ const il = /* @__PURE__ */ A({
|
|
|
149
149
|
}, {
|
|
150
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
157
|
disabled: !v.isLast,
|
|
158
158
|
onClick: v.addItem
|
|
159
159
|
}, {
|
|
160
160
|
default: () => [F("+")]
|
|
161
|
-
}),
|
|
161
|
+
}), r(C, {
|
|
162
162
|
size: l,
|
|
163
163
|
type: "danger",
|
|
164
164
|
onClick: v.removeItem
|
|
165
165
|
}, {
|
|
166
166
|
default: () => [F("-")]
|
|
167
167
|
})])])]);
|
|
168
|
-
})]),
|
|
168
|
+
})]), r("div", {
|
|
169
169
|
class: `control ${i.value.length ? "" : "noList"}`
|
|
170
|
-
}, [!i.value.length && (
|
|
171
|
-
newItem:
|
|
172
|
-
}) :
|
|
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
177
|
default: () => [s.newTxt]
|
|
178
|
-
})), !e.isController &&
|
|
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
185
|
default: () => [s.resetTxt]
|
|
186
|
-
})),
|
|
186
|
+
})), n.mergeBtn ? n.mergeBtn({
|
|
187
187
|
merge: d
|
|
188
|
-
}) :
|
|
188
|
+
}) : r(C, {
|
|
189
189
|
size: l,
|
|
190
190
|
type: "info",
|
|
191
191
|
onClick: d
|
|
@@ -242,7 +242,7 @@ const dl = /* @__PURE__ */ A({
|
|
|
242
242
|
setup(e, {
|
|
243
243
|
emit: o,
|
|
244
244
|
expose: t,
|
|
245
|
-
slots:
|
|
245
|
+
slots: n
|
|
246
246
|
}) {
|
|
247
247
|
const s = {
|
|
248
248
|
resetTxt: "重置",
|
|
@@ -263,32 +263,32 @@ const dl = /* @__PURE__ */ A({
|
|
|
263
263
|
}, f = {
|
|
264
264
|
arraySplitSymbol: ",",
|
|
265
265
|
...e.dyListConfigs
|
|
266
|
-
}, l = (
|
|
267
|
-
let y =
|
|
268
|
-
const w = Array.isArray(y),
|
|
269
|
-
return l(typeof y) && (y =
|
|
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
271
|
key: v,
|
|
272
|
-
value: Object.prototype.toString.call(y) === "[object Object]" ? i(
|
|
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
|
-
}),
|
|
276
|
+
}), b = (p) => p.reduce((v, h) => {
|
|
277
277
|
const y = h.value;
|
|
278
|
-
return h.key.trim().length && (v[h.key] = Array.isArray(y) ?
|
|
279
|
-
}, {}),
|
|
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
280
|
class: [`depth-${v}`, u.showBorder ? "" : "no-border", u.showPad ? "" : "no-pad"],
|
|
281
281
|
style: {
|
|
282
282
|
"--depth": v,
|
|
283
283
|
["--c" + [v]]: ue(u.borderColors, v)
|
|
284
284
|
}
|
|
285
|
-
}, [
|
|
286
|
-
const B = Array.isArray(y.value), V = l(typeof y.value),
|
|
285
|
+
}, [p.map((y, w, z) => {
|
|
286
|
+
const B = Array.isArray(y.value), V = l(typeof y.value), x = {
|
|
287
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: ""
|
|
@@ -302,10 +302,10 @@ const dl = /* @__PURE__ */ A({
|
|
|
302
302
|
});
|
|
303
303
|
},
|
|
304
304
|
removeItem: () => {
|
|
305
|
-
if (
|
|
306
|
-
if (h === void 0) return
|
|
307
|
-
const T =
|
|
308
|
-
v < 1 ?
|
|
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 = "";
|
|
@@ -314,19 +314,19 @@ const dl = /* @__PURE__ */ A({
|
|
|
314
314
|
toggleArray: () => y.isArray = !y.isArray,
|
|
315
315
|
toggleNumber: () => y.isNumber = !y.isNumber
|
|
316
316
|
};
|
|
317
|
-
return
|
|
317
|
+
return r("div", {
|
|
318
318
|
class: "dItem",
|
|
319
319
|
key: y.rId,
|
|
320
320
|
style: {
|
|
321
321
|
marginLeft: v > 1 ? `${v * u.retractLen}px` : "0"
|
|
322
322
|
}
|
|
323
|
-
}, [
|
|
323
|
+
}, [r("div", {
|
|
324
324
|
class: "input"
|
|
325
|
-
}, [!B &&
|
|
325
|
+
}, [!B && r(O, null, [r(D, {
|
|
326
326
|
modelValue: y.key,
|
|
327
327
|
class: "key",
|
|
328
328
|
onInput: (T) => y.key = T
|
|
329
|
-
}, null), F(":")]),
|
|
329
|
+
}, null), F(":")]), r(D, {
|
|
330
330
|
class: `value ${B ? "isKey" : ""}`,
|
|
331
331
|
modelValue: V ? y.value : y.key,
|
|
332
332
|
onInput: (T) => {
|
|
@@ -337,22 +337,22 @@ const dl = /* @__PURE__ */ A({
|
|
|
337
337
|
u.allowFilter && y.isNumber ? y.value = Q(T, y.isArray, f.arraySplitSymbol) : y.value = T;
|
|
338
338
|
}
|
|
339
339
|
}, {
|
|
340
|
-
prefix: Array.isArray(y.value) ? void 0 : () =>
|
|
340
|
+
prefix: Array.isArray(y.value) ? void 0 : () => n.typeTools ? n.typeTools(x) : r(O, null, [!u.hideArrayBtn && r(C, {
|
|
341
341
|
type: y.isArray ? "success" : "default",
|
|
342
342
|
size: "small",
|
|
343
|
-
onClick:
|
|
343
|
+
onClick: x.toggleArray
|
|
344
344
|
}, {
|
|
345
345
|
default: () => [F("Array")]
|
|
346
|
-
}), F(" "), !u.hideNumberBtn &&
|
|
346
|
+
}), F(" "), !u.hideNumberBtn && r(C, {
|
|
347
347
|
type: y.isNumber ? "success" : "default",
|
|
348
348
|
size: "small",
|
|
349
|
-
onClick:
|
|
349
|
+
onClick: x.toggleNumber
|
|
350
350
|
}, {
|
|
351
351
|
default: () => [F("Number")]
|
|
352
352
|
})]),
|
|
353
353
|
suffix: () => {
|
|
354
354
|
let T;
|
|
355
|
-
return v < e.depth ? !B && (
|
|
355
|
+
return v < e.depth ? !B && (n.newChild ? n.newChild(x) : r(C, {
|
|
356
356
|
type: "success",
|
|
357
357
|
size: "small",
|
|
358
358
|
onClick: () => {
|
|
@@ -366,69 +366,69 @@ const dl = /* @__PURE__ */ A({
|
|
|
366
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
376
|
default: () => [F("+")]
|
|
377
|
-
}),
|
|
377
|
+
}), r(C, {
|
|
378
378
|
type: "danger",
|
|
379
|
-
onClick:
|
|
379
|
+
onClick: x.removeItem
|
|
380
380
|
}, {
|
|
381
381
|
default: () => [F("-")]
|
|
382
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 v = p
|
|
387
|
-
o("update:modelValue", v), o("onMerge", v, P(
|
|
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 d = () =>
|
|
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
|
-
}, [!
|
|
413
|
+
}, [c(a.value)]), r("div", {
|
|
414
|
+
class: `control ${a.value.length ? "" : "noObj"}`
|
|
415
|
+
}, [!a.value.length && (n.newBtn ? n.newBtn({
|
|
416
416
|
newItem: d
|
|
417
|
-
}) :
|
|
417
|
+
}) : r(C, {
|
|
418
418
|
type: "success",
|
|
419
419
|
onClick: d
|
|
420
420
|
}, {
|
|
421
421
|
default: () => [s.newTxt]
|
|
422
|
-
})), !e.isController &&
|
|
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
428
|
default: () => [s.resetTxt]
|
|
429
|
-
})),
|
|
429
|
+
})), n.mergeBtn ? n.mergeBtn({
|
|
430
430
|
merge: S
|
|
431
|
-
}) :
|
|
431
|
+
}) : r(C, {
|
|
432
432
|
type: "info",
|
|
433
433
|
onClick: S
|
|
434
434
|
}, {
|
|
@@ -471,7 +471,7 @@ const dl = /* @__PURE__ */ A({
|
|
|
471
471
|
expose: o,
|
|
472
472
|
slots: t
|
|
473
473
|
}) {
|
|
474
|
-
const
|
|
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
475
|
...s.value?.reduce((c, d) => {
|
|
476
476
|
let m = d.rule;
|
|
477
477
|
return d.required && !d.rule && (m = {
|
|
@@ -481,43 +481,43 @@ const dl = /* @__PURE__ */ A({
|
|
|
481
481
|
}), c[d.key] = m, c;
|
|
482
482
|
}, {}),
|
|
483
483
|
...e.rules
|
|
484
|
-
})), l =
|
|
484
|
+
})), l = R(() => [...s.value].sort((c, d) => {
|
|
485
485
|
const m = c.sort ?? 1 / 0, S = d.sort ?? 1 / 0;
|
|
486
486
|
return Number(m) - Number(S);
|
|
487
487
|
}));
|
|
488
|
-
function i(
|
|
488
|
+
function i(a = null) {
|
|
489
489
|
s.value && s.value.forEach((c) => {
|
|
490
|
-
c.value.value =
|
|
490
|
+
c.value.value = a;
|
|
491
491
|
});
|
|
492
492
|
}
|
|
493
|
-
function
|
|
494
|
-
return new Promise((
|
|
495
|
-
|
|
496
|
-
d ?
|
|
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
501
|
reset: i,
|
|
502
|
-
validator:
|
|
503
|
-
getResult: (
|
|
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
513
|
rules: f.value
|
|
514
514
|
}), {
|
|
515
515
|
default() {
|
|
516
|
-
const
|
|
516
|
+
const a = l.value;
|
|
517
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
|
}, {
|
|
@@ -528,7 +528,7 @@ const dl = /* @__PURE__ */ A({
|
|
|
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
|
}, {
|
|
@@ -593,30 +593,30 @@ const cl = /* @__PURE__ */ A({
|
|
|
593
593
|
setup(e, {
|
|
594
594
|
expose: o,
|
|
595
595
|
emit: t,
|
|
596
|
-
slots:
|
|
596
|
+
slots: n
|
|
597
597
|
}) {
|
|
598
|
-
const s =
|
|
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
612
|
const i = async () => {
|
|
613
613
|
f.c = !0, (await e.onCancel?.() ?? !0) && l(!1), f.c = !1;
|
|
614
|
-
},
|
|
614
|
+
}, b = async () => {
|
|
615
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: {
|
|
@@ -626,28 +626,28 @@ const cl = /* @__PURE__ */ A({
|
|
|
626
626
|
appendTo: e.to
|
|
627
627
|
}, s.value), {
|
|
628
628
|
footer: () => {
|
|
629
|
-
const [
|
|
629
|
+
const [a, c] = e.footerTxt, {
|
|
630
630
|
c: d,
|
|
631
631
|
s: m
|
|
632
632
|
} = f;
|
|
633
|
-
return
|
|
633
|
+
return r("div", {
|
|
634
634
|
class: "flex justify-end align-center"
|
|
635
|
-
}, [
|
|
635
|
+
}, [r(C, {
|
|
636
636
|
size: "small",
|
|
637
637
|
onClick: i,
|
|
638
638
|
loading: d
|
|
639
|
-
}, K(
|
|
640
|
-
default: () => [
|
|
641
|
-
}),
|
|
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
|
});
|
|
@@ -686,7 +686,7 @@ const fl = /* @__PURE__ */ A({
|
|
|
686
686
|
slots: o,
|
|
687
687
|
expose: t
|
|
688
688
|
}) {
|
|
689
|
-
const
|
|
689
|
+
const n = se(...e.checkWindowSize), {
|
|
690
690
|
wrapRef: s,
|
|
691
691
|
cardRef: u,
|
|
692
692
|
restRef: f,
|
|
@@ -694,16 +694,16 @@ const fl = /* @__PURE__ */ A({
|
|
|
694
694
|
} = ie(U, e.observeDelay);
|
|
695
695
|
return t({
|
|
696
696
|
tableHeight: l,
|
|
697
|
-
isMobile:
|
|
697
|
+
isMobile: R(() => n.isMobile)
|
|
698
698
|
}), () => {
|
|
699
|
-
const i = de(
|
|
700
|
-
return
|
|
699
|
+
const i = de(n);
|
|
700
|
+
return r("div", {
|
|
701
701
|
class: "zealCard",
|
|
702
702
|
style: {
|
|
703
703
|
height: `calc(${e.zealHeight} - ${e.outPadding * 2}px)`
|
|
704
704
|
},
|
|
705
705
|
ref: s
|
|
706
|
-
}, [
|
|
706
|
+
}, [r(U, {
|
|
707
707
|
ref: u
|
|
708
708
|
}, {
|
|
709
709
|
default: () => [o.default?.({
|
|
@@ -711,32 +711,32 @@ const fl = /* @__PURE__ */ A({
|
|
|
711
711
|
...i
|
|
712
712
|
})],
|
|
713
713
|
header: () => {
|
|
714
|
-
const [
|
|
715
|
-
return
|
|
714
|
+
const [b, a] = e.searchBtnTxt;
|
|
715
|
+
return r("div", {
|
|
716
716
|
class: "header"
|
|
717
|
-
}, [o.header?.(i) ??
|
|
717
|
+
}, [o.header?.(i) ?? r(O, null, [r("div", {
|
|
718
718
|
class: "title"
|
|
719
|
-
}, [e.title]),
|
|
719
|
+
}, [e.title]), r("div", {
|
|
720
720
|
class: "search"
|
|
721
|
-
}, [o.searchForm?.(i), o.searchBtn?.(i) || o.searchForm &&
|
|
721
|
+
}, [o.searchForm?.(i), o.searchBtn?.(i) || o.searchForm && r("div", {
|
|
722
722
|
class: "searchBtn"
|
|
723
|
-
}, [
|
|
723
|
+
}, [r(C, {
|
|
724
724
|
size: "small"
|
|
725
|
-
}, J(
|
|
726
|
-
default: () => [
|
|
727
|
-
}),
|
|
725
|
+
}, J(b) ? b : {
|
|
726
|
+
default: () => [b]
|
|
727
|
+
}), r(C, {
|
|
728
728
|
type: "info",
|
|
729
729
|
size: "small"
|
|
730
|
-
}, J(
|
|
731
|
-
default: () => [
|
|
732
|
-
})])])]),
|
|
730
|
+
}, J(a) ? a : {
|
|
731
|
+
default: () => [a]
|
|
732
|
+
})])])]), r("div", {
|
|
733
733
|
class: "controlBtn"
|
|
734
|
-
}, [
|
|
734
|
+
}, [r("div", null, [o.controlBtn?.(i)]), o.toolBtn?.(i)])]);
|
|
735
735
|
},
|
|
736
|
-
footer: o.footer ? () =>
|
|
736
|
+
footer: o.footer ? () => r("div", {
|
|
737
737
|
class: "footer"
|
|
738
738
|
}, [o.footer?.(i)]) : null
|
|
739
|
-
}),
|
|
739
|
+
}), r("div", {
|
|
740
740
|
ref: f
|
|
741
741
|
}, [o.rest?.(i)])]);
|
|
742
742
|
};
|
|
@@ -757,17 +757,17 @@ function H(e) {
|
|
|
757
757
|
return { ...o, __isGroup: !1 };
|
|
758
758
|
});
|
|
759
759
|
}
|
|
760
|
-
function _e(e, o, t = "label",
|
|
760
|
+
function _e(e, o, t = "label", n = "value") {
|
|
761
761
|
const s = H(o);
|
|
762
762
|
for (const u of s)
|
|
763
763
|
if (u.__isGroup) {
|
|
764
764
|
for (const f of u.__children)
|
|
765
|
-
if (k(f,
|
|
766
|
-
} else if (k(u,
|
|
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);
|
|
767
767
|
return "";
|
|
768
768
|
}
|
|
769
769
|
function Le(e, o = {}, t) {
|
|
770
|
-
const { onChange:
|
|
770
|
+
const { onChange: n, value: s, ...u } = t;
|
|
771
771
|
return g(D, {
|
|
772
772
|
...u,
|
|
773
773
|
modelValue: e.value,
|
|
@@ -777,15 +777,15 @@ function Le(e, o = {}, t) {
|
|
|
777
777
|
...o
|
|
778
778
|
});
|
|
779
779
|
}
|
|
780
|
-
function He(e, o, t = {},
|
|
781
|
-
const { onChange: s, labelField: u, valueField: f, options: l, ...i } =
|
|
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
782
|
return g(
|
|
783
783
|
we,
|
|
784
784
|
{
|
|
785
785
|
...i,
|
|
786
786
|
modelValue: e.value,
|
|
787
787
|
"onUpdate:modelValue": (d) => {
|
|
788
|
-
e.value = d,
|
|
788
|
+
e.value = d, n?.onChange?.(d, n, c);
|
|
789
789
|
},
|
|
790
790
|
...t
|
|
791
791
|
},
|
|
@@ -794,10 +794,10 @@ function He(e, o, t = {}, a) {
|
|
|
794
794
|
if (d.__isGroup)
|
|
795
795
|
return g(
|
|
796
796
|
Te,
|
|
797
|
-
{ key: d.key ?? `g-${m}`, label: k(d,
|
|
797
|
+
{ key: d.key ?? `g-${m}`, label: k(d, b, d.label) },
|
|
798
798
|
{
|
|
799
799
|
default: () => (d.__children ?? []).map((v, h) => {
|
|
800
|
-
const y = k(v,
|
|
800
|
+
const y = k(v, b, v.label), w = k(v, a, v.value);
|
|
801
801
|
return g(Z, {
|
|
802
802
|
key: v.key ?? `${m}-${h}`,
|
|
803
803
|
label: y,
|
|
@@ -807,28 +807,28 @@ function He(e, o, t = {}, a) {
|
|
|
807
807
|
})
|
|
808
808
|
}
|
|
809
809
|
);
|
|
810
|
-
const S = k(d,
|
|
810
|
+
const S = k(d, b, d.label), p = k(d, a, d.value);
|
|
811
811
|
return g(Z, {
|
|
812
812
|
key: d.key ?? `${m}`,
|
|
813
813
|
label: S,
|
|
814
|
-
value:
|
|
814
|
+
value: p,
|
|
815
815
|
disabled: d.disabled
|
|
816
816
|
});
|
|
817
817
|
})
|
|
818
818
|
}
|
|
819
819
|
);
|
|
820
820
|
}
|
|
821
|
-
function Ge(e, o, t = {},
|
|
822
|
-
const { labelField: u, valueField: f, options: l, onChange: i, ...
|
|
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
823
|
if (s) return s;
|
|
824
|
-
const
|
|
825
|
-
return g(C, null, { default: () =>
|
|
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 });
|
|
826
826
|
};
|
|
827
|
-
return Array.isArray(e.value) ?
|
|
827
|
+
return Array.isArray(e.value) ? r(
|
|
828
828
|
Fe,
|
|
829
829
|
{
|
|
830
830
|
trigger: "click",
|
|
831
|
-
...
|
|
831
|
+
...b,
|
|
832
832
|
...t
|
|
833
833
|
},
|
|
834
834
|
{
|
|
@@ -837,8 +837,8 @@ function Ge(e, o, t = {}, a, s) {
|
|
|
837
837
|
Y,
|
|
838
838
|
{
|
|
839
839
|
modelValue: e.value,
|
|
840
|
-
"onUpdate:modelValue": (
|
|
841
|
-
e.value =
|
|
840
|
+
"onUpdate:modelValue": (p) => {
|
|
841
|
+
e.value = p, n?.onChange?.(p, n, m);
|
|
842
842
|
}
|
|
843
843
|
},
|
|
844
844
|
{
|
|
@@ -846,8 +846,8 @@ function Ge(e, o, t = {}, a, s) {
|
|
|
846
846
|
ee,
|
|
847
847
|
{ wrap: !0 },
|
|
848
848
|
{
|
|
849
|
-
default: () => m.flatMap((
|
|
850
|
-
const
|
|
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
851
|
return g(
|
|
852
852
|
L,
|
|
853
853
|
{
|
|
@@ -855,7 +855,7 @@ function Ge(e, o, t = {}, a, s) {
|
|
|
855
855
|
label: B,
|
|
856
856
|
disabled: y.disabled
|
|
857
857
|
},
|
|
858
|
-
{ default: () =>
|
|
858
|
+
{ default: () => z }
|
|
859
859
|
);
|
|
860
860
|
}))
|
|
861
861
|
}
|
|
@@ -863,46 +863,46 @@ function Ge(e, o, t = {}, a, s) {
|
|
|
863
863
|
}
|
|
864
864
|
)
|
|
865
865
|
}
|
|
866
|
-
) :
|
|
866
|
+
) : r(
|
|
867
867
|
le,
|
|
868
868
|
{
|
|
869
869
|
trigger: "click",
|
|
870
|
-
...
|
|
871
|
-
onCommand: (
|
|
872
|
-
e.value =
|
|
870
|
+
...b,
|
|
871
|
+
onCommand: (p) => {
|
|
872
|
+
e.value = p, n?.onChange?.(p, n, m);
|
|
873
873
|
},
|
|
874
874
|
...t
|
|
875
875
|
},
|
|
876
876
|
{
|
|
877
877
|
default: () => S(),
|
|
878
878
|
dropdown: () => g(te, null, {
|
|
879
|
-
default: () => m.flatMap((
|
|
880
|
-
const
|
|
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
881
|
return g(
|
|
882
882
|
ae,
|
|
883
883
|
{ key: y.key ?? `${v}-${w}`, command: B, disabled: y.disabled },
|
|
884
|
-
{ default: () =>
|
|
884
|
+
{ default: () => z }
|
|
885
885
|
);
|
|
886
886
|
}))
|
|
887
887
|
})
|
|
888
888
|
}
|
|
889
889
|
);
|
|
890
890
|
}
|
|
891
|
-
function Ue(e, o, t = {},
|
|
891
|
+
function Ue(e, o, t = {}, n) {
|
|
892
892
|
const {
|
|
893
893
|
valueField: s = "value",
|
|
894
894
|
labelField: u = "label",
|
|
895
895
|
childrenField: f = "children",
|
|
896
896
|
onChange: l,
|
|
897
897
|
options: i,
|
|
898
|
-
...
|
|
899
|
-
} =
|
|
898
|
+
...b
|
|
899
|
+
} = n ?? {}, a = i ?? o;
|
|
900
900
|
return g(Be, {
|
|
901
|
-
...
|
|
902
|
-
data:
|
|
901
|
+
...b,
|
|
902
|
+
data: a,
|
|
903
903
|
modelValue: e.value,
|
|
904
904
|
"onUpdate:modelValue": (c) => {
|
|
905
|
-
e.value = c,
|
|
905
|
+
e.value = c, n?.onChange?.(c, n, a);
|
|
906
906
|
},
|
|
907
907
|
props: {
|
|
908
908
|
value: s,
|
|
@@ -913,59 +913,59 @@ function Ue(e, o, t = {}, a) {
|
|
|
913
913
|
...t
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
|
-
function Ze(e, o, t = {},
|
|
917
|
-
const { onChange: s, labelField: u, valueField: f, options: l, ...i } =
|
|
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
918
|
return g(
|
|
919
919
|
ne,
|
|
920
920
|
{
|
|
921
921
|
...i,
|
|
922
922
|
modelValue: e.value,
|
|
923
923
|
"onUpdate:modelValue": (d) => {
|
|
924
|
-
e.value = d,
|
|
924
|
+
e.value = d, n?.onChange?.(d, n, c);
|
|
925
925
|
},
|
|
926
926
|
...t
|
|
927
927
|
},
|
|
928
928
|
{
|
|
929
929
|
default: () => (c ?? []).map((d, m) => {
|
|
930
|
-
const S = k(d,
|
|
931
|
-
return g(
|
|
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);
|
|
932
932
|
})
|
|
933
933
|
}
|
|
934
934
|
);
|
|
935
935
|
}
|
|
936
|
-
function qe(e, o, t = {},
|
|
937
|
-
const { onChange: s, labelField: u, valueField: f, options: l, ...i } =
|
|
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
938
|
return g(
|
|
939
939
|
ne,
|
|
940
940
|
{
|
|
941
941
|
...i,
|
|
942
942
|
modelValue: e.value,
|
|
943
943
|
"onUpdate:modelValue": (d) => {
|
|
944
|
-
e.value = d,
|
|
944
|
+
e.value = d, n?.onChange?.(d, n, c);
|
|
945
945
|
},
|
|
946
946
|
...t
|
|
947
947
|
},
|
|
948
948
|
{
|
|
949
949
|
default: () => (c ?? []).map((d, m) => {
|
|
950
|
-
const S = k(d,
|
|
950
|
+
const S = k(d, b, d.label), p = k(d, a, d.value);
|
|
951
951
|
return g(
|
|
952
|
-
|
|
953
|
-
{ key: d.key ?? m, label:
|
|
952
|
+
Oe,
|
|
953
|
+
{ key: d.key ?? m, label: p, disabled: d.disabled },
|
|
954
954
|
() => S
|
|
955
955
|
);
|
|
956
956
|
})
|
|
957
957
|
}
|
|
958
958
|
);
|
|
959
959
|
}
|
|
960
|
-
function We(e, o, t = {},
|
|
961
|
-
const { onChange: s, labelField: u, valueField: f, options: l, ...i } =
|
|
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
962
|
return g(
|
|
963
963
|
Y,
|
|
964
964
|
{
|
|
965
965
|
...i,
|
|
966
966
|
modelValue: e.value,
|
|
967
967
|
"onUpdate:modelValue": (d) => {
|
|
968
|
-
e.value = d,
|
|
968
|
+
e.value = d, n?.onChange?.(d, n, c);
|
|
969
969
|
},
|
|
970
970
|
...t
|
|
971
971
|
},
|
|
@@ -975,10 +975,10 @@ function We(e, o, t = {}, a) {
|
|
|
975
975
|
{ wrap: !0 },
|
|
976
976
|
{
|
|
977
977
|
default: () => (c ?? []).map((d, m) => {
|
|
978
|
-
const S = k(d,
|
|
978
|
+
const S = k(d, b, d.label), p = k(d, a, d.value);
|
|
979
979
|
return g(
|
|
980
980
|
L,
|
|
981
|
-
{ key: d.key ?? m, label:
|
|
981
|
+
{ key: d.key ?? m, label: p, disabled: d.disabled },
|
|
982
982
|
() => S
|
|
983
983
|
);
|
|
984
984
|
})
|
|
@@ -988,7 +988,7 @@ function We(e, o, t = {}, a) {
|
|
|
988
988
|
);
|
|
989
989
|
}
|
|
990
990
|
function Ke(e, o = {}, t) {
|
|
991
|
-
const { onChange:
|
|
991
|
+
const { onChange: n, ...s } = t ?? {};
|
|
992
992
|
return g(Ae, {
|
|
993
993
|
...s,
|
|
994
994
|
modelValue: e.value,
|
|
@@ -999,8 +999,8 @@ function Ke(e, o = {}, t) {
|
|
|
999
999
|
});
|
|
1000
1000
|
}
|
|
1001
1001
|
function Je(e, o = {}, t) {
|
|
1002
|
-
const { onChange:
|
|
1003
|
-
return g(
|
|
1002
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1003
|
+
return g(xe, {
|
|
1004
1004
|
...s,
|
|
1005
1005
|
modelValue: e.value,
|
|
1006
1006
|
"onUpdate:modelValue": (u) => {
|
|
@@ -1010,8 +1010,8 @@ function Je(e, o = {}, t) {
|
|
|
1010
1010
|
});
|
|
1011
1011
|
}
|
|
1012
1012
|
function Qe(e, o = {}, t) {
|
|
1013
|
-
const { onChange:
|
|
1014
|
-
return g(
|
|
1013
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1014
|
+
return g(ze, {
|
|
1015
1015
|
...s,
|
|
1016
1016
|
modelValue: e.value,
|
|
1017
1017
|
"onUpdate:modelValue": (u) => {
|
|
@@ -1021,7 +1021,7 @@ function Qe(e, o = {}, t) {
|
|
|
1021
1021
|
});
|
|
1022
1022
|
}
|
|
1023
1023
|
function Xe(e, o = {}, t) {
|
|
1024
|
-
const { onChange:
|
|
1024
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1025
1025
|
return g(L, {
|
|
1026
1026
|
...s,
|
|
1027
1027
|
label: o?.label ?? t?.label,
|
|
@@ -1033,21 +1033,21 @@ function Xe(e, o = {}, t) {
|
|
|
1033
1033
|
});
|
|
1034
1034
|
}
|
|
1035
1035
|
function Ye(e, o = {}, t) {
|
|
1036
|
-
const { onChange:
|
|
1037
|
-
return g(
|
|
1036
|
+
const { onChange: n, value: s, labelField: u = "label", valueField: f, ...l } = t ?? {};
|
|
1037
|
+
return g(Re, {
|
|
1038
1038
|
...l,
|
|
1039
1039
|
modelValue: f ? e.value.map((i) => i[f]) : e.value,
|
|
1040
1040
|
"onUpdate:modelValue": (i) => {
|
|
1041
|
-
e.value = f ? i.map((
|
|
1042
|
-
[u]:
|
|
1043
|
-
[f]:
|
|
1041
|
+
e.value = f ? i.map((b) => ({
|
|
1042
|
+
[u]: b,
|
|
1043
|
+
[f]: b
|
|
1044
1044
|
})) : i, t?.onChange?.(i, t);
|
|
1045
1045
|
},
|
|
1046
1046
|
...o
|
|
1047
1047
|
});
|
|
1048
1048
|
}
|
|
1049
1049
|
function el(e, o = {}, t) {
|
|
1050
|
-
const { onChange:
|
|
1050
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1051
1051
|
return g(je, {
|
|
1052
1052
|
...s,
|
|
1053
1053
|
modelValue: e.value,
|
|
@@ -1058,7 +1058,7 @@ function el(e, o = {}, t) {
|
|
|
1058
1058
|
});
|
|
1059
1059
|
}
|
|
1060
1060
|
function ll(e, o = {}, t) {
|
|
1061
|
-
const { onChange:
|
|
1061
|
+
const { onChange: n, ...s } = t ?? {};
|
|
1062
1062
|
return g(Ee, {
|
|
1063
1063
|
...s,
|
|
1064
1064
|
modelValue: e.value,
|
|
@@ -1086,7 +1086,7 @@ const tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1086
1086
|
renderTreeSelect: Ue
|
|
1087
1087
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1088
1088
|
function al(e) {
|
|
1089
|
-
return function(t,
|
|
1089
|
+
return function(t, n = !0) {
|
|
1090
1090
|
const s = e, u = {
|
|
1091
1091
|
renderInput: (l) => s.renderInput(l.value, l.renderProps ?? {}, l),
|
|
1092
1092
|
renderSelect: (l) => s.renderSelect(l.value, l.options ?? [], l.renderProps ?? {}, l),
|
|
@@ -1108,10 +1108,10 @@ function al(e) {
|
|
|
1108
1108
|
if (i.value = ce(l.value), typeof l.render2 == "function")
|
|
1109
1109
|
i.render2 = l.render2;
|
|
1110
1110
|
else {
|
|
1111
|
-
const
|
|
1112
|
-
|
|
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));
|
|
1113
1113
|
}
|
|
1114
|
-
return
|
|
1114
|
+
return n ? me(i) : i;
|
|
1115
1115
|
});
|
|
1116
1116
|
};
|
|
1117
1117
|
}
|
|
@@ -1163,6 +1163,10 @@ const ml = /* @__PURE__ */ A({
|
|
|
1163
1163
|
isMobile: {
|
|
1164
1164
|
type: Boolean,
|
|
1165
1165
|
default: !1
|
|
1166
|
+
},
|
|
1167
|
+
formSize: {
|
|
1168
|
+
type: String,
|
|
1169
|
+
default: "default"
|
|
1166
1170
|
}
|
|
1167
1171
|
},
|
|
1168
1172
|
emits: {
|
|
@@ -1173,74 +1177,75 @@ const ml = /* @__PURE__ */ A({
|
|
|
1173
1177
|
setup(e, {
|
|
1174
1178
|
emit: o,
|
|
1175
1179
|
slots: t,
|
|
1176
|
-
expose:
|
|
1180
|
+
expose: n
|
|
1177
1181
|
}) {
|
|
1178
|
-
const s =
|
|
1179
|
-
s.value =
|
|
1182
|
+
const s = I(!1), u = I({}), f = fe(e.searchItems), l = (a) => {
|
|
1183
|
+
s.value = a ?? !s.value;
|
|
1180
1184
|
}, i = () => {
|
|
1181
1185
|
e.copyDefault ? f.setValues(u.value) : f.onReset(null), o("onReset"), l(!1);
|
|
1182
|
-
},
|
|
1183
|
-
const
|
|
1184
|
-
o("onSearch",
|
|
1186
|
+
}, b = () => {
|
|
1187
|
+
const a = f.getValues();
|
|
1188
|
+
o("onSearch", a), l(!1);
|
|
1185
1189
|
};
|
|
1186
|
-
return _(() => e.isMobile, (
|
|
1187
|
-
e.closeDrawerAuto ||
|
|
1190
|
+
return _(() => e.isMobile, (a) => {
|
|
1191
|
+
e.closeDrawerAuto || a || l(!1);
|
|
1188
1192
|
}), be(async () => {
|
|
1189
1193
|
await X(), e.copyDefault && (u.value = f.getValues());
|
|
1190
|
-
}),
|
|
1194
|
+
}), n({
|
|
1191
1195
|
onReset: i,
|
|
1192
|
-
onSearch:
|
|
1196
|
+
onSearch: b,
|
|
1193
1197
|
toggleDrawer: l,
|
|
1194
1198
|
getParams: () => f.getValues()
|
|
1195
1199
|
}), () => {
|
|
1196
|
-
const [
|
|
1197
|
-
return
|
|
1200
|
+
const [a, c] = e.searchBtnTxt;
|
|
1201
|
+
return r("div", {
|
|
1198
1202
|
class: "eleZealTableSearch"
|
|
1199
|
-
}, [!e.mobileDrawer || !e.isMobile ?
|
|
1203
|
+
}, [!e.mobileDrawer || !e.isMobile ? r(O, null, [t.title?.() ?? r("div", {
|
|
1200
1204
|
class: "naiTitle"
|
|
1201
|
-
}, [e.title]),
|
|
1205
|
+
}, [e.title]), r("div", {
|
|
1202
1206
|
class: "searchForm",
|
|
1203
1207
|
style: {
|
|
1204
1208
|
maxHeight: e.searchFormMaxHeight
|
|
1205
1209
|
}
|
|
1206
|
-
}, [
|
|
1210
|
+
}, [r(q, {
|
|
1207
1211
|
items: e.searchItems,
|
|
1208
1212
|
preset: "grid",
|
|
1209
1213
|
formConfig: {
|
|
1210
1214
|
labelPosition: "left",
|
|
1211
|
-
showMessage: !1
|
|
1212
|
-
// showFeedback: false
|
|
1215
|
+
showMessage: !1,
|
|
1216
|
+
// showFeedback: false,
|
|
1217
|
+
size: e.formSize
|
|
1213
1218
|
}
|
|
1214
1219
|
}, null)]), t.searchBtn ? t.searchBtn?.({
|
|
1215
|
-
onSearch:
|
|
1220
|
+
onSearch: b,
|
|
1216
1221
|
onReset: i
|
|
1217
|
-
}) :
|
|
1222
|
+
}) : r("div", {
|
|
1218
1223
|
class: "searchBtn"
|
|
1219
|
-
}, [
|
|
1224
|
+
}, [r(C, {
|
|
1220
1225
|
size: "small",
|
|
1221
1226
|
onClick: i
|
|
1222
|
-
}, j(
|
|
1223
|
-
default: () => [
|
|
1224
|
-
}),
|
|
1227
|
+
}, j(a) ? a : {
|
|
1228
|
+
default: () => [a]
|
|
1229
|
+
}), r(C, {
|
|
1225
1230
|
type: "primary",
|
|
1226
1231
|
size: "small",
|
|
1227
|
-
onClick:
|
|
1232
|
+
onClick: b
|
|
1228
1233
|
}, j(c) ? c : {
|
|
1229
1234
|
default: () => [c]
|
|
1230
|
-
})])]) :
|
|
1235
|
+
})])]) : r("div", {
|
|
1231
1236
|
class: "drawerSearchBtn"
|
|
1232
|
-
}, [t.title?.() ??
|
|
1237
|
+
}, [t.title?.() ?? r("div", {
|
|
1233
1238
|
class: "naiTitle"
|
|
1234
1239
|
}, [e.title]), t.drawerBtn ? t.drawerBtn?.({
|
|
1235
1240
|
openDrawer: () => l(!0)
|
|
1236
|
-
}) :
|
|
1241
|
+
}) : r(C, {
|
|
1237
1242
|
size: "small",
|
|
1238
1243
|
onClick: () => {
|
|
1239
1244
|
l(!0);
|
|
1240
1245
|
}
|
|
1241
1246
|
}, {
|
|
1242
1247
|
default: () => [e.drawerOpenTxt]
|
|
1243
|
-
})]),
|
|
1248
|
+
})]), r(Pe, {
|
|
1244
1249
|
class: "eleZealSearchDrawer",
|
|
1245
1250
|
modelValue: s.value,
|
|
1246
1251
|
"onUpdate:modelValue": (d) => s.value = d,
|
|
@@ -1248,9 +1253,9 @@ const ml = /* @__PURE__ */ A({
|
|
|
1248
1253
|
trapFocus: !1,
|
|
1249
1254
|
direction: "ttb"
|
|
1250
1255
|
}, {
|
|
1251
|
-
default: () => [
|
|
1256
|
+
default: () => [r("div", {
|
|
1252
1257
|
class: "searchForm"
|
|
1253
|
-
}, [
|
|
1258
|
+
}, [r(q, {
|
|
1254
1259
|
formConfig: {
|
|
1255
1260
|
labelPosition: "left",
|
|
1256
1261
|
size: "small",
|
|
@@ -1258,21 +1263,21 @@ const ml = /* @__PURE__ */ A({
|
|
|
1258
1263
|
},
|
|
1259
1264
|
items: e.searchItems
|
|
1260
1265
|
}, null)])],
|
|
1261
|
-
header: () =>
|
|
1266
|
+
header: () => r("div", null, [e.drawerTitle ?? e.title]),
|
|
1262
1267
|
footer: () => t.searchBtn ? t.searchBtn?.({
|
|
1263
|
-
onSearch:
|
|
1268
|
+
onSearch: b,
|
|
1264
1269
|
onReset: i
|
|
1265
|
-
}) :
|
|
1270
|
+
}) : r("div", {
|
|
1266
1271
|
class: "searchBtn"
|
|
1267
|
-
}, [
|
|
1272
|
+
}, [r(C, {
|
|
1268
1273
|
size: "small",
|
|
1269
1274
|
onClick: i
|
|
1270
|
-
}, j(
|
|
1271
|
-
default: () => [
|
|
1272
|
-
}),
|
|
1275
|
+
}, j(a) ? a : {
|
|
1276
|
+
default: () => [a]
|
|
1277
|
+
}), r(C, {
|
|
1273
1278
|
type: "primary",
|
|
1274
1279
|
size: "small",
|
|
1275
|
-
onClick:
|
|
1280
|
+
onClick: b
|
|
1276
1281
|
}, j(c) ? c : {
|
|
1277
1282
|
default: () => [c]
|
|
1278
1283
|
})])
|
|
@@ -1299,19 +1304,19 @@ const ml = /* @__PURE__ */ A({
|
|
|
1299
1304
|
slots: o
|
|
1300
1305
|
}) {
|
|
1301
1306
|
const t = pe(e, "pagination");
|
|
1302
|
-
function
|
|
1307
|
+
function n(u) {
|
|
1303
1308
|
t.value.pageNo = u, t.value?.onChange();
|
|
1304
1309
|
}
|
|
1305
1310
|
function s(u) {
|
|
1306
1311
|
t.value.pageNo = 1, t.value.pageSize = u, t.value?.onPageSizeChange();
|
|
1307
1312
|
}
|
|
1308
|
-
return () =>
|
|
1313
|
+
return () => r(Ve, E({
|
|
1309
1314
|
currentPage: t.value?.pageNo,
|
|
1310
1315
|
"page-size": t.value?.pageSize,
|
|
1311
1316
|
total: t.value?.total,
|
|
1312
1317
|
pageSizes: t.value?.pageSizes,
|
|
1313
1318
|
layout: !o.default && e.isMobile ? rl(t.value?.layout) : t.value?.layout,
|
|
1314
|
-
"onUpdate:current-page":
|
|
1319
|
+
"onUpdate:current-page": n,
|
|
1315
1320
|
"onUpdate:page-size": s
|
|
1316
1321
|
}, e.pageConfig), {
|
|
1317
1322
|
...o
|
|
@@ -1359,23 +1364,23 @@ const ml = /* @__PURE__ */ A({
|
|
|
1359
1364
|
slots: o,
|
|
1360
1365
|
attrs: t
|
|
1361
1366
|
}) {
|
|
1362
|
-
return () => ve(
|
|
1367
|
+
return () => ve(r(De, E(e.tableConfig, t, {
|
|
1363
1368
|
data: e.data,
|
|
1364
1369
|
maxHeight: e.maxHeight,
|
|
1365
1370
|
stripe: e.stripe,
|
|
1366
1371
|
border: e.border
|
|
1367
1372
|
}), {
|
|
1368
|
-
default: () => [e.columns.map((
|
|
1369
|
-
const s =
|
|
1373
|
+
default: () => [e.columns.map((n) => {
|
|
1374
|
+
const s = n.key ?? String(n.prop ?? n.label), u = n.align ?? e.columnAlign, {
|
|
1370
1375
|
render2: f,
|
|
1371
1376
|
slot: l,
|
|
1372
1377
|
...i
|
|
1373
|
-
} =
|
|
1374
|
-
return
|
|
1378
|
+
} = n, b = l || (n.prop ? `cell-${String(n.prop)}` : void 0), a = b ? o[b] : void 0;
|
|
1379
|
+
return r(Ne, E(i, {
|
|
1375
1380
|
align: u,
|
|
1376
1381
|
key: s
|
|
1377
1382
|
}), {
|
|
1378
|
-
default: (c) => f ? f(c.row, c.$index) :
|
|
1383
|
+
default: (c) => f ? f(c.row, c.$index) : a ? a(c) : n.prop ? c.row[n.prop] : null
|
|
1379
1384
|
});
|
|
1380
1385
|
})],
|
|
1381
1386
|
...o
|
|
@@ -1412,66 +1417,73 @@ const ml = /* @__PURE__ */ A({
|
|
|
1412
1417
|
emit: o,
|
|
1413
1418
|
slots: t
|
|
1414
1419
|
}) {
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
},
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
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,
|
|
1436
1466
|
onClick: () => {
|
|
1437
|
-
|
|
1467
|
+
c?.(a), o("onSelect", a);
|
|
1438
1468
|
}
|
|
1439
|
-
}, {
|
|
1440
|
-
default: () => [
|
|
1441
|
-
}))) ? f : {
|
|
1442
|
-
default: () => [f]
|
|
1469
|
+
}), j(d) ? d : {
|
|
1470
|
+
default: () => [d]
|
|
1443
1471
|
});
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
const {
|
|
1447
|
-
key: l,
|
|
1448
|
-
onSelect: i,
|
|
1449
|
-
title: p,
|
|
1450
|
-
...r
|
|
1451
|
-
} = f;
|
|
1452
|
-
return n(C, E({
|
|
1453
|
-
size: u,
|
|
1454
|
-
key: l,
|
|
1455
|
-
onClick: () => {
|
|
1456
|
-
i?.(l), o("onSelect", l);
|
|
1457
|
-
}
|
|
1458
|
-
}, r), j(p) ? p : {
|
|
1459
|
-
default: () => [p]
|
|
1460
|
-
});
|
|
1461
|
-
})]);
|
|
1472
|
+
})]);
|
|
1473
|
+
};
|
|
1462
1474
|
}
|
|
1463
1475
|
});
|
|
1464
1476
|
function gl(e, o) {
|
|
1465
|
-
const t =
|
|
1477
|
+
const t = I(null), n = R(() => {
|
|
1466
1478
|
const s = t.value;
|
|
1467
1479
|
return e({
|
|
1468
|
-
isMobile: s?.isMobile ??
|
|
1469
|
-
tableHeight: s?.tableHeight ??
|
|
1480
|
+
isMobile: s?.isMobile ?? I(!1),
|
|
1481
|
+
tableHeight: s?.tableHeight ?? I(0)
|
|
1470
1482
|
}).map((u) => ({ ...o, ...u }));
|
|
1471
1483
|
});
|
|
1472
1484
|
return {
|
|
1473
1485
|
eleZealCardRef: t,
|
|
1474
|
-
tableColumns:
|
|
1486
|
+
tableColumns: n
|
|
1475
1487
|
};
|
|
1476
1488
|
}
|
|
1477
1489
|
export {
|