x-essential-lib 0.9.35 → 0.9.36
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/i18n-en.f0pmulir.js +1 -0
- package/dist/i18n-zhHans.ex0oq1u6.js +1 -0
- package/dist/index.d.ts +434 -357
- package/dist/index.js +2 -966
- package/dist/rolldown-runtime.mam1o4z7.js +1 -0
- package/dist/style.css +1 -0
- package/package.json +38 -43
- package/dist/i18n-en.lqadbyvh.js +0 -102
- package/dist/i18n-zhHans.jagnyxbk.js +0 -102
- package/dist/rolldown-runtime.msh1uh5g.js +0 -11
- package/dist/vendor.muy2hy8m.js +0 -224
package/dist/index.js
CHANGED
|
@@ -1,966 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { i as e, n as t, r as n, t as r } from "./vendor.muy2hy8m.js";
|
|
3
|
-
import { Fragment as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, inject as m, isRef as h, normalizeStyle as g, onBeforeMount as _, onBeforeUnmount as v, onMounted as y, openBlock as b, provide as x, ref as S, renderList as C, resolveComponent as w, toDisplayString as T, unref as E, useTemplateRef as D, watch as O, watchEffect as k, withCtx as A, withKeys as j, withModifiers as M } from "vue";
|
|
4
|
-
import { useI18n as N } from "vue-i18n";
|
|
5
|
-
import { useDisplay as ee, useTheme as P } from "vuetify";
|
|
6
|
-
import { useRoute as te, useRouter as ne } from "vue-router";
|
|
7
|
-
import re from "axios";
|
|
8
|
-
//#region src/composables/color.ts
|
|
9
|
-
function ie() {
|
|
10
|
-
let e = P();
|
|
11
|
-
return {
|
|
12
|
-
primaryColor: o(() => e.global.current.value.colors.primary),
|
|
13
|
-
secondaryColor: o(() => e.global.current.value.colors.secondary),
|
|
14
|
-
backgroundColor0: o(() => e.current.value.dark ? "#2e2e2e" : "#bdbdbd"),
|
|
15
|
-
backgroundColor1: o(() => e.current.value.dark ? "#272727" : "#eeeeee"),
|
|
16
|
-
backgroundColor2: o(() => e.current.value.dark ? "#1e1e1e" : "#ffffff"),
|
|
17
|
-
highlightColor: o(() => e.current.value.dark ? "#303030" : "#f6f6f6"),
|
|
18
|
-
borderColor: o(() => e.current.value.dark ? "#ffffff1f" : "#0000001f")
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region src/utils/axios.ts
|
|
23
|
-
function ae(e) {
|
|
24
|
-
let t = re.create({ timeout: 6e3 });
|
|
25
|
-
return t.defaults.baseURL = e.baseUrl, t.interceptors.request.use((e) => oe(e), (t) => {
|
|
26
|
-
se(t, e.onError);
|
|
27
|
-
}), t.interceptors.response.use((e) => ce(e), (t) => le(t, e.onError)), t;
|
|
28
|
-
}
|
|
29
|
-
function oe(e) {
|
|
30
|
-
let t = n.get("accessToken") ?? "";
|
|
31
|
-
return e.headers.Authorization = "Basic " + t, e.headers["Content-Type"] = "application/json", e.data = JSON.stringify(e.data), e;
|
|
32
|
-
}
|
|
33
|
-
function se(e, t) {
|
|
34
|
-
console.error(e), t("request timeout");
|
|
35
|
-
}
|
|
36
|
-
function ce(e) {
|
|
37
|
-
return e.data;
|
|
38
|
-
}
|
|
39
|
-
function le(e, t) {
|
|
40
|
-
let n = e.response;
|
|
41
|
-
return n ? (n.status === 401 && ue(), n.data?.message ? t(n.data?.message) : t({
|
|
42
|
-
code: n.status,
|
|
43
|
-
message: n.statusText
|
|
44
|
-
}), Promise.reject(e)) : Promise.reject(e);
|
|
45
|
-
}
|
|
46
|
-
function ue() {
|
|
47
|
-
n.remove("accessToken"), n.remove("refreshToken"), n.remove("userId"), n.remove("userName"), n.remove("phone"), n.remove("activeOrg"), ne().replace({ path: "/passport/login" });
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/utils/misc.ts
|
|
51
|
-
var de = (function() {
|
|
52
|
-
return window.globalObjects || (window.globalObjects = {
|
|
53
|
-
router: null,
|
|
54
|
-
i18n: null
|
|
55
|
-
}, console.log("globalObjects created")), window.globalObjects;
|
|
56
|
-
})(), F = (function() {
|
|
57
|
-
return window.eventBus || (window.eventBus = t(), console.log("eventBus created")), window.eventBus;
|
|
58
|
-
})();
|
|
59
|
-
async function fe(e) {
|
|
60
|
-
return new Promise((t) => {
|
|
61
|
-
setTimeout(t, e);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
async function I(e, t, n) {
|
|
65
|
-
let r = Date.now();
|
|
66
|
-
return new Promise((i) => {
|
|
67
|
-
let a = async () => {
|
|
68
|
-
e() ? i(!0) : t && Date.now() - r > t ? i(!1) : setTimeout(a, n ?? 30);
|
|
69
|
-
};
|
|
70
|
-
a();
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
function pe(e, t) {
|
|
74
|
-
let n = document.getElementById("single-spa-application:" + e);
|
|
75
|
-
n && (n.classList.remove("app-left", "app-right", "app-reset"), t ? n.classList.add("app-left") : n.classList.add("app-right"), setTimeout(() => {
|
|
76
|
-
n.classList.add("app-reset");
|
|
77
|
-
}, 50));
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/utils/dialog.ts
|
|
81
|
-
var L = Date.now();
|
|
82
|
-
function R() {
|
|
83
|
-
let e = Date.now();
|
|
84
|
-
return e - L > 500 ? (L = e, !0) : !1;
|
|
85
|
-
}
|
|
86
|
-
var me = 0;
|
|
87
|
-
function z() {
|
|
88
|
-
return ++me;
|
|
89
|
-
}
|
|
90
|
-
async function he(e) {
|
|
91
|
-
if (!R()) return;
|
|
92
|
-
let t = !1, n, r = (e) => {
|
|
93
|
-
n = e, t = !0;
|
|
94
|
-
}, i = z();
|
|
95
|
-
return F.on("confirmDlgResult" + i, r), F.emit("confirmDlg", {
|
|
96
|
-
...e,
|
|
97
|
-
seq: i
|
|
98
|
-
}), await I(() => t), F.off("confirmDlgResult" + i, r), n;
|
|
99
|
-
}
|
|
100
|
-
async function ge(e) {
|
|
101
|
-
if (!R()) return;
|
|
102
|
-
let t = !1, n, r = (e) => {
|
|
103
|
-
n = e, t = !0;
|
|
104
|
-
}, i = z();
|
|
105
|
-
return F.on("numberDlgResult" + i, r), F.emit("numberDlg", {
|
|
106
|
-
...e,
|
|
107
|
-
seq: i
|
|
108
|
-
}), await I(() => t), F.off("numberDlgResult" + i, r), n;
|
|
109
|
-
}
|
|
110
|
-
async function _e(e) {
|
|
111
|
-
if (!R()) return;
|
|
112
|
-
let t = !1, n, r = (e) => {
|
|
113
|
-
n = e, t = !0;
|
|
114
|
-
}, i = z();
|
|
115
|
-
return F.on("promptDlgResult" + i, r), F.emit("promptDlg", {
|
|
116
|
-
...e,
|
|
117
|
-
seq: i
|
|
118
|
-
}), await I(() => t), F.off("promptDlgResult" + i, r), n;
|
|
119
|
-
}
|
|
120
|
-
function ve(e) {
|
|
121
|
-
F.emit("waitDlg", { text: e });
|
|
122
|
-
}
|
|
123
|
-
function ye() {
|
|
124
|
-
F.emit("closeWaitDlg");
|
|
125
|
-
}
|
|
126
|
-
//#endregion
|
|
127
|
-
//#region src/utils/message.ts
|
|
128
|
-
function be(e, t) {
|
|
129
|
-
F.emit("message", {
|
|
130
|
-
type: "error",
|
|
131
|
-
text: e,
|
|
132
|
-
timeout: t
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
function xe(e, t) {
|
|
136
|
-
F.emit("message", {
|
|
137
|
-
type: "info",
|
|
138
|
-
text: e,
|
|
139
|
-
timeout: t
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
function Se(e, t) {
|
|
143
|
-
F.emit("message", {
|
|
144
|
-
type: "success",
|
|
145
|
-
text: e,
|
|
146
|
-
timeout: t
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
function Ce(e, t) {
|
|
150
|
-
F.emit("message", {
|
|
151
|
-
type: "warning",
|
|
152
|
-
text: e,
|
|
153
|
-
timeout: t
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
//#endregion
|
|
157
|
-
//#region src/utils/permission.ts
|
|
158
|
-
var we = /* @__PURE__ */ function(e) {
|
|
159
|
-
return 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_compute_space = "list_compute_space", e.get_compute_space = "get_compute_space", e.create_compute_space = "create_compute_space", e.delete_compute_space = "delete_compute_space", e.update_compute_space = "update_compute_space", e.arrange_compute_space = "arrange_compute_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.debug_flow = "debug_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_compute_layer = "open_compute_layer", e.list_data_space = "list_data_space", e.get_data_space = "get_data_space", e.create_data_space = "create_data_space", e.delete_data_space = "delete_data_space", e.update_data_space = "update_data_space", e.arrange_data_space = "arrange_data_space", e.list_table_group = "list_table_group", e.create_table_group = "create_table_group", e.delete_table_group = "delete_table_group", e.update_table_group = "update_table_group", e.arrange_table_group = "arrange_table_group", e.list_table = "list_table", e.get_table = "get_table", e.create_table = "create_table", e.delete_table = "delete_table", e.update_table = "update_table", e.get_data = "get_data", e.create_data = "create_data", e.delete_data = "delete_data", e.update_data = "update_data", e.get_relation_graph = "get_relation_graph", e.update_relation_graph = "update_relation_graph", e.list_change = "list_change", e.apply_change = "apply_change", e.open_data_layer = "open_data_layer", e.list_resource_space = "list_resource_space", e.get_resource_space = "get_resource_space", e.create_resource_space = "create_resource_space", e.delete_resource_space = "delete_resource_space", e.update_resource_space = "update_resource_space", e.arrange_resource_space = "arrange_resource_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_resource = "list_resource", e.get_resource = "get_resource", e.create_resource = "create_resource", e.delete_resource = "delete_resource", e.update_resource = "update_resource", e.move_resource = "move_resource", e.open_resource_layer = "open_resource_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_group = "list_org_role_group", e.create_org_role_group = "create_org_role_group", e.delete_org_role_group = "delete_org_role_group", e.update_org_role_group = "update_org_role_group", e.arrange_org_role_group = "arrange_org_role_group", 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.get_org_structure = "get_org_structure", e.update_org_structure = "update_org_structure", e.filter_table = "filter_table", e;
|
|
160
|
-
}({});
|
|
161
|
-
function B(e, t) {
|
|
162
|
-
if (!e) return !1;
|
|
163
|
-
let n = e;
|
|
164
|
-
return Object.keys(n).length <= 0 || (t.split("/").forEach((e) => {
|
|
165
|
-
if (Object.keys(n).length <= 0) return !0;
|
|
166
|
-
if (n[e]) n = n[e];
|
|
167
|
-
else return !1;
|
|
168
|
-
}), Object.keys(n).length <= 0);
|
|
169
|
-
}
|
|
170
|
-
function V(e, t, n) {
|
|
171
|
-
let r = e[t];
|
|
172
|
-
return r ? n ? !(!B(r.includes, n) || B(r.excludes, n)) : !0 : !1;
|
|
173
|
-
}
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/utils/provideInject.ts
|
|
176
|
-
var H = "essentialDark", U = "essentialLocale", W = "essentialPermissionObjects", G = "essentialPermissionChecksum", K = "essentialLastAppPath", q = "essentialViews";
|
|
177
|
-
function Te(e) {
|
|
178
|
-
x(H, e);
|
|
179
|
-
}
|
|
180
|
-
function Ee() {
|
|
181
|
-
return m(H);
|
|
182
|
-
}
|
|
183
|
-
function De(e) {
|
|
184
|
-
x(U, e);
|
|
185
|
-
}
|
|
186
|
-
function Oe() {
|
|
187
|
-
return m(U);
|
|
188
|
-
}
|
|
189
|
-
function ke(e) {
|
|
190
|
-
x(W, e);
|
|
191
|
-
}
|
|
192
|
-
function Ae() {
|
|
193
|
-
return m(W);
|
|
194
|
-
}
|
|
195
|
-
function je(e) {
|
|
196
|
-
x(G, e);
|
|
197
|
-
}
|
|
198
|
-
function Me() {
|
|
199
|
-
return m(G);
|
|
200
|
-
}
|
|
201
|
-
function Ne(e) {
|
|
202
|
-
x(K, e);
|
|
203
|
-
}
|
|
204
|
-
function Pe() {
|
|
205
|
-
return m(K);
|
|
206
|
-
}
|
|
207
|
-
function Fe(e) {
|
|
208
|
-
x(q, e);
|
|
209
|
-
}
|
|
210
|
-
function Ie() {
|
|
211
|
-
return m(q);
|
|
212
|
-
}
|
|
213
|
-
//#endregion
|
|
214
|
-
//#region src/utils/router.ts
|
|
215
|
-
var Le = [
|
|
216
|
-
{
|
|
217
|
-
app: "x-passport-mf",
|
|
218
|
-
path: "/passport/login",
|
|
219
|
-
level: 0,
|
|
220
|
-
mainActive: 1
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
app: "x-passport-mf",
|
|
224
|
-
path: "/passport/loginAccount",
|
|
225
|
-
level: 1,
|
|
226
|
-
mainActive: 1
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
app: "x-passport-mf",
|
|
230
|
-
path: "/passport/register",
|
|
231
|
-
level: 1,
|
|
232
|
-
mainActive: 1
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
app: "x-org-mf",
|
|
236
|
-
path: "/org/joinOrCreate",
|
|
237
|
-
level: 1,
|
|
238
|
-
requiredState: "auth"
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
app: "x-org-mf",
|
|
242
|
-
path: "/org/manager",
|
|
243
|
-
level: 1,
|
|
244
|
-
requiredState: "org",
|
|
245
|
-
mainActive: 2
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
app: "x-main-mf",
|
|
249
|
-
path: "/main",
|
|
250
|
-
level: 0,
|
|
251
|
-
requiredState: "org"
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
app: "x-mine-mf",
|
|
255
|
-
path: "/mine/personalInfo",
|
|
256
|
-
level: 1,
|
|
257
|
-
requiredState: "org",
|
|
258
|
-
mainActive: 4
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
app: "x-mine-mf",
|
|
262
|
-
path: "/mine/accountSecurity",
|
|
263
|
-
level: 2,
|
|
264
|
-
requiredState: "org"
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
app: "x-mine-mf",
|
|
268
|
-
path: "/mine/settings",
|
|
269
|
-
level: 1,
|
|
270
|
-
requiredState: "org",
|
|
271
|
-
mainActive: 4
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
app: "x-mine-mf",
|
|
275
|
-
path: "/mine/general",
|
|
276
|
-
level: 2,
|
|
277
|
-
requiredState: "org"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
app: "x-mine-mf",
|
|
281
|
-
path: "/mine/general/darkMode",
|
|
282
|
-
level: 3,
|
|
283
|
-
requiredState: "org"
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
app: "x-mine-mf",
|
|
287
|
-
path: "/mine/general/language",
|
|
288
|
-
level: 3,
|
|
289
|
-
requiredState: "org"
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
app: "x-app-mf",
|
|
293
|
-
path: "/app/manager",
|
|
294
|
-
level: 1,
|
|
295
|
-
requiredState: "org",
|
|
296
|
-
mainActive: 2
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
app: "x-app-mf",
|
|
300
|
-
path: "/app/editor",
|
|
301
|
-
level: 2,
|
|
302
|
-
requiredState: "org"
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
app: "x-compute-mf",
|
|
306
|
-
path: "/compute",
|
|
307
|
-
level: 1,
|
|
308
|
-
requiredState: "org",
|
|
309
|
-
mainActive: 2
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
app: "x-data-mf",
|
|
313
|
-
path: "/data",
|
|
314
|
-
level: 1,
|
|
315
|
-
requiredState: "org",
|
|
316
|
-
mainActive: 2
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
app: "x-resource-mf",
|
|
320
|
-
path: "/resource",
|
|
321
|
-
level: 1,
|
|
322
|
-
requiredState: "org",
|
|
323
|
-
mainActive: 2
|
|
324
|
-
}
|
|
325
|
-
];
|
|
326
|
-
function J(e) {
|
|
327
|
-
let t, n = 0, r = e.split("/").filter((e) => e.trim() !== "");
|
|
328
|
-
return Le.forEach((e) => {
|
|
329
|
-
let i = e.path.split("/").filter((e) => e.trim() !== ""), a = 0;
|
|
330
|
-
for (let e = 0; e < r.length && !(e >= i.length || r[e] !== i[e]); e++) a++;
|
|
331
|
-
a > 0 && a > n && (t = e, n = a);
|
|
332
|
-
}), t;
|
|
333
|
-
}
|
|
334
|
-
var Y = S("");
|
|
335
|
-
function X(e, t, n) {
|
|
336
|
-
t === "/" && (t = n);
|
|
337
|
-
let r = J(e), i = J(t);
|
|
338
|
-
if (!r) {
|
|
339
|
-
console.assert(!1);
|
|
340
|
-
return;
|
|
341
|
-
}
|
|
342
|
-
if (console.info(`~~~~routeChange~~~~ ${t} -> ${e}`), !i) return;
|
|
343
|
-
let a = r.app === i.app, o = r.path === i.path, s = r.level >= i.level;
|
|
344
|
-
a ? o ? Y.value = "" : Y.value = s ? "inner-left" : "inner-right" : (Y.value = "", pe(r.app, s));
|
|
345
|
-
}
|
|
346
|
-
function Re() {
|
|
347
|
-
return !!n.get("accessToken");
|
|
348
|
-
}
|
|
349
|
-
function ze() {
|
|
350
|
-
return !!n.get("activeOrg");
|
|
351
|
-
}
|
|
352
|
-
function Be(e, t, n) {
|
|
353
|
-
let r = Re(), i = ze(), a = J(e.path);
|
|
354
|
-
if (!a) throw Error("to route meta invalid");
|
|
355
|
-
if (a.requiredState === "auth") if (r) if (i) {
|
|
356
|
-
let e = "/main";
|
|
357
|
-
return X(e, t.path, n), { path: e };
|
|
358
|
-
} else {
|
|
359
|
-
X(e.path, t.path, n);
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
else {
|
|
363
|
-
let e = "/passport/login";
|
|
364
|
-
return X(e, t.path, n), { path: e };
|
|
365
|
-
}
|
|
366
|
-
else if (a.requiredState === "org") if (r) if (i) {
|
|
367
|
-
X(e.path, t.path, n);
|
|
368
|
-
return;
|
|
369
|
-
} else {
|
|
370
|
-
let e = "/org/joinOrCreate";
|
|
371
|
-
return X(e, t.path, n), { path: e };
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
374
|
-
let e = "/passport/login";
|
|
375
|
-
return X(e, t.path, n), { path: e };
|
|
376
|
-
}
|
|
377
|
-
else if (r) if (i) {
|
|
378
|
-
let e = "/main";
|
|
379
|
-
return X(e, t.path, n), { path: e };
|
|
380
|
-
} else {
|
|
381
|
-
let e = "/org/joinOrCreate";
|
|
382
|
-
return X(e, t.path, n), { path: e };
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
X(e.path, t.path, n);
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
//#endregion
|
|
390
|
-
//#region src/utils/type.ts
|
|
391
|
-
var Ve = [
|
|
392
|
-
"string",
|
|
393
|
-
"number",
|
|
394
|
-
"boolean",
|
|
395
|
-
"array",
|
|
396
|
-
"object",
|
|
397
|
-
"any"
|
|
398
|
-
];
|
|
399
|
-
function He(e) {
|
|
400
|
-
switch (e) {
|
|
401
|
-
case "string": return "#5ba58c";
|
|
402
|
-
case "number": return "#5b67a5";
|
|
403
|
-
case "boolean": return "#5b80a5";
|
|
404
|
-
case "array": return "#745ba5";
|
|
405
|
-
case "object": return "#80a55b";
|
|
406
|
-
case "any": return "#9e9e9e";
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
function Ue(e) {
|
|
410
|
-
switch (e) {
|
|
411
|
-
case "string": return "";
|
|
412
|
-
case "number": return 0;
|
|
413
|
-
case "boolean": return !1;
|
|
414
|
-
case "array": return [];
|
|
415
|
-
case "object": return {};
|
|
416
|
-
case "any": return null;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
//#endregion
|
|
420
|
-
//#region src/utils/viewMgr.ts
|
|
421
|
-
function We(e) {
|
|
422
|
-
return e.value.length <= 0;
|
|
423
|
-
}
|
|
424
|
-
function Ge(e) {
|
|
425
|
-
if (e.value.length > 0) return e.value[e.value.length - 1];
|
|
426
|
-
}
|
|
427
|
-
function Z(e, t) {
|
|
428
|
-
return !!e.value.find((e) => e === t);
|
|
429
|
-
}
|
|
430
|
-
function Ke(e, t) {
|
|
431
|
-
let n = e.value.findIndex((e) => e === t);
|
|
432
|
-
n >= 0 && e.value.splice(n, 1), e.value.push(t);
|
|
433
|
-
}
|
|
434
|
-
function qe(e, t) {
|
|
435
|
-
let n = e.value.findIndex((e) => e === t);
|
|
436
|
-
n >= 0 && e.value.splice(n, 1);
|
|
437
|
-
}
|
|
438
|
-
function Je(e) {
|
|
439
|
-
console.assert(e.value.length > 0), e.value.pop();
|
|
440
|
-
}
|
|
441
|
-
function Ye(e) {
|
|
442
|
-
e.value = [];
|
|
443
|
-
}
|
|
444
|
-
//#endregion
|
|
445
|
-
//#region src/composables/microApp.ts
|
|
446
|
-
function Xe(t, n, r, i, a, o) {
|
|
447
|
-
let s = te(), c = ne(), l = e(), u = S(!1);
|
|
448
|
-
k(() => {
|
|
449
|
-
let e;
|
|
450
|
-
e = typeof t.value == "boolean" ? t.value : l.value, u.value = e;
|
|
451
|
-
}), Te(u), De(n), ke(r), je(i), Ne(a), Fe(o);
|
|
452
|
-
let d = P();
|
|
453
|
-
k(() => {
|
|
454
|
-
d.change(u.value ? "dark" : "light");
|
|
455
|
-
});
|
|
456
|
-
let f = () => {
|
|
457
|
-
if (!We(o)) {
|
|
458
|
-
Z(o, "waitDlg") || Je(o);
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
let e = J(s.path);
|
|
462
|
-
if (!e) {
|
|
463
|
-
console.assert(!1);
|
|
464
|
-
return;
|
|
465
|
-
}
|
|
466
|
-
e.level === 0 ? navigator?.Backbutton?.goHome(() => {}, () => {}) : c.back();
|
|
467
|
-
}, p = (e) => {
|
|
468
|
-
if (e.key === "Escape") {
|
|
469
|
-
f();
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
}, m = () => {
|
|
473
|
-
f();
|
|
474
|
-
};
|
|
475
|
-
y(() => {
|
|
476
|
-
window.addEventListener("keydown", p), F.on("backbutton", m);
|
|
477
|
-
}), v(() => {
|
|
478
|
-
window.removeEventListener("keydown", p), F.off("backbutton", m);
|
|
479
|
-
});
|
|
480
|
-
let h = (e) => {
|
|
481
|
-
t.value = e;
|
|
482
|
-
}, g = (e) => {
|
|
483
|
-
n.value = e;
|
|
484
|
-
}, b = (e) => {
|
|
485
|
-
let t = e;
|
|
486
|
-
r.value = t[0], i.value = t[1];
|
|
487
|
-
}, x = (e) => {
|
|
488
|
-
a.value = e;
|
|
489
|
-
};
|
|
490
|
-
_(() => {
|
|
491
|
-
F.on("updateDark", h), F.on("updateLocale", g), F.on("updatePermission", b), F.on("updateLastAppPath", x), F.emit("syncGlobalState");
|
|
492
|
-
}), v(() => {
|
|
493
|
-
F.off("updateDark", h), F.off("updateLocale", g), F.off("updatePermission", b), F.off("updateLastAppPath", x);
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
//#endregion
|
|
497
|
-
//#region src/composables/permission.ts
|
|
498
|
-
function Ze() {
|
|
499
|
-
let e = Ae();
|
|
500
|
-
function t(t, n) {
|
|
501
|
-
return V(e.value, t, n ?? "");
|
|
502
|
-
}
|
|
503
|
-
return { verifyPermission: t };
|
|
504
|
-
}
|
|
505
|
-
//#endregion
|
|
506
|
-
//#region src/composables/system.ts
|
|
507
|
-
function Qe() {
|
|
508
|
-
let { locale: e, t } = N(), n = o(() => !!window.cordova), i = ee();
|
|
509
|
-
return {
|
|
510
|
-
sysBarAvail: n,
|
|
511
|
-
compactWidth: o(() => i.width.value <= 1280 ? i.width.value + "px" : i.width.value <= 1920 ? "768px" : "1024px"),
|
|
512
|
-
isCurvedScreen: o(() => !1),
|
|
513
|
-
isMobile: () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),
|
|
514
|
-
nameList: (n, r) => {
|
|
515
|
-
let i, a = n.map((e) => t(e));
|
|
516
|
-
return i = r ? `${a.join("/")} <${r.join("/")}>` : e.value === "en" ? a.join(" ") : a.join(""), i;
|
|
517
|
-
},
|
|
518
|
-
sentenceOfAsk: (n, i, a) => e.value === "en" ? t("dlg.common.ask", {
|
|
519
|
-
verb: r(t(n)),
|
|
520
|
-
object: r(t(i)),
|
|
521
|
-
name: a
|
|
522
|
-
}) : t("dlg.common.ask", {
|
|
523
|
-
verb: t(n),
|
|
524
|
-
object: t(i),
|
|
525
|
-
name: a
|
|
526
|
-
})
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
//#endregion
|
|
530
|
-
//#region src/composables/viewStack.ts
|
|
531
|
-
function Q(e, t) {
|
|
532
|
-
let n = Ie(), r = o({
|
|
533
|
-
get() {
|
|
534
|
-
return Z(n, e);
|
|
535
|
-
},
|
|
536
|
-
set(t) {
|
|
537
|
-
t ? Ke(n, e) : qe(n, e);
|
|
538
|
-
}
|
|
539
|
-
}), i = (e) => {
|
|
540
|
-
t?.(e), r.value = !0;
|
|
541
|
-
};
|
|
542
|
-
return y(() => {
|
|
543
|
-
F.on(e, i);
|
|
544
|
-
}), v(() => {
|
|
545
|
-
F.off(e, i);
|
|
546
|
-
}), { open: r };
|
|
547
|
-
}
|
|
548
|
-
//#endregion
|
|
549
|
-
//#region src/components/confirmDlg/index.vue
|
|
550
|
-
var $e = /* @__PURE__ */ p({
|
|
551
|
-
__name: "index",
|
|
552
|
-
setup(e) {
|
|
553
|
-
let { t } = N(), n = S(""), r = S(""), i = S(""), a = S(""), o = S(""), c = S(""), l = S(""), u = 0, p = !1, { open: m } = Q("confirmDlg", (e) => {
|
|
554
|
-
n.value = e.title, r.value = e.subtitle ?? "", i.value = e.text, a.value = e.cancel?.color ?? "primary", o.value = e.cancel?.text ?? t("dlg.common.cancel"), c.value = e.confirm?.color ?? "primary", l.value = e.confirm?.text ?? t("dlg.common.confirm"), u = e.seq, p = !1, m.value = !0;
|
|
555
|
-
}), g = () => {
|
|
556
|
-
m.value = !1, p ||= (F.emit("confirmDlgResult" + u, !0), !0);
|
|
557
|
-
};
|
|
558
|
-
return O(m, (e) => {
|
|
559
|
-
!e && !p && (F.emit("confirmDlgResult" + u, !1), p = !0);
|
|
560
|
-
}), (e, t) => {
|
|
561
|
-
let u = w("v-card-text"), p = w("v-btn"), _ = w("v-card-actions"), v = w("v-card"), y = w("v-dialog");
|
|
562
|
-
return b(), s(y, {
|
|
563
|
-
modelValue: E(m),
|
|
564
|
-
"onUpdate:modelValue": t[1] ||= (e) => h(m) ? m.value = e : null,
|
|
565
|
-
attach: "",
|
|
566
|
-
"max-width": "600px",
|
|
567
|
-
transition: "dialog-top-transition",
|
|
568
|
-
onKeydown: [j(M(g, ["stop", "prevent"]), ["enter"]), t[2] ||= j(M((e) => m.value = !1, ["stop", "prevent"]), ["esc"])]
|
|
569
|
-
}, {
|
|
570
|
-
default: A(() => [f(v, {
|
|
571
|
-
subtitle: r.value,
|
|
572
|
-
title: n.value
|
|
573
|
-
}, {
|
|
574
|
-
default: A(() => [f(u, null, {
|
|
575
|
-
default: A(() => [d(T(i.value), 1)]),
|
|
576
|
-
_: 1
|
|
577
|
-
}), f(_, { class: "d-flex justify-end" }, {
|
|
578
|
-
default: A(() => [f(p, {
|
|
579
|
-
color: a.value,
|
|
580
|
-
variant: "text",
|
|
581
|
-
onClick: t[0] ||= (e) => m.value = !1
|
|
582
|
-
}, {
|
|
583
|
-
default: A(() => [d(T(o.value), 1)]),
|
|
584
|
-
_: 1
|
|
585
|
-
}, 8, ["color"]), f(p, {
|
|
586
|
-
color: c.value,
|
|
587
|
-
variant: "text",
|
|
588
|
-
onClick: g
|
|
589
|
-
}, {
|
|
590
|
-
default: A(() => [d(T(l.value), 1)]),
|
|
591
|
-
_: 1
|
|
592
|
-
}, 8, ["color"])]),
|
|
593
|
-
_: 1
|
|
594
|
-
})]),
|
|
595
|
-
_: 1
|
|
596
|
-
}, 8, ["subtitle", "title"])]),
|
|
597
|
-
_: 1
|
|
598
|
-
}, 8, ["modelValue", "onKeydown"]);
|
|
599
|
-
};
|
|
600
|
-
}
|
|
601
|
-
}), et = /* @__PURE__ */ p({
|
|
602
|
-
__name: "index",
|
|
603
|
-
props: {
|
|
604
|
-
open: {
|
|
605
|
-
type: Boolean,
|
|
606
|
-
default: !0
|
|
607
|
-
},
|
|
608
|
-
zIndex: { default: 1 }
|
|
609
|
-
},
|
|
610
|
-
setup(e) {
|
|
611
|
-
let { backgroundColor2: t } = ie(), n = o(() => ({
|
|
612
|
-
background: t.value,
|
|
613
|
-
zIndex: e.zIndex
|
|
614
|
-
})), r = 0;
|
|
615
|
-
return (t, i) => (b(), s(a, { name: "fade" }, {
|
|
616
|
-
default: A(() => [e.open ? (b(), l("div", {
|
|
617
|
-
key: h(r) ? ++r.value : ++r,
|
|
618
|
-
class: "x-cont",
|
|
619
|
-
style: g(n.value)
|
|
620
|
-
}, [...i[0] ||= [u("div", { class: "lds-spinner" }, [
|
|
621
|
-
u("div"),
|
|
622
|
-
u("div"),
|
|
623
|
-
u("div"),
|
|
624
|
-
u("div"),
|
|
625
|
-
u("div"),
|
|
626
|
-
u("div"),
|
|
627
|
-
u("div"),
|
|
628
|
-
u("div"),
|
|
629
|
-
u("div"),
|
|
630
|
-
u("div"),
|
|
631
|
-
u("div"),
|
|
632
|
-
u("div")
|
|
633
|
-
], -1)]], 4)) : c("", !0)]),
|
|
634
|
-
_: 1
|
|
635
|
-
}));
|
|
636
|
-
}
|
|
637
|
-
}), $ = (e, t) => {
|
|
638
|
-
let n = e.__vccOpts || e;
|
|
639
|
-
for (let [e, r] of t) n[e] = r;
|
|
640
|
-
return n;
|
|
641
|
-
}, tt = /* @__PURE__ */ $(et, [["__scopeId", "data-v-6874f27f"]]), nt = /* @__PURE__ */ $(/* @__PURE__ */ p({
|
|
642
|
-
__name: "item",
|
|
643
|
-
props: {
|
|
644
|
-
id: {},
|
|
645
|
-
type: {},
|
|
646
|
-
text: {},
|
|
647
|
-
timeout: { default: 5e3 }
|
|
648
|
-
},
|
|
649
|
-
emits: ["timeout"],
|
|
650
|
-
setup(e, { emit: t }) {
|
|
651
|
-
let n = o(() => ({
|
|
652
|
-
width: "calc(100% - 64px)",
|
|
653
|
-
overflowWrap: "break-word"
|
|
654
|
-
})), r = o(() => {
|
|
655
|
-
switch (e.type) {
|
|
656
|
-
case "success": return "mdi-check-circle";
|
|
657
|
-
case "info": return "mdi-information";
|
|
658
|
-
case "error": return "mdi-close-circle";
|
|
659
|
-
case "warning": return "mdi-alert-circle";
|
|
660
|
-
default: return "";
|
|
661
|
-
}
|
|
662
|
-
}), i = S(!0), a = t;
|
|
663
|
-
return y(() => {
|
|
664
|
-
setTimeout(() => {
|
|
665
|
-
a("timeout", e.id);
|
|
666
|
-
}, e.timeout);
|
|
667
|
-
}), O(i, (t) => {
|
|
668
|
-
t || a("timeout", e.id);
|
|
669
|
-
}), (t, i) => {
|
|
670
|
-
let o = w("v-icon"), l = w("v-sheet");
|
|
671
|
-
return b(), s(l, {
|
|
672
|
-
class: "x-item d-flex align-center py-2 mb-2",
|
|
673
|
-
color: e.type,
|
|
674
|
-
elevation: 1
|
|
675
|
-
}, {
|
|
676
|
-
default: A(() => [
|
|
677
|
-
r.value ? (b(), s(o, {
|
|
678
|
-
key: 0,
|
|
679
|
-
class: "mx-1",
|
|
680
|
-
icon: r.value
|
|
681
|
-
}, null, 8, ["icon"])) : c("", !0),
|
|
682
|
-
u("div", { style: g(n.value) }, T(e.text), 5),
|
|
683
|
-
f(o, {
|
|
684
|
-
class: "mx-1",
|
|
685
|
-
icon: "mdi-close",
|
|
686
|
-
onClick: i[0] ||= (t) => a("timeout", e.id)
|
|
687
|
-
})
|
|
688
|
-
]),
|
|
689
|
-
_: 1
|
|
690
|
-
}, 8, ["color"]);
|
|
691
|
-
};
|
|
692
|
-
}
|
|
693
|
-
}), [["__scopeId", "data-v-96fcf38e"]]), rt = /* @__PURE__ */ $(/* @__PURE__ */ p({
|
|
694
|
-
__name: "index",
|
|
695
|
-
setup(e) {
|
|
696
|
-
let t = S([]);
|
|
697
|
-
y(() => {
|
|
698
|
-
F.on("message", n);
|
|
699
|
-
}), v(() => {
|
|
700
|
-
F.off("message", n);
|
|
701
|
-
});
|
|
702
|
-
let n = (e) => {
|
|
703
|
-
let { type: t, text: n, timeout: r } = e;
|
|
704
|
-
o(t, n, r);
|
|
705
|
-
}, r = (e) => {
|
|
706
|
-
c(e);
|
|
707
|
-
}, a = 0, o = (e, n, r) => {
|
|
708
|
-
let i = a++;
|
|
709
|
-
t.value.push({
|
|
710
|
-
id: i,
|
|
711
|
-
type: e,
|
|
712
|
-
text: n,
|
|
713
|
-
timeout: r
|
|
714
|
-
});
|
|
715
|
-
}, c = (e) => {
|
|
716
|
-
let n = t.value.findIndex((t) => t.id === e);
|
|
717
|
-
n >= 0 && t.value.splice(n, 1);
|
|
718
|
-
};
|
|
719
|
-
return (e, n) => (b(), l("div", {
|
|
720
|
-
class: "x-cont d-flex flex-column-reverse align-center",
|
|
721
|
-
onClick: n[0] ||= M(() => {}, ["stop"])
|
|
722
|
-
}, [(b(!0), l(i, null, C(t.value, (e) => (b(), s(nt, {
|
|
723
|
-
id: e.id,
|
|
724
|
-
key: e.id,
|
|
725
|
-
text: e.text,
|
|
726
|
-
timeout: e.timeout,
|
|
727
|
-
type: e.type,
|
|
728
|
-
onTimeout: r
|
|
729
|
-
}, null, 8, [
|
|
730
|
-
"id",
|
|
731
|
-
"text",
|
|
732
|
-
"timeout",
|
|
733
|
-
"type"
|
|
734
|
-
]))), 128))]));
|
|
735
|
-
}
|
|
736
|
-
}), [["__scopeId", "data-v-3d0e9ceb"]]), it = /* @__PURE__ */ p({
|
|
737
|
-
__name: "index",
|
|
738
|
-
setup(e) {
|
|
739
|
-
let { t } = N(), n = S(""), r = S(""), i = S(0), a = S(), o = S(-Infinity), c = S(Infinity), l = S(1), u = 0, p = !1, m = D("target"), { open: g } = Q("numberDlg", async (e) => {
|
|
740
|
-
n.value = e.title, r.value = e.subtitle ?? "", i.value = e.value, a.value = e.precision, o.value = e.min, c.value = e.max, l.value = e.step, u = e.seq, p = !1, g.value = !0, await I(() => !!m.value), m.value.focus();
|
|
741
|
-
}), _ = S(!1), v = () => {
|
|
742
|
-
g.value = !1, p ||= (F.emit(`numberDlgResult${u}`, i.value), !0);
|
|
743
|
-
};
|
|
744
|
-
return O(g, (e) => {
|
|
745
|
-
!e && !p && (F.emit(`numberDlgResult${u}`, void 0), p = !0);
|
|
746
|
-
}), (e, r) => {
|
|
747
|
-
let u = w("v-number-input"), p = w("v-btn"), y = w("v-card-actions"), x = w("v-form"), S = w("v-card"), C = w("v-dialog");
|
|
748
|
-
return b(), s(C, {
|
|
749
|
-
modelValue: E(g),
|
|
750
|
-
"onUpdate:modelValue": r[3] ||= (e) => h(g) ? g.value = e : null,
|
|
751
|
-
attach: "",
|
|
752
|
-
"max-width": "600px",
|
|
753
|
-
transition: "dialog-top-transition",
|
|
754
|
-
onKeydown: r[4] ||= j(M((e) => g.value = !1, ["stop", "prevent"]), ["esc"])
|
|
755
|
-
}, {
|
|
756
|
-
default: A(() => [f(S, { title: n.value }, {
|
|
757
|
-
default: A(() => [f(x, {
|
|
758
|
-
modelValue: _.value,
|
|
759
|
-
"onUpdate:modelValue": r[2] ||= (e) => _.value = e,
|
|
760
|
-
class: "mx-3",
|
|
761
|
-
onSubmit: M(v, ["prevent"])
|
|
762
|
-
}, {
|
|
763
|
-
default: A(() => [f(u, {
|
|
764
|
-
ref_key: "target",
|
|
765
|
-
ref: m,
|
|
766
|
-
modelValue: i.value,
|
|
767
|
-
"onUpdate:modelValue": r[0] ||= (e) => i.value = e,
|
|
768
|
-
"control-variant": "stacked",
|
|
769
|
-
max: c.value,
|
|
770
|
-
min: o.value,
|
|
771
|
-
precision: a.value,
|
|
772
|
-
step: l.value
|
|
773
|
-
}, null, 8, [
|
|
774
|
-
"modelValue",
|
|
775
|
-
"max",
|
|
776
|
-
"min",
|
|
777
|
-
"precision",
|
|
778
|
-
"step"
|
|
779
|
-
]), f(y, { class: "d-flex justify-end" }, {
|
|
780
|
-
default: A(() => [f(p, {
|
|
781
|
-
color: "primary",
|
|
782
|
-
variant: "text",
|
|
783
|
-
onClick: r[1] ||= (e) => g.value = !1
|
|
784
|
-
}, {
|
|
785
|
-
default: A(() => [d(T(E(t)("dlg.common.cancel")), 1)]),
|
|
786
|
-
_: 1
|
|
787
|
-
}), f(p, {
|
|
788
|
-
color: "primary",
|
|
789
|
-
disabled: !_.value,
|
|
790
|
-
type: "submit",
|
|
791
|
-
variant: "text"
|
|
792
|
-
}, {
|
|
793
|
-
default: A(() => [d(T(E(t)("dlg.common.confirm")), 1)]),
|
|
794
|
-
_: 1
|
|
795
|
-
}, 8, ["disabled"])]),
|
|
796
|
-
_: 1
|
|
797
|
-
})]),
|
|
798
|
-
_: 1
|
|
799
|
-
}, 8, ["modelValue"])]),
|
|
800
|
-
_: 1
|
|
801
|
-
}, 8, ["title"])]),
|
|
802
|
-
_: 1
|
|
803
|
-
}, 8, ["modelValue"]);
|
|
804
|
-
};
|
|
805
|
-
}
|
|
806
|
-
}), at = /* @__PURE__ */ p({
|
|
807
|
-
__name: "index",
|
|
808
|
-
setup(e) {
|
|
809
|
-
let { t } = N(), n = S(""), r = S(""), i = S(""), a = S(""), o = S(""), l = S(), u = S(""), p = S(""), m = S(""), g = S(""), _ = S(""), v = 0, y = !1, x = D("target"), { open: C } = Q("promptDlg", async (e) => {
|
|
810
|
-
n.value = e.title, r.value = e.subtitle ?? "", i.value = e.text, a.value = e.label, o.value = e.placeholder, l.value = e.rules, u.value = e.value, p.value = e.cancel?.color ?? "primary", m.value = e.cancel?.text ?? t("dlg.common.cancel"), g.value = e.confirm?.color ?? "primary", _.value = e.confirm?.text ?? t("dlg.common.confirm"), v = e.seq, y = !1, C.value = !0, await I(() => !!x.value), x.value.focus();
|
|
811
|
-
}), k = S(!1), ee = () => {
|
|
812
|
-
C.value = !1, y ||= (F.emit("promptDlgResult" + v, u.value ?? ""), !0);
|
|
813
|
-
};
|
|
814
|
-
return O(C, (e) => {
|
|
815
|
-
!e && !y && (F.emit("promptDlgResult" + v, void 0), y = !0);
|
|
816
|
-
}), (e, t) => {
|
|
817
|
-
let v = w("v-card-text"), y = w("v-text-field"), S = w("v-btn"), D = w("v-card-actions"), O = w("v-form"), N = w("v-card"), P = w("v-dialog");
|
|
818
|
-
return b(), s(P, {
|
|
819
|
-
modelValue: E(C),
|
|
820
|
-
"onUpdate:modelValue": t[3] ||= (e) => h(C) ? C.value = e : null,
|
|
821
|
-
attach: "",
|
|
822
|
-
"max-width": "600px",
|
|
823
|
-
transition: "dialog-top-transition",
|
|
824
|
-
onKeydown: t[4] ||= j(M((e) => C.value = !1, ["stop", "prevent"]), ["esc"])
|
|
825
|
-
}, {
|
|
826
|
-
default: A(() => [f(N, {
|
|
827
|
-
subtitle: r.value,
|
|
828
|
-
title: n.value
|
|
829
|
-
}, {
|
|
830
|
-
default: A(() => [i.value ? (b(), s(v, { key: 0 }, {
|
|
831
|
-
default: A(() => [d(T(i.value), 1)]),
|
|
832
|
-
_: 1
|
|
833
|
-
})) : c("", !0), f(O, {
|
|
834
|
-
modelValue: k.value,
|
|
835
|
-
"onUpdate:modelValue": t[2] ||= (e) => k.value = e,
|
|
836
|
-
class: "mx-3",
|
|
837
|
-
onSubmit: M(ee, ["prevent"])
|
|
838
|
-
}, {
|
|
839
|
-
default: A(() => [f(y, {
|
|
840
|
-
ref_key: "target",
|
|
841
|
-
ref: x,
|
|
842
|
-
modelValue: u.value,
|
|
843
|
-
"onUpdate:modelValue": t[0] ||= (e) => u.value = e,
|
|
844
|
-
label: a.value,
|
|
845
|
-
placeholder: o.value,
|
|
846
|
-
rules: l.value
|
|
847
|
-
}, null, 8, [
|
|
848
|
-
"modelValue",
|
|
849
|
-
"label",
|
|
850
|
-
"placeholder",
|
|
851
|
-
"rules"
|
|
852
|
-
]), f(D, { class: "d-flex justify-end" }, {
|
|
853
|
-
default: A(() => [f(S, {
|
|
854
|
-
color: p.value,
|
|
855
|
-
variant: "text",
|
|
856
|
-
onClick: t[1] ||= (e) => C.value = !1
|
|
857
|
-
}, {
|
|
858
|
-
default: A(() => [d(T(m.value), 1)]),
|
|
859
|
-
_: 1
|
|
860
|
-
}, 8, ["color"]), f(S, {
|
|
861
|
-
color: g.value,
|
|
862
|
-
disabled: !k.value,
|
|
863
|
-
type: "submit",
|
|
864
|
-
variant: "text"
|
|
865
|
-
}, {
|
|
866
|
-
default: A(() => [d(T(_.value), 1)]),
|
|
867
|
-
_: 1
|
|
868
|
-
}, 8, ["color", "disabled"])]),
|
|
869
|
-
_: 1
|
|
870
|
-
})]),
|
|
871
|
-
_: 1
|
|
872
|
-
}, 8, ["modelValue"])]),
|
|
873
|
-
_: 1
|
|
874
|
-
}, 8, ["subtitle", "title"])]),
|
|
875
|
-
_: 1
|
|
876
|
-
}, 8, ["modelValue"]);
|
|
877
|
-
};
|
|
878
|
-
}
|
|
879
|
-
}), ot = /* @__PURE__ */ p({
|
|
880
|
-
__name: "index",
|
|
881
|
-
props: {
|
|
882
|
-
show: { type: Boolean },
|
|
883
|
-
top: {},
|
|
884
|
-
left: {}
|
|
885
|
-
},
|
|
886
|
-
setup(e) {
|
|
887
|
-
let t = o(() => ({
|
|
888
|
-
position: "absolute",
|
|
889
|
-
backgroundColor: "#ff00cc",
|
|
890
|
-
width: "100%",
|
|
891
|
-
height: "1px",
|
|
892
|
-
top: `${e.top}px`,
|
|
893
|
-
left: "0px",
|
|
894
|
-
zIndex: 9999
|
|
895
|
-
})), n = o(() => ({
|
|
896
|
-
position: "absolute",
|
|
897
|
-
backgroundColor: "#ff00cc",
|
|
898
|
-
width: "1px",
|
|
899
|
-
height: "100%",
|
|
900
|
-
top: "0px",
|
|
901
|
-
left: `${e.left}px`,
|
|
902
|
-
zIndex: 9999
|
|
903
|
-
}));
|
|
904
|
-
return (r, a) => (b(), l(i, null, [e.show ? (b(), l("span", {
|
|
905
|
-
key: 0,
|
|
906
|
-
style: g(t.value)
|
|
907
|
-
}, null, 4)) : c("", !0), e.show ? (b(), l("span", {
|
|
908
|
-
key: 1,
|
|
909
|
-
style: g(n.value)
|
|
910
|
-
}, null, 4)) : c("", !0)], 64));
|
|
911
|
-
}
|
|
912
|
-
}), st = { class: "ma-auto" }, ct = { class: "w-100 h-100 d-flex align-center justify-center" }, lt = { class: "text-body-large" }, ut = /* @__PURE__ */ p({
|
|
913
|
-
__name: "index",
|
|
914
|
-
setup(e) {
|
|
915
|
-
let { t } = N(), n = S(""), r = (e) => {
|
|
916
|
-
n.value = e.text ?? t("dlg.common.responding"), a.value = !0;
|
|
917
|
-
}, i = () => {
|
|
918
|
-
a.value = !1;
|
|
919
|
-
}, { open: a } = Q("waitDlg", r);
|
|
920
|
-
return y(() => {
|
|
921
|
-
F.on("closeWaitDlg", i);
|
|
922
|
-
}), v(() => {
|
|
923
|
-
F.off("closeWaitDlg", i);
|
|
924
|
-
}), (e, t) => {
|
|
925
|
-
let r = w("v-card"), i = w("v-dialog");
|
|
926
|
-
return b(), s(i, {
|
|
927
|
-
modelValue: E(a),
|
|
928
|
-
"onUpdate:modelValue": t[0] ||= (e) => h(a) ? a.value = e : null,
|
|
929
|
-
attach: "",
|
|
930
|
-
fullscreen: "",
|
|
931
|
-
"no-click-animation": "",
|
|
932
|
-
persistent: ""
|
|
933
|
-
}, {
|
|
934
|
-
default: A(() => [u("div", st, [f(r, {
|
|
935
|
-
height: "80px",
|
|
936
|
-
loading: "",
|
|
937
|
-
width: "300px"
|
|
938
|
-
}, {
|
|
939
|
-
default: A(() => [u("div", ct, [u("span", lt, T(n.value), 1)])]),
|
|
940
|
-
_: 1
|
|
941
|
-
})])]),
|
|
942
|
-
_: 1
|
|
943
|
-
}, 8, ["modelValue"]);
|
|
944
|
-
};
|
|
945
|
-
}
|
|
946
|
-
}), dt = (e) => {
|
|
947
|
-
e.component("XConfirmDlg", $e), e.component("XLoading", tt), e.component("XMessage", rt), e.component("XNumberDlg", it), e.component("XPromptDlg", at), e.component("XRefLine", ot), e.component("XWaitDlg", ut);
|
|
948
|
-
}, ft = (e, t, n) => {
|
|
949
|
-
let r = t.lastIndexOf("?"), i = e[r === -1 || r < t.lastIndexOf("/") ? t : t.slice(0, r)];
|
|
950
|
-
return i ? typeof i == "function" ? i() : Promise.resolve(i) : new Promise((e, r) => {
|
|
951
|
-
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(r.bind(null, /* @__PURE__ */ Error("Unknown variable dynamic import: " + t + (t.split("/").length === n ? "" : ". Note that variables only represent file names one level deep."))));
|
|
952
|
-
});
|
|
953
|
-
};
|
|
954
|
-
//#endregion
|
|
955
|
-
//#region src/i18n/index.ts
|
|
956
|
-
async function pt(e) {
|
|
957
|
-
return (await ft(/* @__PURE__ */ Object.assign({
|
|
958
|
-
"./locales/en/index.ts": () => import("./i18n-en.lqadbyvh.js").then((e) => e.t),
|
|
959
|
-
"./locales/zhHans/index.ts": () => import("./i18n-zhHans.jagnyxbk.js").then((e) => e.t)
|
|
960
|
-
}), `./locales/${e}/index.ts`, 4)).default;
|
|
961
|
-
}
|
|
962
|
-
//#endregion
|
|
963
|
-
//#region src/index.ts
|
|
964
|
-
var mt = { install: dt };
|
|
965
|
-
//#endregion
|
|
966
|
-
export { we as Permission, Ke as addView, pe as appAppear, Ye as clearViews, ye as closeWaitDlg, ae as createAxios, mt as default, qe as delView, F as eventBus, He as getTypeColor, Ue as getTypeDefault, de as globalObjects, Z as hasView, Ee as injectDark, Pe as injectLastAppPath, Oe as injectLocale, Me as injectPermissionChecksum, Ae as injectPermissionObjects, Ie as injectViews, We as isEmpty, B as isExist, Ge as lastView, pt as loadLocaleMessageEssential, J as matchRouteMeta, be as messageError, xe as messageInfo, Se as messageSuccess, Ce as messageWarning, Be as onBeforeEach, he as openConfirmDlg, ge as openNumberDlg, _e as openPromptDlg, ve as openWaitDlg, Je as popView, Te as provideDark, Ne as provideLastAppPath, De as provideLocale, je as providePermissionChecksum, ke as providePermissionObjects, Fe as provideViews, Y as routeTransName, Ve as types, ie as useColor, Xe as useMicroApp, Ze as usePermission, Qe as useSystem, Q as useViewStack, V as verifyPermission, fe as waitMs, I as waitUtil };
|
|
1
|
+
import './style.css';
|
|
2
|
+
import{Fragment as e,Transition as t,computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,createVNode as c,defineComponent as l,inject as u,isRef as d,normalizeStyle as f,onBeforeMount as p,onBeforeUnmount as m,onMounted as h,openBlock as g,provide as _,ref as v,renderList as y,resolveComponent as b,toDisplayString as x,unref as S,useTemplateRef as C,watch as w,watchEffect as T,withCtx as E,withKeys as D,withModifiers as O}from"vue";import{useI18n as k}from"vue-i18n";import{useDisplay as A,useTheme as j}from"vuetify";import{usePreferredDark as M}from"@vueuse/core";import{useRoute as N,useRouter as P}from"vue-router";import F from"axios";import I from"js-cookie";import ee from"mitt";import{toLower as te}from"lodash-es";function ne(){let e=j();return{primaryColor:n(()=>e.global.current.value.colors.primary),secondaryColor:n(()=>e.global.current.value.colors.secondary),backgroundColor0:n(()=>e.current.value.dark?`#2e2e2e`:`#bdbdbd`),backgroundColor1:n(()=>e.current.value.dark?`#272727`:`#eeeeee`),backgroundColor2:n(()=>e.current.value.dark?`#1e1e1e`:`#ffffff`),highlightColor:n(()=>e.current.value.dark?`#303030`:`#f6f6f6`),borderColor:n(()=>e.current.value.dark?`#ffffff1f`:`#0000001f`)}}function re(e){let t=F.create({timeout:6e3});return t.defaults.baseURL=e.baseUrl,t.interceptors.request.use(e=>ie(e),t=>{ae(t,e.onError)}),t.interceptors.response.use(e=>oe(e),t=>se(t,e.onError)),t}function ie(e){let t=I.get(`accessToken`)??``;return e.headers.Authorization=`Basic `+t,e.headers[`Content-Type`]=`application/json`,e.data=JSON.stringify(e.data),e}function ae(e,t){console.error(e),t(`request timeout`)}function oe(e){return e.data}function se(e,t){let n=e.response;return n?(n.status===401&&ce(),n.data?.message?t(n.data?.message):t({code:n.status,message:n.statusText}),Promise.reject(e)):Promise.reject(e)}function ce(){I.remove(`accessToken`),I.remove(`refreshToken`),I.remove(`userId`),I.remove(`userName`),I.remove(`phone`),I.remove(`activeOrg`),P().replace({path:`/passport/login`})}const le=(function(){return window.globalObjects||(window.globalObjects={router:null,i18n:null},console.log(`globalObjects created`)),window.globalObjects})(),L=(function(){return window.eventBus||(window.eventBus=ee(),console.log(`eventBus created`)),window.eventBus})();async function ue(e){return new Promise(t=>{setTimeout(t,e)})}async function R(e,t,n){let r=Date.now();return new Promise(i=>{let a=async()=>{e()?i(!0):t&&Date.now()-r>t?i(!1):setTimeout(a,n??30)};a()})}function z(e,t){let n=document.getElementById(`single-spa-application:`+e);n&&(n.classList.remove(`app-left`,`app-right`,`app-reset`),t?n.classList.add(`app-left`):n.classList.add(`app-right`),setTimeout(()=>{n.classList.add(`app-reset`)},50))}let B=Date.now();function V(){let e=Date.now();return e-B>500?(B=e,!0):!1}let de=0;function H(){return++de}async function fe(e){if(!V())return;let t=!1,n,r=e=>{n=e,t=!0},i=H();return L.on(`confirmDlgResult`+i,r),L.emit(`confirmDlg`,{...e,seq:i}),await R(()=>t),L.off(`confirmDlgResult`+i,r),n}async function pe(e){if(!V())return;let t=!1,n,r=e=>{n=e,t=!0},i=H();return L.on(`numberDlgResult`+i,r),L.emit(`numberDlg`,{...e,seq:i}),await R(()=>t),L.off(`numberDlgResult`+i,r),n}async function me(e){if(!V())return;let t=!1,n,r=e=>{n=e,t=!0},i=H();return L.on(`promptDlgResult`+i,r),L.emit(`promptDlg`,{...e,seq:i}),await R(()=>t),L.off(`promptDlgResult`+i,r),n}function he(e){L.emit(`waitDlg`,{text:e})}function ge(){L.emit(`closeWaitDlg`)}function _e(e,t){L.emit(`message`,{type:`error`,text:e,timeout:t})}function ve(e,t){L.emit(`message`,{type:`info`,text:e,timeout:t})}function ye(e,t){L.emit(`message`,{type:`success`,text:e,timeout:t})}function be(e,t){L.emit(`message`,{type:`warning`,text:e,timeout:t})}let xe=function(e){return 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_compute_space=`list_compute_space`,e.get_compute_space=`get_compute_space`,e.create_compute_space=`create_compute_space`,e.delete_compute_space=`delete_compute_space`,e.update_compute_space=`update_compute_space`,e.arrange_compute_space=`arrange_compute_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.debug_flow=`debug_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_compute_layer=`open_compute_layer`,e.list_data_space=`list_data_space`,e.get_data_space=`get_data_space`,e.create_data_space=`create_data_space`,e.delete_data_space=`delete_data_space`,e.update_data_space=`update_data_space`,e.arrange_data_space=`arrange_data_space`,e.list_table_group=`list_table_group`,e.create_table_group=`create_table_group`,e.delete_table_group=`delete_table_group`,e.update_table_group=`update_table_group`,e.arrange_table_group=`arrange_table_group`,e.list_table=`list_table`,e.get_table=`get_table`,e.create_table=`create_table`,e.delete_table=`delete_table`,e.update_table=`update_table`,e.get_data=`get_data`,e.create_data=`create_data`,e.delete_data=`delete_data`,e.update_data=`update_data`,e.get_relation_graph=`get_relation_graph`,e.update_relation_graph=`update_relation_graph`,e.list_change=`list_change`,e.apply_change=`apply_change`,e.open_data_layer=`open_data_layer`,e.list_resource_space=`list_resource_space`,e.get_resource_space=`get_resource_space`,e.create_resource_space=`create_resource_space`,e.delete_resource_space=`delete_resource_space`,e.update_resource_space=`update_resource_space`,e.arrange_resource_space=`arrange_resource_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_resource=`list_resource`,e.get_resource=`get_resource`,e.create_resource=`create_resource`,e.delete_resource=`delete_resource`,e.update_resource=`update_resource`,e.move_resource=`move_resource`,e.open_resource_layer=`open_resource_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_group=`list_org_role_group`,e.create_org_role_group=`create_org_role_group`,e.delete_org_role_group=`delete_org_role_group`,e.update_org_role_group=`update_org_role_group`,e.arrange_org_role_group=`arrange_org_role_group`,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.get_org_structure=`get_org_structure`,e.update_org_structure=`update_org_structure`,e.filter_table=`filter_table`,e}({});function U(e,t){if(!e)return!1;let n=e;return Object.keys(n).length<=0||(t.split(`/`).forEach(e=>{if(Object.keys(n).length<=0)return!0;if(n[e])n=n[e];else return!1}),Object.keys(n).length<=0)}function W(e,t,n){let r=e[t];return r?n?!(!U(r.includes,n)||U(r.excludes,n)):!0:!1}const G=`essentialDark`,K=`essentialLocale`,q=`essentialPermissionObjects`,Se=`essentialPermissionChecksum`,Ce=`essentialLastAppPath`,we=`essentialViews`;function Te(e){_(G,e)}function Ee(){return u(G)}function De(e){_(K,e)}function Oe(){return u(K)}function ke(e){_(q,e)}function Ae(){return u(q)}function je(e){_(Se,e)}function Me(){return u(Se)}function Ne(e){_(Ce,e)}function Pe(){return u(Ce)}function Fe(e){_(we,e)}function Ie(){return u(we)}const Le=[{app:`x-passport-mf`,path:`/passport/login`,level:0,mainActive:1},{app:`x-passport-mf`,path:`/passport/loginAccount`,level:1,mainActive:1},{app:`x-passport-mf`,path:`/passport/register`,level:1,mainActive:1},{app:`x-org-mf`,path:`/org/joinOrCreate`,level:1,requiredState:`auth`},{app:`x-org-mf`,path:`/org/manager`,level:1,requiredState:`org`,mainActive:2},{app:`x-main-mf`,path:`/main`,level:0,requiredState:`org`},{app:`x-mine-mf`,path:`/mine/personalInfo`,level:1,requiredState:`org`,mainActive:4},{app:`x-mine-mf`,path:`/mine/accountSecurity`,level:2,requiredState:`org`},{app:`x-mine-mf`,path:`/mine/settings`,level:1,requiredState:`org`,mainActive:4},{app:`x-mine-mf`,path:`/mine/general`,level:2,requiredState:`org`},{app:`x-mine-mf`,path:`/mine/general/darkMode`,level:3,requiredState:`org`},{app:`x-mine-mf`,path:`/mine/general/language`,level:3,requiredState:`org`},{app:`x-app-mf`,path:`/app/manager`,level:1,requiredState:`org`,mainActive:2},{app:`x-app-mf`,path:`/app/editor`,level:2,requiredState:`org`},{app:`x-compute-mf`,path:`/compute`,level:1,requiredState:`org`,mainActive:2},{app:`x-data-mf`,path:`/data`,level:1,requiredState:`org`,mainActive:2},{app:`x-resource-mf`,path:`/resource`,level:1,requiredState:`org`,mainActive:2}];function J(e){let t,n=0,r=e.split(`/`).filter(e=>e.trim()!==``);return Le.forEach(e=>{let i=e.path.split(`/`).filter(e=>e.trim()!==``),a=0;for(let e=0;e<r.length&&!(e>=i.length||r[e]!==i[e]);e++)a++;a>0&&a>n&&(t=e,n=a)}),t}const Y=v(``);function X(e,t,n){t===`/`&&(t=n);let r=J(e),i=J(t);if(!r){console.assert(!1);return}if(console.info(`~~~~routeChange~~~~ ${t} -> ${e}`),!i)return;let a=r.app===i.app,o=r.path===i.path,s=r.level>=i.level;a?o?Y.value=``:Y.value=s?`inner-left`:`inner-right`:(Y.value=``,z(r.app,s))}function Re(){return!!I.get(`accessToken`)}function ze(){return!!I.get(`activeOrg`)}function Be(e,t,n){let r=Re(),i=ze(),a=J(e.path);if(!a)throw Error(`to route meta invalid`);if(a.requiredState===`auth`)if(r)if(i){let e=`/main`;return X(e,t.path,n),{path:e}}else{X(e.path,t.path,n);return}else{let e=`/passport/login`;return X(e,t.path,n),{path:e}}else if(a.requiredState===`org`)if(r)if(i){X(e.path,t.path,n);return}else{let e=`/org/joinOrCreate`;return X(e,t.path,n),{path:e}}else{let e=`/passport/login`;return X(e,t.path,n),{path:e}}else if(r)if(i){let e=`/main`;return X(e,t.path,n),{path:e}}else{let e=`/org/joinOrCreate`;return X(e,t.path,n),{path:e}}else{X(e.path,t.path,n);return}}const Ve=[`string`,`number`,`boolean`,`array`,`object`,`any`];function He(e){switch(e){case`string`:return`#5ba58c`;case`number`:return`#5b67a5`;case`boolean`:return`#5b80a5`;case`array`:return`#745ba5`;case`object`:return`#80a55b`;case`any`:return`#9e9e9e`}}function Ue(e){switch(e){case`string`:return``;case`number`:return 0;case`boolean`:return!1;case`array`:return[];case`object`:return{};case`any`:return null}}function We(e){return e.value.length<=0}function Ge(e){if(e.value.length>0)return e.value[e.value.length-1]}function Z(e,t){return!!e.value.find(e=>e===t)}function Ke(e,t){let n=e.value.findIndex(e=>e===t);n>=0&&e.value.splice(n,1),e.value.push(t)}function qe(e,t){let n=e.value.findIndex(e=>e===t);n>=0&&e.value.splice(n,1)}function Je(e){console.assert(e.value.length>0),e.value.pop()}function Ye(e){e.value=[]}function Xe(e,t,n,r,i,a){let o=N(),s=P(),c=M(),l=v(!1);T(()=>{let t;t=typeof e.value==`boolean`?e.value:c.value,l.value=t}),Te(l),De(t),ke(n),je(r),Ne(i),Fe(a);let u=j();T(()=>{u.change(l.value?`dark`:`light`)});let d=()=>{if(!We(a)){Z(a,`waitDlg`)||Je(a);return}let e=J(o.path);if(!e){console.assert(!1);return}e.level===0?navigator?.Backbutton?.goHome(()=>{},()=>{}):s.back()},f=e=>{if(e.key===`Escape`){d();return}},g=()=>{d()};h(()=>{window.addEventListener(`keydown`,f),L.on(`backbutton`,g)}),m(()=>{window.removeEventListener(`keydown`,f),L.off(`backbutton`,g)});let _=t=>{e.value=t},y=e=>{t.value=e},b=e=>{let t=e;n.value=t[0],r.value=t[1]},x=e=>{i.value=e};p(()=>{L.on(`updateDark`,_),L.on(`updateLocale`,y),L.on(`updatePermission`,b),L.on(`updateLastAppPath`,x),L.emit(`syncGlobalState`)}),m(()=>{L.off(`updateDark`,_),L.off(`updateLocale`,y),L.off(`updatePermission`,b),L.off(`updateLastAppPath`,x)})}function Ze(){let e=Ae();function t(t,n){return W(e.value,t,n??``)}return{verifyPermission:t}}function Qe(){let{locale:e,t}=k(),r=n(()=>!!window.cordova),i=A();return{sysBarAvail:r,compactWidth:n(()=>i.width.value<=1280?i.width.value+`px`:i.width.value<=1920?`768px`:`1024px`),isCurvedScreen:n(()=>!1),isMobile:()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),nameList:(n,r)=>{let i,a=n.map(e=>t(e));return i=r?`${a.join(`/`)} <${r.join(`/`)}>`:e.value===`en`?a.join(` `):a.join(``),i},sentenceOfAsk:(n,r,i)=>e.value===`en`?t(`dlg.common.ask`,{verb:te(t(n)),object:te(t(r)),name:i}):t(`dlg.common.ask`,{verb:t(n),object:t(r),name:i})}}function Q(e,t){let r=Ie(),i=n({get(){return Z(r,e)},set(t){t?Ke(r,e):qe(r,e)}}),a=e=>{t?.(e),i.value=!0};return h(()=>{L.on(e,a)}),m(()=>{L.off(e,a)}),{open:i}}var $e=l({__name:`index`,setup(e){let{t}=k(),n=v(``),i=v(``),a=v(``),o=v(``),l=v(``),u=v(``),f=v(``),p=0,m=!1,{open:h}=Q(`confirmDlg`,e=>{n.value=e.title,i.value=e.subtitle??``,a.value=e.text,o.value=e.cancel?.color??`primary`,l.value=e.cancel?.text??t(`dlg.common.cancel`),u.value=e.confirm?.color??`primary`,f.value=e.confirm?.text??t(`dlg.common.confirm`),p=e.seq,m=!1,h.value=!0}),_=()=>{h.value=!1,m||=(L.emit(`confirmDlgResult`+p,!0),!0)};return w(h,e=>{!e&&!m&&(L.emit(`confirmDlgResult`+p,!1),m=!0)}),(e,t)=>{let p=b(`v-card-text`),m=b(`v-btn`),v=b(`v-card-actions`),y=b(`v-card`),C=b(`v-dialog`);return g(),r(C,{modelValue:S(h),"onUpdate:modelValue":t[1]||=e=>d(h)?h.value=e:null,attach:``,"max-width":`600px`,transition:`dialog-top-transition`,onKeydown:[D(O(_,[`stop`,`prevent`]),[`enter`]),t[2]||=D(O(e=>h.value=!1,[`stop`,`prevent`]),[`esc`])]},{default:E(()=>[c(y,{subtitle:i.value,title:n.value},{default:E(()=>[c(p,null,{default:E(()=>[s(x(a.value),1)]),_:1}),c(v,{class:`d-flex justify-end`},{default:E(()=>[c(m,{color:o.value,variant:`text`,onClick:t[0]||=e=>h.value=!1},{default:E(()=>[s(x(l.value),1)]),_:1},8,[`color`]),c(m,{color:u.value,variant:`text`,onClick:_},{default:E(()=>[s(x(f.value),1)]),_:1},8,[`color`])]),_:1})]),_:1},8,[`subtitle`,`title`])]),_:1},8,[`modelValue`,`onKeydown`])}}}),et=l({__name:`index`,props:{open:{type:Boolean,required:!1,default:!0},zIndex:{type:Number,required:!1,default:1}},setup(e){let{backgroundColor2:s}=ne(),c=n(()=>({background:s.value,zIndex:e.zIndex})),l=0;return(n,s)=>(g(),r(t,{name:`fade`},{default:E(()=>[e.open?(g(),a(`div`,{key:d(l)?++l.value:++l,class:`x-cont`,style:f(c.value)},[...s[0]||=[o(`div`,{class:`lds-spinner`},[o(`div`),o(`div`),o(`div`),o(`div`),o(`div`),o(`div`),o(`div`),o(`div`),o(`div`),o(`div`),o(`div`),o(`div`)],-1)]],4)):i(`v-if`,!0)]),_:1}))}}),$=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},tt=$(et,[[`__scopeId`,`data-v-x-essential-lib-c3545c8d`]]),nt=$(l({__name:`item`,props:{id:{type:Number,required:!0},type:{type:null,required:!0},text:{type:String,required:!0},timeout:{type:Number,required:!1,default:5e3}},emits:[`timeout`],setup(e,{emit:t}){let a=n(()=>({width:`calc(100% - 64px)`,overflowWrap:`break-word`})),s=n(()=>{switch(e.type){case`success`:return`mdi-check-circle`;case`info`:return`mdi-information`;case`error`:return`mdi-close-circle`;case`warning`:return`mdi-alert-circle`;default:return``}}),l=v(!0),u=t;return h(()=>{setTimeout(()=>{u(`timeout`,e.id)},e.timeout)}),w(l,t=>{t||u(`timeout`,e.id)}),(t,n)=>{let l=b(`v-icon`),d=b(`v-sheet`);return g(),r(d,{class:`x-item d-flex align-center py-2 mb-2`,color:e.type,elevation:1},{default:E(()=>[s.value?(g(),r(l,{key:0,class:`mx-1`,icon:s.value},null,8,[`icon`])):i(`v-if`,!0),o(`div`,{style:f(a.value)},x(e.text),5),c(l,{class:`mx-1`,icon:`mdi-close`,onClick:n[0]||=t=>u(`timeout`,e.id)})]),_:1},8,[`color`])}}}),[[`__scopeId`,`data-v-x-essential-lib-cfcda9d9`]]),rt=$(l({__name:`index`,setup(t){let n=v([]);h(()=>{L.on(`message`,i)}),m(()=>{L.off(`message`,i)});let i=e=>{let{type:t,text:n,timeout:r}=e;c(t,n,r)},o=e=>{l(e)},s=0,c=(e,t,r)=>{let i=s++;n.value.push({id:i,type:e,text:t,timeout:r})},l=e=>{let t=n.value.findIndex(t=>t.id===e);t>=0&&n.value.splice(t,1)};return(t,i)=>(g(),a(`div`,{class:`x-cont d-flex flex-column-reverse align-center`,onClick:i[0]||=O(()=>{},[`stop`])},[(g(!0),a(e,null,y(n.value,e=>(g(),r(nt,{id:e.id,key:e.id,text:e.text,timeout:e.timeout,type:e.type,onTimeout:o},null,8,[`id`,`text`,`timeout`,`type`]))),128))]))}}),[[`__scopeId`,`data-v-x-essential-lib-b973907d`]]),it=l({__name:`index`,setup(e){let{t}=k(),n=v(``),i=v(``),a=v(0),o=v(),l=v(-1/0),u=v(1/0),f=v(1),p=0,m=!1,h=C(`target`),{open:_}=Q(`numberDlg`,async e=>{n.value=e.title,i.value=e.subtitle??``,a.value=e.value,o.value=e.precision,l.value=e.min,u.value=e.max,f.value=e.step,p=e.seq,m=!1,_.value=!0,await R(()=>!!h.value),h.value.focus()}),y=v(!1),T=()=>{_.value=!1,m||=(L.emit(`numberDlgResult${p}`,a.value),!0)};return w(_,e=>{!e&&!m&&(L.emit(`numberDlgResult${p}`,void 0),m=!0)}),(e,i)=>{let p=b(`v-number-input`),m=b(`v-btn`),v=b(`v-card-actions`),C=b(`v-form`),w=b(`v-card`),k=b(`v-dialog`);return g(),r(k,{modelValue:S(_),"onUpdate:modelValue":i[3]||=e=>d(_)?_.value=e:null,attach:``,"max-width":`600px`,transition:`dialog-top-transition`,onKeydown:i[4]||=D(O(e=>_.value=!1,[`stop`,`prevent`]),[`esc`])},{default:E(()=>[c(w,{title:n.value},{default:E(()=>[c(C,{modelValue:y.value,"onUpdate:modelValue":i[2]||=e=>y.value=e,class:`mx-3`,onSubmit:O(T,[`prevent`])},{default:E(()=>[c(p,{ref_key:`target`,ref:h,modelValue:a.value,"onUpdate:modelValue":i[0]||=e=>a.value=e,"control-variant":`stacked`,max:u.value,min:l.value,precision:o.value,step:f.value},null,8,[`modelValue`,`max`,`min`,`precision`,`step`]),c(v,{class:`d-flex justify-end`},{default:E(()=>[c(m,{color:`primary`,variant:`text`,onClick:i[1]||=e=>_.value=!1},{default:E(()=>[s(x(S(t)(`dlg.common.cancel`)),1)]),_:1}),c(m,{color:`primary`,disabled:!y.value,type:`submit`,variant:`text`},{default:E(()=>[s(x(S(t)(`dlg.common.confirm`)),1)]),_:1},8,[`disabled`])]),_:1})]),_:1},8,[`modelValue`])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}}}),at=l({__name:`index`,setup(e){let{t}=k(),n=v(``),a=v(``),o=v(``),l=v(``),u=v(``),f=v(),p=v(``),m=v(``),h=v(``),_=v(``),y=v(``),T=0,A=!1,j=C(`target`),{open:M}=Q(`promptDlg`,async e=>{n.value=e.title,a.value=e.subtitle??``,o.value=e.text,l.value=e.label,u.value=e.placeholder,f.value=e.rules,p.value=e.value,m.value=e.cancel?.color??`primary`,h.value=e.cancel?.text??t(`dlg.common.cancel`),_.value=e.confirm?.color??`primary`,y.value=e.confirm?.text??t(`dlg.common.confirm`),T=e.seq,A=!1,M.value=!0,await R(()=>!!j.value),j.value.focus()}),N=v(!1),P=()=>{M.value=!1,A||=(L.emit(`promptDlgResult`+T,p.value??``),!0)};return w(M,e=>{!e&&!A&&(L.emit(`promptDlgResult`+T,void 0),A=!0)}),(e,t)=>{let v=b(`v-card-text`),C=b(`v-text-field`),w=b(`v-btn`),T=b(`v-card-actions`),k=b(`v-form`),A=b(`v-card`),F=b(`v-dialog`);return g(),r(F,{modelValue:S(M),"onUpdate:modelValue":t[3]||=e=>d(M)?M.value=e:null,attach:``,"max-width":`600px`,transition:`dialog-top-transition`,onKeydown:t[4]||=D(O(e=>M.value=!1,[`stop`,`prevent`]),[`esc`])},{default:E(()=>[c(A,{subtitle:a.value,title:n.value},{default:E(()=>[o.value?(g(),r(v,{key:0},{default:E(()=>[s(x(o.value),1)]),_:1})):i(`v-if`,!0),c(k,{modelValue:N.value,"onUpdate:modelValue":t[2]||=e=>N.value=e,class:`mx-3`,onSubmit:O(P,[`prevent`])},{default:E(()=>[c(C,{ref_key:`target`,ref:j,modelValue:p.value,"onUpdate:modelValue":t[0]||=e=>p.value=e,label:l.value,placeholder:u.value,rules:f.value},null,8,[`modelValue`,`label`,`placeholder`,`rules`]),c(T,{class:`d-flex justify-end`},{default:E(()=>[c(w,{color:m.value,variant:`text`,onClick:t[1]||=e=>M.value=!1},{default:E(()=>[s(x(h.value),1)]),_:1},8,[`color`]),c(w,{color:_.value,disabled:!N.value,type:`submit`,variant:`text`},{default:E(()=>[s(x(y.value),1)]),_:1},8,[`color`,`disabled`])]),_:1})]),_:1},8,[`modelValue`])]),_:1},8,[`subtitle`,`title`])]),_:1},8,[`modelValue`])}}}),ot=l({__name:`index`,props:{show:{type:Boolean,required:!0},top:{type:Number,required:!0},left:{type:Number,required:!0}},setup(t){let r=n(()=>({position:`absolute`,backgroundColor:`#ff00cc`,width:`100%`,height:`1px`,top:`${t.top}px`,left:`0px`,zIndex:9999})),o=n(()=>({position:`absolute`,backgroundColor:`#ff00cc`,width:`1px`,height:`100%`,top:`0px`,left:`${t.left}px`,zIndex:9999}));return(n,s)=>(g(),a(e,null,[t.show?(g(),a(`span`,{key:0,style:f(r.value)},null,4)):i(`v-if`,!0),t.show?(g(),a(`span`,{key:1,style:f(o.value)},null,4)):i(`v-if`,!0)],64))}});const st={class:`ma-auto`},ct={class:`w-100 h-100 d-flex align-center justify-center`},lt={class:`text-body-large`};var ut=l({__name:`index`,setup(e){let{t}=k(),n=v(``),i=e=>{n.value=e.text??t(`dlg.common.responding`),s.value=!0},a=()=>{s.value=!1},{open:s}=Q(`waitDlg`,i);return h(()=>{L.on(`closeWaitDlg`,a)}),m(()=>{L.off(`closeWaitDlg`,a)}),(e,t)=>{let i=b(`v-card`),a=b(`v-dialog`);return g(),r(a,{modelValue:S(s),"onUpdate:modelValue":t[0]||=e=>d(s)?s.value=e:null,attach:``,fullscreen:``,"no-click-animation":``,persistent:``},{default:E(()=>[o(`div`,st,[c(i,{height:`80px`,loading:``,width:`300px`},{default:E(()=>[o(`div`,ct,[o(`span`,lt,x(n.value),1)])]),_:1})])]),_:1},8,[`modelValue`])}}});const dt=e=>{e.component(`XConfirmDlg`,$e),e.component(`XLoading`,tt),e.component(`XMessage`,rt),e.component(`XNumberDlg`,it),e.component(`XPromptDlg`,at),e.component(`XRefLine`,ot),e.component(`XWaitDlg`,ut)};async function ft(e){if(e===`en`)return(await import(`./i18n-en.f0pmulir.js`).then(e=>e.t)).default;if(e===`zhHans`)return(await import(`./i18n-zhHans.ex0oq1u6.js`).then(e=>e.t)).default;throw Error(`invalid locale=${e}`)}var pt={install:dt};export{xe as Permission,Ke as addView,z as appAppear,Ye as clearViews,ge as closeWaitDlg,re as createAxios,pt as default,qe as delView,L as eventBus,He as getTypeColor,Ue as getTypeDefault,le as globalObjects,Z as hasView,Ee as injectDark,Pe as injectLastAppPath,Oe as injectLocale,Me as injectPermissionChecksum,Ae as injectPermissionObjects,Ie as injectViews,We as isEmpty,U as isExist,Ge as lastView,ft as loadLocaleMessageEssential,J as matchRouteMeta,_e as messageError,ve as messageInfo,ye as messageSuccess,be as messageWarning,Be as onBeforeEach,fe as openConfirmDlg,pe as openNumberDlg,me as openPromptDlg,he as openWaitDlg,Je as popView,Te as provideDark,Ne as provideLastAppPath,De as provideLocale,je as providePermissionChecksum,ke as providePermissionObjects,Fe as provideViews,Y as routeTransName,Ve as types,ne as useColor,Xe as useMicroApp,Ze as usePermission,Qe as useSystem,Q as useViewStack,W as verifyPermission,ue as waitMs,R as waitUtil};
|