x-essential-lib 0.5.61 → 0.5.67
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/composables/microApp.d.ts +1 -3
- package/dist/index.js +329 -410
- package/dist/store/global.d.ts +3 -4
- package/dist/utils/misc.d.ts +0 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,68 +1,39 @@
|
|
|
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 i,
|
|
3
|
-
import {
|
|
2
|
+
import { ref as i, computed as g, onMounted as q, onBeforeUnmount as j, defineComponent as T, watch as G, resolveComponent as h, openBlock as D, createBlock as O, unref as z, isRef as J, withKeys as F, withModifiers as U, withCtx as w, createVNode as y, createTextVNode as A, toDisplayString as S, createElementBlock as H, 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 { useLocale as Q, useTheme as Y, useDisplay as ke } from "vuetify";
|
|
4
4
|
import { defineStore as le } from "pinia";
|
|
5
|
-
import
|
|
6
|
-
import { useRouter as
|
|
7
|
-
const Z = le(
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
{ immediate: !0 }
|
|
19
|
-
), {
|
|
20
|
-
dark: a,
|
|
21
|
-
locale: t,
|
|
22
|
-
permissionObjects: l,
|
|
23
|
-
permissionChecksum: o,
|
|
24
|
-
lastAppPath: n
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
persist: [
|
|
29
|
-
{
|
|
30
|
-
beforeRestore: (e) => {
|
|
31
|
-
console.log("beforeRestore", e.store.$state);
|
|
32
|
-
},
|
|
33
|
-
afterRestore: (e) => {
|
|
34
|
-
console.log("afterRestore", e.store.$state);
|
|
35
|
-
},
|
|
36
|
-
storage: localStorage,
|
|
37
|
-
paths: ["dark", "locale"]
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
storage: sessionStorage,
|
|
41
|
-
paths: ["permissionObjects", "permissionChecksum", "lastAppPath"]
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
), ne = le("viewMgr", () => {
|
|
5
|
+
import Ce from "axios";
|
|
6
|
+
import { useRouter as ne, useRoute as be } from "vue-router";
|
|
7
|
+
const Z = le("global", () => {
|
|
8
|
+
const e = i(!1), a = i("en"), t = i({}), l = i(""), o = i("");
|
|
9
|
+
return {
|
|
10
|
+
dark: e,
|
|
11
|
+
locale: a,
|
|
12
|
+
permissionObjects: t,
|
|
13
|
+
permissionChecksum: l,
|
|
14
|
+
lastAppPath: o
|
|
15
|
+
};
|
|
16
|
+
}), re = le("viewMgr", () => {
|
|
46
17
|
const e = i([]);
|
|
47
18
|
function a() {
|
|
48
19
|
return e.value.length <= 0;
|
|
49
20
|
}
|
|
50
21
|
function t() {
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
return e.value[
|
|
22
|
+
const p = e.value.length;
|
|
23
|
+
if (p > 0)
|
|
24
|
+
return e.value[p - 1];
|
|
54
25
|
}
|
|
55
|
-
function l(
|
|
56
|
-
return e.value.find((
|
|
26
|
+
function l(p) {
|
|
27
|
+
return e.value.find((s) => s === p) !== void 0;
|
|
57
28
|
}
|
|
58
|
-
function o(
|
|
59
|
-
e.value.push(
|
|
29
|
+
function o(p) {
|
|
30
|
+
e.value.push(p);
|
|
60
31
|
}
|
|
61
|
-
function
|
|
62
|
-
const
|
|
63
|
-
|
|
32
|
+
function r(p) {
|
|
33
|
+
const s = e.value.findIndex((v) => v === p);
|
|
34
|
+
s !== -1 && e.value.splice(s, 1);
|
|
64
35
|
}
|
|
65
|
-
function
|
|
36
|
+
function n() {
|
|
66
37
|
console.assert(e.value.length > 0), e.value.pop();
|
|
67
38
|
}
|
|
68
39
|
function c() {
|
|
@@ -74,8 +45,8 @@ const Z = le(
|
|
|
74
45
|
lastView: t,
|
|
75
46
|
hasView: l,
|
|
76
47
|
addView: o,
|
|
77
|
-
delView:
|
|
78
|
-
popView:
|
|
48
|
+
delView: r,
|
|
49
|
+
popView: n,
|
|
79
50
|
clearViews: c
|
|
80
51
|
};
|
|
81
52
|
});
|
|
@@ -99,48 +70,48 @@ var De = {
|
|
|
99
70
|
);
|
|
100
71
|
}
|
|
101
72
|
};
|
|
102
|
-
function
|
|
103
|
-
function t(o,
|
|
73
|
+
function X(e, a) {
|
|
74
|
+
function t(o, r, n) {
|
|
104
75
|
if (!(typeof document > "u")) {
|
|
105
|
-
|
|
76
|
+
n = W({}, a, n), typeof n.expires == "number" && (n.expires = new Date(Date.now() + n.expires * 864e5)), n.expires && (n.expires = n.expires.toUTCString()), o = encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
106
77
|
var c = "";
|
|
107
|
-
for (var
|
|
108
|
-
|
|
109
|
-
return document.cookie = o + "=" + e.write(
|
|
78
|
+
for (var p in n)
|
|
79
|
+
n[p] && (c += "; " + p, n[p] !== !0 && (c += "=" + n[p].split(";")[0]));
|
|
80
|
+
return document.cookie = o + "=" + e.write(r, o) + c;
|
|
110
81
|
}
|
|
111
82
|
}
|
|
112
83
|
function l(o) {
|
|
113
84
|
if (!(typeof document > "u" || arguments.length && !o)) {
|
|
114
|
-
for (var
|
|
115
|
-
var
|
|
85
|
+
for (var r = document.cookie ? document.cookie.split("; ") : [], n = {}, c = 0; c < r.length; c++) {
|
|
86
|
+
var p = r[c].split("="), s = p.slice(1).join("=");
|
|
116
87
|
try {
|
|
117
|
-
var v = decodeURIComponent(
|
|
118
|
-
if (
|
|
88
|
+
var v = decodeURIComponent(p[0]);
|
|
89
|
+
if (n[v] = e.read(s, v), o === v)
|
|
119
90
|
break;
|
|
120
91
|
} catch {
|
|
121
92
|
}
|
|
122
93
|
}
|
|
123
|
-
return o ?
|
|
94
|
+
return o ? n[o] : n;
|
|
124
95
|
}
|
|
125
96
|
}
|
|
126
97
|
return Object.create(
|
|
127
98
|
{
|
|
128
99
|
set: t,
|
|
129
100
|
get: l,
|
|
130
|
-
remove: function(o,
|
|
101
|
+
remove: function(o, r) {
|
|
131
102
|
t(
|
|
132
103
|
o,
|
|
133
104
|
"",
|
|
134
|
-
W({},
|
|
105
|
+
W({}, r, {
|
|
135
106
|
expires: -1
|
|
136
107
|
})
|
|
137
108
|
);
|
|
138
109
|
},
|
|
139
110
|
withAttributes: function(o) {
|
|
140
|
-
return
|
|
111
|
+
return X(this.converter, W({}, this.attributes, o));
|
|
141
112
|
},
|
|
142
113
|
withConverter: function(o) {
|
|
143
|
-
return
|
|
114
|
+
return X(W({}, this.converter, o), this.attributes);
|
|
144
115
|
}
|
|
145
116
|
},
|
|
146
117
|
{
|
|
@@ -149,29 +120,29 @@ function G(e, a) {
|
|
|
149
120
|
}
|
|
150
121
|
);
|
|
151
122
|
}
|
|
152
|
-
var
|
|
153
|
-
function
|
|
154
|
-
const a =
|
|
123
|
+
var I = X(De, { path: "/" });
|
|
124
|
+
function ot(e) {
|
|
125
|
+
const a = Ce.create({
|
|
155
126
|
timeout: 6e3
|
|
156
127
|
});
|
|
157
128
|
return a.defaults.baseURL = e.baseUrl, a.interceptors.request.use(
|
|
158
129
|
(t) => Re(t),
|
|
159
130
|
(t) => {
|
|
160
|
-
|
|
131
|
+
Ve(t, e.onError);
|
|
161
132
|
}
|
|
162
133
|
), a.interceptors.response.use(
|
|
163
|
-
(t) =>
|
|
134
|
+
(t) => Se(t),
|
|
164
135
|
(t) => qe(t, e.onError)
|
|
165
136
|
), a;
|
|
166
137
|
}
|
|
167
138
|
function Re(e) {
|
|
168
|
-
const a =
|
|
139
|
+
const a = I.get("accessToken") ?? "";
|
|
169
140
|
return e.headers.Authorization = "Basic " + a, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
|
|
170
141
|
}
|
|
171
|
-
function
|
|
142
|
+
function Ve(e, a) {
|
|
172
143
|
console.error(e), a("request timeout");
|
|
173
144
|
}
|
|
174
|
-
function
|
|
145
|
+
function Se(e) {
|
|
175
146
|
return e.data;
|
|
176
147
|
}
|
|
177
148
|
function qe(e, a) {
|
|
@@ -179,17 +150,17 @@ function qe(e, a) {
|
|
|
179
150
|
const t = e.response;
|
|
180
151
|
if (!t)
|
|
181
152
|
return Promise.reject(e);
|
|
182
|
-
t.status === 401 &&
|
|
153
|
+
t.status === 401 && Ae();
|
|
183
154
|
let l = (o = t.data) == null ? void 0 : o.message;
|
|
184
155
|
return l || (l = {
|
|
185
156
|
code: t.status,
|
|
186
157
|
message: t.statusText
|
|
187
158
|
}), a(l), Promise.reject(e);
|
|
188
159
|
}
|
|
189
|
-
function
|
|
190
|
-
|
|
160
|
+
function Ae() {
|
|
161
|
+
I.remove("accessToken"), I.remove("refreshToken"), I.remove("activeOrg"), ne().replace({ path: "/passport/login" });
|
|
191
162
|
}
|
|
192
|
-
function
|
|
163
|
+
function Ie(e) {
|
|
193
164
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(a, t) {
|
|
194
165
|
var l = e.get(a);
|
|
195
166
|
l ? l.push(t) : e.set(a, [t]);
|
|
@@ -205,10 +176,10 @@ function Te(e) {
|
|
|
205
176
|
});
|
|
206
177
|
} };
|
|
207
178
|
}
|
|
208
|
-
const
|
|
209
|
-
return window.eventBus || (window.eventBus =
|
|
179
|
+
const u = function() {
|
|
180
|
+
return window.eventBus || (window.eventBus = Ie()), window.eventBus;
|
|
210
181
|
}();
|
|
211
|
-
async function
|
|
182
|
+
async function lt(e) {
|
|
212
183
|
return new Promise((a) => {
|
|
213
184
|
setTimeout(a, e);
|
|
214
185
|
});
|
|
@@ -216,22 +187,17 @@ async function nt(e) {
|
|
|
216
187
|
async function P(e, a, t) {
|
|
217
188
|
const l = Date.now();
|
|
218
189
|
return new Promise((o) => {
|
|
219
|
-
const
|
|
220
|
-
e() ? o(!0) : a && Date.now() - l > a ? o(!1) : setTimeout(
|
|
190
|
+
const r = async () => {
|
|
191
|
+
e() ? o(!0) : a && Date.now() - l > a ? o(!1) : setTimeout(r, t ?? 30);
|
|
221
192
|
};
|
|
222
|
-
|
|
193
|
+
r();
|
|
223
194
|
});
|
|
224
195
|
}
|
|
225
|
-
function
|
|
226
|
-
var l;
|
|
227
|
-
const a = "single-spa-application:" + e, t = (l = document.getElementById(a)) == null ? void 0 : l.classList;
|
|
228
|
-
t && t.remove("app-left", "app-right");
|
|
229
|
-
}
|
|
230
|
-
function je(e, a) {
|
|
196
|
+
function Oe(e, a) {
|
|
231
197
|
var o;
|
|
232
198
|
const t = "single-spa-application:" + e, l = (o = document.getElementById(t)) == null ? void 0 : o.classList;
|
|
233
|
-
l && (l.remove("app-left", "app-right"), setTimeout(() => {
|
|
234
|
-
|
|
199
|
+
l && (l.remove("app-left", "app-right", "app-reset"), a ? l.add("app-left") : l.add("app-right"), setTimeout(() => {
|
|
200
|
+
l.add("app-reset");
|
|
235
201
|
}, 0));
|
|
236
202
|
}
|
|
237
203
|
let ae = Date.now();
|
|
@@ -239,47 +205,47 @@ function ce() {
|
|
|
239
205
|
const e = Date.now();
|
|
240
206
|
return e - ae > 500 ? (ae = e, !0) : !1;
|
|
241
207
|
}
|
|
242
|
-
let
|
|
208
|
+
let je = 0;
|
|
243
209
|
function ue() {
|
|
244
|
-
return ++
|
|
210
|
+
return ++je;
|
|
245
211
|
}
|
|
246
|
-
async function
|
|
212
|
+
async function nt(e) {
|
|
247
213
|
if (!ce())
|
|
248
214
|
return;
|
|
249
215
|
let a = !1, t;
|
|
250
|
-
const l = (
|
|
251
|
-
t =
|
|
216
|
+
const l = (r) => {
|
|
217
|
+
t = r, a = !0;
|
|
252
218
|
}, o = ue();
|
|
253
|
-
return
|
|
219
|
+
return u.on("confirmDlgResult" + o, l), u.emit("confirmDlg", { ...e, seq: o }), await P(() => a), console.log("confirm dlg closed", o, a, t), u.off("confirmDlgResult" + o, l), t;
|
|
254
220
|
}
|
|
255
|
-
async function
|
|
221
|
+
async function rt(e) {
|
|
256
222
|
if (!ce())
|
|
257
223
|
return;
|
|
258
224
|
let a = !1, t;
|
|
259
|
-
const l = (
|
|
260
|
-
t =
|
|
225
|
+
const l = (r) => {
|
|
226
|
+
t = r, a = !0;
|
|
261
227
|
}, o = ue();
|
|
262
|
-
return
|
|
228
|
+
return u.on("promptDlgResult" + o, l), u.emit("promptDlg", { ...e, seq: o }), await P(() => a), console.log("prompt dlg closed", o, a, t), u.off("promptDlgResult" + o, l), t;
|
|
263
229
|
}
|
|
264
|
-
function
|
|
265
|
-
|
|
230
|
+
function ct() {
|
|
231
|
+
u.emit("openWaitDlg");
|
|
266
232
|
}
|
|
267
|
-
function
|
|
268
|
-
|
|
233
|
+
function ut() {
|
|
234
|
+
u.emit("closeWaitDlg");
|
|
269
235
|
}
|
|
270
|
-
function
|
|
271
|
-
|
|
236
|
+
function pt(e, a) {
|
|
237
|
+
u.emit("message", { type: "error", text: e, timeout: a });
|
|
272
238
|
}
|
|
273
|
-
function
|
|
274
|
-
|
|
239
|
+
function st(e, a) {
|
|
240
|
+
u.emit("message", { type: "info", text: e, timeout: a });
|
|
275
241
|
}
|
|
276
|
-
function
|
|
277
|
-
|
|
242
|
+
function _t(e, a) {
|
|
243
|
+
u.emit("message", { type: "success", text: e, timeout: a });
|
|
278
244
|
}
|
|
279
|
-
function
|
|
280
|
-
|
|
245
|
+
function dt(e, a) {
|
|
246
|
+
u.emit("message", { type: "warning", text: e, timeout: a });
|
|
281
247
|
}
|
|
282
|
-
var
|
|
248
|
+
var Te = /* @__PURE__ */ ((e) => (e.list_app_group = "list_app_group", e.create_app_group = "create_app_group", e.delete_app_group = "delete_app_group", e.update_app_group = "update_app_group", e.arrange_app_group = "arrange_app_group", e.list_app = "list_app", e.get_app = "get_app", e.create_app = "create_app", e.delete_app = "delete_app", e.update_app = "update_app", e.list_app_release = "list_app_release", e.get_app_release = "get_app_release", e.create_app_release = "create_app_release", e.delete_app_release = "delete_app_release", e.deploy_app_release = "deploy_app_release", e.open_app_layer = "open_app_layer", e.open_app = "open_app", e.list_calc_space = "list_calc_space", e.get_calc_space = "get_calc_space", e.create_calc_space = "create_calc_space", e.delete_calc_space = "delete_calc_space", e.update_calc_space = "update_calc_space", e.arrange_calc_space = "arrange_calc_space", e.list_func_group = "list_func_group", e.create_func_group = "create_func_group", e.delete_func_group = "delete_func_group", e.update_func_group = "update_func_group", e.arrange_func_group = "arrange_func_group", e.list_func = "list_func", e.get_func = "get_func", e.create_func = "create_func", e.delete_func = "delete_func", e.update_func = "update_func", e.debug_func = "debug_func", e.call_func = "call_func", e.list_func_release = "list_func_release", e.get_func_release = "get_func_release", e.create_func_release = "create_func_release", e.delete_func_release = "delete_func_release", e.deploy_func_release = "deploy_func_release", e.list_flow_group = "list_flow_group", e.create_flow_group = "create_flow_group", e.delete_flow_group = "delete_flow_group", e.update_flow_group = "update_flow_group", e.arrange_flow_group = "arrange_flow_group", e.list_flow = "list_flow", e.get_flow = "get_flow", e.create_flow = "create_flow", e.delete_flow = "delete_flow", e.update_flow = "update_flow", e.call_flow = "call_flow", e.list_flow_release = "list_flow_release", e.get_flow_release = "get_flow_release", e.create_flow_release = "create_flow_release", e.delete_flow_release = "delete_flow_release", e.deploy_flow_release = "deploy_flow_release", e.list_task = "list_task", e.get_task = "get_task", e.create_task = "create_task", e.delete_task = "delete_task", e.update_task = "update_task", e.call_task = "call_task", e.open_calc_layer = "open_calc_layer", e.list_db_space = "list_db_space", e.get_db_space = "get_db_space", e.create_db_space = "create_db_space", e.delete_db_space = "delete_db_space", e.update_db_space = "update_db_space", e.arrange_db_space = "arrange_db_space", e.list_model_group = "list_model_group", e.create_model_group = "create_model_group", e.delete_model_group = "delete_model_group", e.update_model_group = "update_model_group", e.arrange_model_group = "arrange_model_group", e.list_model = "list_model", e.get_model = "get_model", e.create_model = "create_model", e.delete_model = "delete_model", e.update_model = "update_model", e.get_model_data = "get_model_data", e.create_model_data = "create_model_data", e.delete_model_data = "delete_model_data", e.update_model_data = "update_model_data", e.get_graph = "get_graph", e.update_graph = "update_graph", e.list_change = "list_change", e.apply_change = "apply_change", e.open_data_layer = "open_data_layer", e.list_asset_space = "list_asset_space", e.get_asset_space = "get_asset_space", e.create_asset_space = "create_asset_space", e.delete_asset_space = "delete_asset_space", e.update_asset_space = "update_asset_space", e.arrange_asset_space = "arrange_asset_space", e.list_dir = "list_dir", e.create_dir = "create_dir", e.delete_dir = "delete_dir", e.update_dir = "update_dir", e.move_dir = "move_dir", e.list_asset = "list_asset", e.get_asset = "get_asset", e.create_asset = "create_asset", e.delete_asset = "delete_asset", e.update_asset = "update_asset", e.move_asset = "move_asset", e.open_asset_layer = "open_asset_layer", e.list_org_member = "list_org_member", e.add_org_member = "add_org_member", e.remove_org_member = "remove_org_member", e.update_org_member = "update_org_member", e.list_org_role = "list_org_role", e.get_org_role = "get_org_role", e.create_org_role = "create_org_role", e.delete_org_role = "delete_org_role", e.update_org_role = "update_org_role", e.arrange_org_role = "arrange_org_role", e.get_org_structure = "get_org_structure", e.update_org_structure = "update_org_structure", e.filter_model = "filter_model", e))(Te || {});
|
|
283
249
|
function oe(e, a) {
|
|
284
250
|
if (!e)
|
|
285
251
|
return !1;
|
|
@@ -293,7 +259,7 @@ function oe(e, a) {
|
|
|
293
259
|
return !1;
|
|
294
260
|
}), Object.keys(t).length <= 0);
|
|
295
261
|
}
|
|
296
|
-
const
|
|
262
|
+
const Be = [
|
|
297
263
|
{
|
|
298
264
|
app: "x-passport-mf",
|
|
299
265
|
path: "/passport/login",
|
|
@@ -401,164 +367,164 @@ const Ee = [
|
|
|
401
367
|
mainActive: 2
|
|
402
368
|
}
|
|
403
369
|
];
|
|
404
|
-
function
|
|
370
|
+
function K(e) {
|
|
405
371
|
let a, t = 0;
|
|
406
372
|
const l = e.split("/").filter((o) => o.trim() !== "");
|
|
407
|
-
return
|
|
408
|
-
const
|
|
409
|
-
let
|
|
410
|
-
for (let c = 0; c < l.length && !(c >=
|
|
411
|
-
|
|
412
|
-
|
|
373
|
+
return Be.forEach((o) => {
|
|
374
|
+
const r = o.path.split("/").filter((c) => c.trim() !== "");
|
|
375
|
+
let n = 0;
|
|
376
|
+
for (let c = 0; c < l.length && !(c >= r.length || l[c] !== r[c]); c++)
|
|
377
|
+
n++;
|
|
378
|
+
n > 0 && n >= t && (a = o, t = n);
|
|
413
379
|
}), a;
|
|
414
380
|
}
|
|
415
|
-
const
|
|
416
|
-
function
|
|
381
|
+
const N = i("");
|
|
382
|
+
function b(e, a) {
|
|
417
383
|
const t = Z();
|
|
418
384
|
a === "/" && (a = t.lastAppPath);
|
|
419
|
-
const l =
|
|
385
|
+
const l = K(e), o = K(a);
|
|
420
386
|
if (!l) {
|
|
421
387
|
console.assert(!1, "invalid to route meta");
|
|
422
388
|
return;
|
|
423
389
|
}
|
|
424
390
|
if (console.info(`~~~~routeChange~~~~ ${a} -> ${e}`), !o)
|
|
425
391
|
return;
|
|
426
|
-
const
|
|
427
|
-
|
|
392
|
+
const r = l.app === o.app, n = l.path === o.path, c = l.level >= o.level;
|
|
393
|
+
r ? n ? N.value = "" : N.value = c ? "inner-left" : "inner-right" : (N.value = "", Oe(l.app, c));
|
|
428
394
|
}
|
|
429
|
-
function
|
|
430
|
-
return !!
|
|
395
|
+
function Ee() {
|
|
396
|
+
return !!I.get("accessToken");
|
|
431
397
|
}
|
|
432
|
-
function
|
|
433
|
-
return !!
|
|
398
|
+
function Me() {
|
|
399
|
+
return !!I.get("activeOrg");
|
|
434
400
|
}
|
|
435
|
-
function
|
|
436
|
-
const l =
|
|
437
|
-
if (!
|
|
401
|
+
function ft(e, a, t) {
|
|
402
|
+
const l = Ee(), o = Me(), r = K(e.path);
|
|
403
|
+
if (!r) {
|
|
438
404
|
t();
|
|
439
405
|
return;
|
|
440
406
|
}
|
|
441
|
-
if (
|
|
407
|
+
if (r.requiredState === "auth")
|
|
442
408
|
if (l)
|
|
443
409
|
if (o) {
|
|
444
|
-
const
|
|
445
|
-
|
|
410
|
+
const n = "/main";
|
|
411
|
+
b(n, a.path), t({ path: n });
|
|
446
412
|
} else
|
|
447
|
-
|
|
413
|
+
b(e.path, a.path), t();
|
|
448
414
|
else {
|
|
449
|
-
const
|
|
450
|
-
|
|
415
|
+
const n = "/passport/login";
|
|
416
|
+
b(n, a.path), t({ path: n });
|
|
451
417
|
}
|
|
452
|
-
else if (
|
|
418
|
+
else if (r.requiredState === "org")
|
|
453
419
|
if (l)
|
|
454
420
|
if (o)
|
|
455
|
-
|
|
421
|
+
b(e.path, a.path), t();
|
|
456
422
|
else {
|
|
457
|
-
const
|
|
458
|
-
|
|
423
|
+
const n = "/org/joinOrCreate";
|
|
424
|
+
b(n, a.path), t({ path: n });
|
|
459
425
|
}
|
|
460
426
|
else {
|
|
461
|
-
const
|
|
462
|
-
|
|
427
|
+
const n = "/passport/login";
|
|
428
|
+
b(n, a.path), t({ path: n });
|
|
463
429
|
}
|
|
464
430
|
else if (l)
|
|
465
431
|
if (o) {
|
|
466
|
-
const
|
|
467
|
-
|
|
432
|
+
const n = "/main";
|
|
433
|
+
b(n, a.path), t({ path: n });
|
|
468
434
|
} else {
|
|
469
|
-
const
|
|
470
|
-
|
|
435
|
+
const n = "/org/joinOrCreate";
|
|
436
|
+
b(n, a.path), t({ path: n });
|
|
471
437
|
}
|
|
472
438
|
else
|
|
473
|
-
|
|
439
|
+
b(e.path, a.path), t();
|
|
474
440
|
}
|
|
475
441
|
function ee(e, a) {
|
|
476
|
-
const t =
|
|
442
|
+
const t = re(), l = g({
|
|
477
443
|
get() {
|
|
478
444
|
return t.hasView(e);
|
|
479
445
|
},
|
|
480
|
-
set(
|
|
481
|
-
|
|
446
|
+
set(r) {
|
|
447
|
+
r ? t.addView(e) : t.delView(e);
|
|
482
448
|
}
|
|
483
|
-
}), o = (
|
|
484
|
-
a == null || a(
|
|
449
|
+
}), o = (r) => {
|
|
450
|
+
a == null || a(r), l.value = !0;
|
|
485
451
|
};
|
|
486
|
-
return
|
|
487
|
-
|
|
488
|
-
}),
|
|
489
|
-
|
|
452
|
+
return q(() => {
|
|
453
|
+
u.on(e, o);
|
|
454
|
+
}), j(() => {
|
|
455
|
+
u.off(e, o);
|
|
490
456
|
}), { open: l };
|
|
491
457
|
}
|
|
492
|
-
const Ue = /* @__PURE__ */
|
|
458
|
+
const Ue = /* @__PURE__ */ T({
|
|
493
459
|
__name: "index",
|
|
494
460
|
setup(e) {
|
|
495
|
-
const a =
|
|
496
|
-
var
|
|
497
|
-
return ((
|
|
498
|
-
}),
|
|
499
|
-
var
|
|
500
|
-
return ((
|
|
501
|
-
}),
|
|
502
|
-
var
|
|
503
|
-
return ((
|
|
504
|
-
}), v =
|
|
505
|
-
var
|
|
506
|
-
return ((
|
|
461
|
+
const a = Q(), { open: t } = ee("confirmDlgInternal"), l = i(""), o = i(""), r = i(), n = i(), c = g(() => {
|
|
462
|
+
var d;
|
|
463
|
+
return ((d = r.value) == null ? void 0 : d.color) ?? "primary";
|
|
464
|
+
}), p = g(() => {
|
|
465
|
+
var d;
|
|
466
|
+
return ((d = r.value) == null ? void 0 : d.text) ?? a.t("cancel");
|
|
467
|
+
}), s = g(() => {
|
|
468
|
+
var d;
|
|
469
|
+
return ((d = n.value) == null ? void 0 : d.color) ?? "primary";
|
|
470
|
+
}), v = g(() => {
|
|
471
|
+
var d;
|
|
472
|
+
return ((d = n.value) == null ? void 0 : d.text) ?? a.t("confirm");
|
|
507
473
|
});
|
|
508
|
-
let
|
|
509
|
-
const
|
|
510
|
-
l.value =
|
|
474
|
+
let C = 0, f = !1;
|
|
475
|
+
const R = (d) => {
|
|
476
|
+
l.value = d.title, o.value = d.text, r.value = d.cancel, n.value = d.confirm, C = d.seq, f = !1, t.value = !0;
|
|
511
477
|
};
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}),
|
|
515
|
-
|
|
478
|
+
q(() => {
|
|
479
|
+
u.on("confirmDlg", R);
|
|
480
|
+
}), j(() => {
|
|
481
|
+
u.off("confirmDlg", R);
|
|
516
482
|
});
|
|
517
|
-
const
|
|
518
|
-
t.value = !1,
|
|
483
|
+
const $ = () => {
|
|
484
|
+
t.value = !1, f || (u.emit("confirmDlgResult" + C, !0), f = !0);
|
|
519
485
|
};
|
|
520
|
-
return
|
|
521
|
-
!
|
|
522
|
-
}), (
|
|
523
|
-
const
|
|
524
|
-
return
|
|
486
|
+
return G(t, (d) => {
|
|
487
|
+
!d && !f && (u.emit("confirmDlgResult" + C, !1), f = !0);
|
|
488
|
+
}), (d, k) => {
|
|
489
|
+
const V = h("v-card-text"), B = h("v-btn"), L = h("v-card-actions"), _ = h("v-card"), x = h("v-dialog");
|
|
490
|
+
return D(), O(x, {
|
|
525
491
|
modelValue: z(t),
|
|
526
|
-
"onUpdate:modelValue":
|
|
492
|
+
"onUpdate:modelValue": k[1] || (k[1] = (E) => J(t) ? t.value = E : null),
|
|
527
493
|
onKeydown: [
|
|
528
|
-
|
|
529
|
-
F(
|
|
494
|
+
k[2] || (k[2] = F(U((E) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
495
|
+
F(U($, ["stop", "prevent"]), ["enter"])
|
|
530
496
|
],
|
|
531
497
|
transition: "dialog-top-transition",
|
|
532
498
|
"max-width": "600px"
|
|
533
499
|
}, {
|
|
534
500
|
default: w(() => [
|
|
535
|
-
|
|
501
|
+
y(_, { title: l.value }, {
|
|
536
502
|
default: w(() => [
|
|
537
|
-
|
|
503
|
+
y(V, null, {
|
|
538
504
|
default: w(() => [
|
|
539
|
-
|
|
505
|
+
A(S(o.value), 1)
|
|
540
506
|
]),
|
|
541
507
|
_: 1
|
|
542
508
|
}),
|
|
543
|
-
|
|
509
|
+
y(L, { class: "d-flex justify-end" }, {
|
|
544
510
|
default: w(() => [
|
|
545
|
-
|
|
546
|
-
onClick:
|
|
511
|
+
y(B, {
|
|
512
|
+
onClick: k[0] || (k[0] = (E) => t.value = !1),
|
|
547
513
|
color: c.value,
|
|
548
514
|
variant: "text"
|
|
549
515
|
}, {
|
|
550
516
|
default: w(() => [
|
|
551
|
-
|
|
517
|
+
A(S(p.value), 1)
|
|
552
518
|
]),
|
|
553
519
|
_: 1
|
|
554
520
|
}, 8, ["color"]),
|
|
555
|
-
|
|
556
|
-
onClick:
|
|
557
|
-
color:
|
|
521
|
+
y(B, {
|
|
522
|
+
onClick: $,
|
|
523
|
+
color: s.value,
|
|
558
524
|
variant: "text"
|
|
559
525
|
}, {
|
|
560
526
|
default: w(() => [
|
|
561
|
-
|
|
527
|
+
A(S(v.value), 1)
|
|
562
528
|
]),
|
|
563
529
|
_: 1
|
|
564
530
|
}, 8, ["color"])
|
|
@@ -573,7 +539,7 @@ const Ue = /* @__PURE__ */ M({
|
|
|
573
539
|
}, 8, ["modelValue", "onKeydown"]);
|
|
574
540
|
};
|
|
575
541
|
}
|
|
576
|
-
}),
|
|
542
|
+
}), $e = (e) => (ve("data-v-f4ad116e"), e = e(), me(), e), Le = /* @__PURE__ */ $e(() => /* @__PURE__ */ m("div", { class: "lds-spinner" }, [
|
|
577
543
|
/* @__PURE__ */ m("div"),
|
|
578
544
|
/* @__PURE__ */ m("div"),
|
|
579
545
|
/* @__PURE__ */ m("div"),
|
|
@@ -588,7 +554,7 @@ const Ue = /* @__PURE__ */ M({
|
|
|
588
554
|
/* @__PURE__ */ m("div")
|
|
589
555
|
], -1)), We = [
|
|
590
556
|
Le
|
|
591
|
-
], ze = /* @__PURE__ */
|
|
557
|
+
], ze = /* @__PURE__ */ T({
|
|
592
558
|
__name: "index",
|
|
593
559
|
props: {
|
|
594
560
|
zIndex: {
|
|
@@ -597,21 +563,21 @@ const Ue = /* @__PURE__ */ M({
|
|
|
597
563
|
}
|
|
598
564
|
},
|
|
599
565
|
setup(e) {
|
|
600
|
-
const a =
|
|
566
|
+
const a = Y(), t = e, l = g(() => ({
|
|
601
567
|
background: a.current.value.dark ? "#1e1e1e" : "#ffffff",
|
|
602
568
|
zIndex: t.zIndex
|
|
603
569
|
}));
|
|
604
|
-
return (o,
|
|
570
|
+
return (o, r) => (D(), H("div", {
|
|
605
571
|
class: "x-cont",
|
|
606
572
|
style: ge(l.value)
|
|
607
573
|
}, We, 4));
|
|
608
574
|
}
|
|
609
|
-
}),
|
|
575
|
+
}), pe = (e, a) => {
|
|
610
576
|
const t = e.__vccOpts || e;
|
|
611
577
|
for (const [l, o] of a)
|
|
612
578
|
t[l] = o;
|
|
613
579
|
return t;
|
|
614
|
-
}, Fe = /* @__PURE__ */
|
|
580
|
+
}, Fe = /* @__PURE__ */ pe(ze, [["__scopeId", "data-v-f4ad116e"]]), Ke = /* @__PURE__ */ T({
|
|
615
581
|
__name: "item",
|
|
616
582
|
props: {
|
|
617
583
|
id: {},
|
|
@@ -622,150 +588,150 @@ const Ue = /* @__PURE__ */ M({
|
|
|
622
588
|
emits: ["timeout"],
|
|
623
589
|
setup(e, { emit: a }) {
|
|
624
590
|
const t = e, l = i(!0), o = a;
|
|
625
|
-
return
|
|
591
|
+
return q(() => {
|
|
626
592
|
setTimeout(() => {
|
|
627
593
|
o("timeout", t.id);
|
|
628
594
|
}, t.timeout);
|
|
629
|
-
}),
|
|
630
|
-
|
|
631
|
-
}), (
|
|
595
|
+
}), G(l, (r) => {
|
|
596
|
+
r || o("timeout", t.id);
|
|
597
|
+
}), (r, n) => {
|
|
632
598
|
const c = h("v-alert");
|
|
633
|
-
return
|
|
599
|
+
return D(), O(c, {
|
|
634
600
|
modelValue: l.value,
|
|
635
|
-
"onUpdate:modelValue":
|
|
601
|
+
"onUpdate:modelValue": n[0] || (n[0] = (p) => l.value = p),
|
|
636
602
|
class: "mt-2",
|
|
637
603
|
"max-width": "90%",
|
|
638
604
|
width: "500px",
|
|
639
605
|
elevation: "1",
|
|
640
606
|
density: "compact",
|
|
641
607
|
closable: "",
|
|
642
|
-
type:
|
|
643
|
-
text:
|
|
608
|
+
type: r.type,
|
|
609
|
+
text: r.text
|
|
644
610
|
}, null, 8, ["modelValue", "type", "text"]);
|
|
645
611
|
};
|
|
646
612
|
}
|
|
647
|
-
}),
|
|
613
|
+
}), Ne = /* @__PURE__ */ T({
|
|
648
614
|
__name: "index",
|
|
649
615
|
setup(e) {
|
|
650
616
|
const a = he({ items: [] });
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
}),
|
|
654
|
-
|
|
617
|
+
q(() => {
|
|
618
|
+
u.on("message", t);
|
|
619
|
+
}), j(() => {
|
|
620
|
+
u.off("message", t);
|
|
655
621
|
});
|
|
656
622
|
const t = (c) => {
|
|
657
|
-
|
|
623
|
+
r(c.type, c.text, c.timeout);
|
|
658
624
|
}, l = (c) => {
|
|
659
|
-
|
|
625
|
+
n(c);
|
|
660
626
|
};
|
|
661
627
|
let o = 0;
|
|
662
|
-
const
|
|
628
|
+
const r = (c, p, s) => {
|
|
663
629
|
const v = o++;
|
|
664
|
-
a.items.push({ id: v, type: c, text:
|
|
665
|
-
},
|
|
666
|
-
const
|
|
667
|
-
|
|
630
|
+
a.items.push({ id: v, type: c, text: p, timeout: s });
|
|
631
|
+
}, n = (c) => {
|
|
632
|
+
const p = a.items.findIndex((s) => s.id === c);
|
|
633
|
+
p >= 0 && a.items.splice(p, 1);
|
|
668
634
|
};
|
|
669
|
-
return (c,
|
|
670
|
-
onClick:
|
|
635
|
+
return (c, p) => (D(), H("div", {
|
|
636
|
+
onClick: p[0] || (p[0] = U(() => {
|
|
671
637
|
}, ["stop"])),
|
|
672
638
|
class: "x-cont d-flex flex-column-reverse align-center"
|
|
673
639
|
}, [
|
|
674
|
-
(
|
|
640
|
+
(D(!0), H(we, null, xe(a.items, (s) => (D(), O(Ke, {
|
|
675
641
|
onTimeout: l,
|
|
676
|
-
id:
|
|
677
|
-
type:
|
|
678
|
-
text:
|
|
679
|
-
timeout:
|
|
680
|
-
key:
|
|
642
|
+
id: s.id,
|
|
643
|
+
type: s.type,
|
|
644
|
+
text: s.text,
|
|
645
|
+
timeout: s.timeout,
|
|
646
|
+
key: s.id
|
|
681
647
|
}, null, 8, ["id", "type", "text", "timeout"]))), 128))
|
|
682
648
|
]));
|
|
683
649
|
}
|
|
684
|
-
}),
|
|
650
|
+
}), He = /* @__PURE__ */ pe(Ne, [["__scopeId", "data-v-8c2268ea"]]), Xe = /* @__PURE__ */ T({
|
|
685
651
|
__name: "index",
|
|
686
652
|
setup(e) {
|
|
687
|
-
const a =
|
|
688
|
-
var
|
|
689
|
-
return ((
|
|
690
|
-
}),
|
|
691
|
-
var
|
|
692
|
-
return ((
|
|
693
|
-
}),
|
|
694
|
-
var
|
|
695
|
-
return ((
|
|
696
|
-
}),
|
|
697
|
-
var
|
|
698
|
-
return ((
|
|
699
|
-
}),
|
|
700
|
-
let
|
|
701
|
-
const
|
|
653
|
+
const a = Q(), { open: t } = ee("promptDlgInternal"), l = i(""), o = i(""), r = i(), n = i(), c = i(), p = i(""), s = i(), v = i(), C = g(() => {
|
|
654
|
+
var _;
|
|
655
|
+
return ((_ = s.value) == null ? void 0 : _.color) ?? "primary";
|
|
656
|
+
}), f = g(() => {
|
|
657
|
+
var _;
|
|
658
|
+
return ((_ = s.value) == null ? void 0 : _.text) ?? a.t("cancel");
|
|
659
|
+
}), R = g(() => {
|
|
660
|
+
var _;
|
|
661
|
+
return ((_ = v.value) == null ? void 0 : _.color) ?? "primary";
|
|
662
|
+
}), $ = g(() => {
|
|
663
|
+
var _;
|
|
664
|
+
return ((_ = v.value) == null ? void 0 : _.text) ?? a.t("confirm");
|
|
665
|
+
}), d = i();
|
|
666
|
+
let k = 0, V = !1;
|
|
667
|
+
const B = async (_) => {
|
|
702
668
|
var x;
|
|
703
|
-
l.value =
|
|
669
|
+
l.value = _.title, o.value = _.text, r.value = _.label, n.value = _.placeholder, c.value = _.rules, p.value = _.value, s.value = _.cancel, v.value = _.confirm, k = _.seq, V = !1, t.value = !0, await P(() => d.value !== void 0, 1e3), (x = d.value) == null || x.focus();
|
|
704
670
|
};
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
}),
|
|
708
|
-
|
|
671
|
+
q(() => {
|
|
672
|
+
u.on("promptDlg", B);
|
|
673
|
+
}), j(() => {
|
|
674
|
+
u.off("promptDlg", B);
|
|
709
675
|
});
|
|
710
|
-
const
|
|
711
|
-
t.value = !1,
|
|
676
|
+
const L = () => {
|
|
677
|
+
t.value = !1, V || (u.emit("promptDlgResult" + k, p.value ?? ""), V = !0);
|
|
712
678
|
};
|
|
713
|
-
return
|
|
714
|
-
!
|
|
715
|
-
}), (
|
|
716
|
-
const
|
|
717
|
-
return
|
|
679
|
+
return G(t, (_) => {
|
|
680
|
+
!_ && !V && (u.emit("promptDlgResult" + k, void 0), V = !0);
|
|
681
|
+
}), (_, x) => {
|
|
682
|
+
const E = h("v-card-text"), se = h("v-text-field"), _e = h("v-form"), te = h("v-btn"), de = h("v-card-actions"), fe = h("v-card"), ie = h("v-dialog");
|
|
683
|
+
return D(), O(ie, {
|
|
718
684
|
modelValue: z(t),
|
|
719
|
-
"onUpdate:modelValue": x[2] || (x[2] = (
|
|
685
|
+
"onUpdate:modelValue": x[2] || (x[2] = (M) => J(t) ? t.value = M : null),
|
|
720
686
|
onKeydown: [
|
|
721
|
-
x[3] || (x[3] = F(
|
|
722
|
-
F(
|
|
687
|
+
x[3] || (x[3] = F(U((M) => t.value = !1, ["stop", "prevent"]), ["esc"])),
|
|
688
|
+
F(U(L, ["stop", "prevent"]), ["enter"])
|
|
723
689
|
],
|
|
724
690
|
transition: "dialog-top-transition",
|
|
725
691
|
"max-width": "600px"
|
|
726
692
|
}, {
|
|
727
693
|
default: w(() => [
|
|
728
|
-
|
|
694
|
+
y(fe, { title: l.value }, {
|
|
729
695
|
default: w(() => [
|
|
730
|
-
o.value ? (
|
|
696
|
+
o.value ? (D(), O(E, { key: 0 }, {
|
|
731
697
|
default: w(() => [
|
|
732
|
-
|
|
698
|
+
A(S(o.value), 1)
|
|
733
699
|
]),
|
|
734
700
|
_: 1
|
|
735
701
|
})) : ye("", !0),
|
|
736
|
-
|
|
702
|
+
y(_e, { class: "mx-3" }, {
|
|
737
703
|
default: w(() => [
|
|
738
|
-
|
|
739
|
-
modelValue:
|
|
740
|
-
"onUpdate:modelValue": x[0] || (x[0] = (
|
|
741
|
-
label:
|
|
742
|
-
placeholder:
|
|
704
|
+
y(se, {
|
|
705
|
+
modelValue: p.value,
|
|
706
|
+
"onUpdate:modelValue": x[0] || (x[0] = (M) => p.value = M),
|
|
707
|
+
label: r.value,
|
|
708
|
+
placeholder: n.value,
|
|
743
709
|
rules: c.value,
|
|
744
710
|
ref_key: "target",
|
|
745
|
-
ref:
|
|
711
|
+
ref: d
|
|
746
712
|
}, null, 8, ["modelValue", "label", "placeholder", "rules"])
|
|
747
713
|
]),
|
|
748
714
|
_: 1
|
|
749
715
|
}),
|
|
750
|
-
|
|
716
|
+
y(de, { class: "d-flex justify-end" }, {
|
|
751
717
|
default: w(() => [
|
|
752
|
-
|
|
753
|
-
onClick: x[1] || (x[1] = (
|
|
754
|
-
color:
|
|
718
|
+
y(te, {
|
|
719
|
+
onClick: x[1] || (x[1] = (M) => t.value = !1),
|
|
720
|
+
color: C.value,
|
|
755
721
|
variant: "text"
|
|
756
722
|
}, {
|
|
757
723
|
default: w(() => [
|
|
758
|
-
|
|
724
|
+
A(S(f.value), 1)
|
|
759
725
|
]),
|
|
760
726
|
_: 1
|
|
761
727
|
}, 8, ["color"]),
|
|
762
|
-
|
|
763
|
-
onClick:
|
|
764
|
-
color:
|
|
728
|
+
y(te, {
|
|
729
|
+
onClick: L,
|
|
730
|
+
color: R.value,
|
|
765
731
|
variant: "text"
|
|
766
732
|
}, {
|
|
767
733
|
default: w(() => [
|
|
768
|
-
|
|
734
|
+
A(S($.value), 1)
|
|
769
735
|
]),
|
|
770
736
|
_: 1
|
|
771
737
|
}, 8, ["color"])
|
|
@@ -780,37 +746,37 @@ const Ue = /* @__PURE__ */ M({
|
|
|
780
746
|
}, 8, ["modelValue", "onKeydown"]);
|
|
781
747
|
};
|
|
782
748
|
}
|
|
783
|
-
}), Ge = { class: "mx-auto my-auto" },
|
|
749
|
+
}), Ge = { class: "mx-auto my-auto" }, Je = { class: "d-flex align-center justify-center w-100 h-100" }, Qe = /* @__PURE__ */ T({
|
|
784
750
|
__name: "index",
|
|
785
751
|
setup(e) {
|
|
786
|
-
const a =
|
|
752
|
+
const a = Q(), { open: t } = ee("waitDlg"), l = () => {
|
|
787
753
|
t.value = !0;
|
|
788
754
|
}, o = () => {
|
|
789
755
|
t.value = !1;
|
|
790
756
|
};
|
|
791
|
-
return
|
|
792
|
-
|
|
793
|
-
}),
|
|
794
|
-
|
|
795
|
-
}), (
|
|
796
|
-
const c = h("v-card"),
|
|
797
|
-
return
|
|
757
|
+
return q(() => {
|
|
758
|
+
u.on("openWaitDlg", l), u.on("closeWaitDlg", o);
|
|
759
|
+
}), j(() => {
|
|
760
|
+
u.off("openWaitDlg", l), u.off("closeWaitDlg", o);
|
|
761
|
+
}), (r, n) => {
|
|
762
|
+
const c = h("v-card"), p = h("v-dialog");
|
|
763
|
+
return D(), O(p, {
|
|
798
764
|
modelValue: z(t),
|
|
799
|
-
"onUpdate:modelValue":
|
|
765
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => J(t) ? t.value = s : null),
|
|
800
766
|
persistent: "",
|
|
801
767
|
"no-click-animation": "",
|
|
802
768
|
fullscreen: ""
|
|
803
769
|
}, {
|
|
804
770
|
default: w(() => [
|
|
805
771
|
m("div", Ge, [
|
|
806
|
-
|
|
772
|
+
y(c, {
|
|
807
773
|
width: "300px",
|
|
808
774
|
height: "80px",
|
|
809
775
|
loading: ""
|
|
810
776
|
}, {
|
|
811
777
|
default: w(() => [
|
|
812
|
-
m("div",
|
|
813
|
-
m("span", null,
|
|
778
|
+
m("div", Je, [
|
|
779
|
+
m("span", null, S(z(a).t("waitingResponse")), 1)
|
|
814
780
|
])
|
|
815
781
|
]),
|
|
816
782
|
_: 1
|
|
@@ -821,106 +787,60 @@ const Ue = /* @__PURE__ */ M({
|
|
|
821
787
|
}, 8, ["modelValue"]);
|
|
822
788
|
};
|
|
823
789
|
}
|
|
824
|
-
}),
|
|
825
|
-
e.component("x-confirm-dlg", Ue), e.component("x-loading", Fe), e.component("x-message",
|
|
790
|
+
}), Ye = (e) => {
|
|
791
|
+
e.component("x-confirm-dlg", Ue), e.component("x-loading", Fe), e.component("x-message", He), e.component("x-prompt-dlg", Xe), e.component("x-wait-dlg", Qe);
|
|
826
792
|
};
|
|
827
|
-
function
|
|
828
|
-
const e =
|
|
793
|
+
function it() {
|
|
794
|
+
const e = Y(), a = g(() => e.global.current.value.colors.primary), t = g(() => e.global.current.value.colors.secondary), l = g(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"), o = g(() => e.current.value.dark ? "#272727" : "#eeeeee"), r = g(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"), n = g(() => e.current.value.dark ? "#303030" : "#f6f6f6"), c = g(() => e.current.value.dark ? "#ffffff1f" : "#0000001f");
|
|
829
795
|
return {
|
|
830
796
|
primaryColor: a,
|
|
831
797
|
secondaryColor: t,
|
|
832
798
|
backgroundColor0: l,
|
|
833
799
|
backgroundColor1: o,
|
|
834
|
-
backgroundColor2:
|
|
835
|
-
highlightColor:
|
|
800
|
+
backgroundColor2: r,
|
|
801
|
+
highlightColor: n,
|
|
836
802
|
borderColor: c
|
|
837
803
|
};
|
|
838
804
|
}
|
|
839
|
-
function
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
r = !0;
|
|
849
|
-
}, _ = () => {
|
|
850
|
-
var g;
|
|
851
|
-
if (!n.isEmpty()) {
|
|
852
|
-
n.hasView("waitDlg") || n.popView();
|
|
805
|
+
function gt() {
|
|
806
|
+
const e = be(), a = ne(), t = Z(), l = re(), o = () => {
|
|
807
|
+
console.log("onPause");
|
|
808
|
+
}, r = () => {
|
|
809
|
+
console.log("onResume");
|
|
810
|
+
}, n = () => {
|
|
811
|
+
var R;
|
|
812
|
+
if (!l.isEmpty()) {
|
|
813
|
+
l.hasView("waitDlg") || l.popView();
|
|
853
814
|
return;
|
|
854
815
|
}
|
|
855
|
-
const
|
|
856
|
-
(
|
|
816
|
+
const f = K(e.path);
|
|
817
|
+
(f == null ? void 0 : f.level) === 0 ? (R = navigator == null ? void 0 : navigator.Backbutton) == null || R.goHome(
|
|
857
818
|
() => {
|
|
858
819
|
},
|
|
859
820
|
() => {
|
|
860
821
|
}
|
|
861
|
-
) :
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
822
|
+
) : a.back();
|
|
823
|
+
}, c = (f) => {
|
|
824
|
+
t.dark = f;
|
|
825
|
+
}, p = (f) => {
|
|
826
|
+
t.locale = f;
|
|
827
|
+
}, s = (f) => {
|
|
828
|
+
t.permissionObjects = f[0], t.permissionChecksum = f[1];
|
|
829
|
+
}, v = (f) => {
|
|
830
|
+
t.lastAppPath = f;
|
|
831
|
+
}, C = (f) => {
|
|
832
|
+
if (f.key === "Escape") {
|
|
833
|
+
n();
|
|
871
834
|
return;
|
|
872
835
|
}
|
|
873
|
-
if (!e && u.ctrlKey && u.altKey && u.code === "KeyD") {
|
|
874
|
-
o.dark = !o.dark, o.$persist();
|
|
875
|
-
return;
|
|
876
|
-
}
|
|
877
|
-
if (!e && u.ctrlKey && u.altKey && u.code === "KeyL") {
|
|
878
|
-
o.locale === "en" ? o.locale = "zhHans" : o.locale = "en", o.$persist();
|
|
879
|
-
return;
|
|
880
|
-
}
|
|
881
|
-
};
|
|
882
|
-
R(() => {
|
|
883
|
-
window.addEventListener("keydown", v);
|
|
884
|
-
}), O(() => {
|
|
885
|
-
window.removeEventListener("keydown", v);
|
|
886
|
-
});
|
|
887
|
-
let y;
|
|
888
|
-
const C = async () => {
|
|
889
|
-
if (!r)
|
|
890
|
-
return;
|
|
891
|
-
const u = L(t.path);
|
|
892
|
-
if (!(!u || u.requiredState !== "org"))
|
|
893
|
-
try {
|
|
894
|
-
const { update: g, permissions: b } = await Pe(a, {
|
|
895
|
-
checksum: o.permissionChecksum
|
|
896
|
-
});
|
|
897
|
-
if (!g)
|
|
898
|
-
return;
|
|
899
|
-
const V = {};
|
|
900
|
-
for (const q in b) {
|
|
901
|
-
if (q === "checksum")
|
|
902
|
-
continue;
|
|
903
|
-
const d = b[q];
|
|
904
|
-
V[q] = JSON.parse(d);
|
|
905
|
-
}
|
|
906
|
-
o.permissionObjects = V, o.permissionChecksum = b.checksum ?? "", o.$persist();
|
|
907
|
-
} catch (g) {
|
|
908
|
-
console.error(g);
|
|
909
|
-
}
|
|
910
|
-
}, T = async (u) => {
|
|
911
|
-
u && await C(), clearTimeout(y), y = setTimeout(async () => {
|
|
912
|
-
await C(), y && T();
|
|
913
|
-
}, 3e3);
|
|
914
|
-
}, j = () => {
|
|
915
|
-
clearTimeout(y), y = void 0;
|
|
916
836
|
};
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
}),
|
|
920
|
-
|
|
837
|
+
q(() => {
|
|
838
|
+
u.on("pause", o), u.on("resume", r), u.on("backbutton", n), u.on("darkChange", c), u.on("localeChange", p), u.on("permissionChange", s), u.on("lastAppPathChange", v), window.addEventListener("keydown", C), u.emit("microAppReady");
|
|
839
|
+
}), j(() => {
|
|
840
|
+
u.off("pause", o), u.off("resume", r), u.off("backbutton", n), u.off("darkChange", c), u.off("localeChange", p), u.off("permissionChange", s), u.off("lastAppPathChange", v), window.removeEventListener("keydown", C);
|
|
921
841
|
});
|
|
922
842
|
}
|
|
923
|
-
function
|
|
843
|
+
function vt() {
|
|
924
844
|
const e = Z();
|
|
925
845
|
function a(t, l) {
|
|
926
846
|
const o = e.permissionObjects[t];
|
|
@@ -928,37 +848,36 @@ function ht() {
|
|
|
928
848
|
}
|
|
929
849
|
return { verifyPermission: a };
|
|
930
850
|
}
|
|
931
|
-
function
|
|
932
|
-
const e =
|
|
851
|
+
function mt() {
|
|
852
|
+
const e = Y(), a = ke(), t = g(() => e.current.value.dark), l = g(() => !!window.cordova), o = g(() => a.width.value <= 1280 ? a.width.value + "px" : a.width.value <= 1920 ? 1920 / 2.5 + "px" : 2560 / 2.5 + "px");
|
|
933
853
|
return { dark: t, sysBarAvail: l, compactWidth: o };
|
|
934
854
|
}
|
|
935
|
-
const
|
|
855
|
+
const ht = { install: Ye };
|
|
936
856
|
export {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
p as eventBus,
|
|
857
|
+
Te as Permission,
|
|
858
|
+
Oe as appAppear,
|
|
859
|
+
ut as closeWaitDlg,
|
|
860
|
+
ot as createAxios,
|
|
861
|
+
ht as default,
|
|
862
|
+
u as eventBus,
|
|
944
863
|
oe as isExist,
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
864
|
+
K as matchRouteMeta,
|
|
865
|
+
pt as messageError,
|
|
866
|
+
st as messageInfo,
|
|
867
|
+
_t as messageSuccess,
|
|
868
|
+
dt as messageWarning,
|
|
869
|
+
ft as onBeforeEach,
|
|
870
|
+
nt as openConfirmDlg,
|
|
871
|
+
rt as openPromptDlg,
|
|
872
|
+
ct as openWaitDlg,
|
|
873
|
+
N as routeTransName,
|
|
874
|
+
it as useColor,
|
|
956
875
|
Z as useGlobalStore,
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
876
|
+
gt as useMicroApp,
|
|
877
|
+
vt as usePermission,
|
|
878
|
+
mt as useSystem,
|
|
879
|
+
re as useViewMgrStore,
|
|
961
880
|
ee as useViewStack,
|
|
962
|
-
|
|
881
|
+
lt as waitMs,
|
|
963
882
|
P as waitUtil
|
|
964
883
|
};
|
package/dist/store/global.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import 'pinia-plugin-persistedstate';
|
|
2
1
|
import { PermissionObjects } from '../utils';
|
|
3
2
|
export declare const useGlobalStore: import("pinia").StoreDefinition<"global", import("pinia")._UnwrapAll<Pick<{
|
|
4
|
-
dark: import("vue").Ref<boolean
|
|
3
|
+
dark: import("vue").Ref<boolean>;
|
|
5
4
|
locale: import("vue").Ref<string>;
|
|
6
5
|
permissionObjects: import("vue").Ref<PermissionObjects>;
|
|
7
6
|
permissionChecksum: import("vue").Ref<string>;
|
|
8
7
|
lastAppPath: import("vue").Ref<string>;
|
|
9
8
|
}, "dark" | "locale" | "permissionObjects" | "permissionChecksum" | "lastAppPath">>, Pick<{
|
|
10
|
-
dark: import("vue").Ref<boolean
|
|
9
|
+
dark: import("vue").Ref<boolean>;
|
|
11
10
|
locale: import("vue").Ref<string>;
|
|
12
11
|
permissionObjects: import("vue").Ref<PermissionObjects>;
|
|
13
12
|
permissionChecksum: import("vue").Ref<string>;
|
|
14
13
|
lastAppPath: import("vue").Ref<string>;
|
|
15
14
|
}, never>, Pick<{
|
|
16
|
-
dark: import("vue").Ref<boolean
|
|
15
|
+
dark: import("vue").Ref<boolean>;
|
|
17
16
|
locale: import("vue").Ref<string>;
|
|
18
17
|
permissionObjects: import("vue").Ref<PermissionObjects>;
|
|
19
18
|
permissionChecksum: import("vue").Ref<string>;
|
package/dist/utils/misc.d.ts
CHANGED
|
@@ -2,5 +2,4 @@ import { Emitter, EventType } from 'mitt';
|
|
|
2
2
|
export declare const eventBus: Emitter<Record<EventType, unknown>>;
|
|
3
3
|
export declare function waitMs(ms: number): Promise<void>;
|
|
4
4
|
export declare function waitUtil(conditionFunc: () => boolean, timeout?: number, interval?: number): Promise<boolean>;
|
|
5
|
-
export declare function clearAppAppear(name: string): void;
|
|
6
5
|
export declare function appAppear(name: string, forward: boolean): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-essential-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.67",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"axios": "^1.6.8",
|
|
30
30
|
"pinia": "^2.1.7",
|
|
31
|
+
"pinia-plugin-persistedstate": "^3.2.1",
|
|
31
32
|
"vue": "^3.4.30",
|
|
32
33
|
"vue-i18n": "^9.13.1",
|
|
33
34
|
"vue-router": "^4.4.0",
|
|
@@ -44,7 +45,6 @@
|
|
|
44
45
|
"eslint-plugin-vue": "^9.24.1",
|
|
45
46
|
"husky": "^9.0.11",
|
|
46
47
|
"lint-staged": "^15.2.2",
|
|
47
|
-
"pinia-plugin-persistedstate": "^3.2.1",
|
|
48
48
|
"prettier": "3.2.5",
|
|
49
49
|
"sass": "^1.74.1",
|
|
50
50
|
"typescript": "^5.2.2",
|