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