x-essential-lib 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +237 -255
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.inner-left-enter-active,.inner-right-enter-active{transition:transform .35s ease}.inner-left-enter-from{transform:translate(-100%)}.inner-right-enter-from{transform:translate(100%)}.inner-left-enter-to,.inner-right-enter-to{transform:translate(0)}.x-cont[data-v-a8f3d91f]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-a8f3d91f]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-a8f3d91f]{transform-origin:20px 20px;animation:lds-spinner-a8f3d91f 1.2s linear infinite}.lds-spinner div[data-v-a8f3d91f]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-a8f3d91f]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-a8f3d91f]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-a8f3d91f]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-a8f3d91f]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-a8f3d91f]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-a8f3d91f]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-a8f3d91f]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-a8f3d91f]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-a8f3d91f]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-a8f3d91f]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-a8f3d91f{0%{opacity:1}to{opacity:0}}.x-cont[data-v-70ed4b89]{position:absolute;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
import { VAlert as
|
|
3
|
-
import { ref as m, computed as f, onMounted as
|
|
4
|
-
import { useLocale as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
2
|
+
import { VAlert as ge, VBtn as he, VCard as _e, VCardActions as xe, VCardText as ye, VCardTitle as we, VDialog as ke, VForm as be, VTextField as Ce } from "vuetify/lib/components/index.mjs";
|
|
3
|
+
import { ref as m, computed as f, onMounted as S, onBeforeUnmount as R, defineComponent as T, watch as E, resolveComponent as v, openBlock as V, createBlock as A, unref as W, isRef as F, withKeys as H, withModifiers as $, withCtx as g, createVNode as _, createTextVNode as C, toDisplayString as b, createElementBlock as z, normalizeStyle as Ve, pushScopeId as De, popScopeId as qe, createElementVNode as h, reactive as Se, Fragment as Re, renderList as Te } from "vue";
|
|
4
|
+
import { useLocale as X, useTheme as K, useDisplay as Oe } from "vuetify/lib/framework.mjs";
|
|
5
|
+
import { defineStore as oe } from "pinia";
|
|
6
|
+
import { useRouter as re, useRoute as Ie } from "vue-router";
|
|
7
|
+
import { useI18n as Pe } from "vue-i18n";
|
|
8
|
+
import je from "axios";
|
|
9
|
+
const le = oe("viewMgr", () => {
|
|
9
10
|
const e = m([]);
|
|
10
11
|
function n() {
|
|
11
12
|
return e.value.length <= 0;
|
|
@@ -25,7 +26,7 @@ const ce = se("viewMgr", () => {
|
|
|
25
26
|
}
|
|
26
27
|
return { isEmpty: n, hasView: t, addView: o, delView: r, popView: a };
|
|
27
28
|
});
|
|
28
|
-
function
|
|
29
|
+
function Ee(e) {
|
|
29
30
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(n, t) {
|
|
30
31
|
var o = e.get(n);
|
|
31
32
|
o ? o.push(t) : e.set(n, [t]);
|
|
@@ -41,8 +42,8 @@ function Be(e) {
|
|
|
41
42
|
});
|
|
42
43
|
} };
|
|
43
44
|
}
|
|
44
|
-
const
|
|
45
|
-
async function
|
|
45
|
+
const c = Ee();
|
|
46
|
+
async function ft(e) {
|
|
46
47
|
return new Promise((n) => {
|
|
47
48
|
setTimeout(n, e);
|
|
48
49
|
});
|
|
@@ -57,7 +58,7 @@ async function G(e, n, t) {
|
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
function J(e, n) {
|
|
60
|
-
const t =
|
|
61
|
+
const t = le(), o = f({
|
|
61
62
|
get() {
|
|
62
63
|
return t.hasView(e);
|
|
63
64
|
},
|
|
@@ -67,73 +68,73 @@ function J(e, n) {
|
|
|
67
68
|
}), r = (a) => {
|
|
68
69
|
n == null || n(a), o.value = !0;
|
|
69
70
|
};
|
|
70
|
-
return
|
|
71
|
-
|
|
72
|
-
}),
|
|
73
|
-
|
|
71
|
+
return S(() => {
|
|
72
|
+
c.on(e, r);
|
|
73
|
+
}), R(() => {
|
|
74
|
+
c.off(e, r);
|
|
74
75
|
}), { open: o };
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
+
const $e = /* @__PURE__ */ T({
|
|
77
78
|
__name: "index",
|
|
78
79
|
setup(e) {
|
|
79
|
-
const n =
|
|
80
|
+
const n = X(), { open: t } = J("confirmDlg"), o = m(""), r = m(""), a = m(), l = m(), s = f(() => {
|
|
80
81
|
var d;
|
|
81
82
|
return ((d = a.value) == null ? void 0 : d.color) ?? "primary";
|
|
82
83
|
}), p = f(() => {
|
|
83
84
|
var d;
|
|
84
85
|
return ((d = a.value) == null ? void 0 : d.text) ?? n.t("cancel");
|
|
85
|
-
}),
|
|
86
|
+
}), i = f(() => {
|
|
86
87
|
var d;
|
|
87
88
|
return ((d = l.value) == null ? void 0 : d.color) ?? "primary";
|
|
88
|
-
}),
|
|
89
|
+
}), y = f(() => {
|
|
89
90
|
var d;
|
|
90
91
|
return ((d = l.value) == null ? void 0 : d.text) ?? n.t("confirm");
|
|
91
92
|
});
|
|
92
|
-
let
|
|
93
|
+
let O = 0, D = !1;
|
|
93
94
|
const M = (d) => {
|
|
94
|
-
o.value = d.title, r.value = d.text, a.value = d.cancel, l.value = d.confirm,
|
|
95
|
+
o.value = d.title, r.value = d.text, a.value = d.cancel, l.value = d.confirm, O = d.seq, D = !1, t.value = !0;
|
|
95
96
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}),
|
|
99
|
-
|
|
97
|
+
S(() => {
|
|
98
|
+
c.on("confirmDlg", M);
|
|
99
|
+
}), R(() => {
|
|
100
|
+
c.off("confirmDlg", M);
|
|
100
101
|
});
|
|
101
102
|
const B = () => {
|
|
102
|
-
t.value = !1, D || (
|
|
103
|
+
t.value = !1, D || (c.emit("confirmDlgResult" + O, !0), D = !0);
|
|
103
104
|
};
|
|
104
|
-
return
|
|
105
|
-
!d && !D && (
|
|
106
|
-
}), (d,
|
|
107
|
-
const
|
|
108
|
-
return V(), A(
|
|
109
|
-
modelValue:
|
|
110
|
-
"onUpdate:modelValue":
|
|
105
|
+
return E(t, (d) => {
|
|
106
|
+
!d && !D && (c.emit("confirmDlgResult" + O, !1), D = !0);
|
|
107
|
+
}), (d, w) => {
|
|
108
|
+
const q = v("v-card-title"), L = v("v-card-text"), I = v("v-btn"), u = v("v-card-actions"), x = v("v-card"), N = v("v-dialog");
|
|
109
|
+
return V(), A(N, {
|
|
110
|
+
modelValue: W(t),
|
|
111
|
+
"onUpdate:modelValue": w[1] || (w[1] = (P) => F(t) ? t.value = P : null),
|
|
111
112
|
onKeydown: [
|
|
112
|
-
|
|
113
|
-
|
|
113
|
+
w[2] || (w[2] = H($((P) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
114
|
+
H($(B, ["stop", "prevent"]), ["enter"])
|
|
114
115
|
],
|
|
115
116
|
transition: "dialog-top-transition",
|
|
116
117
|
"max-width": "600px"
|
|
117
118
|
}, {
|
|
118
119
|
default: g(() => [
|
|
119
|
-
|
|
120
|
+
_(x, null, {
|
|
120
121
|
default: g(() => [
|
|
121
|
-
|
|
122
|
+
_(q, null, {
|
|
122
123
|
default: g(() => [
|
|
123
124
|
C(b(o.value), 1)
|
|
124
125
|
]),
|
|
125
126
|
_: 1
|
|
126
127
|
}),
|
|
127
|
-
|
|
128
|
+
_(L, null, {
|
|
128
129
|
default: g(() => [
|
|
129
130
|
C(b(r.value), 1)
|
|
130
131
|
]),
|
|
131
132
|
_: 1
|
|
132
133
|
}),
|
|
133
|
-
|
|
134
|
+
_(u, { class: "d-flex justify-end" }, {
|
|
134
135
|
default: g(() => [
|
|
135
|
-
|
|
136
|
-
onClick:
|
|
136
|
+
_(I, {
|
|
137
|
+
onClick: w[0] || (w[0] = (P) => t.value = !1),
|
|
137
138
|
color: s.value,
|
|
138
139
|
variant: "text"
|
|
139
140
|
}, {
|
|
@@ -142,13 +143,13 @@ const Le = /* @__PURE__ */ R({
|
|
|
142
143
|
]),
|
|
143
144
|
_: 1
|
|
144
145
|
}, 8, ["color"]),
|
|
145
|
-
|
|
146
|
+
_(I, {
|
|
146
147
|
onClick: B,
|
|
147
|
-
color:
|
|
148
|
+
color: i.value,
|
|
148
149
|
variant: "text"
|
|
149
150
|
}, {
|
|
150
151
|
default: g(() => [
|
|
151
|
-
C(b(
|
|
152
|
+
C(b(y.value), 1)
|
|
152
153
|
]),
|
|
153
154
|
_: 1
|
|
154
155
|
}, 8, ["color"])
|
|
@@ -163,22 +164,22 @@ const Le = /* @__PURE__ */ R({
|
|
|
163
164
|
}, 8, ["modelValue", "onKeydown"]);
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
|
-
}),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
], -1)),
|
|
180
|
-
|
|
181
|
-
],
|
|
167
|
+
}), Ae = (e) => (De("data-v-a8f3d91f"), e = e(), qe(), e), Me = /* @__PURE__ */ Ae(() => /* @__PURE__ */ h("div", { class: "lds-spinner" }, [
|
|
168
|
+
/* @__PURE__ */ h("div"),
|
|
169
|
+
/* @__PURE__ */ h("div"),
|
|
170
|
+
/* @__PURE__ */ h("div"),
|
|
171
|
+
/* @__PURE__ */ h("div"),
|
|
172
|
+
/* @__PURE__ */ h("div"),
|
|
173
|
+
/* @__PURE__ */ h("div"),
|
|
174
|
+
/* @__PURE__ */ h("div"),
|
|
175
|
+
/* @__PURE__ */ h("div"),
|
|
176
|
+
/* @__PURE__ */ h("div"),
|
|
177
|
+
/* @__PURE__ */ h("div"),
|
|
178
|
+
/* @__PURE__ */ h("div"),
|
|
179
|
+
/* @__PURE__ */ h("div")
|
|
180
|
+
], -1)), Be = [
|
|
181
|
+
Me
|
|
182
|
+
], Le = /* @__PURE__ */ T({
|
|
182
183
|
__name: "index",
|
|
183
184
|
props: {
|
|
184
185
|
zIndex: {
|
|
@@ -187,21 +188,21 @@ const Le = /* @__PURE__ */ R({
|
|
|
187
188
|
}
|
|
188
189
|
},
|
|
189
190
|
setup(e) {
|
|
190
|
-
const n =
|
|
191
|
+
const n = K(), t = e, o = f(() => ({
|
|
191
192
|
background: n.current.value.dark ? "#1e1e1e" : "#ffffff",
|
|
192
193
|
zIndex: t.zIndex
|
|
193
194
|
}));
|
|
194
|
-
return (r, a) => (V(),
|
|
195
|
+
return (r, a) => (V(), z("div", {
|
|
195
196
|
class: "x-cont",
|
|
196
|
-
style:
|
|
197
|
-
},
|
|
197
|
+
style: Ve(o.value)
|
|
198
|
+
}, Be, 4));
|
|
198
199
|
}
|
|
199
|
-
}),
|
|
200
|
+
}), ae = (e, n) => {
|
|
200
201
|
const t = e.__vccOpts || e;
|
|
201
202
|
for (const [o, r] of n)
|
|
202
203
|
t[o] = r;
|
|
203
204
|
return t;
|
|
204
|
-
},
|
|
205
|
+
}, Ue = /* @__PURE__ */ ae(Le, [["__scopeId", "data-v-a8f3d91f"]]), We = /* @__PURE__ */ T({
|
|
205
206
|
__name: "item",
|
|
206
207
|
props: {
|
|
207
208
|
id: {
|
|
@@ -241,17 +242,17 @@ const Le = /* @__PURE__ */ R({
|
|
|
241
242
|
}
|
|
242
243
|
return l;
|
|
243
244
|
});
|
|
244
|
-
return
|
|
245
|
+
return S(() => {
|
|
245
246
|
setTimeout(() => {
|
|
246
247
|
r("timeout", t.id);
|
|
247
248
|
}, t.timeout);
|
|
248
|
-
}),
|
|
249
|
+
}), E(o, (l) => {
|
|
249
250
|
l || r("timeout", t.id);
|
|
250
251
|
}), (l, s) => {
|
|
251
252
|
const p = v("v-alert");
|
|
252
253
|
return V(), A(p, {
|
|
253
254
|
modelValue: o.value,
|
|
254
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
255
|
+
"onUpdate:modelValue": s[0] || (s[0] = (i) => o.value = i),
|
|
255
256
|
class: "mt-2",
|
|
256
257
|
type: e.type,
|
|
257
258
|
icon: a.value,
|
|
@@ -264,14 +265,14 @@ const Le = /* @__PURE__ */ R({
|
|
|
264
265
|
}, null, 8, ["modelValue", "type", "icon", "text"]);
|
|
265
266
|
};
|
|
266
267
|
}
|
|
267
|
-
}),
|
|
268
|
+
}), He = /* @__PURE__ */ T({
|
|
268
269
|
__name: "index",
|
|
269
270
|
setup(e) {
|
|
270
|
-
const n =
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}),
|
|
274
|
-
|
|
271
|
+
const n = Se({ items: [] });
|
|
272
|
+
S(() => {
|
|
273
|
+
c.on("message", t);
|
|
274
|
+
}), R(() => {
|
|
275
|
+
c.off("message", t);
|
|
275
276
|
});
|
|
276
277
|
const t = (s) => {
|
|
277
278
|
a(s.type, s.text, s.timeout);
|
|
@@ -279,91 +280,91 @@ const Le = /* @__PURE__ */ R({
|
|
|
279
280
|
l(s);
|
|
280
281
|
};
|
|
281
282
|
let r = 0;
|
|
282
|
-
const a = (s, p,
|
|
283
|
-
const
|
|
284
|
-
n.items.push({ id:
|
|
283
|
+
const a = (s, p, i) => {
|
|
284
|
+
const y = r++;
|
|
285
|
+
n.items.push({ id: y, type: s, text: p, timeout: i });
|
|
285
286
|
}, l = (s) => {
|
|
286
|
-
const p = n.items.findIndex((
|
|
287
|
+
const p = n.items.findIndex((i) => i.id === s);
|
|
287
288
|
p >= 0 && n.items.splice(p, 1);
|
|
288
289
|
};
|
|
289
|
-
return (s, p) => (V(),
|
|
290
|
+
return (s, p) => (V(), z("div", {
|
|
290
291
|
onClick: p[0] || (p[0] = $(() => {
|
|
291
292
|
}, ["stop"])),
|
|
292
293
|
class: "x-cont d-flex flex-column-reverse align-center"
|
|
293
294
|
}, [
|
|
294
|
-
(V(!0),
|
|
295
|
+
(V(!0), z(Re, null, Te(n.items, (i) => (V(), A(We, {
|
|
295
296
|
onTimeout: o,
|
|
296
|
-
id:
|
|
297
|
-
type:
|
|
298
|
-
text:
|
|
299
|
-
timeout:
|
|
300
|
-
key:
|
|
297
|
+
id: i.id,
|
|
298
|
+
type: i.type,
|
|
299
|
+
text: i.text,
|
|
300
|
+
timeout: i.timeout,
|
|
301
|
+
key: i.id
|
|
301
302
|
}, null, 8, ["id", "type", "text", "timeout"]))), 128))
|
|
302
303
|
]));
|
|
303
304
|
}
|
|
304
|
-
}),
|
|
305
|
+
}), Ke = /* @__PURE__ */ ae(He, [["__scopeId", "data-v-70ed4b89"]]), Ne = /* @__PURE__ */ T({
|
|
305
306
|
__name: "index",
|
|
306
307
|
setup(e) {
|
|
307
|
-
const n =
|
|
308
|
+
const n = X(), { open: t } = J("promptDlg"), o = m(""), r = m(""), a = m(), l = m(), s = m(), p = m(""), i = m(), y = m(), O = f(() => {
|
|
308
309
|
var u;
|
|
309
|
-
return ((u =
|
|
310
|
+
return ((u = i.value) == null ? void 0 : u.color) ?? "primary";
|
|
310
311
|
}), D = f(() => {
|
|
311
312
|
var u;
|
|
312
|
-
return ((u =
|
|
313
|
+
return ((u = i.value) == null ? void 0 : u.text) ?? n.t("cancel");
|
|
313
314
|
}), M = f(() => {
|
|
314
315
|
var u;
|
|
315
|
-
return ((u =
|
|
316
|
+
return ((u = y.value) == null ? void 0 : u.color) ?? "primary";
|
|
316
317
|
}), B = f(() => {
|
|
317
318
|
var u;
|
|
318
|
-
return ((u =
|
|
319
|
+
return ((u = y.value) == null ? void 0 : u.text) ?? n.t("confirm");
|
|
319
320
|
}), d = m();
|
|
320
|
-
let
|
|
321
|
+
let w = 0, q = !1;
|
|
321
322
|
const L = async (u) => {
|
|
322
323
|
var x;
|
|
323
|
-
o.value = u.title, r.value = u.text, a.value = u.label, l.value = u.placeholder, s.value = u.rules, p.value = u.value,
|
|
324
|
+
o.value = u.title, r.value = u.text, a.value = u.label, l.value = u.placeholder, s.value = u.rules, p.value = u.value, i.value = u.cancel, y.value = u.confirm, w = u.seq, q = !1, t.value = !0, await G(() => d.value !== void 0, 1e3), (x = d.value) == null || x.focus();
|
|
324
325
|
};
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}),
|
|
328
|
-
|
|
326
|
+
S(() => {
|
|
327
|
+
c.on("promptDlg", L);
|
|
328
|
+
}), R(() => {
|
|
329
|
+
c.off("promptDlg", L);
|
|
329
330
|
});
|
|
330
|
-
const
|
|
331
|
-
t.value = !1,
|
|
331
|
+
const I = () => {
|
|
332
|
+
t.value = !1, q || (c.emit("promptDlgResult" + w, p.value ?? ""), q = !0);
|
|
332
333
|
};
|
|
333
|
-
return
|
|
334
|
-
!u && !
|
|
334
|
+
return E(t, (u) => {
|
|
335
|
+
!u && !q && (c.emit("promptDlgResult" + w, void 0), q = !0);
|
|
335
336
|
}), (u, x) => {
|
|
336
|
-
const
|
|
337
|
-
return V(), A(
|
|
338
|
-
modelValue:
|
|
339
|
-
"onUpdate:modelValue": x[2] || (x[2] = (
|
|
337
|
+
const N = v("v-card-title"), P = v("v-card-text"), de = v("v-text-field"), pe = v("v-form"), Y = v("v-btn"), fe = v("v-card-actions"), me = v("v-card"), ve = v("v-dialog");
|
|
338
|
+
return V(), A(ve, {
|
|
339
|
+
modelValue: W(t),
|
|
340
|
+
"onUpdate:modelValue": x[2] || (x[2] = (j) => F(t) ? t.value = j : null),
|
|
340
341
|
onKeydown: [
|
|
341
|
-
x[3] || (x[3] =
|
|
342
|
-
|
|
342
|
+
x[3] || (x[3] = H($((j) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
343
|
+
H($(I, ["stop", "prevent"]), ["enter"])
|
|
343
344
|
],
|
|
344
345
|
transition: "dialog-top-transition",
|
|
345
346
|
"max-width": "600px"
|
|
346
347
|
}, {
|
|
347
348
|
default: g(() => [
|
|
348
|
-
|
|
349
|
+
_(me, null, {
|
|
349
350
|
default: g(() => [
|
|
350
|
-
|
|
351
|
+
_(N, null, {
|
|
351
352
|
default: g(() => [
|
|
352
353
|
C(b(o.value), 1)
|
|
353
354
|
]),
|
|
354
355
|
_: 1
|
|
355
356
|
}),
|
|
356
|
-
|
|
357
|
+
_(P, null, {
|
|
357
358
|
default: g(() => [
|
|
358
359
|
C(b(r.value), 1)
|
|
359
360
|
]),
|
|
360
361
|
_: 1
|
|
361
362
|
}),
|
|
362
|
-
|
|
363
|
+
_(pe, { class: "mx-3" }, {
|
|
363
364
|
default: g(() => [
|
|
364
|
-
|
|
365
|
+
_(de, {
|
|
365
366
|
modelValue: p.value,
|
|
366
|
-
"onUpdate:modelValue": x[0] || (x[0] = (
|
|
367
|
+
"onUpdate:modelValue": x[0] || (x[0] = (j) => p.value = j),
|
|
367
368
|
label: a.value,
|
|
368
369
|
placeholder: l.value,
|
|
369
370
|
rules: s.value,
|
|
@@ -373,11 +374,11 @@ const Le = /* @__PURE__ */ R({
|
|
|
373
374
|
]),
|
|
374
375
|
_: 1
|
|
375
376
|
}),
|
|
376
|
-
|
|
377
|
+
_(fe, { class: "d-flex justify-end" }, {
|
|
377
378
|
default: g(() => [
|
|
378
|
-
|
|
379
|
-
onClick: x[1] || (x[1] = (
|
|
380
|
-
color:
|
|
379
|
+
_(Y, {
|
|
380
|
+
onClick: x[1] || (x[1] = (j) => t.value = !1),
|
|
381
|
+
color: O.value,
|
|
381
382
|
variant: "text"
|
|
382
383
|
}, {
|
|
383
384
|
default: g(() => [
|
|
@@ -385,8 +386,8 @@ const Le = /* @__PURE__ */ R({
|
|
|
385
386
|
]),
|
|
386
387
|
_: 1
|
|
387
388
|
}, 8, ["color"]),
|
|
388
|
-
|
|
389
|
-
onClick:
|
|
389
|
+
_(Y, {
|
|
390
|
+
onClick: I,
|
|
390
391
|
color: M.value,
|
|
391
392
|
variant: "text"
|
|
392
393
|
}, {
|
|
@@ -406,37 +407,37 @@ const Le = /* @__PURE__ */ R({
|
|
|
406
407
|
}, 8, ["modelValue", "onKeydown"]);
|
|
407
408
|
};
|
|
408
409
|
}
|
|
409
|
-
}),
|
|
410
|
+
}), ze = { class: "mx-auto my-auto" }, Fe = { class: "d-flex align-center justify-center w-100 h-100" }, Xe = /* @__PURE__ */ T({
|
|
410
411
|
__name: "index",
|
|
411
412
|
setup(e) {
|
|
412
|
-
const n =
|
|
413
|
+
const n = X(), { open: t } = J("waitDlg"), o = () => {
|
|
413
414
|
t.value = !0;
|
|
414
415
|
}, r = () => {
|
|
415
416
|
t.value = !1;
|
|
416
417
|
};
|
|
417
|
-
return
|
|
418
|
-
|
|
419
|
-
}),
|
|
420
|
-
|
|
418
|
+
return S(() => {
|
|
419
|
+
c.on("openWaitDlg", o), c.on("closeWaitDlg", r);
|
|
420
|
+
}), R(() => {
|
|
421
|
+
c.off("openWaitDlg", o), c.off("closeWaitDlg", r);
|
|
421
422
|
}), (a, l) => {
|
|
422
423
|
const s = v("v-card"), p = v("v-dialog");
|
|
423
424
|
return V(), A(p, {
|
|
424
|
-
modelValue:
|
|
425
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
425
|
+
modelValue: W(t),
|
|
426
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => F(t) ? t.value = i : null),
|
|
426
427
|
persistent: "",
|
|
427
428
|
"no-click-animation": "",
|
|
428
429
|
fullscreen: ""
|
|
429
430
|
}, {
|
|
430
431
|
default: g(() => [
|
|
431
|
-
|
|
432
|
-
|
|
432
|
+
h("div", ze, [
|
|
433
|
+
_(s, {
|
|
433
434
|
width: "300px",
|
|
434
435
|
height: "80px",
|
|
435
436
|
loading: ""
|
|
436
437
|
}, {
|
|
437
438
|
default: g(() => [
|
|
438
|
-
|
|
439
|
-
|
|
439
|
+
h("div", Fe, [
|
|
440
|
+
h("span", null, b(W(n).t("waitingResponse")), 1)
|
|
440
441
|
])
|
|
441
442
|
]),
|
|
442
443
|
_: 1
|
|
@@ -447,11 +448,11 @@ const Le = /* @__PURE__ */ R({
|
|
|
447
448
|
}, 8, ["modelValue"]);
|
|
448
449
|
};
|
|
449
450
|
}
|
|
450
|
-
}),
|
|
451
|
-
e.component("v-alert",
|
|
451
|
+
}), Ge = (e) => {
|
|
452
|
+
e.component("v-alert", ge), e.component("v-btn", he), e.component("v-card", _e), e.component("v-card-actions", xe), e.component("v-card-text", ye), e.component("v-card-title", we), e.component("v-dialog", ke), e.component("v-form", be), e.component("v-text-field", Ce), e.component("x-confirm-dlg", $e), e.component("x-loading", Ue), e.component("x-message", Ke), e.component("x-prompt-dlg", Ne), e.component("x-wait-dlg", Xe);
|
|
452
453
|
};
|
|
453
|
-
function
|
|
454
|
-
const e =
|
|
454
|
+
function mt() {
|
|
455
|
+
const e = K(), n = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary), o = f(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), r = f(() => e.current.value.dark ? "#272727" : "#eeeeee"), a = f(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), l = f(() => e.current.value.dark ? "#303030" : "#f6f6f6"), s = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
|
|
455
456
|
return {
|
|
456
457
|
primaryColor: n,
|
|
457
458
|
secondaryColor: t,
|
|
@@ -462,30 +463,11 @@ function wt() {
|
|
|
462
463
|
borderColor: s
|
|
463
464
|
};
|
|
464
465
|
}
|
|
465
|
-
|
|
466
|
-
(function(e) {
|
|
467
|
-
e.pop = "pop", e.push = "push";
|
|
468
|
-
})(Z || (Z = {}));
|
|
469
|
-
var ee;
|
|
470
|
-
(function(e) {
|
|
471
|
-
e.back = "back", e.forward = "forward", e.unknown = "";
|
|
472
|
-
})(ee || (ee = {}));
|
|
473
|
-
var te;
|
|
474
|
-
(function(e) {
|
|
475
|
-
e[e.aborted = 4] = "aborted", e[e.cancelled = 8] = "cancelled", e[e.duplicated = 16] = "duplicated";
|
|
476
|
-
})(te || (te = {}));
|
|
477
|
-
const et = Symbol(ue.NODE_ENV !== "production" ? "router" : ""), tt = Symbol(ue.NODE_ENV !== "production" ? "route location" : "");
|
|
478
|
-
function de() {
|
|
479
|
-
return ae(et);
|
|
480
|
-
}
|
|
481
|
-
function nt() {
|
|
482
|
-
return ae(tt);
|
|
483
|
-
}
|
|
484
|
-
const ot = se(
|
|
466
|
+
const Je = oe(
|
|
485
467
|
"global",
|
|
486
468
|
() => {
|
|
487
|
-
const e =
|
|
488
|
-
|
|
469
|
+
const e = K(), n = Pe(), t = m(!1);
|
|
470
|
+
E(
|
|
489
471
|
t,
|
|
490
472
|
(l) => {
|
|
491
473
|
e.global.name.value = l ? "dark" : "light";
|
|
@@ -495,7 +477,7 @@ const ot = se(
|
|
|
495
477
|
}
|
|
496
478
|
);
|
|
497
479
|
const o = m("en");
|
|
498
|
-
|
|
480
|
+
E(
|
|
499
481
|
o,
|
|
500
482
|
(l) => {
|
|
501
483
|
n.locale.value = l;
|
|
@@ -515,92 +497,92 @@ const ot = se(
|
|
|
515
497
|
}
|
|
516
498
|
]
|
|
517
499
|
}
|
|
518
|
-
),
|
|
519
|
-
function
|
|
520
|
-
const n =
|
|
500
|
+
), U = require("js-cookie");
|
|
501
|
+
function vt(e) {
|
|
502
|
+
const n = je.create({
|
|
521
503
|
timeout: 6e3
|
|
522
504
|
});
|
|
523
505
|
return n.defaults.baseURL = e.baseUrl, n.interceptors.request.use(
|
|
524
|
-
(t) =>
|
|
506
|
+
(t) => Qe(t),
|
|
525
507
|
(t) => {
|
|
526
|
-
|
|
508
|
+
Ye(t, e.onError);
|
|
527
509
|
}
|
|
528
510
|
), n.interceptors.response.use(
|
|
529
|
-
(t) =>
|
|
530
|
-
(t) =>
|
|
511
|
+
(t) => Ze(t),
|
|
512
|
+
(t) => et(t, e.onError)
|
|
531
513
|
), n;
|
|
532
514
|
}
|
|
533
|
-
function
|
|
534
|
-
const n =
|
|
515
|
+
function Qe(e) {
|
|
516
|
+
const n = U.get("accessToken") ?? "";
|
|
535
517
|
return e.headers.Authorization = "Basic " + n, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
|
|
536
518
|
}
|
|
537
|
-
function
|
|
519
|
+
function Ye(e, n) {
|
|
538
520
|
console.error(e), n("request timeout");
|
|
539
521
|
}
|
|
540
|
-
function
|
|
522
|
+
function Ze(e) {
|
|
541
523
|
return e.data;
|
|
542
524
|
}
|
|
543
|
-
function
|
|
525
|
+
function et(e, n) {
|
|
544
526
|
var r;
|
|
545
527
|
const t = e.response;
|
|
546
528
|
if (!t)
|
|
547
529
|
return Promise.reject(e);
|
|
548
|
-
t.status === 401 &&
|
|
530
|
+
t.status === 401 && tt();
|
|
549
531
|
let o = (r = t.data) == null ? void 0 : r.message;
|
|
550
532
|
return o || (o = {
|
|
551
533
|
code: t.status,
|
|
552
534
|
message: t.statusText
|
|
553
535
|
}), n(o), Promise.reject(e);
|
|
554
536
|
}
|
|
555
|
-
function
|
|
556
|
-
|
|
537
|
+
function tt() {
|
|
538
|
+
U.remove("accessToken"), U.remove("refreshToken"), U.remove("activeOrg"), re().replace({ path: "/passport/login" });
|
|
557
539
|
}
|
|
558
|
-
let
|
|
559
|
-
function
|
|
540
|
+
let Z = Date.now();
|
|
541
|
+
function se() {
|
|
560
542
|
const e = Date.now();
|
|
561
|
-
return e -
|
|
543
|
+
return e - Z > 500 ? (Z = e, !0) : !1;
|
|
562
544
|
}
|
|
563
|
-
let
|
|
564
|
-
function
|
|
565
|
-
return ++
|
|
545
|
+
let nt = 0;
|
|
546
|
+
function ie() {
|
|
547
|
+
return ++nt;
|
|
566
548
|
}
|
|
567
|
-
async function
|
|
568
|
-
if (!
|
|
549
|
+
async function gt(e) {
|
|
550
|
+
if (!se())
|
|
569
551
|
return;
|
|
570
552
|
let n = !1, t;
|
|
571
553
|
const o = (a) => {
|
|
572
554
|
t = a, n = !0;
|
|
573
|
-
}, r =
|
|
574
|
-
return
|
|
555
|
+
}, r = ie();
|
|
556
|
+
return c.on("confirmDlgResult" + r, o), c.emit("confirmDlg", { ...e, seq: r }), await G(() => n), c.off("confirmDlgResult" + r, o), t;
|
|
575
557
|
}
|
|
576
|
-
async function
|
|
577
|
-
if (!
|
|
558
|
+
async function ht(e) {
|
|
559
|
+
if (!se())
|
|
578
560
|
return;
|
|
579
561
|
let n = !1, t;
|
|
580
562
|
const o = (a) => {
|
|
581
563
|
t = a, n = !0;
|
|
582
|
-
}, r =
|
|
583
|
-
return
|
|
564
|
+
}, r = ie();
|
|
565
|
+
return c.on("promptDlgResult" + r, o), c.emit("promptDlg", { ...e, seq: r }), await G(() => n), c.off("promptDlgResult" + r, o), t;
|
|
584
566
|
}
|
|
585
|
-
function
|
|
586
|
-
|
|
567
|
+
function _t() {
|
|
568
|
+
c.emit("openWaitDlg");
|
|
587
569
|
}
|
|
588
|
-
function
|
|
589
|
-
|
|
570
|
+
function xt() {
|
|
571
|
+
c.emit("closeWaitDlg");
|
|
590
572
|
}
|
|
591
|
-
function
|
|
592
|
-
|
|
573
|
+
function yt(e, n) {
|
|
574
|
+
c.emit("message", { type: "error", text: e, timeout: n });
|
|
593
575
|
}
|
|
594
|
-
function
|
|
595
|
-
|
|
576
|
+
function wt(e, n) {
|
|
577
|
+
c.emit("message", { type: "info", text: e, timeout: n });
|
|
596
578
|
}
|
|
597
|
-
function
|
|
598
|
-
|
|
579
|
+
function kt(e, n) {
|
|
580
|
+
c.emit("message", { type: "success", text: e, timeout: n });
|
|
599
581
|
}
|
|
600
|
-
function
|
|
601
|
-
|
|
582
|
+
function bt(e, n) {
|
|
583
|
+
c.emit("message", { type: "warning", text: e, timeout: n });
|
|
602
584
|
}
|
|
603
|
-
function
|
|
585
|
+
function Ct(e) {
|
|
604
586
|
var o, r;
|
|
605
587
|
if (!window.appAppear) {
|
|
606
588
|
window.appAppear = !0;
|
|
@@ -611,11 +593,11 @@ function Rt(e) {
|
|
|
611
593
|
t.add("app-reset");
|
|
612
594
|
}, 0));
|
|
613
595
|
}
|
|
614
|
-
let
|
|
615
|
-
function
|
|
616
|
-
|
|
596
|
+
let ce = {};
|
|
597
|
+
function Vt(e) {
|
|
598
|
+
ce = e;
|
|
617
599
|
}
|
|
618
|
-
function
|
|
600
|
+
function ee(e, n) {
|
|
619
601
|
if (!e)
|
|
620
602
|
return !1;
|
|
621
603
|
let t = e;
|
|
@@ -628,11 +610,11 @@ function oe(e, n) {
|
|
|
628
610
|
return !1;
|
|
629
611
|
}), Object.keys(t).length <= 0);
|
|
630
612
|
}
|
|
631
|
-
function
|
|
632
|
-
const t =
|
|
633
|
-
return t ? n ? (!
|
|
613
|
+
function Dt(e, n) {
|
|
614
|
+
const t = ce[e];
|
|
615
|
+
return t ? n ? (!ee(t.includes, n) || ee(t.excludes, n), !1) : !0 : !1;
|
|
634
616
|
}
|
|
635
|
-
const
|
|
617
|
+
const ue = require("js-cookie"), ot = [
|
|
636
618
|
{ path: "/passport/login", level: 0 },
|
|
637
619
|
{ path: "/passport/loginAccount", level: 1 },
|
|
638
620
|
{ path: "/passport/register", level: 1 },
|
|
@@ -655,7 +637,7 @@ const ve = require("js-cookie"), ut = [
|
|
|
655
637
|
function Q(e) {
|
|
656
638
|
let n, t = 0;
|
|
657
639
|
const o = e.split("/");
|
|
658
|
-
return
|
|
640
|
+
return ot.forEach((r) => {
|
|
659
641
|
const a = r.path.split("/");
|
|
660
642
|
let l = 0;
|
|
661
643
|
for (let s = 0; s < o.length && !(s >= a.length || o[s] !== a[s]); s++)
|
|
@@ -663,7 +645,7 @@ function Q(e) {
|
|
|
663
645
|
l >= t && (n = r, t = l);
|
|
664
646
|
}), n;
|
|
665
647
|
}
|
|
666
|
-
function
|
|
648
|
+
function te(e) {
|
|
667
649
|
if (e === "/")
|
|
668
650
|
return { app: "", path: "/", level: -1 };
|
|
669
651
|
const n = Q(e);
|
|
@@ -672,21 +654,21 @@ function re(e) {
|
|
|
672
654
|
const t = e.split("/");
|
|
673
655
|
return console.assert(t.length >= 2), { app: t[1], path: n.path, level: n.level };
|
|
674
656
|
}
|
|
675
|
-
const
|
|
657
|
+
const ne = m("");
|
|
676
658
|
function k(e, n) {
|
|
677
|
-
const t =
|
|
659
|
+
const t = te(e), o = te(n), r = t.app === o.app, a = t.path === o.path, l = t.level >= o.level;
|
|
678
660
|
console.info(
|
|
679
661
|
`~~~~before route change~~~~ ${o.path} -> ${t.path} inner=${r} forward=${l}`
|
|
680
|
-
), r ? a ?
|
|
662
|
+
), r ? a ? ne.value = "" : ne.value = l ? "inner-left" : "inner-right" : window.routeExtras = { forward: l };
|
|
681
663
|
}
|
|
682
|
-
function
|
|
683
|
-
return !!
|
|
664
|
+
function rt() {
|
|
665
|
+
return !!ue.get("accessToken");
|
|
684
666
|
}
|
|
685
|
-
function
|
|
686
|
-
return !!
|
|
667
|
+
function lt() {
|
|
668
|
+
return !!ue.get("activeOrg");
|
|
687
669
|
}
|
|
688
|
-
function
|
|
689
|
-
const o =
|
|
670
|
+
function qt(e, n, t) {
|
|
671
|
+
const o = rt(), r = lt(), a = Q(e.path);
|
|
690
672
|
if (!a) {
|
|
691
673
|
t();
|
|
692
674
|
return;
|
|
@@ -725,28 +707,28 @@ function It(e, n, t) {
|
|
|
725
707
|
else
|
|
726
708
|
k(e.path, n.path), t();
|
|
727
709
|
}
|
|
728
|
-
function
|
|
729
|
-
const n =
|
|
730
|
-
if (
|
|
710
|
+
function St(e) {
|
|
711
|
+
const n = Ie(), t = re(), o = Je(), r = le(), a = (i) => {
|
|
712
|
+
if (i.key === "Escape") {
|
|
731
713
|
l();
|
|
732
714
|
return;
|
|
733
715
|
}
|
|
734
|
-
if (!e &&
|
|
716
|
+
if (!e && i.ctrlKey && i.key.toLowerCase() === "d") {
|
|
735
717
|
s();
|
|
736
718
|
return;
|
|
737
719
|
}
|
|
738
|
-
if (!e &&
|
|
720
|
+
if (!e && i.ctrlKey && i.key.toLowerCase() === "l") {
|
|
739
721
|
p();
|
|
740
722
|
return;
|
|
741
723
|
}
|
|
742
724
|
}, l = () => {
|
|
743
|
-
var
|
|
725
|
+
var y;
|
|
744
726
|
if (!r.isEmpty()) {
|
|
745
727
|
r.hasView("waitDlg") || r.popView();
|
|
746
728
|
return;
|
|
747
729
|
}
|
|
748
|
-
const
|
|
749
|
-
(
|
|
730
|
+
const i = Q(n.path);
|
|
731
|
+
(i == null ? void 0 : i.level) === 0 ? (y = navigator == null ? void 0 : navigator.Backbutton) == null || y.goHome(
|
|
750
732
|
() => {
|
|
751
733
|
},
|
|
752
734
|
() => {
|
|
@@ -757,41 +739,41 @@ function Pt(e) {
|
|
|
757
739
|
}, p = () => {
|
|
758
740
|
o.locale === "en" ? o.locale = "zhHans" : o.locale = "en";
|
|
759
741
|
};
|
|
760
|
-
return
|
|
742
|
+
return S(() => {
|
|
761
743
|
window.addEventListener("keydown", a, !1);
|
|
762
|
-
}),
|
|
744
|
+
}), R(() => {
|
|
763
745
|
window.removeEventListener("keydown", a, !1);
|
|
764
746
|
}), {};
|
|
765
747
|
}
|
|
766
|
-
function
|
|
767
|
-
const e =
|
|
748
|
+
function Rt() {
|
|
749
|
+
const e = K(), { width: n } = Oe(), t = f(() => e.global.name.value), o = f(() => !!window.cordova), r = f(() => n.value <= 1280 ? n.value + "px" : n.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
|
|
768
750
|
return { dark: t, sysBarAvail: o, compactWidth: r };
|
|
769
751
|
}
|
|
770
|
-
const
|
|
752
|
+
const Tt = { install: Ge };
|
|
771
753
|
export {
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
754
|
+
Ct as appAppear,
|
|
755
|
+
xt as closeWaitDlg,
|
|
756
|
+
vt as createAxios,
|
|
757
|
+
Tt as default,
|
|
758
|
+
c as eventBus,
|
|
777
759
|
Q as matchRouteMeta,
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
760
|
+
yt as messageError,
|
|
761
|
+
wt as messageInfo,
|
|
762
|
+
kt as messageSuccess,
|
|
763
|
+
bt as messageWarning,
|
|
764
|
+
qt as onBeforeEach,
|
|
765
|
+
gt as openConfirmDlg,
|
|
766
|
+
ht as openPromptDlg,
|
|
767
|
+
_t as openWaitDlg,
|
|
768
|
+
ne as routeTransName,
|
|
769
|
+
Vt as setPermissionObject,
|
|
770
|
+
mt as useColor,
|
|
771
|
+
Je as useGlobalStore,
|
|
772
|
+
St as useHotkey,
|
|
773
|
+
Rt as useSystem,
|
|
774
|
+
le as useViewMgrStore,
|
|
793
775
|
J as useViewStack,
|
|
794
|
-
|
|
795
|
-
|
|
776
|
+
Dt as verifyPermission,
|
|
777
|
+
ft as waitMs,
|
|
796
778
|
G as waitUtil
|
|
797
779
|
};
|