x-essential-lib 0.5.28 → 0.5.30
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 +272 -190
- package/dist/utils/router.d.ts +1 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var a=document.createElement("style");a.id="x-essential-lib",a.appendChild(document.createTextNode('.x-cont[data-v-f4ad116e]{position:absolute;top:0;left:0;bottom:0;right:0;display:flex;align-items:center;justify-content:center}.lds-spinner[data-v-f4ad116e]{color:official;display:inline-block;position:relative;width:40px;height:40px}.lds-spinner div[data-v-f4ad116e]{transform-origin:20px 20px;animation:lds-spinner-f4ad116e 1.2s linear infinite}.lds-spinner div[data-v-f4ad116e]:after{content:" ";display:block;position:absolute;top:3px;left:18px;width:2px;height:6px;border-radius:5%;background:#9e9e9e}.lds-spinner div[data-v-f4ad116e]:nth-child(1){transform:rotate(0);animation-delay:-1.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.lds-spinner div[data-v-f4ad116e]:nth-child(3){transform:rotate(60deg);animation-delay:-.9s}.lds-spinner div[data-v-f4ad116e]:nth-child(4){transform:rotate(90deg);animation-delay:-.8s}.lds-spinner div[data-v-f4ad116e]:nth-child(5){transform:rotate(120deg);animation-delay:-.7s}.lds-spinner div[data-v-f4ad116e]:nth-child(6){transform:rotate(150deg);animation-delay:-.6s}.lds-spinner div[data-v-f4ad116e]:nth-child(7){transform:rotate(180deg);animation-delay:-.5s}.lds-spinner div[data-v-f4ad116e]:nth-child(8){transform:rotate(210deg);animation-delay:-.4s}.lds-spinner div[data-v-f4ad116e]:nth-child(9){transform:rotate(240deg);animation-delay:-.3s}.lds-spinner div[data-v-f4ad116e]:nth-child(10){transform:rotate(270deg);animation-delay:-.2s}.lds-spinner div[data-v-f4ad116e]:nth-child(11){transform:rotate(300deg);animation-delay:-.1s}.lds-spinner div[data-v-f4ad116e]:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes lds-spinner-f4ad116e{0%{opacity:1}to{opacity:0}}.x-cont[data-v-8c2268ea]{position:absolute;left:50%;bottom:20px;transform:translate(-50%);z-index:9999}')),document.head.appendChild(a)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
import { ref as
|
|
3
|
-
import { useTheme as H, useLocale as Q, useDisplay as
|
|
4
|
-
import { defineStore as
|
|
5
|
-
import
|
|
6
|
-
import { useRouter as
|
|
7
|
-
const Y =
|
|
2
|
+
import { ref as i, watch as N, computed as f, onMounted as S, onBeforeUnmount as T, defineComponent as U, resolveComponent as h, openBlock as V, createBlock as E, unref as F, isRef as G, withKeys as M, withModifiers as W, withCtx as w, createVNode as k, createTextVNode as B, toDisplayString as A, createElementBlock as J, normalizeStyle as ge, pushScopeId as ve, popScopeId as me, createElementVNode as m, reactive as he, Fragment as we, renderList as xe, createCommentVNode as ye } from "vue";
|
|
3
|
+
import { useTheme as H, useLocale as Q, useDisplay as ke } from "vuetify";
|
|
4
|
+
import { defineStore as le } from "pinia";
|
|
5
|
+
import be from "axios";
|
|
6
|
+
import { useRouter as re, useRoute as Ce } from "vue-router";
|
|
7
|
+
const Y = le(
|
|
8
8
|
"global",
|
|
9
9
|
() => {
|
|
10
|
-
const e = H(), a =
|
|
10
|
+
const e = H(), a = i(), t = i("en"), l = i({}), o = i(""), n = i("/");
|
|
11
11
|
return N(
|
|
12
12
|
a,
|
|
13
13
|
() => {
|
|
@@ -34,8 +34,8 @@ const Y = re(
|
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
36
|
}
|
|
37
|
-
),
|
|
38
|
-
const e =
|
|
37
|
+
), ne = le("viewMgr", () => {
|
|
38
|
+
const e = i([]);
|
|
39
39
|
function a() {
|
|
40
40
|
return e.value.length <= 0;
|
|
41
41
|
}
|
|
@@ -72,7 +72,7 @@ const Y = re(
|
|
|
72
72
|
};
|
|
73
73
|
});
|
|
74
74
|
/*! js-cookie v3.0.5 | MIT */
|
|
75
|
-
function
|
|
75
|
+
function L(e) {
|
|
76
76
|
for (var a = 1; a < arguments.length; a++) {
|
|
77
77
|
var t = arguments[a];
|
|
78
78
|
for (var l in t)
|
|
@@ -80,7 +80,7 @@ function W(e) {
|
|
|
80
80
|
}
|
|
81
81
|
return e;
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var De = {
|
|
84
84
|
read: function(e) {
|
|
85
85
|
return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
86
86
|
},
|
|
@@ -94,7 +94,7 @@ var Se = {
|
|
|
94
94
|
function X(e, a) {
|
|
95
95
|
function t(o, n, r) {
|
|
96
96
|
if (!(typeof document > "u")) {
|
|
97
|
-
r =
|
|
97
|
+
r = L({}, a, r), typeof r.expires == "number" && (r.expires = new Date(Date.now() + r.expires * 864e5)), r.expires && (r.expires = r.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
98
98
|
var c = "";
|
|
99
99
|
for (var p in r)
|
|
100
100
|
r[p] && (c += "; " + p, r[p] !== !0 && (c += "=" + r[p].split(";")[0]));
|
|
@@ -123,16 +123,16 @@ function X(e, a) {
|
|
|
123
123
|
t(
|
|
124
124
|
o,
|
|
125
125
|
"",
|
|
126
|
-
|
|
126
|
+
L({}, n, {
|
|
127
127
|
expires: -1
|
|
128
128
|
})
|
|
129
129
|
);
|
|
130
130
|
},
|
|
131
131
|
withAttributes: function(o) {
|
|
132
|
-
return X(this.converter,
|
|
132
|
+
return X(this.converter, L({}, this.attributes, o));
|
|
133
133
|
},
|
|
134
134
|
withConverter: function(o) {
|
|
135
|
-
return X(
|
|
135
|
+
return X(L({}, this.converter, o), this.attributes);
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
138
|
{
|
|
@@ -141,29 +141,29 @@ function X(e, a) {
|
|
|
141
141
|
}
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
|
-
var
|
|
145
|
-
function
|
|
146
|
-
const a =
|
|
144
|
+
var R = X(De, { path: "/" });
|
|
145
|
+
function ot(e) {
|
|
146
|
+
const a = be.create({
|
|
147
147
|
timeout: 6e3
|
|
148
148
|
});
|
|
149
149
|
return a.defaults.baseURL = e.baseUrl, a.interceptors.request.use(
|
|
150
|
-
(t) =>
|
|
150
|
+
(t) => Se(t),
|
|
151
151
|
(t) => {
|
|
152
|
-
|
|
152
|
+
Ve(t, e.onError);
|
|
153
153
|
}
|
|
154
154
|
), a.interceptors.response.use(
|
|
155
|
-
(t) =>
|
|
155
|
+
(t) => qe(t),
|
|
156
156
|
(t) => Oe(t, e.onError)
|
|
157
157
|
), a;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
const a =
|
|
159
|
+
function Se(e) {
|
|
160
|
+
const a = R.get("accessToken") ?? "";
|
|
161
161
|
return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Ve(e, a) {
|
|
164
164
|
console.error(e), a("request timeout");
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function qe(e) {
|
|
167
167
|
return e.data;
|
|
168
168
|
}
|
|
169
169
|
function Oe(e, a) {
|
|
@@ -179,7 +179,7 @@ function Oe(e, a) {
|
|
|
179
179
|
}), a(l), Promise.reject(e);
|
|
180
180
|
}
|
|
181
181
|
function Te() {
|
|
182
|
-
|
|
182
|
+
R.remove("accessToken"), R.remove("refreshToken"), R.remove("activeOrg"), re().replace({ path: "/passport/login" });
|
|
183
183
|
}
|
|
184
184
|
function je(e) {
|
|
185
185
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
|
|
@@ -200,7 +200,7 @@ function je(e) {
|
|
|
200
200
|
const s = function() {
|
|
201
201
|
return window.eventBus || (window.eventBus = je()), window.eventBus;
|
|
202
202
|
}();
|
|
203
|
-
async function
|
|
203
|
+
async function lt(e) {
|
|
204
204
|
return new Promise((a) => {
|
|
205
205
|
setTimeout(a, e);
|
|
206
206
|
});
|
|
@@ -214,7 +214,7 @@ async function Z(e, a, t) {
|
|
|
214
214
|
n();
|
|
215
215
|
});
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function rt(e) {
|
|
218
218
|
var l, o;
|
|
219
219
|
if (!window.appAppear) {
|
|
220
220
|
window.appAppear = !0;
|
|
@@ -226,45 +226,45 @@ function nt(e) {
|
|
|
226
226
|
}, 0));
|
|
227
227
|
}
|
|
228
228
|
let te = Date.now();
|
|
229
|
-
function
|
|
229
|
+
function ce() {
|
|
230
230
|
const e = Date.now();
|
|
231
231
|
return e - te > 500 ? (te = e, !0) : !1;
|
|
232
232
|
}
|
|
233
233
|
let Ae = 0;
|
|
234
|
-
function
|
|
234
|
+
function ue() {
|
|
235
235
|
return ++Ae;
|
|
236
236
|
}
|
|
237
|
-
async function
|
|
238
|
-
if (!
|
|
237
|
+
async function nt(e) {
|
|
238
|
+
if (!ce())
|
|
239
239
|
return;
|
|
240
240
|
let a = !1, t;
|
|
241
241
|
const l = (n) => {
|
|
242
242
|
t = n, a = !0;
|
|
243
|
-
}, o =
|
|
243
|
+
}, o = ue();
|
|
244
244
|
return s.on("confirmDlgResult" + o, l), s.emit("confirmDlg", { ...e, seq: o }), await Z(() => a), s.off("confirmDlgResult" + o, l), t;
|
|
245
245
|
}
|
|
246
|
-
async function
|
|
247
|
-
if (!
|
|
246
|
+
async function ct(e) {
|
|
247
|
+
if (!ce())
|
|
248
248
|
return;
|
|
249
249
|
let a = !1, t;
|
|
250
250
|
const l = (n) => {
|
|
251
251
|
t = n, a = !0;
|
|
252
|
-
}, o =
|
|
252
|
+
}, o = ue();
|
|
253
253
|
return s.on("promptDlgResult" + o, l), s.emit("promptDlg", { ...e, seq: o }), await Z(() => a), s.off("promptDlgResult" + o, l), t;
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function ut() {
|
|
256
256
|
s.emit("openWaitDlg");
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function pt() {
|
|
259
259
|
s.emit("closeWaitDlg");
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function st(e, a) {
|
|
262
262
|
s.emit("message", { type: "error", text: e, timeout: a });
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function _t(e, a) {
|
|
265
265
|
s.emit("message", { type: "info", text: e, timeout: a });
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function dt(e, a) {
|
|
268
268
|
s.emit("message", { type: "success", text: e, timeout: a });
|
|
269
269
|
}
|
|
270
270
|
function it(e, a) {
|
|
@@ -285,25 +285,114 @@ function ae(e, a) {
|
|
|
285
285
|
}), Object.keys(t).length <= 0);
|
|
286
286
|
}
|
|
287
287
|
const Be = [
|
|
288
|
-
{
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
{
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
{
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
{
|
|
304
|
-
|
|
288
|
+
{
|
|
289
|
+
app: "x-passport-mf",
|
|
290
|
+
path: "/passport/login",
|
|
291
|
+
level: 0
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
app: "x-passport-mf",
|
|
295
|
+
path: "/passport/loginAccount",
|
|
296
|
+
level: 1
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
app: "x-passport-mf",
|
|
300
|
+
path: "/passport/register",
|
|
301
|
+
level: 1
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
app: "x-org-mf",
|
|
305
|
+
path: "/org/joinOrCreate",
|
|
306
|
+
level: 1,
|
|
307
|
+
requiredState: "auth"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
app: "x-org-mf",
|
|
311
|
+
path: "/org/manager",
|
|
312
|
+
level: 1,
|
|
313
|
+
requiredState: "org",
|
|
314
|
+
mainActive: 2
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
app: "x-main-mf",
|
|
318
|
+
path: "/main",
|
|
319
|
+
level: 0,
|
|
320
|
+
requiredState: "org"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
app: "x-mine-mf",
|
|
324
|
+
path: "/mine/personalInfo",
|
|
325
|
+
level: 1,
|
|
326
|
+
requiredState: "org",
|
|
327
|
+
mainActive: 4
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
app: "x-mine-mf",
|
|
331
|
+
path: "/mine/accountSecurity",
|
|
332
|
+
level: 2,
|
|
333
|
+
requiredState: "org"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
app: "x-mine-mf",
|
|
337
|
+
path: "/mine/settings",
|
|
338
|
+
level: 1,
|
|
339
|
+
requiredState: "org",
|
|
340
|
+
mainActive: 4
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
app: "x-mine-mf",
|
|
344
|
+
path: "/mine/general",
|
|
345
|
+
level: 2,
|
|
346
|
+
requiredState: "org"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
app: "x-mine-mf",
|
|
350
|
+
path: "/mine/general/darkMode",
|
|
351
|
+
level: 3,
|
|
352
|
+
requiredState: "org"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
app: "x-mine-mf",
|
|
356
|
+
path: "/mine/general/language",
|
|
357
|
+
level: 3,
|
|
358
|
+
requiredState: "org"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
app: "x-app-mf",
|
|
362
|
+
path: "/app/manager",
|
|
363
|
+
level: 1,
|
|
364
|
+
requiredState: "org",
|
|
365
|
+
mainActive: 2
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
app: "x-app-mf",
|
|
369
|
+
path: "/app/editor",
|
|
370
|
+
level: 2,
|
|
371
|
+
requiredState: "org"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
app: "x-asset-mf",
|
|
375
|
+
path: "/asset",
|
|
376
|
+
level: 1,
|
|
377
|
+
requiredState: "org",
|
|
378
|
+
mainActive: 2
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
app: "x-calc-mf",
|
|
382
|
+
path: "/calc",
|
|
383
|
+
level: 1,
|
|
384
|
+
requiredState: "org",
|
|
385
|
+
mainActive: 2
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
app: "x-data-mf",
|
|
389
|
+
path: "/data",
|
|
390
|
+
level: 1,
|
|
391
|
+
requiredState: "org",
|
|
392
|
+
mainActive: 2
|
|
393
|
+
}
|
|
305
394
|
];
|
|
306
|
-
function
|
|
395
|
+
function z(e) {
|
|
307
396
|
let a, t = 0;
|
|
308
397
|
const l = e.split("/").filter((o) => o.trim() !== "");
|
|
309
398
|
return Be.forEach((o) => {
|
|
@@ -314,30 +403,23 @@ function F(e) {
|
|
|
314
403
|
r > 0 && r >= t && (a = o, t = r);
|
|
315
404
|
}), a;
|
|
316
405
|
}
|
|
317
|
-
|
|
318
|
-
const { lastAppPath: a } = Y();
|
|
319
|
-
if (e === "/" && (e = a), e === "/")
|
|
320
|
-
return { app: "", path: "/", level: -1 };
|
|
321
|
-
const t = F(e);
|
|
322
|
-
console.assert(t, "invalid route meta");
|
|
323
|
-
const l = e.split("/");
|
|
324
|
-
return console.assert(l.length >= 2), { app: l[1], path: t.path, level: t.level };
|
|
325
|
-
}
|
|
326
|
-
const le = f("");
|
|
406
|
+
const oe = i("");
|
|
327
407
|
function D(e, a) {
|
|
328
|
-
const
|
|
408
|
+
const { lastAppPath: t } = Y();
|
|
409
|
+
e === "/" && (e = t);
|
|
410
|
+
const l = z(e), o = z(a), n = (l == null ? void 0 : l.app) === (o == null ? void 0 : o.app), r = (l == null ? void 0 : l.path) === (o == null ? void 0 : o.path), c = ((l == null ? void 0 : l.level) ?? -1) >= ((o == null ? void 0 : o.level) ?? -1);
|
|
329
411
|
console.info(
|
|
330
|
-
`~~~~before route change~~~~ ${
|
|
331
|
-
),
|
|
412
|
+
`~~~~before route change~~~~ ${a} -> ${e} inner=${n} forward=${c}`
|
|
413
|
+
), n ? r ? oe.value = "" : oe.value = c ? "inner-left" : "inner-right" : window.routeExtras = { forward: c };
|
|
332
414
|
}
|
|
333
|
-
function
|
|
334
|
-
return !!
|
|
415
|
+
function Re() {
|
|
416
|
+
return !!R.get("accessToken");
|
|
335
417
|
}
|
|
336
|
-
function
|
|
337
|
-
return !!
|
|
418
|
+
function Ee() {
|
|
419
|
+
return !!R.get("activeOrg");
|
|
338
420
|
}
|
|
339
|
-
function
|
|
340
|
-
const l =
|
|
421
|
+
function ft(e, a, t) {
|
|
422
|
+
const l = Re(), o = Ee(), n = z(e.path);
|
|
341
423
|
if (!n) {
|
|
342
424
|
t();
|
|
343
425
|
return;
|
|
@@ -377,7 +459,7 @@ function gt(e, a, t) {
|
|
|
377
459
|
D(e.path, a.path), t();
|
|
378
460
|
}
|
|
379
461
|
function P(e, a) {
|
|
380
|
-
const t =
|
|
462
|
+
const t = ne(), l = f({
|
|
381
463
|
get() {
|
|
382
464
|
return t.hasView(e);
|
|
383
465
|
},
|
|
@@ -389,48 +471,48 @@ function P(e, a) {
|
|
|
389
471
|
};
|
|
390
472
|
return S(() => {
|
|
391
473
|
s.on(e, o);
|
|
392
|
-
}),
|
|
474
|
+
}), T(() => {
|
|
393
475
|
s.off(e, o);
|
|
394
476
|
}), { open: l };
|
|
395
477
|
}
|
|
396
|
-
const Ue = /* @__PURE__ */
|
|
478
|
+
const Ue = /* @__PURE__ */ U({
|
|
397
479
|
__name: "index",
|
|
398
480
|
setup(e) {
|
|
399
|
-
const a = Q(), { open: t } = P("confirmDlg"), l =
|
|
481
|
+
const a = Q(), { open: t } = P("confirmDlg"), l = i(""), o = i(""), n = i(), r = i(), c = f(() => {
|
|
400
482
|
var u;
|
|
401
483
|
return ((u = n.value) == null ? void 0 : u.color) ?? "primary";
|
|
402
|
-
}), p =
|
|
484
|
+
}), p = f(() => {
|
|
403
485
|
var u;
|
|
404
486
|
return ((u = n.value) == null ? void 0 : u.text) ?? a.t("cancel");
|
|
405
|
-
}), _ =
|
|
487
|
+
}), _ = f(() => {
|
|
406
488
|
var u;
|
|
407
489
|
return ((u = r.value) == null ? void 0 : u.color) ?? "primary";
|
|
408
|
-
}), v =
|
|
490
|
+
}), v = f(() => {
|
|
409
491
|
var u;
|
|
410
492
|
return ((u = r.value) == null ? void 0 : u.text) ?? a.t("confirm");
|
|
411
493
|
});
|
|
412
494
|
let y = 0, C = !1;
|
|
413
|
-
const
|
|
495
|
+
const j = (u) => {
|
|
414
496
|
l.value = u.title, o.value = u.text, n.value = u.cancel, r.value = u.confirm, y = u.seq, C = !1, t.value = !0;
|
|
415
497
|
};
|
|
416
498
|
S(() => {
|
|
417
|
-
s.on("confirmDlg",
|
|
418
|
-
}),
|
|
419
|
-
s.off("confirmDlg",
|
|
499
|
+
s.on("confirmDlg", j);
|
|
500
|
+
}), T(() => {
|
|
501
|
+
s.off("confirmDlg", j);
|
|
420
502
|
});
|
|
421
|
-
const
|
|
503
|
+
const I = () => {
|
|
422
504
|
t.value = !1, C || (s.emit("confirmDlgResult" + y, !0), C = !0);
|
|
423
505
|
};
|
|
424
506
|
return N(t, (u) => {
|
|
425
507
|
!u && !C && (s.emit("confirmDlgResult" + y, !1), C = !0);
|
|
426
508
|
}), (u, g) => {
|
|
427
|
-
const b = h("v-card-text"), q = h("v-btn"),
|
|
509
|
+
const b = h("v-card-text"), q = h("v-btn"), O = h("v-card-actions"), d = h("v-card"), x = h("v-dialog");
|
|
428
510
|
return V(), E(x, {
|
|
429
|
-
modelValue:
|
|
430
|
-
"onUpdate:modelValue": g[1] || (g[1] = (
|
|
511
|
+
modelValue: F(t),
|
|
512
|
+
"onUpdate:modelValue": g[1] || (g[1] = ($) => G(t) ? t.value = $ : null),
|
|
431
513
|
onKeydown: [
|
|
432
|
-
g[2] || (g[2] =
|
|
433
|
-
|
|
514
|
+
g[2] || (g[2] = M(W(($) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
515
|
+
M(W(I, ["stop", "prevent"]), ["enter"])
|
|
434
516
|
],
|
|
435
517
|
transition: "dialog-top-transition",
|
|
436
518
|
"max-width": "600px"
|
|
@@ -440,29 +522,29 @@ const Ue = /* @__PURE__ */ M({
|
|
|
440
522
|
default: w(() => [
|
|
441
523
|
k(b, null, {
|
|
442
524
|
default: w(() => [
|
|
443
|
-
|
|
525
|
+
B(A(o.value), 1)
|
|
444
526
|
]),
|
|
445
527
|
_: 1
|
|
446
528
|
}),
|
|
447
|
-
k(
|
|
529
|
+
k(O, { class: "d-flex justify-end" }, {
|
|
448
530
|
default: w(() => [
|
|
449
531
|
k(q, {
|
|
450
|
-
onClick: g[0] || (g[0] = (
|
|
532
|
+
onClick: g[0] || (g[0] = ($) => t.value = !1),
|
|
451
533
|
color: c.value,
|
|
452
534
|
variant: "text"
|
|
453
535
|
}, {
|
|
454
536
|
default: w(() => [
|
|
455
|
-
|
|
537
|
+
B(A(p.value), 1)
|
|
456
538
|
]),
|
|
457
539
|
_: 1
|
|
458
540
|
}, 8, ["color"]),
|
|
459
541
|
k(q, {
|
|
460
|
-
onClick:
|
|
542
|
+
onClick: I,
|
|
461
543
|
color: _.value,
|
|
462
544
|
variant: "text"
|
|
463
545
|
}, {
|
|
464
546
|
default: w(() => [
|
|
465
|
-
|
|
547
|
+
B(A(v.value), 1)
|
|
466
548
|
]),
|
|
467
549
|
_: 1
|
|
468
550
|
}, 8, ["color"])
|
|
@@ -477,7 +559,7 @@ const Ue = /* @__PURE__ */ M({
|
|
|
477
559
|
}, 8, ["modelValue", "onKeydown"]);
|
|
478
560
|
};
|
|
479
561
|
}
|
|
480
|
-
}), $e = (e) => (
|
|
562
|
+
}), $e = (e) => (ve("data-v-f4ad116e"), e = e(), me(), e), Ke = /* @__PURE__ */ $e(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
|
|
481
563
|
/* @__PURE__ */ m("div"),
|
|
482
564
|
/* @__PURE__ */ m("div"),
|
|
483
565
|
/* @__PURE__ */ m("div"),
|
|
@@ -492,7 +574,7 @@ const Ue = /* @__PURE__ */ M({
|
|
|
492
574
|
/* @__PURE__ */ m("div")
|
|
493
575
|
], -1)), We = [
|
|
494
576
|
Ke
|
|
495
|
-
], ze = /* @__PURE__ */
|
|
577
|
+
], ze = /* @__PURE__ */ U({
|
|
496
578
|
__name: "index",
|
|
497
579
|
props: {
|
|
498
580
|
zIndex: {
|
|
@@ -501,21 +583,21 @@ const Ue = /* @__PURE__ */ M({
|
|
|
501
583
|
}
|
|
502
584
|
},
|
|
503
585
|
setup(e) {
|
|
504
|
-
const a = H(), t = e, l =
|
|
586
|
+
const a = H(), t = e, l = f(() => ({
|
|
505
587
|
background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
|
|
506
588
|
zIndex: t.zIndex
|
|
507
589
|
}));
|
|
508
590
|
return (o, n) => (V(), J("div", {
|
|
509
591
|
class: "x-cont",
|
|
510
|
-
style:
|
|
592
|
+
style: ge(l.value)
|
|
511
593
|
}, We, 4));
|
|
512
594
|
}
|
|
513
|
-
}),
|
|
595
|
+
}), pe = (e, a) => {
|
|
514
596
|
const t = e.__vccOpts || e;
|
|
515
597
|
for (const [l, o] of a)
|
|
516
598
|
t[l] = o;
|
|
517
599
|
return t;
|
|
518
|
-
}, Le = /* @__PURE__ */
|
|
600
|
+
}, Le = /* @__PURE__ */ pe(ze, [["__scopeId", "data-v-f4ad116e"]]), Fe = /* @__PURE__ */ U({
|
|
519
601
|
__name: "item",
|
|
520
602
|
props: {
|
|
521
603
|
id: {},
|
|
@@ -525,7 +607,7 @@ const Ue = /* @__PURE__ */ M({
|
|
|
525
607
|
},
|
|
526
608
|
emits: ["timeout"],
|
|
527
609
|
setup(e, { emit: a }) {
|
|
528
|
-
const t = e, l =
|
|
610
|
+
const t = e, l = i(!0), o = a;
|
|
529
611
|
return S(() => {
|
|
530
612
|
setTimeout(() => {
|
|
531
613
|
o("timeout", t.id);
|
|
@@ -548,13 +630,13 @@ const Ue = /* @__PURE__ */ M({
|
|
|
548
630
|
}, null, 8, ["modelValue", "type", "text"]);
|
|
549
631
|
};
|
|
550
632
|
}
|
|
551
|
-
}),
|
|
633
|
+
}), Me = /* @__PURE__ */ U({
|
|
552
634
|
__name: "index",
|
|
553
635
|
setup(e) {
|
|
554
|
-
const a =
|
|
636
|
+
const a = he({ items: [] });
|
|
555
637
|
S(() => {
|
|
556
638
|
s.on("message", t);
|
|
557
|
-
}),
|
|
639
|
+
}), T(() => {
|
|
558
640
|
s.off("message", t);
|
|
559
641
|
});
|
|
560
642
|
const t = (c) => {
|
|
@@ -571,11 +653,11 @@ const Ue = /* @__PURE__ */ M({
|
|
|
571
653
|
p >= 0 && a.items.splice(p, 1);
|
|
572
654
|
};
|
|
573
655
|
return (c, p) => (V(), J("div", {
|
|
574
|
-
onClick: p[0] || (p[0] =
|
|
656
|
+
onClick: p[0] || (p[0] = W(() => {
|
|
575
657
|
}, ["stop"])),
|
|
576
658
|
class: "x-cont d-flex flex-column-reverse align-center"
|
|
577
659
|
}, [
|
|
578
|
-
(V(!0), J(
|
|
660
|
+
(V(!0), J(we, null, xe(a.items, (_) => (V(), E(Fe, {
|
|
579
661
|
onTimeout: l,
|
|
580
662
|
id: _.id,
|
|
581
663
|
type: _.type,
|
|
@@ -585,22 +667,22 @@ const Ue = /* @__PURE__ */ M({
|
|
|
585
667
|
}, null, 8, ["id", "type", "text", "timeout"]))), 128))
|
|
586
668
|
]));
|
|
587
669
|
}
|
|
588
|
-
}),
|
|
670
|
+
}), Ne = /* @__PURE__ */ pe(Me, [["__scopeId", "data-v-8c2268ea"]]), He = /* @__PURE__ */ U({
|
|
589
671
|
__name: "index",
|
|
590
672
|
setup(e) {
|
|
591
|
-
const a = Q(), { open: t } = P("promptDlg"), l =
|
|
673
|
+
const a = Q(), { open: t } = P("promptDlg"), l = i(""), o = i(""), n = i(), r = i(), c = i(), p = i(""), _ = i(), v = i(), y = f(() => {
|
|
592
674
|
var d;
|
|
593
675
|
return ((d = _.value) == null ? void 0 : d.color) ?? "primary";
|
|
594
|
-
}), C =
|
|
676
|
+
}), C = f(() => {
|
|
595
677
|
var d;
|
|
596
678
|
return ((d = _.value) == null ? void 0 : d.text) ?? a.t("cancel");
|
|
597
|
-
}),
|
|
679
|
+
}), j = f(() => {
|
|
598
680
|
var d;
|
|
599
681
|
return ((d = v.value) == null ? void 0 : d.color) ?? "primary";
|
|
600
|
-
}),
|
|
682
|
+
}), I = f(() => {
|
|
601
683
|
var d;
|
|
602
684
|
return ((d = v.value) == null ? void 0 : d.text) ?? a.t("confirm");
|
|
603
|
-
}), u =
|
|
685
|
+
}), u = i();
|
|
604
686
|
let g = 0, b = !1;
|
|
605
687
|
const q = async (d) => {
|
|
606
688
|
var x;
|
|
@@ -608,22 +690,22 @@ const Ue = /* @__PURE__ */ M({
|
|
|
608
690
|
};
|
|
609
691
|
S(() => {
|
|
610
692
|
s.on("promptDlg", q);
|
|
611
|
-
}),
|
|
693
|
+
}), T(() => {
|
|
612
694
|
s.off("promptDlg", q);
|
|
613
695
|
});
|
|
614
|
-
const
|
|
696
|
+
const O = () => {
|
|
615
697
|
t.value = !1, b || (s.emit("promptDlgResult" + g, p.value ?? ""), b = !0);
|
|
616
698
|
};
|
|
617
699
|
return N(t, (d) => {
|
|
618
700
|
!d && !b && (s.emit("promptDlgResult" + g, void 0), b = !0);
|
|
619
701
|
}), (d, x) => {
|
|
620
|
-
const
|
|
621
|
-
return V(), E(
|
|
622
|
-
modelValue:
|
|
623
|
-
"onUpdate:modelValue": x[2] || (x[2] = (
|
|
702
|
+
const $ = h("v-card-text"), se = h("v-text-field"), _e = h("v-form"), ee = h("v-btn"), de = h("v-card-actions"), ie = h("v-card"), fe = h("v-dialog");
|
|
703
|
+
return V(), E(fe, {
|
|
704
|
+
modelValue: F(t),
|
|
705
|
+
"onUpdate:modelValue": x[2] || (x[2] = (K) => G(t) ? t.value = K : null),
|
|
624
706
|
onKeydown: [
|
|
625
|
-
x[3] || (x[3] =
|
|
626
|
-
|
|
707
|
+
x[3] || (x[3] = M(W((K) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
708
|
+
M(W(O, ["stop", "prevent"]), ["enter"])
|
|
627
709
|
],
|
|
628
710
|
transition: "dialog-top-transition",
|
|
629
711
|
"max-width": "600px"
|
|
@@ -631,17 +713,17 @@ const Ue = /* @__PURE__ */ M({
|
|
|
631
713
|
default: w(() => [
|
|
632
714
|
k(ie, { title: l.value }, {
|
|
633
715
|
default: w(() => [
|
|
634
|
-
o.value ? (V(), E(
|
|
716
|
+
o.value ? (V(), E($, { key: 0 }, {
|
|
635
717
|
default: w(() => [
|
|
636
|
-
|
|
718
|
+
B(A(o.value), 1)
|
|
637
719
|
]),
|
|
638
720
|
_: 1
|
|
639
|
-
})) :
|
|
640
|
-
k(
|
|
721
|
+
})) : ye("", !0),
|
|
722
|
+
k(_e, { class: "mx-3" }, {
|
|
641
723
|
default: w(() => [
|
|
642
|
-
k(
|
|
724
|
+
k(se, {
|
|
643
725
|
modelValue: p.value,
|
|
644
|
-
"onUpdate:modelValue": x[0] || (x[0] = (
|
|
726
|
+
"onUpdate:modelValue": x[0] || (x[0] = (K) => p.value = K),
|
|
645
727
|
label: n.value,
|
|
646
728
|
placeholder: r.value,
|
|
647
729
|
rules: c.value,
|
|
@@ -651,25 +733,25 @@ const Ue = /* @__PURE__ */ M({
|
|
|
651
733
|
]),
|
|
652
734
|
_: 1
|
|
653
735
|
}),
|
|
654
|
-
k(
|
|
736
|
+
k(de, { class: "d-flex justify-end" }, {
|
|
655
737
|
default: w(() => [
|
|
656
738
|
k(ee, {
|
|
657
|
-
onClick: x[1] || (x[1] = (
|
|
739
|
+
onClick: x[1] || (x[1] = (K) => t.value = !1),
|
|
658
740
|
color: y.value,
|
|
659
741
|
variant: "text"
|
|
660
742
|
}, {
|
|
661
743
|
default: w(() => [
|
|
662
|
-
|
|
744
|
+
B(A(C.value), 1)
|
|
663
745
|
]),
|
|
664
746
|
_: 1
|
|
665
747
|
}, 8, ["color"]),
|
|
666
748
|
k(ee, {
|
|
667
|
-
onClick:
|
|
668
|
-
color:
|
|
749
|
+
onClick: O,
|
|
750
|
+
color: j.value,
|
|
669
751
|
variant: "text"
|
|
670
752
|
}, {
|
|
671
753
|
default: w(() => [
|
|
672
|
-
|
|
754
|
+
B(A(I.value), 1)
|
|
673
755
|
]),
|
|
674
756
|
_: 1
|
|
675
757
|
}, 8, ["color"])
|
|
@@ -684,7 +766,7 @@ const Ue = /* @__PURE__ */ M({
|
|
|
684
766
|
}, 8, ["modelValue", "onKeydown"]);
|
|
685
767
|
};
|
|
686
768
|
}
|
|
687
|
-
}),
|
|
769
|
+
}), Je = { class: "mx-auto my-auto" }, Xe = { class: "d-flex align-center justify-center w-100 h-100" }, Ge = /* @__PURE__ */ U({
|
|
688
770
|
__name: "index",
|
|
689
771
|
setup(e) {
|
|
690
772
|
const a = Q(), { open: t } = P("waitDlg"), l = () => {
|
|
@@ -694,27 +776,27 @@ const Ue = /* @__PURE__ */ M({
|
|
|
694
776
|
};
|
|
695
777
|
return S(() => {
|
|
696
778
|
s.on("openWaitDlg", l), s.on("closeWaitDlg", o);
|
|
697
|
-
}),
|
|
779
|
+
}), T(() => {
|
|
698
780
|
s.off("openWaitDlg", l), s.off("closeWaitDlg", o);
|
|
699
781
|
}), (n, r) => {
|
|
700
782
|
const c = h("v-card"), p = h("v-dialog");
|
|
701
783
|
return V(), E(p, {
|
|
702
|
-
modelValue:
|
|
784
|
+
modelValue: F(t),
|
|
703
785
|
"onUpdate:modelValue": r[0] || (r[0] = (_) => G(t) ? t.value = _ : null),
|
|
704
786
|
persistent: "",
|
|
705
787
|
"no-click-animation": "",
|
|
706
788
|
fullscreen: ""
|
|
707
789
|
}, {
|
|
708
790
|
default: w(() => [
|
|
709
|
-
m("div",
|
|
791
|
+
m("div", Je, [
|
|
710
792
|
k(c, {
|
|
711
793
|
width: "300px",
|
|
712
794
|
height: "80px",
|
|
713
795
|
loading: ""
|
|
714
796
|
}, {
|
|
715
797
|
default: w(() => [
|
|
716
|
-
m("div",
|
|
717
|
-
m("span", null,
|
|
798
|
+
m("div", Xe, [
|
|
799
|
+
m("span", null, A(F(a).t("waitingResponse")), 1)
|
|
718
800
|
])
|
|
719
801
|
]),
|
|
720
802
|
_: 1
|
|
@@ -725,11 +807,11 @@ const Ue = /* @__PURE__ */ M({
|
|
|
725
807
|
}, 8, ["modelValue"]);
|
|
726
808
|
};
|
|
727
809
|
}
|
|
728
|
-
}),
|
|
729
|
-
e.component("x-confirm-dlg", Ue), e.component("x-loading", Le), e.component("x-message",
|
|
810
|
+
}), Qe = (e) => {
|
|
811
|
+
e.component("x-confirm-dlg", Ue), e.component("x-loading", Le), e.component("x-message", Ne), e.component("x-prompt-dlg", He), e.component("x-wait-dlg", Ge);
|
|
730
812
|
};
|
|
731
|
-
function
|
|
732
|
-
const e = H(), a =
|
|
813
|
+
function gt() {
|
|
814
|
+
const e = H(), a = f(() => e.global.current.value.colors.primary), t = f(() => e.global.current.value.colors.secondary), l = f(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), o = f(() => e.current.value.dark ? "#272727" : "#eeeeee"), n = f(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), r = f(() => e.current.value.dark ? "#303030" : "#f6f6f6"), c = f(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
|
|
733
815
|
return {
|
|
734
816
|
primaryColor: a,
|
|
735
817
|
secondaryColor: t,
|
|
@@ -740,11 +822,11 @@ function vt() {
|
|
|
740
822
|
borderColor: c
|
|
741
823
|
};
|
|
742
824
|
}
|
|
743
|
-
function
|
|
825
|
+
function Ye(e, a) {
|
|
744
826
|
return e.post("pullPermission", a);
|
|
745
827
|
}
|
|
746
|
-
function
|
|
747
|
-
const t =
|
|
828
|
+
function vt(e, a) {
|
|
829
|
+
const t = Ce(), l = re(), o = Y(), n = ne();
|
|
748
830
|
let r = !0;
|
|
749
831
|
const c = () => {
|
|
750
832
|
r = !1;
|
|
@@ -756,7 +838,7 @@ function mt(e, a) {
|
|
|
756
838
|
n.hasView("waitDlg") || n.popView();
|
|
757
839
|
return;
|
|
758
840
|
}
|
|
759
|
-
const u =
|
|
841
|
+
const u = z(t.path);
|
|
760
842
|
(u == null ? void 0 : u.level) === 0 ? (g = navigator == null ? void 0 : navigator.Backbutton) == null || g.goHome(
|
|
761
843
|
() => {
|
|
762
844
|
},
|
|
@@ -766,7 +848,7 @@ function mt(e, a) {
|
|
|
766
848
|
};
|
|
767
849
|
S(() => {
|
|
768
850
|
s.on("pause", c), s.on("resume", p), s.on("backbutton", _);
|
|
769
|
-
}),
|
|
851
|
+
}), T(() => {
|
|
770
852
|
s.off("pause", c), s.off("resume", p), s.off("backbutton", _);
|
|
771
853
|
});
|
|
772
854
|
const v = (u) => {
|
|
@@ -785,46 +867,46 @@ function mt(e, a) {
|
|
|
785
867
|
};
|
|
786
868
|
S(() => {
|
|
787
869
|
window.addEventListener("keydown", v);
|
|
788
|
-
}),
|
|
870
|
+
}), T(() => {
|
|
789
871
|
window.removeEventListener("keydown", v);
|
|
790
872
|
});
|
|
791
873
|
let y;
|
|
792
874
|
const C = async () => {
|
|
793
875
|
if (!r)
|
|
794
876
|
return;
|
|
795
|
-
const u =
|
|
877
|
+
const u = z(t.path);
|
|
796
878
|
if (!(!u || u.requiredState !== "org"))
|
|
797
879
|
try {
|
|
798
|
-
const { update: g, permissions: b } = await
|
|
880
|
+
const { update: g, permissions: b } = await Ye(a, {
|
|
799
881
|
checksum: o.permissionChecksum
|
|
800
882
|
});
|
|
801
883
|
if (!g)
|
|
802
884
|
return;
|
|
803
885
|
const q = {};
|
|
804
|
-
for (const
|
|
805
|
-
if (
|
|
886
|
+
for (const O in b) {
|
|
887
|
+
if (O === "checksum")
|
|
806
888
|
continue;
|
|
807
|
-
const d = b[
|
|
808
|
-
q[
|
|
889
|
+
const d = b[O];
|
|
890
|
+
q[O] = JSON.parse(d);
|
|
809
891
|
}
|
|
810
892
|
o.permissionObjects = q, o.permissionChecksum = b.checksum ?? "";
|
|
811
893
|
} catch (g) {
|
|
812
894
|
console.error(g);
|
|
813
895
|
}
|
|
814
|
-
},
|
|
896
|
+
}, j = async (u) => {
|
|
815
897
|
u && await C(), clearTimeout(y), y = setTimeout(async () => {
|
|
816
|
-
await C(), y &&
|
|
898
|
+
await C(), y && j();
|
|
817
899
|
}, 3e3);
|
|
818
|
-
},
|
|
900
|
+
}, I = () => {
|
|
819
901
|
clearTimeout(y), y = void 0;
|
|
820
902
|
};
|
|
821
903
|
S(() => {
|
|
822
|
-
a &&
|
|
823
|
-
}),
|
|
824
|
-
|
|
904
|
+
a && j(!0);
|
|
905
|
+
}), T(() => {
|
|
906
|
+
I();
|
|
825
907
|
});
|
|
826
908
|
}
|
|
827
|
-
function
|
|
909
|
+
function mt() {
|
|
828
910
|
const e = Y();
|
|
829
911
|
function a(t, l) {
|
|
830
912
|
const o = e.permissionObjects[t];
|
|
@@ -832,36 +914,36 @@ function ht() {
|
|
|
832
914
|
}
|
|
833
915
|
return { verifyPermission: a };
|
|
834
916
|
}
|
|
835
|
-
function
|
|
836
|
-
const e = H(), a =
|
|
917
|
+
function ht() {
|
|
918
|
+
const e = H(), a = ke(), t = f(() => e.current.value.dark), l = f(() => !!window.cordova), o = f(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
|
|
837
919
|
return { dark: t, sysBarAvail: l, compactWidth: o };
|
|
838
920
|
}
|
|
839
|
-
const
|
|
921
|
+
const wt = { install: Qe };
|
|
840
922
|
export {
|
|
841
923
|
Ie as Permission,
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
924
|
+
rt as appAppear,
|
|
925
|
+
pt as closeWaitDlg,
|
|
926
|
+
ot as createAxios,
|
|
927
|
+
wt as default,
|
|
846
928
|
s as eventBus,
|
|
847
929
|
ae as isExist,
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
930
|
+
z as matchRouteMeta,
|
|
931
|
+
st as messageError,
|
|
932
|
+
_t as messageInfo,
|
|
933
|
+
dt as messageSuccess,
|
|
852
934
|
it as messageWarning,
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
935
|
+
ft as onBeforeEach,
|
|
936
|
+
nt as openConfirmDlg,
|
|
937
|
+
ct as openPromptDlg,
|
|
938
|
+
ut as openWaitDlg,
|
|
939
|
+
oe as routeTransName,
|
|
940
|
+
gt as useColor,
|
|
859
941
|
Y as useGlobalStore,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
942
|
+
vt as useMicroApp,
|
|
943
|
+
mt as usePermission,
|
|
944
|
+
ht as useSystem,
|
|
945
|
+
ne as useViewMgrStore,
|
|
864
946
|
P as useViewStack,
|
|
865
|
-
|
|
947
|
+
lt as waitMs,
|
|
866
948
|
Z as waitUtil
|
|
867
949
|
};
|
package/dist/utils/router.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { RouteLocationNormalized, NavigationGuardNext } from 'vue-router';
|
|
2
|
-
type RequiredState = 'auth' | 'org';
|
|
3
2
|
interface RouteMeta {
|
|
4
3
|
app: 'x-app-mf' | 'x-asset-mf' | 'x-calc-mf' | 'x-data-mf' | 'x-main-mf' | 'x-mine-mf' | 'x-org-mf' | 'x-passport-mf';
|
|
5
4
|
path: string;
|
|
6
5
|
level: number;
|
|
7
|
-
requiredState?:
|
|
6
|
+
requiredState?: 'auth' | 'org';
|
|
8
7
|
mainActive?: 2 | 3 | 4;
|
|
9
8
|
}
|
|
10
9
|
export declare function matchRouteMeta(path: string): RouteMeta | undefined;
|