@gopowerteam/form-render 0.0.93 → 1.0.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/cjs/config/provide.config.d.ts +0 -1
- package/dist/cjs/defines/define-form.d.ts +0 -1
- package/dist/cjs/form-items/cascader/index.d.ts +0 -1
- package/dist/cjs/form-items/currency/index.d.ts +0 -1
- package/dist/cjs/form-items/date/index.d.ts +2 -1
- package/dist/cjs/form-items/date-range/index.d.ts +2 -1
- package/dist/cjs/form-items/input/index.d.ts +0 -1
- package/dist/cjs/form-items/radio/index.d.ts +0 -1
- package/dist/cjs/form-items/render/index.d.ts +0 -1
- package/dist/cjs/form-items/select/index.d.ts +0 -1
- package/dist/cjs/form-items/switch/index.d.ts +0 -1
- package/dist/cjs/form-items/textarea/index.d.ts +0 -1
- package/dist/cjs/form-items/tree-select/index.d.ts +1 -2
- package/dist/cjs/form-render/form-collapsed-dialog.d.ts +6 -7
- package/dist/cjs/form-render/form-item-render.d.ts +3 -3
- package/dist/cjs/form-render/index.d.ts +126 -17
- package/dist/cjs/hooks/use-form.d.ts +2 -3
- package/dist/cjs/index.cjs +5 -1
- package/dist/cjs/index.d.ts +2 -3
- package/dist/cjs/install.d.ts +0 -1
- package/dist/cjs/interfaces/form-item-options.d.ts +0 -1
- package/dist/cjs/utils/create-form-source.d.ts +0 -1
- package/dist/es/config/provide.config.d.ts +0 -1
- package/dist/es/defines/define-form.d.ts +0 -1
- package/dist/es/form-items/cascader/index.d.ts +0 -1
- package/dist/es/form-items/currency/index.d.ts +0 -1
- package/dist/es/form-items/date/index.d.ts +2 -1
- package/dist/es/form-items/date-range/index.d.ts +2 -1
- package/dist/es/form-items/input/index.d.ts +0 -1
- package/dist/es/form-items/radio/index.d.ts +0 -1
- package/dist/es/form-items/render/index.d.ts +0 -1
- package/dist/es/form-items/select/index.d.ts +0 -1
- package/dist/es/form-items/switch/index.d.ts +0 -1
- package/dist/es/form-items/textarea/index.d.ts +0 -1
- package/dist/es/form-items/tree-select/index.d.ts +1 -2
- package/dist/es/form-render/form-collapsed-dialog.d.ts +6 -7
- package/dist/es/form-render/form-item-render.d.ts +3 -3
- package/dist/es/form-render/index.d.ts +126 -17
- package/dist/es/hooks/use-form.d.ts +2 -3
- package/dist/es/index.d.ts +2 -3
- package/dist/es/index.mjs +1630 -1594
- package/dist/es/install.d.ts +0 -1
- package/dist/es/interfaces/form-item-options.d.ts +0 -1
- package/dist/es/utils/create-form-source.d.ts +0 -1
- package/dist/style.css +1 -1
- package/package.json +31 -29
package/dist/es/index.mjs
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { FormRenderResolver as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return
|
|
1
|
+
import { getCurrentInstance as ee, inject as Ve, defineComponent as U, computed as L, openBlock as T, createElementBlock as z, normalizeStyle as Q, normalizeClass as Oe, createElementVNode as O, shallowRef as A, ref as D, provide as ze, onMounted as te, Fragment as Ce, renderSlot as yt, createBlock as Se, Teleport as gt, createVNode as p, TransitionGroup as bt, withCtx as kt, renderList as wt, mergeProps as Z, createCommentVNode as J, triggerRef as se, defineAsyncComponent as xt, useCssVars as Ct, onUnmounted as St, withModifiers as Ot, toDisplayString as X, resolveDynamicComponent as dt, normalizeProps as $t, guardReactiveProps as _t, watch as ne, toValue as C, nextTick as Ft, isRef as ie, toRefs as Mt, customRef as Yt, getCurrentScope as Lt, onScopeDispose as Tt, unref as Dt, createTextVNode as q, isVNode as qe, h as Je, onUpdated as Rt } from "vue";
|
|
2
|
+
import { Divider as et, Button as W, Tabs as It, TabPane as Pt, Cascader as jt, InputNumber as ft, DatePicker as Et, YearPicker as zt, QuarterPicker as Nt, MonthPicker as Bt, WeekPicker as Vt, RangePicker as qt, Input as At, RadioGroup as Wt, Select as Ht, Option as Ut, Switch as Gt, Textarea as Qt, TreeSelect as Xt, FormItem as Ne, Form as Zt, Grid as Kt, GridItem as De, Space as tt, Tag as Jt } from "@arco-design/web-vue";
|
|
3
|
+
import k from "dayjs";
|
|
4
|
+
import { FormRenderResolver as Xr } from "./resolver.mjs";
|
|
5
|
+
function Wr(e) {
|
|
6
|
+
return e;
|
|
7
|
+
}
|
|
8
|
+
const en = /* @__PURE__ */ Symbol("ArcoConfigProvider"), tn = "arco", nn = "$arco", Ae = (e) => {
|
|
9
|
+
var r, n, t;
|
|
10
|
+
const o = ee(), a = Ve(en, void 0);
|
|
11
|
+
return `${(t = (n = a?.prefixCls) != null ? n : (r = o?.appContext.config.globalProperties[nn]) == null ? void 0 : r.classPrefix) != null ? t : tn}-${e}`;
|
|
12
|
+
}, rn = Object.prototype.toString;
|
|
13
|
+
function We(e) {
|
|
14
|
+
return rn.call(e) === "[object Number]" && e === e;
|
|
12
15
|
}
|
|
13
|
-
var
|
|
14
|
-
for (const [
|
|
15
|
-
e[
|
|
16
|
+
var He = (e, r) => {
|
|
17
|
+
for (const [n, t] of r)
|
|
18
|
+
e[n] = t;
|
|
16
19
|
return e;
|
|
17
20
|
};
|
|
18
|
-
const
|
|
21
|
+
const on = U({
|
|
19
22
|
name: "IconDown",
|
|
20
23
|
props: {
|
|
21
24
|
size: {
|
|
@@ -42,47 +45,47 @@ const Vt = I({
|
|
|
42
45
|
click: (e) => !0
|
|
43
46
|
},
|
|
44
47
|
setup(e, {
|
|
45
|
-
emit:
|
|
48
|
+
emit: r
|
|
46
49
|
}) {
|
|
47
|
-
const
|
|
48
|
-
[`${
|
|
49
|
-
}]),
|
|
50
|
-
const
|
|
51
|
-
return e.size && (
|
|
50
|
+
const n = Ae("icon"), t = L(() => [n, `${n}-down`, {
|
|
51
|
+
[`${n}-spin`]: e.spin
|
|
52
|
+
}]), o = L(() => {
|
|
53
|
+
const l = {};
|
|
54
|
+
return e.size && (l.fontSize = We(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
|
|
52
55
|
});
|
|
53
56
|
return {
|
|
54
57
|
cls: t,
|
|
55
|
-
innerStyle:
|
|
56
|
-
onClick: (
|
|
57
|
-
|
|
58
|
+
innerStyle: o,
|
|
59
|
+
onClick: (l) => {
|
|
60
|
+
r("click", l);
|
|
58
61
|
}
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
|
-
}),
|
|
64
|
+
}), ln = ["stroke-width", "stroke-linecap", "stroke-linejoin"], an = /* @__PURE__ */ O("path", {
|
|
62
65
|
d: "M39.6 17.443 24.043 33 8.487 17.443"
|
|
63
|
-
}, null, -1),
|
|
64
|
-
function
|
|
65
|
-
return
|
|
66
|
+
}, null, -1), un = [an];
|
|
67
|
+
function sn(e, r, n, t, o, a) {
|
|
68
|
+
return T(), z("svg", {
|
|
66
69
|
viewBox: "0 0 48 48",
|
|
67
70
|
fill: "none",
|
|
68
71
|
xmlns: "http://www.w3.org/2000/svg",
|
|
69
72
|
stroke: "currentColor",
|
|
70
|
-
class:
|
|
71
|
-
style:
|
|
73
|
+
class: Oe(e.cls),
|
|
74
|
+
style: Q(e.innerStyle),
|
|
72
75
|
"stroke-width": e.strokeWidth,
|
|
73
76
|
"stroke-linecap": e.strokeLinecap,
|
|
74
77
|
"stroke-linejoin": e.strokeLinejoin,
|
|
75
|
-
onClick:
|
|
76
|
-
},
|
|
78
|
+
onClick: r[0] || (r[0] = (...l) => e.onClick && e.onClick(...l))
|
|
79
|
+
}, un, 14, ln);
|
|
77
80
|
}
|
|
78
|
-
var
|
|
79
|
-
const
|
|
80
|
-
install: (e,
|
|
81
|
-
var
|
|
82
|
-
const t = (
|
|
83
|
-
e.component(t +
|
|
81
|
+
var Re = /* @__PURE__ */ He(on, [["render", sn]]);
|
|
82
|
+
const cn = Object.assign(Re, {
|
|
83
|
+
install: (e, r) => {
|
|
84
|
+
var n;
|
|
85
|
+
const t = (n = r?.iconPrefix) != null ? n : "";
|
|
86
|
+
e.component(t + Re.name, Re);
|
|
84
87
|
}
|
|
85
|
-
}),
|
|
88
|
+
}), dn = U({
|
|
86
89
|
name: "IconUp",
|
|
87
90
|
props: {
|
|
88
91
|
size: {
|
|
@@ -109,47 +112,47 @@ const Ht = Object.assign(fe, {
|
|
|
109
112
|
click: (e) => !0
|
|
110
113
|
},
|
|
111
114
|
setup(e, {
|
|
112
|
-
emit:
|
|
115
|
+
emit: r
|
|
113
116
|
}) {
|
|
114
|
-
const
|
|
115
|
-
[`${
|
|
116
|
-
}]),
|
|
117
|
-
const
|
|
118
|
-
return e.size && (
|
|
117
|
+
const n = Ae("icon"), t = L(() => [n, `${n}-up`, {
|
|
118
|
+
[`${n}-spin`]: e.spin
|
|
119
|
+
}]), o = L(() => {
|
|
120
|
+
const l = {};
|
|
121
|
+
return e.size && (l.fontSize = We(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
|
|
119
122
|
});
|
|
120
123
|
return {
|
|
121
124
|
cls: t,
|
|
122
|
-
innerStyle:
|
|
123
|
-
onClick: (
|
|
124
|
-
|
|
125
|
+
innerStyle: o,
|
|
126
|
+
onClick: (l) => {
|
|
127
|
+
r("click", l);
|
|
125
128
|
}
|
|
126
129
|
};
|
|
127
130
|
}
|
|
128
|
-
}),
|
|
131
|
+
}), fn = ["stroke-width", "stroke-linecap", "stroke-linejoin"], pn = /* @__PURE__ */ O("path", {
|
|
129
132
|
d: "M39.6 30.557 24.043 15 8.487 30.557"
|
|
130
|
-
}, null, -1),
|
|
131
|
-
function
|
|
132
|
-
return
|
|
133
|
+
}, null, -1), mn = [pn];
|
|
134
|
+
function hn(e, r, n, t, o, a) {
|
|
135
|
+
return T(), z("svg", {
|
|
133
136
|
viewBox: "0 0 48 48",
|
|
134
137
|
fill: "none",
|
|
135
138
|
xmlns: "http://www.w3.org/2000/svg",
|
|
136
139
|
stroke: "currentColor",
|
|
137
|
-
class:
|
|
138
|
-
style:
|
|
140
|
+
class: Oe(e.cls),
|
|
141
|
+
style: Q(e.innerStyle),
|
|
139
142
|
"stroke-width": e.strokeWidth,
|
|
140
143
|
"stroke-linecap": e.strokeLinecap,
|
|
141
144
|
"stroke-linejoin": e.strokeLinejoin,
|
|
142
|
-
onClick:
|
|
143
|
-
},
|
|
145
|
+
onClick: r[0] || (r[0] = (...l) => e.onClick && e.onClick(...l))
|
|
146
|
+
}, mn, 14, fn);
|
|
144
147
|
}
|
|
145
|
-
var
|
|
146
|
-
const
|
|
147
|
-
install: (e,
|
|
148
|
-
var
|
|
149
|
-
const t = (
|
|
150
|
-
e.component(t +
|
|
148
|
+
var Ie = /* @__PURE__ */ He(dn, [["render", hn]]);
|
|
149
|
+
const vn = Object.assign(Ie, {
|
|
150
|
+
install: (e, r) => {
|
|
151
|
+
var n;
|
|
152
|
+
const t = (n = r?.iconPrefix) != null ? n : "";
|
|
153
|
+
e.component(t + Ie.name, Ie);
|
|
151
154
|
}
|
|
152
|
-
}),
|
|
155
|
+
}), yn = U({
|
|
153
156
|
name: "IconSearch",
|
|
154
157
|
props: {
|
|
155
158
|
size: {
|
|
@@ -176,259 +179,309 @@ const Zt = Object.assign(me, {
|
|
|
176
179
|
click: (e) => !0
|
|
177
180
|
},
|
|
178
181
|
setup(e, {
|
|
179
|
-
emit:
|
|
182
|
+
emit: r
|
|
180
183
|
}) {
|
|
181
|
-
const
|
|
182
|
-
[`${
|
|
183
|
-
}]),
|
|
184
|
-
const
|
|
185
|
-
return e.size && (
|
|
184
|
+
const n = Ae("icon"), t = L(() => [n, `${n}-search`, {
|
|
185
|
+
[`${n}-spin`]: e.spin
|
|
186
|
+
}]), o = L(() => {
|
|
187
|
+
const l = {};
|
|
188
|
+
return e.size && (l.fontSize = We(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
|
|
186
189
|
});
|
|
187
190
|
return {
|
|
188
191
|
cls: t,
|
|
189
|
-
innerStyle:
|
|
190
|
-
onClick: (
|
|
191
|
-
|
|
192
|
+
innerStyle: o,
|
|
193
|
+
onClick: (l) => {
|
|
194
|
+
r("click", l);
|
|
192
195
|
}
|
|
193
196
|
};
|
|
194
197
|
}
|
|
195
|
-
}),
|
|
198
|
+
}), gn = ["stroke-width", "stroke-linecap", "stroke-linejoin"], bn = /* @__PURE__ */ O("path", {
|
|
196
199
|
d: "M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485"
|
|
197
|
-
}, null, -1),
|
|
198
|
-
function
|
|
199
|
-
return
|
|
200
|
+
}, null, -1), kn = [bn];
|
|
201
|
+
function wn(e, r, n, t, o, a) {
|
|
202
|
+
return T(), z("svg", {
|
|
200
203
|
viewBox: "0 0 48 48",
|
|
201
204
|
fill: "none",
|
|
202
205
|
xmlns: "http://www.w3.org/2000/svg",
|
|
203
206
|
stroke: "currentColor",
|
|
204
|
-
class:
|
|
205
|
-
style:
|
|
207
|
+
class: Oe(e.cls),
|
|
208
|
+
style: Q(e.innerStyle),
|
|
206
209
|
"stroke-width": e.strokeWidth,
|
|
207
210
|
"stroke-linecap": e.strokeLinecap,
|
|
208
211
|
"stroke-linejoin": e.strokeLinejoin,
|
|
209
|
-
onClick:
|
|
210
|
-
},
|
|
212
|
+
onClick: r[0] || (r[0] = (...l) => e.onClick && e.onClick(...l))
|
|
213
|
+
}, kn, 14, gn);
|
|
211
214
|
}
|
|
212
|
-
var
|
|
213
|
-
const
|
|
214
|
-
install: (e,
|
|
215
|
-
var
|
|
216
|
-
const t = (
|
|
217
|
-
e.component(t +
|
|
215
|
+
var Pe = /* @__PURE__ */ He(yn, [["render", wn]]);
|
|
216
|
+
const xn = Object.assign(Pe, {
|
|
217
|
+
install: (e, r) => {
|
|
218
|
+
var n;
|
|
219
|
+
const t = (n = r?.iconPrefix) != null ? n : "";
|
|
220
|
+
e.component(t + Pe.name, Pe);
|
|
218
221
|
}
|
|
219
|
-
})
|
|
220
|
-
function
|
|
221
|
-
return
|
|
222
|
-
}
|
|
223
|
-
function D(e) {
|
|
224
|
-
return typeof e == "function" ? e() : Ae(e);
|
|
222
|
+
});
|
|
223
|
+
function Cn(e, r) {
|
|
224
|
+
return Lt() ? (Tt(e, r), !0) : !1;
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const pt = typeof window < "u" && typeof document < "u";
|
|
227
227
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return q();
|
|
228
|
+
const Sn = Object.prototype.toString, On = (e) => Sn.call(e) === "[object Object]";
|
|
229
|
+
function ge(e) {
|
|
230
|
+
return Array.isArray(e) ? e : [e];
|
|
232
231
|
}
|
|
233
|
-
function
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
232
|
+
function $n(e) {
|
|
233
|
+
return ee();
|
|
234
|
+
}
|
|
235
|
+
function _n(e, r = {}) {
|
|
236
|
+
if (!ie(e)) return Mt(e);
|
|
237
|
+
const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
|
|
238
|
+
for (const t in e.value) n[t] = Yt(() => ({
|
|
239
|
+
get() {
|
|
240
|
+
return e.value[t];
|
|
241
|
+
},
|
|
242
|
+
set(o) {
|
|
243
|
+
var a;
|
|
244
|
+
if (!((a = C(r.replaceRef)) !== null && a !== void 0) || a) if (Array.isArray(e.value)) {
|
|
245
|
+
const l = [...e.value];
|
|
246
|
+
l[t] = o, e.value = l;
|
|
247
|
+
} else {
|
|
248
|
+
const l = {
|
|
249
|
+
...e.value,
|
|
250
|
+
[t]: o
|
|
251
|
+
};
|
|
252
|
+
Object.setPrototypeOf(l, Object.getPrototypeOf(e.value)), e.value = l;
|
|
254
253
|
}
|
|
255
|
-
|
|
256
|
-
|
|
254
|
+
else e.value[t] = o;
|
|
255
|
+
}
|
|
256
|
+
}));
|
|
257
|
+
return n;
|
|
257
258
|
}
|
|
258
|
-
function
|
|
259
|
-
|
|
259
|
+
function Fn(e, r = !0, n) {
|
|
260
|
+
$n() ? te(e, n) : r ? e() : Ft(e);
|
|
260
261
|
}
|
|
261
|
-
function
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
function Mn(e, r, n) {
|
|
263
|
+
return ne(e, r, {
|
|
264
|
+
...n,
|
|
265
|
+
immediate: !0
|
|
266
|
+
});
|
|
265
267
|
}
|
|
266
|
-
const
|
|
267
|
-
function
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
() =>
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
)
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
268
|
+
const $e = pt ? window : void 0;
|
|
269
|
+
function K(e) {
|
|
270
|
+
var r;
|
|
271
|
+
const n = C(e);
|
|
272
|
+
return (r = n?.$el) !== null && r !== void 0 ? r : n;
|
|
273
|
+
}
|
|
274
|
+
function je(...e) {
|
|
275
|
+
const r = (t, o, a, l) => (t.addEventListener(o, a, l), () => t.removeEventListener(o, a, l)), n = L(() => {
|
|
276
|
+
const t = ge(C(e[0])).filter((o) => o != null);
|
|
277
|
+
return t.every((o) => typeof o != "string") ? t : void 0;
|
|
278
|
+
});
|
|
279
|
+
return Mn(() => {
|
|
280
|
+
var t, o;
|
|
281
|
+
return [
|
|
282
|
+
(t = (o = n.value) === null || o === void 0 ? void 0 : o.map((a) => K(a))) !== null && t !== void 0 ? t : [$e].filter((a) => a != null),
|
|
283
|
+
ge(C(n.value ? e[1] : e[0])),
|
|
284
|
+
ge(Dt(n.value ? e[2] : e[1])),
|
|
285
|
+
C(n.value ? e[3] : e[2])
|
|
286
|
+
];
|
|
287
|
+
}, ([t, o, a, l], d, s) => {
|
|
288
|
+
if (!t?.length || !o?.length || !a?.length) return;
|
|
289
|
+
const i = On(l) ? { ...l } : l, u = t.flatMap((c) => o.flatMap((h) => a.map((m) => r(c, h, m, i))));
|
|
290
|
+
s(() => {
|
|
291
|
+
u.forEach((c) => c());
|
|
292
|
+
});
|
|
293
|
+
}, { flush: "post" });
|
|
289
294
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
295
|
+
// @__NO_SIDE_EFFECTS__
|
|
296
|
+
function Yn() {
|
|
297
|
+
const e = A(!1), r = ee();
|
|
298
|
+
return r && te(() => {
|
|
293
299
|
e.value = !0;
|
|
294
|
-
},
|
|
300
|
+
}, r), e;
|
|
295
301
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
302
|
+
// @__NO_SIDE_EFFECTS__
|
|
303
|
+
function Ln(e) {
|
|
304
|
+
const r = /* @__PURE__ */ Yn();
|
|
305
|
+
return L(() => (r.value, !!e()));
|
|
299
306
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
} =
|
|
316
|
-
(
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
},
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
307
|
+
const ve = {
|
|
308
|
+
speed: 2,
|
|
309
|
+
margin: 30,
|
|
310
|
+
direction: "both"
|
|
311
|
+
};
|
|
312
|
+
function Tn(e) {
|
|
313
|
+
e.scrollLeft > e.scrollWidth - e.clientWidth && (e.scrollLeft = Math.max(0, e.scrollWidth - e.clientWidth)), e.scrollTop > e.scrollHeight - e.clientHeight && (e.scrollTop = Math.max(0, e.scrollHeight - e.clientHeight));
|
|
314
|
+
}
|
|
315
|
+
function Dn(e, r = {}) {
|
|
316
|
+
var n, t, o, a;
|
|
317
|
+
const { pointerTypes: l, preventDefault: d, stopPropagation: s, exact: i, onMove: u, onEnd: c, onStart: h, initialValue: m, axis: f = "both", draggingElement: x = $e, containerElement: v, handle: F = e, buttons: Y = [0], restrictInView: I, autoScroll: P = !1 } = r, R = D((n = C(m)) !== null && n !== void 0 ? n : {
|
|
318
|
+
x: 0,
|
|
319
|
+
y: 0
|
|
320
|
+
}), N = D(), V = (y) => l ? l.includes(y.pointerType) : !0, b = (y) => {
|
|
321
|
+
C(d) && y.preventDefault(), C(s) && y.stopPropagation();
|
|
322
|
+
}, _ = C(P), j = typeof _ == "object" ? {
|
|
323
|
+
speed: (t = C(_.speed)) !== null && t !== void 0 ? t : ve.speed,
|
|
324
|
+
margin: (o = C(_.margin)) !== null && o !== void 0 ? o : ve.margin,
|
|
325
|
+
direction: (a = _.direction) !== null && a !== void 0 ? a : ve.direction
|
|
326
|
+
} : ve, H = (y) => typeof y == "number" ? [y, y] : [y.x, y.y], ce = (y, w, S) => {
|
|
327
|
+
const { clientWidth: M, clientHeight: $, scrollLeft: B, scrollTop: pe, scrollWidth: Te, scrollHeight: vt } = y, [Qe, Xe] = H(j.margin), [Ze, Ke] = H(j.speed);
|
|
328
|
+
let me = 0, he = 0;
|
|
329
|
+
(j.direction === "x" || j.direction === "both") && (S.x < Qe && B > 0 ? me = -Ze : S.x + w.width > M - Qe && B < Te - M && (me = Ze)), (j.direction === "y" || j.direction === "both") && (S.y < Xe && pe > 0 ? he = -Ke : S.y + w.height > $ - Xe && pe < vt - $ && (he = Ke)), (me || he) && y.scrollBy({
|
|
330
|
+
left: me,
|
|
331
|
+
top: he,
|
|
332
|
+
behavior: "auto"
|
|
333
|
+
});
|
|
334
|
+
};
|
|
335
|
+
let G = null;
|
|
336
|
+
const Me = () => {
|
|
337
|
+
const y = C(v);
|
|
338
|
+
y && !G && (G = setInterval(() => {
|
|
339
|
+
const w = C(e).getBoundingClientRect(), { x: S, y: M } = R.value, $ = {
|
|
340
|
+
x: S - y.scrollLeft,
|
|
341
|
+
y: M - y.scrollTop
|
|
342
|
+
};
|
|
343
|
+
$.x >= 0 && $.y >= 0 && (ce(y, w, $), $.x += y.scrollLeft, $.y += y.scrollTop, R.value = $);
|
|
344
|
+
}, 1e3 / 60));
|
|
345
|
+
}, de = () => {
|
|
346
|
+
G && (clearInterval(G), G = null);
|
|
347
|
+
}, Ye = (y, w, S, M) => {
|
|
348
|
+
const [$, B] = typeof S == "number" ? [S, S] : [S.x, S.y], { clientWidth: pe, clientHeight: Te } = w;
|
|
349
|
+
return y.x < $ || y.x + M.width > pe - $ || y.y < B || y.y + M.height > Te - B;
|
|
350
|
+
}, Le = () => {
|
|
351
|
+
if (C(r.disabled) || !N.value) return;
|
|
352
|
+
const y = C(v);
|
|
353
|
+
if (!y) return;
|
|
354
|
+
const w = C(e).getBoundingClientRect(), { x: S, y: M } = R.value;
|
|
355
|
+
Ye({
|
|
356
|
+
x: S - y.scrollLeft,
|
|
357
|
+
y: M - y.scrollTop
|
|
358
|
+
}, y, j.margin, w) ? Me() : de();
|
|
359
|
+
};
|
|
360
|
+
C(P) && ne(R, Le);
|
|
361
|
+
const fe = (y) => {
|
|
362
|
+
var w;
|
|
363
|
+
if (!C(Y).includes(y.button) || C(r.disabled) || !V(y) || C(i) && y.target !== C(e)) return;
|
|
364
|
+
const S = C(v), M = S == null || (w = S.getBoundingClientRect) === null || w === void 0 ? void 0 : w.call(S), $ = C(e).getBoundingClientRect(), B = {
|
|
365
|
+
x: y.clientX - (S ? $.left - M.left + (P ? 0 : S.scrollLeft) : $.left),
|
|
366
|
+
y: y.clientY - (S ? $.top - M.top + (P ? 0 : S.scrollTop) : $.top)
|
|
326
367
|
};
|
|
327
|
-
(
|
|
328
|
-
},
|
|
329
|
-
if (
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
368
|
+
h?.(B, y) !== !1 && (N.value = B, b(y));
|
|
369
|
+
}, g = (y) => {
|
|
370
|
+
if (C(r.disabled) || !V(y) || !N.value) return;
|
|
371
|
+
const w = C(v);
|
|
372
|
+
w instanceof HTMLElement && Tn(w);
|
|
373
|
+
const S = C(e).getBoundingClientRect();
|
|
374
|
+
let { x: M, y: $ } = R.value;
|
|
375
|
+
if ((f === "x" || f === "both") && (M = y.clientX - N.value.x, w && (M = Math.min(Math.max(0, M), w.scrollWidth - S.width))), (f === "y" || f === "both") && ($ = y.clientY - N.value.y, w && ($ = Math.min(Math.max(0, $), w.scrollHeight - S.height))), C(P) && w && (G === null && ce(w, S, {
|
|
376
|
+
x: M,
|
|
377
|
+
y: $
|
|
378
|
+
}), M += w.scrollLeft, $ += w.scrollTop), w && (I || P)) {
|
|
379
|
+
if (f !== "y") {
|
|
380
|
+
const B = M - w.scrollLeft;
|
|
381
|
+
B < 0 ? M = w.scrollLeft : B > w.clientWidth - S.width && (M = w.clientWidth - S.width + w.scrollLeft);
|
|
382
|
+
}
|
|
383
|
+
if (f !== "x") {
|
|
384
|
+
const B = $ - w.scrollTop;
|
|
385
|
+
B < 0 ? $ = w.scrollTop : B > w.clientHeight - S.height && ($ = w.clientHeight - S.height + w.scrollTop);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
R.value = {
|
|
389
|
+
x: M,
|
|
390
|
+
y: $
|
|
391
|
+
}, u?.(R.value, y), b(y);
|
|
392
|
+
}, E = (y) => {
|
|
393
|
+
C(r.disabled) || !V(y) || N.value && (N.value = void 0, P && de(), c?.(R.value, y), b(y));
|
|
339
394
|
};
|
|
340
|
-
if (
|
|
341
|
-
const
|
|
342
|
-
|
|
395
|
+
if (pt) {
|
|
396
|
+
const y = () => {
|
|
397
|
+
var w;
|
|
398
|
+
return {
|
|
399
|
+
capture: (w = r.capture) !== null && w !== void 0 ? w : !0,
|
|
400
|
+
passive: !C(d)
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
je(F, "pointerdown", fe, y), je(x, "pointermove", g, y), je(x, "pointerup", E, y);
|
|
343
404
|
}
|
|
344
405
|
return {
|
|
345
|
-
...
|
|
346
|
-
position:
|
|
347
|
-
isDragging:
|
|
348
|
-
style:
|
|
349
|
-
|
|
350
|
-
|
|
406
|
+
..._n(R),
|
|
407
|
+
position: R,
|
|
408
|
+
isDragging: L(() => !!N.value),
|
|
409
|
+
style: L(() => `
|
|
410
|
+
left: ${R.value.x}px;
|
|
411
|
+
top: ${R.value.y}px;
|
|
412
|
+
${P ? "text-wrap: nowrap;" : ""}
|
|
413
|
+
`)
|
|
351
414
|
};
|
|
352
415
|
}
|
|
353
|
-
function
|
|
354
|
-
const { window: t =
|
|
355
|
-
let
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
},
|
|
359
|
-
|
|
360
|
-
(
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
416
|
+
function Rn(e, r, n = {}) {
|
|
417
|
+
const { window: t = $e, ...o } = n;
|
|
418
|
+
let a;
|
|
419
|
+
const l = /* @__PURE__ */ Ln(() => t && "ResizeObserver" in t), d = () => {
|
|
420
|
+
a && (a.disconnect(), a = void 0);
|
|
421
|
+
}, s = ne(L(() => {
|
|
422
|
+
const u = C(e);
|
|
423
|
+
return Array.isArray(u) ? u.map((c) => K(c)) : [K(u)];
|
|
424
|
+
}), (u) => {
|
|
425
|
+
if (d(), l.value && t) {
|
|
426
|
+
a = new ResizeObserver(r);
|
|
427
|
+
for (const c of u) c && a.observe(c, o);
|
|
428
|
+
}
|
|
429
|
+
}, {
|
|
430
|
+
immediate: !0,
|
|
431
|
+
flush: "post"
|
|
432
|
+
}), i = () => {
|
|
433
|
+
d(), s();
|
|
370
434
|
};
|
|
371
|
-
return
|
|
372
|
-
isSupported:
|
|
373
|
-
stop:
|
|
435
|
+
return Cn(i), {
|
|
436
|
+
isSupported: l,
|
|
437
|
+
stop: i
|
|
374
438
|
};
|
|
375
439
|
}
|
|
376
|
-
function
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
(
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
)
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
s && (a.value = "offsetWidth" in s ? s.offsetWidth : n.width, i.value = "offsetHeight" in s ? s.offsetHeight : n.height);
|
|
440
|
+
function re(e, r = {
|
|
441
|
+
width: 0,
|
|
442
|
+
height: 0
|
|
443
|
+
}, n = {}) {
|
|
444
|
+
const { window: t = $e, box: o = "content-box" } = n, a = L(() => {
|
|
445
|
+
var c;
|
|
446
|
+
return (c = K(e)) === null || c === void 0 || (c = c.namespaceURI) === null || c === void 0 ? void 0 : c.includes("svg");
|
|
447
|
+
}), l = A(r.width), d = A(r.height), { stop: s } = Rn(e, ([c]) => {
|
|
448
|
+
const h = o === "border-box" ? c.borderBoxSize : o === "content-box" ? c.contentBoxSize : c.devicePixelContentBoxSize;
|
|
449
|
+
if (t && a.value) {
|
|
450
|
+
const m = K(e);
|
|
451
|
+
if (m) {
|
|
452
|
+
const f = m.getBoundingClientRect();
|
|
453
|
+
l.value = f.width, d.value = f.height;
|
|
454
|
+
}
|
|
455
|
+
} else if (h) {
|
|
456
|
+
const m = ge(h);
|
|
457
|
+
l.value = m.reduce((f, { inlineSize: x }) => f + x, 0), d.value = m.reduce((f, { blockSize: x }) => f + x, 0);
|
|
458
|
+
} else
|
|
459
|
+
l.value = c.contentRect.width, d.value = c.contentRect.height;
|
|
460
|
+
}, n);
|
|
461
|
+
Fn(() => {
|
|
462
|
+
const c = K(e);
|
|
463
|
+
c && (l.value = "offsetWidth" in c ? c.offsetWidth : r.width, d.value = "offsetHeight" in c ? c.offsetHeight : r.height);
|
|
401
464
|
});
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
);
|
|
408
|
-
function o() {
|
|
409
|
-
v(), c();
|
|
465
|
+
const i = ne(() => K(e), (c) => {
|
|
466
|
+
l.value = c ? r.width : 0, d.value = c ? r.height : 0;
|
|
467
|
+
});
|
|
468
|
+
function u() {
|
|
469
|
+
s(), i();
|
|
410
470
|
}
|
|
411
471
|
return {
|
|
412
|
-
width:
|
|
413
|
-
height:
|
|
414
|
-
stop:
|
|
472
|
+
width: l,
|
|
473
|
+
height: d,
|
|
474
|
+
stop: u
|
|
415
475
|
};
|
|
416
476
|
}
|
|
417
|
-
const
|
|
477
|
+
const Ue = /* @__PURE__ */ Symbol("__MODAL__"), In = { class: "title text-16px font-bold" }, Pn = { class: "action" }, jn = ["form"], En = {
|
|
418
478
|
key: 2,
|
|
419
479
|
class: "modal-loading"
|
|
420
|
-
},
|
|
421
|
-
/* @__PURE__ */ C("div"),
|
|
422
|
-
/* @__PURE__ */ C("div"),
|
|
423
|
-
/* @__PURE__ */ C("div"),
|
|
424
|
-
/* @__PURE__ */ C("div")
|
|
425
|
-
], -1)), xr = [
|
|
426
|
-
wr
|
|
427
|
-
], Cr = {
|
|
480
|
+
}, zn = {
|
|
428
481
|
name: "ModalContainer",
|
|
429
482
|
inheritAttrs: !1
|
|
430
|
-
},
|
|
431
|
-
...
|
|
483
|
+
}, Nn = /* @__PURE__ */ U({
|
|
484
|
+
...zn,
|
|
432
485
|
props: {
|
|
433
486
|
id: {},
|
|
434
487
|
form: {},
|
|
@@ -461,160 +514,185 @@ const yr = (e) => (Ve("data-v-37f80068"), e = e(), Be(), e), pr = { class: "titl
|
|
|
461
514
|
onCancel: {}
|
|
462
515
|
},
|
|
463
516
|
emits: ["submit"],
|
|
464
|
-
setup(e, { expose:
|
|
465
|
-
|
|
466
|
-
|
|
517
|
+
setup(e, { expose: r, emit: n }) {
|
|
518
|
+
Ct((g) => ({
|
|
519
|
+
v4586ed24: g.zIndex
|
|
467
520
|
}));
|
|
468
|
-
const t = e,
|
|
469
|
-
let
|
|
470
|
-
const
|
|
521
|
+
const t = e, o = n, a = Ve(Ue), l = D(!1);
|
|
522
|
+
let d = 0, s = 0;
|
|
523
|
+
const i = A(), u = A(), c = A(), h = A(), m = A(), f = A(), { height: x } = re(
|
|
524
|
+
i
|
|
525
|
+
), { height: v } = re(
|
|
526
|
+
c,
|
|
527
|
+
void 0,
|
|
528
|
+
{ box: "border-box" }
|
|
529
|
+
), { height: F } = re(
|
|
530
|
+
h,
|
|
531
|
+
void 0,
|
|
532
|
+
{ box: "border-box" }
|
|
533
|
+
), { height: Y } = re(
|
|
534
|
+
m
|
|
535
|
+
), { height: I } = re(
|
|
536
|
+
f
|
|
537
|
+
), { x: P, y: R } = Dn(c, {
|
|
471
538
|
initialValue: { x: 0, y: 0 }
|
|
472
539
|
});
|
|
473
540
|
function N() {
|
|
474
|
-
|
|
541
|
+
a?.close(t.id);
|
|
475
542
|
}
|
|
476
|
-
function
|
|
477
|
-
return typeof
|
|
543
|
+
function V(g) {
|
|
544
|
+
return typeof g == "number" ? `${g}px` : g;
|
|
478
545
|
}
|
|
479
|
-
const
|
|
480
|
-
const
|
|
481
|
-
return t.mode === "dialog" && (
|
|
546
|
+
const b = L(() => {
|
|
547
|
+
const g = {};
|
|
548
|
+
return t.mode === "dialog" && (g.justifyContent = "center"), t.mode === "drawer" && (g.justifyContent = {
|
|
482
549
|
left: "flex-start",
|
|
483
550
|
right: "flex-end",
|
|
484
551
|
top: "flex-start",
|
|
485
552
|
bottom: "flex-end"
|
|
486
|
-
}[t.position],
|
|
553
|
+
}[t.position], g.flexDirection = {
|
|
487
554
|
left: "row",
|
|
488
555
|
right: "row",
|
|
489
556
|
top: "column",
|
|
490
557
|
bottom: "column"
|
|
491
|
-
}[t.position]),
|
|
492
|
-
}),
|
|
493
|
-
const
|
|
494
|
-
return t.mode === "drawer" && ["top", "bottom"].includes(t.position) ?
|
|
495
|
-
}),
|
|
496
|
-
const
|
|
497
|
-
return t.draggable && !t.fullscreen && t.mode === "dialog" && (
|
|
498
|
-
}),
|
|
499
|
-
const
|
|
500
|
-
|
|
558
|
+
}[t.position]), g;
|
|
559
|
+
}), _ = L(() => {
|
|
560
|
+
const g = {};
|
|
561
|
+
return t.mode === "drawer" && ["top", "bottom"].includes(t.position) ? g.maxHeight = V(t.maxHeight) : (g.width = V(t.sizes[t.size]), g.maxWidth = V(t.maxWidth)), t.width && (g.width = V(t.width)), t.height && (g.height = V(t.height)), t.fullscreen && (g.maxWidth = "unset", g.width = "100%", g.position = "fixed", g.top = 0, g.left = 0, g.bottom = 0, g.right = 0, g.borderRadius = 0), t.draggable && !t.fullscreen && t.mode === "dialog" && (g.transform = `translate3d(${P.value - d}px, ${R.value - s}px, 0px)`), t.mode === "drawer" && (g.borderRadius = 0, ["left", "right"].includes(t.position) ? g.height = "100%" : g.width = "100%"), t.offset && t.mode === "dialog" && (g.marginLeft = `${t.offset.x || 0}px`, g.marginTop = `${t.offset.y || 0}px`), t.backgroundColor && (g.backgroundColor = t.backgroundColor), g;
|
|
562
|
+
}), j = L(() => {
|
|
563
|
+
const g = {};
|
|
564
|
+
return t.draggable && !t.fullscreen && t.mode === "dialog" && (g.cursor = "move"), g;
|
|
565
|
+
}), H = L(() => {
|
|
566
|
+
const g = {}, E = Y.value + I.value + v.value + F.value, y = Math.floor(
|
|
567
|
+
x.value * (Number(V(t.maxHeight).replace("%", "")) / 100)
|
|
568
|
+
);
|
|
569
|
+
return t.maxHeight && (g.maxHeight = `${y - E}px`), t.mode === "drawer" && (g.maxHeight = "unset", ["left", "right"].includes(t.position) && (g.height = `${x.value - E}px`)), t.fullscreen && (g.maxHeight = "unset", g.height = `calc(100% - ${E}px)`), t.type !== "component" && (g.padding = "0"), t.bodyStyle && Object.assign(g, t.bodyStyle), g;
|
|
501
570
|
});
|
|
502
|
-
function
|
|
503
|
-
const
|
|
504
|
-
if (t.form &&
|
|
505
|
-
const
|
|
506
|
-
|
|
571
|
+
function ce() {
|
|
572
|
+
const g = u.value;
|
|
573
|
+
if (t.form && g) {
|
|
574
|
+
const E = g.querySelector(
|
|
575
|
+
`form[name="${t.form}"]`
|
|
576
|
+
);
|
|
577
|
+
E && E.dispatchEvent(new Event("submit"));
|
|
507
578
|
}
|
|
508
579
|
t.onOk && t.onOk({
|
|
509
|
-
close: () =>
|
|
510
|
-
}),
|
|
580
|
+
close: () => a?.close(t.id)
|
|
581
|
+
}), o("submit");
|
|
511
582
|
}
|
|
512
|
-
function
|
|
513
|
-
|
|
583
|
+
function G() {
|
|
584
|
+
a?.close(t.id), t?.onCancel && t.onCancel();
|
|
514
585
|
}
|
|
515
|
-
function
|
|
586
|
+
function Me() {
|
|
516
587
|
window && window.addEventListener("resize", () => {
|
|
517
|
-
|
|
588
|
+
se(i), se(u), u.value && (d = u.value.offsetLeft, s = u.value.offsetTop);
|
|
518
589
|
});
|
|
519
590
|
}
|
|
520
|
-
function
|
|
591
|
+
function de() {
|
|
521
592
|
if (t.closeable && t.esc) {
|
|
522
|
-
const
|
|
523
|
-
|
|
593
|
+
const g = ({ key: E }) => {
|
|
594
|
+
E === "Escape" && (a?.close(t.id), window.removeEventListener("keydown", g));
|
|
524
595
|
};
|
|
525
|
-
window.addEventListener("keydown",
|
|
596
|
+
window.addEventListener("keydown", g);
|
|
526
597
|
}
|
|
527
598
|
}
|
|
528
|
-
function
|
|
529
|
-
|
|
599
|
+
function Ye() {
|
|
600
|
+
d = u.value.offsetLeft, s = u.value.offsetTop;
|
|
530
601
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}),
|
|
602
|
+
te(() => {
|
|
603
|
+
de(), Me();
|
|
604
|
+
}), St(() => {
|
|
534
605
|
});
|
|
535
|
-
function
|
|
536
|
-
return
|
|
606
|
+
function Le() {
|
|
607
|
+
return l.value = !0, () => fe();
|
|
537
608
|
}
|
|
538
|
-
function
|
|
539
|
-
|
|
609
|
+
function fe() {
|
|
610
|
+
l.value = !1;
|
|
540
611
|
}
|
|
541
|
-
return
|
|
542
|
-
showLoading:
|
|
543
|
-
hideLoading:
|
|
544
|
-
}), (
|
|
612
|
+
return r({
|
|
613
|
+
showLoading: Le,
|
|
614
|
+
hideLoading: fe
|
|
615
|
+
}), (g, E) => (T(), z("div", {
|
|
545
616
|
ref_key: "wrapperRef",
|
|
546
|
-
ref:
|
|
617
|
+
ref: i,
|
|
547
618
|
class: "modal-wrapper",
|
|
548
|
-
style:
|
|
549
|
-
onClick:
|
|
619
|
+
style: Q(b.value),
|
|
620
|
+
onClick: E[0] || (E[0] = Ot((y) => e.maskClosable && N(), ["self"]))
|
|
550
621
|
}, [
|
|
551
|
-
|
|
622
|
+
O("div", {
|
|
552
623
|
ref_key: "contentRef",
|
|
553
|
-
ref:
|
|
554
|
-
class:
|
|
555
|
-
style:
|
|
624
|
+
ref: u,
|
|
625
|
+
class: Oe(["modal-content", { [`${e.mode}-mode`]: !0, [`${e.position}-position`]: !0 }]),
|
|
626
|
+
style: Q(_.value)
|
|
556
627
|
}, [
|
|
557
|
-
|
|
628
|
+
e.header ? (T(), z("div", {
|
|
558
629
|
key: 0,
|
|
559
630
|
ref_key: "headerRef",
|
|
560
|
-
ref:
|
|
631
|
+
ref: c,
|
|
561
632
|
class: "modal-header",
|
|
562
|
-
style:
|
|
563
|
-
onMousedown:
|
|
633
|
+
style: Q(j.value),
|
|
634
|
+
onMousedown: Ye
|
|
564
635
|
}, [
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
636
|
+
O("div", In, X(e.title), 1),
|
|
637
|
+
O("div", Pn, [
|
|
638
|
+
e.closeable ? (T(), z("div", {
|
|
568
639
|
key: 0,
|
|
569
640
|
class: "i-icon-park-outline:close block cursor-pointer",
|
|
570
641
|
onClick: N
|
|
571
|
-
})) :
|
|
642
|
+
})) : J("", !0)
|
|
572
643
|
])
|
|
573
|
-
], 36)) :
|
|
574
|
-
|
|
644
|
+
], 36)) : J("", !0),
|
|
645
|
+
O("div", {
|
|
575
646
|
id: "modal-header-slot",
|
|
576
647
|
ref_key: "headerSlotRef",
|
|
577
648
|
ref: m
|
|
578
649
|
}, null, 512),
|
|
579
|
-
|
|
650
|
+
O("div", {
|
|
580
651
|
class: "modal-body",
|
|
581
|
-
style:
|
|
652
|
+
style: Q(H.value)
|
|
582
653
|
}, [
|
|
583
|
-
(
|
|
654
|
+
(T(), Se(dt(e.component), $t(_t(e.componentProps)), null, 16))
|
|
584
655
|
], 4),
|
|
585
|
-
|
|
656
|
+
O("div", {
|
|
586
657
|
id: "modal-footer-slot",
|
|
587
658
|
ref_key: "footerSlotRef",
|
|
588
|
-
ref:
|
|
659
|
+
ref: f
|
|
589
660
|
}, null, 512),
|
|
590
|
-
|
|
661
|
+
e.footer ? (T(), z("div", {
|
|
591
662
|
key: 1,
|
|
592
663
|
ref_key: "footerRef",
|
|
593
|
-
ref:
|
|
664
|
+
ref: h,
|
|
594
665
|
class: "modal-footer space-x-2"
|
|
595
666
|
}, [
|
|
596
|
-
|
|
667
|
+
O("button", {
|
|
597
668
|
class: "cancel-button",
|
|
598
669
|
type: "button",
|
|
599
|
-
onClick:
|
|
600
|
-
},
|
|
601
|
-
|
|
670
|
+
onClick: G
|
|
671
|
+
}, X(e.cancelText), 1),
|
|
672
|
+
O("button", {
|
|
602
673
|
class: "submit-button",
|
|
603
|
-
form:
|
|
674
|
+
form: e.form,
|
|
604
675
|
type: "submit",
|
|
605
|
-
onClick:
|
|
606
|
-
},
|
|
607
|
-
], 512)) :
|
|
608
|
-
|
|
676
|
+
onClick: ce
|
|
677
|
+
}, X(e.submitText), 9, jn)
|
|
678
|
+
], 512)) : J("", !0),
|
|
679
|
+
l.value ? (T(), z("div", En, [...E[1] || (E[1] = [
|
|
680
|
+
O("div", { class: "lds-ring" }, [
|
|
681
|
+
O("div"),
|
|
682
|
+
O("div"),
|
|
683
|
+
O("div"),
|
|
684
|
+
O("div")
|
|
685
|
+
], -1)
|
|
686
|
+
])])) : J("", !0)
|
|
609
687
|
], 6)
|
|
610
688
|
], 4));
|
|
611
689
|
}
|
|
612
|
-
}),
|
|
613
|
-
const
|
|
614
|
-
for (const [t,
|
|
615
|
-
|
|
616
|
-
return
|
|
617
|
-
},
|
|
690
|
+
}), _e = (e, r) => {
|
|
691
|
+
const n = e.__vccOpts || e;
|
|
692
|
+
for (const [t, o] of r)
|
|
693
|
+
n[t] = o;
|
|
694
|
+
return n;
|
|
695
|
+
}, Bn = /* @__PURE__ */ _e(Nn, [["__scopeId", "data-v-1d490f4f"]]), Vn = { class: "modal-dialog" }, qn = { class: "dialog-body" }, An = { class: "dialog-title" }, Wn = { class: "dialog-content" }, Hn = /* @__PURE__ */ U({
|
|
618
696
|
__name: "modal-dialog",
|
|
619
697
|
props: {
|
|
620
698
|
type: {},
|
|
@@ -627,70 +705,70 @@ const yr = (e) => (Ve("data-v-37f80068"), e = e(), Be(), e), pr = { class: "titl
|
|
|
627
705
|
footer: {}
|
|
628
706
|
},
|
|
629
707
|
setup(e) {
|
|
630
|
-
const
|
|
708
|
+
const r = e, n = mt(), t = L(() => r.title ? r.title : {
|
|
631
709
|
confirm: "提示",
|
|
632
710
|
info: "提示",
|
|
633
711
|
warning: "警告",
|
|
634
712
|
error: "错误",
|
|
635
713
|
success: "成功"
|
|
636
|
-
}[
|
|
637
|
-
async function
|
|
638
|
-
|
|
714
|
+
}[r.type]);
|
|
715
|
+
async function o() {
|
|
716
|
+
r.onOk && await r.onOk(), n.close();
|
|
639
717
|
}
|
|
640
|
-
async function
|
|
641
|
-
|
|
718
|
+
async function a() {
|
|
719
|
+
r.onCancel && await r.onCancel(), n.close();
|
|
642
720
|
}
|
|
643
|
-
return (
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
721
|
+
return (l, d) => (T(), z("section", Vn, [
|
|
722
|
+
O("div", qn, [
|
|
723
|
+
O("div", An, X(t.value), 1),
|
|
724
|
+
O("div", Wn, X(e.content), 1)
|
|
647
725
|
]),
|
|
648
|
-
|
|
726
|
+
O("div", {
|
|
649
727
|
class: "dialog-footer space-x-2",
|
|
650
|
-
style:
|
|
728
|
+
style: Q(e.type === "confirm" ? { "justify-content": "end" } : { "border-top": "none" })
|
|
651
729
|
}, [
|
|
652
|
-
|
|
653
|
-
|
|
730
|
+
e.footer ? (T(), Se(dt(e.footer), { key: 0 })) : (T(), z(Ce, { key: 1 }, [
|
|
731
|
+
O("button", {
|
|
654
732
|
class: "submit-button",
|
|
655
733
|
type: "button",
|
|
656
|
-
onClick:
|
|
657
|
-
},
|
|
658
|
-
|
|
734
|
+
onClick: o
|
|
735
|
+
}, X(e.okText), 1),
|
|
736
|
+
e.type === "confirm" ? (T(), z("button", {
|
|
659
737
|
key: 0,
|
|
660
738
|
class: "cancel-button",
|
|
661
739
|
type: "button",
|
|
662
|
-
onClick:
|
|
663
|
-
},
|
|
740
|
+
onClick: a
|
|
741
|
+
}, X(e.cancelText), 1)) : J("", !0)
|
|
664
742
|
], 64))
|
|
665
743
|
], 4)
|
|
666
744
|
]));
|
|
667
745
|
}
|
|
668
|
-
}),
|
|
669
|
-
/* @__PURE__ */ C("div", { class: "lds-ring" }, [
|
|
670
|
-
/* @__PURE__ */ C("div"),
|
|
671
|
-
/* @__PURE__ */ C("div"),
|
|
672
|
-
/* @__PURE__ */ C("div"),
|
|
673
|
-
/* @__PURE__ */ C("div")
|
|
674
|
-
])
|
|
675
|
-
], -1)), jr = { class: "modal-loading-text" }, Rr = /* @__PURE__ */ I({
|
|
746
|
+
}), Un = /* @__PURE__ */ _e(Hn, [["__scopeId", "data-v-f5ece095"]]), Gn = { class: "flex-center" }, Qn = { class: "modal-loading-text" }, Xn = /* @__PURE__ */ U({
|
|
676
747
|
__name: "modal-loading",
|
|
677
748
|
props: {
|
|
678
749
|
text: { default: "加载中" }
|
|
679
750
|
},
|
|
680
751
|
setup(e) {
|
|
681
|
-
return (
|
|
682
|
-
|
|
683
|
-
|
|
752
|
+
return (r, n) => (T(), z("section", Gn, [
|
|
753
|
+
n[0] || (n[0] = O("div", { class: "modal-loading" }, [
|
|
754
|
+
O("div", { class: "lds-ring" }, [
|
|
755
|
+
O("div"),
|
|
756
|
+
O("div"),
|
|
757
|
+
O("div"),
|
|
758
|
+
O("div")
|
|
759
|
+
])
|
|
760
|
+
], -1)),
|
|
761
|
+
O("div", Qn, X(e.text), 1)
|
|
684
762
|
]));
|
|
685
763
|
}
|
|
686
|
-
}),
|
|
764
|
+
}), Zn = /* @__PURE__ */ _e(Xn, [["__scopeId", "data-v-27aee8fa"]]), Kn = {
|
|
687
765
|
key: 0,
|
|
688
766
|
class: "modal-teleport"
|
|
689
|
-
},
|
|
767
|
+
}, Jn = {
|
|
690
768
|
name: "ModalProvider",
|
|
691
769
|
inheritAttrs: !1
|
|
692
|
-
},
|
|
693
|
-
...
|
|
770
|
+
}, er = /* @__PURE__ */ U({
|
|
771
|
+
...Jn,
|
|
694
772
|
props: {
|
|
695
773
|
appendToBody: { type: [Boolean, String], default: !1 },
|
|
696
774
|
sizes: { default: () => ({
|
|
@@ -702,170 +780,172 @@ const yr = (e) => (Ve("data-v-37f80068"), e = e(), Be(), e), pr = { class: "titl
|
|
|
702
780
|
maxHeight: { default: "90%" },
|
|
703
781
|
offset: { default: () => ({ x: 0, y: 0 }) }
|
|
704
782
|
},
|
|
705
|
-
setup(e, { expose:
|
|
706
|
-
const
|
|
707
|
-
function
|
|
708
|
-
const
|
|
709
|
-
() => Promise.resolve(typeof
|
|
783
|
+
setup(e, { expose: r }) {
|
|
784
|
+
const n = A([]), t = D(!1), o = ee();
|
|
785
|
+
function a(h, m = {}, f = {}) {
|
|
786
|
+
const x = xt(
|
|
787
|
+
() => Promise.resolve(typeof h == "string" ? Un : h)
|
|
710
788
|
);
|
|
711
|
-
typeof
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
789
|
+
typeof h == "string" && (m.type = h, f.size = "small", f.fullscreen = !1, f.mode = "dialog", f.footer = !1, f.header = !1);
|
|
790
|
+
const v = Math.random().toString(32).slice(2), F = Object.assign(
|
|
791
|
+
{
|
|
792
|
+
zIndex: typeof h == "string" ? 1100 : 1e3
|
|
793
|
+
},
|
|
794
|
+
f
|
|
795
|
+
), Y = new Promise((I, P) => {
|
|
796
|
+
n.value.push({
|
|
797
|
+
id: v,
|
|
798
|
+
component: x,
|
|
718
799
|
props: m || {},
|
|
719
800
|
options: {
|
|
720
|
-
...
|
|
721
|
-
type: typeof
|
|
801
|
+
...F,
|
|
802
|
+
type: typeof h == "string" ? h : "component"
|
|
722
803
|
},
|
|
723
|
-
resolve:
|
|
724
|
-
reject:
|
|
804
|
+
resolve: I,
|
|
805
|
+
reject: P,
|
|
725
806
|
listeners: []
|
|
726
|
-
}),
|
|
727
|
-
}).catch((
|
|
728
|
-
}) : Promise.reject(
|
|
729
|
-
return Object.assign(
|
|
730
|
-
close: () =>
|
|
807
|
+
}), se(n);
|
|
808
|
+
}).catch((I) => I === "CANCEL" ? new Promise(() => {
|
|
809
|
+
}) : Promise.reject(I));
|
|
810
|
+
return Object.assign(Y, {
|
|
811
|
+
close: () => l(v)
|
|
731
812
|
});
|
|
732
813
|
}
|
|
733
|
-
function
|
|
734
|
-
const
|
|
735
|
-
if (
|
|
814
|
+
function l(h, m) {
|
|
815
|
+
const f = n.value.findIndex((v) => v.id === h);
|
|
816
|
+
if (f < 0)
|
|
736
817
|
return;
|
|
737
|
-
const
|
|
738
|
-
m === void 0 ?
|
|
818
|
+
const x = n.value[f];
|
|
819
|
+
m === void 0 ? x?.reject("CANCEL") : x?.resolve(m), n.value.splice(f, 1), se(n);
|
|
739
820
|
}
|
|
740
|
-
function
|
|
741
|
-
!
|
|
742
|
-
|
|
743
|
-
}),
|
|
821
|
+
function d() {
|
|
822
|
+
!n.value || n.value.length === 0 || (n.value.forEach((h) => {
|
|
823
|
+
h?.reject("CANCEL");
|
|
824
|
+
}), n.value = [], se(n));
|
|
744
825
|
}
|
|
745
|
-
function
|
|
746
|
-
const
|
|
747
|
-
if (!
|
|
826
|
+
function s(h, m) {
|
|
827
|
+
const f = n.value.find((v) => v.id === h);
|
|
828
|
+
if (!f)
|
|
748
829
|
return;
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
open:
|
|
752
|
-
close: (
|
|
753
|
-
closeAll:
|
|
754
|
-
showLoading: () =>
|
|
755
|
-
hideLoading: () =>
|
|
756
|
-
confirm: (
|
|
757
|
-
success: (
|
|
758
|
-
error: (
|
|
759
|
-
warning: (
|
|
760
|
-
info: (
|
|
830
|
+
const x = f.listeners.find((v) => v.event === m);
|
|
831
|
+
x && x.callback({
|
|
832
|
+
open: a,
|
|
833
|
+
close: (v) => l(f.id, v),
|
|
834
|
+
closeAll: d,
|
|
835
|
+
showLoading: () => i(f.id),
|
|
836
|
+
hideLoading: () => u(f.id),
|
|
837
|
+
confirm: (v) => a("confirm", v),
|
|
838
|
+
success: (v) => a("success", v),
|
|
839
|
+
error: (v) => a("error", v),
|
|
840
|
+
warning: (v) => a("warning", v),
|
|
841
|
+
info: (v) => a("info", v)
|
|
761
842
|
});
|
|
762
843
|
}
|
|
763
|
-
function
|
|
764
|
-
if (!
|
|
844
|
+
function i(h, m) {
|
|
845
|
+
if (!o)
|
|
765
846
|
return;
|
|
766
|
-
const [
|
|
767
|
-
if (
|
|
768
|
-
return
|
|
847
|
+
const [f] = o.refs[`modal-container_${h}`] || [];
|
|
848
|
+
if (f)
|
|
849
|
+
return f.showLoading();
|
|
769
850
|
{
|
|
770
|
-
const { close:
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
header: !1,
|
|
775
|
-
closeable: !1,
|
|
776
|
-
backgroundColor: "transparent"
|
|
777
|
-
});
|
|
778
|
-
return m != null && m.duration && setTimeout(
|
|
779
|
-
() => {
|
|
780
|
-
k();
|
|
851
|
+
const { close: x } = a(
|
|
852
|
+
Zn,
|
|
853
|
+
{
|
|
854
|
+
text: m?.text
|
|
781
855
|
},
|
|
782
|
-
|
|
783
|
-
|
|
856
|
+
{
|
|
857
|
+
footer: !1,
|
|
858
|
+
header: !1,
|
|
859
|
+
closeable: !1,
|
|
860
|
+
backgroundColor: "transparent"
|
|
861
|
+
}
|
|
862
|
+
);
|
|
863
|
+
return m?.duration && setTimeout(() => {
|
|
864
|
+
x();
|
|
865
|
+
}, m?.duration), x;
|
|
784
866
|
}
|
|
785
867
|
}
|
|
786
|
-
function
|
|
787
|
-
if (!
|
|
868
|
+
function u(h) {
|
|
869
|
+
if (!o)
|
|
788
870
|
return;
|
|
789
|
-
const [m] =
|
|
871
|
+
const [m] = o.refs[`modal-container_${h}`];
|
|
790
872
|
if (m)
|
|
791
873
|
return m.hideLoading();
|
|
792
874
|
}
|
|
793
|
-
function
|
|
794
|
-
const
|
|
795
|
-
|
|
875
|
+
function c(h, m, f) {
|
|
876
|
+
const x = n.value.find((v) => v.id === h);
|
|
877
|
+
x && x.listeners.push({
|
|
796
878
|
event: m,
|
|
797
|
-
callback:
|
|
879
|
+
callback: f
|
|
798
880
|
});
|
|
799
881
|
}
|
|
800
|
-
return
|
|
801
|
-
open:
|
|
802
|
-
close:
|
|
803
|
-
closeAll:
|
|
804
|
-
addEventListener:
|
|
805
|
-
showLoading:
|
|
806
|
-
hideLoading:
|
|
807
|
-
}),
|
|
808
|
-
elements:
|
|
809
|
-
open:
|
|
810
|
-
close:
|
|
811
|
-
closeAll:
|
|
812
|
-
}),
|
|
882
|
+
return ze(Ue, {
|
|
883
|
+
open: a,
|
|
884
|
+
close: l,
|
|
885
|
+
closeAll: d,
|
|
886
|
+
addEventListener: c,
|
|
887
|
+
showLoading: i,
|
|
888
|
+
hideLoading: u
|
|
889
|
+
}), r({
|
|
890
|
+
elements: n,
|
|
891
|
+
open: a,
|
|
892
|
+
close: l,
|
|
893
|
+
closeAll: d
|
|
894
|
+
}), te(() => {
|
|
813
895
|
t.value = !0;
|
|
814
|
-
}), (
|
|
815
|
-
|
|
816
|
-
t.value ? (
|
|
817
|
-
(
|
|
818
|
-
disabled: !
|
|
819
|
-
to: typeof
|
|
896
|
+
}), (h, m) => (T(), z(Ce, null, [
|
|
897
|
+
yt(h.$slots, "default", {}, void 0, !0),
|
|
898
|
+
t.value ? (T(), z("div", Kn, [
|
|
899
|
+
(T(), Se(gt, {
|
|
900
|
+
disabled: !e.appendToBody,
|
|
901
|
+
to: typeof e.appendToBody == "string" ? e.appendToBody : "body"
|
|
820
902
|
}, [
|
|
821
|
-
|
|
822
|
-
default:
|
|
823
|
-
(
|
|
824
|
-
id:
|
|
825
|
-
key:
|
|
903
|
+
p(bt, { name: "modal-fade" }, {
|
|
904
|
+
default: kt(() => [
|
|
905
|
+
(T(!0), z(Ce, null, wt(n.value, (f) => (T(), Se(Bn, Z({
|
|
906
|
+
id: f.id,
|
|
907
|
+
key: f.id,
|
|
826
908
|
ref_for: !0,
|
|
827
|
-
ref: `modal-container_${
|
|
828
|
-
component:
|
|
829
|
-
"component-props":
|
|
830
|
-
"max-height":
|
|
831
|
-
"max-width":
|
|
832
|
-
offset:
|
|
833
|
-
sizes:
|
|
834
|
-
},
|
|
835
|
-
onSubmit: () =>
|
|
909
|
+
ref: `modal-container_${f.id}`,
|
|
910
|
+
component: f.component,
|
|
911
|
+
"component-props": f.props,
|
|
912
|
+
"max-height": e.maxHeight,
|
|
913
|
+
"max-width": e.maxWidth,
|
|
914
|
+
offset: e.offset,
|
|
915
|
+
sizes: e.sizes
|
|
916
|
+
}, { ref_for: !0 }, f.options, {
|
|
917
|
+
onSubmit: () => s(f.id, "submit")
|
|
836
918
|
}), null, 16, ["id", "component", "component-props", "max-height", "max-width", "offset", "sizes", "onSubmit"]))), 128))
|
|
837
919
|
]),
|
|
838
920
|
_: 1
|
|
839
921
|
})
|
|
840
922
|
], 8, ["disabled", "to"]))
|
|
841
|
-
])) :
|
|
923
|
+
])) : J("", !0)
|
|
842
924
|
], 64));
|
|
843
925
|
}
|
|
844
|
-
}),
|
|
845
|
-
function
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
return ((t = l == null ? void 0 : l.type) == null ? void 0 : t.name) === n ? l : null;
|
|
926
|
+
}), tr = /* @__PURE__ */ _e(er, [["__scopeId", "data-v-d74e77f1"]]);
|
|
927
|
+
function Ee(e, r) {
|
|
928
|
+
let n = e?.parent;
|
|
929
|
+
for (; n && n?.type?.name !== r; )
|
|
930
|
+
n = n.parent;
|
|
931
|
+
return n?.type?.name === r ? n : null;
|
|
851
932
|
}
|
|
852
|
-
function
|
|
853
|
-
const e =
|
|
854
|
-
function
|
|
933
|
+
function mt() {
|
|
934
|
+
const e = Ve(Ue), r = ee();
|
|
935
|
+
function n(t, o, a) {
|
|
855
936
|
if (!e)
|
|
856
937
|
throw new Error("Not Found Modal Provider Component");
|
|
857
|
-
return e.open(t,
|
|
938
|
+
return e.open(t, o, a);
|
|
858
939
|
}
|
|
859
940
|
return {
|
|
860
|
-
open:
|
|
941
|
+
open: n,
|
|
861
942
|
close(t) {
|
|
862
|
-
var l;
|
|
863
943
|
if (!e)
|
|
864
944
|
throw new Error("Not Found Modal Provider Component");
|
|
865
|
-
const
|
|
866
|
-
if (!
|
|
945
|
+
const o = Ee(r, "ModalContainer")?.props?.id;
|
|
946
|
+
if (!o)
|
|
867
947
|
throw new Error("Not Found Current Modal Container");
|
|
868
|
-
e.close(
|
|
948
|
+
e.close(o, t);
|
|
869
949
|
},
|
|
870
950
|
closeAll() {
|
|
871
951
|
if (!e)
|
|
@@ -873,18 +953,16 @@ function He() {
|
|
|
873
953
|
e.closeAll();
|
|
874
954
|
},
|
|
875
955
|
showLoading(t) {
|
|
876
|
-
var l;
|
|
877
956
|
if (!e)
|
|
878
957
|
throw new Error("Not Found Modal Provider Component");
|
|
879
|
-
const
|
|
880
|
-
return e.showLoading(
|
|
958
|
+
const o = Ee(r, "ModalContainer")?.props?.id;
|
|
959
|
+
return e.showLoading(o, t);
|
|
881
960
|
},
|
|
882
961
|
hideLoading() {
|
|
883
|
-
var t;
|
|
884
962
|
if (!e)
|
|
885
963
|
throw new Error("Not Found Modal Provider Component");
|
|
886
|
-
const
|
|
887
|
-
return e.hideLoading(
|
|
964
|
+
const t = Ee(r, "ModalContainer")?.props?.id;
|
|
965
|
+
return e.hideLoading(t);
|
|
888
966
|
},
|
|
889
967
|
confirm(t) {
|
|
890
968
|
return this.open("confirm", t);
|
|
@@ -903,365 +981,236 @@ function He() {
|
|
|
903
981
|
}
|
|
904
982
|
};
|
|
905
983
|
}
|
|
906
|
-
const
|
|
907
|
-
id: Symbol("ID"),
|
|
908
|
-
source: Symbol("Source")
|
|
984
|
+
const nt = {
|
|
985
|
+
id: /* @__PURE__ */ Symbol("ID"),
|
|
986
|
+
source: /* @__PURE__ */ Symbol("Source")
|
|
909
987
|
};
|
|
910
|
-
function
|
|
911
|
-
const
|
|
912
|
-
return e
|
|
913
|
-
let
|
|
914
|
-
|
|
915
|
-
}), [
|
|
916
|
-
|
|
988
|
+
function nr(e, r) {
|
|
989
|
+
const n = D({});
|
|
990
|
+
return e?.forEach((o) => {
|
|
991
|
+
let a = null;
|
|
992
|
+
o.default && (a = (typeof o.default == "function" ? o.default() : o.default) || null), r && r[o.key] !== void 0 && (a = r[o.key]), n.value[o.key] = a;
|
|
993
|
+
}), [n, (o) => {
|
|
994
|
+
n.value = o;
|
|
917
995
|
}];
|
|
918
996
|
}
|
|
919
|
-
|
|
920
|
-
function
|
|
921
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
997
|
+
function rr(e) {
|
|
998
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qe(e);
|
|
922
999
|
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1000
|
+
const or = /* @__PURE__ */ U({
|
|
1001
|
+
props: {
|
|
1002
|
+
form: {
|
|
1003
|
+
type: Object,
|
|
1004
|
+
required: !0
|
|
1005
|
+
},
|
|
1006
|
+
value: {
|
|
1007
|
+
type: Object
|
|
1008
|
+
},
|
|
1009
|
+
columns: {
|
|
1010
|
+
type: Number,
|
|
1011
|
+
default: 2
|
|
932
1012
|
}
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
past: "%s前",
|
|
960
|
-
s: "几秒",
|
|
961
|
-
m: "1 分钟",
|
|
962
|
-
mm: "%d 分钟",
|
|
963
|
-
h: "1 小时",
|
|
964
|
-
hh: "%d 小时",
|
|
965
|
-
d: "1 天",
|
|
966
|
-
dd: "%d 天",
|
|
967
|
-
M: "1 个月",
|
|
968
|
-
MM: "%d 个月",
|
|
969
|
-
y: "1 年",
|
|
970
|
-
yy: "%d 年"
|
|
1013
|
+
},
|
|
1014
|
+
setup(e) {
|
|
1015
|
+
const r = mt(), n = e.form.map((s) => ({
|
|
1016
|
+
...s,
|
|
1017
|
+
collapsed: !1
|
|
1018
|
+
})), t = Array.from(new Set(n.map((s) => s.group).flat().filter(Boolean))), o = n.reduce((s, i) => ((i.group ? [i.group].flat() : ["默认"]).forEach((u) => {
|
|
1019
|
+
let c = s.find((h) => h.group === u);
|
|
1020
|
+
c || (c = {
|
|
1021
|
+
group: u,
|
|
1022
|
+
instance: void 0,
|
|
1023
|
+
form: []
|
|
1024
|
+
}, s.push(c)), c.form.push(i);
|
|
1025
|
+
}), s), []).sort((s, i) => s.group === "默认" ? -1 : i.group === "默认" ? 1 : s.group > i.group ? -1 : 1), a = D("默认");
|
|
1026
|
+
return {
|
|
1027
|
+
formItems: n,
|
|
1028
|
+
groups: t,
|
|
1029
|
+
groupForms: o,
|
|
1030
|
+
activeTab: a,
|
|
1031
|
+
onSubmit: () => {
|
|
1032
|
+
const s = o.find((i) => i.group === a.value);
|
|
1033
|
+
if (s && s.instance) {
|
|
1034
|
+
const i = s.instance.formSource;
|
|
1035
|
+
s.instance.validate().then((u) => {
|
|
1036
|
+
u || r.close(i);
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
971
1039
|
},
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1040
|
+
onReset: () => {
|
|
1041
|
+
const s = o.find((i) => i.group === a.value);
|
|
1042
|
+
s && s.instance && s.instance.reset();
|
|
975
1043
|
}
|
|
976
1044
|
};
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
(
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
const Hr = /* @__PURE__ */ $e(Wr);
|
|
1036
|
-
b.extend(qr);
|
|
1037
|
-
b.extend(Hr);
|
|
1038
|
-
b.locale("zh-cn", {
|
|
1039
|
-
weekStart: 1
|
|
1040
|
-
});
|
|
1041
|
-
function Gr(e) {
|
|
1042
|
-
function n(r, t) {
|
|
1043
|
-
return e != null && e.disabledDate ? e.disabledDate(r, t) : !1;
|
|
1045
|
+
},
|
|
1046
|
+
render() {
|
|
1047
|
+
const e = this.groupForms.find((r) => r.group === this.activeTab);
|
|
1048
|
+
if (this.groups.length) {
|
|
1049
|
+
let r;
|
|
1050
|
+
return p(It, {
|
|
1051
|
+
"active-key": this.activeTab,
|
|
1052
|
+
"onUpdate:active-key": (n) => this.activeTab = n
|
|
1053
|
+
}, rr(r = this.groupForms.map((n) => p(Pt, {
|
|
1054
|
+
title: n.group,
|
|
1055
|
+
key: n.group
|
|
1056
|
+
}, {
|
|
1057
|
+
default: () => [p(Be, {
|
|
1058
|
+
columns: this.columns,
|
|
1059
|
+
form: n.form,
|
|
1060
|
+
value: this.value,
|
|
1061
|
+
ref: (t) => n.instance = t
|
|
1062
|
+
}, null), p(et, null, null), p("div", {
|
|
1063
|
+
class: "flex items-center justify-between space-x-2"
|
|
1064
|
+
}, [p(W, {
|
|
1065
|
+
type: "secondary",
|
|
1066
|
+
size: "large",
|
|
1067
|
+
onClick: this.onReset
|
|
1068
|
+
}, {
|
|
1069
|
+
default: () => [q("重置")]
|
|
1070
|
+
}), p(W, {
|
|
1071
|
+
class: "w-100px",
|
|
1072
|
+
type: "primary",
|
|
1073
|
+
size: "large",
|
|
1074
|
+
onClick: this.onSubmit
|
|
1075
|
+
}, {
|
|
1076
|
+
default: () => [q("搜索")]
|
|
1077
|
+
})])]
|
|
1078
|
+
}))) ? r : {
|
|
1079
|
+
default: () => [r]
|
|
1080
|
+
});
|
|
1081
|
+
} else
|
|
1082
|
+
return p(Ce, null, [p(Be, {
|
|
1083
|
+
columns: this.columns,
|
|
1084
|
+
form: this.formItems,
|
|
1085
|
+
value: this.value,
|
|
1086
|
+
ref: (r) => e.instance = r
|
|
1087
|
+
}, null), p(et, null, null), p("div", {
|
|
1088
|
+
class: "flex items-center justify-between space-x-2"
|
|
1089
|
+
}, [p(W, {
|
|
1090
|
+
type: "secondary",
|
|
1091
|
+
size: "large",
|
|
1092
|
+
onClick: this.onReset
|
|
1093
|
+
}, {
|
|
1094
|
+
default: () => [q("重置")]
|
|
1095
|
+
}), p(W, {
|
|
1096
|
+
class: "w-100px",
|
|
1097
|
+
type: "primary",
|
|
1098
|
+
size: "large",
|
|
1099
|
+
onClick: this.onSubmit
|
|
1100
|
+
}, {
|
|
1101
|
+
default: () => [q("搜索")]
|
|
1102
|
+
})])]);
|
|
1044
1103
|
}
|
|
1045
|
-
|
|
1046
|
-
function l() {
|
|
1047
|
-
const a = r[t.key];
|
|
1048
|
-
switch (e == null ? void 0 : e.type) {
|
|
1049
|
-
case "week":
|
|
1050
|
-
return f("span", null, [`${b(a).format("YYYY年")}${b(a).week()}周`]);
|
|
1051
|
-
case "month":
|
|
1052
|
-
return f("span", null, [b(a).format("YYYY年MM月")]);
|
|
1053
|
-
case "quarter":
|
|
1054
|
-
return f("span", null, [`${b(a).format("YYYY年")}${b(a).quarter()}季度`]);
|
|
1055
|
-
case "year":
|
|
1056
|
-
return f("span", null, [b(a).format("YYYY年")]);
|
|
1057
|
-
case "date":
|
|
1058
|
-
default:
|
|
1059
|
-
return f("span", null, [b(a).format(e != null && e.showTime ? "YYYY年MM月DD日 HH:mm:ss" : "YYYY年MM月DD日")]);
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
function u() {
|
|
1063
|
-
switch (e == null ? void 0 : e.type) {
|
|
1064
|
-
case "week":
|
|
1065
|
-
return f(Ct, {
|
|
1066
|
-
"day-start-of-week": 1,
|
|
1067
|
-
modelValue: r[t.key],
|
|
1068
|
-
"onUpdate:modelValue": (a) => r[t.key] = a,
|
|
1069
|
-
"disabled-date": n,
|
|
1070
|
-
format: e == null ? void 0 : e.labelFormat,
|
|
1071
|
-
"value-format": e == null ? void 0 : e.valueFormat
|
|
1072
|
-
}, null);
|
|
1073
|
-
case "month":
|
|
1074
|
-
return f(xt, {
|
|
1075
|
-
modelValue: r[t.key],
|
|
1076
|
-
"onUpdate:modelValue": (a) => r[t.key] = a,
|
|
1077
|
-
"disabled-date": n,
|
|
1078
|
-
format: e == null ? void 0 : e.labelFormat,
|
|
1079
|
-
"value-format": e == null ? void 0 : e.valueFormat
|
|
1080
|
-
}, null);
|
|
1081
|
-
case "quarter":
|
|
1082
|
-
return f(wt, {
|
|
1083
|
-
modelValue: r[t.key],
|
|
1084
|
-
"onUpdate:modelValue": (a) => r[t.key] = a,
|
|
1085
|
-
"disabled-date": n,
|
|
1086
|
-
format: e == null ? void 0 : e.labelFormat,
|
|
1087
|
-
"value-format": e == null ? void 0 : e.valueFormat
|
|
1088
|
-
}, null);
|
|
1089
|
-
case "year":
|
|
1090
|
-
return f(kt, {
|
|
1091
|
-
modelValue: r[t.key],
|
|
1092
|
-
"onUpdate:modelValue": (a) => r[t.key] = a,
|
|
1093
|
-
"disabled-date": n,
|
|
1094
|
-
format: e == null ? void 0 : e.labelFormat,
|
|
1095
|
-
"value-format": e == null ? void 0 : e.valueFormat
|
|
1096
|
-
}, null);
|
|
1097
|
-
case "date":
|
|
1098
|
-
default:
|
|
1099
|
-
return f(bt, we({
|
|
1100
|
-
"disabled-input": !0,
|
|
1101
|
-
modelValue: r[t.key],
|
|
1102
|
-
"onUpdate:modelValue": (a) => r[t.key] = a,
|
|
1103
|
-
"disabled-date": n,
|
|
1104
|
-
format: e == null ? void 0 : e.labelFormat,
|
|
1105
|
-
"value-format": e == null ? void 0 : e.valueFormat,
|
|
1106
|
-
"show-time": e == null ? void 0 : e.showTime
|
|
1107
|
-
}, {
|
|
1108
|
-
shortcuts: e == null ? void 0 : e.shortcuts
|
|
1109
|
-
}), null);
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
switch (t.mode) {
|
|
1113
|
-
case "text":
|
|
1114
|
-
return l();
|
|
1115
|
-
case "component":
|
|
1116
|
-
default:
|
|
1117
|
-
return u();
|
|
1118
|
-
}
|
|
1119
|
-
};
|
|
1120
|
-
}
|
|
1121
|
-
function Pe(e) {
|
|
1122
|
-
return typeof e == "function" ? e() : Ae(e);
|
|
1123
|
-
}
|
|
1104
|
+
});
|
|
1124
1105
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
1125
|
-
const
|
|
1106
|
+
const rt = () => {
|
|
1126
1107
|
};
|
|
1127
|
-
function
|
|
1128
|
-
function
|
|
1129
|
-
return new Promise((
|
|
1130
|
-
Promise.resolve(e(() =>
|
|
1108
|
+
function lr(e, r) {
|
|
1109
|
+
function n(...t) {
|
|
1110
|
+
return new Promise((o, a) => {
|
|
1111
|
+
Promise.resolve(e(() => r.apply(this, t), {
|
|
1112
|
+
fn: r,
|
|
1113
|
+
thisArg: this,
|
|
1114
|
+
args: t
|
|
1115
|
+
})).then(o).catch(a);
|
|
1131
1116
|
});
|
|
1132
1117
|
}
|
|
1133
|
-
return
|
|
1118
|
+
return n;
|
|
1134
1119
|
}
|
|
1135
|
-
function
|
|
1136
|
-
let
|
|
1137
|
-
const
|
|
1138
|
-
clearTimeout(
|
|
1120
|
+
function ar(e, r = {}) {
|
|
1121
|
+
let n, t, o = rt;
|
|
1122
|
+
const a = (s) => {
|
|
1123
|
+
clearTimeout(s), o(), o = rt;
|
|
1139
1124
|
};
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1125
|
+
let l;
|
|
1126
|
+
return (s) => {
|
|
1127
|
+
const i = C(e), u = C(r.maxWait);
|
|
1128
|
+
return n && a(n), i <= 0 || u !== void 0 && u <= 0 ? (t && (a(t), t = void 0), Promise.resolve(s())) : new Promise((c, h) => {
|
|
1129
|
+
o = r.rejectOnCancel ? h : c, l = s, u && !t && (t = setTimeout(() => {
|
|
1130
|
+
n && a(n), t = void 0, c(l());
|
|
1131
|
+
}, u)), n = setTimeout(() => {
|
|
1132
|
+
t && a(t), t = void 0, c(s());
|
|
1133
|
+
}, i);
|
|
1148
1134
|
});
|
|
1149
1135
|
};
|
|
1150
1136
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
e
|
|
1155
|
-
);
|
|
1137
|
+
// @__NO_SIDE_EFFECTS__
|
|
1138
|
+
function ur(e, r = 200, n = {}) {
|
|
1139
|
+
return lr(ar(r, n), e);
|
|
1156
1140
|
}
|
|
1157
|
-
function
|
|
1158
|
-
|
|
1159
|
-
|
|
1141
|
+
function Fe(e, r, n) {
|
|
1142
|
+
return ne(e, r, {
|
|
1143
|
+
...n,
|
|
1144
|
+
once: !0
|
|
1145
|
+
});
|
|
1160
1146
|
}
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
function l() {
|
|
1168
|
-
return f("span", null, [r[t.key]]);
|
|
1169
|
-
}
|
|
1170
|
-
function u() {
|
|
1171
|
-
if (!(e != null && e.autoSubmit))
|
|
1147
|
+
function ht(e) {
|
|
1148
|
+
let r = !1;
|
|
1149
|
+
const n = [], t = (o) => {
|
|
1150
|
+
if (!r) {
|
|
1151
|
+
if (n.push(o), o[e.valueProp] === e.key) {
|
|
1152
|
+
r = !0;
|
|
1172
1153
|
return;
|
|
1173
|
-
let i = n;
|
|
1174
|
-
for (; i && i.$el.tagName !== "FORM"; )
|
|
1175
|
-
i = i.$parent;
|
|
1176
|
-
if (i && i.$el) {
|
|
1177
|
-
const v = i.$el;
|
|
1178
|
-
Qr(v);
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
function a() {
|
|
1182
|
-
switch (e == null ? void 0 : e.type) {
|
|
1183
|
-
case "number":
|
|
1184
|
-
return f(Ue, {
|
|
1185
|
-
ref: (i) => n = i,
|
|
1186
|
-
modelValue: r[t.key],
|
|
1187
|
-
"onUpdate:modelValue": (i) => r[t.key] = i,
|
|
1188
|
-
hideButton: !0,
|
|
1189
|
-
"read-only": e == null ? void 0 : e.readonly,
|
|
1190
|
-
placeholder: e == null ? void 0 : e.placeholder,
|
|
1191
|
-
onInput: u,
|
|
1192
|
-
onClear: () => u(),
|
|
1193
|
-
allowClear: e == null ? void 0 : e.clearable
|
|
1194
|
-
}, null);
|
|
1195
|
-
case "string":
|
|
1196
|
-
default:
|
|
1197
|
-
return f(St, {
|
|
1198
|
-
ref: (i) => n = i,
|
|
1199
|
-
modelValue: r[t.key],
|
|
1200
|
-
"onUpdate:modelValue": (i) => r[t.key] = i,
|
|
1201
|
-
placeholder: e == null ? void 0 : e.placeholder,
|
|
1202
|
-
readonly: e == null ? void 0 : e.readonly,
|
|
1203
|
-
onInput: u,
|
|
1204
|
-
onClear: () => u(),
|
|
1205
|
-
allowClear: e == null ? void 0 : e.clearable
|
|
1206
|
-
}, null);
|
|
1207
1154
|
}
|
|
1208
|
-
|
|
1209
|
-
switch (t.mode) {
|
|
1210
|
-
case "text":
|
|
1211
|
-
return l();
|
|
1212
|
-
case "component":
|
|
1213
|
-
default:
|
|
1214
|
-
return a();
|
|
1155
|
+
o.children?.length && o.children.forEach(t), r || n.pop();
|
|
1215
1156
|
}
|
|
1216
1157
|
};
|
|
1158
|
+
return e.data.forEach(t), n;
|
|
1217
1159
|
}
|
|
1218
|
-
function
|
|
1219
|
-
|
|
1160
|
+
function sr(e) {
|
|
1161
|
+
let r = e.data;
|
|
1162
|
+
const n = [];
|
|
1163
|
+
return e.path.forEach((t) => {
|
|
1164
|
+
const o = r.find((a) => a[e.valueProp] === t);
|
|
1165
|
+
o && n.push(o), o && o.children?.length && (r = o.children);
|
|
1166
|
+
}), n;
|
|
1220
1167
|
}
|
|
1221
|
-
const
|
|
1222
|
-
function
|
|
1223
|
-
const e =
|
|
1224
|
-
return [e, (
|
|
1168
|
+
const oe = /* @__PURE__ */ new WeakMap();
|
|
1169
|
+
function ir() {
|
|
1170
|
+
const e = D([]);
|
|
1171
|
+
return [e, (n) => e.value = n];
|
|
1225
1172
|
}
|
|
1226
|
-
function
|
|
1227
|
-
let
|
|
1228
|
-
const [t,
|
|
1229
|
-
if (
|
|
1173
|
+
function cr(e) {
|
|
1174
|
+
let r, n = !1;
|
|
1175
|
+
const [t, o] = ir(), a = () => {
|
|
1176
|
+
if (!e.autoSubmit || !r)
|
|
1230
1177
|
return;
|
|
1231
|
-
let
|
|
1232
|
-
for (;
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
},
|
|
1236
|
-
const
|
|
1237
|
-
|
|
1238
|
-
},
|
|
1239
|
-
const
|
|
1240
|
-
switch (typeof
|
|
1178
|
+
let i = r;
|
|
1179
|
+
for (; i && i.$el.tagName !== "FORM"; )
|
|
1180
|
+
i = i.$parent;
|
|
1181
|
+
i && i.$el && i.$el.dispatchEvent(new Event("submit"));
|
|
1182
|
+
}, l = (i, u) => {
|
|
1183
|
+
const c = i();
|
|
1184
|
+
c instanceof Promise ? c.then(u) : u(c);
|
|
1185
|
+
}, d = async () => {
|
|
1186
|
+
const i = oe.get(e.options);
|
|
1187
|
+
switch (typeof i) {
|
|
1188
|
+
// 已经执行未返回
|
|
1241
1189
|
case "function":
|
|
1242
|
-
|
|
1190
|
+
oe.set(e.options, o);
|
|
1243
1191
|
return;
|
|
1192
|
+
// 已经执行已返回
|
|
1244
1193
|
case "object":
|
|
1245
|
-
|
|
1194
|
+
o(i);
|
|
1246
1195
|
return;
|
|
1247
1196
|
}
|
|
1248
|
-
|
|
1249
|
-
const
|
|
1250
|
-
|
|
1197
|
+
oe.set(e.options, o), l(e.options, (u) => {
|
|
1198
|
+
const c = oe.get(e.options);
|
|
1199
|
+
oe.set(e.options, u), c(u);
|
|
1251
1200
|
});
|
|
1252
|
-
},
|
|
1253
|
-
|
|
1254
|
-
|
|
1201
|
+
}, s = () => {
|
|
1202
|
+
l(e.options, (i) => {
|
|
1203
|
+
o(i);
|
|
1255
1204
|
});
|
|
1256
1205
|
};
|
|
1257
1206
|
switch (!0) {
|
|
1258
|
-
case e.options
|
|
1259
|
-
e.cache !== !1 ?
|
|
1207
|
+
case typeof e.options == "function": {
|
|
1208
|
+
e.cache !== !1 ? d() : s();
|
|
1260
1209
|
break;
|
|
1261
1210
|
}
|
|
1262
|
-
case
|
|
1263
|
-
|
|
1264
|
-
|
|
1211
|
+
case ie(e.options): {
|
|
1212
|
+
Fe(() => e.options, () => {
|
|
1213
|
+
o(e.options.value);
|
|
1265
1214
|
}, {
|
|
1266
1215
|
immediate: !0
|
|
1267
1216
|
});
|
|
@@ -1270,320 +1219,589 @@ function rn(e) {
|
|
|
1270
1219
|
default:
|
|
1271
1220
|
t.value = e.options;
|
|
1272
1221
|
}
|
|
1273
|
-
return (
|
|
1274
|
-
e.default && !
|
|
1275
|
-
function
|
|
1276
|
-
const m =
|
|
1277
|
-
|
|
1222
|
+
return (i, u) => {
|
|
1223
|
+
e.default && !n && (i[u.key] = e.default, n = !0);
|
|
1224
|
+
function c() {
|
|
1225
|
+
const m = i[u.key], f = (v) => ht({
|
|
1226
|
+
data: t.value,
|
|
1227
|
+
valueProp: "value",
|
|
1228
|
+
key: v
|
|
1229
|
+
}).map((Y) => Y.label).join("/"), x = (v) => sr({
|
|
1230
|
+
data: t.value,
|
|
1231
|
+
valueProp: "value",
|
|
1232
|
+
path: v
|
|
1233
|
+
}).map((Y) => Y.label).join("/");
|
|
1234
|
+
switch (!0) {
|
|
1235
|
+
case (!e.pathMode && !e.multiple): {
|
|
1236
|
+
const v = f(m);
|
|
1237
|
+
return p("span", null, [v]);
|
|
1238
|
+
}
|
|
1239
|
+
case (!e.pathMode && e.multiple): {
|
|
1240
|
+
const v = m.map((F) => f(F));
|
|
1241
|
+
return p("span", null, [v.join(", ")]);
|
|
1242
|
+
}
|
|
1243
|
+
case (e.pathMode && !e.multiple): {
|
|
1244
|
+
const v = x(m);
|
|
1245
|
+
return p("span", null, [v]);
|
|
1246
|
+
}
|
|
1247
|
+
case (e.pathMode && e.multiple): {
|
|
1248
|
+
const v = m.map((F) => x(F));
|
|
1249
|
+
return p("span", null, [v.join(", ")]);
|
|
1250
|
+
}
|
|
1251
|
+
default:
|
|
1252
|
+
return p("span", null, null);
|
|
1253
|
+
}
|
|
1278
1254
|
}
|
|
1279
|
-
function
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
ref: (
|
|
1255
|
+
function h() {
|
|
1256
|
+
return p(jt, {
|
|
1257
|
+
pathMode: e.pathMode,
|
|
1258
|
+
ref: (m) => r = m,
|
|
1283
1259
|
multiple: e.multiple,
|
|
1284
|
-
modelValue:
|
|
1285
|
-
"onUpdate:modelValue": (
|
|
1260
|
+
modelValue: i[u.key],
|
|
1261
|
+
"onUpdate:modelValue": (m) => i[u.key] = m,
|
|
1286
1262
|
placeholder: e.placeholder,
|
|
1287
1263
|
allowClear: e.clearable,
|
|
1288
1264
|
allowSearch: e.searchable,
|
|
1289
|
-
"allow-create": e.createable,
|
|
1290
1265
|
maxTagCount: e.maxTagCount ?? 2,
|
|
1291
|
-
onChange:
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
}, null))) ? m : {
|
|
1297
|
-
default: () => [m]
|
|
1298
|
-
});
|
|
1266
|
+
onChange: a,
|
|
1267
|
+
checkStrictly: e.checkStrictly,
|
|
1268
|
+
triggerProps: e.triggerProps,
|
|
1269
|
+
options: t.value
|
|
1270
|
+
}, null);
|
|
1299
1271
|
}
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1272
|
+
return u.mode === "text" ? c() : h();
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
const dr = {
|
|
1276
|
+
thousands: !0,
|
|
1277
|
+
inputUnit: "元",
|
|
1278
|
+
outputUnit: "元"
|
|
1279
|
+
}, ye = {
|
|
1280
|
+
分: 10 ** 0,
|
|
1281
|
+
元: 10 ** 2,
|
|
1282
|
+
万: 10 ** 4
|
|
1283
|
+
};
|
|
1284
|
+
function fr(e) {
|
|
1285
|
+
e = {
|
|
1286
|
+
...dr,
|
|
1287
|
+
...e || {}
|
|
1288
|
+
};
|
|
1289
|
+
const r = (l) => {
|
|
1290
|
+
if (l == null)
|
|
1291
|
+
return;
|
|
1292
|
+
if (e?.inputUnit === e?.outputUnit)
|
|
1293
|
+
return l;
|
|
1294
|
+
const d = ye[e.outputUnit] / ye[e.inputUnit];
|
|
1295
|
+
return Number.parseFloat((l * d).toFixed(10));
|
|
1296
|
+
}, n = (l) => {
|
|
1297
|
+
if (l == null)
|
|
1298
|
+
return;
|
|
1299
|
+
if (e?.inputUnit === e?.outputUnit)
|
|
1300
|
+
return l;
|
|
1301
|
+
const d = ye[e.inputUnit] / ye[e.outputUnit];
|
|
1302
|
+
return Number.parseFloat((l * d).toFixed(10));
|
|
1303
|
+
}, t = (l) => {
|
|
1304
|
+
const d = l.split(".");
|
|
1305
|
+
return d[0] = d[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), d.join(".");
|
|
1306
|
+
}, o = (l) => {
|
|
1307
|
+
const d = l;
|
|
1308
|
+
return e?.thousands ? t(d) : d;
|
|
1309
|
+
}, a = (l) => l.replace(/,/g, "");
|
|
1310
|
+
return (l, d) => {
|
|
1311
|
+
const s = D(r(l[d.key]));
|
|
1312
|
+
ne(s, (m) => {
|
|
1313
|
+
l[d.key] = n(m);
|
|
1314
|
+
});
|
|
1315
|
+
const i = e?.prefix && (() => typeof e?.prefix == "string" ? p("span", null, [e.prefix]) : e.prefix()), u = () => typeof e?.suffix == "string" ? p("span", null, [e.suffix]) : typeof e?.suffix == "function" ? e.suffix() : e?.inputUnit;
|
|
1316
|
+
function c() {
|
|
1317
|
+
return p("span", null, [o(s.value.toString()), u()]);
|
|
1318
|
+
}
|
|
1319
|
+
function h() {
|
|
1320
|
+
return p(ft, {
|
|
1321
|
+
modelValue: s.value,
|
|
1322
|
+
"onUpdate:modelValue": (m) => s.value = m,
|
|
1323
|
+
formatter: o,
|
|
1324
|
+
parser: a,
|
|
1325
|
+
precision: e?.precision,
|
|
1326
|
+
hideButton: !0,
|
|
1327
|
+
"read-only": e?.readonly,
|
|
1328
|
+
placeholder: e?.placeholder,
|
|
1329
|
+
allowClear: e?.clearable
|
|
1330
|
+
}, {
|
|
1331
|
+
prefix: i,
|
|
1332
|
+
suffix: u
|
|
1333
|
+
});
|
|
1306
1334
|
}
|
|
1335
|
+
return d.mode === "text" ? c() : h();
|
|
1307
1336
|
};
|
|
1308
1337
|
}
|
|
1309
|
-
function
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1338
|
+
function Ge(e) {
|
|
1339
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1340
|
+
}
|
|
1341
|
+
var be = { exports: {} }, pr = be.exports, ot;
|
|
1342
|
+
function mr() {
|
|
1343
|
+
return ot || (ot = 1, (function(e, r) {
|
|
1344
|
+
(function(n, t) {
|
|
1345
|
+
e.exports = t();
|
|
1346
|
+
})(pr, function() {
|
|
1347
|
+
var n = "month", t = "quarter";
|
|
1348
|
+
return function(o, a) {
|
|
1349
|
+
var l = a.prototype;
|
|
1350
|
+
l.quarter = function(i) {
|
|
1351
|
+
return this.$utils().u(i) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (i - 1));
|
|
1352
|
+
};
|
|
1353
|
+
var d = l.add;
|
|
1354
|
+
l.add = function(i, u) {
|
|
1355
|
+
return i = Number(i), this.$utils().p(u) === t ? this.add(3 * i, n) : d.bind(this)(i, u);
|
|
1356
|
+
};
|
|
1357
|
+
var s = l.startOf;
|
|
1358
|
+
l.startOf = function(i, u) {
|
|
1359
|
+
var c = this.$utils(), h = !!c.u(u) || u;
|
|
1360
|
+
if (c.p(i) === t) {
|
|
1361
|
+
var m = this.quarter() - 1;
|
|
1362
|
+
return h ? this.month(3 * m).startOf(n).startOf("day") : this.month(3 * m + 2).endOf(n).endOf("day");
|
|
1363
|
+
}
|
|
1364
|
+
return s.bind(this)(i, u);
|
|
1365
|
+
};
|
|
1366
|
+
};
|
|
1367
|
+
});
|
|
1368
|
+
})(be)), be.exports;
|
|
1369
|
+
}
|
|
1370
|
+
var hr = mr();
|
|
1371
|
+
const vr = /* @__PURE__ */ Ge(hr);
|
|
1372
|
+
var ke = { exports: {} }, yr = ke.exports, lt;
|
|
1373
|
+
function gr() {
|
|
1374
|
+
return lt || (lt = 1, (function(e, r) {
|
|
1375
|
+
(function(n, t) {
|
|
1376
|
+
e.exports = t();
|
|
1377
|
+
})(yr, function() {
|
|
1378
|
+
var n = "week", t = "year";
|
|
1379
|
+
return function(o, a, l) {
|
|
1380
|
+
var d = a.prototype;
|
|
1381
|
+
d.week = function(s) {
|
|
1382
|
+
if (s === void 0 && (s = null), s !== null) return this.add(7 * (s - this.week()), "day");
|
|
1383
|
+
var i = this.$locale().yearStart || 1;
|
|
1384
|
+
if (this.month() === 11 && this.date() > 25) {
|
|
1385
|
+
var u = l(this).startOf(t).add(1, t).date(i), c = l(this).endOf(n);
|
|
1386
|
+
if (u.isBefore(c)) return 1;
|
|
1387
|
+
}
|
|
1388
|
+
var h = l(this).startOf(t).date(i).startOf(n).subtract(1, "millisecond"), m = this.diff(h, n, !0);
|
|
1389
|
+
return m < 0 ? l(this).startOf("week").week() : Math.ceil(m);
|
|
1390
|
+
}, d.weeks = function(s) {
|
|
1391
|
+
return s === void 0 && (s = null), this.week(s);
|
|
1392
|
+
};
|
|
1393
|
+
};
|
|
1394
|
+
});
|
|
1395
|
+
})(ke)), ke.exports;
|
|
1396
|
+
}
|
|
1397
|
+
var br = gr();
|
|
1398
|
+
const kr = /* @__PURE__ */ Ge(br);
|
|
1399
|
+
var we = { exports: {} }, wr = we.exports, at;
|
|
1400
|
+
function xr() {
|
|
1401
|
+
return at || (at = 1, (function(e, r) {
|
|
1402
|
+
(function(n, t) {
|
|
1403
|
+
e.exports = t(k);
|
|
1404
|
+
})(wr, function(n) {
|
|
1405
|
+
function t(l) {
|
|
1406
|
+
return l && typeof l == "object" && "default" in l ? l : {
|
|
1407
|
+
default: l
|
|
1408
|
+
};
|
|
1409
|
+
}
|
|
1410
|
+
var o = t(n), a = {
|
|
1411
|
+
name: "zh-cn",
|
|
1412
|
+
weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
|
|
1413
|
+
weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
|
|
1414
|
+
weekdaysMin: "日_一_二_三_四_五_六".split("_"),
|
|
1415
|
+
months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
|
|
1416
|
+
monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
|
|
1417
|
+
ordinal: function(l, d) {
|
|
1418
|
+
return d === "W" ? l + "周" : l + "日";
|
|
1419
|
+
},
|
|
1420
|
+
weekStart: 1,
|
|
1421
|
+
yearStart: 4,
|
|
1422
|
+
formats: {
|
|
1423
|
+
LT: "HH:mm",
|
|
1424
|
+
LTS: "HH:mm:ss",
|
|
1425
|
+
L: "YYYY/MM/DD",
|
|
1426
|
+
LL: "YYYY年M月D日",
|
|
1427
|
+
LLL: "YYYY年M月D日Ah点mm分",
|
|
1428
|
+
LLLL: "YYYY年M月D日ddddAh点mm分",
|
|
1429
|
+
l: "YYYY/M/D",
|
|
1430
|
+
ll: "YYYY年M月D日",
|
|
1431
|
+
lll: "YYYY年M月D日 HH:mm",
|
|
1432
|
+
llll: "YYYY年M月D日dddd HH:mm"
|
|
1433
|
+
},
|
|
1434
|
+
relativeTime: {
|
|
1435
|
+
future: "%s内",
|
|
1436
|
+
past: "%s前",
|
|
1437
|
+
s: "几秒",
|
|
1438
|
+
m: "1 分钟",
|
|
1439
|
+
mm: "%d 分钟",
|
|
1440
|
+
h: "1 小时",
|
|
1441
|
+
hh: "%d 小时",
|
|
1442
|
+
d: "1 天",
|
|
1443
|
+
dd: "%d 天",
|
|
1444
|
+
M: "1 个月",
|
|
1445
|
+
MM: "%d 个月",
|
|
1446
|
+
y: "1 年",
|
|
1447
|
+
yy: "%d 年"
|
|
1448
|
+
},
|
|
1449
|
+
meridiem: function(l, d) {
|
|
1450
|
+
var s = 100 * l + d;
|
|
1451
|
+
return s < 600 ? "凌晨" : s < 900 ? "早上" : s < 1100 ? "上午" : s < 1300 ? "中午" : s < 1800 ? "下午" : "晚上";
|
|
1452
|
+
}
|
|
1453
|
+
};
|
|
1454
|
+
return o.default.locale(a, null, !0), a;
|
|
1455
|
+
});
|
|
1456
|
+
})(we)), we.exports;
|
|
1457
|
+
}
|
|
1458
|
+
xr();
|
|
1459
|
+
k.extend(kr);
|
|
1460
|
+
k.extend(vr);
|
|
1461
|
+
k.locale("zh-cn", {
|
|
1462
|
+
weekStart: 1
|
|
1463
|
+
});
|
|
1464
|
+
function Cr(e) {
|
|
1465
|
+
let r;
|
|
1466
|
+
function n(o, a) {
|
|
1467
|
+
return e?.disabledDate ? e.disabledDate(o, a) : !1;
|
|
1468
|
+
}
|
|
1469
|
+
function t(o) {
|
|
1470
|
+
if (e?.onChange && e?.onChange(o), !e?.autoSubmit || !r)
|
|
1313
1471
|
return;
|
|
1314
|
-
let
|
|
1315
|
-
for (;
|
|
1316
|
-
|
|
1317
|
-
|
|
1472
|
+
let a = r;
|
|
1473
|
+
for (; a && a.$el.tagName !== "FORM"; )
|
|
1474
|
+
a = a.$parent;
|
|
1475
|
+
a && a.$el && a.$el.dispatchEvent(new Event("submit"));
|
|
1318
1476
|
}
|
|
1319
|
-
return (
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
"
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
onChange: r
|
|
1335
|
-
}, null);
|
|
1477
|
+
return (o, a) => {
|
|
1478
|
+
function l() {
|
|
1479
|
+
const s = o[a.key];
|
|
1480
|
+
switch (e?.type) {
|
|
1481
|
+
case "week":
|
|
1482
|
+
return p("span", null, [`${k(s).format("YYYY年")}${k(s).week()}周`]);
|
|
1483
|
+
case "month":
|
|
1484
|
+
return p("span", null, [k(s).format("YYYY年MM月")]);
|
|
1485
|
+
case "quarter":
|
|
1486
|
+
return p("span", null, [`${k(s).format("YYYY年")}${k(s).quarter()}季度`]);
|
|
1487
|
+
case "year":
|
|
1488
|
+
return p("span", null, [k(s).format("YYYY年")]);
|
|
1489
|
+
default:
|
|
1490
|
+
return p("span", null, [k(s).format(e?.showTime ? "YYYY年MM月DD日 HH:mm:ss" : "YYYY年MM月DD日")]);
|
|
1491
|
+
}
|
|
1336
1492
|
}
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1493
|
+
function d() {
|
|
1494
|
+
switch (e?.type) {
|
|
1495
|
+
case "week":
|
|
1496
|
+
return p(Vt, Z({
|
|
1497
|
+
ref: (s) => r = s,
|
|
1498
|
+
"day-start-of-week": 1,
|
|
1499
|
+
modelValue: o[a.key],
|
|
1500
|
+
"onUpdate:modelValue": (s) => o[a.key] = s,
|
|
1501
|
+
"disabled-date": n,
|
|
1502
|
+
format: e?.labelFormat,
|
|
1503
|
+
"value-format": e?.valueFormat
|
|
1504
|
+
}, {
|
|
1505
|
+
onChange: t
|
|
1506
|
+
}), null);
|
|
1507
|
+
case "month":
|
|
1508
|
+
return p(Bt, Z({
|
|
1509
|
+
ref: (s) => r = s,
|
|
1510
|
+
modelValue: o[a.key],
|
|
1511
|
+
"onUpdate:modelValue": (s) => o[a.key] = s,
|
|
1512
|
+
"disabled-date": n,
|
|
1513
|
+
format: e?.labelFormat,
|
|
1514
|
+
"value-format": e?.valueFormat
|
|
1515
|
+
}, {
|
|
1516
|
+
onChange: t
|
|
1517
|
+
}), null);
|
|
1518
|
+
case "quarter":
|
|
1519
|
+
return p(Nt, Z({
|
|
1520
|
+
ref: (s) => r = s,
|
|
1521
|
+
modelValue: o[a.key],
|
|
1522
|
+
"onUpdate:modelValue": (s) => o[a.key] = s,
|
|
1523
|
+
"disabled-date": n,
|
|
1524
|
+
format: e?.labelFormat,
|
|
1525
|
+
"value-format": e?.valueFormat
|
|
1526
|
+
}, {
|
|
1527
|
+
onChange: t
|
|
1528
|
+
}), null);
|
|
1529
|
+
case "year":
|
|
1530
|
+
return p(zt, Z({
|
|
1531
|
+
ref: (s) => r = s,
|
|
1532
|
+
modelValue: o[a.key],
|
|
1533
|
+
"onUpdate:modelValue": (s) => o[a.key] = s,
|
|
1534
|
+
"disabled-date": n,
|
|
1535
|
+
format: e?.labelFormat,
|
|
1536
|
+
"value-format": e?.valueFormat
|
|
1537
|
+
}, {
|
|
1538
|
+
onChange: t
|
|
1539
|
+
}), null);
|
|
1540
|
+
default:
|
|
1541
|
+
return p(Et, Z({
|
|
1542
|
+
ref: (s) => r = s,
|
|
1543
|
+
"disabled-input": !0,
|
|
1544
|
+
modelValue: o[a.key],
|
|
1545
|
+
"onUpdate:modelValue": (s) => o[a.key] = s,
|
|
1546
|
+
"disabled-date": n,
|
|
1547
|
+
format: e?.labelFormat,
|
|
1548
|
+
"value-format": e?.valueFormat,
|
|
1549
|
+
"show-time": e?.showTime
|
|
1550
|
+
}, {
|
|
1551
|
+
onChange: t
|
|
1552
|
+
}, {
|
|
1553
|
+
shortcuts: e?.shortcuts
|
|
1554
|
+
}), null);
|
|
1555
|
+
}
|
|
1343
1556
|
}
|
|
1557
|
+
return a.mode === "text" ? l() : d();
|
|
1344
1558
|
};
|
|
1345
1559
|
}
|
|
1346
|
-
var
|
|
1347
|
-
|
|
1348
|
-
(function(
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
return (
|
|
1356
|
-
|
|
1357
|
-
}),
|
|
1560
|
+
var xe = { exports: {} }, Sr = xe.exports, ut;
|
|
1561
|
+
function Or() {
|
|
1562
|
+
return ut || (ut = 1, (function(e, r) {
|
|
1563
|
+
(function(n, t) {
|
|
1564
|
+
e.exports = t();
|
|
1565
|
+
})(Sr, function() {
|
|
1566
|
+
return function(n, t, o) {
|
|
1567
|
+
o.updateLocale = function(a, l) {
|
|
1568
|
+
var d = o.Ls[a];
|
|
1569
|
+
if (d) return (l ? Object.keys(l) : []).forEach(function(s) {
|
|
1570
|
+
d[s] = l[s];
|
|
1571
|
+
}), d;
|
|
1572
|
+
};
|
|
1358
1573
|
};
|
|
1359
|
-
};
|
|
1360
|
-
});
|
|
1361
|
-
}
|
|
1362
|
-
var
|
|
1363
|
-
const
|
|
1364
|
-
function
|
|
1365
|
-
|
|
1366
|
-
|
|
1574
|
+
});
|
|
1575
|
+
})(xe)), xe.exports;
|
|
1576
|
+
}
|
|
1577
|
+
var $r = Or();
|
|
1578
|
+
const _r = /* @__PURE__ */ Ge($r);
|
|
1579
|
+
function Fr(e) {
|
|
1580
|
+
k.extend(_r);
|
|
1581
|
+
let r;
|
|
1582
|
+
const n = "YYYY-MM-DD HH:mm:ss", t = [{
|
|
1367
1583
|
label: "默认",
|
|
1368
1584
|
value: () => {
|
|
1369
|
-
const
|
|
1370
|
-
return [
|
|
1585
|
+
const a = k().startOf("month").toDate(), l = k().endOf("date").toDate();
|
|
1586
|
+
return [a, l];
|
|
1371
1587
|
}
|
|
1372
1588
|
}, {
|
|
1373
1589
|
label: "今天",
|
|
1374
1590
|
value: () => {
|
|
1375
|
-
const
|
|
1376
|
-
return [
|
|
1591
|
+
const a = k().startOf("date").toDate(), l = k().endOf("date").toDate();
|
|
1592
|
+
return [a, l];
|
|
1377
1593
|
}
|
|
1378
1594
|
}, {
|
|
1379
1595
|
label: "昨天",
|
|
1380
1596
|
value: () => {
|
|
1381
|
-
const
|
|
1382
|
-
return
|
|
1597
|
+
const a = k().subtract(1, "day").startOf("date").toDate(), l = k().subtract(1, "day").endOf("date").toDate();
|
|
1598
|
+
return [a, l];
|
|
1383
1599
|
}
|
|
1384
1600
|
}, {
|
|
1385
1601
|
label: "本周",
|
|
1386
1602
|
value: () => {
|
|
1387
|
-
|
|
1603
|
+
k.updateLocale("zh-cn", {
|
|
1388
1604
|
weekStart: 1
|
|
1389
1605
|
});
|
|
1390
|
-
const
|
|
1391
|
-
return [
|
|
1606
|
+
const a = k().startOf("week").toDate(), l = k().endOf("week").toDate();
|
|
1607
|
+
return [a, l];
|
|
1392
1608
|
}
|
|
1393
1609
|
}, {
|
|
1394
1610
|
label: "上周",
|
|
1395
1611
|
value: () => {
|
|
1396
|
-
|
|
1612
|
+
k.updateLocale("zh-cn", {
|
|
1397
1613
|
weekStart: 1
|
|
1398
1614
|
});
|
|
1399
|
-
const
|
|
1400
|
-
return [
|
|
1615
|
+
const a = k().subtract(1, "week").startOf("week").toDate(), l = k().subtract(1, "week").endOf("week").toDate();
|
|
1616
|
+
return [a, l];
|
|
1401
1617
|
}
|
|
1402
1618
|
}, {
|
|
1403
1619
|
label: "本月",
|
|
1404
1620
|
value: () => {
|
|
1405
|
-
const
|
|
1406
|
-
return [
|
|
1621
|
+
const a = k().startOf("month").toDate(), l = k().endOf("month").toDate();
|
|
1622
|
+
return [a, l];
|
|
1407
1623
|
}
|
|
1408
1624
|
}, {
|
|
1409
1625
|
label: "上月",
|
|
1410
1626
|
value: () => {
|
|
1411
|
-
const
|
|
1412
|
-
return [
|
|
1627
|
+
const a = k().subtract(1, "month").startOf("month").toDate(), l = k().subtract(1, "month").endOf("month").toDate();
|
|
1628
|
+
return [a, l];
|
|
1413
1629
|
}
|
|
1414
1630
|
}, {
|
|
1415
1631
|
label: "本年",
|
|
1416
1632
|
value: () => {
|
|
1417
|
-
const
|
|
1418
|
-
return [
|
|
1633
|
+
const a = k().startOf("year").toDate(), l = k().endOf("year").toDate();
|
|
1634
|
+
return [a, l];
|
|
1419
1635
|
}
|
|
1420
1636
|
}, {
|
|
1421
1637
|
label: "去年",
|
|
1422
1638
|
value: () => {
|
|
1423
|
-
const
|
|
1424
|
-
return [
|
|
1639
|
+
const a = k().subtract(1, "year").startOf("year").toDate(), l = k().subtract(1, "year").endOf("year").toDate();
|
|
1640
|
+
return [a, l];
|
|
1425
1641
|
}
|
|
1426
|
-
}]
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1642
|
+
}], o = (a) => {
|
|
1643
|
+
if (e?.onChange && e?.onChange(a), !e?.autoSubmit || !r)
|
|
1644
|
+
return;
|
|
1645
|
+
let l = r;
|
|
1646
|
+
for (; l && l.$el.tagName !== "FORM"; )
|
|
1647
|
+
l = l.$parent;
|
|
1648
|
+
l && l.$el && l.$el.dispatchEvent(new Event("submit"));
|
|
1649
|
+
};
|
|
1650
|
+
return (a, l) => {
|
|
1651
|
+
let d = [];
|
|
1652
|
+
function s(f) {
|
|
1653
|
+
d = f;
|
|
1654
|
+
}
|
|
1655
|
+
function i(f) {
|
|
1656
|
+
if (f && f.length === 2) {
|
|
1657
|
+
const [x, v] = f.sort(), F = k(x).startOf("days"), Y = k(v).endOf("days"), I = [F.format(e?.valueFormat || n), Y.format(e?.valueFormat || n)];
|
|
1658
|
+
a[l.key] = I, o(I);
|
|
1436
1659
|
}
|
|
1660
|
+
f === void 0 && o();
|
|
1437
1661
|
}
|
|
1438
|
-
function
|
|
1439
|
-
return e
|
|
1662
|
+
function u(f) {
|
|
1663
|
+
return e?.disabledDate ? e.disabledDate(d.filter(Boolean), f) : !1;
|
|
1440
1664
|
}
|
|
1441
1665
|
function c() {
|
|
1442
|
-
const
|
|
1443
|
-
switch (e
|
|
1666
|
+
const f = a[l.key], [x, v] = f, F = (Y) => {
|
|
1667
|
+
switch (e?.type) {
|
|
1444
1668
|
case "week":
|
|
1445
|
-
return
|
|
1669
|
+
return p("span", null, [`${k(Y).format("YYYY年")}${k(Y).week()}周`]);
|
|
1446
1670
|
case "month":
|
|
1447
|
-
return
|
|
1671
|
+
return p("span", null, [k(Y).format("YYYY年MM月")]);
|
|
1448
1672
|
case "quarter":
|
|
1449
|
-
return
|
|
1673
|
+
return p("span", null, [`${k(Y).format("YYYY年")}${k(Y).quarter()}季度`]);
|
|
1450
1674
|
case "year":
|
|
1451
|
-
return
|
|
1452
|
-
case "date":
|
|
1675
|
+
return p("span", null, [k(Y).format("YYYY年")]);
|
|
1453
1676
|
default:
|
|
1454
|
-
return
|
|
1677
|
+
return p("span", null, [k(Y).format("YYYY年MM月DD日")]);
|
|
1455
1678
|
}
|
|
1456
1679
|
};
|
|
1457
|
-
return
|
|
1680
|
+
return p("span", null, [F(x), " ", q("-"), " ", F(v)]);
|
|
1458
1681
|
}
|
|
1459
|
-
function
|
|
1682
|
+
function h() {
|
|
1460
1683
|
switch (!0) {
|
|
1461
|
-
case !!
|
|
1462
|
-
return e
|
|
1463
|
-
case
|
|
1464
|
-
case
|
|
1465
|
-
return
|
|
1684
|
+
case !!e?.shortcuts:
|
|
1685
|
+
return e?.shortcuts;
|
|
1686
|
+
case e?.type === "date":
|
|
1687
|
+
case e?.type === void 0:
|
|
1688
|
+
return t;
|
|
1466
1689
|
}
|
|
1467
1690
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1691
|
+
function m() {
|
|
1692
|
+
return p("div", null, [p(qt, {
|
|
1693
|
+
ref: (f) => r = f,
|
|
1471
1694
|
"disabled-input": !0,
|
|
1472
1695
|
style: {
|
|
1473
1696
|
width: "300px"
|
|
1474
1697
|
},
|
|
1475
|
-
modelValue:
|
|
1476
|
-
"onUpdate:modelValue": (
|
|
1477
|
-
onSelect:
|
|
1698
|
+
modelValue: a[l.key],
|
|
1699
|
+
"onUpdate:modelValue": (f) => a[l.key] = f,
|
|
1700
|
+
onSelect: s,
|
|
1478
1701
|
onChange: i,
|
|
1479
|
-
mode: e
|
|
1480
|
-
placeholder: e
|
|
1481
|
-
shortcuts:
|
|
1482
|
-
allowClear: e
|
|
1483
|
-
"disabled-date":
|
|
1484
|
-
format: e
|
|
1485
|
-
"value-format":
|
|
1702
|
+
mode: e?.type,
|
|
1703
|
+
placeholder: e?.placeholder,
|
|
1704
|
+
shortcuts: h(),
|
|
1705
|
+
allowClear: e?.clearable,
|
|
1706
|
+
"disabled-date": u,
|
|
1707
|
+
format: e?.labelFormat,
|
|
1708
|
+
"value-format": e?.valueFormat ?? n
|
|
1486
1709
|
}, null)]);
|
|
1487
1710
|
}
|
|
1488
|
-
|
|
1489
|
-
case "text":
|
|
1490
|
-
return c();
|
|
1491
|
-
case "component":
|
|
1492
|
-
default:
|
|
1493
|
-
return s();
|
|
1494
|
-
}
|
|
1711
|
+
return l.mode === "text" ? c() : m();
|
|
1495
1712
|
};
|
|
1496
1713
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
"onUpdate:modelValue": (u) => n[r.key] = u,
|
|
1506
|
-
placeholder: e == null ? void 0 : e.placeholder,
|
|
1507
|
-
autoSize: e == null ? void 0 : e.autosize,
|
|
1508
|
-
maxLength: e == null ? void 0 : e.maxLength
|
|
1509
|
-
}, null);
|
|
1510
|
-
}
|
|
1511
|
-
switch (r.mode) {
|
|
1512
|
-
case "text":
|
|
1513
|
-
return t();
|
|
1514
|
-
case "component":
|
|
1515
|
-
default:
|
|
1516
|
-
return l();
|
|
1714
|
+
const Mr = /* @__PURE__ */ ur((e) => {
|
|
1715
|
+
e && e.dispatchEvent(new Event("submit"));
|
|
1716
|
+
}, 1e3);
|
|
1717
|
+
function Yr(e) {
|
|
1718
|
+
let r;
|
|
1719
|
+
return (n, t) => {
|
|
1720
|
+
function o() {
|
|
1721
|
+
return p("span", null, [n[t.key]]);
|
|
1517
1722
|
}
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
function Je(e) {
|
|
1521
|
-
let n = !1;
|
|
1522
|
-
const r = [], t = (l) => {
|
|
1523
|
-
var u;
|
|
1524
|
-
if (!n) {
|
|
1525
|
-
if (r.push(l), l[e.valueProp] === e.key) {
|
|
1526
|
-
n = !0;
|
|
1723
|
+
function a() {
|
|
1724
|
+
if (!e?.autoSubmit)
|
|
1527
1725
|
return;
|
|
1726
|
+
let d = r;
|
|
1727
|
+
for (; d && d.$el.tagName !== "FORM"; )
|
|
1728
|
+
d = d.$parent;
|
|
1729
|
+
if (d && d.$el) {
|
|
1730
|
+
const s = d.$el;
|
|
1731
|
+
Mr(s);
|
|
1528
1732
|
}
|
|
1529
|
-
(u = l.children) != null && u.length && l.children.forEach(t), n || r.pop();
|
|
1530
1733
|
}
|
|
1734
|
+
function l() {
|
|
1735
|
+
return e?.type === "number" ? p(ft, {
|
|
1736
|
+
ref: (d) => r = d,
|
|
1737
|
+
modelValue: n[t.key],
|
|
1738
|
+
"onUpdate:modelValue": (d) => n[t.key] = d,
|
|
1739
|
+
hideButton: !0,
|
|
1740
|
+
"read-only": e?.readonly,
|
|
1741
|
+
placeholder: e?.placeholder,
|
|
1742
|
+
onInput: a,
|
|
1743
|
+
onClear: () => a(),
|
|
1744
|
+
allowClear: e?.clearable
|
|
1745
|
+
}, null) : p(At, {
|
|
1746
|
+
ref: (d) => r = d,
|
|
1747
|
+
modelValue: n[t.key],
|
|
1748
|
+
"onUpdate:modelValue": (d) => n[t.key] = d,
|
|
1749
|
+
placeholder: e?.placeholder,
|
|
1750
|
+
readonly: e?.readonly,
|
|
1751
|
+
onInput: a,
|
|
1752
|
+
onClear: () => a(),
|
|
1753
|
+
allowClear: e?.clearable
|
|
1754
|
+
}, null);
|
|
1755
|
+
}
|
|
1756
|
+
return t.mode === "text" ? o() : l();
|
|
1531
1757
|
};
|
|
1532
|
-
return e.data.forEach(t), r;
|
|
1533
|
-
}
|
|
1534
|
-
function cn(e) {
|
|
1535
|
-
let n = e.data;
|
|
1536
|
-
const r = [];
|
|
1537
|
-
return e.path.forEach((t) => {
|
|
1538
|
-
var u;
|
|
1539
|
-
const l = n.find((a) => a[e.valueProp] === t);
|
|
1540
|
-
l && r.push(l), l && ((u = l.children) != null && u.length) && (n = l.children);
|
|
1541
|
-
}), r;
|
|
1542
1758
|
}
|
|
1543
|
-
const
|
|
1544
|
-
function
|
|
1545
|
-
const e =
|
|
1546
|
-
return [e, (
|
|
1759
|
+
const le = /* @__PURE__ */ new WeakMap();
|
|
1760
|
+
function Lr() {
|
|
1761
|
+
const e = D(/* @__PURE__ */ new Map());
|
|
1762
|
+
return [e, (n) => e.value = n];
|
|
1547
1763
|
}
|
|
1548
|
-
function
|
|
1549
|
-
let
|
|
1550
|
-
const [t,
|
|
1551
|
-
if (!e.autoSubmit || !
|
|
1764
|
+
function Tr(e) {
|
|
1765
|
+
let r, n = !1;
|
|
1766
|
+
const [t, o] = Lr(), a = (i) => {
|
|
1767
|
+
if (e.onChange && e.onChange(i), !e.autoSubmit || !r)
|
|
1552
1768
|
return;
|
|
1553
|
-
let
|
|
1554
|
-
for (;
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
},
|
|
1558
|
-
const
|
|
1559
|
-
|
|
1560
|
-
},
|
|
1561
|
-
const
|
|
1562
|
-
switch (typeof
|
|
1769
|
+
let u = r;
|
|
1770
|
+
for (; u && u.$el.tagName !== "FORM"; )
|
|
1771
|
+
u = u.$parent;
|
|
1772
|
+
u && u.$el && u.$el.dispatchEvent(new Event("submit"));
|
|
1773
|
+
}, l = (i, u) => {
|
|
1774
|
+
const c = i();
|
|
1775
|
+
c instanceof Promise ? c.then(u) : u(c);
|
|
1776
|
+
}, d = async () => {
|
|
1777
|
+
const i = le.get(e.options);
|
|
1778
|
+
switch (typeof i) {
|
|
1779
|
+
// 已经执行未返回
|
|
1563
1780
|
case "function":
|
|
1564
|
-
|
|
1781
|
+
le.set(e.options, o);
|
|
1565
1782
|
return;
|
|
1783
|
+
// 已经执行已返回
|
|
1566
1784
|
case "object":
|
|
1567
|
-
|
|
1785
|
+
o(i);
|
|
1568
1786
|
return;
|
|
1569
1787
|
}
|
|
1570
|
-
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1788
|
+
le.set(e.options, o), l(e.options, (u) => {
|
|
1789
|
+
const c = le.get(e.options);
|
|
1790
|
+
le.set(e.options, u), c(u);
|
|
1573
1791
|
});
|
|
1574
|
-
},
|
|
1575
|
-
|
|
1576
|
-
|
|
1792
|
+
}, s = () => {
|
|
1793
|
+
l(e.options, (i) => {
|
|
1794
|
+
o(i);
|
|
1577
1795
|
});
|
|
1578
1796
|
};
|
|
1579
1797
|
switch (!0) {
|
|
1580
|
-
case e.options
|
|
1581
|
-
e.cache !== !1 ?
|
|
1798
|
+
case typeof e.options == "function": {
|
|
1799
|
+
e.cache !== !1 ? d() : s();
|
|
1582
1800
|
break;
|
|
1583
1801
|
}
|
|
1584
|
-
case
|
|
1585
|
-
|
|
1586
|
-
|
|
1802
|
+
case ie(e.options): {
|
|
1803
|
+
Fe(() => e.options, () => {
|
|
1804
|
+
o(e.options.value);
|
|
1587
1805
|
}, {
|
|
1588
1806
|
immediate: !0
|
|
1589
1807
|
});
|
|
@@ -1592,105 +1810,81 @@ function dn(e) {
|
|
|
1592
1810
|
default:
|
|
1593
1811
|
t.value = e.options;
|
|
1594
1812
|
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
return (o, s) => {
|
|
1601
|
-
e.default && !r && (o[s.key] = e.default, r = !0);
|
|
1602
|
-
function d() {
|
|
1603
|
-
const h = o[s.key], k = (y) => {
|
|
1604
|
-
const [S] = Je({
|
|
1605
|
-
data: t.value,
|
|
1606
|
-
labelProp: "title",
|
|
1607
|
-
valueProp: "key",
|
|
1608
|
-
key: y
|
|
1609
|
-
}).reverse() || [];
|
|
1610
|
-
return S == null ? void 0 : S.title;
|
|
1611
|
-
};
|
|
1612
|
-
if (e.multiple) {
|
|
1613
|
-
const y = h.map((S) => k(S));
|
|
1614
|
-
return f("span", null, [y.join(", ")]);
|
|
1615
|
-
} else {
|
|
1616
|
-
const y = k(h);
|
|
1617
|
-
return f("span", null, [y]);
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
function m() {
|
|
1621
|
-
return f(Dt, {
|
|
1622
|
-
ref: (h) => n = h,
|
|
1623
|
-
multiple: e.multiple,
|
|
1624
|
-
modelValue: o[s.key],
|
|
1625
|
-
"onUpdate:modelValue": (h) => o[s.key] = h,
|
|
1626
|
-
placeholder: e.placeholder,
|
|
1627
|
-
allowClear: e.clearable,
|
|
1628
|
-
allowSearch: e.searchable,
|
|
1629
|
-
maxTagCount: e.maxTagCount ?? 2,
|
|
1630
|
-
onChange: u,
|
|
1631
|
-
filterTreeNode: c,
|
|
1632
|
-
data: t.value,
|
|
1633
|
-
fieldNames: e.fieldNames,
|
|
1634
|
-
treeProps: e.treeProps,
|
|
1635
|
-
treeCheckStrictly: e.treeCheckStrictly,
|
|
1636
|
-
treeCheckedStrategy: e.treeCheckedStrategy
|
|
1637
|
-
}, {
|
|
1638
|
-
...e.slots
|
|
1639
|
-
});
|
|
1813
|
+
return (i, u) => {
|
|
1814
|
+
e.default && !n && (i[u.key] = e.default, n = !0);
|
|
1815
|
+
function c() {
|
|
1816
|
+
const m = i[u.key];
|
|
1817
|
+
return p("span", null, [t.value?.get(m)]);
|
|
1640
1818
|
}
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1819
|
+
function h() {
|
|
1820
|
+
return p(Wt, {
|
|
1821
|
+
type: e.type || "radio",
|
|
1822
|
+
size: e.size,
|
|
1823
|
+
ref: (m) => r = m,
|
|
1824
|
+
modelValue: i[u.key],
|
|
1825
|
+
"onUpdate:modelValue": (m) => i[u.key] = m,
|
|
1826
|
+
onChange: a,
|
|
1827
|
+
options: Array.from(t.value.entries()).map(([m, f]) => ({
|
|
1828
|
+
label: f,
|
|
1829
|
+
value: m
|
|
1830
|
+
}))
|
|
1831
|
+
}, null);
|
|
1647
1832
|
}
|
|
1833
|
+
return u.mode === "text" ? c() : h();
|
|
1648
1834
|
};
|
|
1649
1835
|
}
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1836
|
+
function Dr(e) {
|
|
1837
|
+
return (r, n) => e(r, n);
|
|
1838
|
+
}
|
|
1839
|
+
function Rr(e) {
|
|
1840
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qe(e);
|
|
1654
1841
|
}
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1842
|
+
const ae = /* @__PURE__ */ new WeakMap();
|
|
1843
|
+
function Ir() {
|
|
1844
|
+
const e = D(/* @__PURE__ */ new Map());
|
|
1845
|
+
return [e, (n) => e.value = n];
|
|
1846
|
+
}
|
|
1847
|
+
function Pr(e) {
|
|
1848
|
+
let r, n = !1;
|
|
1849
|
+
const [t, o] = Ir(), a = (i) => {
|
|
1850
|
+
if (e.onChange && e.onChange(i), !e.autoSubmit || !r)
|
|
1659
1851
|
return;
|
|
1660
|
-
let
|
|
1661
|
-
for (;
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
},
|
|
1665
|
-
const
|
|
1666
|
-
|
|
1667
|
-
},
|
|
1668
|
-
const
|
|
1669
|
-
switch (typeof
|
|
1852
|
+
let u = r;
|
|
1853
|
+
for (; u && u.$el.tagName !== "FORM"; )
|
|
1854
|
+
u = u.$parent;
|
|
1855
|
+
u && u.$el && u.$el.dispatchEvent(new Event("submit"));
|
|
1856
|
+
}, l = (i, u) => {
|
|
1857
|
+
const c = i();
|
|
1858
|
+
c instanceof Promise ? c.then(u) : u(c);
|
|
1859
|
+
}, d = async () => {
|
|
1860
|
+
const i = ae.get(e.options);
|
|
1861
|
+
switch (typeof i) {
|
|
1862
|
+
// 已经执行未返回
|
|
1670
1863
|
case "function":
|
|
1671
|
-
|
|
1864
|
+
ae.set(e.options, o);
|
|
1672
1865
|
return;
|
|
1866
|
+
// 已经执行已返回
|
|
1673
1867
|
case "object":
|
|
1674
|
-
|
|
1868
|
+
o(i);
|
|
1675
1869
|
return;
|
|
1676
1870
|
}
|
|
1677
|
-
|
|
1678
|
-
const
|
|
1679
|
-
|
|
1871
|
+
ae.set(e.options, o), l(e.options, (u) => {
|
|
1872
|
+
const c = ae.get(e.options);
|
|
1873
|
+
ae.set(e.options, u), c(u);
|
|
1680
1874
|
});
|
|
1681
|
-
},
|
|
1682
|
-
|
|
1683
|
-
|
|
1875
|
+
}, s = () => {
|
|
1876
|
+
l(e.options, (i) => {
|
|
1877
|
+
o(i);
|
|
1684
1878
|
});
|
|
1685
1879
|
};
|
|
1686
1880
|
switch (!0) {
|
|
1687
|
-
case e.options
|
|
1688
|
-
e.cache !== !1 ?
|
|
1881
|
+
case typeof e.options == "function": {
|
|
1882
|
+
e.cache !== !1 ? d() : s();
|
|
1689
1883
|
break;
|
|
1690
1884
|
}
|
|
1691
|
-
case
|
|
1692
|
-
|
|
1693
|
-
|
|
1885
|
+
case ie(e.options): {
|
|
1886
|
+
Fe(() => e.options, () => {
|
|
1887
|
+
o(e.options.value);
|
|
1694
1888
|
}, {
|
|
1695
1889
|
immediate: !0
|
|
1696
1890
|
});
|
|
@@ -1699,183 +1893,130 @@ function mn(e) {
|
|
|
1699
1893
|
default:
|
|
1700
1894
|
t.value = e.options;
|
|
1701
1895
|
}
|
|
1702
|
-
return (
|
|
1703
|
-
e.default && !
|
|
1704
|
-
function
|
|
1705
|
-
const m =
|
|
1706
|
-
|
|
1707
|
-
labelProp: "label",
|
|
1708
|
-
valueProp: "value",
|
|
1709
|
-
key: y
|
|
1710
|
-
}).map((L) => L.label).join("/"), k = (y) => cn({
|
|
1711
|
-
data: t.value,
|
|
1712
|
-
labelProp: "label",
|
|
1713
|
-
valueProp: "value",
|
|
1714
|
-
path: y
|
|
1715
|
-
}).map((L) => L.label).join("/");
|
|
1716
|
-
switch (!0) {
|
|
1717
|
-
case (!e.pathMode && !e.multiple): {
|
|
1718
|
-
const y = h(m);
|
|
1719
|
-
return f("span", null, [y]);
|
|
1720
|
-
}
|
|
1721
|
-
case (!e.pathMode && e.multiple): {
|
|
1722
|
-
const y = m.map((S) => h(S));
|
|
1723
|
-
return f("span", null, [y.join(", ")]);
|
|
1724
|
-
}
|
|
1725
|
-
case (e.pathMode && !e.multiple): {
|
|
1726
|
-
const y = k(m);
|
|
1727
|
-
return f("span", null, [y]);
|
|
1728
|
-
}
|
|
1729
|
-
case (e.pathMode && e.multiple): {
|
|
1730
|
-
const y = m.map((S) => k(S));
|
|
1731
|
-
return f("span", null, [y.join(", ")]);
|
|
1732
|
-
}
|
|
1733
|
-
default:
|
|
1734
|
-
return f("span", null, null);
|
|
1735
|
-
}
|
|
1896
|
+
return (i, u) => {
|
|
1897
|
+
e.default && !n && (i[u.key] = e.default, n = !0);
|
|
1898
|
+
function c() {
|
|
1899
|
+
const m = i[u.key];
|
|
1900
|
+
return e.multiple ? p("span", null, [m.map((f) => t.value.get(f)).join(" ,")]) : p("span", null, [t.value.get(m)]);
|
|
1736
1901
|
}
|
|
1737
|
-
function
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
ref: (
|
|
1902
|
+
function h() {
|
|
1903
|
+
let m;
|
|
1904
|
+
return p(Ht, {
|
|
1905
|
+
ref: (f) => r = f,
|
|
1741
1906
|
multiple: e.multiple,
|
|
1742
|
-
modelValue:
|
|
1743
|
-
"onUpdate:modelValue": (
|
|
1907
|
+
modelValue: i[u.key],
|
|
1908
|
+
"onUpdate:modelValue": (f) => i[u.key] = f,
|
|
1744
1909
|
placeholder: e.placeholder,
|
|
1745
1910
|
allowClear: e.clearable,
|
|
1746
1911
|
allowSearch: e.searchable,
|
|
1912
|
+
"allow-create": e.createable,
|
|
1747
1913
|
maxTagCount: e.maxTagCount ?? 2,
|
|
1748
|
-
onChange:
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
return s();
|
|
1757
|
-
case "component":
|
|
1758
|
-
default:
|
|
1759
|
-
return d();
|
|
1914
|
+
onChange: a
|
|
1915
|
+
}, Rr(m = Array.from(t.value.entries()).map(([f, x], v) => p(Ut, {
|
|
1916
|
+
key: v,
|
|
1917
|
+
value: f,
|
|
1918
|
+
label: x
|
|
1919
|
+
}, null))) ? m : {
|
|
1920
|
+
default: () => [m]
|
|
1921
|
+
});
|
|
1760
1922
|
}
|
|
1923
|
+
return u.mode === "text" ? c() : h();
|
|
1761
1924
|
};
|
|
1762
1925
|
}
|
|
1763
|
-
function
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
thousands: !0,
|
|
1768
|
-
inputUnit: "元",
|
|
1769
|
-
outputUnit: "元"
|
|
1770
|
-
}, ne = {
|
|
1771
|
-
分: 10 ** 0,
|
|
1772
|
-
元: 10 ** 2,
|
|
1773
|
-
万: 10 ** 4
|
|
1774
|
-
};
|
|
1775
|
-
function yn(e) {
|
|
1776
|
-
e = {
|
|
1777
|
-
...vn,
|
|
1778
|
-
...e || {}
|
|
1779
|
-
};
|
|
1780
|
-
const n = (a) => {
|
|
1781
|
-
if (a == null)
|
|
1782
|
-
return;
|
|
1783
|
-
if ((e == null ? void 0 : e.inputUnit) === (e == null ? void 0 : e.outputUnit))
|
|
1784
|
-
return a;
|
|
1785
|
-
const i = ne[e.outputUnit] / ne[e.inputUnit];
|
|
1786
|
-
return parseFloat((a * i).toFixed(10));
|
|
1787
|
-
}, r = (a) => {
|
|
1788
|
-
if (a == null)
|
|
1926
|
+
function jr(e) {
|
|
1927
|
+
let r;
|
|
1928
|
+
function n() {
|
|
1929
|
+
if (!e?.autoSubmit || !r)
|
|
1789
1930
|
return;
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
}, u = (a) => a.replace(/,/g, "");
|
|
1801
|
-
return (a, i) => {
|
|
1802
|
-
const v = O(n(a[i.key]));
|
|
1803
|
-
ee(v, (m) => {
|
|
1804
|
-
a[i.key] = r(m);
|
|
1805
|
-
});
|
|
1806
|
-
const c = (e == null ? void 0 : e.prefix) && (() => typeof (e == null ? void 0 : e.prefix) == "string" ? f("span", null, [e.prefix]) : e.prefix()), o = () => typeof (e == null ? void 0 : e.suffix) == "string" ? f("span", null, [e.suffix]) : typeof (e == null ? void 0 : e.suffix) == "function" ? e.suffix() : e == null ? void 0 : e.inputUnit;
|
|
1807
|
-
function s() {
|
|
1808
|
-
return f("span", null, [l(v.value.toString()), o()]);
|
|
1931
|
+
let t = r;
|
|
1932
|
+
for (; t && t.$el.tagName !== "FORM"; )
|
|
1933
|
+
t = t.$parent;
|
|
1934
|
+
t && t.$el && t.$el.dispatchEvent(new Event("submit"));
|
|
1935
|
+
}
|
|
1936
|
+
return (t, o) => {
|
|
1937
|
+
e?.default && (t[o.key] = e.default);
|
|
1938
|
+
function a() {
|
|
1939
|
+
const d = t[o.key];
|
|
1940
|
+
return p("span", null, [d ? e?.openLabel ?? "是" : e?.closeLabel ?? "否"]);
|
|
1809
1941
|
}
|
|
1810
|
-
function
|
|
1811
|
-
return
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
}, {
|
|
1822
|
-
prefix: c,
|
|
1823
|
-
suffix: o
|
|
1824
|
-
});
|
|
1942
|
+
function l() {
|
|
1943
|
+
return p(Gt, {
|
|
1944
|
+
ref: (d) => r = d,
|
|
1945
|
+
modelValue: t[o.key],
|
|
1946
|
+
"onUpdate:modelValue": (d) => t[o.key] = d,
|
|
1947
|
+
checkedText: e?.openLabel ?? "是",
|
|
1948
|
+
uncheckedText: e?.closeLabel ?? "否",
|
|
1949
|
+
checkedValue: e?.openValue ?? !0,
|
|
1950
|
+
uncheckedValue: e?.closeValue ?? !1,
|
|
1951
|
+
onChange: n
|
|
1952
|
+
}, null);
|
|
1825
1953
|
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1954
|
+
return o.mode === "text" ? a() : l();
|
|
1955
|
+
};
|
|
1956
|
+
}
|
|
1957
|
+
function Er(e) {
|
|
1958
|
+
return (r, n) => {
|
|
1959
|
+
function t() {
|
|
1960
|
+
return p("span", null, [r[n.key]]);
|
|
1832
1961
|
}
|
|
1962
|
+
function o() {
|
|
1963
|
+
return p(Qt, {
|
|
1964
|
+
modelValue: r[n.key],
|
|
1965
|
+
"onUpdate:modelValue": (a) => r[n.key] = a,
|
|
1966
|
+
placeholder: e?.placeholder,
|
|
1967
|
+
autoSize: e?.autosize,
|
|
1968
|
+
maxLength: e?.maxLength
|
|
1969
|
+
}, null);
|
|
1970
|
+
}
|
|
1971
|
+
return n.mode === "text" ? t() : o();
|
|
1833
1972
|
};
|
|
1834
1973
|
}
|
|
1835
|
-
const
|
|
1836
|
-
function
|
|
1837
|
-
const e =
|
|
1838
|
-
return [e, (
|
|
1974
|
+
const ue = /* @__PURE__ */ new WeakMap();
|
|
1975
|
+
function zr() {
|
|
1976
|
+
const e = D([]);
|
|
1977
|
+
return [e, (n) => e.value = n];
|
|
1839
1978
|
}
|
|
1840
|
-
function
|
|
1841
|
-
let
|
|
1842
|
-
const [t,
|
|
1843
|
-
if (
|
|
1979
|
+
function Nr(e) {
|
|
1980
|
+
let r, n = !1;
|
|
1981
|
+
const [t, o] = zr(), a = () => {
|
|
1982
|
+
if (!e.autoSubmit || !r)
|
|
1844
1983
|
return;
|
|
1845
|
-
let
|
|
1846
|
-
for (;
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
},
|
|
1850
|
-
const
|
|
1851
|
-
|
|
1852
|
-
},
|
|
1853
|
-
const
|
|
1854
|
-
switch (typeof
|
|
1984
|
+
let u = r;
|
|
1985
|
+
for (; u && u.$el.tagName !== "FORM"; )
|
|
1986
|
+
u = u.$parent;
|
|
1987
|
+
u && u.$el && u.$el.dispatchEvent(new Event("submit"));
|
|
1988
|
+
}, l = (u, c) => {
|
|
1989
|
+
const h = u();
|
|
1990
|
+
h instanceof Promise ? h.then(c) : c(h);
|
|
1991
|
+
}, d = async () => {
|
|
1992
|
+
const u = ue.get(e.options);
|
|
1993
|
+
switch (typeof u) {
|
|
1994
|
+
// 已经执行未返回
|
|
1855
1995
|
case "function":
|
|
1856
|
-
|
|
1996
|
+
ue.set(e.options, o);
|
|
1857
1997
|
return;
|
|
1998
|
+
// 已经执行已返回
|
|
1858
1999
|
case "object":
|
|
1859
|
-
|
|
2000
|
+
o(u);
|
|
1860
2001
|
return;
|
|
1861
2002
|
}
|
|
1862
|
-
|
|
1863
|
-
const
|
|
1864
|
-
|
|
2003
|
+
ue.set(e.options, o), l(e.options, (c) => {
|
|
2004
|
+
const h = ue.get(e.options);
|
|
2005
|
+
ue.set(e.options, c), h(c);
|
|
1865
2006
|
});
|
|
1866
|
-
},
|
|
1867
|
-
|
|
1868
|
-
|
|
2007
|
+
}, s = () => {
|
|
2008
|
+
l(e.options, (u) => {
|
|
2009
|
+
o(u);
|
|
1869
2010
|
});
|
|
1870
2011
|
};
|
|
1871
2012
|
switch (!0) {
|
|
1872
|
-
case e.options
|
|
1873
|
-
e.cache !== !1 ?
|
|
2013
|
+
case typeof e.options == "function": {
|
|
2014
|
+
e.cache !== !1 ? d() : s();
|
|
1874
2015
|
break;
|
|
1875
2016
|
}
|
|
1876
|
-
case
|
|
1877
|
-
|
|
1878
|
-
|
|
2017
|
+
case ie(e.options): {
|
|
2018
|
+
Fe(() => e.options, () => {
|
|
2019
|
+
o(e.options.value);
|
|
1879
2020
|
}, {
|
|
1880
2021
|
immediate: !0
|
|
1881
2022
|
});
|
|
@@ -1884,188 +2025,91 @@ function gn(e) {
|
|
|
1884
2025
|
default:
|
|
1885
2026
|
t.value = e.options;
|
|
1886
2027
|
}
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
2028
|
+
function i(u, c) {
|
|
2029
|
+
const h = e.fieldNames?.title || "title", m = c[h];
|
|
2030
|
+
return m ? m.toLowerCase().includes(u.toLowerCase()) : !1;
|
|
2031
|
+
}
|
|
2032
|
+
return (u, c) => {
|
|
2033
|
+
e.default && !n && (u[c.key] = e.default, n = !0);
|
|
2034
|
+
function h() {
|
|
2035
|
+
const f = u[c.key], x = (v) => {
|
|
2036
|
+
const [F] = ht({
|
|
2037
|
+
data: t.value,
|
|
2038
|
+
valueProp: "key",
|
|
2039
|
+
key: v
|
|
2040
|
+
}).reverse() || [];
|
|
2041
|
+
return F?.title;
|
|
2042
|
+
};
|
|
2043
|
+
if (e.multiple) {
|
|
2044
|
+
const v = f.map((F) => x(F));
|
|
2045
|
+
return p("span", null, [v.join(", ")]);
|
|
2046
|
+
} else {
|
|
2047
|
+
const v = x(f);
|
|
2048
|
+
return p("span", null, [v]);
|
|
2049
|
+
}
|
|
1907
2050
|
}
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
2051
|
+
function m() {
|
|
2052
|
+
return p(Xt, {
|
|
2053
|
+
ref: (f) => r = f,
|
|
2054
|
+
multiple: e.multiple,
|
|
2055
|
+
modelValue: u[c.key],
|
|
2056
|
+
"onUpdate:modelValue": (f) => u[c.key] = f,
|
|
2057
|
+
placeholder: e.placeholder,
|
|
2058
|
+
allowClear: e.clearable,
|
|
2059
|
+
allowSearch: e.searchable,
|
|
2060
|
+
maxTagCount: e.maxTagCount ?? 2,
|
|
2061
|
+
onChange: a,
|
|
2062
|
+
filterTreeNode: i,
|
|
2063
|
+
data: t.value,
|
|
2064
|
+
fieldNames: e.fieldNames,
|
|
2065
|
+
treeProps: e.treeProps,
|
|
2066
|
+
treeCheckStrictly: e.treeCheckStrictly,
|
|
2067
|
+
treeCheckedStrategy: e.treeCheckedStrategy
|
|
2068
|
+
}, {
|
|
2069
|
+
...e.slots
|
|
2070
|
+
});
|
|
1914
2071
|
}
|
|
2072
|
+
return c.mode === "text" ? h() : m();
|
|
1915
2073
|
};
|
|
1916
2074
|
}
|
|
1917
|
-
function
|
|
2075
|
+
function Br() {
|
|
1918
2076
|
return {
|
|
1919
|
-
input:
|
|
1920
|
-
textarea:
|
|
1921
|
-
select:
|
|
1922
|
-
treeSelect:
|
|
1923
|
-
date:
|
|
1924
|
-
switch:
|
|
1925
|
-
dateRange:
|
|
1926
|
-
render:
|
|
1927
|
-
cascader:
|
|
1928
|
-
currency:
|
|
1929
|
-
radio:
|
|
2077
|
+
input: Yr,
|
|
2078
|
+
textarea: Er,
|
|
2079
|
+
select: Pr,
|
|
2080
|
+
treeSelect: Nr,
|
|
2081
|
+
date: Cr,
|
|
2082
|
+
switch: jr,
|
|
2083
|
+
dateRange: Fr,
|
|
2084
|
+
render: Dr,
|
|
2085
|
+
cascader: cr,
|
|
2086
|
+
currency: fr,
|
|
2087
|
+
radio: Tr
|
|
1930
2088
|
};
|
|
1931
2089
|
}
|
|
1932
|
-
function
|
|
1933
|
-
|
|
1934
|
-
const
|
|
1935
|
-
...
|
|
2090
|
+
function st(e, r) {
|
|
2091
|
+
r.render || (r.render = (t) => t.input());
|
|
2092
|
+
const n = r.render({
|
|
2093
|
+
...Br()
|
|
1936
2094
|
});
|
|
1937
2095
|
return {
|
|
1938
|
-
default: () =>
|
|
2096
|
+
default: () => n(e, r)
|
|
1939
2097
|
};
|
|
1940
2098
|
}
|
|
1941
|
-
function
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
label: n.title,
|
|
1951
|
-
hideLabel: n.hideLabel,
|
|
1952
|
-
labelColStyle: n.labelStyle,
|
|
1953
|
-
wrapperColStyle: n.contentStyle
|
|
1954
|
-
}, Re(e, n));
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
function kn(e) {
|
|
1958
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !xe(e);
|
|
2099
|
+
function it(e, r) {
|
|
2100
|
+
return r.mode === "text" ? Je(st(e, r).default) : Je(Ne, {
|
|
2101
|
+
key: r.key,
|
|
2102
|
+
field: r.key,
|
|
2103
|
+
label: r.title,
|
|
2104
|
+
hideLabel: r.hideLabel,
|
|
2105
|
+
labelColStyle: r.labelStyle,
|
|
2106
|
+
wrapperColStyle: r.contentStyle
|
|
2107
|
+
}, st(e, r));
|
|
1959
2108
|
}
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
form: {
|
|
1963
|
-
type: Object,
|
|
1964
|
-
required: !0
|
|
1965
|
-
},
|
|
1966
|
-
value: {
|
|
1967
|
-
type: Object
|
|
1968
|
-
},
|
|
1969
|
-
columns: {
|
|
1970
|
-
type: Number,
|
|
1971
|
-
default: 2
|
|
1972
|
-
}
|
|
1973
|
-
},
|
|
1974
|
-
setup(e) {
|
|
1975
|
-
const n = He(), r = e.form.map((v) => ({
|
|
1976
|
-
...v,
|
|
1977
|
-
collapsed: !1
|
|
1978
|
-
})), t = Array.from(new Set(r.map((v) => v.group).flat().filter(Boolean))), l = r.reduce((v, c) => ((c.group ? [c.group].flat() : ["默认"]).forEach((o) => {
|
|
1979
|
-
let s = v.find((d) => d.group === o);
|
|
1980
|
-
s || (s = {
|
|
1981
|
-
group: o,
|
|
1982
|
-
instance: void 0,
|
|
1983
|
-
form: []
|
|
1984
|
-
}, v.push(s)), s.form.push(c);
|
|
1985
|
-
}), v), []).sort((v, c) => v.group === "默认" ? -1 : c.group === "默认" ? 1 : v.group > c.group ? -1 : 1), u = O("默认");
|
|
1986
|
-
return {
|
|
1987
|
-
formItems: r,
|
|
1988
|
-
groups: t,
|
|
1989
|
-
groupForms: l,
|
|
1990
|
-
activeTab: u,
|
|
1991
|
-
onSubmit: () => {
|
|
1992
|
-
const v = l.find((c) => c.group === u.value);
|
|
1993
|
-
if (v && v.instance) {
|
|
1994
|
-
const c = v.instance.formSource;
|
|
1995
|
-
v.instance.validate().then((o) => {
|
|
1996
|
-
o || n.close(c);
|
|
1997
|
-
});
|
|
1998
|
-
}
|
|
1999
|
-
},
|
|
2000
|
-
onReset: () => {
|
|
2001
|
-
const v = l.find((c) => c.group === u.value);
|
|
2002
|
-
v && v.instance && v.instance.reset();
|
|
2003
|
-
}
|
|
2004
|
-
};
|
|
2005
|
-
},
|
|
2006
|
-
render() {
|
|
2007
|
-
const e = this.groupForms.find((n) => n.group === this.activeTab);
|
|
2008
|
-
if (this.groups.length) {
|
|
2009
|
-
let n;
|
|
2010
|
-
return f(Lt, {
|
|
2011
|
-
"active-key": this.activeTab,
|
|
2012
|
-
"onUpdate:active-key": (r) => this.activeTab = r
|
|
2013
|
-
}, kn(n = this.groupForms.map((r) => f(Pt, {
|
|
2014
|
-
title: r.group,
|
|
2015
|
-
key: r.group
|
|
2016
|
-
}, {
|
|
2017
|
-
default: () => [f(be, {
|
|
2018
|
-
columns: this.columns,
|
|
2019
|
-
form: r.form,
|
|
2020
|
-
value: this.value,
|
|
2021
|
-
ref: (t) => r.instance = t
|
|
2022
|
-
}, null), f(Me, null, null), f("div", {
|
|
2023
|
-
class: "flex items-center justify-between space-x-2"
|
|
2024
|
-
}, [f(R, {
|
|
2025
|
-
type: "secondary",
|
|
2026
|
-
size: "large",
|
|
2027
|
-
onClick: this.onReset
|
|
2028
|
-
}, {
|
|
2029
|
-
default: () => [j("重置")]
|
|
2030
|
-
}), f(R, {
|
|
2031
|
-
class: "w-100px",
|
|
2032
|
-
type: "primary",
|
|
2033
|
-
size: "large",
|
|
2034
|
-
onClick: this.onSubmit
|
|
2035
|
-
}, {
|
|
2036
|
-
default: () => [j("搜索")]
|
|
2037
|
-
})])]
|
|
2038
|
-
}))) ? n : {
|
|
2039
|
-
default: () => [n]
|
|
2040
|
-
});
|
|
2041
|
-
} else
|
|
2042
|
-
return f(le, null, [f(be, {
|
|
2043
|
-
columns: this.columns,
|
|
2044
|
-
form: this.formItems,
|
|
2045
|
-
value: this.value,
|
|
2046
|
-
ref: (n) => e.instance = n
|
|
2047
|
-
}, null), f(Me, null, null), f("div", {
|
|
2048
|
-
class: "flex items-center justify-between space-x-2"
|
|
2049
|
-
}, [f(R, {
|
|
2050
|
-
type: "secondary",
|
|
2051
|
-
size: "large",
|
|
2052
|
-
onClick: this.onReset
|
|
2053
|
-
}, {
|
|
2054
|
-
default: () => [j("重置")]
|
|
2055
|
-
}), f(R, {
|
|
2056
|
-
class: "w-100px",
|
|
2057
|
-
type: "primary",
|
|
2058
|
-
size: "large",
|
|
2059
|
-
onClick: this.onSubmit
|
|
2060
|
-
}, {
|
|
2061
|
-
default: () => [j("搜索")]
|
|
2062
|
-
})])]);
|
|
2063
|
-
}
|
|
2064
|
-
});
|
|
2065
|
-
function Ee(e) {
|
|
2066
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !xe(e);
|
|
2109
|
+
function ct(e) {
|
|
2110
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qe(e);
|
|
2067
2111
|
}
|
|
2068
|
-
const
|
|
2112
|
+
const Be = /* @__PURE__ */ U({
|
|
2069
2113
|
props: {
|
|
2070
2114
|
form: {
|
|
2071
2115
|
type: Object,
|
|
@@ -2150,48 +2194,46 @@ const be = /* @__PURE__ */ I({
|
|
|
2150
2194
|
emits: ["submit", "cancel", "update:model-value"],
|
|
2151
2195
|
expose: ["formSource", "updateFormField", "updateFormSource", "reset", "validate"],
|
|
2152
2196
|
setup(e, {
|
|
2153
|
-
emit:
|
|
2197
|
+
emit: r
|
|
2154
2198
|
}) {
|
|
2155
|
-
const
|
|
2156
|
-
|
|
2157
|
-
const
|
|
2158
|
-
|
|
2159
|
-
},
|
|
2199
|
+
const n = D(), [t, o] = nr(e.form, e.modelValue || e.value), a = D(e.columns || 0), l = D(!0), d = D(), s = () => l.value = !l.value, i = D(""), u = D("");
|
|
2200
|
+
ze(nt.id, i), ze(nt.source, t);
|
|
2201
|
+
const c = () => {
|
|
2202
|
+
r("submit", t.value), r("update:model-value", t.value);
|
|
2203
|
+
}, h = L(() => e.form.filter((b) => l.value ? !b.collapsed : !0).filter((b) => {
|
|
2160
2204
|
switch (!0) {
|
|
2161
|
-
case typeof
|
|
2162
|
-
return
|
|
2163
|
-
case typeof
|
|
2164
|
-
return
|
|
2205
|
+
case typeof b.visiable == "boolean":
|
|
2206
|
+
return b.visiable;
|
|
2207
|
+
case typeof b.visiable == "function":
|
|
2208
|
+
return b.visiable(t.value);
|
|
2165
2209
|
default:
|
|
2166
2210
|
return !0;
|
|
2167
2211
|
}
|
|
2168
|
-
})), m =
|
|
2169
|
-
if (!
|
|
2212
|
+
})), m = L(() => {
|
|
2213
|
+
if (!a.value)
|
|
2170
2214
|
return 1;
|
|
2171
|
-
const
|
|
2172
|
-
return
|
|
2173
|
-
}),
|
|
2174
|
-
...
|
|
2175
|
-
validator: (
|
|
2176
|
-
const
|
|
2177
|
-
if (typeof
|
|
2178
|
-
return
|
|
2215
|
+
const b = h.value.reduce((_, j) => _ + (j?.span || 1), 0);
|
|
2216
|
+
return a.value - b % a.value;
|
|
2217
|
+
}), f = (b) => b?.validator ? {
|
|
2218
|
+
...b,
|
|
2219
|
+
validator: (_, j) => {
|
|
2220
|
+
const H = b.validator(_, j);
|
|
2221
|
+
if (typeof H == "function")
|
|
2222
|
+
return H(t.value);
|
|
2179
2223
|
}
|
|
2180
|
-
} :
|
|
2181
|
-
function
|
|
2182
|
-
var x;
|
|
2224
|
+
} : b, x = L(() => e.form.reduce((b, _) => (_.rule && (Array.isArray(_.rule) ? b[_.key] = _.rule.map(f) : b[_.key] = f(_.rule)), b), {}));
|
|
2225
|
+
function v() {
|
|
2183
2226
|
if (e.columns)
|
|
2184
2227
|
return;
|
|
2185
|
-
const
|
|
2186
|
-
|
|
2228
|
+
const b = n.value?.$el;
|
|
2229
|
+
b && (a.value = Math.max(Math.floor(b.offsetWidth / e.minWidth), 1));
|
|
2187
2230
|
}
|
|
2188
|
-
function
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
g && (g.id = c.value);
|
|
2231
|
+
function F() {
|
|
2232
|
+
const b = n.value?.$el;
|
|
2233
|
+
b && (b.id = i.value);
|
|
2192
2234
|
}
|
|
2193
|
-
function
|
|
2194
|
-
|
|
2235
|
+
function Y() {
|
|
2236
|
+
d.value.open(or, {
|
|
2195
2237
|
form: e.form,
|
|
2196
2238
|
value: t.value,
|
|
2197
2239
|
columns: e.collapsedDialogColumns
|
|
@@ -2199,169 +2241,167 @@ const be = /* @__PURE__ */ I({
|
|
|
2199
2241
|
title: "高级搜索",
|
|
2200
2242
|
footer: !1,
|
|
2201
2243
|
submitText: "搜索"
|
|
2202
|
-
}).then((
|
|
2203
|
-
|
|
2244
|
+
}).then((b) => {
|
|
2245
|
+
b && (I(b), c());
|
|
2204
2246
|
});
|
|
2205
2247
|
}
|
|
2206
|
-
|
|
2207
|
-
const
|
|
2208
|
-
|
|
2248
|
+
te(() => {
|
|
2249
|
+
const b = Math.random().toString(32).slice(2);
|
|
2250
|
+
i.value = e.id ?? b, u.value = e.name ?? b, v(), F(), window && window.addEventListener("resize", v);
|
|
2209
2251
|
});
|
|
2210
|
-
function
|
|
2211
|
-
|
|
2252
|
+
function I(b) {
|
|
2253
|
+
o({
|
|
2212
2254
|
...t.value,
|
|
2213
|
-
...
|
|
2255
|
+
...b || {}
|
|
2214
2256
|
});
|
|
2215
2257
|
}
|
|
2216
|
-
function
|
|
2217
|
-
t.value[
|
|
2258
|
+
function P(b, _) {
|
|
2259
|
+
t.value[b] = _, I({
|
|
2218
2260
|
...t.value
|
|
2219
2261
|
});
|
|
2220
2262
|
}
|
|
2221
|
-
function
|
|
2222
|
-
const
|
|
2223
|
-
|
|
2263
|
+
function R(b) {
|
|
2264
|
+
const _ = e.form.find((H) => H.key === b), j = (typeof _.default == "function" ? _.default() : _.default) || null;
|
|
2265
|
+
P(b, j);
|
|
2224
2266
|
}
|
|
2225
2267
|
function N() {
|
|
2226
|
-
|
|
2268
|
+
n.value && n.value.resetFields();
|
|
2227
2269
|
}
|
|
2228
|
-
function
|
|
2229
|
-
|
|
2230
|
-
return (g = r.value) == null ? void 0 : g.validate();
|
|
2270
|
+
function V() {
|
|
2271
|
+
return n.value?.validate();
|
|
2231
2272
|
}
|
|
2232
2273
|
return {
|
|
2233
|
-
formId:
|
|
2234
|
-
formName:
|
|
2274
|
+
formId: i,
|
|
2275
|
+
formName: u,
|
|
2235
2276
|
formSource: t,
|
|
2236
|
-
formInstance:
|
|
2237
|
-
formColumns:
|
|
2238
|
-
formRules:
|
|
2239
|
-
formCollspased:
|
|
2277
|
+
formInstance: n,
|
|
2278
|
+
formColumns: a,
|
|
2279
|
+
formRules: x,
|
|
2280
|
+
formCollspased: l,
|
|
2240
2281
|
formActiosSpan: m,
|
|
2241
|
-
formItems:
|
|
2242
|
-
toggleFormCollapsed:
|
|
2243
|
-
updateFormField:
|
|
2244
|
-
resetFormField:
|
|
2282
|
+
formItems: h,
|
|
2283
|
+
toggleFormCollapsed: s,
|
|
2284
|
+
updateFormField: P,
|
|
2285
|
+
resetFormField: R,
|
|
2245
2286
|
resetFormFields: N,
|
|
2246
|
-
updateFormSource:
|
|
2287
|
+
updateFormSource: I,
|
|
2247
2288
|
reset: N,
|
|
2248
|
-
validate:
|
|
2249
|
-
onSubmitSuccess:
|
|
2250
|
-
openCollapsedDialog:
|
|
2251
|
-
modalInstance:
|
|
2289
|
+
validate: V,
|
|
2290
|
+
onSubmitSuccess: c,
|
|
2291
|
+
openCollapsedDialog: Y,
|
|
2292
|
+
modalInstance: d
|
|
2252
2293
|
};
|
|
2253
2294
|
},
|
|
2254
2295
|
render() {
|
|
2255
2296
|
const e = () => {
|
|
2256
2297
|
if (!this.showFormResult)
|
|
2257
2298
|
return;
|
|
2258
|
-
const
|
|
2259
|
-
const
|
|
2299
|
+
const n = this.form.filter((o) => {
|
|
2300
|
+
const a = this.formSource[o.key];
|
|
2260
2301
|
switch (!0) {
|
|
2261
|
-
case typeof
|
|
2262
|
-
return
|
|
2263
|
-
case Array.isArray(
|
|
2264
|
-
return
|
|
2302
|
+
case typeof a == "string":
|
|
2303
|
+
return a !== "";
|
|
2304
|
+
case Array.isArray(a):
|
|
2305
|
+
return a.length !== 0;
|
|
2265
2306
|
default:
|
|
2266
|
-
return
|
|
2307
|
+
return a != null;
|
|
2267
2308
|
}
|
|
2268
|
-
}), t = (
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
u && !(u != null && u.collapsed) ? (a = this.formInstance) == null || a.resetFields(l) : this.resetFormField(l);
|
|
2309
|
+
}), t = (o) => {
|
|
2310
|
+
const a = this.formItems.find((l) => l.key === o);
|
|
2311
|
+
a && !a?.collapsed ? this.formInstance?.resetFields(o) : this.resetFormField(o);
|
|
2272
2312
|
};
|
|
2273
|
-
return
|
|
2313
|
+
return p(De, {
|
|
2274
2314
|
span: this.formColumns
|
|
2275
2315
|
}, {
|
|
2276
|
-
default: () => [
|
|
2316
|
+
default: () => [p(Ne, {
|
|
2277
2317
|
label: "搜索条件",
|
|
2278
2318
|
class: "mb-0!"
|
|
2279
2319
|
}, {
|
|
2280
|
-
default: () => [
|
|
2281
|
-
class: "w-full
|
|
2282
|
-
}, [
|
|
2320
|
+
default: () => [p("div", {
|
|
2321
|
+
class: "mt-5px w-full text-left"
|
|
2322
|
+
}, [p(tt, {
|
|
2283
2323
|
wrap: !0,
|
|
2284
2324
|
align: "center"
|
|
2285
2325
|
}, {
|
|
2286
|
-
default: () => [
|
|
2287
|
-
key:
|
|
2326
|
+
default: () => [n.length > 0 ? n.map((o) => p(Jt, {
|
|
2327
|
+
key: o.key,
|
|
2288
2328
|
closable: !0,
|
|
2289
|
-
onClose: () => t(
|
|
2329
|
+
onClose: () => t(o.key)
|
|
2290
2330
|
}, {
|
|
2291
|
-
default: () => [
|
|
2331
|
+
default: () => [p("div", {
|
|
2292
2332
|
class: "flex space-x-2"
|
|
2293
|
-
}, [
|
|
2333
|
+
}, [p("div", {
|
|
2294
2334
|
class: "text-#999"
|
|
2295
|
-
}, [
|
|
2335
|
+
}, [o.title, q(":")]), p("div", {
|
|
2296
2336
|
class: "text-#333"
|
|
2297
|
-
}, [
|
|
2298
|
-
...
|
|
2299
|
-
key:
|
|
2337
|
+
}, [it(this.formSource, {
|
|
2338
|
+
...o,
|
|
2339
|
+
key: o.key,
|
|
2300
2340
|
mode: "text"
|
|
2301
2341
|
})])])]
|
|
2302
|
-
})) :
|
|
2342
|
+
})) : p("div", {
|
|
2303
2343
|
class: "text-#999"
|
|
2304
|
-
}, [
|
|
2344
|
+
}, [q("暂无搜索条件")])]
|
|
2305
2345
|
})])]
|
|
2306
2346
|
})]
|
|
2307
2347
|
});
|
|
2308
|
-
},
|
|
2309
|
-
const
|
|
2348
|
+
}, r = () => {
|
|
2349
|
+
const n = [], t = this.footer ? {
|
|
2310
2350
|
span: this.formColumns
|
|
2311
2351
|
} : {
|
|
2312
2352
|
span: this.formActiosSpan
|
|
2313
2353
|
};
|
|
2314
|
-
if (this.searchable && (
|
|
2354
|
+
if (this.searchable && (n.push(p(W, {
|
|
2315
2355
|
type: "primary",
|
|
2316
2356
|
htmlType: "submit"
|
|
2317
2357
|
}, {
|
|
2318
|
-
default: () => [
|
|
2319
|
-
})), this.resetable &&
|
|
2358
|
+
default: () => [q("搜索")]
|
|
2359
|
+
})), this.resetable && n.push(p(W, {
|
|
2320
2360
|
type: "secondary",
|
|
2321
2361
|
onClick: () => this.resetFormFields()
|
|
2322
2362
|
}, {
|
|
2323
|
-
default: () => [
|
|
2324
|
-
}))), this.submitable && (
|
|
2363
|
+
default: () => [q("重置")]
|
|
2364
|
+
}))), this.submitable && (n.push(p(W, {
|
|
2325
2365
|
type: "primary",
|
|
2326
2366
|
htmlType: "submit"
|
|
2327
2367
|
}, {
|
|
2328
|
-
default: () => [
|
|
2329
|
-
})),
|
|
2368
|
+
default: () => [q("提交")]
|
|
2369
|
+
})), n.push(p(W, {
|
|
2330
2370
|
type: "secondary",
|
|
2331
2371
|
onClick: () => this.$emit("cancel")
|
|
2332
2372
|
}, {
|
|
2333
|
-
default: () => [
|
|
2334
|
-
}))), this.form.some((
|
|
2373
|
+
default: () => [q("取消")]
|
|
2374
|
+
}))), this.form.some((o) => !!o.collapsed) && (this.collapsedMode === "append" && n.push(p(W, {
|
|
2335
2375
|
onClick: this.toggleFormCollapsed
|
|
2336
2376
|
}, {
|
|
2337
2377
|
default: () => this.formCollspased ? "展开" : "收起",
|
|
2338
|
-
icon: () => this.formCollspased ?
|
|
2339
|
-
})), this.collapsedMode === "dialog" &&
|
|
2378
|
+
icon: () => this.formCollspased ? p(cn, null, null) : p(vn, null, null)
|
|
2379
|
+
})), this.collapsedMode === "dialog" && n.push(p(W, {
|
|
2340
2380
|
onClick: this.openCollapsedDialog
|
|
2341
2381
|
}, {
|
|
2342
2382
|
default: () => "高级搜索",
|
|
2343
|
-
icon: () =>
|
|
2344
|
-
}))), this.$slots.actions &&
|
|
2345
|
-
return
|
|
2346
|
-
default: () => [
|
|
2347
|
-
hideLabel: this.formItems.every((
|
|
2383
|
+
icon: () => p(xn, null, null)
|
|
2384
|
+
}))), this.$slots.actions && n.push(...this.$slots.actions()), n.length)
|
|
2385
|
+
return p(De, t, {
|
|
2386
|
+
default: () => [p(Ne, {
|
|
2387
|
+
hideLabel: this.formItems.every((o) => !!o.hideLabel),
|
|
2348
2388
|
contentClass: this.footer ? "form-footer" : ""
|
|
2349
2389
|
}, {
|
|
2350
|
-
default: () => [
|
|
2351
|
-
default: () => [
|
|
2390
|
+
default: () => [p(tt, null, ct(n) ? n : {
|
|
2391
|
+
default: () => [n]
|
|
2352
2392
|
})]
|
|
2353
2393
|
})]
|
|
2354
2394
|
});
|
|
2355
2395
|
};
|
|
2356
|
-
return
|
|
2396
|
+
return p("div", {
|
|
2357
2397
|
class: {
|
|
2358
2398
|
"form-render": !0,
|
|
2359
2399
|
"no-rules": Object.keys(this.formRules).length === 0
|
|
2360
2400
|
}
|
|
2361
|
-
}, [
|
|
2362
|
-
ref: (
|
|
2401
|
+
}, [p(tr, {
|
|
2402
|
+
ref: (n) => this.modalInstance = n
|
|
2363
2403
|
}, {
|
|
2364
|
-
default: () => [
|
|
2404
|
+
default: () => [p(Zt, Z({
|
|
2365
2405
|
name: this.formName
|
|
2366
2406
|
}, {
|
|
2367
2407
|
labelAlign: "right",
|
|
@@ -2369,49 +2409,45 @@ const be = /* @__PURE__ */ I({
|
|
|
2369
2409
|
rules: this.formRules,
|
|
2370
2410
|
onSubmitSuccess: this.onSubmitSuccess,
|
|
2371
2411
|
"auto-label-width": !0,
|
|
2372
|
-
ref: (
|
|
2412
|
+
ref: (n) => this.formInstance = n,
|
|
2373
2413
|
model: this.formSource
|
|
2374
2414
|
}), {
|
|
2375
|
-
default: () => [
|
|
2415
|
+
default: () => [p(Kt, {
|
|
2376
2416
|
cols: this.formColumns,
|
|
2377
2417
|
"col-gap": this.$props.colGap,
|
|
2378
2418
|
"row-gap": this.$props.rowGap
|
|
2379
2419
|
}, {
|
|
2380
|
-
default: () => [this.formItems.filter(() => this.formColumns !== 0).map((
|
|
2420
|
+
default: () => [this.formItems.filter(() => this.formColumns !== 0).map((n) => {
|
|
2381
2421
|
let t;
|
|
2382
|
-
return
|
|
2383
|
-
span:
|
|
2384
|
-
key:
|
|
2385
|
-
},
|
|
2422
|
+
return p(De, {
|
|
2423
|
+
span: n.span,
|
|
2424
|
+
key: n.key
|
|
2425
|
+
}, ct(t = it(this.formSource, n)) ? t : {
|
|
2386
2426
|
default: () => [t]
|
|
2387
2427
|
});
|
|
2388
|
-
}),
|
|
2428
|
+
}), r(), e()]
|
|
2389
2429
|
})]
|
|
2390
2430
|
})]
|
|
2391
2431
|
})]);
|
|
2392
2432
|
}
|
|
2393
2433
|
});
|
|
2394
|
-
function
|
|
2395
|
-
|
|
2396
|
-
}
|
|
2397
|
-
function _n(e) {
|
|
2398
|
-
const n = q(), r = O();
|
|
2434
|
+
function Hr(e) {
|
|
2435
|
+
const r = ee(), n = D();
|
|
2399
2436
|
function t() {
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
l && (r.value = l);
|
|
2437
|
+
const o = r?.proxy?.$refs?.[e];
|
|
2438
|
+
o && (n.value = o);
|
|
2403
2439
|
}
|
|
2404
|
-
return
|
|
2440
|
+
return te(t), Rt(t), n;
|
|
2405
2441
|
}
|
|
2406
|
-
const
|
|
2407
|
-
install(e,
|
|
2408
|
-
e.component("FormRender",
|
|
2442
|
+
const Ur = {
|
|
2443
|
+
install(e, r) {
|
|
2444
|
+
e.component("FormRender", Be);
|
|
2409
2445
|
}
|
|
2410
2446
|
};
|
|
2411
2447
|
export {
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2448
|
+
Be as FormRender,
|
|
2449
|
+
Xr as FormRenderResolver,
|
|
2450
|
+
Ur as default,
|
|
2451
|
+
Wr as defineForm,
|
|
2452
|
+
Hr as useForm
|
|
2417
2453
|
};
|