@maxtan/ez-ui 0.24.0 → 0.25.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/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +774 -643
- package/dist/types/index.d.ts +66 -7
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { useAttrs as
|
|
2
|
-
import { useLocale as
|
|
3
|
-
const
|
|
4
|
-
for (const
|
|
5
|
-
|
|
1
|
+
import { useAttrs as Me, computed as T, defineComponent as w, mergeModels as F, useModel as L, createBlock as v, openBlock as o, unref as t, mergeProps as g, withCtx as y, createElementBlock as V, Fragment as P, renderList as W, resolveDynamicComponent as ge, createTextVNode as _, toDisplayString as Y, resolveDirective as Ue, renderSlot as C, createCommentVNode as D, withDirectives as Pe, createElementVNode as N, ref as O, createVNode as M, withModifiers as Ve, normalizeStyle as ie, createSlots as ae, useSlots as je, shallowRef as We, watch as fe, onMounted as ye, normalizeClass as ce, nextTick as Le, onUnmounted as Ke, normalizeProps as Ee, guardReactiveProps as Ye } from "vue";
|
|
2
|
+
import { useLocale as Xe, ElCheckbox as Ne, ElCheckboxButton as Ze, ElCheckboxGroup as Je, ElLoading as be, ElDialog as Qe, ElButton as te, ElSelect as _e, ElOptionGroup as el, ElOption as $e, ElRadio as ll, ElRadioButton as tl, ElRadioGroup as al, ElUpload as ke, ElImage as we, ElImageViewer as ol, ElMessage as se, ElFormItem as nl, ElInput as me, ElInputNumber as sl, ElDatePicker as de, ElTimePicker as Se, ElSwitch as rl, ElTreeSelect as il, ElCascader as ul, ElTree as dl, ElSlider as cl, ElRate as fl, ElForm as ml, ElRow as ze, ElCol as Ce, ElTable as pl, ElTableColumn as Ae, ElPagination as vl, ElDrawer as gl, ElInfiniteScroll as yl, ElMessageBox as bl, ElNotification as hl, ElPopoverDirective as Vl } from "element-plus";
|
|
3
|
+
const G = (e, c) => (e.install = (l) => {
|
|
4
|
+
for (const i of [e, ...Object.values({})])
|
|
5
|
+
i.name ? l.component(i.name, i) : process.env.NODE_ENV !== "production" && console.warn("[withInstall] Component is missing name property:", i);
|
|
6
6
|
}, e);
|
|
7
|
-
function
|
|
8
|
-
const
|
|
7
|
+
function oe(e = []) {
|
|
8
|
+
const c = Me(), l = T(() => {
|
|
9
9
|
const f = {};
|
|
10
|
-
for (const
|
|
11
|
-
e.includes(
|
|
10
|
+
for (const n in c)
|
|
11
|
+
e.includes(n) || (f[n] = c[n]);
|
|
12
12
|
return f;
|
|
13
|
-
}),
|
|
13
|
+
}), i = T(() => {
|
|
14
14
|
const f = {};
|
|
15
|
-
for (const
|
|
16
|
-
|
|
15
|
+
for (const n in l.value)
|
|
16
|
+
n.startsWith("on") || (f[n] = l.value[n]);
|
|
17
17
|
return f;
|
|
18
|
-
}),
|
|
18
|
+
}), a = T(() => {
|
|
19
19
|
const f = {};
|
|
20
|
-
for (const
|
|
21
|
-
|
|
20
|
+
for (const n in l.value)
|
|
21
|
+
n.startsWith("on") && (f[n] = l.value[n]);
|
|
22
22
|
return f;
|
|
23
23
|
});
|
|
24
24
|
return {
|
|
25
25
|
/** 所有过滤后的属性(包括事件) */
|
|
26
26
|
attrs: l,
|
|
27
27
|
/** 只包含普通属性 */
|
|
28
|
-
props:
|
|
28
|
+
props: i,
|
|
29
29
|
/** 只包含事件监听器 */
|
|
30
|
-
listeners:
|
|
30
|
+
listeners: a
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
var
|
|
33
|
+
var El = {
|
|
34
34
|
s: {
|
|
35
35
|
label: {
|
|
36
36
|
name: "姓名",
|
|
@@ -110,39 +110,39 @@ var hl = {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
-
const { s:
|
|
114
|
-
function
|
|
115
|
-
return
|
|
113
|
+
const { s: $l } = El;
|
|
114
|
+
function kl(e, c) {
|
|
115
|
+
return c.split(".").reduce((l, i) => l && typeof l == "object" ? l[i] : void 0, e);
|
|
116
116
|
}
|
|
117
|
-
function wl(e,
|
|
118
|
-
return e.replace(/\{\s*(\w+)\s*\}/g, (l,
|
|
119
|
-
const
|
|
120
|
-
return
|
|
117
|
+
function wl(e, c = {}) {
|
|
118
|
+
return e.replace(/\{\s*(\w+)\s*\}/g, (l, i) => {
|
|
119
|
+
const a = c[i];
|
|
120
|
+
return a !== void 0 ? String(a) : `{${i}}`;
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
const { t: e, lang:
|
|
123
|
+
function ue() {
|
|
124
|
+
const { t: e, lang: c } = Xe();
|
|
125
125
|
return {
|
|
126
|
-
t: (
|
|
127
|
-
const f = e(
|
|
128
|
-
if (f !==
|
|
129
|
-
const
|
|
130
|
-
return typeof
|
|
126
|
+
t: (i, a = {}) => {
|
|
127
|
+
const f = e(i, a);
|
|
128
|
+
if (f !== i) return f;
|
|
129
|
+
const n = kl({ s: $l }, i);
|
|
130
|
+
return typeof n == "string" ? wl(n, a) : i;
|
|
131
131
|
},
|
|
132
|
-
lang:
|
|
132
|
+
lang: c
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Sl(e, c = 200) {
|
|
136
136
|
let l = null;
|
|
137
|
-
return function(...
|
|
137
|
+
return function(...i) {
|
|
138
138
|
l || (l = setTimeout(() => {
|
|
139
|
-
e.apply(this,
|
|
140
|
-
},
|
|
139
|
+
e.apply(this, i), l = null;
|
|
140
|
+
}, c));
|
|
141
141
|
};
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
...
|
|
145
|
-
props: /* @__PURE__ */
|
|
143
|
+
const zl = w({ name: "EzCheckbox", inheritAttrs: !1 }), Cl = /* @__PURE__ */ w({
|
|
144
|
+
...zl,
|
|
145
|
+
props: /* @__PURE__ */ F({
|
|
146
146
|
type: { default: "default" },
|
|
147
147
|
options: { default: () => [] }
|
|
148
148
|
}, {
|
|
@@ -151,22 +151,22 @@ const kl = V({ name: "EzCheckbox", inheritAttrs: !1 }), zl = /* @__PURE__ */ V({
|
|
|
151
151
|
}),
|
|
152
152
|
emits: ["update:modelValue"],
|
|
153
153
|
setup(e) {
|
|
154
|
-
const
|
|
155
|
-
() => ["default", "border"].includes(
|
|
154
|
+
const c = e, l = L(e, "modelValue"), { attrs: i } = oe(["options", "type", "modelValue"]), a = T(
|
|
155
|
+
() => ["default", "border"].includes(c.type) ? Ne : Ze
|
|
156
156
|
);
|
|
157
|
-
return (f,
|
|
157
|
+
return (f, n) => (o(), v(t(Je), g({
|
|
158
158
|
modelValue: l.value,
|
|
159
|
-
"onUpdate:modelValue":
|
|
160
|
-
}, t(
|
|
161
|
-
default:
|
|
162
|
-
(
|
|
163
|
-
key: String(
|
|
159
|
+
"onUpdate:modelValue": n[0] || (n[0] = (m) => l.value = m)
|
|
160
|
+
}, t(i)), {
|
|
161
|
+
default: y(() => [
|
|
162
|
+
(o(!0), V(P, null, W(e.options, (m) => (o(), v(ge(a.value), g({
|
|
163
|
+
key: String(m.value),
|
|
164
164
|
ref_for: !0
|
|
165
|
-
},
|
|
165
|
+
}, m, {
|
|
166
166
|
border: e.type === "border"
|
|
167
167
|
}), {
|
|
168
|
-
default:
|
|
169
|
-
|
|
168
|
+
default: y(() => [
|
|
169
|
+
_(Y(m.label), 1)
|
|
170
170
|
]),
|
|
171
171
|
_: 2
|
|
172
172
|
}, 1040, ["border"]))), 128))
|
|
@@ -174,83 +174,83 @@ const kl = V({ name: "EzCheckbox", inheritAttrs: !1 }), zl = /* @__PURE__ */ V({
|
|
|
174
174
|
_: 1
|
|
175
175
|
}, 16, ["modelValue"]));
|
|
176
176
|
}
|
|
177
|
-
}),
|
|
178
|
-
var
|
|
179
|
-
const
|
|
177
|
+
}), Be = G(Cl);
|
|
178
|
+
var re = /* @__PURE__ */ ((e) => (e.CANCEL = "取消", e.CONFIRM = "确定", e))(re || {});
|
|
179
|
+
const Al = { key: 1 }, Dl = {
|
|
180
180
|
key: 0,
|
|
181
181
|
class: "ez-dialog__body"
|
|
182
|
-
},
|
|
183
|
-
...
|
|
184
|
-
props: /* @__PURE__ */
|
|
182
|
+
}, Tl = { key: 1 }, Rl = w({ name: "EzDialog", inheritAttrs: !1, directives: { loading: be.directive } }), xl = /* @__PURE__ */ w({
|
|
183
|
+
...Rl,
|
|
184
|
+
props: /* @__PURE__ */ F({
|
|
185
185
|
title: { default: "" },
|
|
186
186
|
loading: { type: Boolean, default: !1 },
|
|
187
|
-
cancelText: { default:
|
|
188
|
-
confirmText: { default:
|
|
187
|
+
cancelText: { default: re.CANCEL },
|
|
188
|
+
confirmText: { default: re.CONFIRM }
|
|
189
189
|
}, {
|
|
190
190
|
modelValue: { type: Boolean },
|
|
191
191
|
modelModifiers: {}
|
|
192
192
|
}),
|
|
193
|
-
emits: /* @__PURE__ */
|
|
194
|
-
setup(e, { emit:
|
|
195
|
-
const { t: l } =
|
|
196
|
-
f.value = !1,
|
|
197
|
-
},
|
|
198
|
-
|
|
193
|
+
emits: /* @__PURE__ */ F(["cancel", "confirm"], ["update:modelValue"]),
|
|
194
|
+
setup(e, { emit: c }) {
|
|
195
|
+
const { t: l } = ue(), i = e, a = c, f = L(e, "modelValue"), { attrs: n } = oe(["title", "loading", "cancelText", "confirmText", "modelValue"]), m = () => {
|
|
196
|
+
f.value = !1, a("cancel");
|
|
197
|
+
}, d = () => {
|
|
198
|
+
a("confirm");
|
|
199
199
|
};
|
|
200
|
-
return (
|
|
201
|
-
const
|
|
202
|
-
return
|
|
200
|
+
return (s, r) => {
|
|
201
|
+
const R = Ue("loading");
|
|
202
|
+
return o(), v(t(Qe), g({
|
|
203
203
|
modelValue: f.value,
|
|
204
|
-
"onUpdate:modelValue":
|
|
204
|
+
"onUpdate:modelValue": r[0] || (r[0] = (K) => f.value = K),
|
|
205
205
|
class: "ez-dialog",
|
|
206
206
|
width: 800,
|
|
207
207
|
"append-to-body": !1,
|
|
208
208
|
"close-on-click-modal": !1,
|
|
209
209
|
"destroy-on-close": !0,
|
|
210
210
|
"close-on-press-escape": !1
|
|
211
|
-
}, t(
|
|
212
|
-
header:
|
|
213
|
-
|
|
211
|
+
}, t(n)), {
|
|
212
|
+
header: y(() => [
|
|
213
|
+
s.$slots.header ? C(s.$slots, "header", { key: 0 }) : (o(), V("p", Al, Y(i.title), 1))
|
|
214
214
|
]),
|
|
215
|
-
default:
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
default: y(() => [
|
|
216
|
+
s.$slots.default ? Pe((o(), V("div", Dl, [
|
|
217
|
+
C(s.$slots, "default")
|
|
218
218
|
])), [
|
|
219
|
-
[
|
|
220
|
-
]) :
|
|
219
|
+
[R, i.loading]
|
|
220
|
+
]) : D("", !0)
|
|
221
221
|
]),
|
|
222
|
-
footer:
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
footer: y(() => [
|
|
223
|
+
s.$slots.footer ? C(s.$slots, "footer", { key: 0 }) : (o(), V("div", Tl, [
|
|
224
|
+
i.cancelText ? (o(), v(t(te), {
|
|
225
225
|
key: 0,
|
|
226
226
|
type: "default",
|
|
227
|
-
onClick:
|
|
227
|
+
onClick: m
|
|
228
228
|
}, {
|
|
229
|
-
default:
|
|
230
|
-
|
|
229
|
+
default: y(() => [
|
|
230
|
+
_(Y(i.cancelText === t(re).CANCEL ? t(l)("s.button.cancel") : i.cancelText), 1)
|
|
231
231
|
]),
|
|
232
232
|
_: 1
|
|
233
|
-
})) :
|
|
234
|
-
|
|
233
|
+
})) : D("", !0),
|
|
234
|
+
i.confirmText ? (o(), v(t(te), {
|
|
235
235
|
key: 1,
|
|
236
236
|
type: "primary",
|
|
237
|
-
loading:
|
|
238
|
-
onClick:
|
|
237
|
+
loading: i.loading,
|
|
238
|
+
onClick: d
|
|
239
239
|
}, {
|
|
240
|
-
default:
|
|
241
|
-
|
|
240
|
+
default: y(() => [
|
|
241
|
+
_(Y(i.confirmText === t(re).CONFIRM ? t(l)("s.button.confirm") : i.confirmText), 1)
|
|
242
242
|
]),
|
|
243
243
|
_: 1
|
|
244
|
-
}, 8, ["loading"])) :
|
|
244
|
+
}, 8, ["loading"])) : D("", !0)
|
|
245
245
|
]))
|
|
246
246
|
]),
|
|
247
247
|
_: 3
|
|
248
248
|
}, 16, ["modelValue"]);
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
|
-
}),
|
|
251
|
+
}), Ml = G(xl), Ul = w({ name: "EzSelect", inheritAttrs: !1 }), Pl = /* @__PURE__ */ w({
|
|
252
252
|
...Ul,
|
|
253
|
-
props: /* @__PURE__ */
|
|
253
|
+
props: /* @__PURE__ */ F({
|
|
254
254
|
options: { default: () => [] }
|
|
255
255
|
}, {
|
|
256
256
|
modelValue: {},
|
|
@@ -258,38 +258,38 @@ const Cl = { key: 1 }, Sl = {
|
|
|
258
258
|
}),
|
|
259
259
|
emits: ["update:modelValue"],
|
|
260
260
|
setup(e) {
|
|
261
|
-
const
|
|
262
|
-
return (
|
|
263
|
-
modelValue:
|
|
264
|
-
"onUpdate:modelValue":
|
|
261
|
+
const c = L(e, "modelValue"), { attrs: l } = oe(["options", "modelValue"]), i = (n) => typeof n > "u", a = (n) => !i(n.options), f = (n, m) => n.value != null && typeof n.value != "object" ? String(n.value) : m;
|
|
262
|
+
return (n, m) => (o(), v(t(_e), g({
|
|
263
|
+
modelValue: c.value,
|
|
264
|
+
"onUpdate:modelValue": m[0] || (m[0] = (d) => c.value = d),
|
|
265
265
|
clearable: ""
|
|
266
266
|
}, t(l)), {
|
|
267
|
-
default:
|
|
268
|
-
(
|
|
269
|
-
key: f(
|
|
267
|
+
default: y(() => [
|
|
268
|
+
(o(!0), V(P, null, W(e.options, (d, s) => (o(), V(P, {
|
|
269
|
+
key: f(d, s)
|
|
270
270
|
}, [
|
|
271
|
-
|
|
271
|
+
a(d) ? (o(), v(t(el), g({
|
|
272
272
|
key: 0,
|
|
273
273
|
ref_for: !0
|
|
274
|
-
},
|
|
275
|
-
default:
|
|
276
|
-
(
|
|
277
|
-
key: f(
|
|
278
|
-
}, { ref_for: !0 },
|
|
274
|
+
}, d), {
|
|
275
|
+
default: y(() => [
|
|
276
|
+
(o(!0), V(P, null, W(d.options, (r) => (o(), v(t($e), g({
|
|
277
|
+
key: f(r, r.value)
|
|
278
|
+
}, { ref_for: !0 }, r), null, 16))), 128))
|
|
279
279
|
]),
|
|
280
280
|
_: 2
|
|
281
|
-
}, 1040)) : (
|
|
281
|
+
}, 1040)) : (o(), v(t($e), g({
|
|
282
282
|
key: 1,
|
|
283
283
|
ref_for: !0
|
|
284
|
-
},
|
|
284
|
+
}, d), null, 16))
|
|
285
285
|
], 64))), 128))
|
|
286
286
|
]),
|
|
287
287
|
_: 1
|
|
288
288
|
}, 16, ["modelValue"]));
|
|
289
289
|
}
|
|
290
|
-
}),
|
|
291
|
-
...
|
|
292
|
-
props: /* @__PURE__ */
|
|
290
|
+
}), Ie = G(Pl), Ll = w({ name: "EzRadio", inheritAttrs: !1 }), Nl = /* @__PURE__ */ w({
|
|
291
|
+
...Ll,
|
|
292
|
+
props: /* @__PURE__ */ F({
|
|
293
293
|
type: { default: "default" },
|
|
294
294
|
options: { default: () => [] }
|
|
295
295
|
}, {
|
|
@@ -298,20 +298,20 @@ const Cl = { key: 1 }, Sl = {
|
|
|
298
298
|
}),
|
|
299
299
|
emits: ["update:modelValue"],
|
|
300
300
|
setup(e) {
|
|
301
|
-
const
|
|
302
|
-
return (f,
|
|
301
|
+
const c = e, l = L(e, "modelValue"), { attrs: i } = oe(["options", "type", "modelValue"]), a = T(() => ["default", "border"].includes(c.type) ? ll : tl);
|
|
302
|
+
return (f, n) => (o(), v(t(al), g({
|
|
303
303
|
modelValue: l.value,
|
|
304
|
-
"onUpdate:modelValue":
|
|
305
|
-
}, t(
|
|
306
|
-
default:
|
|
307
|
-
(
|
|
308
|
-
key: String(
|
|
304
|
+
"onUpdate:modelValue": n[0] || (n[0] = (m) => l.value = m)
|
|
305
|
+
}, t(i)), {
|
|
306
|
+
default: y(() => [
|
|
307
|
+
(o(!0), V(P, null, W(e.options, (m) => (o(), v(ge(a.value), g({
|
|
308
|
+
key: String(m.value),
|
|
309
309
|
ref_for: !0
|
|
310
|
-
},
|
|
310
|
+
}, m, {
|
|
311
311
|
border: e.type === "border"
|
|
312
312
|
}), {
|
|
313
|
-
default:
|
|
314
|
-
|
|
313
|
+
default: y(() => [
|
|
314
|
+
_(Y(m.label), 1)
|
|
315
315
|
]),
|
|
316
316
|
_: 2
|
|
317
317
|
}, 1040, ["border"]))), 128))
|
|
@@ -319,136 +319,136 @@ const Cl = { key: 1 }, Sl = {
|
|
|
319
319
|
_: 1
|
|
320
320
|
}, 16, ["modelValue"]));
|
|
321
321
|
}
|
|
322
|
-
}),
|
|
322
|
+
}), Oe = G(Nl), Bl = w({ name: "EzIcon", inheritAttrs: !1 }), Il = /* @__PURE__ */ w({
|
|
323
323
|
...Bl,
|
|
324
324
|
props: {
|
|
325
325
|
size: { default: 20 },
|
|
326
326
|
color: { default: "inherit" }
|
|
327
327
|
},
|
|
328
328
|
setup(e) {
|
|
329
|
-
const
|
|
330
|
-
const { size:
|
|
331
|
-
return !
|
|
332
|
-
fontSize:
|
|
333
|
-
color:
|
|
329
|
+
const c = e, l = T(() => {
|
|
330
|
+
const { size: i, color: a } = c;
|
|
331
|
+
return !i && !a ? {} : {
|
|
332
|
+
fontSize: i ? `${i}px` : void 0,
|
|
333
|
+
color: a
|
|
334
334
|
};
|
|
335
335
|
});
|
|
336
|
-
return (
|
|
336
|
+
return (i, a) => (o(), V("i", g({
|
|
337
337
|
class: "ez-icon",
|
|
338
338
|
style: l.value
|
|
339
|
-
},
|
|
340
|
-
|
|
339
|
+
}, i.$attrs), [
|
|
340
|
+
C(i.$slots, "default", { class: "w-[1em] h-[1em]" })
|
|
341
341
|
], 16));
|
|
342
342
|
}
|
|
343
|
-
}),
|
|
343
|
+
}), Q = G(Il), Ol = {
|
|
344
344
|
xmlns: "http://www.w3.org/2000/svg",
|
|
345
345
|
width: "200",
|
|
346
346
|
height: "200",
|
|
347
347
|
viewBox: "0 0 1024 1024"
|
|
348
|
-
},
|
|
348
|
+
}, ql = /* @__PURE__ */ w({
|
|
349
349
|
name: "ArrowDown",
|
|
350
350
|
__name: "ArrowDown",
|
|
351
351
|
setup(e) {
|
|
352
|
-
return (
|
|
353
|
-
|
|
352
|
+
return (c, l) => (o(), V("svg", Ol, [...l[0] || (l[0] = [
|
|
353
|
+
N("path", {
|
|
354
354
|
fill: "currentColor",
|
|
355
355
|
d: "m832 340.992-320 312-320-312a28.8 28.8 0 0 0-20.992-8.96 28.8 28.8 0 0 0-20.992 8.96 28.8 28.8 0 0 0-8.96 20.992c0 8 2.624 14.72 8 19.968l340.992 332.032c5.952 6.016 13.312 8.96 22.016 8.96 8.64 0 16-2.944 22.016-8.96l340.992-331.008a31.23 31.23 0 0 0 8-21.504c0-8.32-3.008-15.36-8.96-20.992a29.76 29.76 0 0 0-42.048.448v.064z"
|
|
356
356
|
}, null, -1)
|
|
357
357
|
])]));
|
|
358
358
|
}
|
|
359
|
-
}),
|
|
359
|
+
}), Fl = {
|
|
360
360
|
xmlns: "http://www.w3.org/2000/svg",
|
|
361
361
|
width: "200",
|
|
362
362
|
height: "200",
|
|
363
363
|
viewBox: "0 0 1024 1024"
|
|
364
|
-
},
|
|
364
|
+
}, Gl = /* @__PURE__ */ w({
|
|
365
365
|
name: "ArrowUp",
|
|
366
366
|
__name: "ArrowUp",
|
|
367
367
|
setup(e) {
|
|
368
|
-
return (
|
|
369
|
-
|
|
368
|
+
return (c, l) => (o(), V("svg", Fl, [...l[0] || (l[0] = [
|
|
369
|
+
N("path", {
|
|
370
370
|
fill: "currentColor",
|
|
371
371
|
d: "M488.96 344 148.992 700.992a32.26 32.26 0 0 0-8.96 22.016c0 8 2.944 15.36 8.96 22.016v1.024c6.016 5.952 13.184 8.96 21.504 8.96S185.984 752 192 746.048l320-336 320 336c6.016 5.952 13.184 8.96 21.504 8.96s15.488-3.008 21.504-8.96v-1.024a32.26 32.26 0 0 0 8.96-22.016 32.26 32.26 0 0 0-8.96-22.016L534.976 344A31.17 31.17 0 0 0 512 335.04a31.17 31.17 0 0 0-23.04 8.96"
|
|
372
372
|
}, null, -1)
|
|
373
373
|
])]));
|
|
374
374
|
}
|
|
375
|
-
}),
|
|
375
|
+
}), Hl = {
|
|
376
376
|
xmlns: "http://www.w3.org/2000/svg",
|
|
377
377
|
width: "200",
|
|
378
378
|
height: "200",
|
|
379
379
|
viewBox: "0 0 1024 1024"
|
|
380
|
-
},
|
|
380
|
+
}, De = /* @__PURE__ */ w({
|
|
381
381
|
name: "Delete",
|
|
382
382
|
__name: "delete",
|
|
383
383
|
setup(e) {
|
|
384
|
-
return (
|
|
385
|
-
|
|
384
|
+
return (c, l) => (o(), V("svg", Hl, [...l[0] || (l[0] = [
|
|
385
|
+
N("path", {
|
|
386
386
|
fill: "currentColor",
|
|
387
387
|
d: "M218.88 118.592C208 139.968 208 168 208 245.376V272H96a32 32 0 1 0 0 64h832a32 32 0 0 0 0-64H816v-26.624c0-77.44 0-105.408-10.88-126.72a100.03 100.03 0 0 0-43.712-43.776C740.032 64 712 64 634.624 64H389.376c-77.44 0-105.408 0-126.72 10.88-18.88 9.6-34.176 24.96-43.776 43.712M752 272H272v-64c0-28.032 0-42.304 5.568-52.992a50.24 50.24 0 0 1 21.44-21.44C309.76 128.064 323.968 128 352 128h320c28.032 0 42.304 0 52.992 5.568 9.152 4.736 16.64 12.288 21.44 21.44C751.936 165.696 752 179.968 752 208zM192 416a32 32 0 0 0-32 32v358.4c0 53.76.128 81.28 10.688 101.76a96.54 96.54 0 0 0 41.216 41.152C232.384 959.872 259.84 960 313.6 960h396.8c53.76 0 81.28-.128 101.76-10.688a96.54 96.54 0 0 0 41.152-41.216C863.872 887.616 864 860.16 864 806.4V448a32 32 0 0 0-64 0v371.2c0 26.88 0 40.64-5.376 50.88a48.2 48.2 0 0 1-20.544 20.544c-10.24 5.312-24 5.376-50.88 5.376H300.8c-26.88 0-40.64 0-50.88-5.376a48.2 48.2 0 0 1-20.544-20.544c-5.312-10.24-5.376-24-5.376-50.88V448a32 32 0 0 0-32-32m216 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32m208 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32"
|
|
388
388
|
}, null, -1)
|
|
389
389
|
])]));
|
|
390
390
|
}
|
|
391
|
-
}),
|
|
391
|
+
}), jl = {
|
|
392
392
|
xmlns: "http://www.w3.org/2000/svg",
|
|
393
393
|
width: "200",
|
|
394
394
|
height: "200",
|
|
395
395
|
viewBox: "0 0 1024 1024"
|
|
396
|
-
},
|
|
396
|
+
}, Te = /* @__PURE__ */ w({
|
|
397
397
|
name: "Plus",
|
|
398
398
|
__name: "plus",
|
|
399
399
|
setup(e) {
|
|
400
|
-
return (
|
|
401
|
-
|
|
400
|
+
return (c, l) => (o(), V("svg", jl, [...l[0] || (l[0] = [
|
|
401
|
+
N("path", {
|
|
402
402
|
fill: "currentColor",
|
|
403
403
|
d: "M512 96a32 32 0 0 0-32 32v352H128a32 32 0 1 0 0 64h352v352a32 32 0 0 0 64 0V544h352a32 32 0 0 0 0-64H544V128a32 32 0 0 0-32-32"
|
|
404
404
|
}, null, -1)
|
|
405
405
|
])]));
|
|
406
406
|
}
|
|
407
|
-
}),
|
|
407
|
+
}), Wl = {
|
|
408
408
|
xmlns: "http://www.w3.org/2000/svg",
|
|
409
409
|
width: "200",
|
|
410
410
|
height: "200",
|
|
411
411
|
viewBox: "0 0 1024 1024"
|
|
412
|
-
},
|
|
412
|
+
}, Kl = /* @__PURE__ */ w({
|
|
413
413
|
name: "Setting",
|
|
414
414
|
__name: "setting",
|
|
415
415
|
setup(e) {
|
|
416
|
-
return (
|
|
417
|
-
|
|
416
|
+
return (c, l) => (o(), V("svg", Wl, [...l[0] || (l[0] = [
|
|
417
|
+
N("path", {
|
|
418
418
|
fill: "currentColor",
|
|
419
419
|
d: "M218.688 848q27.712 48 83.2 48h374.08q55.424 0 83.136-48l187.008-323.968q27.776-48 0-96L759.104 104.064q-27.712-48-83.2-48H301.952q-55.488 0-83.2 48L31.68 428.032q-27.712 48 0 96zm55.424-32L87.104 492.032q-9.216-16 0-32l187.008-323.968q9.28-16 27.776-16h374.08q18.432 0 27.712 16l187.008 323.968q9.28 16 0 32L703.68 816q-9.28 16-27.712 16h-374.08q-18.56 0-27.776-16m54.784-339.968a160 160 0 1 0 320 0 160 160 0 0 0-320 0m64 0a96 96 0 1 1 192 0 96 96 0 0 1-192 0"
|
|
420
420
|
}, null, -1)
|
|
421
421
|
])]));
|
|
422
422
|
}
|
|
423
|
-
}),
|
|
423
|
+
}), Yl = {
|
|
424
424
|
xmlns: "http://www.w3.org/2000/svg",
|
|
425
425
|
width: "200",
|
|
426
426
|
height: "200",
|
|
427
427
|
viewBox: "0 0 1024 1024"
|
|
428
|
-
},
|
|
428
|
+
}, Re = /* @__PURE__ */ w({
|
|
429
429
|
name: "ZoomIn",
|
|
430
430
|
__name: "ZoomIn",
|
|
431
431
|
setup(e) {
|
|
432
|
-
return (
|
|
433
|
-
|
|
432
|
+
return (c, l) => (o(), V("svg", Yl, [...l[0] || (l[0] = [
|
|
433
|
+
N("path", {
|
|
434
434
|
fill: "currentColor",
|
|
435
435
|
d: "M764.352 809.6a424 424 0 1 1 45.184-45.184l139.456 139.392a31.936 31.936 0 1 1-45.184 45.184L764.352 809.536zM848 488a360 360 0 1 0-720 0 360 360 0 0 0 720 0"
|
|
436
436
|
}, null, -1),
|
|
437
|
-
|
|
437
|
+
N("path", {
|
|
438
438
|
fill: "currentColor",
|
|
439
439
|
d: "M294.4 486.4a32 32 0 0 0 32 32h128v128a32 32 0 0 0 64 0v-128h128a32 32 0 0 0 0-64h-128v-128a32 32 0 0 0-64 0v128h-128a32 32 0 0 0-32 32"
|
|
440
440
|
}, null, -1)
|
|
441
441
|
])]));
|
|
442
442
|
}
|
|
443
|
-
}),
|
|
443
|
+
}), Xl = { class: "ez-image-upload" }, Zl = {
|
|
444
444
|
key: 0,
|
|
445
445
|
class: "ez-image-upload__image"
|
|
446
|
-
},
|
|
446
|
+
}, Jl = {
|
|
447
447
|
key: 1,
|
|
448
448
|
class: "ez-image-upload__list"
|
|
449
|
-
},
|
|
450
|
-
...
|
|
451
|
-
props: /* @__PURE__ */
|
|
449
|
+
}, Ql = { class: "flex items-center justify-center h-full" }, _l = w({ name: "EzImageUpload", inheritAttrs: !1 }), et = /* @__PURE__ */ w({
|
|
450
|
+
..._l,
|
|
451
|
+
props: /* @__PURE__ */ F({
|
|
452
452
|
api: { type: Function, default: () => Promise.resolve({ url: "" }) },
|
|
453
453
|
imageTypes: { default: () => ["image/webp", "image/png", "image/jpg", "image/gif", "image/bmp", "image/jpeg"] },
|
|
454
454
|
limitSize: { default: 10 },
|
|
@@ -462,8 +462,8 @@ const Cl = { key: 1 }, Sl = {
|
|
|
462
462
|
modelModifiers: {}
|
|
463
463
|
}),
|
|
464
464
|
emits: ["update:modelValue"],
|
|
465
|
-
setup(e, { expose:
|
|
466
|
-
const l = e, { attrs:
|
|
465
|
+
setup(e, { expose: c }) {
|
|
466
|
+
const l = e, { attrs: i } = oe([
|
|
467
467
|
"api",
|
|
468
468
|
"imageTypes",
|
|
469
469
|
"limitSize",
|
|
@@ -473,172 +473,172 @@ const Cl = { key: 1 }, Sl = {
|
|
|
473
473
|
"limit",
|
|
474
474
|
"disabled",
|
|
475
475
|
"modelValue"
|
|
476
|
-
]), { t:
|
|
477
|
-
function
|
|
478
|
-
if (
|
|
479
|
-
const
|
|
480
|
-
let
|
|
481
|
-
|
|
482
|
-
const
|
|
483
|
-
for (let
|
|
484
|
-
const
|
|
485
|
-
|
|
476
|
+
]), { t: a } = ue(), f = O(!1), n = O(0), m = L(e, "modelValue"), d = T(() => l.multiple), s = /^(https?:\/\/|data:|blob:)/i, r = T(() => m.value ? R(m.value) : []);
|
|
477
|
+
function R($) {
|
|
478
|
+
if (!$) return [];
|
|
479
|
+
const E = /^(https?:\/\/|data:|blob:)/i;
|
|
480
|
+
let z = [], U = "", B = !1;
|
|
481
|
+
$ = $.trim().replace(/,$/, "");
|
|
482
|
+
const ee = $.split(",");
|
|
483
|
+
for (let u = 0; u < ee.length; u++) {
|
|
484
|
+
const k = ee[u].trim();
|
|
485
|
+
k && (E.test(k) ? (B && U && z.push(U.trim()), U = k, B = !0) : B ? U += "," + k : E.test(k.trim()) && z.push(k.trim()));
|
|
486
486
|
}
|
|
487
|
-
return
|
|
487
|
+
return B && U && z.push(U.trim()), z.filter((u) => u && E.test(u));
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
return
|
|
489
|
+
function K($) {
|
|
490
|
+
return !$ || $.length === 0 ? "" : $.filter((E) => E.trim()).map((E) => E.trim()).join(",");
|
|
491
491
|
}
|
|
492
|
-
const
|
|
492
|
+
const H = ($) => l.disabled ? (se.warning(a("s.message.disabled")), !1) : l.imageTypes.includes($.type.toLocaleLowerCase()) ? $.size > l.limitSize * 1024 * 1024 ? (se.error(a("s.validate.upload.limit", { max: l.limitSize })), !1) : !0 : (se.error(a("s.validate.upload.image")), !1), j = async ({ file: $ }) => {
|
|
493
493
|
if (!l.disabled)
|
|
494
494
|
try {
|
|
495
|
-
const { url:
|
|
496
|
-
if (!
|
|
497
|
-
if (
|
|
498
|
-
const
|
|
499
|
-
|
|
495
|
+
const { url: E } = await l.api($);
|
|
496
|
+
if (!E) throw new Error(a("s.message.uploadFail"));
|
|
497
|
+
if (d.value) {
|
|
498
|
+
const z = m.value ? R(m.value) : [];
|
|
499
|
+
E && s.test(E) && (z.push(E), m.value = K(z));
|
|
500
500
|
} else
|
|
501
|
-
|
|
502
|
-
} catch (
|
|
503
|
-
|
|
501
|
+
m.value = E;
|
|
502
|
+
} catch (E) {
|
|
503
|
+
se.error(E.message);
|
|
504
504
|
}
|
|
505
|
-
},
|
|
506
|
-
|
|
507
|
-
},
|
|
508
|
-
if (!l.disabled && !(
|
|
509
|
-
if (
|
|
510
|
-
const
|
|
511
|
-
|
|
505
|
+
}, X = ($, E = 0) => {
|
|
506
|
+
$ && (n.value = E, f.value = !0);
|
|
507
|
+
}, Z = ($) => {
|
|
508
|
+
if (!l.disabled && !(!$ || !m.value))
|
|
509
|
+
if (d.value) {
|
|
510
|
+
const E = R(m.value), z = E.findIndex((U) => U === $);
|
|
511
|
+
z !== -1 && (E.splice(z, 1), m.value = E.join(","));
|
|
512
512
|
} else
|
|
513
|
-
|
|
514
|
-
},
|
|
515
|
-
return
|
|
516
|
-
getUploadRef: () =>
|
|
517
|
-
getUrlList: () =>
|
|
518
|
-
}), (
|
|
519
|
-
|
|
520
|
-
(
|
|
521
|
-
key:
|
|
513
|
+
m.value = null;
|
|
514
|
+
}, J = O();
|
|
515
|
+
return c({
|
|
516
|
+
getUploadRef: () => J.value,
|
|
517
|
+
getUrlList: () => r.value
|
|
518
|
+
}), ($, E) => (o(), V("div", Xl, [
|
|
519
|
+
d.value ? (o(), V("div", Jl, [
|
|
520
|
+
(o(!0), V(P, null, W(r.value, (z, U) => (o(), V("div", {
|
|
521
|
+
key: U,
|
|
522
522
|
class: "ez-image-upload__item",
|
|
523
|
-
style:
|
|
523
|
+
style: ie(l.style)
|
|
524
524
|
}, [
|
|
525
|
-
|
|
526
|
-
src:
|
|
525
|
+
M(t(we), {
|
|
526
|
+
src: z,
|
|
527
527
|
fit: l.fit
|
|
528
528
|
}, null, 8, ["src", "fit"]),
|
|
529
|
-
|
|
529
|
+
N("div", {
|
|
530
530
|
class: "ez-image-upload__handler",
|
|
531
|
-
onClick:
|
|
531
|
+
onClick: E[3] || (E[3] = Ve(() => {
|
|
532
532
|
}, ["stop"]))
|
|
533
533
|
}, [
|
|
534
|
-
|
|
534
|
+
M(t(Q), {
|
|
535
535
|
size: 18,
|
|
536
|
-
onClick: (
|
|
536
|
+
onClick: (B) => X(z, U)
|
|
537
537
|
}, {
|
|
538
|
-
default:
|
|
539
|
-
|
|
538
|
+
default: y(() => [
|
|
539
|
+
M(t(Re))
|
|
540
540
|
]),
|
|
541
541
|
_: 1
|
|
542
542
|
}, 8, ["onClick"]),
|
|
543
|
-
l.disabled ?
|
|
543
|
+
l.disabled ? D("", !0) : (o(), v(t(Q), {
|
|
544
544
|
key: 0,
|
|
545
545
|
size: 18,
|
|
546
|
-
onClick: (
|
|
546
|
+
onClick: (B) => Z(z)
|
|
547
547
|
}, {
|
|
548
|
-
default:
|
|
549
|
-
|
|
548
|
+
default: y(() => [
|
|
549
|
+
M(t(De))
|
|
550
550
|
]),
|
|
551
551
|
_: 1
|
|
552
552
|
}, 8, ["onClick"]))
|
|
553
553
|
])
|
|
554
554
|
], 4))), 128)),
|
|
555
|
-
|
|
555
|
+
r.value.length < l.limit && !l.disabled || r.value.length === 0 ? (o(), v(t(ke), g({ key: 0 }, t(i), {
|
|
556
556
|
ref_key: "uploadRef",
|
|
557
|
-
ref:
|
|
557
|
+
ref: J,
|
|
558
558
|
action: "",
|
|
559
559
|
accept: "image/*",
|
|
560
560
|
"show-file-list": !1,
|
|
561
|
-
"before-upload":
|
|
562
|
-
"http-request":
|
|
561
|
+
"before-upload": H,
|
|
562
|
+
"http-request": j,
|
|
563
563
|
style: l.style,
|
|
564
564
|
disabled: l.disabled,
|
|
565
565
|
class: [{ "is-disabled": l.disabled }, "ez-image-upload__item ez-image-upload__button"]
|
|
566
566
|
}), {
|
|
567
|
-
default:
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
default:
|
|
571
|
-
|
|
567
|
+
default: y(() => [
|
|
568
|
+
N("div", Ql, [
|
|
569
|
+
M(t(Q), null, {
|
|
570
|
+
default: y(() => [
|
|
571
|
+
M(t(Te))
|
|
572
572
|
]),
|
|
573
573
|
_: 1
|
|
574
574
|
})
|
|
575
575
|
])
|
|
576
576
|
]),
|
|
577
577
|
_: 1
|
|
578
|
-
}, 16, ["style", "disabled", "class"])) :
|
|
579
|
-
])) : (
|
|
578
|
+
}, 16, ["style", "disabled", "class"])) : D("", !0)
|
|
579
|
+
])) : (o(), v(t(ke), g({ key: 0 }, t(i), {
|
|
580
580
|
ref_key: "uploadRef",
|
|
581
|
-
ref:
|
|
581
|
+
ref: J,
|
|
582
582
|
action: "",
|
|
583
583
|
accept: "image/*",
|
|
584
584
|
"show-file-list": !1,
|
|
585
|
-
"before-upload":
|
|
586
|
-
"http-request":
|
|
585
|
+
"before-upload": H,
|
|
586
|
+
"http-request": j,
|
|
587
587
|
style: l.style,
|
|
588
588
|
disabled: l.disabled,
|
|
589
589
|
class: ["ez-image-upload__wrapper", { "is-disabled": l.disabled }]
|
|
590
590
|
}), {
|
|
591
|
-
default:
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
src:
|
|
591
|
+
default: y(() => [
|
|
592
|
+
m.value ? (o(), V("div", Zl, [
|
|
593
|
+
M(t(we), {
|
|
594
|
+
src: m.value,
|
|
595
595
|
fit: l.fit
|
|
596
596
|
}, null, 8, ["src", "fit"]),
|
|
597
|
-
|
|
597
|
+
N("div", {
|
|
598
598
|
class: "ez-image-upload__handler",
|
|
599
|
-
onClick:
|
|
599
|
+
onClick: E[2] || (E[2] = Ve(() => {
|
|
600
600
|
}, ["stop"]))
|
|
601
601
|
}, [
|
|
602
|
-
|
|
602
|
+
M(t(Q), {
|
|
603
603
|
size: 18,
|
|
604
|
-
onClick:
|
|
604
|
+
onClick: E[0] || (E[0] = (z) => X(m.value, 0))
|
|
605
605
|
}, {
|
|
606
|
-
default:
|
|
607
|
-
|
|
606
|
+
default: y(() => [
|
|
607
|
+
M(t(Re))
|
|
608
608
|
]),
|
|
609
609
|
_: 1
|
|
610
610
|
}),
|
|
611
|
-
l.disabled ?
|
|
611
|
+
l.disabled ? D("", !0) : (o(), v(t(Q), {
|
|
612
612
|
key: 0,
|
|
613
613
|
size: 18,
|
|
614
|
-
onClick:
|
|
614
|
+
onClick: E[1] || (E[1] = (z) => Z(m.value))
|
|
615
615
|
}, {
|
|
616
|
-
default:
|
|
617
|
-
|
|
616
|
+
default: y(() => [
|
|
617
|
+
M(t(De))
|
|
618
618
|
]),
|
|
619
619
|
_: 1
|
|
620
620
|
}))
|
|
621
621
|
])
|
|
622
|
-
])) : (
|
|
623
|
-
default:
|
|
624
|
-
|
|
622
|
+
])) : (o(), v(t(Q), { key: 1 }, {
|
|
623
|
+
default: y(() => [
|
|
624
|
+
M(t(Te))
|
|
625
625
|
]),
|
|
626
626
|
_: 1
|
|
627
627
|
}))
|
|
628
628
|
]),
|
|
629
629
|
_: 1
|
|
630
630
|
}, 16, ["style", "disabled", "class"])),
|
|
631
|
-
f.value ? (
|
|
631
|
+
f.value ? (o(), v(t(ol), {
|
|
632
632
|
key: 2,
|
|
633
|
-
"url-list":
|
|
634
|
-
"initial-index":
|
|
635
|
-
onClose:
|
|
636
|
-
}, null, 8, ["url-list", "initial-index"])) :
|
|
633
|
+
"url-list": d.value ? r.value : [m.value],
|
|
634
|
+
"initial-index": n.value,
|
|
635
|
+
onClose: E[4] || (E[4] = (z) => f.value = !1)
|
|
636
|
+
}, null, 8, ["url-list", "initial-index"])) : D("", !0)
|
|
637
637
|
]));
|
|
638
638
|
}
|
|
639
|
-
}),
|
|
640
|
-
var
|
|
641
|
-
const
|
|
639
|
+
}), qe = G(et);
|
|
640
|
+
var A = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.TEXTAREA = "textarea", e.NUMBER = "number", e.PASSWORD = "password", e.SELECT = "select", e.RADIO = "radio", e.CHECKBOX = "checkbox", e.DATE = "date", e.DATETIME = "datetime", e.DATERANGE = "daterange", e.DATETIMERANGE = "datetimerange", e.TIME = "time", e.TIMERANGE = "timerange", e.UPLOAD_IMAGES = "upload-images", e.SWITCH = "switch", e.TREE_SELECT = "tree-select", e.CASCADER = "cascader", e.TREE = "tree", e.SLIDER = "slider", e.RATE = "rate", e))(A || {});
|
|
641
|
+
const lt = /* @__PURE__ */ new Set([
|
|
642
642
|
"select",
|
|
643
643
|
"radio",
|
|
644
644
|
"checkbox",
|
|
@@ -653,7 +653,7 @@ const _l = /* @__PURE__ */ new Set([
|
|
|
653
653
|
"tree",
|
|
654
654
|
"tree-select"
|
|
655
655
|
/* TREE_SELECT */
|
|
656
|
-
]),
|
|
656
|
+
]), tt = /* @__PURE__ */ new Set([
|
|
657
657
|
"select",
|
|
658
658
|
"radio",
|
|
659
659
|
"checkbox",
|
|
@@ -671,15 +671,15 @@ const _l = /* @__PURE__ */ new Set([
|
|
|
671
671
|
"rate"
|
|
672
672
|
/* RATE */
|
|
673
673
|
]);
|
|
674
|
-
function
|
|
675
|
-
return e &&
|
|
674
|
+
function at(e) {
|
|
675
|
+
return e && lt.has(e) ? "选择" : "输入";
|
|
676
676
|
}
|
|
677
|
-
function
|
|
678
|
-
return e &&
|
|
677
|
+
function ot(e) {
|
|
678
|
+
return e && tt.has(e) ? "change" : "blur";
|
|
679
679
|
}
|
|
680
|
-
const
|
|
681
|
-
...
|
|
682
|
-
props: /* @__PURE__ */
|
|
680
|
+
const nt = w({ name: "EzFormItem" }), pe = /* @__PURE__ */ w({
|
|
681
|
+
...nt,
|
|
682
|
+
props: /* @__PURE__ */ F({
|
|
683
683
|
config: {},
|
|
684
684
|
formData: { default: () => ({}) }
|
|
685
685
|
}, {
|
|
@@ -688,188 +688,195 @@ const at = V({ name: "EzFormItem" }), Ue = /* @__PURE__ */ V({
|
|
|
688
688
|
}),
|
|
689
689
|
emits: ["update:modelValue"],
|
|
690
690
|
setup(e) {
|
|
691
|
-
const
|
|
692
|
-
const { config:
|
|
693
|
-
if (!
|
|
694
|
-
if (
|
|
695
|
-
return
|
|
696
|
-
let
|
|
697
|
-
return
|
|
691
|
+
const c = e, l = L(e, "modelValue"), i = T(() => c.config?.itemAttrs && typeof c.config.itemAttrs == "object" ? c.config.itemAttrs : {}), a = T(() => c.config?.attrs && typeof c.config.attrs == "object" ? c.config.attrs : {}), f = T(() => c.config?.options && Array.isArray(c.config.options) ? c.config.options : []), n = /* @__PURE__ */ new WeakMap(), m = () => {
|
|
692
|
+
const { config: d } = c;
|
|
693
|
+
if (!d || typeof d != "object") return;
|
|
694
|
+
if (n.has(d))
|
|
695
|
+
return n.get(d);
|
|
696
|
+
let s;
|
|
697
|
+
return d.rules ? s = d.rules : d.required && (s = [{ required: !0, message: d.requiredMessage || `请${at(d.type)}${d.label || ""}`, trigger: ot(d.type) }]), s !== void 0 && n.set(d, s), s;
|
|
698
698
|
};
|
|
699
|
-
return (
|
|
699
|
+
return (d, s) => e.config && e.config.prop ? (o(), v(t(nl), g({
|
|
700
700
|
key: 0,
|
|
701
701
|
prop: e.config.prop,
|
|
702
702
|
label: e.config.label,
|
|
703
|
-
rules:
|
|
704
|
-
},
|
|
705
|
-
default:
|
|
706
|
-
|
|
703
|
+
rules: m()
|
|
704
|
+
}, i.value), ae({
|
|
705
|
+
default: y(() => [
|
|
706
|
+
d.$slots.default ? C(d.$slots, "default", {
|
|
707
707
|
key: 0,
|
|
708
708
|
config: e.config,
|
|
709
709
|
value: l.value,
|
|
710
710
|
formData: e.formData
|
|
711
|
-
}) : e.config.component ? (
|
|
711
|
+
}) : e.config.component ? (o(), v(ge(e.config.component), g({
|
|
712
712
|
key: 1,
|
|
713
713
|
modelValue: l.value,
|
|
714
|
-
"onUpdate:modelValue":
|
|
714
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => l.value = r),
|
|
715
715
|
disabled: e.config.disabled
|
|
716
|
-
},
|
|
717
|
-
e.config.type === t(
|
|
716
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : (o(), V(P, { key: 2 }, [
|
|
717
|
+
e.config.type === t(A).INPUT || !e.config.type ? (o(), v(t(me), g({
|
|
718
718
|
key: 0,
|
|
719
719
|
modelValue: l.value,
|
|
720
|
-
"onUpdate:modelValue":
|
|
720
|
+
"onUpdate:modelValue": s[1] || (s[1] = (r) => l.value = r),
|
|
721
721
|
placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
|
|
722
722
|
disabled: e.config.disabled,
|
|
723
723
|
clearable: ""
|
|
724
|
-
},
|
|
724
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).TEXTAREA ? (o(), v(t(me), g({
|
|
725
725
|
key: 1,
|
|
726
726
|
modelValue: l.value,
|
|
727
|
-
"onUpdate:modelValue":
|
|
727
|
+
"onUpdate:modelValue": s[2] || (s[2] = (r) => l.value = r),
|
|
728
728
|
type: "textarea",
|
|
729
729
|
placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
|
|
730
730
|
disabled: e.config.disabled
|
|
731
|
-
},
|
|
731
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).NUMBER ? (o(), v(t(sl), g({
|
|
732
732
|
key: 2,
|
|
733
733
|
modelValue: l.value,
|
|
734
|
-
"onUpdate:modelValue":
|
|
734
|
+
"onUpdate:modelValue": s[3] || (s[3] = (r) => l.value = r),
|
|
735
735
|
placeholder: e.config.placeholder,
|
|
736
736
|
disabled: e.config.disabled
|
|
737
|
-
},
|
|
737
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).PASSWORD ? (o(), v(t(me), g({
|
|
738
738
|
key: 3,
|
|
739
739
|
modelValue: l.value,
|
|
740
|
-
"onUpdate:modelValue":
|
|
740
|
+
"onUpdate:modelValue": s[4] || (s[4] = (r) => l.value = r),
|
|
741
741
|
type: "password",
|
|
742
742
|
placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
|
|
743
743
|
disabled: e.config.disabled,
|
|
744
744
|
"show-password": "",
|
|
745
745
|
clearable: ""
|
|
746
|
-
},
|
|
746
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).SELECT ? (o(), v(t(Ie), g({
|
|
747
747
|
key: 4,
|
|
748
748
|
modelValue: l.value,
|
|
749
|
-
"onUpdate:modelValue":
|
|
749
|
+
"onUpdate:modelValue": s[5] || (s[5] = (r) => l.value = r),
|
|
750
750
|
options: f.value,
|
|
751
751
|
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
752
752
|
disabled: e.config.disabled
|
|
753
|
-
},
|
|
753
|
+
}, a.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === t(A).RADIO ? (o(), v(t(Oe), g({
|
|
754
754
|
key: 5,
|
|
755
755
|
modelValue: l.value,
|
|
756
|
-
"onUpdate:modelValue":
|
|
756
|
+
"onUpdate:modelValue": s[6] || (s[6] = (r) => l.value = r),
|
|
757
757
|
options: f.value,
|
|
758
758
|
disabled: e.config.disabled
|
|
759
|
-
},
|
|
759
|
+
}, a.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === t(A).CHECKBOX ? (o(), v(t(Be), g({
|
|
760
760
|
key: 6,
|
|
761
761
|
modelValue: l.value,
|
|
762
|
-
"onUpdate:modelValue":
|
|
762
|
+
"onUpdate:modelValue": s[7] || (s[7] = (r) => l.value = r),
|
|
763
763
|
options: f.value,
|
|
764
764
|
disabled: e.config.disabled
|
|
765
|
-
},
|
|
765
|
+
}, a.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === t(A).DATE ? (o(), v(t(de), g({
|
|
766
766
|
key: 7,
|
|
767
767
|
modelValue: l.value,
|
|
768
|
-
"onUpdate:modelValue":
|
|
768
|
+
"onUpdate:modelValue": s[8] || (s[8] = (r) => l.value = r),
|
|
769
769
|
type: "date",
|
|
770
770
|
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
771
771
|
disabled: e.config.disabled
|
|
772
|
-
},
|
|
772
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).DATETIME ? (o(), v(t(de), g({
|
|
773
773
|
key: 8,
|
|
774
774
|
modelValue: l.value,
|
|
775
|
-
"onUpdate:modelValue":
|
|
775
|
+
"onUpdate:modelValue": s[9] || (s[9] = (r) => l.value = r),
|
|
776
776
|
type: "datetime",
|
|
777
777
|
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
778
778
|
disabled: e.config.disabled
|
|
779
|
-
},
|
|
779
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).DATERANGE ? (o(), v(t(de), g({
|
|
780
780
|
key: 9,
|
|
781
781
|
modelValue: l.value,
|
|
782
|
-
"onUpdate:modelValue":
|
|
782
|
+
"onUpdate:modelValue": s[10] || (s[10] = (r) => l.value = r),
|
|
783
783
|
type: "daterange",
|
|
784
784
|
"range-separator": "至",
|
|
785
785
|
"start-placeholder": "开始日期",
|
|
786
786
|
"end-placeholder": "结束日期",
|
|
787
787
|
disabled: e.config.disabled
|
|
788
|
-
},
|
|
788
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).DATETIMERANGE ? (o(), v(t(de), g({
|
|
789
789
|
key: 10,
|
|
790
790
|
modelValue: l.value,
|
|
791
|
-
"onUpdate:modelValue":
|
|
791
|
+
"onUpdate:modelValue": s[11] || (s[11] = (r) => l.value = r),
|
|
792
792
|
type: "datetimerange",
|
|
793
793
|
"range-separator": "至",
|
|
794
794
|
"start-placeholder": "开始时间",
|
|
795
795
|
"end-placeholder": "结束时间",
|
|
796
796
|
disabled: e.config.disabled
|
|
797
|
-
},
|
|
797
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).TIME ? (o(), v(t(Se), g({
|
|
798
798
|
key: 11,
|
|
799
799
|
modelValue: l.value,
|
|
800
|
-
"onUpdate:modelValue":
|
|
800
|
+
"onUpdate:modelValue": s[12] || (s[12] = (r) => l.value = r),
|
|
801
801
|
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
802
802
|
disabled: e.config.disabled
|
|
803
|
-
},
|
|
803
|
+
}, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).TIMERANGE ? (o(), v(t(Se), g({
|
|
804
804
|
key: 12,
|
|
805
805
|
modelValue: l.value,
|
|
806
|
-
"onUpdate:modelValue":
|
|
806
|
+
"onUpdate:modelValue": s[13] || (s[13] = (r) => l.value = r),
|
|
807
807
|
"is-range": "",
|
|
808
808
|
"range-separator": "至",
|
|
809
809
|
"start-placeholder": "开始时间",
|
|
810
810
|
"end-placeholder": "结束时间",
|
|
811
811
|
disabled: e.config.disabled
|
|
812
|
-
},
|
|
812
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).SWITCH ? (o(), v(t(rl), g({
|
|
813
813
|
key: 13,
|
|
814
814
|
modelValue: l.value,
|
|
815
|
-
"onUpdate:modelValue":
|
|
815
|
+
"onUpdate:modelValue": s[14] || (s[14] = (r) => l.value = r),
|
|
816
816
|
disabled: e.config.disabled
|
|
817
|
-
},
|
|
817
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).TREE_SELECT ? (o(), v(t(il), g({
|
|
818
818
|
key: 14,
|
|
819
819
|
modelValue: l.value,
|
|
820
|
-
"onUpdate:modelValue":
|
|
820
|
+
"onUpdate:modelValue": s[15] || (s[15] = (r) => l.value = r),
|
|
821
821
|
data: f.value,
|
|
822
822
|
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
823
823
|
disabled: e.config.disabled
|
|
824
|
-
},
|
|
824
|
+
}, a.value), null, 16, ["modelValue", "data", "placeholder", "disabled"])) : e.config.type === t(A).CASCADER ? (o(), v(t(ul), g({
|
|
825
825
|
key: 15,
|
|
826
826
|
modelValue: l.value,
|
|
827
|
-
"onUpdate:modelValue":
|
|
827
|
+
"onUpdate:modelValue": s[16] || (s[16] = (r) => l.value = r),
|
|
828
828
|
options: f.value,
|
|
829
829
|
placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
|
|
830
830
|
disabled: e.config.disabled,
|
|
831
831
|
clearable: ""
|
|
832
|
-
},
|
|
832
|
+
}, a.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === t(A).TREE ? (o(), v(t(dl), g({
|
|
833
833
|
key: 16,
|
|
834
834
|
modelValue: l.value,
|
|
835
|
-
"onUpdate:modelValue":
|
|
835
|
+
"onUpdate:modelValue": s[17] || (s[17] = (r) => l.value = r),
|
|
836
836
|
data: f.value,
|
|
837
837
|
"show-checkbox": "",
|
|
838
838
|
"node-key": "id"
|
|
839
|
-
},
|
|
839
|
+
}, a.value), null, 16, ["modelValue", "data"])) : e.config.type === t(A).SLIDER ? (o(), v(t(cl), g({
|
|
840
840
|
key: 17,
|
|
841
841
|
modelValue: l.value,
|
|
842
|
-
"onUpdate:modelValue":
|
|
842
|
+
"onUpdate:modelValue": s[18] || (s[18] = (r) => l.value = r),
|
|
843
843
|
disabled: e.config.disabled
|
|
844
|
-
},
|
|
844
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).RATE ? (o(), v(t(fl), g({
|
|
845
845
|
key: 18,
|
|
846
846
|
modelValue: l.value,
|
|
847
|
-
"onUpdate:modelValue":
|
|
847
|
+
"onUpdate:modelValue": s[19] || (s[19] = (r) => l.value = r),
|
|
848
848
|
disabled: e.config.disabled
|
|
849
|
-
},
|
|
849
|
+
}, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).UPLOAD_IMAGES && a.value.api ? (o(), v(t(qe), g({
|
|
850
850
|
key: 19,
|
|
851
851
|
modelValue: l.value,
|
|
852
|
-
"onUpdate:modelValue":
|
|
853
|
-
api:
|
|
852
|
+
"onUpdate:modelValue": s[20] || (s[20] = (r) => l.value = r),
|
|
853
|
+
api: a.value.api,
|
|
854
854
|
disabled: e.config.disabled
|
|
855
|
-
},
|
|
855
|
+
}, a.value), null, 16, ["modelValue", "api", "disabled"])) : D("", !0)
|
|
856
856
|
], 64))
|
|
857
857
|
]),
|
|
858
858
|
_: 2
|
|
859
859
|
}, [
|
|
860
|
-
|
|
860
|
+
d.$slots.label ? {
|
|
861
861
|
name: "label",
|
|
862
|
-
fn:
|
|
863
|
-
|
|
862
|
+
fn: y(() => [
|
|
863
|
+
C(d.$slots, "label", { config: e.config })
|
|
864
864
|
]),
|
|
865
865
|
key: "0"
|
|
866
866
|
} : void 0
|
|
867
|
-
]), 1040, ["prop", "label", "rules"])) :
|
|
867
|
+
]), 1040, ["prop", "label", "rules"])) : D("", !0);
|
|
868
868
|
}
|
|
869
|
-
}),
|
|
870
|
-
|
|
871
|
-
|
|
869
|
+
}), st = {
|
|
870
|
+
key: 0,
|
|
871
|
+
class: "ez-dynamic-form-group__title"
|
|
872
|
+
}, rt = {
|
|
873
|
+
key: 1,
|
|
874
|
+
class: "ez-dynamic-form-group__description"
|
|
875
|
+
}, it = w({ name: "EzDynamicForm", inheritAttrs: !1 }), ut = /* @__PURE__ */ w({
|
|
876
|
+
...it,
|
|
877
|
+
props: /* @__PURE__ */ F({
|
|
872
878
|
items: { default: () => [] },
|
|
879
|
+
groups: { default: () => [] },
|
|
873
880
|
modelValue: {},
|
|
874
881
|
cols: { default: 1 },
|
|
875
882
|
gutter: { default: 20 },
|
|
@@ -891,179 +898,303 @@ const at = V({ name: "EzFormItem" }), Ue = /* @__PURE__ */ V({
|
|
|
891
898
|
modelModifiers: {}
|
|
892
899
|
}),
|
|
893
900
|
emits: ["update:modelValue"],
|
|
894
|
-
setup(e, { expose:
|
|
895
|
-
const l = e,
|
|
896
|
-
|
|
897
|
-
|
|
901
|
+
setup(e, { expose: c }) {
|
|
902
|
+
const l = e, i = je(), a = L(e, "modelValue"), f = We(), n = "__legacy__";
|
|
903
|
+
let m = !1;
|
|
904
|
+
const d = (u) => Object.prototype.toString.call(u) === "[object Object]", s = (u) => u instanceof Date ? new Date(u.getTime()) : Array.isArray(u) ? u.map((k) => s(k)) : d(u) ? Object.fromEntries(Object.entries(u).map(([k, p]) => [k, s(p)])) : u, r = () => {
|
|
905
|
+
d(a.value) || (a.value = {});
|
|
906
|
+
}, R = () => {
|
|
907
|
+
r(), a.value && H.value.forEach((u) => {
|
|
908
|
+
u.prop in a.value || (a.value[u.prop] = u.defaultValue !== void 0 ? u.defaultValue : void 0);
|
|
898
909
|
});
|
|
899
|
-
};
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
910
|
+
}, K = T(() => Math.floor(24 / l.cols)), H = T(() => l.groups?.length ? l.groups.flatMap((u) => u.items || []) : l.items || []);
|
|
911
|
+
fe(
|
|
912
|
+
() => [l.items?.length || 0, l.groups?.length || 0],
|
|
913
|
+
([u, k]) => {
|
|
914
|
+
m || u === 0 || k === 0 || (m = !0, console.warn('[EzDynamicForm] Both "items" and "groups" were provided. "groups" takes precedence and "items" will be ignored.'));
|
|
915
|
+
},
|
|
916
|
+
{ immediate: !0 }
|
|
917
|
+
), fe(() => [l.items, l.groups], R, { deep: !0, immediate: !0 }), fe(a, R, { immediate: !0 }), ye(R);
|
|
918
|
+
const j = (u, k, p) => {
|
|
919
|
+
if (!u) return !0;
|
|
920
|
+
try {
|
|
921
|
+
return u(a.value);
|
|
922
|
+
} catch (b) {
|
|
923
|
+
return console.error(`[EzDynamicForm] ${k} visibility error for "${p}":`, b), !1;
|
|
924
|
+
}
|
|
925
|
+
}, X = T(() => {
|
|
926
|
+
const u = Array.isArray(l.groups) && l.groups.length > 0, k = u ? l.groups : [{ name: n, items: l.items || [], cols: l.cols, gutter: l.gutter }], p = [];
|
|
927
|
+
return k.forEach((b, I) => {
|
|
928
|
+
if (!b || b.hidden) return;
|
|
929
|
+
const h = b.name || `group-${I}`;
|
|
930
|
+
if (!j(b.show, "group", h)) return;
|
|
931
|
+
const S = (b.items || []).filter((ne) => ne.hidden ? !1 : j(ne.show, "item", ne.prop)), q = Math.max(1, b.cols || l.cols), x = b.gutter ?? l.gutter, le = b.headerSlot || (b.name ? `group-header-${b.name}` : void 0), he = b.slot || (b.name ? `group-${b.name}` : void 0);
|
|
932
|
+
p.push({
|
|
933
|
+
key: `${h}-${I}`,
|
|
934
|
+
index: I,
|
|
935
|
+
group: b,
|
|
936
|
+
items: S,
|
|
937
|
+
cols: q,
|
|
938
|
+
gutter: x,
|
|
939
|
+
isLegacy: !u,
|
|
940
|
+
headerSlotName: le,
|
|
941
|
+
bodySlotName: he
|
|
942
|
+
});
|
|
943
|
+
}), p;
|
|
944
|
+
}), Z = (u, k) => {
|
|
945
|
+
if (u.span !== void 0)
|
|
946
|
+
return Math.max(1, Math.min(24, u.span));
|
|
947
|
+
const p = Math.max(1, k);
|
|
948
|
+
return Math.max(1, Math.floor(24 / p)) || K.value;
|
|
949
|
+
}, J = (u) => u.isLegacy ? !1 : u.group.title || u.group.description || u.headerSlotName && i[u.headerSlotName] ? !0 : !!i["group-header"], $ = (u) => {
|
|
950
|
+
let k = u.disabled || l.disabled;
|
|
951
|
+
if (!k && u.disabledWhen)
|
|
913
952
|
try {
|
|
914
|
-
|
|
915
|
-
} catch (
|
|
916
|
-
console.error(`[EzDynamicForm] Disabled check error for "${
|
|
953
|
+
k = u.disabledWhen(a.value);
|
|
954
|
+
} catch (p) {
|
|
955
|
+
console.error(`[EzDynamicForm] Disabled check error for "${u.prop}":`, p);
|
|
917
956
|
}
|
|
918
|
-
return { ...
|
|
957
|
+
return { ...u, disabled: k };
|
|
919
958
|
};
|
|
920
|
-
return
|
|
959
|
+
return c({
|
|
921
960
|
validate: async () => {
|
|
922
|
-
if (!
|
|
961
|
+
if (!f.value)
|
|
923
962
|
return console.warn("[EzDynamicForm] Form ref is not available"), !1;
|
|
924
963
|
try {
|
|
925
|
-
return await
|
|
964
|
+
return await f.value.validate(), !0;
|
|
926
965
|
} catch {
|
|
927
966
|
return !1;
|
|
928
967
|
}
|
|
929
968
|
},
|
|
930
|
-
validateField: async (
|
|
931
|
-
if (!
|
|
969
|
+
validateField: async (u) => {
|
|
970
|
+
if (!f.value)
|
|
932
971
|
return console.warn("[EzDynamicForm] Form ref is not available"), !1;
|
|
933
972
|
try {
|
|
934
|
-
return await
|
|
973
|
+
return await f.value.validateField(u), !0;
|
|
935
974
|
} catch {
|
|
936
975
|
return !1;
|
|
937
976
|
}
|
|
938
977
|
},
|
|
939
|
-
clearValidate: (
|
|
940
|
-
if (!
|
|
978
|
+
clearValidate: (u) => {
|
|
979
|
+
if (!f.value) {
|
|
941
980
|
console.warn("[EzDynamicForm] Form ref is not available");
|
|
942
981
|
return;
|
|
943
982
|
}
|
|
944
|
-
|
|
983
|
+
f.value.clearValidate(u);
|
|
945
984
|
},
|
|
946
|
-
getFormData: () => (
|
|
947
|
-
setFormData: (
|
|
948
|
-
|
|
985
|
+
getFormData: () => s(a.value),
|
|
986
|
+
setFormData: (u, k = !0) => {
|
|
987
|
+
if (!u) return;
|
|
988
|
+
r();
|
|
989
|
+
const p = s(u);
|
|
990
|
+
k ? Object.assign(a.value, p) : a.value = p, R(), Le(() => {
|
|
991
|
+
f.value?.clearValidate();
|
|
992
|
+
});
|
|
949
993
|
},
|
|
950
|
-
formRef:
|
|
951
|
-
}), (
|
|
994
|
+
formRef: f
|
|
995
|
+
}), (u, k) => (o(), v(t(ml), g({
|
|
952
996
|
ref_key: "formRef",
|
|
953
|
-
ref:
|
|
997
|
+
ref: f,
|
|
954
998
|
class: "ez-dynamic-form",
|
|
955
999
|
"label-width": "auto"
|
|
956
|
-
},
|
|
957
|
-
default:
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
},
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
1000
|
+
}, u.$attrs, { model: a.value }), {
|
|
1001
|
+
default: y(() => [
|
|
1002
|
+
(o(!0), V(P, null, W(X.value, (p) => (o(), V(P, {
|
|
1003
|
+
key: p.key
|
|
1004
|
+
}, [
|
|
1005
|
+
p.isLegacy ? (o(), v(t(ze), {
|
|
1006
|
+
key: 0,
|
|
1007
|
+
gutter: p.gutter
|
|
1008
|
+
}, {
|
|
1009
|
+
default: y(() => [
|
|
1010
|
+
(o(!0), V(P, null, W(p.items, (b) => (o(), v(t(Ce), {
|
|
1011
|
+
key: b.prop,
|
|
1012
|
+
span: Z(b, p.cols)
|
|
1013
|
+
}, {
|
|
1014
|
+
default: y(() => [
|
|
1015
|
+
M(pe, {
|
|
1016
|
+
modelValue: a.value[b.prop],
|
|
1017
|
+
"onUpdate:modelValue": (I) => a.value[b.prop] = I,
|
|
1018
|
+
config: $(b),
|
|
1019
|
+
formData: a.value
|
|
1020
|
+
}, ae({ _: 2 }, [
|
|
1021
|
+
u.$slots[`label-${b.prop}`] ? {
|
|
1022
|
+
name: "label",
|
|
1023
|
+
fn: y(() => [
|
|
1024
|
+
C(u.$slots, `label-${b.prop}`, { item: b })
|
|
1025
|
+
]),
|
|
1026
|
+
key: "0"
|
|
1027
|
+
} : void 0,
|
|
1028
|
+
u.$slots[b.prop] ? {
|
|
1029
|
+
name: "default",
|
|
1030
|
+
fn: y(({ config: I, value: h }) => [
|
|
1031
|
+
C(u.$slots, b.prop, {
|
|
1032
|
+
item: I,
|
|
1033
|
+
value: h,
|
|
1034
|
+
formData: a.value
|
|
1035
|
+
})
|
|
1036
|
+
]),
|
|
1037
|
+
key: "1"
|
|
1038
|
+
} : void 0
|
|
1039
|
+
]), 1032, ["modelValue", "onUpdate:modelValue", "config", "formData"])
|
|
1040
|
+
]),
|
|
1041
|
+
_: 2
|
|
1042
|
+
}, 1032, ["span"]))), 128))
|
|
1043
|
+
]),
|
|
1044
|
+
_: 2
|
|
1045
|
+
}, 1032, ["gutter"])) : (o(), V("section", {
|
|
1046
|
+
key: 1,
|
|
1047
|
+
class: ce(["ez-dynamic-form-group", p.group.className]),
|
|
1048
|
+
style: ie(p.group.style)
|
|
1049
|
+
}, [
|
|
1050
|
+
J(p) ? (o(), V("div", {
|
|
1051
|
+
key: 0,
|
|
1052
|
+
class: ce(["ez-dynamic-form-group__header", p.group.headerClassName]),
|
|
1053
|
+
style: ie(p.group.headerStyle)
|
|
1054
|
+
}, [
|
|
1055
|
+
p.headerSlotName && u.$slots[p.headerSlotName] ? C(u.$slots, p.headerSlotName, {
|
|
1056
|
+
key: 0,
|
|
1057
|
+
group: p.group,
|
|
1058
|
+
index: p.index,
|
|
1059
|
+
items: p.items,
|
|
1060
|
+
formData: a.value
|
|
1061
|
+
}) : u.$slots["group-header"] ? C(u.$slots, "group-header", {
|
|
1062
|
+
key: 1,
|
|
1063
|
+
group: p.group,
|
|
1064
|
+
index: p.index,
|
|
1065
|
+
items: p.items,
|
|
1066
|
+
formData: a.value
|
|
1067
|
+
}) : (o(), V(P, { key: 2 }, [
|
|
1068
|
+
p.group.title ? (o(), V("div", st, Y(p.group.title), 1)) : D("", !0),
|
|
1069
|
+
p.group.description ? (o(), V("div", rt, Y(p.group.description), 1)) : D("", !0)
|
|
1070
|
+
], 64))
|
|
1071
|
+
], 6)) : D("", !0),
|
|
1072
|
+
p.bodySlotName && u.$slots[p.bodySlotName] ? C(u.$slots, p.bodySlotName, {
|
|
1073
|
+
key: 1,
|
|
1074
|
+
group: p.group,
|
|
1075
|
+
index: p.index,
|
|
1076
|
+
items: p.items,
|
|
1077
|
+
formData: a.value
|
|
1078
|
+
}) : u.$slots.group ? C(u.$slots, "group", {
|
|
1079
|
+
key: 2,
|
|
1080
|
+
group: p.group,
|
|
1081
|
+
index: p.index,
|
|
1082
|
+
items: p.items,
|
|
1083
|
+
formData: a.value
|
|
1084
|
+
}) : (o(), v(t(ze), {
|
|
1085
|
+
key: 3,
|
|
1086
|
+
gutter: p.gutter,
|
|
1087
|
+
class: ce(["ez-dynamic-form-group__body", p.group.bodyClassName]),
|
|
1088
|
+
style: ie(p.group.bodyStyle)
|
|
965
1089
|
}, {
|
|
966
|
-
default:
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1090
|
+
default: y(() => [
|
|
1091
|
+
(o(!0), V(P, null, W(p.items, (b) => (o(), v(t(Ce), {
|
|
1092
|
+
key: `${p.key}-${b.prop}`,
|
|
1093
|
+
span: Z(b, p.cols)
|
|
1094
|
+
}, {
|
|
1095
|
+
default: y(() => [
|
|
1096
|
+
M(pe, {
|
|
1097
|
+
modelValue: a.value[b.prop],
|
|
1098
|
+
"onUpdate:modelValue": (I) => a.value[b.prop] = I,
|
|
1099
|
+
config: $(b),
|
|
1100
|
+
formData: a.value
|
|
1101
|
+
}, ae({ _: 2 }, [
|
|
1102
|
+
u.$slots[`label-${b.prop}`] ? {
|
|
1103
|
+
name: "label",
|
|
1104
|
+
fn: y(() => [
|
|
1105
|
+
C(u.$slots, `label-${b.prop}`, { item: b })
|
|
1106
|
+
]),
|
|
1107
|
+
key: "0"
|
|
1108
|
+
} : void 0,
|
|
1109
|
+
u.$slots[b.prop] ? {
|
|
1110
|
+
name: "default",
|
|
1111
|
+
fn: y(({ config: I, value: h }) => [
|
|
1112
|
+
C(u.$slots, b.prop, {
|
|
1113
|
+
item: I,
|
|
1114
|
+
value: h,
|
|
1115
|
+
formData: a.value
|
|
1116
|
+
})
|
|
1117
|
+
]),
|
|
1118
|
+
key: "1"
|
|
1119
|
+
} : void 0
|
|
1120
|
+
]), 1032, ["modelValue", "onUpdate:modelValue", "config", "formData"])
|
|
1121
|
+
]),
|
|
1122
|
+
_: 2
|
|
1123
|
+
}, 1032, ["span"]))), 128))
|
|
992
1124
|
]),
|
|
993
1125
|
_: 2
|
|
994
|
-
}, 1032, ["
|
|
995
|
-
])
|
|
996
|
-
|
|
997
|
-
}, 8, ["gutter"])
|
|
1126
|
+
}, 1032, ["gutter", "class", "style"]))
|
|
1127
|
+
], 6))
|
|
1128
|
+
], 64))), 128))
|
|
998
1129
|
]),
|
|
999
1130
|
_: 3
|
|
1000
1131
|
}, 16, ["model"]));
|
|
1001
1132
|
}
|
|
1002
|
-
}),
|
|
1003
|
-
...
|
|
1133
|
+
}), dt = G(ut), ct = G(pe), ft = w({ name: "EzTable" }), mt = /* @__PURE__ */ w({
|
|
1134
|
+
...ft,
|
|
1004
1135
|
props: {
|
|
1005
1136
|
data: { default: () => [] },
|
|
1006
1137
|
columns: { default: () => [] },
|
|
1007
1138
|
rowKey: {}
|
|
1008
1139
|
},
|
|
1009
|
-
setup(e, { expose:
|
|
1010
|
-
const l = e,
|
|
1011
|
-
const
|
|
1140
|
+
setup(e, { expose: c }) {
|
|
1141
|
+
const l = e, i = O(), a = (n) => {
|
|
1142
|
+
const m = l.columns[l.columns.length - 1], d = () => n.type ? !1 : n.prop !== m.prop;
|
|
1012
1143
|
return { ...{
|
|
1013
1144
|
align: "center",
|
|
1014
1145
|
hidden: 1,
|
|
1015
1146
|
resizable: !0,
|
|
1016
|
-
reserveSelection:
|
|
1147
|
+
reserveSelection: n.type === "selection",
|
|
1017
1148
|
/** 默认最后一个 */
|
|
1018
|
-
showOverflowTooltip:
|
|
1019
|
-
}, ...
|
|
1149
|
+
showOverflowTooltip: d()
|
|
1150
|
+
}, ...n };
|
|
1020
1151
|
};
|
|
1021
|
-
return
|
|
1022
|
-
getTableRef: () =>
|
|
1023
|
-
clearSelection: () =>
|
|
1024
|
-
toggleRowSelection: (
|
|
1025
|
-
toggleAllSelection: () =>
|
|
1026
|
-
toggleRowExpansion: (
|
|
1027
|
-
setCurrentRow: (
|
|
1028
|
-
clearSort: () =>
|
|
1029
|
-
clearFilter: (
|
|
1030
|
-
doLayout: () =>
|
|
1031
|
-
sort: (
|
|
1032
|
-
}), (
|
|
1152
|
+
return c({
|
|
1153
|
+
getTableRef: () => i.value,
|
|
1154
|
+
clearSelection: () => i.value?.clearSelection(),
|
|
1155
|
+
toggleRowSelection: (n, m) => i.value?.toggleRowSelection(n, m),
|
|
1156
|
+
toggleAllSelection: () => i.value?.toggleAllSelection(),
|
|
1157
|
+
toggleRowExpansion: (n, m) => i.value?.toggleRowExpansion(n, m),
|
|
1158
|
+
setCurrentRow: (n) => i.value?.setCurrentRow(n),
|
|
1159
|
+
clearSort: () => i.value?.clearSort(),
|
|
1160
|
+
clearFilter: (n) => i.value?.clearFilter(n),
|
|
1161
|
+
doLayout: () => i.value?.doLayout(),
|
|
1162
|
+
sort: (n, m) => i.value?.sort(n, m)
|
|
1163
|
+
}), (n, m) => (o(), v(t(pl), g({
|
|
1033
1164
|
ref_key: "tableRef",
|
|
1034
|
-
ref:
|
|
1165
|
+
ref: i,
|
|
1035
1166
|
data: l.data,
|
|
1036
1167
|
border: "",
|
|
1037
1168
|
"row-key": "id"
|
|
1038
|
-
},
|
|
1039
|
-
default:
|
|
1040
|
-
(
|
|
1041
|
-
key:
|
|
1169
|
+
}, n.$attrs), ae({
|
|
1170
|
+
default: y(() => [
|
|
1171
|
+
(o(!0), V(P, null, W(l.columns, (d) => (o(), V(P, {
|
|
1172
|
+
key: d.prop
|
|
1042
1173
|
}, [
|
|
1043
|
-
["selection", "index"].includes(
|
|
1174
|
+
["selection", "index"].includes(d.type) ? (o(), v(t(Ae), g({
|
|
1044
1175
|
key: 0,
|
|
1045
1176
|
ref_for: !0
|
|
1046
|
-
},
|
|
1177
|
+
}, a(d)), null, 16)) : d.hidden ? D("", !0) : (o(), v(t(Ae), g({
|
|
1047
1178
|
key: 1,
|
|
1048
1179
|
ref_for: !0
|
|
1049
|
-
},
|
|
1050
|
-
|
|
1180
|
+
}, a(d)), ae({ _: 2 }, [
|
|
1181
|
+
n.$slots[d.prop] ? {
|
|
1051
1182
|
name: "default",
|
|
1052
|
-
fn:
|
|
1053
|
-
|
|
1183
|
+
fn: y((s) => [
|
|
1184
|
+
C(n.$slots, d.prop, g({ ref_for: !0 }, s))
|
|
1054
1185
|
]),
|
|
1055
1186
|
key: "0"
|
|
1056
|
-
} :
|
|
1187
|
+
} : d.transform ? {
|
|
1057
1188
|
name: "default",
|
|
1058
|
-
fn:
|
|
1059
|
-
|
|
1189
|
+
fn: y((s) => [
|
|
1190
|
+
_(Y(d.transform(s.row)), 1)
|
|
1060
1191
|
]),
|
|
1061
1192
|
key: "1"
|
|
1062
1193
|
} : void 0,
|
|
1063
|
-
|
|
1194
|
+
n.$slots[`header-${d.prop}`] ? {
|
|
1064
1195
|
name: "header",
|
|
1065
|
-
fn:
|
|
1066
|
-
|
|
1196
|
+
fn: y((s) => [
|
|
1197
|
+
C(n.$slots, `header-${d.prop}`, g({ ref_for: !0 }, s))
|
|
1067
1198
|
]),
|
|
1068
1199
|
key: "2"
|
|
1069
1200
|
} : void 0
|
|
@@ -1072,25 +1203,25 @@ const at = V({ name: "EzFormItem" }), Ue = /* @__PURE__ */ V({
|
|
|
1072
1203
|
]),
|
|
1073
1204
|
_: 2
|
|
1074
1205
|
}, [
|
|
1075
|
-
|
|
1206
|
+
n.$slots?.append ? {
|
|
1076
1207
|
name: "append",
|
|
1077
|
-
fn:
|
|
1078
|
-
|
|
1208
|
+
fn: y(() => [
|
|
1209
|
+
C(n.$slots, "append")
|
|
1079
1210
|
]),
|
|
1080
1211
|
key: "0"
|
|
1081
1212
|
} : void 0,
|
|
1082
|
-
|
|
1213
|
+
n.$slots?.empty ? {
|
|
1083
1214
|
name: "empty",
|
|
1084
|
-
fn:
|
|
1085
|
-
|
|
1215
|
+
fn: y(() => [
|
|
1216
|
+
C(n.$slots, "empty")
|
|
1086
1217
|
]),
|
|
1087
1218
|
key: "1"
|
|
1088
1219
|
} : void 0
|
|
1089
1220
|
]), 1040, ["data"]));
|
|
1090
1221
|
}
|
|
1091
|
-
}),
|
|
1092
|
-
...
|
|
1093
|
-
props: /* @__PURE__ */
|
|
1222
|
+
}), Fe = G(mt), pt = { class: "ez-search-form" }, vt = { class: "ez-search-form__operate" }, gt = w({ name: "EzSearchForm", inheritAttrs: !1 }), yt = /* @__PURE__ */ w({
|
|
1223
|
+
...gt,
|
|
1224
|
+
props: /* @__PURE__ */ F({
|
|
1094
1225
|
collapsedHeight: { default: 50 },
|
|
1095
1226
|
reset: { type: Boolean }
|
|
1096
1227
|
}, {
|
|
@@ -1098,51 +1229,51 @@ const at = V({ name: "EzFormItem" }), Ue = /* @__PURE__ */ V({
|
|
|
1098
1229
|
expandedModifiers: {}
|
|
1099
1230
|
}),
|
|
1100
1231
|
emits: ["update:expanded"],
|
|
1101
|
-
setup(e, { expose:
|
|
1102
|
-
const l = e, { t:
|
|
1103
|
-
let
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1106
|
-
}, 100),
|
|
1107
|
-
|
|
1232
|
+
setup(e, { expose: c }) {
|
|
1233
|
+
const l = e, { t: i } = ue(), a = O(), f = O(0), n = L(e, "expanded"), m = T(() => f.value > l.collapsedHeight), d = T(() => n.value ? Gl : ql), s = T(() => n.value ? i("s.button.collapse") : i("s.button.expand"));
|
|
1234
|
+
let r = null;
|
|
1235
|
+
const R = Sl(() => {
|
|
1236
|
+
a.value && (f.value = a.value.scrollHeight);
|
|
1237
|
+
}, 100), K = () => {
|
|
1238
|
+
n.value = !n.value;
|
|
1108
1239
|
};
|
|
1109
|
-
return
|
|
1240
|
+
return ye(() => {
|
|
1110
1241
|
setTimeout(() => {
|
|
1111
|
-
|
|
1242
|
+
a.value && (R(), r = new ResizeObserver(R), r.observe(a.value));
|
|
1112
1243
|
}, 50);
|
|
1113
|
-
}),
|
|
1114
|
-
|
|
1115
|
-
}),
|
|
1116
|
-
countViewHeight:
|
|
1117
|
-
}), (
|
|
1118
|
-
|
|
1244
|
+
}), Ke(() => {
|
|
1245
|
+
r && (r.disconnect(), r = null);
|
|
1246
|
+
}), c({
|
|
1247
|
+
countViewHeight: R
|
|
1248
|
+
}), (H, j) => (o(), V("div", pt, [
|
|
1249
|
+
N("div", {
|
|
1119
1250
|
class: "ez-search-form__wrapper",
|
|
1120
|
-
style:
|
|
1121
|
-
height: f.value ?
|
|
1251
|
+
style: ie({
|
|
1252
|
+
height: f.value ? n.value ? `${f.value}px` : `${l.collapsedHeight}px` : "auto"
|
|
1122
1253
|
})
|
|
1123
1254
|
}, [
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1255
|
+
N("div", vt, [
|
|
1256
|
+
C(H.$slots, "operate"),
|
|
1257
|
+
m.value ? (o(), v(t(te), {
|
|
1127
1258
|
key: 0,
|
|
1128
|
-
icon:
|
|
1259
|
+
icon: d.value,
|
|
1129
1260
|
size: "small",
|
|
1130
|
-
title:
|
|
1261
|
+
title: s.value,
|
|
1131
1262
|
circle: "",
|
|
1132
|
-
onClick:
|
|
1133
|
-
}, null, 8, ["icon", "title"])) :
|
|
1263
|
+
onClick: j[0] || (j[0] = (X) => K())
|
|
1264
|
+
}, null, 8, ["icon", "title"])) : D("", !0)
|
|
1134
1265
|
]),
|
|
1135
|
-
|
|
1266
|
+
N("div", {
|
|
1136
1267
|
ref_key: "wrapRef",
|
|
1137
|
-
ref:
|
|
1268
|
+
ref: a
|
|
1138
1269
|
}, [
|
|
1139
|
-
|
|
1270
|
+
C(H.$slots, "default")
|
|
1140
1271
|
], 512)
|
|
1141
1272
|
], 4)
|
|
1142
1273
|
]));
|
|
1143
1274
|
}
|
|
1144
|
-
}),
|
|
1145
|
-
...
|
|
1275
|
+
}), Ge = G(yt), bt = w({ name: "EzPagination", inheritAttrs: !1 }), ht = /* @__PURE__ */ w({
|
|
1276
|
+
...bt,
|
|
1146
1277
|
props: {
|
|
1147
1278
|
currentPage: {},
|
|
1148
1279
|
currentPageModifiers: {},
|
|
@@ -1151,32 +1282,32 @@ const at = V({ name: "EzFormItem" }), Ue = /* @__PURE__ */ V({
|
|
|
1151
1282
|
},
|
|
1152
1283
|
emits: ["update:currentPage", "update:pageSize"],
|
|
1153
1284
|
setup(e) {
|
|
1154
|
-
const
|
|
1155
|
-
return (
|
|
1156
|
-
"current-page":
|
|
1157
|
-
"onUpdate:currentPage": f[0] || (f[0] = (
|
|
1285
|
+
const c = L(e, "currentPage"), l = L(e, "pageSize"), { attrs: i } = oe(["currentPage", "pageSize"]);
|
|
1286
|
+
return (a, f) => (o(), v(t(vl), g({
|
|
1287
|
+
"current-page": c.value,
|
|
1288
|
+
"onUpdate:currentPage": f[0] || (f[0] = (n) => c.value = n),
|
|
1158
1289
|
"page-size": l.value,
|
|
1159
|
-
"onUpdate:pageSize": f[1] || (f[1] = (
|
|
1290
|
+
"onUpdate:pageSize": f[1] || (f[1] = (n) => l.value = n),
|
|
1160
1291
|
"page-sizes": [10, 20, 50, 100],
|
|
1161
1292
|
layout: "total, sizes, prev, pager, next, jumper"
|
|
1162
|
-
}, t(
|
|
1293
|
+
}, t(i)), null, 16, ["current-page", "page-size"]));
|
|
1163
1294
|
}
|
|
1164
|
-
}),
|
|
1165
|
-
var
|
|
1166
|
-
const
|
|
1167
|
-
const
|
|
1295
|
+
}), He = G(ht);
|
|
1296
|
+
var ve = /* @__PURE__ */ ((e) => (e.ASC = "ascending", e.DESC = "descending", e[e.EMPTY = null] = "EMPTY", e))(ve || {});
|
|
1297
|
+
const Vt = (e) => {
|
|
1298
|
+
const c = O([]), l = T(() => c.value), i = T(() => c.value.map((n) => n[e]));
|
|
1168
1299
|
return {
|
|
1169
|
-
selectionChange: (
|
|
1170
|
-
|
|
1300
|
+
selectionChange: (n) => {
|
|
1301
|
+
c.value = n;
|
|
1171
1302
|
},
|
|
1172
1303
|
getSelectedList: l,
|
|
1173
|
-
getSelectedIds:
|
|
1174
|
-
getSortParams: ({ prop:
|
|
1175
|
-
const
|
|
1176
|
-
return
|
|
1304
|
+
getSelectedIds: i,
|
|
1305
|
+
getSortParams: ({ prop: n, order: m }) => {
|
|
1306
|
+
const d = { asc: null, desc: null };
|
|
1307
|
+
return m === ve.ASC ? (d.asc = n, d.desc = null) : m === ve.DESC && (d.asc = null, d.desc = n), d;
|
|
1177
1308
|
}
|
|
1178
1309
|
};
|
|
1179
|
-
},
|
|
1310
|
+
}, Et = /* @__PURE__ */ w({
|
|
1180
1311
|
__name: "column-config",
|
|
1181
1312
|
props: {
|
|
1182
1313
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1184,47 +1315,47 @@ const gt = (e) => {
|
|
|
1184
1315
|
columns: { default: () => [] },
|
|
1185
1316
|
columnsModifiers: {}
|
|
1186
1317
|
},
|
|
1187
|
-
emits: /* @__PURE__ */
|
|
1188
|
-
setup(e, { emit:
|
|
1189
|
-
const { t: l } =
|
|
1190
|
-
return (
|
|
1318
|
+
emits: /* @__PURE__ */ F(["change"], ["update:modelValue", "update:columns"]),
|
|
1319
|
+
setup(e, { emit: c }) {
|
|
1320
|
+
const { t: l } = ue(), i = ["selection", "index", "expand"], a = c, f = L(e, "modelValue"), n = L(e, "columns"), m = (d) => n.value.filter((r) => r.hidden === 0).length < 2 && d.hidden === 0;
|
|
1321
|
+
return (d, s) => (o(), v(t(gl), {
|
|
1191
1322
|
modelValue: f.value,
|
|
1192
|
-
"onUpdate:modelValue":
|
|
1323
|
+
"onUpdate:modelValue": s[1] || (s[1] = (r) => f.value = r),
|
|
1193
1324
|
class: "ez-column-wrapper",
|
|
1194
1325
|
title: t(l)("s.label.column"),
|
|
1195
1326
|
size: "15%"
|
|
1196
1327
|
}, {
|
|
1197
|
-
default:
|
|
1198
|
-
(
|
|
1199
|
-
key:
|
|
1328
|
+
default: y(() => [
|
|
1329
|
+
(o(!0), V(P, null, W(n.value, (r) => (o(), V(P, {
|
|
1330
|
+
key: r.prop
|
|
1200
1331
|
}, [
|
|
1201
|
-
|
|
1332
|
+
i.includes(r.type) ? D("", !0) : (o(), v(t(Ne), {
|
|
1202
1333
|
key: 0,
|
|
1203
|
-
modelValue:
|
|
1204
|
-
"onUpdate:modelValue": (
|
|
1334
|
+
modelValue: r.hidden,
|
|
1335
|
+
"onUpdate:modelValue": (R) => r.hidden = R,
|
|
1205
1336
|
class: "flex",
|
|
1206
1337
|
"true-value": 0,
|
|
1207
1338
|
"false-value": 1,
|
|
1208
|
-
label:
|
|
1339
|
+
label: r.label,
|
|
1209
1340
|
checked: "",
|
|
1210
|
-
disabled:
|
|
1211
|
-
onChange:
|
|
1341
|
+
disabled: m(r),
|
|
1342
|
+
onChange: s[0] || (s[0] = (R) => a("change"))
|
|
1212
1343
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))
|
|
1213
1344
|
], 64))), 128))
|
|
1214
1345
|
]),
|
|
1215
1346
|
_: 1
|
|
1216
1347
|
}, 8, ["modelValue", "title"]));
|
|
1217
1348
|
}
|
|
1218
|
-
}),
|
|
1349
|
+
}), $t = { class: "ez-fast-table" }, kt = { class: "ez-fast-table_wrapper" }, wt = {
|
|
1219
1350
|
key: 0,
|
|
1220
1351
|
class: "ez-fast-table_wrapper_header_operation"
|
|
1221
|
-
},
|
|
1352
|
+
}, St = { class: "ez-fast-table_pagination" }, zt = w({
|
|
1222
1353
|
name: "EzFastTable",
|
|
1223
|
-
directives: { loading:
|
|
1354
|
+
directives: { loading: be.directive },
|
|
1224
1355
|
inheritAttrs: !1
|
|
1225
|
-
}),
|
|
1226
|
-
...
|
|
1227
|
-
props: /* @__PURE__ */
|
|
1356
|
+
}), Ct = /* @__PURE__ */ w({
|
|
1357
|
+
...zt,
|
|
1358
|
+
props: /* @__PURE__ */ F({
|
|
1228
1359
|
api: { type: Function, default: () => Promise.resolve() },
|
|
1229
1360
|
beforeSearch: { type: Function, default: () => Promise.resolve() },
|
|
1230
1361
|
columnTool: { type: Boolean, default: !0 },
|
|
@@ -1240,186 +1371,186 @@ const gt = (e) => {
|
|
|
1240
1371
|
loading: { type: Boolean },
|
|
1241
1372
|
loadingModifiers: {}
|
|
1242
1373
|
}),
|
|
1243
|
-
emits: /* @__PURE__ */
|
|
1244
|
-
setup(e, { expose:
|
|
1245
|
-
const { t:
|
|
1246
|
-
const { api: h, beforeSearch:
|
|
1374
|
+
emits: /* @__PURE__ */ F(["changePage", "reset", "query"], ["update:params", "update:columns", "update:loading"]),
|
|
1375
|
+
setup(e, { expose: c, emit: l }) {
|
|
1376
|
+
const { t: i } = ue(), a = e, f = Me(), n = T(() => {
|
|
1377
|
+
const { api: h, beforeSearch: S, columnTool: q, expanded: x, ...le } = a;
|
|
1247
1378
|
return {
|
|
1248
1379
|
...f,
|
|
1249
|
-
...
|
|
1380
|
+
...le
|
|
1250
1381
|
};
|
|
1251
|
-
}),
|
|
1382
|
+
}), m = O(a.expanded), { selectionChange: d, getSelectedList: s, getSortParams: r, getSelectedIds: R } = Vt(a.rowKey), K = O(null), H = O(!1), j = O(null), X = O([]), Z = O(0), J = l, $ = L(e, "params"), E = L(e, "columns"), z = L(e, "loading"), U = async () => {
|
|
1252
1383
|
try {
|
|
1253
|
-
|
|
1254
|
-
const { code: h, data:
|
|
1255
|
-
h === 200 &&
|
|
1384
|
+
z.value = !0, await a.beforeSearch($.value);
|
|
1385
|
+
const { code: h, data: S } = await a.api($.value);
|
|
1386
|
+
h === 200 && S.records ? (X.value = S.records || [], Z.value = S.total) : (X.value = [], Z.value = 0), J("query");
|
|
1256
1387
|
} finally {
|
|
1257
|
-
|
|
1388
|
+
z.value = !1;
|
|
1258
1389
|
}
|
|
1259
|
-
},
|
|
1260
|
-
|
|
1261
|
-
},
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
const { column:
|
|
1265
|
-
|
|
1266
|
-
},
|
|
1390
|
+
}, B = () => {
|
|
1391
|
+
$.value.current = 1, U();
|
|
1392
|
+
}, ee = () => K.value?.getTableRef(), u = (h) => {
|
|
1393
|
+
const S = r(h);
|
|
1394
|
+
$.value = { ...$.value, ...S };
|
|
1395
|
+
const { column: q } = h;
|
|
1396
|
+
q.sortable === "custom" && B();
|
|
1397
|
+
}, k = (h) => {
|
|
1267
1398
|
if (h === null || typeof h != "object") return h;
|
|
1268
1399
|
if (h instanceof Date) return new Date(h.getTime());
|
|
1269
|
-
if (h instanceof Array) return h.map((
|
|
1270
|
-
const
|
|
1271
|
-
for (const
|
|
1272
|
-
h.hasOwnProperty(
|
|
1273
|
-
return
|
|
1274
|
-
},
|
|
1275
|
-
|
|
1276
|
-
},
|
|
1277
|
-
|
|
1278
|
-
},
|
|
1279
|
-
|
|
1400
|
+
if (h instanceof Array) return h.map((q) => k(q));
|
|
1401
|
+
const S = Object.create(Object.getPrototypeOf(h));
|
|
1402
|
+
for (const q in h)
|
|
1403
|
+
h.hasOwnProperty(q) && (S[q] = k(h[q]));
|
|
1404
|
+
return S;
|
|
1405
|
+
}, p = () => {
|
|
1406
|
+
$.value = k(j.value), J("reset"), Le(() => B());
|
|
1407
|
+
}, b = (h) => {
|
|
1408
|
+
J("changePage", h), h.size ? B() : U();
|
|
1409
|
+
}, I = () => {
|
|
1410
|
+
ee().doLayout();
|
|
1280
1411
|
};
|
|
1281
|
-
return
|
|
1282
|
-
|
|
1283
|
-
}),
|
|
1284
|
-
const
|
|
1285
|
-
return
|
|
1286
|
-
h.$slots.form ? (
|
|
1412
|
+
return ye(() => {
|
|
1413
|
+
j.value = k($.value);
|
|
1414
|
+
}), c({ search: B, query: U, getTableRef: ee }), (h, S) => {
|
|
1415
|
+
const q = Ue("loading");
|
|
1416
|
+
return o(), V("div", $t, [
|
|
1417
|
+
h.$slots.form ? (o(), v(t(Ge), {
|
|
1287
1418
|
key: 0,
|
|
1288
|
-
loading:
|
|
1289
|
-
expanded:
|
|
1419
|
+
loading: z.value,
|
|
1420
|
+
expanded: m.value
|
|
1290
1421
|
}, {
|
|
1291
|
-
default:
|
|
1292
|
-
|
|
1422
|
+
default: y((x) => [
|
|
1423
|
+
C(h.$slots, "form", Ee(Ye(x)))
|
|
1293
1424
|
]),
|
|
1294
|
-
operate:
|
|
1295
|
-
|
|
1425
|
+
operate: y(() => [
|
|
1426
|
+
M(t(te), {
|
|
1296
1427
|
type: "primary",
|
|
1297
|
-
loading:
|
|
1298
|
-
onClick:
|
|
1428
|
+
loading: z.value,
|
|
1429
|
+
onClick: B
|
|
1299
1430
|
}, {
|
|
1300
|
-
default:
|
|
1301
|
-
|
|
1431
|
+
default: y(() => [
|
|
1432
|
+
_(Y(t(i)("s.button.query")), 1)
|
|
1302
1433
|
]),
|
|
1303
1434
|
_: 1
|
|
1304
1435
|
}, 8, ["loading"]),
|
|
1305
|
-
|
|
1306
|
-
default:
|
|
1307
|
-
|
|
1436
|
+
M(t(te), { onClick: p }, {
|
|
1437
|
+
default: y(() => [
|
|
1438
|
+
_(Y(t(i)("s.button.reset")), 1)
|
|
1308
1439
|
]),
|
|
1309
1440
|
_: 1
|
|
1310
1441
|
})
|
|
1311
1442
|
]),
|
|
1312
1443
|
_: 3
|
|
1313
|
-
}, 8, ["loading", "expanded"])) :
|
|
1314
|
-
h.$slots.freeArea ?
|
|
1315
|
-
|
|
1316
|
-
h.$slots.header ||
|
|
1444
|
+
}, 8, ["loading", "expanded"])) : D("", !0),
|
|
1445
|
+
h.$slots.freeArea ? C(h.$slots, "freeArea", { key: 1 }) : D("", !0),
|
|
1446
|
+
N("div", kt, [
|
|
1447
|
+
h.$slots.header || a.columnTool ? (o(), V("div", {
|
|
1317
1448
|
key: 0,
|
|
1318
|
-
class:
|
|
1449
|
+
class: ce(["ez-fast-table_wrapper_header", h.$slots.header ? "justify-between" : "justify-end"])
|
|
1319
1450
|
}, [
|
|
1320
|
-
h.$slots.header ? (
|
|
1321
|
-
|
|
1322
|
-
selectList: t(
|
|
1323
|
-
selectIds: t(
|
|
1451
|
+
h.$slots.header ? (o(), V("div", wt, [
|
|
1452
|
+
C(h.$slots, "header", {
|
|
1453
|
+
selectList: t(s),
|
|
1454
|
+
selectIds: t(R)
|
|
1324
1455
|
})
|
|
1325
|
-
])) :
|
|
1326
|
-
|
|
1456
|
+
])) : D("", !0),
|
|
1457
|
+
a.columnTool ? (o(), v(t(te), {
|
|
1327
1458
|
key: 1,
|
|
1328
|
-
icon: t(
|
|
1459
|
+
icon: t(Kl),
|
|
1329
1460
|
circle: "",
|
|
1330
|
-
onClick:
|
|
1331
|
-
}, null, 8, ["icon"])) :
|
|
1332
|
-
], 2)) :
|
|
1333
|
-
|
|
1461
|
+
onClick: S[0] || (S[0] = (x) => H.value = !0)
|
|
1462
|
+
}, null, 8, ["icon"])) : D("", !0)
|
|
1463
|
+
], 2)) : D("", !0),
|
|
1464
|
+
Pe((o(), v(t(Fe), g(n.value, {
|
|
1334
1465
|
ref_key: "fastTableRef",
|
|
1335
|
-
ref:
|
|
1336
|
-
columns:
|
|
1337
|
-
data:
|
|
1338
|
-
onSelectionChange: t(
|
|
1339
|
-
onSortChange:
|
|
1340
|
-
}),
|
|
1341
|
-
|
|
1342
|
-
name:
|
|
1343
|
-
fn:
|
|
1344
|
-
["form"].includes(
|
|
1466
|
+
ref: K,
|
|
1467
|
+
columns: E.value,
|
|
1468
|
+
data: X.value,
|
|
1469
|
+
onSelectionChange: t(d),
|
|
1470
|
+
onSortChange: u
|
|
1471
|
+
}), ae({ _: 2 }, [
|
|
1472
|
+
W(h.$slots, (x, le, he) => ({
|
|
1473
|
+
name: le,
|
|
1474
|
+
fn: y((ne) => [
|
|
1475
|
+
["form"].includes(x.name) ? D("", !0) : C(h.$slots, le, Ee(g({ key: 0 }, ne)))
|
|
1345
1476
|
])
|
|
1346
1477
|
}))
|
|
1347
1478
|
]), 1040, ["columns", "data", "onSelectionChange"])), [
|
|
1348
|
-
[
|
|
1479
|
+
[q, z.value]
|
|
1349
1480
|
]),
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
"current-page":
|
|
1481
|
+
N("div", St, [
|
|
1482
|
+
M(t(He), {
|
|
1483
|
+
"current-page": $.value.current,
|
|
1353
1484
|
"onUpdate:currentPage": [
|
|
1354
|
-
|
|
1355
|
-
|
|
1485
|
+
S[1] || (S[1] = (x) => $.value.current = x),
|
|
1486
|
+
S[3] || (S[3] = (x) => b({ current: x }))
|
|
1356
1487
|
],
|
|
1357
|
-
"page-size":
|
|
1488
|
+
"page-size": $.value.size,
|
|
1358
1489
|
"onUpdate:pageSize": [
|
|
1359
|
-
|
|
1360
|
-
|
|
1490
|
+
S[2] || (S[2] = (x) => $.value.size = x),
|
|
1491
|
+
S[4] || (S[4] = (x) => b({ size: x }))
|
|
1361
1492
|
],
|
|
1362
|
-
total:
|
|
1493
|
+
total: Z.value
|
|
1363
1494
|
}, null, 8, ["current-page", "page-size", "total"])
|
|
1364
1495
|
])
|
|
1365
1496
|
]),
|
|
1366
|
-
|
|
1367
|
-
modelValue:
|
|
1368
|
-
"onUpdate:modelValue":
|
|
1369
|
-
columns:
|
|
1370
|
-
"onUpdate:columns":
|
|
1371
|
-
onChange:
|
|
1497
|
+
M(Et, {
|
|
1498
|
+
modelValue: H.value,
|
|
1499
|
+
"onUpdate:modelValue": S[5] || (S[5] = (x) => H.value = x),
|
|
1500
|
+
columns: E.value,
|
|
1501
|
+
"onUpdate:columns": S[6] || (S[6] = (x) => E.value = x),
|
|
1502
|
+
onChange: I
|
|
1372
1503
|
}, null, 8, ["modelValue", "columns"])
|
|
1373
1504
|
]);
|
|
1374
1505
|
};
|
|
1375
1506
|
}
|
|
1376
|
-
}),
|
|
1377
|
-
function
|
|
1507
|
+
}), At = G(Ct), xe = /* @__PURE__ */ Symbol("INSTALLED_KEY");
|
|
1508
|
+
function Dt(e = []) {
|
|
1378
1509
|
return {
|
|
1379
1510
|
install: (l) => {
|
|
1380
|
-
l[
|
|
1511
|
+
l[xe] || (l[xe] = !0, e.forEach((i) => l.use(i)));
|
|
1381
1512
|
}
|
|
1382
1513
|
};
|
|
1383
1514
|
}
|
|
1384
|
-
const
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
],
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
gl,
|
|
1515
|
+
const Tt = [
|
|
1516
|
+
Be,
|
|
1517
|
+
Ml,
|
|
1518
|
+
dt,
|
|
1519
|
+
ct,
|
|
1520
|
+
At,
|
|
1521
|
+
Q,
|
|
1522
|
+
qe,
|
|
1523
|
+
He,
|
|
1524
|
+
Oe,
|
|
1525
|
+
Ge,
|
|
1526
|
+
Ie,
|
|
1527
|
+
Fe
|
|
1528
|
+
], Rt = [
|
|
1529
|
+
yl,
|
|
1530
|
+
be,
|
|
1531
|
+
se,
|
|
1402
1532
|
bl,
|
|
1403
|
-
|
|
1404
|
-
|
|
1533
|
+
hl,
|
|
1534
|
+
Vl
|
|
1535
|
+
], xt = Dt([...Tt, ...Rt]), Pt = xt.install;
|
|
1405
1536
|
export {
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1537
|
+
tt as CHANGE_TRIGGER_TYPES,
|
|
1538
|
+
Be as EzCheckbox,
|
|
1539
|
+
Ml as EzDialog,
|
|
1540
|
+
dt as EzDynamicForm,
|
|
1541
|
+
At as EzFastTable,
|
|
1542
|
+
ct as EzFormItem,
|
|
1543
|
+
Q as EzIcon,
|
|
1544
|
+
qe as EzImageUpload,
|
|
1545
|
+
He as EzPagination,
|
|
1546
|
+
Oe as EzRadio,
|
|
1547
|
+
Ge as EzSearchForm,
|
|
1548
|
+
Ie as EzSelect,
|
|
1549
|
+
Fe as EzTable,
|
|
1550
|
+
A as FormItemType,
|
|
1551
|
+
lt as SELECT_FORM_TYPES,
|
|
1552
|
+
xt as default,
|
|
1553
|
+
at as getInputVerb,
|
|
1554
|
+
ot as getTrigger,
|
|
1555
|
+
Pt as install
|
|
1425
1556
|
};
|