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
package/dist/naiveUi/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
1
|
+
import { t as D, r as $, f as q, p as Q, s as X, d as Y, e as ee, k as te, i as ae, c as ne } from "../index-BQKYL550.js";
|
|
2
|
+
import { defineComponent as F, ref as x, watch as H, toRaw as P, createVNode as a, createTextVNode as N, Fragment as w, nextTick as W, isVNode as M, computed as B, h as C, mergeProps as A, reactive as le, shallowReactive as re, onMounted as oe, toRef as ue } from "vue";
|
|
3
|
+
import { NInput as O, NButton as p, NForm as se, NGrid as ie, NFormItemGridItem as ce, NFormItem as de, NModal as fe, NCard as U, NSelect as ye, NPopselect as me, NTreeSelect as ve, NRadioGroup as E, NRadio as ge, NRadioButton as pe, NCheckboxGroup as be, NSpace as he, NCheckbox as K, NSwitch as Ce, NDatePicker as Se, NTimePicker as ke, NDynamicTags as Ne, NSlider as xe, NInputNumber as we, NDrawer as Te, NDrawerContent as Fe, NPagination as Ie, NDropdown as Be } from "naive-ui";
|
|
4
|
+
const Je = /* @__PURE__ */ F({
|
|
5
5
|
name: "NaiDynamicInput",
|
|
6
6
|
props: {
|
|
7
7
|
size: {
|
|
@@ -39,15 +39,15 @@ const je = /* @__PURE__ */ z({
|
|
|
39
39
|
slots: Object,
|
|
40
40
|
setup(e, {
|
|
41
41
|
emit: u,
|
|
42
|
-
expose:
|
|
43
|
-
slots:
|
|
42
|
+
expose: n,
|
|
43
|
+
slots: l
|
|
44
44
|
}) {
|
|
45
|
-
const
|
|
45
|
+
const s = {
|
|
46
46
|
resetTxt: "重置",
|
|
47
47
|
newTxt: "添加项",
|
|
48
48
|
mergeTxt: "合并",
|
|
49
49
|
...e.btnConfigs
|
|
50
|
-
},
|
|
50
|
+
}, r = {
|
|
51
51
|
hideReset: !1,
|
|
52
52
|
maxHeight: "300px",
|
|
53
53
|
autoScroll: !0,
|
|
@@ -55,147 +55,147 @@ const je = /* @__PURE__ */ z({
|
|
|
55
55
|
hideArrayBtn: !1,
|
|
56
56
|
hideNumberBtn: !1,
|
|
57
57
|
...e.configs
|
|
58
|
-
},
|
|
58
|
+
}, c = {
|
|
59
59
|
arraySplitSymbol: ",",
|
|
60
60
|
...e.dyListConfigs
|
|
61
|
-
},
|
|
62
|
-
|
|
61
|
+
}, t = e.size, i = x(D(e.modelValue, e.randomFun, c.arraySplitSymbol)), m = x(null);
|
|
62
|
+
H(i, (y) => {
|
|
63
63
|
if (!e.isController) return;
|
|
64
|
-
const
|
|
65
|
-
u("update:modelValue",
|
|
64
|
+
const S = $(y, c.arraySplitSymbol);
|
|
65
|
+
u("update:modelValue", S), u("onMerge", S, P(i.value));
|
|
66
66
|
}, {
|
|
67
67
|
deep: !0
|
|
68
|
-
}),
|
|
69
|
-
onSet: (
|
|
70
|
-
|
|
68
|
+
}), n({
|
|
69
|
+
onSet: (y) => {
|
|
70
|
+
i.value = D(y ?? e.modelValue, e.randomFun, c.arraySplitSymbol);
|
|
71
71
|
},
|
|
72
|
-
getResult: (
|
|
72
|
+
getResult: (y = "res") => y === "ori" ? P(i.value) : $(i.value, c.arraySplitSymbol)
|
|
73
73
|
});
|
|
74
|
-
const o = () =>
|
|
74
|
+
const o = () => i.value.push({
|
|
75
75
|
rId: e.randomFun(),
|
|
76
76
|
key: "",
|
|
77
77
|
value: ""
|
|
78
|
-
}),
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
u("update:modelValue",
|
|
78
|
+
}), f = () => {
|
|
79
|
+
i.value = D(e.modelValue, e.randomFun, c.arraySplitSymbol), u("onReset");
|
|
80
|
+
}, b = () => {
|
|
81
|
+
i.value.sort((S, g) => +S.rId - +g.rId);
|
|
82
|
+
const y = $(i.value, c.arraySplitSymbol);
|
|
83
|
+
u("update:modelValue", y), u("onMerge", y, P(i.value)), i.value = D(y, e.randomFun, c.arraySplitSymbol);
|
|
84
84
|
};
|
|
85
|
-
return () =>
|
|
86
|
-
class: `dynamicForm ${
|
|
87
|
-
}, [
|
|
88
|
-
class: `dyFormList ${
|
|
89
|
-
ref:
|
|
85
|
+
return () => a("div", {
|
|
86
|
+
class: `dynamicForm ${t} ${e.dyCls}`
|
|
87
|
+
}, [a("div", {
|
|
88
|
+
class: `dyFormList ${i.value.length ? "" : "noList"}`,
|
|
89
|
+
ref: m,
|
|
90
90
|
style: {
|
|
91
|
-
maxHeight:
|
|
91
|
+
maxHeight: r.maxHeight
|
|
92
92
|
}
|
|
93
|
-
}, [
|
|
94
|
-
const
|
|
95
|
-
row:
|
|
96
|
-
index:
|
|
97
|
-
isLast:
|
|
93
|
+
}, [i.value.map((y, S, g) => {
|
|
94
|
+
const v = {
|
|
95
|
+
row: y,
|
|
96
|
+
index: S,
|
|
97
|
+
isLast: S === g.length - 1,
|
|
98
98
|
addItem: () => {
|
|
99
|
-
|
|
99
|
+
i.value.push({
|
|
100
100
|
rId: e.randomFun(),
|
|
101
101
|
key: "",
|
|
102
102
|
value: ""
|
|
103
|
-
}),
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
top:
|
|
103
|
+
}), r.autoScroll && W(() => {
|
|
104
|
+
const h = m.value;
|
|
105
|
+
h?.scrollTo({
|
|
106
|
+
top: h.scrollHeight,
|
|
107
107
|
behavior: "smooth"
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
},
|
|
111
111
|
removeItem: () => {
|
|
112
|
-
|
|
112
|
+
i.value = i.value.filter((h) => h.rId !== y.rId);
|
|
113
113
|
},
|
|
114
|
-
toggleArray: () =>
|
|
115
|
-
toggleNumber: () =>
|
|
114
|
+
toggleArray: () => y.isArray = !y.isArray,
|
|
115
|
+
toggleNumber: () => y.isNumber = !y.isNumber
|
|
116
116
|
};
|
|
117
|
-
return
|
|
117
|
+
return a("div", {
|
|
118
118
|
class: "dItem",
|
|
119
|
-
key:
|
|
120
|
-
}, [
|
|
119
|
+
key: y.rId
|
|
120
|
+
}, [a("div", {
|
|
121
121
|
class: "input"
|
|
122
|
-
}, [
|
|
123
|
-
size:
|
|
124
|
-
value:
|
|
122
|
+
}, [a(O, {
|
|
123
|
+
size: t,
|
|
124
|
+
value: y.key,
|
|
125
125
|
class: "key",
|
|
126
|
-
onInput: (
|
|
127
|
-
|
|
126
|
+
onInput: (h) => {
|
|
127
|
+
y.key = h;
|
|
128
128
|
}
|
|
129
|
-
}, null),
|
|
130
|
-
size:
|
|
131
|
-
value:
|
|
129
|
+
}, null), N(":"), a(O, {
|
|
130
|
+
size: t,
|
|
131
|
+
value: y.value,
|
|
132
132
|
class: "value",
|
|
133
|
-
onInput: (
|
|
134
|
-
|
|
133
|
+
onInput: (h) => {
|
|
134
|
+
r.allowFilter && y.isNumber ? y.value = q(h, y.isArray, c.arraySplitSymbol) : y.value = h;
|
|
135
135
|
}
|
|
136
136
|
}, {
|
|
137
|
-
prefix: () =>
|
|
138
|
-
type:
|
|
137
|
+
prefix: () => l.typeTools ? l.typeTools(v) : a(w, null, [!r.hideArrayBtn && a(p, {
|
|
138
|
+
type: y.isArray ? "success" : "default",
|
|
139
139
|
size: "tiny",
|
|
140
|
-
onClick:
|
|
140
|
+
onClick: v.toggleArray
|
|
141
141
|
}, {
|
|
142
|
-
default: () => [
|
|
143
|
-
}),
|
|
144
|
-
type:
|
|
142
|
+
default: () => [N("Array")]
|
|
143
|
+
}), N(" "), !r.hideNumberBtn && a(p, {
|
|
144
|
+
type: y.isNumber ? "success" : "default",
|
|
145
145
|
size: "tiny",
|
|
146
|
-
onClick:
|
|
146
|
+
onClick: v.toggleNumber
|
|
147
147
|
}, {
|
|
148
|
-
default: () => [
|
|
148
|
+
default: () => [N("Number")]
|
|
149
149
|
})])
|
|
150
|
-
})]),
|
|
150
|
+
})]), a("div", {
|
|
151
151
|
class: "btn"
|
|
152
|
-
}, [
|
|
152
|
+
}, [l.rowActions ? l.rowActions(v) : a(w, null, [a(p, {
|
|
153
153
|
type: "success",
|
|
154
|
-
size:
|
|
155
|
-
disabled: !
|
|
156
|
-
onClick:
|
|
154
|
+
size: t,
|
|
155
|
+
disabled: !v.isLast,
|
|
156
|
+
onClick: v.addItem
|
|
157
157
|
}, {
|
|
158
|
-
default: () => [
|
|
159
|
-
}),
|
|
160
|
-
size:
|
|
158
|
+
default: () => [N("+")]
|
|
159
|
+
}), a(p, {
|
|
160
|
+
size: t,
|
|
161
161
|
type: "error",
|
|
162
|
-
onClick:
|
|
162
|
+
onClick: v.removeItem
|
|
163
163
|
}, {
|
|
164
|
-
default: () => [
|
|
164
|
+
default: () => [N("-")]
|
|
165
165
|
})])])]);
|
|
166
|
-
})]),
|
|
167
|
-
class: `control ${
|
|
168
|
-
}, [!
|
|
166
|
+
})]), a("div", {
|
|
167
|
+
class: `control ${i.value.length ? "" : "noList"}`
|
|
168
|
+
}, [!i.value.length && (l.newBtn ? l.newBtn({
|
|
169
169
|
newItem: o
|
|
170
|
-
}) :
|
|
171
|
-
size:
|
|
170
|
+
}) : a(p, {
|
|
171
|
+
size: t,
|
|
172
172
|
type: "success",
|
|
173
173
|
onClick: o
|
|
174
174
|
}, {
|
|
175
|
-
default: () => [
|
|
176
|
-
})), !e.isController &&
|
|
177
|
-
reset:
|
|
178
|
-
}) :
|
|
179
|
-
size:
|
|
175
|
+
default: () => [s.newTxt]
|
|
176
|
+
})), !e.isController && a(w, null, [!r.hideReset && (l.resetBtn ? l.resetBtn({
|
|
177
|
+
reset: f
|
|
178
|
+
}) : a(p, {
|
|
179
|
+
size: t,
|
|
180
180
|
type: "default",
|
|
181
|
-
onClick:
|
|
181
|
+
onClick: f
|
|
182
182
|
}, {
|
|
183
|
-
default: () => [
|
|
184
|
-
})),
|
|
185
|
-
merge:
|
|
186
|
-
}) :
|
|
187
|
-
size:
|
|
183
|
+
default: () => [s.resetTxt]
|
|
184
|
+
})), l.mergeBtn ? l.mergeBtn({
|
|
185
|
+
merge: b
|
|
186
|
+
}) : a(p, {
|
|
187
|
+
size: t,
|
|
188
188
|
type: "info",
|
|
189
|
-
onClick:
|
|
189
|
+
onClick: b
|
|
190
190
|
}, {
|
|
191
|
-
default: () => [
|
|
191
|
+
default: () => [s.mergeTxt]
|
|
192
192
|
})])])]);
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
|
-
function
|
|
196
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
195
|
+
function Re(e) {
|
|
196
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
197
197
|
}
|
|
198
|
-
const
|
|
198
|
+
const Qe = /* @__PURE__ */ F({
|
|
199
199
|
name: "NaiveUiDynamicCascadeInput",
|
|
200
200
|
props: {
|
|
201
201
|
modelValue: {
|
|
@@ -239,15 +239,15 @@ const Oe = /* @__PURE__ */ z({
|
|
|
239
239
|
slots: Object,
|
|
240
240
|
setup(e, {
|
|
241
241
|
emit: u,
|
|
242
|
-
expose:
|
|
243
|
-
slots:
|
|
242
|
+
expose: n,
|
|
243
|
+
slots: l
|
|
244
244
|
}) {
|
|
245
|
-
const
|
|
245
|
+
const s = {
|
|
246
246
|
resetTxt: "重置",
|
|
247
247
|
newTxt: "添加项",
|
|
248
248
|
mergeTxt: "合并",
|
|
249
249
|
...e.btnConfigs
|
|
250
|
-
},
|
|
250
|
+
}, r = {
|
|
251
251
|
hideReset: !1,
|
|
252
252
|
maxHeight: "600px",
|
|
253
253
|
allowFilter: !0,
|
|
@@ -258,182 +258,182 @@ const Oe = /* @__PURE__ */ z({
|
|
|
258
258
|
retractLen: 0,
|
|
259
259
|
borderColors: [],
|
|
260
260
|
...e.configs
|
|
261
|
-
},
|
|
261
|
+
}, c = {
|
|
262
262
|
arraySplitSymbol: ",",
|
|
263
263
|
...e.dyListConfigs
|
|
264
|
-
},
|
|
265
|
-
let
|
|
266
|
-
const
|
|
267
|
-
return
|
|
268
|
-
rId: e.randomFun(
|
|
269
|
-
key:
|
|
270
|
-
value: Object.prototype.toString.call(
|
|
271
|
-
isArray:
|
|
272
|
-
isNumber:
|
|
264
|
+
}, t = (g) => ["string", "number"].includes(g), i = (g) => Object.keys(g).map((v, h) => {
|
|
265
|
+
let d = g[v];
|
|
266
|
+
const I = Array.isArray(d), V = I ? d.every((j) => typeof j == "number") : typeof d == "number", R = d === null;
|
|
267
|
+
return t(typeof d) && (d = g[v]), R && (d = ""), {
|
|
268
|
+
rId: e.randomFun(h),
|
|
269
|
+
key: v,
|
|
270
|
+
value: Object.prototype.toString.call(d) === "[object Object]" ? i(g[v]) : I ? d.join(c.arraySplitSymbol) : d,
|
|
271
|
+
isArray: I || void 0,
|
|
272
|
+
isNumber: V || void 0
|
|
273
273
|
};
|
|
274
|
-
}),
|
|
275
|
-
const
|
|
276
|
-
return
|
|
277
|
-
}, {}), o =
|
|
278
|
-
class: [`depth-${
|
|
274
|
+
}), m = (g) => g.reduce((v, h) => {
|
|
275
|
+
const d = h.value;
|
|
276
|
+
return h.key.trim().length && (v[h.key] = Array.isArray(d) ? m(d) : Q(h.value, h.isArray, h.isNumber, c.arraySplitSymbol)), v;
|
|
277
|
+
}, {}), o = x(i(e.modelValue)), f = (g, v = 1, h) => a("div", {
|
|
278
|
+
class: [`depth-${v}`, r.showBorder ? "" : "no-border", r.showPad ? "" : "no-pad"],
|
|
279
279
|
style: {
|
|
280
|
-
"--depth":
|
|
281
|
-
["--c" + [
|
|
280
|
+
"--depth": v,
|
|
281
|
+
["--c" + [v]]: X(r.borderColors, v)
|
|
282
282
|
}
|
|
283
|
-
}, [
|
|
284
|
-
const R = Array.isArray(
|
|
285
|
-
row:
|
|
286
|
-
index:
|
|
287
|
-
isLast:
|
|
283
|
+
}, [g.map((d, I, V) => {
|
|
284
|
+
const R = Array.isArray(d.value), j = t(typeof d.value), T = {
|
|
285
|
+
row: d,
|
|
286
|
+
index: I,
|
|
287
|
+
isLast: I === V.length - 1,
|
|
288
288
|
addItem: () => {
|
|
289
|
-
|
|
289
|
+
g.push({
|
|
290
290
|
rId: e.randomFun(),
|
|
291
291
|
key: "",
|
|
292
292
|
value: ""
|
|
293
293
|
});
|
|
294
294
|
},
|
|
295
295
|
addChild: () => {
|
|
296
|
-
|
|
296
|
+
j && (d.value = [], d.isArray = void 0), d.value.push({
|
|
297
297
|
rId: e.randomFun(),
|
|
298
298
|
key: "",
|
|
299
299
|
value: ""
|
|
300
300
|
});
|
|
301
301
|
},
|
|
302
302
|
removeItem: () => {
|
|
303
|
-
if (
|
|
304
|
-
if (
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
...
|
|
303
|
+
if (g.splice(I, 1), g.length < 1) {
|
|
304
|
+
if (h === void 0) return m([]);
|
|
305
|
+
const k = o.value.findIndex((J) => J.rId === h?.rId);
|
|
306
|
+
v < 1 ? o.value.splice(k, 1, {
|
|
307
|
+
...h,
|
|
308
308
|
value: ""
|
|
309
|
-
}) :
|
|
309
|
+
}) : h.value = "";
|
|
310
310
|
}
|
|
311
311
|
},
|
|
312
|
-
toggleArray: () =>
|
|
313
|
-
toggleNumber: () =>
|
|
312
|
+
toggleArray: () => d.isArray = !d.isArray,
|
|
313
|
+
toggleNumber: () => d.isNumber = !d.isNumber
|
|
314
314
|
};
|
|
315
|
-
return
|
|
315
|
+
return a("div", {
|
|
316
316
|
class: "dItem",
|
|
317
|
-
key:
|
|
317
|
+
key: d.rId,
|
|
318
318
|
style: {
|
|
319
|
-
marginLeft:
|
|
319
|
+
marginLeft: v > 1 ? `${v * r.retractLen}px` : "0"
|
|
320
320
|
}
|
|
321
|
-
}, [
|
|
321
|
+
}, [a("div", {
|
|
322
322
|
class: "input"
|
|
323
|
-
}, [!R &&
|
|
324
|
-
value:
|
|
323
|
+
}, [!R && a(w, null, [a(O, {
|
|
324
|
+
value: d.key,
|
|
325
325
|
class: "key",
|
|
326
|
-
onInput: (
|
|
327
|
-
}, null),
|
|
326
|
+
onInput: (k) => d.key = k
|
|
327
|
+
}, null), N(":")]), a(O, {
|
|
328
328
|
class: `value ${R ? "isKey" : ""}`,
|
|
329
|
-
value:
|
|
330
|
-
onInput: (
|
|
329
|
+
value: j ? d.value : d.key,
|
|
330
|
+
onInput: (k) => {
|
|
331
331
|
if (R) {
|
|
332
|
-
|
|
332
|
+
d.key = k;
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
|
-
|
|
335
|
+
r.allowFilter && d.isNumber ? d.value = q(k, d.isArray, c.arraySplitSymbol) : d.value = k;
|
|
336
336
|
}
|
|
337
337
|
}, {
|
|
338
|
-
prefix: Array.isArray(
|
|
339
|
-
type:
|
|
338
|
+
prefix: Array.isArray(d.value) ? void 0 : () => l.typeTools ? l.typeTools(T) : a(w, null, [!r.hideArrayBtn && a(p, {
|
|
339
|
+
type: d.isArray ? "success" : "default",
|
|
340
340
|
size: "tiny",
|
|
341
|
-
onClick:
|
|
341
|
+
onClick: T.toggleArray
|
|
342
342
|
}, {
|
|
343
|
-
default: () => [
|
|
344
|
-
}),
|
|
345
|
-
type:
|
|
343
|
+
default: () => [N("Array")]
|
|
344
|
+
}), N(" "), !r.hideNumberBtn && a(p, {
|
|
345
|
+
type: d.isNumber ? "success" : "default",
|
|
346
346
|
size: "tiny",
|
|
347
|
-
onClick:
|
|
347
|
+
onClick: T.toggleNumber
|
|
348
348
|
}, {
|
|
349
|
-
default: () => [
|
|
349
|
+
default: () => [N("Number")]
|
|
350
350
|
})]),
|
|
351
351
|
suffix: () => {
|
|
352
|
-
let
|
|
353
|
-
return
|
|
352
|
+
let k;
|
|
353
|
+
return v < e.depth ? !R && (l.newChild ? l.newChild(T) : a(p, {
|
|
354
354
|
type: "success",
|
|
355
355
|
size: "tiny",
|
|
356
356
|
onClick: () => {
|
|
357
|
-
|
|
357
|
+
j && (d.value = [], d.isArray = void 0), d.value.push({
|
|
358
358
|
rId: e.randomFun(),
|
|
359
359
|
key: "",
|
|
360
360
|
value: ""
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
},
|
|
364
|
-
default: () => [
|
|
363
|
+
}, Re(k = e.newChildTxt(d)) ? k : {
|
|
364
|
+
default: () => [k]
|
|
365
365
|
})) : null;
|
|
366
366
|
}
|
|
367
|
-
})]),
|
|
367
|
+
})]), a("div", {
|
|
368
368
|
class: "btn"
|
|
369
|
-
}, [
|
|
369
|
+
}, [l.rowActions ? l.rowActions(T) : a(w, null, [a(p, {
|
|
370
370
|
type: "success",
|
|
371
|
-
disabled: !
|
|
372
|
-
onClick:
|
|
371
|
+
disabled: !T.isLast,
|
|
372
|
+
onClick: T.addItem
|
|
373
373
|
}, {
|
|
374
|
-
default: () => [
|
|
375
|
-
}),
|
|
374
|
+
default: () => [N("+")]
|
|
375
|
+
}), a(p, {
|
|
376
376
|
type: "error",
|
|
377
|
-
onClick:
|
|
377
|
+
onClick: T.removeItem
|
|
378
378
|
}, {
|
|
379
|
-
default: () => [
|
|
380
|
-
})])]), Array.isArray(
|
|
379
|
+
default: () => [N("-")]
|
|
380
|
+
})])]), Array.isArray(d.value) && f(d.value, v + 1, d)]);
|
|
381
381
|
})]);
|
|
382
|
-
|
|
382
|
+
H(o, (g) => {
|
|
383
383
|
if (!e.isController) return;
|
|
384
|
-
const
|
|
385
|
-
u("update:modelValue",
|
|
384
|
+
const v = m(g);
|
|
385
|
+
u("update:modelValue", v), u("onMerge", v, P(o.value));
|
|
386
386
|
}, {
|
|
387
387
|
deep: !0
|
|
388
|
-
}),
|
|
389
|
-
onSet: (
|
|
390
|
-
o.value =
|
|
388
|
+
}), n({
|
|
389
|
+
onSet: (g) => {
|
|
390
|
+
o.value = i(g ?? e.modelValue);
|
|
391
391
|
},
|
|
392
|
-
getResult: (
|
|
392
|
+
getResult: (g = "res") => g === "ori" ? P(o.value) : m(o.value)
|
|
393
393
|
});
|
|
394
|
-
const
|
|
394
|
+
const b = () => o.value.push({
|
|
395
395
|
rId: e.randomFun(),
|
|
396
396
|
key: "",
|
|
397
397
|
value: ""
|
|
398
|
-
}),
|
|
399
|
-
o.value =
|
|
400
|
-
},
|
|
401
|
-
const
|
|
402
|
-
u("update:modelValue",
|
|
398
|
+
}), y = () => {
|
|
399
|
+
o.value = i(e.modelValue), u("onReset");
|
|
400
|
+
}, S = () => {
|
|
401
|
+
const g = m(o.value);
|
|
402
|
+
u("update:modelValue", g), u("onMerge", g, P(o.value)), o.value = i(g);
|
|
403
403
|
};
|
|
404
|
-
return () =>
|
|
404
|
+
return () => a("div", {
|
|
405
405
|
class: `dynamicCascadeForm ${e.dyCls}`
|
|
406
|
-
}, [
|
|
406
|
+
}, [a("div", {
|
|
407
407
|
class: `dyFormList ${o.value.length ? "" : "noObj"}`,
|
|
408
408
|
style: {
|
|
409
|
-
maxHeight:
|
|
409
|
+
maxHeight: r.maxHeight
|
|
410
410
|
}
|
|
411
|
-
}, [
|
|
411
|
+
}, [f(o.value)]), a("div", {
|
|
412
412
|
class: `control ${o.value.length ? "" : "noObj"}`
|
|
413
|
-
}, [!o.value.length && (
|
|
414
|
-
newItem:
|
|
415
|
-
}) :
|
|
413
|
+
}, [!o.value.length && (l.newBtn ? l.newBtn({
|
|
414
|
+
newItem: b
|
|
415
|
+
}) : a(p, {
|
|
416
416
|
type: "success",
|
|
417
|
-
onClick:
|
|
417
|
+
onClick: b
|
|
418
418
|
}, {
|
|
419
|
-
default: () => [
|
|
420
|
-
})), !e.isController &&
|
|
421
|
-
reset:
|
|
422
|
-
}) :
|
|
419
|
+
default: () => [s.newTxt]
|
|
420
|
+
})), !e.isController && a(w, null, [!r.hideReset && (l.resetBtn ? l.resetBtn({
|
|
421
|
+
reset: y
|
|
422
|
+
}) : a(p, {
|
|
423
423
|
type: "default",
|
|
424
|
-
onClick:
|
|
424
|
+
onClick: y
|
|
425
425
|
}, {
|
|
426
|
-
default: () => [
|
|
427
|
-
})),
|
|
428
|
-
merge:
|
|
429
|
-
}) :
|
|
426
|
+
default: () => [s.resetTxt]
|
|
427
|
+
})), l.mergeBtn ? l.mergeBtn({
|
|
428
|
+
merge: S
|
|
429
|
+
}) : a(p, {
|
|
430
430
|
type: "info",
|
|
431
|
-
onClick:
|
|
431
|
+
onClick: S
|
|
432
432
|
}, {
|
|
433
|
-
default: () => [
|
|
433
|
+
default: () => [s.mergeTxt]
|
|
434
434
|
})])])]);
|
|
435
435
|
}
|
|
436
|
-
}),
|
|
436
|
+
}), L = /* @__PURE__ */ F({
|
|
437
437
|
name: "NaiDynamicForm",
|
|
438
438
|
props: {
|
|
439
439
|
formConfig: {
|
|
@@ -467,219 +467,415 @@ const Oe = /* @__PURE__ */ z({
|
|
|
467
467
|
slots: Object,
|
|
468
468
|
setup(e, {
|
|
469
469
|
expose: u,
|
|
470
|
-
slots:
|
|
470
|
+
slots: n
|
|
471
471
|
}) {
|
|
472
|
-
const
|
|
473
|
-
...
|
|
474
|
-
let
|
|
475
|
-
return
|
|
472
|
+
const l = x(null), s = B(() => (e.items ?? []).filter((o) => !o.hidden)), r = B(() => s.value ? s.value.reduce((o, f) => (o[f.key] = f.value.value, o), {}) : {}), c = B(() => ({
|
|
473
|
+
...s.value?.reduce((f, b) => {
|
|
474
|
+
let y = b.rule;
|
|
475
|
+
return b.required && !b.rule && (y = {
|
|
476
476
|
required: !0,
|
|
477
|
-
message:
|
|
477
|
+
message: b.requiredHint?.(b?.label ?? "") ?? `${b.label}不能为空`,
|
|
478
478
|
trigger: ["blur"]
|
|
479
|
-
}),
|
|
479
|
+
}), f[b.key] = y, f;
|
|
480
480
|
}, {}),
|
|
481
481
|
...e.rules
|
|
482
|
-
})),
|
|
483
|
-
const
|
|
484
|
-
return Number(
|
|
482
|
+
})), t = B(() => [...s.value].sort((f, b) => {
|
|
483
|
+
const y = f.sort ?? 1 / 0, S = b.sort ?? 1 / 0;
|
|
484
|
+
return Number(y) - Number(S);
|
|
485
485
|
}));
|
|
486
|
-
function
|
|
487
|
-
|
|
488
|
-
|
|
486
|
+
function i(o = null) {
|
|
487
|
+
s.value && s.value.forEach((f) => {
|
|
488
|
+
f.value.value = o;
|
|
489
489
|
});
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
return new Promise((o,
|
|
493
|
-
|
|
494
|
-
|
|
491
|
+
function m() {
|
|
492
|
+
return new Promise((o, f) => {
|
|
493
|
+
l.value?.validate((b) => {
|
|
494
|
+
b ? f(b) : o(r.value);
|
|
495
495
|
});
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
if (u({
|
|
499
|
-
reset:
|
|
500
|
-
validator:
|
|
501
|
-
getResult: (o = "res") => o === "ori" ?
|
|
499
|
+
reset: i,
|
|
500
|
+
validator: m,
|
|
501
|
+
getResult: (o = "res") => o === "ori" ? s.value : r.value
|
|
502
502
|
}), !e.items) throw new Error("prop items must be not null");
|
|
503
|
-
return () =>
|
|
503
|
+
return () => a("div", {
|
|
504
504
|
class: "naiDynamicForm"
|
|
505
|
-
}, [
|
|
505
|
+
}, [n.header && a("div", {
|
|
506
506
|
class: "header"
|
|
507
|
-
}, [
|
|
508
|
-
ref:
|
|
507
|
+
}, [n.header?.()]), a(se, A({
|
|
508
|
+
ref: l
|
|
509
509
|
}, e.formConfig, {
|
|
510
|
-
model:
|
|
511
|
-
rules:
|
|
510
|
+
model: r.value,
|
|
511
|
+
rules: c.value
|
|
512
512
|
}), {
|
|
513
513
|
default() {
|
|
514
|
-
const o =
|
|
515
|
-
return e.preset === "grid" ?
|
|
514
|
+
const o = t.value;
|
|
515
|
+
return e.preset === "grid" ? C(ie, {
|
|
516
516
|
...e.gridConfig
|
|
517
517
|
}, {
|
|
518
|
-
default: () => o?.map((
|
|
519
|
-
label:
|
|
520
|
-
path:
|
|
521
|
-
span:
|
|
522
|
-
offset:
|
|
518
|
+
default: () => o?.map((f) => C(ce, {
|
|
519
|
+
label: f.label,
|
|
520
|
+
path: f.path || f.key,
|
|
521
|
+
span: f.span ?? 24,
|
|
522
|
+
offset: f.offset ?? 0
|
|
523
523
|
}, {
|
|
524
|
-
default:
|
|
524
|
+
default: G(f)
|
|
525
525
|
}))
|
|
526
|
-
}) : o?.map((
|
|
527
|
-
label:
|
|
528
|
-
path:
|
|
526
|
+
}) : o?.map((f) => C(de, {
|
|
527
|
+
label: f.label,
|
|
528
|
+
path: f.path || f.key
|
|
529
529
|
}, {
|
|
530
|
-
default:
|
|
530
|
+
default: G(f)
|
|
531
531
|
}));
|
|
532
532
|
}
|
|
533
|
-
}),
|
|
533
|
+
}), n.footer && C("div", {
|
|
534
534
|
class: "footer"
|
|
535
|
-
},
|
|
535
|
+
}, n.footer?.())]);
|
|
536
536
|
}
|
|
537
537
|
});
|
|
538
|
-
function
|
|
538
|
+
function G(e) {
|
|
539
539
|
return function() {
|
|
540
540
|
return e.render2 ? e.render2(e) : null;
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
543
|
+
function Z(e) {
|
|
544
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
545
|
+
}
|
|
546
|
+
const Xe = /* @__PURE__ */ F({
|
|
547
|
+
name: "NaiPopupModal",
|
|
548
|
+
props: {
|
|
549
|
+
title: {
|
|
550
|
+
type: [String, Function]
|
|
551
|
+
},
|
|
552
|
+
modalProps: {
|
|
553
|
+
type: Object
|
|
554
|
+
},
|
|
555
|
+
to: {
|
|
556
|
+
type: String
|
|
557
|
+
},
|
|
558
|
+
showClose: {
|
|
559
|
+
type: Boolean,
|
|
560
|
+
default: !0
|
|
561
|
+
},
|
|
562
|
+
closeOnMask: {
|
|
563
|
+
type: Boolean,
|
|
564
|
+
default: !0
|
|
565
|
+
},
|
|
566
|
+
width: {
|
|
567
|
+
type: String,
|
|
568
|
+
default: "min(1080px,90%)"
|
|
569
|
+
},
|
|
570
|
+
onCancel: {
|
|
571
|
+
type: Function,
|
|
572
|
+
default: () => !0
|
|
573
|
+
},
|
|
574
|
+
onSubmit: {
|
|
575
|
+
type: Function,
|
|
576
|
+
default: () => !0
|
|
577
|
+
},
|
|
578
|
+
footerTxt: {
|
|
579
|
+
type: Array,
|
|
580
|
+
default: () => ["Cancel", "Submit"]
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
slots: Object,
|
|
584
|
+
/*emits: {
|
|
585
|
+
cancel: () => true,
|
|
586
|
+
submit: () => true,
|
|
587
|
+
},*/
|
|
588
|
+
setup(e, {
|
|
589
|
+
expose: u,
|
|
590
|
+
emit: n,
|
|
591
|
+
slots: l
|
|
592
|
+
}) {
|
|
593
|
+
const s = B(() => ({
|
|
594
|
+
preset: "card",
|
|
595
|
+
draggable: !0,
|
|
596
|
+
...e.modalProps ?? {}
|
|
597
|
+
})), r = x(!1), c = le({
|
|
598
|
+
c: !1,
|
|
599
|
+
s: !1
|
|
600
|
+
}), t = (o) => {
|
|
601
|
+
r.value = o ?? !r.value;
|
|
602
|
+
};
|
|
603
|
+
u({
|
|
604
|
+
toggle: t
|
|
605
|
+
});
|
|
606
|
+
const i = async () => {
|
|
607
|
+
c.c = !0, (await e.onCancel?.() ?? !0) && t(!1), c.c = !1;
|
|
608
|
+
}, m = async () => {
|
|
609
|
+
c.s = !0, (await e.onSubmit?.() ?? !0) && t(!1), c.s = !1;
|
|
610
|
+
};
|
|
611
|
+
return () => a(fe, A({
|
|
612
|
+
show: r.value,
|
|
613
|
+
"onUpdate:show": (o) => r.value = o,
|
|
614
|
+
style: {
|
|
615
|
+
width: e.width
|
|
616
|
+
},
|
|
617
|
+
title: e.title,
|
|
618
|
+
to: e.to,
|
|
619
|
+
closable: e.showClose,
|
|
620
|
+
maskClosable: e.closeOnMask
|
|
621
|
+
}, s.value), {
|
|
622
|
+
footer: () => {
|
|
623
|
+
const [o, f] = e.footerTxt, {
|
|
624
|
+
c: b,
|
|
625
|
+
s: y
|
|
626
|
+
} = c;
|
|
627
|
+
return a("div", {
|
|
628
|
+
class: "flex justify-end align-center sm-gap"
|
|
629
|
+
}, [a(p, {
|
|
630
|
+
size: "small",
|
|
631
|
+
onClick: i,
|
|
632
|
+
loading: b
|
|
633
|
+
}, Z(o) ? o : {
|
|
634
|
+
default: () => [o]
|
|
635
|
+
}), a(p, {
|
|
636
|
+
size: "small",
|
|
637
|
+
type: "success",
|
|
638
|
+
onClick: m,
|
|
639
|
+
loading: y
|
|
640
|
+
}, Z(f) ? f : {
|
|
641
|
+
default: () => [f]
|
|
642
|
+
})]);
|
|
643
|
+
},
|
|
644
|
+
...l
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
function _(e) {
|
|
649
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
650
|
+
}
|
|
651
|
+
const Ye = /* @__PURE__ */ F({
|
|
652
|
+
name: "NaiZealCard",
|
|
653
|
+
props: {
|
|
654
|
+
title: {
|
|
655
|
+
type: String
|
|
656
|
+
},
|
|
657
|
+
zealHeight: {
|
|
658
|
+
type: String,
|
|
659
|
+
default: "100vh"
|
|
660
|
+
},
|
|
661
|
+
outPadding: {
|
|
662
|
+
type: Number,
|
|
663
|
+
default: 20
|
|
664
|
+
},
|
|
665
|
+
searchBtnTxt: {
|
|
666
|
+
type: Array,
|
|
667
|
+
default: () => ["Reset", "Search"]
|
|
668
|
+
},
|
|
669
|
+
checkWindowSize: {
|
|
670
|
+
type: Array,
|
|
671
|
+
default: [756, 500]
|
|
672
|
+
},
|
|
673
|
+
observeDelay: {
|
|
674
|
+
type: Number,
|
|
675
|
+
default: 100
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
slots: Object,
|
|
679
|
+
setup(e, {
|
|
680
|
+
slots: u,
|
|
681
|
+
expose: n
|
|
682
|
+
}) {
|
|
683
|
+
const l = Y(...e.checkWindowSize), {
|
|
684
|
+
wrapRef: s,
|
|
685
|
+
cardRef: r,
|
|
686
|
+
restRef: c,
|
|
687
|
+
tableHeight: t
|
|
688
|
+
} = ee(U, e.observeDelay);
|
|
689
|
+
return n({
|
|
690
|
+
tableHeight: t,
|
|
691
|
+
isMobile: B(() => l.isMobile)
|
|
692
|
+
}), () => {
|
|
693
|
+
const i = te(l);
|
|
694
|
+
return a("div", {
|
|
695
|
+
class: "zealCard",
|
|
696
|
+
style: {
|
|
697
|
+
height: `calc(${e.zealHeight} - ${e.outPadding * 2}px)`
|
|
698
|
+
},
|
|
699
|
+
ref: s
|
|
700
|
+
}, [a(U, {
|
|
701
|
+
ref: r
|
|
702
|
+
}, {
|
|
703
|
+
default: () => [u.default?.({
|
|
704
|
+
tableHeight: t.value,
|
|
705
|
+
...i
|
|
706
|
+
})],
|
|
707
|
+
header: () => {
|
|
708
|
+
const [m, o] = e.searchBtnTxt;
|
|
709
|
+
return a("div", {
|
|
710
|
+
class: "header"
|
|
711
|
+
}, [u.header?.(i) ?? a(w, null, [a("div", {
|
|
712
|
+
class: "title"
|
|
713
|
+
}, [e.title]), a("div", {
|
|
714
|
+
class: "search"
|
|
715
|
+
}, [u.searchForm?.(i), u.searchBtn?.(i) || u.searchForm && a("div", {
|
|
716
|
+
class: "searchBtn"
|
|
717
|
+
}, [a(p, {
|
|
718
|
+
size: "small"
|
|
719
|
+
}, _(m) ? m : {
|
|
720
|
+
default: () => [m]
|
|
721
|
+
}), a(p, {
|
|
722
|
+
type: "info",
|
|
723
|
+
size: "small"
|
|
724
|
+
}, _(o) ? o : {
|
|
725
|
+
default: () => [o]
|
|
726
|
+
})])])]), a("div", {
|
|
727
|
+
class: "controlBtn"
|
|
728
|
+
}, [a("div", null, [u.controlBtn?.(i)]), u.toolBtn?.(i)])]);
|
|
729
|
+
},
|
|
730
|
+
footer: () => u.footer ? a("div", {
|
|
731
|
+
class: "footer"
|
|
732
|
+
}, [u.footer?.(i)]) : null
|
|
733
|
+
}), a("div", {
|
|
734
|
+
ref: c
|
|
735
|
+
}, [u.rest?.(i)])]);
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
function ze(e, u = {}, n) {
|
|
740
|
+
const { onChange: l, ...s } = n ?? {};
|
|
741
|
+
return C(O, {
|
|
742
|
+
...s,
|
|
547
743
|
value: e.value,
|
|
548
|
-
onUpdateValue: (
|
|
549
|
-
e.value =
|
|
744
|
+
onUpdateValue: (r) => {
|
|
745
|
+
e.value = r, n?.onChange?.(r, n);
|
|
550
746
|
},
|
|
551
747
|
...u
|
|
552
748
|
});
|
|
553
749
|
}
|
|
554
|
-
function
|
|
555
|
-
const { onChange:
|
|
556
|
-
return
|
|
557
|
-
...
|
|
750
|
+
function Pe(e, u, n = {}, l) {
|
|
751
|
+
const { onChange: s, ...r } = l ?? {};
|
|
752
|
+
return C(ye, {
|
|
753
|
+
...r,
|
|
558
754
|
value: e.value,
|
|
559
755
|
options: u,
|
|
560
|
-
onUpdateValue: (
|
|
561
|
-
e.value =
|
|
756
|
+
onUpdateValue: (c) => {
|
|
757
|
+
e.value = c, l?.onChange?.(c, l, u);
|
|
562
758
|
},
|
|
563
|
-
...
|
|
759
|
+
...n
|
|
564
760
|
});
|
|
565
761
|
}
|
|
566
|
-
function
|
|
567
|
-
const { value:
|
|
568
|
-
return
|
|
569
|
-
|
|
762
|
+
function je(e, u, n = {}, l, s) {
|
|
763
|
+
const { value: r, labelField: c, valueField: t, onChange: i, ...m } = l ?? {}, o = c ?? "label", f = t ?? "value", b = m.options ?? u;
|
|
764
|
+
return a(
|
|
765
|
+
me,
|
|
570
766
|
{
|
|
571
|
-
...
|
|
767
|
+
...m,
|
|
572
768
|
value: e.value,
|
|
573
|
-
onUpdateValue: (
|
|
574
|
-
e.value =
|
|
769
|
+
onUpdateValue: (y) => {
|
|
770
|
+
e.value = y, l?.onChange?.(y, l, b);
|
|
575
771
|
},
|
|
576
|
-
options:
|
|
577
|
-
...
|
|
772
|
+
options: b.map((y) => ({ ...y, label: y[o], value: y[f] })),
|
|
773
|
+
...n
|
|
578
774
|
},
|
|
579
775
|
{
|
|
580
|
-
default: () =>
|
|
776
|
+
default: () => s ?? a(p, null, {
|
|
581
777
|
default: () => e.value || "请选择"
|
|
582
778
|
})
|
|
583
779
|
}
|
|
584
780
|
);
|
|
585
781
|
}
|
|
586
|
-
function
|
|
587
|
-
const { valueField:
|
|
588
|
-
return
|
|
589
|
-
...
|
|
782
|
+
function Ae(e, u, n = {}, l) {
|
|
783
|
+
const { valueField: s = "value", onChange: r, ...c } = l ?? {};
|
|
784
|
+
return C(ve, {
|
|
785
|
+
...c,
|
|
590
786
|
value: e.value,
|
|
591
787
|
options: u,
|
|
592
|
-
onUpdateValue: (
|
|
593
|
-
e.value =
|
|
788
|
+
onUpdateValue: (t) => {
|
|
789
|
+
e.value = t, l?.onChange?.(t, l, u);
|
|
594
790
|
},
|
|
595
|
-
keyField:
|
|
596
|
-
...
|
|
791
|
+
keyField: s,
|
|
792
|
+
...n
|
|
597
793
|
});
|
|
598
794
|
}
|
|
599
|
-
function
|
|
600
|
-
const { onChange:
|
|
601
|
-
return
|
|
602
|
-
|
|
795
|
+
function Oe(e, u, n = {}, l) {
|
|
796
|
+
const { onChange: s, ...r } = l ?? {};
|
|
797
|
+
return C(
|
|
798
|
+
E,
|
|
603
799
|
{
|
|
604
|
-
...
|
|
800
|
+
...r,
|
|
605
801
|
value: e.value,
|
|
606
|
-
onUpdateValue: (
|
|
607
|
-
e.value =
|
|
802
|
+
onUpdateValue: (c) => {
|
|
803
|
+
e.value = c, l?.onChange?.(c, l, u);
|
|
608
804
|
},
|
|
609
|
-
...
|
|
805
|
+
...n
|
|
610
806
|
},
|
|
611
807
|
{
|
|
612
|
-
default: () => (
|
|
613
|
-
const
|
|
614
|
-
return
|
|
615
|
-
|
|
808
|
+
default: () => (l?.options ?? u).map((t) => {
|
|
809
|
+
const i = l, m = t[i?.labelField ?? "label"], o = t[i?.valueField ?? "value"];
|
|
810
|
+
return C(
|
|
811
|
+
ge,
|
|
616
812
|
{
|
|
617
|
-
...
|
|
618
|
-
label:
|
|
813
|
+
...t,
|
|
814
|
+
label: m,
|
|
619
815
|
value: o
|
|
620
816
|
},
|
|
621
817
|
{
|
|
622
|
-
default: () =>
|
|
818
|
+
default: () => t.label
|
|
623
819
|
}
|
|
624
820
|
);
|
|
625
821
|
})
|
|
626
822
|
}
|
|
627
823
|
);
|
|
628
824
|
}
|
|
629
|
-
function
|
|
630
|
-
const { onChange:
|
|
631
|
-
return
|
|
632
|
-
|
|
825
|
+
function De(e, u, n = {}, l) {
|
|
826
|
+
const { onChange: s, ...r } = l ?? {};
|
|
827
|
+
return a(
|
|
828
|
+
E,
|
|
633
829
|
{
|
|
634
|
-
...
|
|
830
|
+
...r,
|
|
635
831
|
value: e.value,
|
|
636
|
-
onUpdateValue: (
|
|
637
|
-
e.value =
|
|
832
|
+
onUpdateValue: (c) => {
|
|
833
|
+
e.value = c, l?.onChange?.(c, l, u);
|
|
638
834
|
},
|
|
639
|
-
...
|
|
835
|
+
...n
|
|
640
836
|
},
|
|
641
837
|
{
|
|
642
|
-
default: () => (
|
|
643
|
-
const
|
|
644
|
-
return
|
|
645
|
-
|
|
838
|
+
default: () => (l?.options ?? u).map((t) => {
|
|
839
|
+
const i = l, m = t[i?.labelField ?? "label"], o = t[i?.valueField ?? "value"];
|
|
840
|
+
return a(
|
|
841
|
+
pe,
|
|
646
842
|
{
|
|
647
|
-
...
|
|
648
|
-
label:
|
|
843
|
+
...t,
|
|
844
|
+
label: m,
|
|
649
845
|
value: o
|
|
650
846
|
},
|
|
651
847
|
{
|
|
652
|
-
default: () =>
|
|
848
|
+
default: () => t.label
|
|
653
849
|
}
|
|
654
850
|
);
|
|
655
851
|
})
|
|
656
852
|
}
|
|
657
853
|
);
|
|
658
854
|
}
|
|
659
|
-
function
|
|
660
|
-
const { onChange:
|
|
661
|
-
return
|
|
662
|
-
|
|
855
|
+
function Me(e, u, n = {}, l) {
|
|
856
|
+
const { onChange: s, ...r } = l ?? {};
|
|
857
|
+
return C(
|
|
858
|
+
be,
|
|
663
859
|
{
|
|
664
|
-
...
|
|
860
|
+
...r,
|
|
665
861
|
value: e.value,
|
|
666
|
-
onUpdateValue: (
|
|
667
|
-
e.value =
|
|
862
|
+
onUpdateValue: (c) => {
|
|
863
|
+
e.value = c, l?.onChange?.(c, l, u);
|
|
668
864
|
},
|
|
669
|
-
...
|
|
865
|
+
...n
|
|
670
866
|
},
|
|
671
867
|
{
|
|
672
|
-
default: () =>
|
|
673
|
-
|
|
868
|
+
default: () => C(
|
|
869
|
+
he,
|
|
674
870
|
{
|
|
675
871
|
itemStyle: "display: flex"
|
|
676
872
|
},
|
|
677
873
|
{
|
|
678
|
-
default: () => (
|
|
679
|
-
const
|
|
680
|
-
return
|
|
874
|
+
default: () => (l?.options ?? u).map((t) => {
|
|
875
|
+
const i = l, m = t[i?.labelField ?? "label"], o = t[i?.valueField ?? "value"];
|
|
876
|
+
return C(K, {
|
|
681
877
|
value: o,
|
|
682
|
-
label:
|
|
878
|
+
label: m
|
|
683
879
|
});
|
|
684
880
|
})
|
|
685
881
|
}
|
|
@@ -687,154 +883,452 @@ function Ce(e, u, a = {}, r) {
|
|
|
687
883
|
}
|
|
688
884
|
);
|
|
689
885
|
}
|
|
690
|
-
function
|
|
691
|
-
const { onChange:
|
|
692
|
-
return
|
|
693
|
-
...
|
|
886
|
+
function Ve(e, u = {}, n) {
|
|
887
|
+
const { onChange: l, ...s } = n ?? {};
|
|
888
|
+
return C(Ce, {
|
|
889
|
+
...s,
|
|
694
890
|
value: e.value,
|
|
695
|
-
onUpdateValue: (
|
|
696
|
-
e.value =
|
|
891
|
+
onUpdateValue: (r) => {
|
|
892
|
+
e.value = r, n?.onChange?.(r, n);
|
|
697
893
|
},
|
|
698
894
|
...u
|
|
699
895
|
});
|
|
700
896
|
}
|
|
701
|
-
function
|
|
702
|
-
const { onChange:
|
|
703
|
-
return
|
|
704
|
-
...
|
|
897
|
+
function $e(e, u = {}, n) {
|
|
898
|
+
const { onChange: l, ...s } = n ?? {};
|
|
899
|
+
return C(Se, {
|
|
900
|
+
...s,
|
|
705
901
|
value: e.value,
|
|
706
|
-
onUpdateValue: (
|
|
707
|
-
e.value =
|
|
902
|
+
onUpdateValue: (r) => {
|
|
903
|
+
e.value = r, n?.onChange?.(r, n);
|
|
708
904
|
},
|
|
709
905
|
...u
|
|
710
906
|
});
|
|
711
907
|
}
|
|
712
|
-
function
|
|
713
|
-
const { onChange:
|
|
714
|
-
return
|
|
715
|
-
...
|
|
908
|
+
function He(e, u = {}, n) {
|
|
909
|
+
const { onChange: l, ...s } = n ?? {};
|
|
910
|
+
return C(ke, {
|
|
911
|
+
...s,
|
|
716
912
|
value: e.value,
|
|
717
|
-
onUpdateValue: (
|
|
718
|
-
e.value =
|
|
913
|
+
onUpdateValue: (r) => {
|
|
914
|
+
e.value = r, n?.onChange?.(r, n);
|
|
719
915
|
},
|
|
720
916
|
...u
|
|
721
917
|
});
|
|
722
918
|
}
|
|
723
|
-
function
|
|
724
|
-
const { onChange:
|
|
725
|
-
return
|
|
726
|
-
|
|
919
|
+
function Ue(e, u = {}, n) {
|
|
920
|
+
const { onChange: l, ...s } = n ?? {};
|
|
921
|
+
return C(
|
|
922
|
+
K,
|
|
727
923
|
{
|
|
728
|
-
...
|
|
924
|
+
...s,
|
|
729
925
|
checked: e.value,
|
|
730
|
-
onUpdateChecked: (
|
|
731
|
-
e.value =
|
|
926
|
+
onUpdateChecked: (r) => {
|
|
927
|
+
e.value = r, n?.onChange?.(r, n);
|
|
732
928
|
},
|
|
733
929
|
...u
|
|
734
930
|
},
|
|
735
931
|
{
|
|
736
|
-
default: () => u?.label ??
|
|
932
|
+
default: () => u?.label ?? n?.label
|
|
737
933
|
}
|
|
738
934
|
);
|
|
739
935
|
}
|
|
740
|
-
function
|
|
741
|
-
const { onChange:
|
|
742
|
-
return
|
|
743
|
-
...
|
|
936
|
+
function Le(e, u = {}, n) {
|
|
937
|
+
const { onChange: l, ...s } = n ?? {};
|
|
938
|
+
return C(Ne, {
|
|
939
|
+
...s,
|
|
744
940
|
value: e.value,
|
|
745
|
-
onUpdateValue: (
|
|
746
|
-
e.value =
|
|
941
|
+
onUpdateValue: (r) => {
|
|
942
|
+
e.value = r, n?.onChange?.(r, n);
|
|
747
943
|
},
|
|
748
944
|
...u
|
|
749
945
|
});
|
|
750
946
|
}
|
|
751
|
-
function
|
|
752
|
-
const { onChange:
|
|
753
|
-
return
|
|
754
|
-
...
|
|
947
|
+
function Ge(e, u = {}, n) {
|
|
948
|
+
const { onChange: l, ...s } = n ?? {};
|
|
949
|
+
return C(xe, {
|
|
950
|
+
...s,
|
|
755
951
|
value: e.value,
|
|
756
|
-
onUpdateValue: (
|
|
757
|
-
e.value =
|
|
952
|
+
onUpdateValue: (r) => {
|
|
953
|
+
e.value = r, n?.onChange?.(r, n);
|
|
758
954
|
},
|
|
759
955
|
...u
|
|
760
956
|
});
|
|
761
957
|
}
|
|
762
|
-
function
|
|
763
|
-
const { onChange:
|
|
764
|
-
return
|
|
765
|
-
...
|
|
958
|
+
function Ze(e, u = {}, n) {
|
|
959
|
+
const { onChange: l, ...s } = n ?? {};
|
|
960
|
+
return C(we, {
|
|
961
|
+
...s,
|
|
766
962
|
value: e.value,
|
|
767
|
-
onUpdateValue: (
|
|
768
|
-
e.value =
|
|
963
|
+
onUpdateValue: (r) => {
|
|
964
|
+
e.value = r, n?.onChange?.(r, n);
|
|
769
965
|
},
|
|
770
966
|
...u
|
|
771
967
|
});
|
|
772
968
|
}
|
|
773
|
-
const
|
|
969
|
+
const _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
774
970
|
__proto__: null,
|
|
775
|
-
renderCheckbox:
|
|
776
|
-
renderCheckboxGroup:
|
|
777
|
-
renderDatePicker:
|
|
778
|
-
renderDynamicTags:
|
|
779
|
-
renderInput:
|
|
780
|
-
renderInputNumber:
|
|
781
|
-
renderPopSelect:
|
|
782
|
-
renderRadioButtonGroup:
|
|
783
|
-
renderRadioGroup:
|
|
784
|
-
renderSelect:
|
|
785
|
-
renderSlider:
|
|
786
|
-
renderSwitch:
|
|
787
|
-
renderTimePicker:
|
|
788
|
-
renderTreeSelect:
|
|
971
|
+
renderCheckbox: Ue,
|
|
972
|
+
renderCheckboxGroup: Me,
|
|
973
|
+
renderDatePicker: $e,
|
|
974
|
+
renderDynamicTags: Le,
|
|
975
|
+
renderInput: ze,
|
|
976
|
+
renderInputNumber: Ze,
|
|
977
|
+
renderPopSelect: je,
|
|
978
|
+
renderRadioButtonGroup: De,
|
|
979
|
+
renderRadioGroup: Oe,
|
|
980
|
+
renderSelect: Pe,
|
|
981
|
+
renderSlider: Ge,
|
|
982
|
+
renderSwitch: Ve,
|
|
983
|
+
renderTimePicker: He,
|
|
984
|
+
renderTreeSelect: Ae
|
|
789
985
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
790
|
-
function
|
|
791
|
-
return function(
|
|
792
|
-
const
|
|
793
|
-
renderInput: (
|
|
794
|
-
renderSelect: (
|
|
795
|
-
renderPopSelect: (
|
|
796
|
-
renderTreeSelect: (
|
|
797
|
-
renderRadioGroup: (
|
|
798
|
-
renderRadioButtonGroup: (
|
|
799
|
-
renderCheckboxGroup: (
|
|
800
|
-
renderSwitch: (
|
|
801
|
-
renderDatePicker: (
|
|
802
|
-
renderTimePicker: (
|
|
803
|
-
renderCheckbox: (
|
|
804
|
-
renderDynamicTags: (
|
|
805
|
-
renderSlider: (
|
|
806
|
-
renderInputNumber: (
|
|
986
|
+
function qe(e) {
|
|
987
|
+
return function(n, l = !0) {
|
|
988
|
+
const s = e, r = {
|
|
989
|
+
renderInput: (t) => s.renderInput(t.value, t.renderProps ?? {}, t),
|
|
990
|
+
renderSelect: (t) => s.renderSelect(t.value, t.options ?? [], t.renderProps ?? {}, t),
|
|
991
|
+
renderPopSelect: (t) => s.renderPopSelect(t.value, t.options ?? [], t.renderProps ?? {}, t),
|
|
992
|
+
renderTreeSelect: (t) => s.renderTreeSelect(t.value, t.options ?? [], t.renderProps ?? {}, t),
|
|
993
|
+
renderRadioGroup: (t) => s.renderRadioGroup(t.value, t.options ?? [], t.renderProps ?? {}, t),
|
|
994
|
+
renderRadioButtonGroup: (t) => s.renderRadioButtonGroup(t.value, t.options ?? [], t.renderProps ?? {}, t),
|
|
995
|
+
renderCheckboxGroup: (t) => s.renderCheckboxGroup(t.value, t.options ?? [], t.renderProps ?? {}, t),
|
|
996
|
+
renderSwitch: (t) => s.renderSwitch(t.value, t.renderProps ?? {}, t),
|
|
997
|
+
renderDatePicker: (t) => s.renderDatePicker(t.value, t.renderProps ?? {}, t),
|
|
998
|
+
renderTimePicker: (t) => s.renderTimePicker(t.value, t.renderProps ?? {}, t),
|
|
999
|
+
renderCheckbox: (t) => s.renderCheckbox(t.value, t.renderProps ?? {}, t),
|
|
1000
|
+
renderDynamicTags: (t) => s.renderDynamicTags(t.value, t.renderProps ?? {}, t),
|
|
1001
|
+
renderSlider: (t) => s.renderSlider(t.value, t.renderProps ?? {}, t),
|
|
1002
|
+
renderInputNumber: (t) => s.renderInputNumber(t.value, t.renderProps ?? {}, t)
|
|
807
1003
|
};
|
|
808
|
-
return
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
811
|
-
|
|
1004
|
+
return n.map((t) => {
|
|
1005
|
+
const i = t;
|
|
1006
|
+
if (i.value = ae(t.value), typeof t.render2 == "function")
|
|
1007
|
+
i.render2 = t.render2;
|
|
812
1008
|
else {
|
|
813
|
-
const
|
|
814
|
-
o ?
|
|
1009
|
+
const m = t.renderType ?? "renderInput", o = r[m];
|
|
1010
|
+
o ? i.render2 = () => o(i) : (console.warn(`[useDecorateForm] unknown renderType: ${t.renderType}`), i.render2 = () => r.renderInput(i));
|
|
815
1011
|
}
|
|
816
|
-
return
|
|
1012
|
+
return l ? re(i) : i;
|
|
1013
|
+
});
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
const et = qe(_e);
|
|
1017
|
+
function z(e) {
|
|
1018
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !M(e);
|
|
1019
|
+
}
|
|
1020
|
+
const tt = /* @__PURE__ */ F({
|
|
1021
|
+
name: "NaiZealTableSearch",
|
|
1022
|
+
props: {
|
|
1023
|
+
title: {
|
|
1024
|
+
type: String
|
|
1025
|
+
},
|
|
1026
|
+
drawerTitle: {
|
|
1027
|
+
type: String
|
|
1028
|
+
},
|
|
1029
|
+
searchItems: {
|
|
1030
|
+
type: Array,
|
|
1031
|
+
default: []
|
|
1032
|
+
},
|
|
1033
|
+
searchFormMaxHeight: {
|
|
1034
|
+
type: String,
|
|
1035
|
+
default: "200px"
|
|
1036
|
+
},
|
|
1037
|
+
drawerMaxHeight: {
|
|
1038
|
+
type: Number,
|
|
1039
|
+
default: 420
|
|
1040
|
+
},
|
|
1041
|
+
drawerOpenTxt: {
|
|
1042
|
+
type: String,
|
|
1043
|
+
default: "Search Drawer"
|
|
1044
|
+
},
|
|
1045
|
+
searchBtnTxt: {
|
|
1046
|
+
type: Array,
|
|
1047
|
+
default: () => ["Reset", "Search"]
|
|
1048
|
+
},
|
|
1049
|
+
mobileDrawer: {
|
|
1050
|
+
type: Boolean,
|
|
1051
|
+
default: !0
|
|
1052
|
+
},
|
|
1053
|
+
closeDrawerAuto: {
|
|
1054
|
+
type: Boolean,
|
|
1055
|
+
default: !0
|
|
1056
|
+
},
|
|
1057
|
+
copyDefault: {
|
|
1058
|
+
type: Boolean,
|
|
1059
|
+
default: !1
|
|
1060
|
+
},
|
|
1061
|
+
isMobile: {
|
|
1062
|
+
type: Boolean,
|
|
1063
|
+
default: !1
|
|
1064
|
+
}
|
|
1065
|
+
},
|
|
1066
|
+
emits: {
|
|
1067
|
+
onReset: () => !0,
|
|
1068
|
+
onSearch: (e) => !0
|
|
1069
|
+
},
|
|
1070
|
+
slots: Object,
|
|
1071
|
+
setup(e, {
|
|
1072
|
+
emit: u,
|
|
1073
|
+
slots: n,
|
|
1074
|
+
expose: l
|
|
1075
|
+
}) {
|
|
1076
|
+
const s = x(!1), r = x({}), c = ne(e.searchItems), t = (o) => {
|
|
1077
|
+
s.value = o ?? !s.value;
|
|
1078
|
+
}, i = () => {
|
|
1079
|
+
e.copyDefault ? c.setValues(r.value) : c.onReset(null), u("onReset"), t(!1);
|
|
1080
|
+
}, m = () => {
|
|
1081
|
+
const o = c.getValues();
|
|
1082
|
+
u("onSearch", o), t(!1);
|
|
1083
|
+
};
|
|
1084
|
+
return H(() => e.isMobile, (o) => {
|
|
1085
|
+
e.closeDrawerAuto || o || t(!1);
|
|
1086
|
+
}), oe(async () => {
|
|
1087
|
+
await W(), e.copyDefault && (r.value = c.getValues());
|
|
1088
|
+
}), l({
|
|
1089
|
+
onReset: i,
|
|
1090
|
+
onSearch: m,
|
|
1091
|
+
toggleDrawer: t,
|
|
1092
|
+
getParams: () => c.getValues()
|
|
1093
|
+
}), () => {
|
|
1094
|
+
const [o, f] = e.searchBtnTxt;
|
|
1095
|
+
return a("div", {
|
|
1096
|
+
class: "naiZealTableSearch"
|
|
1097
|
+
}, [!e.mobileDrawer || !e.isMobile ? a(w, null, [n.title?.() ?? a("div", {
|
|
1098
|
+
class: "naiTitle"
|
|
1099
|
+
}, [e.title]), a("div", {
|
|
1100
|
+
class: "searchForm",
|
|
1101
|
+
style: {
|
|
1102
|
+
maxHeight: e.searchFormMaxHeight
|
|
1103
|
+
}
|
|
1104
|
+
}, [a(L, {
|
|
1105
|
+
items: e.searchItems,
|
|
1106
|
+
preset: "grid",
|
|
1107
|
+
formConfig: {
|
|
1108
|
+
labelPlacement: "left"
|
|
1109
|
+
// showFeedback: false
|
|
1110
|
+
}
|
|
1111
|
+
}, null)]), n.searchBtn ? n.searchBtn?.({
|
|
1112
|
+
onSearch: m,
|
|
1113
|
+
onReset: i
|
|
1114
|
+
}) : a("div", {
|
|
1115
|
+
class: "searchBtn"
|
|
1116
|
+
}, [a(p, {
|
|
1117
|
+
size: "small",
|
|
1118
|
+
onClick: i
|
|
1119
|
+
}, z(o) ? o : {
|
|
1120
|
+
default: () => [o]
|
|
1121
|
+
}), a(p, {
|
|
1122
|
+
type: "info",
|
|
1123
|
+
size: "small",
|
|
1124
|
+
onClick: m
|
|
1125
|
+
}, z(f) ? f : {
|
|
1126
|
+
default: () => [f]
|
|
1127
|
+
})])]) : a("div", {
|
|
1128
|
+
class: "drawerSearchBtn"
|
|
1129
|
+
}, [n.title?.() ?? a("div", {
|
|
1130
|
+
class: "naiTitle"
|
|
1131
|
+
}, [e.title]), n.drawerBtn ? n.drawerBtn?.({
|
|
1132
|
+
openDrawer: () => t(!0)
|
|
1133
|
+
}) : a(p, {
|
|
1134
|
+
size: "small",
|
|
1135
|
+
onClick: () => {
|
|
1136
|
+
t(!0);
|
|
1137
|
+
}
|
|
1138
|
+
}, {
|
|
1139
|
+
default: () => [e.drawerOpenTxt]
|
|
1140
|
+
})]), a(Te, {
|
|
1141
|
+
class: "naiZealSearchDrawer",
|
|
1142
|
+
show: s.value,
|
|
1143
|
+
"onUpdate:show": (b) => s.value = b,
|
|
1144
|
+
maxHeight: e.drawerMaxHeight,
|
|
1145
|
+
trapFocus: !1,
|
|
1146
|
+
blockScroll: !1,
|
|
1147
|
+
placement: "top"
|
|
1148
|
+
}, {
|
|
1149
|
+
default: () => [a(Fe, {
|
|
1150
|
+
title: e.drawerTitle ?? e.title
|
|
1151
|
+
}, {
|
|
1152
|
+
default: () => [a("div", {
|
|
1153
|
+
class: "searchForm"
|
|
1154
|
+
}, [a(L, {
|
|
1155
|
+
formConfig: {
|
|
1156
|
+
labelPlacement: "left",
|
|
1157
|
+
size: "small"
|
|
1158
|
+
// showFeedback: false
|
|
1159
|
+
},
|
|
1160
|
+
items: e.searchItems
|
|
1161
|
+
}, null)])],
|
|
1162
|
+
footer: () => n.searchBtn ? n.searchBtn?.({
|
|
1163
|
+
onSearch: m,
|
|
1164
|
+
onReset: i
|
|
1165
|
+
}) : a("div", {
|
|
1166
|
+
class: "searchBtn"
|
|
1167
|
+
}, [a(p, {
|
|
1168
|
+
size: "small",
|
|
1169
|
+
onClick: i
|
|
1170
|
+
}, z(o) ? o : {
|
|
1171
|
+
default: () => [o]
|
|
1172
|
+
}), a(p, {
|
|
1173
|
+
type: "info",
|
|
1174
|
+
size: "small",
|
|
1175
|
+
onClick: m
|
|
1176
|
+
}, z(f) ? f : {
|
|
1177
|
+
default: () => [f]
|
|
1178
|
+
})])
|
|
1179
|
+
})]
|
|
1180
|
+
})]);
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
}), at = /* @__PURE__ */ F({
|
|
1184
|
+
name: "NaiZealTablePaginationControl",
|
|
1185
|
+
props: {
|
|
1186
|
+
pagination: {
|
|
1187
|
+
type: Object,
|
|
1188
|
+
required: !0
|
|
1189
|
+
},
|
|
1190
|
+
pageConfig: {
|
|
1191
|
+
type: Object
|
|
1192
|
+
},
|
|
1193
|
+
isMobile: {
|
|
1194
|
+
type: Boolean,
|
|
1195
|
+
default: !1
|
|
1196
|
+
}
|
|
1197
|
+
},
|
|
1198
|
+
slots: Object,
|
|
1199
|
+
setup(e, {
|
|
1200
|
+
slots: u
|
|
1201
|
+
}) {
|
|
1202
|
+
const n = ue(e, "pagination");
|
|
1203
|
+
function l(r) {
|
|
1204
|
+
n.value.pageNo = r, n.value?.onChange();
|
|
1205
|
+
}
|
|
1206
|
+
function s(r) {
|
|
1207
|
+
n.value.pageNo = 1, n.value.pageSize = r, n.value?.onPageSizeChange();
|
|
1208
|
+
}
|
|
1209
|
+
return () => a(Ie, A({
|
|
1210
|
+
page: n.value?.pageNo,
|
|
1211
|
+
"page-size": n.value?.pageSize,
|
|
1212
|
+
itemCount: n.value?.total,
|
|
1213
|
+
pageSizes: n.value?.pageSizes,
|
|
1214
|
+
pageSlot: n.value?.pageSlot,
|
|
1215
|
+
showSizePicker: u.prefix && e.isMobile ? !1 : n.value?.showSizePicker,
|
|
1216
|
+
"onUpdate:page": l,
|
|
1217
|
+
"onUpdate:pageSize": s
|
|
1218
|
+
}, e.pageConfig), {
|
|
1219
|
+
// prefix:({itemCount})=><span>Total {itemCount}</span>
|
|
1220
|
+
...u
|
|
817
1221
|
});
|
|
1222
|
+
}
|
|
1223
|
+
}), nt = /* @__PURE__ */ F({
|
|
1224
|
+
name: "NaiZealTableBtnControl",
|
|
1225
|
+
props: {
|
|
1226
|
+
isMobile: {
|
|
1227
|
+
type: Boolean,
|
|
1228
|
+
default: !1
|
|
1229
|
+
},
|
|
1230
|
+
btnItems: {
|
|
1231
|
+
type: Array,
|
|
1232
|
+
default: () => []
|
|
1233
|
+
},
|
|
1234
|
+
size: {
|
|
1235
|
+
type: String,
|
|
1236
|
+
default: "small"
|
|
1237
|
+
},
|
|
1238
|
+
dropDownProps: {
|
|
1239
|
+
type: Object
|
|
1240
|
+
},
|
|
1241
|
+
dropDownText: {
|
|
1242
|
+
type: String,
|
|
1243
|
+
default: "controls"
|
|
1244
|
+
}
|
|
1245
|
+
},
|
|
1246
|
+
slots: Object,
|
|
1247
|
+
emits: {
|
|
1248
|
+
onSelect: (e) => !0
|
|
1249
|
+
},
|
|
1250
|
+
setup(e, {
|
|
1251
|
+
emit: u,
|
|
1252
|
+
slots: n
|
|
1253
|
+
}) {
|
|
1254
|
+
const l = e.btnItems, {
|
|
1255
|
+
dropDownText: s,
|
|
1256
|
+
size: r
|
|
1257
|
+
} = e, c = (t) => {
|
|
1258
|
+
l.find((i) => i.key === t)?.onSelect?.(t), u("onSelect", t);
|
|
1259
|
+
};
|
|
1260
|
+
return () => a("div", {
|
|
1261
|
+
class: "zealTableBtnControl"
|
|
1262
|
+
}, [e.isMobile ? a(Be, A({
|
|
1263
|
+
size: r,
|
|
1264
|
+
trigger: "click",
|
|
1265
|
+
onSelect: c,
|
|
1266
|
+
options: l.map((t) => ({
|
|
1267
|
+
label: t.title,
|
|
1268
|
+
disabled: t.disabled,
|
|
1269
|
+
key: t.key
|
|
1270
|
+
}))
|
|
1271
|
+
}, e.dropDownProps), {
|
|
1272
|
+
default: () => n.text ? n.text() : a(p, {
|
|
1273
|
+
size: r
|
|
1274
|
+
}, z(s) ? s : {
|
|
1275
|
+
default: () => [s]
|
|
1276
|
+
})
|
|
1277
|
+
}) : l.map((t) => {
|
|
1278
|
+
const {
|
|
1279
|
+
key: i,
|
|
1280
|
+
onSelect: m,
|
|
1281
|
+
title: o,
|
|
1282
|
+
...f
|
|
1283
|
+
} = t;
|
|
1284
|
+
return a(p, A({
|
|
1285
|
+
size: r,
|
|
1286
|
+
key: i,
|
|
1287
|
+
onClick: () => {
|
|
1288
|
+
m?.(i), u("onSelect", i);
|
|
1289
|
+
}
|
|
1290
|
+
}, f), z(o) ? o : {
|
|
1291
|
+
default: () => [o]
|
|
1292
|
+
});
|
|
1293
|
+
})]);
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
function lt(e, u) {
|
|
1297
|
+
const n = x(null), l = B(() => {
|
|
1298
|
+
const s = n.value;
|
|
1299
|
+
return e({
|
|
1300
|
+
isMobile: s?.isMobile ?? x(!1),
|
|
1301
|
+
tableHeight: s?.tableHeight ?? x(0)
|
|
1302
|
+
}).map((r) => ({ ...u, ...r }));
|
|
1303
|
+
});
|
|
1304
|
+
return {
|
|
1305
|
+
naiZealCardRef: n,
|
|
1306
|
+
tableColumns: l
|
|
818
1307
|
};
|
|
819
1308
|
}
|
|
820
|
-
const ze = Te(Ae);
|
|
821
1309
|
export {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
1310
|
+
Qe as NaiDynamicCascadeInput,
|
|
1311
|
+
L as NaiDynamicForm,
|
|
1312
|
+
Je as NaiDynamicInput,
|
|
1313
|
+
Xe as NaiPopupModal,
|
|
1314
|
+
Ye as NaiZealCard,
|
|
1315
|
+
nt as NaiZealTableBtnControl,
|
|
1316
|
+
at as NaiZealTablePaginationControl,
|
|
1317
|
+
tt as NaiZealTableSearch,
|
|
1318
|
+
Ue as renderCheckbox,
|
|
1319
|
+
Me as renderCheckboxGroup,
|
|
1320
|
+
$e as renderDatePicker,
|
|
1321
|
+
Le as renderDynamicTags,
|
|
1322
|
+
ze as renderInput,
|
|
1323
|
+
Ze as renderInputNumber,
|
|
1324
|
+
je as renderPopSelect,
|
|
1325
|
+
De as renderRadioButtonGroup,
|
|
1326
|
+
Oe as renderRadioGroup,
|
|
1327
|
+
Pe as renderSelect,
|
|
1328
|
+
Ge as renderSlider,
|
|
1329
|
+
Ve as renderSwitch,
|
|
1330
|
+
He as renderTimePicker,
|
|
1331
|
+
Ae as renderTreeSelect,
|
|
1332
|
+
et as useDecorateForm,
|
|
1333
|
+
lt as useZealColumnTool
|
|
840
1334
|
};
|