@witlink/components 0.0.4 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -12
- package/dist/index.cjs +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +437 -102
- package/dist/index.js +1147 -100
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.ts +100 -89
- package/dist/utils.js +136 -119
- package/package.json +14 -8
package/dist/index.js
CHANGED
|
@@ -1,7 +1,470 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { hasPermission as
|
|
3
|
-
import { UserCenterKey as
|
|
4
|
-
|
|
1
|
+
import { markRaw as Q, createElementBlock as P, openBlock as N, createElementVNode as M, defineComponent as V, mergeModels as H, useModel as ve, useSlots as ge, useAttrs as Se, resolveComponent as O, createBlock as z, mergeProps as F, createSlots as J, renderList as U, withCtx as E, unref as $, renderSlot as R, normalizeProps as he, guardReactiveProps as Ee, createVNode as T, ref as C, getCurrentInstance as X, render as q, h as A, computed as I, onMounted as ye, onUnmounted as Me, normalizeClass as Le, normalizeStyle as ae, isRef as Ne, withKeys as $e, withModifiers as se, Fragment as re, createTextVNode as Z, toDisplayString as ie, nextTick as le, shallowRef as W, shallowReadonly as Te, toValue as D, getCurrentScope as Be, onScopeDispose as Ae, watch as Oe, toRaw as je } from "vue";
|
|
2
|
+
import { isNullOrUndef as j, hasPermission as Pe } from "./utils.js";
|
|
3
|
+
import { UserCenterKey as Wt, buildTree as zt, exportFile as Ft, forEachTree as Ut, getButtonPermissions as It, getLocale as Vt, getMenuInfo as qt, getToken as Kt, getUserCenterParams as Ht, getUserCenterParamsByUrl as Xt, getUserInfo as Zt, is as Yt, isArray as Gt, isAsyncFunction as Qt, isBoolean as Jt, isClient as en, isDate as tn, isDef as nn, isElement as on, isFunction as an, isImageDom as sn, isNull as rn, isNumber as ln, isObject as cn, isPromise as un, isServer as dn, isString as pn, isUndef as fn, isWindow as mn, logoutToUserCenter as vn, removeAll as gn, removeLocale as hn, removeToken as yn, setLocale as _n, setMenuInfo as bn, setToken as xn, setUserCenterParams as wn, setUserInfo as Cn, toUserCenterConsole as kn } from "./utils.js";
|
|
4
|
+
import ce from "dayjs";
|
|
5
|
+
import { Drawer as L, App as De, Button as Re, ConfigProvider as We, Textarea as ze, message as Fe, Tooltip as Ue } from "ant-design-vue";
|
|
6
|
+
import { ElScrollbar as Ie } from "element-plus";
|
|
7
|
+
const Ve = {
|
|
8
|
+
class: "icon",
|
|
9
|
+
viewBox: "0 0 1024 1024",
|
|
10
|
+
width: "1.2em",
|
|
11
|
+
height: "1.2em"
|
|
12
|
+
};
|
|
13
|
+
function qe(e, t) {
|
|
14
|
+
return N(), P("svg", Ve, t[0] || (t[0] = [
|
|
15
|
+
M("path", {
|
|
16
|
+
fill: "currentColor",
|
|
17
|
+
d: "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8"
|
|
18
|
+
}, null, -1),
|
|
19
|
+
M("path", {
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
d: "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z"
|
|
22
|
+
}, null, -1)
|
|
23
|
+
]));
|
|
24
|
+
}
|
|
25
|
+
const Ke = Q({ name: "ant-design-plus", render: qe }), He = {
|
|
26
|
+
class: "icon",
|
|
27
|
+
viewBox: "0 0 1024 1024",
|
|
28
|
+
width: "1.2em",
|
|
29
|
+
height: "1.2em"
|
|
30
|
+
};
|
|
31
|
+
function Xe(e, t) {
|
|
32
|
+
return N(), P("svg", He, t[0] || (t[0] = [
|
|
33
|
+
M("path", {
|
|
34
|
+
fill: "currentColor",
|
|
35
|
+
d: "M872 474H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h720c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8"
|
|
36
|
+
}, null, -1)
|
|
37
|
+
]));
|
|
38
|
+
}
|
|
39
|
+
const Ze = Q({ name: "ant-design-minus", render: Xe }), Ye = /* @__PURE__ */ V({
|
|
40
|
+
inheritAttrs: !1,
|
|
41
|
+
__name: "index",
|
|
42
|
+
props: /* @__PURE__ */ H({
|
|
43
|
+
precision: {
|
|
44
|
+
type: Number
|
|
45
|
+
},
|
|
46
|
+
stringMode: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
customControls: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
value: {},
|
|
56
|
+
valueModifiers: {}
|
|
57
|
+
}),
|
|
58
|
+
emits: /* @__PURE__ */ H(["change"], ["update:value"]),
|
|
59
|
+
setup(e, { emit: t }) {
|
|
60
|
+
const n = ve(e, "value"), r = e, c = t, i = ge(), o = Se();
|
|
61
|
+
function a(p) {
|
|
62
|
+
if (j(p))
|
|
63
|
+
n.value = null, c("change", null);
|
|
64
|
+
else {
|
|
65
|
+
let h = p;
|
|
66
|
+
r.stringMode && (h = Number(h).toFixed(r.precision)), n.value !== h && (n.value = h, c("change", h));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function d() {
|
|
70
|
+
if (j(n.value))
|
|
71
|
+
return;
|
|
72
|
+
let p = n.value;
|
|
73
|
+
r.stringMode && (p = Number(p).toFixed(r.precision)), n.value = p;
|
|
74
|
+
}
|
|
75
|
+
function u() {
|
|
76
|
+
if (o.disabled) return;
|
|
77
|
+
const p = Number(n.value);
|
|
78
|
+
!j(o.min) && p <= Number(o.min) || a(p - 1);
|
|
79
|
+
}
|
|
80
|
+
function l() {
|
|
81
|
+
if (o.disabled) return;
|
|
82
|
+
const p = Number(n.value);
|
|
83
|
+
!j(o.max) && p >= Number(o.max) || a(p + 1);
|
|
84
|
+
}
|
|
85
|
+
return (p, h) => {
|
|
86
|
+
const b = Ze, w = Ke, x = O("a-input-number");
|
|
87
|
+
return N(), z(x, F({
|
|
88
|
+
value: n.value,
|
|
89
|
+
precision: e.precision,
|
|
90
|
+
stringMode: e.stringMode,
|
|
91
|
+
controls: !e.customControls,
|
|
92
|
+
onChange: a,
|
|
93
|
+
onBlur: d
|
|
94
|
+
}, p.$attrs), J({ _: 2 }, [
|
|
95
|
+
U(Object.keys($(i)), (f) => ({
|
|
96
|
+
name: f,
|
|
97
|
+
fn: E((m) => [
|
|
98
|
+
R(p.$slots, f, he(Ee(m)))
|
|
99
|
+
])
|
|
100
|
+
})),
|
|
101
|
+
e.customControls ? {
|
|
102
|
+
name: "addonBefore",
|
|
103
|
+
fn: E(() => [
|
|
104
|
+
M("div", {
|
|
105
|
+
class: "btn-control",
|
|
106
|
+
onClick: u
|
|
107
|
+
}, [
|
|
108
|
+
T(b, { class: "btn-icon" })
|
|
109
|
+
])
|
|
110
|
+
]),
|
|
111
|
+
key: "0"
|
|
112
|
+
} : void 0,
|
|
113
|
+
e.customControls ? {
|
|
114
|
+
name: "addonAfter",
|
|
115
|
+
fn: E(() => [
|
|
116
|
+
M("div", {
|
|
117
|
+
class: "btn-control",
|
|
118
|
+
onClick: l
|
|
119
|
+
}, [
|
|
120
|
+
T(w, { class: "btn-icon" })
|
|
121
|
+
])
|
|
122
|
+
]),
|
|
123
|
+
key: "1"
|
|
124
|
+
} : void 0
|
|
125
|
+
]), 1040, ["value", "precision", "stringMode", "controls"]);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}), Ge = /* @__PURE__ */ V({
|
|
129
|
+
__name: "index",
|
|
130
|
+
props: {
|
|
131
|
+
value: {},
|
|
132
|
+
// 最大可选择时间距离当日多长时间,默认0,代表当日
|
|
133
|
+
max: {
|
|
134
|
+
type: Number,
|
|
135
|
+
default: 0
|
|
136
|
+
},
|
|
137
|
+
maxUnit: {
|
|
138
|
+
type: String,
|
|
139
|
+
default: "day"
|
|
140
|
+
},
|
|
141
|
+
// 最小可选择时间距离当日多长时间,默认0,代表当日
|
|
142
|
+
min: {
|
|
143
|
+
type: Number,
|
|
144
|
+
default: 0
|
|
145
|
+
},
|
|
146
|
+
minUnit: {
|
|
147
|
+
type: String,
|
|
148
|
+
default: "day"
|
|
149
|
+
},
|
|
150
|
+
// 可选择时间间隔,默认60天
|
|
151
|
+
interval: {
|
|
152
|
+
type: Number,
|
|
153
|
+
default: 60
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
emits: ["update:value", "change"],
|
|
157
|
+
setup(e, { emit: t }) {
|
|
158
|
+
const n = e, r = t, c = C(), i = C(), o = (l) => {
|
|
159
|
+
const p = ce().add(n.max, n.maxUnit), h = ce().subtract(n.min, n.minUnit), b = n.interval;
|
|
160
|
+
if (!c.value || c.value.length === 0)
|
|
161
|
+
return l.isAfter(p) || l.isBefore(h);
|
|
162
|
+
const w = c.value[0] && (l.diff(c.value[0], "days") > b || l.isAfter(p));
|
|
163
|
+
return c.value[1] && (c.value[1].diff(l, "days") > b || l.isBefore(h)) || w;
|
|
164
|
+
}, a = (l) => {
|
|
165
|
+
l ? (c.value = [], i.value = []) : i.value = void 0;
|
|
166
|
+
}, d = (l) => {
|
|
167
|
+
r("update:value", l), r("change", l);
|
|
168
|
+
}, u = (l) => {
|
|
169
|
+
c.value = l;
|
|
170
|
+
};
|
|
171
|
+
return (l, p) => {
|
|
172
|
+
const h = O("a-range-picker");
|
|
173
|
+
return N(), z(h, F({
|
|
174
|
+
value: $(i) || e.value,
|
|
175
|
+
"disabled-date": o,
|
|
176
|
+
onChange: d,
|
|
177
|
+
onOpenChange: a,
|
|
178
|
+
onCalendarChange: u
|
|
179
|
+
}, l.$attrs), J({ _: 2 }, [
|
|
180
|
+
U(Object.keys(l.$slots), (b) => ({
|
|
181
|
+
name: b,
|
|
182
|
+
fn: E((w) => [
|
|
183
|
+
R(l.$slots, b)
|
|
184
|
+
])
|
|
185
|
+
}))
|
|
186
|
+
]), 1040, ["value"]);
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
function ee(e) {
|
|
191
|
+
e || (e = X());
|
|
192
|
+
const t = (e == null ? void 0 : e.provides) || {}, n = Qe(t, "configProvider"), r = t[n];
|
|
193
|
+
return Object.fromEntries(
|
|
194
|
+
Object.entries(r).map(([i, o]) => [i, $(o)])
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
function Qe(e, t) {
|
|
198
|
+
for (; e; ) {
|
|
199
|
+
const n = Reflect.ownKeys(e).find(
|
|
200
|
+
(r) => r === t || typeof r == "symbol" && r.description === t
|
|
201
|
+
);
|
|
202
|
+
if (n)
|
|
203
|
+
return n;
|
|
204
|
+
e = Object.getPrototypeOf(e);
|
|
205
|
+
}
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
function At(e) {
|
|
209
|
+
var n;
|
|
210
|
+
let t = (n = X()) == null ? void 0 : n.parent;
|
|
211
|
+
for (; t; ) {
|
|
212
|
+
if (t.type.name === e)
|
|
213
|
+
return t;
|
|
214
|
+
t = t.parent;
|
|
215
|
+
}
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
const Je = "data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.3125%205.5L2.3125%2012L7.3125%2018.5H22.3125V5.5H7.3125Z'%20stroke='%23272E3B'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M10.8125%209.5L15.8125%2014.5'%20stroke='%23272E3B'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M15.8125%209.5L10.8125%2014.5'%20stroke='%23272E3B'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e", et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
219
|
+
__proto__: null,
|
|
220
|
+
default: Je
|
|
221
|
+
}, Symbol.toStringTag, { value: "Module" })), tt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20aria-hidden='true'%20role='img'%20class='iconify%20iconify--logos'%20width='37.07'%20height='36'%20preserveAspectRatio='xMidYMid%20meet'%20viewBox='0%200%20256%20198'%3e%3cpath%20fill='%2341B883'%20d='M204.8%200H256L128%20220.8L0%200h97.92L128%2051.2L157.44%200h47.36Z'%3e%3c/path%3e%3cpath%20fill='%2341B883'%20d='m0%200l128%20220.8L256%200h-51.2L128%20132.48L50.56%200H0Z'%3e%3c/path%3e%3cpath%20fill='%2335495E'%20d='M50.56%200L128%20133.12L204.8%200h-47.36L128%2051.2L97.92%200H50.56Z'%3e%3c/path%3e%3c/svg%3e", nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
222
|
+
__proto__: null,
|
|
223
|
+
default: tt
|
|
224
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
225
|
+
function Ot(e) {
|
|
226
|
+
return (/* @__PURE__ */ Object.assign({ "/src/assets/svg/clear.svg": et, "/src/assets/vue.svg": nt }))[`/src/assets/${e}`].default;
|
|
227
|
+
}
|
|
228
|
+
let B;
|
|
229
|
+
L.destroy = function() {
|
|
230
|
+
const e = L.instanceArr || [], t = e.pop();
|
|
231
|
+
if (t && q(null, t.container), e.length > 0) {
|
|
232
|
+
const n = e[e.length - 1].instance;
|
|
233
|
+
Object.assign(n.component.props, {
|
|
234
|
+
contentWrapperStyle: { transform: null }
|
|
235
|
+
}), n.component.update();
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
L.destroyAll = function() {
|
|
239
|
+
(L.instanceArr || []).forEach((t) => {
|
|
240
|
+
q(null, t.container);
|
|
241
|
+
}), L.instanceArr = [];
|
|
242
|
+
};
|
|
243
|
+
function jt() {
|
|
244
|
+
var b, w;
|
|
245
|
+
const e = X(), { message: t, modal: n, notification: r } = De.useApp(), c = {
|
|
246
|
+
zh: "关闭",
|
|
247
|
+
en: "Close",
|
|
248
|
+
fr: "fermeture"
|
|
249
|
+
}, i = {
|
|
250
|
+
zh: "请输入",
|
|
251
|
+
en: "Please Enter",
|
|
252
|
+
fr: "Veuillez entrer"
|
|
253
|
+
}, o = ee(), a = ((w = (b = o == null ? void 0 : o.locale) == null ? void 0 : b.locale) == null ? void 0 : w.slice(0, 2)) || "en";
|
|
254
|
+
function d({ title: x, ...f }) {
|
|
255
|
+
const m = C();
|
|
256
|
+
return u({
|
|
257
|
+
title: x,
|
|
258
|
+
...f,
|
|
259
|
+
comp: ze,
|
|
260
|
+
props: {
|
|
261
|
+
placeholder: i[a],
|
|
262
|
+
autoSize: { minRows: 6 },
|
|
263
|
+
value: m,
|
|
264
|
+
"onUpdate:value": (s) => {
|
|
265
|
+
m.value = s;
|
|
266
|
+
},
|
|
267
|
+
...f.props
|
|
268
|
+
},
|
|
269
|
+
class: "modal-comp modal-comp-input",
|
|
270
|
+
type: "confirm",
|
|
271
|
+
onOk: () => new Promise((s, v) => {
|
|
272
|
+
f.onOk && (f.onOk(m.value) ? s(1) : v()), s(1);
|
|
273
|
+
})
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
function u({ title: x, comp: f, props: m, ...s }) {
|
|
277
|
+
const v = A(f, m), g = (s == null ? void 0 : s.type) ?? "info", y = {
|
|
278
|
+
title: x,
|
|
279
|
+
content: v,
|
|
280
|
+
width: "auto",
|
|
281
|
+
icon: null,
|
|
282
|
+
closable: !0,
|
|
283
|
+
maskClosable: !0,
|
|
284
|
+
centered: !0,
|
|
285
|
+
class: "modal-comp",
|
|
286
|
+
...s
|
|
287
|
+
};
|
|
288
|
+
switch (g) {
|
|
289
|
+
case "info":
|
|
290
|
+
B = n.info(y);
|
|
291
|
+
break;
|
|
292
|
+
case "warning":
|
|
293
|
+
B = n.warning(y);
|
|
294
|
+
break;
|
|
295
|
+
case "success":
|
|
296
|
+
B = n.success(y);
|
|
297
|
+
break;
|
|
298
|
+
case "confirm":
|
|
299
|
+
B = n.confirm(y);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
return B;
|
|
303
|
+
}
|
|
304
|
+
function l() {
|
|
305
|
+
B == null || B.destroy();
|
|
306
|
+
}
|
|
307
|
+
function p({ title: x, comp: f, props: m, ...s }) {
|
|
308
|
+
const v = s.getContainer || document.createDocumentFragment();
|
|
309
|
+
L.instanceArr || (L.instanceArr = []);
|
|
310
|
+
const g = L.instanceArr, y = g[g.length - 1];
|
|
311
|
+
let _;
|
|
312
|
+
if ((y == null ? void 0 : y.comp) === f) {
|
|
313
|
+
const k = y.instance;
|
|
314
|
+
Object.assign(k.component.props, { title: x, ...s }), k.component.update(), _ = y.compInstance, Object.assign(_.component.props, { ...m }), _.component.update();
|
|
315
|
+
} else {
|
|
316
|
+
if (y) {
|
|
317
|
+
const oe = y.instance;
|
|
318
|
+
Object.assign(oe.component.props, {
|
|
319
|
+
contentWrapperStyle: { transform: "translateX(-180px)" }
|
|
320
|
+
}), oe.component.update();
|
|
321
|
+
}
|
|
322
|
+
_ = A(f, m);
|
|
323
|
+
const k = {
|
|
324
|
+
default: () => A(
|
|
325
|
+
Ie,
|
|
326
|
+
{ style: { height: "100%" }, wrapStyle: { overflowX: "hidden" } },
|
|
327
|
+
_
|
|
328
|
+
)
|
|
329
|
+
};
|
|
330
|
+
s.footer === void 0 && Object.assign(k, {
|
|
331
|
+
footer: () => A(
|
|
332
|
+
Re,
|
|
333
|
+
{
|
|
334
|
+
onClick: () => {
|
|
335
|
+
L.destroy();
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
c[a]
|
|
339
|
+
)
|
|
340
|
+
});
|
|
341
|
+
const S = s.width || 992;
|
|
342
|
+
delete s.width;
|
|
343
|
+
const K = A(
|
|
344
|
+
L,
|
|
345
|
+
{
|
|
346
|
+
title: x,
|
|
347
|
+
width: S,
|
|
348
|
+
open: !0,
|
|
349
|
+
class: "drawer-comp",
|
|
350
|
+
footerStyle: {
|
|
351
|
+
textAlign: "right"
|
|
352
|
+
},
|
|
353
|
+
onClose: () => {
|
|
354
|
+
s != null && s.afterClose && s.afterClose(), L.destroy();
|
|
355
|
+
},
|
|
356
|
+
...s
|
|
357
|
+
},
|
|
358
|
+
k
|
|
359
|
+
), ke = o.getPrefixCls(), ne = A(
|
|
360
|
+
We,
|
|
361
|
+
{ ...o, prefixCls: ke },
|
|
362
|
+
{ default: () => K }
|
|
363
|
+
);
|
|
364
|
+
ne.appContext = e.appContext, q(ne, v), g.push({ instance: K, comp: f, compInstance: _, container: v });
|
|
365
|
+
}
|
|
366
|
+
return {
|
|
367
|
+
updateProps: (k) => {
|
|
368
|
+
Object.assign(_.component.props, { ...k }), _.component.update();
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
function h() {
|
|
373
|
+
L.destroy();
|
|
374
|
+
}
|
|
375
|
+
return {
|
|
376
|
+
message: t,
|
|
377
|
+
modal: n,
|
|
378
|
+
notification: r,
|
|
379
|
+
modalInput: d,
|
|
380
|
+
modalComp: u,
|
|
381
|
+
modalDestroy: l,
|
|
382
|
+
drawerComp: p,
|
|
383
|
+
drawerDestroy: h
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
const ot = /* @__PURE__ */ V({
|
|
387
|
+
inheritAttrs: !1,
|
|
388
|
+
__name: "index",
|
|
389
|
+
props: {
|
|
390
|
+
loadData: {
|
|
391
|
+
type: Function,
|
|
392
|
+
required: !0
|
|
393
|
+
},
|
|
394
|
+
formatSortParams: {
|
|
395
|
+
type: Boolean,
|
|
396
|
+
default: !0
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
setup(e, { expose: t }) {
|
|
400
|
+
const n = e, r = ge(), c = C([]), i = C(!1), o = C(0), a = C(1), d = C(10), u = C(), l = C(), p = {
|
|
401
|
+
zh: "共 {num} 条",
|
|
402
|
+
en: "Total {num} items",
|
|
403
|
+
fr: "Total de {num}"
|
|
404
|
+
}, h = ee(), b = I(() => {
|
|
405
|
+
var y, _;
|
|
406
|
+
return ((_ = (y = h == null ? void 0 : h.locale) == null ? void 0 : y.locale) == null ? void 0 : _.slice(0, 2)) || "en";
|
|
407
|
+
}), w = I(() => ({
|
|
408
|
+
total: o.value,
|
|
409
|
+
current: a.value,
|
|
410
|
+
pageSize: d.value,
|
|
411
|
+
showSizeChanger: !0,
|
|
412
|
+
size: "small",
|
|
413
|
+
showTotal: (g) => p[b.value].replace("{num}", g)
|
|
414
|
+
}));
|
|
415
|
+
function x() {
|
|
416
|
+
var g;
|
|
417
|
+
if (typeof n.loadData == "function") {
|
|
418
|
+
i.value = !0;
|
|
419
|
+
const y = { pageNo: a.value, pageSize: d.value };
|
|
420
|
+
n.formatSortParams && ((g = l.value) != null && g.orderMap) && (y[l.value.field + "SortField"] = l.value.orderMap), n.loadData(y, u.value, l.value).then((_) => {
|
|
421
|
+
i.value = !1, (_ == null ? void 0 : _.code) === 0 && (o.value = _.result.totalCount, c.value = _.result.data);
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function f(g, y, _) {
|
|
426
|
+
if (a.value = g.current, d.value = g.pageSize, u.value = y, _) {
|
|
427
|
+
const k = {
|
|
428
|
+
ascend: "asc",
|
|
429
|
+
descend: "desc"
|
|
430
|
+
};
|
|
431
|
+
_.orderMap = k[_.order] || "";
|
|
432
|
+
}
|
|
433
|
+
l.value = _, x();
|
|
434
|
+
}
|
|
435
|
+
function m(g, y) {
|
|
436
|
+
y.width = g;
|
|
437
|
+
}
|
|
438
|
+
function s() {
|
|
439
|
+
a.value = 1, x();
|
|
440
|
+
}
|
|
441
|
+
function v() {
|
|
442
|
+
a.value = 1, o.value = 0, c.value = [];
|
|
443
|
+
}
|
|
444
|
+
return t({
|
|
445
|
+
loadData: x,
|
|
446
|
+
refresh: s,
|
|
447
|
+
reset: v
|
|
448
|
+
}), (g, y) => {
|
|
449
|
+
const _ = O("a-table");
|
|
450
|
+
return N(), z(_, F({
|
|
451
|
+
class: "table-ex",
|
|
452
|
+
loading: $(i),
|
|
453
|
+
pagination: $(w),
|
|
454
|
+
dataSource: $(c),
|
|
455
|
+
onChange: f,
|
|
456
|
+
onResizeColumn: m
|
|
457
|
+
}, g.$attrs), J({ _: 2 }, [
|
|
458
|
+
U(Object.keys($(r)), (k) => ({
|
|
459
|
+
name: k,
|
|
460
|
+
fn: E((S) => [
|
|
461
|
+
k !== "emptyText" ? R(g.$slots, k, he(F({ key: 0 }, S))) : R(g.$slots, k, { key: 1 })
|
|
462
|
+
])
|
|
463
|
+
}))
|
|
464
|
+
]), 1040, ["loading", "pagination", "dataSource"]);
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
}), at = /* @__PURE__ */ V({
|
|
5
468
|
__name: "index",
|
|
6
469
|
props: {
|
|
7
470
|
leftMin: {
|
|
@@ -11,126 +474,710 @@ const k = /* @__PURE__ */ x({
|
|
|
11
474
|
leftMax: {
|
|
12
475
|
type: Number,
|
|
13
476
|
default: 0.3
|
|
477
|
+
},
|
|
478
|
+
bordered: {
|
|
479
|
+
type: Boolean,
|
|
480
|
+
default: !0
|
|
14
481
|
}
|
|
15
482
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
483
|
+
setup(e) {
|
|
484
|
+
const t = e, n = C(), r = C(), c = C({}), i = C({}), o = C(0.2);
|
|
485
|
+
function a(u) {
|
|
486
|
+
c.value = { width: `calc(${u * 100}% - 5px)` }, i.value = { width: `calc(${(1 - u) * 100}% - 5px)` };
|
|
487
|
+
}
|
|
488
|
+
function d() {
|
|
489
|
+
const u = n.value;
|
|
490
|
+
if (!u)
|
|
24
491
|
return;
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
492
|
+
const l = u.clientWidth, p = u.getBoundingClientRect(), h = p.left;
|
|
493
|
+
function b(x) {
|
|
494
|
+
x.preventDefault(), (x.clientX < p.left || x.clientX > p.right || x.clientY < p.top || x.clientY > p.bottom) && w();
|
|
495
|
+
const m = (x.clientX - h) / l;
|
|
496
|
+
m > t.leftMin && m < t.leftMax && (o.value = m, a(m));
|
|
30
497
|
}
|
|
31
|
-
function
|
|
32
|
-
document.removeEventListener("mousemove",
|
|
498
|
+
function w() {
|
|
499
|
+
document.removeEventListener("mousemove", b), document.removeEventListener("mouseup", w);
|
|
33
500
|
}
|
|
34
|
-
document.addEventListener("mousemove",
|
|
501
|
+
document.addEventListener("mousemove", b), document.addEventListener("mouseup", w);
|
|
35
502
|
}
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
}), (
|
|
503
|
+
return ye(() => {
|
|
504
|
+
a(o.value), r.value && r.value.addEventListener("mousedown", d, !1);
|
|
505
|
+
}), Me(() => {
|
|
506
|
+
r.value && r.value.removeEventListener("mousedown", d);
|
|
507
|
+
}), (u, l) => (N(), P("div", {
|
|
41
508
|
ref_key: "container",
|
|
42
|
-
ref:
|
|
43
|
-
class: "splitter"
|
|
509
|
+
ref: n,
|
|
510
|
+
class: Le(["wl-splitter", { bordered: e.bordered }])
|
|
44
511
|
}, [
|
|
45
|
-
|
|
512
|
+
M("div", {
|
|
46
513
|
class: "my-left",
|
|
47
|
-
style:
|
|
514
|
+
style: ae($(c))
|
|
48
515
|
}, [
|
|
49
|
-
|
|
516
|
+
R(u.$slots, "left")
|
|
50
517
|
], 4),
|
|
51
|
-
|
|
518
|
+
M("div", {
|
|
52
519
|
ref_key: "spliter",
|
|
53
|
-
ref:
|
|
520
|
+
ref: r,
|
|
54
521
|
style: { height: "100%", width: "10px" },
|
|
55
522
|
class: "my-spliter"
|
|
56
523
|
}, null, 512),
|
|
57
|
-
|
|
524
|
+
M("div", {
|
|
58
525
|
class: "my-right",
|
|
59
|
-
style:
|
|
526
|
+
style: ae($(i))
|
|
60
527
|
}, [
|
|
61
|
-
|
|
528
|
+
R(u.$slots, "right")
|
|
62
529
|
], 4)
|
|
63
|
-
],
|
|
64
|
-
}
|
|
65
|
-
}),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
530
|
+
], 2));
|
|
531
|
+
}
|
|
532
|
+
}), st = {
|
|
533
|
+
class: "icon",
|
|
534
|
+
width: "25",
|
|
535
|
+
height: "24",
|
|
536
|
+
viewBox: "0 0 25 24",
|
|
537
|
+
fill: "none",
|
|
538
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
539
|
+
};
|
|
540
|
+
function rt(e, t) {
|
|
541
|
+
return N(), P("svg", st, t[0] || (t[0] = [
|
|
542
|
+
M("path", {
|
|
543
|
+
d: "M7.3125 5.5L2.3125 12L7.3125 18.5H22.3125V5.5H7.3125Z",
|
|
544
|
+
stroke: "#272E3B",
|
|
545
|
+
"stroke-linecap": "round",
|
|
546
|
+
"stroke-linejoin": "round"
|
|
547
|
+
}, null, -1),
|
|
548
|
+
M("path", {
|
|
549
|
+
d: "M10.8125 9.5L15.8125 14.5",
|
|
550
|
+
stroke: "#272E3B",
|
|
551
|
+
"stroke-linecap": "round",
|
|
552
|
+
"stroke-linejoin": "round"
|
|
553
|
+
}, null, -1),
|
|
554
|
+
M("path", {
|
|
555
|
+
d: "M15.8125 9.5L10.8125 14.5",
|
|
556
|
+
stroke: "#272E3B",
|
|
557
|
+
"stroke-linecap": "round",
|
|
558
|
+
"stroke-linejoin": "round"
|
|
559
|
+
}, null, -1)
|
|
560
|
+
]));
|
|
561
|
+
}
|
|
562
|
+
const it = Q({ name: "local-clear", render: rt }), lt = { class: "nums-box" }, ct = { class: "btn-box" }, ut = /* @__PURE__ */ V({
|
|
563
|
+
inheritAttrs: !1,
|
|
564
|
+
__name: "index",
|
|
565
|
+
props: /* @__PURE__ */ H({
|
|
566
|
+
quickNums: {
|
|
567
|
+
type: Array,
|
|
568
|
+
default: () => [100, 500, 1e3, 1500, 2e3, 2500]
|
|
569
|
+
},
|
|
570
|
+
min: {
|
|
571
|
+
type: Number,
|
|
572
|
+
default: 0
|
|
573
|
+
},
|
|
574
|
+
max: {
|
|
575
|
+
type: Number,
|
|
576
|
+
default: 1e8
|
|
577
|
+
},
|
|
578
|
+
precision: {
|
|
579
|
+
type: Number,
|
|
580
|
+
default: 0
|
|
581
|
+
}
|
|
582
|
+
}, {
|
|
583
|
+
value: { type: String },
|
|
584
|
+
valueModifiers: {}
|
|
585
|
+
}),
|
|
586
|
+
emits: /* @__PURE__ */ H(["enter"], ["update:value"]),
|
|
587
|
+
setup(e, { emit: t }) {
|
|
588
|
+
const n = e, r = t, c = C(), i = C(), o = C(["7", "8", "9", "4", "5", "6", "1", "2", "3", "0", "00", "."]), a = ve(e, "value"), d = C(!1);
|
|
589
|
+
function u() {
|
|
590
|
+
d.value = !0;
|
|
591
|
+
}
|
|
592
|
+
function l() {
|
|
593
|
+
x();
|
|
594
|
+
}
|
|
595
|
+
function p(f) {
|
|
596
|
+
i.value.focus(), a.value = Number(f).toFixed(n.precision);
|
|
597
|
+
}
|
|
598
|
+
function h(f) {
|
|
599
|
+
if (i.value.focus(), j(a.value) || a.value === "") {
|
|
600
|
+
if (["00", "."].includes(f))
|
|
601
|
+
return;
|
|
602
|
+
a.value = f;
|
|
603
|
+
} else {
|
|
604
|
+
const m = String(a.value), s = c.value.getElementsByTagName("input")[0], v = s.selectionStart || 0, g = s.selectionEnd || 0;
|
|
605
|
+
a.value = `${m.slice(0, v)}${f}${m.slice(g)}`;
|
|
606
|
+
const y = v + f.length;
|
|
607
|
+
le(() => {
|
|
608
|
+
i.value.setSelectionRange(y, y);
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function b() {
|
|
613
|
+
if (i.value.focus(), j(a.value))
|
|
614
|
+
return;
|
|
615
|
+
const f = String(a.value);
|
|
616
|
+
if (f != null && f.length) {
|
|
617
|
+
const m = c.value.getElementsByTagName("input")[0], s = m.selectionStart || 0, v = m.selectionEnd || 0, g = s > 0 ? s - 1 : 0;
|
|
618
|
+
s === v ? a.value = f.slice(0, g) + f.slice(v) : a.value = f.slice(0, s) + f.slice(v), le(() => {
|
|
619
|
+
i.value.setSelectionRange(g, g);
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
function w() {
|
|
624
|
+
i.value.blur();
|
|
625
|
+
}
|
|
626
|
+
function x() {
|
|
627
|
+
const f = n.min, m = n.max;
|
|
628
|
+
let s = parseFloat(a.value || "0");
|
|
629
|
+
j(f) || (s = s > f ? s : f), j(m) || (s = s > m ? m : s), a.value = Number(s).toFixed(n.precision), d.value = !1, r("enter");
|
|
630
|
+
}
|
|
631
|
+
return (f, m) => {
|
|
632
|
+
const s = O("a-button"), v = O("a-col"), g = it, y = O("a-row"), _ = O("a-input"), k = O("a-popover");
|
|
633
|
+
return N(), P("div", {
|
|
634
|
+
class: "number-keyboard",
|
|
635
|
+
ref_key: "numberKeyboard",
|
|
636
|
+
ref: c
|
|
637
|
+
}, [
|
|
638
|
+
T(k, {
|
|
639
|
+
overlayClassName: "popover-keyboard",
|
|
640
|
+
trigger: "manual",
|
|
641
|
+
placement: "bottomLeft",
|
|
642
|
+
align: { offset: [0, -9] },
|
|
643
|
+
open: $(d),
|
|
644
|
+
"onUpdate:open": m[2] || (m[2] = (S) => Ne(d) ? d.value = S : null)
|
|
645
|
+
}, {
|
|
646
|
+
content: E(() => [
|
|
647
|
+
M("div", {
|
|
648
|
+
class: "keyboard-panel",
|
|
649
|
+
onMousedownCapture: m[0] || (m[0] = se(() => {
|
|
650
|
+
}, ["prevent", "stop"]))
|
|
651
|
+
}, [
|
|
652
|
+
T(y, { gutter: "8" }, {
|
|
653
|
+
default: E(() => [
|
|
654
|
+
T(v, { span: 18 }, {
|
|
655
|
+
default: E(() => [
|
|
656
|
+
M("div", lt, [
|
|
657
|
+
(N(!0), P(re, null, U(e.quickNums, (S) => (N(), z(s, {
|
|
658
|
+
class: "btn-num",
|
|
659
|
+
key: S,
|
|
660
|
+
onClick: (K) => p(S)
|
|
661
|
+
}, {
|
|
662
|
+
default: E(() => [
|
|
663
|
+
Z(ie(S), 1)
|
|
664
|
+
]),
|
|
665
|
+
_: 2
|
|
666
|
+
}, 1032, ["onClick"]))), 128)),
|
|
667
|
+
(N(!0), P(re, null, U($(o), (S) => (N(), z(s, {
|
|
668
|
+
class: "btn-num",
|
|
669
|
+
key: S,
|
|
670
|
+
onClick: (K) => h(S)
|
|
671
|
+
}, {
|
|
672
|
+
default: E(() => [
|
|
673
|
+
Z(ie(S), 1)
|
|
674
|
+
]),
|
|
675
|
+
_: 2
|
|
676
|
+
}, 1032, ["onClick"]))), 128))
|
|
677
|
+
])
|
|
678
|
+
]),
|
|
679
|
+
_: 1
|
|
680
|
+
}),
|
|
681
|
+
T(v, { span: 6 }, {
|
|
682
|
+
default: E(() => [
|
|
683
|
+
M("div", ct, [
|
|
684
|
+
T(s, {
|
|
685
|
+
class: "btn-clear",
|
|
686
|
+
onClick: b
|
|
687
|
+
}, {
|
|
688
|
+
default: E(() => [
|
|
689
|
+
T(g, { style: { width: "24px", height: "24px" } })
|
|
690
|
+
]),
|
|
691
|
+
_: 1
|
|
692
|
+
}),
|
|
693
|
+
T(s, {
|
|
694
|
+
class: "btn-enter",
|
|
695
|
+
type: "primary",
|
|
696
|
+
onClick: se(w, ["stop"])
|
|
697
|
+
}, {
|
|
698
|
+
default: E(() => m[3] || (m[3] = [
|
|
699
|
+
Z("Enter ")
|
|
700
|
+
])),
|
|
701
|
+
_: 1
|
|
702
|
+
})
|
|
703
|
+
])
|
|
704
|
+
]),
|
|
705
|
+
_: 1
|
|
706
|
+
})
|
|
707
|
+
]),
|
|
708
|
+
_: 1
|
|
709
|
+
})
|
|
710
|
+
], 32)
|
|
711
|
+
]),
|
|
712
|
+
default: E(() => [
|
|
713
|
+
T(_, F({
|
|
714
|
+
ref_key: "inputRef",
|
|
715
|
+
ref: i,
|
|
716
|
+
value: a.value,
|
|
717
|
+
"onUpdate:value": m[1] || (m[1] = (S) => a.value = S)
|
|
718
|
+
}, f.$attrs, {
|
|
719
|
+
onFocus: u,
|
|
720
|
+
onBlur: l,
|
|
721
|
+
onKeyup: $e(w, ["enter"])
|
|
722
|
+
}), null, 16, ["value"])
|
|
723
|
+
]),
|
|
724
|
+
_: 1
|
|
725
|
+
}, 8, ["open"])
|
|
726
|
+
], 512);
|
|
727
|
+
};
|
|
728
|
+
}
|
|
729
|
+
}), ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
71
730
|
__proto__: null,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
731
|
+
AInputNumberEx: Ye,
|
|
732
|
+
ARangePickerEx: Ge,
|
|
733
|
+
ATableEx: ot,
|
|
734
|
+
WlNumberKeyboard: ut,
|
|
735
|
+
WlSplitter: at
|
|
736
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
737
|
+
function _e(e) {
|
|
738
|
+
return Be() ? (Ae(e), !0) : !1;
|
|
739
|
+
}
|
|
740
|
+
const te = typeof window < "u" && typeof document < "u";
|
|
741
|
+
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
742
|
+
const dt = Object.prototype.toString, pt = (e) => dt.call(e) === "[object Object]";
|
|
743
|
+
function ft(e) {
|
|
744
|
+
let t;
|
|
745
|
+
function n() {
|
|
746
|
+
return t || (t = e()), t;
|
|
747
|
+
}
|
|
748
|
+
return n.reset = async () => {
|
|
749
|
+
const r = t;
|
|
750
|
+
t = void 0, r && await r;
|
|
751
|
+
}, n;
|
|
752
|
+
}
|
|
753
|
+
function Y(e) {
|
|
754
|
+
return Array.isArray(e) ? e : [e];
|
|
755
|
+
}
|
|
756
|
+
function mt(e, t, n = {}) {
|
|
757
|
+
const {
|
|
758
|
+
immediate: r = !0,
|
|
759
|
+
immediateCallback: c = !1
|
|
760
|
+
} = n, i = W(!1);
|
|
761
|
+
let o = null;
|
|
762
|
+
function a() {
|
|
763
|
+
o && (clearTimeout(o), o = null);
|
|
764
|
+
}
|
|
765
|
+
function d() {
|
|
766
|
+
i.value = !1, a();
|
|
767
|
+
}
|
|
768
|
+
function u(...l) {
|
|
769
|
+
c && e(), a(), i.value = !0, o = setTimeout(() => {
|
|
770
|
+
i.value = !1, o = null, e(...l);
|
|
771
|
+
}, D(t));
|
|
772
|
+
}
|
|
773
|
+
return r && (i.value = !0, te && u()), _e(d), {
|
|
774
|
+
isPending: Te(i),
|
|
775
|
+
start: u,
|
|
776
|
+
stop: d
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
function vt(e, t, n) {
|
|
780
|
+
return Oe(
|
|
781
|
+
e,
|
|
782
|
+
t,
|
|
783
|
+
{
|
|
784
|
+
...n,
|
|
785
|
+
immediate: !0
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
const gt = te ? window : void 0, be = te ? window.navigator : void 0;
|
|
790
|
+
function ht(e) {
|
|
791
|
+
var t;
|
|
792
|
+
const n = D(e);
|
|
793
|
+
return (t = n == null ? void 0 : n.$el) != null ? t : n;
|
|
794
|
+
}
|
|
795
|
+
function xe(...e) {
|
|
796
|
+
const t = [], n = () => {
|
|
797
|
+
t.forEach((a) => a()), t.length = 0;
|
|
798
|
+
}, r = (a, d, u, l) => (a.addEventListener(d, u, l), () => a.removeEventListener(d, u, l)), c = I(() => {
|
|
799
|
+
const a = Y(D(e[0])).filter((d) => d != null);
|
|
800
|
+
return a.every((d) => typeof d != "string") ? a : void 0;
|
|
801
|
+
}), i = vt(
|
|
802
|
+
() => {
|
|
803
|
+
var a, d;
|
|
804
|
+
return [
|
|
805
|
+
(d = (a = c.value) == null ? void 0 : a.map((u) => ht(u))) != null ? d : [gt].filter((u) => u != null),
|
|
806
|
+
Y(D(c.value ? e[1] : e[0])),
|
|
807
|
+
Y($(c.value ? e[2] : e[1])),
|
|
808
|
+
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
|
|
809
|
+
D(c.value ? e[3] : e[2])
|
|
810
|
+
];
|
|
811
|
+
},
|
|
812
|
+
([a, d, u, l]) => {
|
|
813
|
+
if (n(), !(a != null && a.length) || !(d != null && d.length) || !(u != null && u.length))
|
|
814
|
+
return;
|
|
815
|
+
const p = pt(l) ? { ...l } : l;
|
|
816
|
+
t.push(
|
|
817
|
+
...a.flatMap(
|
|
818
|
+
(h) => d.flatMap(
|
|
819
|
+
(b) => u.map((w) => r(h, b, w, p))
|
|
820
|
+
)
|
|
821
|
+
)
|
|
822
|
+
);
|
|
823
|
+
},
|
|
824
|
+
{ flush: "post" }
|
|
825
|
+
), o = () => {
|
|
826
|
+
i(), n();
|
|
827
|
+
};
|
|
828
|
+
return _e(n), o;
|
|
829
|
+
}
|
|
830
|
+
function yt() {
|
|
831
|
+
const e = W(!1), t = X();
|
|
832
|
+
return t && ye(() => {
|
|
833
|
+
e.value = !0;
|
|
834
|
+
}, t), e;
|
|
835
|
+
}
|
|
836
|
+
function we(e) {
|
|
837
|
+
const t = yt();
|
|
838
|
+
return I(() => (t.value, !!e()));
|
|
839
|
+
}
|
|
840
|
+
function de(e, t = {}) {
|
|
841
|
+
const {
|
|
842
|
+
controls: n = !1,
|
|
843
|
+
navigator: r = be
|
|
844
|
+
} = t, c = we(() => r && "permissions" in r), i = W(), o = typeof e == "string" ? { name: e } : e, a = W(), d = () => {
|
|
845
|
+
var l, p;
|
|
846
|
+
a.value = (p = (l = i.value) == null ? void 0 : l.state) != null ? p : "prompt";
|
|
847
|
+
};
|
|
848
|
+
xe(i, "change", d, { passive: !0 });
|
|
849
|
+
const u = ft(async () => {
|
|
850
|
+
if (c.value) {
|
|
851
|
+
if (!i.value)
|
|
852
|
+
try {
|
|
853
|
+
i.value = await r.permissions.query(o);
|
|
854
|
+
} catch {
|
|
855
|
+
i.value = void 0;
|
|
856
|
+
} finally {
|
|
857
|
+
d();
|
|
858
|
+
}
|
|
859
|
+
if (n)
|
|
860
|
+
return je(i.value);
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
return u(), n ? {
|
|
864
|
+
state: a,
|
|
865
|
+
isSupported: c,
|
|
866
|
+
query: u
|
|
867
|
+
} : a;
|
|
868
|
+
}
|
|
869
|
+
function _t(e = {}) {
|
|
870
|
+
const {
|
|
871
|
+
navigator: t = be,
|
|
872
|
+
read: n = !1,
|
|
873
|
+
source: r,
|
|
874
|
+
copiedDuring: c = 1500,
|
|
875
|
+
legacy: i = !1
|
|
876
|
+
} = e, o = we(() => t && "clipboard" in t), a = de("clipboard-read"), d = de("clipboard-write"), u = I(() => o.value || i), l = W(""), p = W(!1), h = mt(() => p.value = !1, c, { immediate: !1 });
|
|
877
|
+
async function b() {
|
|
878
|
+
let s = !(o.value && m(a.value));
|
|
879
|
+
if (!s)
|
|
880
|
+
try {
|
|
881
|
+
l.value = await t.clipboard.readText();
|
|
882
|
+
} catch {
|
|
883
|
+
s = !0;
|
|
884
|
+
}
|
|
885
|
+
s && (l.value = f());
|
|
886
|
+
}
|
|
887
|
+
u.value && n && xe(["copy", "cut"], b, { passive: !0 });
|
|
888
|
+
async function w(s = D(r)) {
|
|
889
|
+
if (u.value && s != null) {
|
|
890
|
+
let v = !(o.value && m(d.value));
|
|
891
|
+
if (!v)
|
|
892
|
+
try {
|
|
893
|
+
await t.clipboard.writeText(s);
|
|
894
|
+
} catch {
|
|
895
|
+
v = !0;
|
|
896
|
+
}
|
|
897
|
+
v && x(s), l.value = s, p.value = !0, h.start();
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
function x(s) {
|
|
901
|
+
const v = document.createElement("textarea");
|
|
902
|
+
v.value = s ?? "", v.style.position = "absolute", v.style.opacity = "0", document.body.appendChild(v), v.select(), document.execCommand("copy"), v.remove();
|
|
903
|
+
}
|
|
904
|
+
function f() {
|
|
905
|
+
var s, v, g;
|
|
906
|
+
return (g = (v = (s = document == null ? void 0 : document.getSelection) == null ? void 0 : s.call(document)) == null ? void 0 : v.toString()) != null ? g : "";
|
|
907
|
+
}
|
|
908
|
+
function m(s) {
|
|
909
|
+
return s === "granted" || s === "prompt";
|
|
910
|
+
}
|
|
911
|
+
return {
|
|
912
|
+
isSupported: u,
|
|
913
|
+
text: l,
|
|
914
|
+
copied: p,
|
|
915
|
+
copy: w
|
|
916
|
+
};
|
|
917
|
+
}
|
|
918
|
+
const bt = _t();
|
|
919
|
+
let G;
|
|
920
|
+
const xt = {
|
|
921
|
+
mounted(e, t, n) {
|
|
922
|
+
var o, a;
|
|
923
|
+
const r = ee(n.ctx), c = ((a = (o = r == null ? void 0 : r.locale) == null ? void 0 : o.locale) == null ? void 0 : a.slice(0, 2)) || "en", i = {
|
|
924
|
+
zh: "复制成功",
|
|
925
|
+
en: "Copy successfully",
|
|
926
|
+
fr: "Copie réussie"
|
|
927
|
+
};
|
|
928
|
+
G = () => {
|
|
929
|
+
bt.copy(t.value), Fe.success(i[c]);
|
|
930
|
+
}, e.addEventListener("click", G);
|
|
931
|
+
},
|
|
932
|
+
unmounted(e) {
|
|
933
|
+
e.removeEventListener("click", G);
|
|
934
|
+
}
|
|
935
|
+
}, wt = {
|
|
936
|
+
beforeMount(e, t, n) {
|
|
937
|
+
const r = t.value, c = {
|
|
938
|
+
letterNumber: /^\w*$/,
|
|
939
|
+
// 字母和数字
|
|
940
|
+
price: /^(\d*|(\d+\.\d{0,2}))$/,
|
|
941
|
+
phone: /^\d{0,11}$/,
|
|
942
|
+
number: /^\d*$/,
|
|
943
|
+
negativePrice: /^\-?(\d*|(\d+\.\d{0,2}))$/,
|
|
944
|
+
//负数金额
|
|
945
|
+
loginVerify: /^[0-9a-zA-Z]{0,4}$/,
|
|
946
|
+
verify: /^\d{0,6}$/,
|
|
947
|
+
idCard: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/
|
|
948
|
+
//身份证号(15位、18位数字),最后一位是校验位,可能为数字或字符X
|
|
949
|
+
}, i = r instanceof RegExp ? r : t.arg && c[t.arg] ? c[t.arg] : null;
|
|
950
|
+
e._handleInput = (o) => {
|
|
951
|
+
if (o.isTrusted && !(!o.isComposing && o.inputType === "insertCompositionText" && o.data)) {
|
|
952
|
+
const a = i == null ? void 0 : i.test(o.target.value);
|
|
953
|
+
if (e._input = a ? o.target.value : e._input, o.target.value = "", o.target.value = e._input, !a)
|
|
954
|
+
o.target.selectionStart = e._start, o.target.selectionEnd = e._end;
|
|
955
|
+
else
|
|
956
|
+
switch (o.inputType) {
|
|
957
|
+
case "deleteContentForward":
|
|
958
|
+
//delete
|
|
959
|
+
case "deleteByDrag":
|
|
960
|
+
//dropout
|
|
961
|
+
case "deleteByCut":
|
|
962
|
+
o.target.selectionStart = e._start, o.target.selectionEnd = e._start;
|
|
963
|
+
break;
|
|
964
|
+
case "deleteContentBackward":
|
|
965
|
+
o.target.selectionStart = e._start === e._end ? e._start - 1 : e._start, o.target.selectionEnd = e._start === e._end ? e._start - 1 : e._start;
|
|
966
|
+
break;
|
|
967
|
+
case "insertFromPaste":
|
|
968
|
+
//粘贴
|
|
969
|
+
case "insertFromDrop":
|
|
970
|
+
const u = o.dataTransfer || o.clipboardData || null;
|
|
971
|
+
if (u) {
|
|
972
|
+
const l = u.getData("text") || "";
|
|
973
|
+
o.target.selectionStart = e._start + l.length, o.target.selectionEnd = e._start + l.length;
|
|
974
|
+
}
|
|
975
|
+
break;
|
|
976
|
+
case "insertText":
|
|
977
|
+
//insert
|
|
978
|
+
case "insertCompositionText":
|
|
979
|
+
o.target.selectionStart = e._start + 1, o.target.selectionEnd = e._start + 1;
|
|
980
|
+
break;
|
|
981
|
+
}
|
|
982
|
+
const d = new InputEvent("input", {
|
|
983
|
+
isComposing: !1
|
|
984
|
+
});
|
|
985
|
+
o.target.dispatchEvent(d);
|
|
986
|
+
}
|
|
987
|
+
}, e._handleKeydown = (o) => {
|
|
988
|
+
const a = i == null ? void 0 : i.test(o.target.value);
|
|
989
|
+
e._input = a ? o.target.value : "", e._start = o.target.selectionStart, e._end = o.target.selectionEnd;
|
|
990
|
+
}, e._handleDrop = (o) => {
|
|
991
|
+
o.stopPropagation();
|
|
992
|
+
}, n.type === "input" && (e.addEventListener("input", e._handleInput), e.addEventListener("keydown", e._handleKeydown), e.addEventListener("drop", e._handleDrop));
|
|
993
|
+
},
|
|
994
|
+
unmounted(e) {
|
|
995
|
+
e._handleInput && e.removeEventListener("input", e._handleInput), e._handleKeydown && e.removeEventListener("keydown", e._handleKeydown), e._handleDrop && e.removeEventListener("drop", e._handleDrop);
|
|
996
|
+
}
|
|
997
|
+
};
|
|
998
|
+
function pe(e, t, n) {
|
|
999
|
+
const r = t.value;
|
|
1000
|
+
if (r) {
|
|
1001
|
+
const c = r / 2;
|
|
1002
|
+
e.style.marginLeft = `-${c}px`, e.style.marginRight = `-${c}px`;
|
|
1003
|
+
const i = n.children;
|
|
1004
|
+
i != null && i.length && i[0].children.forEach((o) => {
|
|
1005
|
+
if (o.component) {
|
|
1006
|
+
const a = o.el;
|
|
1007
|
+
a != null && a.style && (a.style.paddingLeft = c + "px", a.style.paddingRight = c + "px");
|
|
1008
|
+
} else Array.isArray(o.children) && o.children.forEach((a) => {
|
|
1009
|
+
const d = a.el;
|
|
1010
|
+
d != null && d.style && (d.style.paddingLeft = c + "px", d.style.paddingRight = c + "px");
|
|
1011
|
+
});
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
const Ct = {
|
|
1016
|
+
beforeMount(e) {
|
|
1017
|
+
e.classList.add("ant-row"), e.style.display = "flex", e.style.flexWrap = "wrap", e.style.flexDirection = "row", e.style.minWidth = 0;
|
|
1018
|
+
},
|
|
1019
|
+
mounted(e, t, n) {
|
|
1020
|
+
pe(e, t, n);
|
|
1021
|
+
},
|
|
1022
|
+
updated(e, t, n, r) {
|
|
1023
|
+
pe(e, t, n);
|
|
1024
|
+
}
|
|
1025
|
+
}, kt = {
|
|
1026
|
+
beforeMount(e, t) {
|
|
1027
|
+
e.classList.add("ant-col", `ant-col-${t.value}`);
|
|
1028
|
+
const n = t.value / 24 * 100;
|
|
1029
|
+
e.style.position = "relative", e.style.flex = `0 0 ${n}%`, e.style.maxWidth = `${n}%`;
|
|
1030
|
+
}
|
|
1031
|
+
}, St = {
|
|
1032
|
+
mounted(e, t, n) {
|
|
1033
|
+
fe(e, t);
|
|
1034
|
+
},
|
|
1035
|
+
updated(e, t) {
|
|
1036
|
+
if (e._tooltipVNode) {
|
|
1037
|
+
const { value: n } = t, {
|
|
1038
|
+
content: r = "",
|
|
1039
|
+
enabled: c = !0,
|
|
1040
|
+
padding: i = 8
|
|
1041
|
+
// 默认左右间距8px,用来判断文本的测量宽度是否超出元素宽度
|
|
1042
|
+
} = typeof n == "string" ? { content: n } : n;
|
|
1043
|
+
if (!c)
|
|
1044
|
+
e.tooltipDisabled = !0;
|
|
1045
|
+
else if (t.modifiers.exceed) {
|
|
1046
|
+
const o = e.originWidth, a = Ce(r);
|
|
1047
|
+
e.tooltipDisabled = a < o - i * 2;
|
|
1048
|
+
}
|
|
1049
|
+
e._tooltipVNode.component.props.title = r, e._tooltipVNode.component.props.trigger = e.tooltipDisabled ? "manual" : "hover", e._tooltipVNode.component.update();
|
|
1050
|
+
} else
|
|
1051
|
+
fe(e, t);
|
|
1052
|
+
},
|
|
1053
|
+
unmounted(e) {
|
|
1054
|
+
e._tooltipContainer && (q(null, e._tooltipContainer), e._tooltipContainer = null, e._tooltipVNode = null);
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
function fe(e, t) {
|
|
1058
|
+
const { value: n } = t, {
|
|
1059
|
+
content: r = "",
|
|
1060
|
+
placement: c = "top",
|
|
1061
|
+
trigger: i = "hover",
|
|
1062
|
+
enabled: o = !0,
|
|
1063
|
+
padding: a = 8,
|
|
1064
|
+
// 默认左右间距8px,用来判断文本的测量宽度是否超出元素宽度
|
|
1065
|
+
...d
|
|
1066
|
+
} = typeof n == "string" ? { content: n } : n;
|
|
1067
|
+
if (!o)
|
|
1068
|
+
e.tooltipDisabled = !0;
|
|
1069
|
+
else if (t.modifiers.exceed) {
|
|
1070
|
+
const u = e.clientWidth, l = Ce(r);
|
|
1071
|
+
e.originWidth = u, e.tooltipDisabled = l < u - a * 2;
|
|
1072
|
+
}
|
|
1073
|
+
if (!e.tooltipDisabled) {
|
|
1074
|
+
const u = A(
|
|
1075
|
+
Ue,
|
|
1076
|
+
{
|
|
1077
|
+
title: r,
|
|
1078
|
+
placement: c,
|
|
1079
|
+
trigger: i,
|
|
1080
|
+
...d
|
|
1081
|
+
},
|
|
1082
|
+
// 默认插槽内容
|
|
1083
|
+
{
|
|
1084
|
+
default: () => {
|
|
1085
|
+
const p = Array.from(e.attributes).reduce(
|
|
1086
|
+
(h, b) => (h[b.name] = b.value, h),
|
|
1087
|
+
{}
|
|
1088
|
+
);
|
|
1089
|
+
return A(e.tagName, { ...p, innerHTML: e.innerHTML });
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
), l = document.createElement("div");
|
|
1093
|
+
q(u, l), e._tooltipVNode = u, e._tooltipContainer = l, e.replaceWith(l.firstElementChild);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
function Ce(e, t) {
|
|
1097
|
+
const r = document.createElement("canvas").getContext("2d");
|
|
1098
|
+
return r.font = "14px Arial", r.measureText(e).width;
|
|
1099
|
+
}
|
|
1100
|
+
const Et = {
|
|
1101
|
+
beforeMount(e, t) {
|
|
1102
|
+
const { value: n } = t;
|
|
1103
|
+
n && (Pe(n) || setTimeout(() => {
|
|
1104
|
+
var c;
|
|
1105
|
+
(c = e.parentNode) == null || c.removeChild(e);
|
|
79
1106
|
}, 50));
|
|
80
1107
|
}
|
|
81
|
-
},
|
|
1108
|
+
}, me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
82
1109
|
__proto__: null,
|
|
83
|
-
|
|
1110
|
+
col: kt,
|
|
1111
|
+
copy: xt,
|
|
1112
|
+
inputlimit: wt,
|
|
1113
|
+
permission: Et,
|
|
1114
|
+
row: Ct,
|
|
1115
|
+
tooltip: St
|
|
84
1116
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
85
|
-
function
|
|
86
|
-
Object.keys(
|
|
87
|
-
|
|
88
|
-
}), Object.keys(
|
|
89
|
-
|
|
1117
|
+
function Mt(e) {
|
|
1118
|
+
Object.keys(ue).forEach((t) => {
|
|
1119
|
+
e.component(t, ue[t]);
|
|
1120
|
+
}), Object.keys(me).forEach((t) => {
|
|
1121
|
+
e.directive(t, me[t]);
|
|
90
1122
|
});
|
|
91
1123
|
}
|
|
92
|
-
const
|
|
1124
|
+
const Pt = { install: Mt };
|
|
93
1125
|
export {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1126
|
+
Ye as AInputNumberEx,
|
|
1127
|
+
Ge as ARangePickerEx,
|
|
1128
|
+
ot as ATableEx,
|
|
1129
|
+
Wt as UserCenterKey,
|
|
1130
|
+
ut as WlNumberKeyboard,
|
|
1131
|
+
at as WlSplitter,
|
|
1132
|
+
zt as buildTree,
|
|
1133
|
+
kt as col,
|
|
1134
|
+
xt as copy,
|
|
1135
|
+
Pt as default,
|
|
1136
|
+
Ft as exportFile,
|
|
1137
|
+
Ut as forEachTree,
|
|
1138
|
+
It as getButtonPermissions,
|
|
1139
|
+
Vt as getLocale,
|
|
1140
|
+
qt as getMenuInfo,
|
|
1141
|
+
Kt as getToken,
|
|
1142
|
+
Ht as getUserCenterParams,
|
|
1143
|
+
Xt as getUserCenterParamsByUrl,
|
|
1144
|
+
Zt as getUserInfo,
|
|
1145
|
+
Pe as hasPermission,
|
|
1146
|
+
wt as inputlimit,
|
|
1147
|
+
Yt as is,
|
|
1148
|
+
Gt as isArray,
|
|
1149
|
+
Qt as isAsyncFunction,
|
|
1150
|
+
Jt as isBoolean,
|
|
1151
|
+
en as isClient,
|
|
1152
|
+
tn as isDate,
|
|
1153
|
+
nn as isDef,
|
|
1154
|
+
on as isElement,
|
|
1155
|
+
an as isFunction,
|
|
1156
|
+
sn as isImageDom,
|
|
1157
|
+
rn as isNull,
|
|
1158
|
+
j as isNullOrUndef,
|
|
1159
|
+
ln as isNumber,
|
|
1160
|
+
cn as isObject,
|
|
1161
|
+
un as isPromise,
|
|
1162
|
+
dn as isServer,
|
|
1163
|
+
pn as isString,
|
|
1164
|
+
fn as isUndef,
|
|
1165
|
+
mn as isWindow,
|
|
1166
|
+
vn as logoutToUserCenter,
|
|
1167
|
+
Et as permission,
|
|
1168
|
+
gn as removeAll,
|
|
1169
|
+
hn as removeLocale,
|
|
1170
|
+
yn as removeToken,
|
|
1171
|
+
Ct as row,
|
|
1172
|
+
_n as setLocale,
|
|
1173
|
+
bn as setMenuInfo,
|
|
1174
|
+
xn as setToken,
|
|
1175
|
+
wn as setUserCenterParams,
|
|
1176
|
+
Cn as setUserInfo,
|
|
1177
|
+
kn as toUserCenterConsole,
|
|
1178
|
+
St as tooltip,
|
|
1179
|
+
ee as useConfigProvider,
|
|
1180
|
+
At as useFindParent,
|
|
1181
|
+
jt as useModal,
|
|
1182
|
+
Ot as useRequire
|
|
136
1183
|
};
|