@vtj/renderer 0.14.5 → 0.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +491 -497
- package/package.json +5 -5
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Base as
|
|
2
|
-
import { isUrl as te, url as
|
|
1
|
+
import { Base as Je, BUILT_IN_COMPONENTS as Ke, ProjectModel as U, HistoryModel as $e } from "@vtj/core";
|
|
2
|
+
import { isUrl as te, url as k, dedupArray as Ge, isString as I, isFunction as q, logger as O, storage as Q, cookie as X, toArray as ge, unRSA as ye, delay as se, createRequest as be, jsonp as Ee, merge as ze, pathToRegexp as Ve, pathToRegexpMatch as We, formDataToJson as Qe, Queue as Xe, cloneDeep as ve, camelCase as C, upperFirst as Ye, pick as Ze, request as ne, loadScript as _e, Storage as et, mapToObject as ue } from "@vtj/utils";
|
|
3
3
|
import * as K from "vue";
|
|
4
|
-
import { inject as
|
|
5
|
-
import { useRoute as
|
|
4
|
+
import { inject as je, defineComponent as Re, h as re, ref as oe, watchEffect as tt, defineAsyncComponent as we } from "vue";
|
|
5
|
+
import { useRoute as Pe } from "vue-router";
|
|
6
6
|
/**!
|
|
7
7
|
* Copyright (c) 2026, VTJ.PRO All rights reserved.
|
|
8
8
|
* @name @vtj/renderer
|
|
9
9
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
10
|
-
* @version 0.14.
|
|
10
|
+
* @version 0.14.6
|
|
11
11
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
12
12
|
*/
|
|
13
|
-
const T = "0.14.
|
|
13
|
+
const T = "0.14.6";
|
|
14
14
|
var w = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(w || {});
|
|
15
|
-
const
|
|
15
|
+
const Se = [
|
|
16
16
|
"$el",
|
|
17
17
|
"$emit",
|
|
18
18
|
"$nextTick",
|
|
@@ -24,7 +24,7 @@ const be = [
|
|
|
24
24
|
"$props",
|
|
25
25
|
"$options",
|
|
26
26
|
"$forceUpdate"
|
|
27
|
-
],
|
|
27
|
+
], ys = [
|
|
28
28
|
"beforeCreate",
|
|
29
29
|
"created",
|
|
30
30
|
"beforeMount",
|
|
@@ -38,7 +38,7 @@ const be = [
|
|
|
38
38
|
"renderTriggered",
|
|
39
39
|
"activated",
|
|
40
40
|
"deactivated"
|
|
41
|
-
],
|
|
41
|
+
], st = [
|
|
42
42
|
"vIf",
|
|
43
43
|
"vElseIf",
|
|
44
44
|
"vElse",
|
|
@@ -47,7 +47,7 @@ const be = [
|
|
|
47
47
|
"vFor",
|
|
48
48
|
"vBind",
|
|
49
49
|
"vHtml"
|
|
50
|
-
],
|
|
50
|
+
], nt = {
|
|
51
51
|
String,
|
|
52
52
|
Number,
|
|
53
53
|
Boolean,
|
|
@@ -55,9 +55,9 @@ const be = [
|
|
|
55
55
|
Object,
|
|
56
56
|
Function,
|
|
57
57
|
Date
|
|
58
|
-
}, x = "VtjPage", N = "VtjHomepage",
|
|
58
|
+
}, x = "VtjPage", N = "VtjHomepage", rt = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot,svg".split(
|
|
59
59
|
","
|
|
60
|
-
),
|
|
60
|
+
), ot = "component,slot".split(","), vs = [
|
|
61
61
|
"h",
|
|
62
62
|
"t",
|
|
63
63
|
"t",
|
|
@@ -77,7 +77,7 @@ const be = [
|
|
|
77
77
|
"p",
|
|
78
78
|
"r",
|
|
79
79
|
"o"
|
|
80
|
-
].join(""),
|
|
80
|
+
].join(""), _s = {
|
|
81
81
|
auth: [
|
|
82
82
|
"h",
|
|
83
83
|
"t",
|
|
@@ -146,53 +146,53 @@ function G(n) {
|
|
|
146
146
|
function z(n) {
|
|
147
147
|
return /\.js$/.test(n);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function it(n) {
|
|
150
150
|
return /\.json$/.test(n);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function ws(n) {
|
|
153
153
|
return n.map(
|
|
154
|
-
(e) => `<script src="${
|
|
154
|
+
(e) => `<script src="${k.append(e, { v: T })}"><\/script>`
|
|
155
155
|
).join("");
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Ss(n = []) {
|
|
158
158
|
return n.map(
|
|
159
|
-
(e) => `<link rel="stylesheet" href="${
|
|
159
|
+
(e) => `<link rel="stylesheet" href="${k.append(e, { v: T })}" />`
|
|
160
160
|
).join("");
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function at(n, e = !1) {
|
|
163
163
|
return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
const s = n.filter((p) => !!p.enabled), r = [],
|
|
165
|
+
function ct(n, e, t = !1) {
|
|
166
|
+
const s = n.filter((p) => !!p.enabled), r = [], o = [], a = [], i = [], l = {}, c = {}, f = [], u = {};
|
|
167
167
|
return s.forEach(
|
|
168
168
|
({ urls: p, assetsUrl: h, library: d, assetsLibrary: m, localeLibrary: g }) => {
|
|
169
169
|
p?.forEach((y) => {
|
|
170
|
-
z(y) && r.push(
|
|
171
|
-
}), d && (
|
|
170
|
+
z(y) && r.push(at(y, t)), G(y) && o.push(y);
|
|
171
|
+
}), d && (i.push(d), l[d] = B(p || [], e), g && (c[d] = g)), h && a.push(h), m && f.push(m), d && m && (u[m] = d);
|
|
172
172
|
}
|
|
173
173
|
), {
|
|
174
174
|
scripts: B(r, e),
|
|
175
|
-
css: B(
|
|
175
|
+
css: B(o, e),
|
|
176
176
|
materials: B(a, e),
|
|
177
|
-
libraryExports:
|
|
178
|
-
materialExports:
|
|
177
|
+
libraryExports: i,
|
|
178
|
+
materialExports: Ge(f),
|
|
179
179
|
materialMapLibrary: u,
|
|
180
180
|
libraryMap: l,
|
|
181
181
|
libraryLocaleMap: c
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function lt(n, e) {
|
|
185
185
|
const { name: t, parent: s, alias: r } = n;
|
|
186
186
|
return s ? e[s]?.[r || t] : e[r || t];
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function ut(n = []) {
|
|
189
189
|
const e = n.filter((s) => G(s)), t = n.filter((s) => z(s));
|
|
190
190
|
return {
|
|
191
191
|
css: e,
|
|
192
192
|
js: t
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function ft(n, e) {
|
|
196
196
|
const t = (c) => {
|
|
197
197
|
const f = [];
|
|
198
198
|
let u = 0;
|
|
@@ -220,15 +220,15 @@ function ht(n, e) {
|
|
|
220
220
|
}), u++;
|
|
221
221
|
else if (c[u] === "{") {
|
|
222
222
|
const S = u + 1;
|
|
223
|
-
let
|
|
224
|
-
for (u++; u < c.length &&
|
|
225
|
-
c[u] === "{" ?
|
|
226
|
-
const V = c.substring(y, u),
|
|
223
|
+
let A = 1;
|
|
224
|
+
for (u++; u < c.length && A > 0; )
|
|
225
|
+
c[u] === "{" ? A++ : c[u] === "}" && A--, u++;
|
|
226
|
+
const V = c.substring(y, u), P = c.substring(S, u - 1);
|
|
227
227
|
f.push({
|
|
228
228
|
type: v ? "keyframes" : "at-rule",
|
|
229
229
|
rule: _,
|
|
230
230
|
content: V,
|
|
231
|
-
inner:
|
|
231
|
+
inner: P
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
234
|
continue;
|
|
@@ -260,7 +260,7 @@ function ht(n, e) {
|
|
|
260
260
|
}, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (f, u, p) => {
|
|
261
261
|
const h = u.trim(), d = p.trim();
|
|
262
262
|
return h ? `${h}[${e}] ${d}` : d;
|
|
263
|
-
}),
|
|
263
|
+
}), o = (c) => {
|
|
264
264
|
const f = c.trim();
|
|
265
265
|
if (!f || f.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(f) || s(f))
|
|
266
266
|
return f;
|
|
@@ -270,7 +270,7 @@ function ht(n, e) {
|
|
|
270
270
|
return d ? `${d}[${e}]${h}` : f;
|
|
271
271
|
}
|
|
272
272
|
return `${f}[${e}]`;
|
|
273
|
-
}, a = (c) => r(c).split(",").map((u) =>
|
|
273
|
+
}, a = (c) => r(c).split(",").map((u) => o(u)).filter((u) => u.trim()).join(", "), i = (c) => c.map((f) => {
|
|
274
274
|
switch (f.type) {
|
|
275
275
|
case "simple-at-rule":
|
|
276
276
|
return f.content;
|
|
@@ -278,7 +278,7 @@ function ht(n, e) {
|
|
|
278
278
|
return f.content;
|
|
279
279
|
case "at-rule":
|
|
280
280
|
try {
|
|
281
|
-
const p = t(f.inner), h =
|
|
281
|
+
const p = t(f.inner), h = i(p);
|
|
282
282
|
return `${f.rule} { ${h} }`;
|
|
283
283
|
} catch {
|
|
284
284
|
return f.content;
|
|
@@ -294,7 +294,7 @@ function ht(n, e) {
|
|
|
294
294
|
}).filter((f) => f.trim()).join(" "), l = (c) => c.replace(/\s*{\s*/g, " { ").replace(/\s*}\s*/g, " } ").replace(/\s*;\s*/g, "; ").replace(/\s*,\s*/g, ", ").replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "").replace(/\s*}\s*}/g, " } }").trim();
|
|
295
295
|
try {
|
|
296
296
|
const c = n.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g, "").replace(/^\s+|\s+$/gm, "").replace(/\n\s*\n/g, `
|
|
297
|
-
`), f = t(c), u =
|
|
297
|
+
`), f = t(c), u = i(f);
|
|
298
298
|
return l(u);
|
|
299
299
|
} catch (c) {
|
|
300
300
|
return console.error("CSS scoping failed:", c), console.error("Input CSS:", n), n.replace(/\/\*[\s\S]*?\*\//g, "").replace(
|
|
@@ -306,37 +306,37 @@ function ht(n, e) {
|
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
const
|
|
310
|
-
function
|
|
309
|
+
const pt = 750;
|
|
310
|
+
function dt(n, e, t) {
|
|
311
311
|
let s;
|
|
312
312
|
typeof n < "u" ? s = n.innerWidth || n.document.documentElement.clientWidth : (console.warn("无法获取屏幕宽度,使用默认值375"), s = 375);
|
|
313
|
-
const r = t ||
|
|
313
|
+
const r = t || pt;
|
|
314
314
|
return e * s / r;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
let t = !1, s = !1, r = !1,
|
|
316
|
+
function ht(n, e) {
|
|
317
|
+
let t = !1, s = !1, r = !1, o = "";
|
|
318
318
|
for (let a = 0; a < e.length; a++) {
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
319
|
+
const i = e[a];
|
|
320
|
+
if (i === "'" && !s && !r ? t = !t : i === '"' && !t && !r ? s = !s : e.substr(a, 4).toLowerCase() === "url(" && !t && !s ? r = !0 : i === ")" && r && (r = !1), !t && !s && !r) {
|
|
321
321
|
const l = e.substr(a).match(/^(-?\d+(?:\.\d+)?)\s*rpx/);
|
|
322
322
|
if (l) {
|
|
323
|
-
const c = l[1], f = parseFloat(c), p = `${
|
|
324
|
-
|
|
323
|
+
const c = l[1], f = parseFloat(c), p = `${dt(n, f).toFixed(6).replace(/\.?0+$/, "")}px`;
|
|
324
|
+
o += p, a += l[0].length - 1;
|
|
325
325
|
continue;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
o += i;
|
|
329
329
|
}
|
|
330
|
-
return
|
|
330
|
+
return o;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function Ce(n) {
|
|
333
333
|
return I(n) ? n : JSON.stringify(n);
|
|
334
334
|
}
|
|
335
335
|
function fe(n, e, t, s = !1) {
|
|
336
|
-
const r = n.CSSStyleSheet,
|
|
336
|
+
const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, a = n.__uniConfig ? ht(n, t) : t, i = s ? ft(a, o) : a;
|
|
337
337
|
if (r.prototype.replaceSync) {
|
|
338
338
|
const l = new r();
|
|
339
|
-
l.id = e, l.replaceSync(
|
|
339
|
+
l.id = e, l.replaceSync(i);
|
|
340
340
|
const c = n.document, f = c.adoptedStyleSheets, u = Array.from(f).filter(
|
|
341
341
|
(p) => p.id !== e
|
|
342
342
|
);
|
|
@@ -344,10 +344,10 @@ function fe(n, e, t, s = !1) {
|
|
|
344
344
|
} else {
|
|
345
345
|
const l = n.document;
|
|
346
346
|
let c = l.getElementById(e);
|
|
347
|
-
c ? c.innerHTML =
|
|
347
|
+
c ? c.innerHTML = i : (c = l.createElement("style"), c.id = e, c.innerHTML = i, l.head.appendChild(c));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function $s(n) {
|
|
351
351
|
const e = n.adoptedStyleSheets || [];
|
|
352
352
|
let t = "";
|
|
353
353
|
if (e.forEach((s) => {
|
|
@@ -363,11 +363,11 @@ function js(n) {
|
|
|
363
363
|
s.textContent = t, n.head.appendChild(s);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
async function
|
|
366
|
+
async function mt(n, e) {
|
|
367
367
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
|
368
368
|
t && fe(window, n, t);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Ae(n, e = window) {
|
|
371
371
|
const t = e.document, s = e.document.head;
|
|
372
372
|
for (const r of n)
|
|
373
373
|
if (!t.getElementById(r)) {
|
|
@@ -375,28 +375,28 @@ function ke(n, e = window) {
|
|
|
375
375
|
a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
async function
|
|
378
|
+
async function Ie(n, e, t = window) {
|
|
379
379
|
const s = t.document, r = t.document.head;
|
|
380
|
-
let
|
|
381
|
-
return
|
|
380
|
+
let o = t[e];
|
|
381
|
+
return o ? o.default || o : new Promise((a, i) => {
|
|
382
382
|
for (const l of n) {
|
|
383
383
|
const c = s.createElement("script");
|
|
384
384
|
c.src = l, c.onload = () => {
|
|
385
|
-
|
|
385
|
+
o = t[e], o ? a(o.default || o) : i(null);
|
|
386
386
|
}, c.onerror = (f) => {
|
|
387
|
-
|
|
387
|
+
i(f);
|
|
388
388
|
}, r.appendChild(c);
|
|
389
389
|
}
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function gt(n) {
|
|
393
393
|
return q(n) && Object.getOwnPropertyNames(n.prototype || {}).length === 0 || q(n?.install);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
return
|
|
395
|
+
function yt(n) {
|
|
396
|
+
return ot.includes(n);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return
|
|
398
|
+
function vt(n) {
|
|
399
|
+
return rt.includes(n);
|
|
400
400
|
}
|
|
401
401
|
function D(n = window) {
|
|
402
402
|
const e = window?.Mock;
|
|
@@ -405,51 +405,51 @@ function D(n = window) {
|
|
|
405
405
|
if (t && window)
|
|
406
406
|
return window.Mock = t, t;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function bs(n, e, t) {
|
|
409
409
|
Object.assign(e.meta, t.meta);
|
|
410
410
|
const s = n?._container;
|
|
411
411
|
t?.type === "page" && s.classList.add("is-page"), t?.pure && s.classList.add("is-pure");
|
|
412
412
|
}
|
|
413
413
|
function H(n, e, t = !1, s = !1, r = !1) {
|
|
414
414
|
try {
|
|
415
|
-
const
|
|
416
|
-
|
|
415
|
+
const o = ['"use strict";', "var __self = arguments[0];"];
|
|
416
|
+
o.push("return ");
|
|
417
417
|
let a = (n.value || "").trim();
|
|
418
|
-
r || (a = a.replace(/this(\W|$)/g, (l, c) => `__self${c}`)), a =
|
|
418
|
+
r || (a = a.replace(/this(\W|$)/g, (l, c) => `__self${c}`)), a = o.join(`
|
|
419
419
|
`) + a;
|
|
420
|
-
const
|
|
420
|
+
const i = r ? `
|
|
421
421
|
${a}
|
|
422
422
|
` : `with(${t ? "{}" : "$scope || {}"}) { ${a} }`;
|
|
423
|
-
return new Function("$scope",
|
|
424
|
-
} catch (
|
|
425
|
-
if (O.error("parseExpression.error",
|
|
426
|
-
throw
|
|
423
|
+
return new Function("$scope", i)(e);
|
|
424
|
+
} catch (o) {
|
|
425
|
+
if (O.error("parseExpression.error", o, n, e?.__self ?? e), s)
|
|
426
|
+
throw o;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
const
|
|
431
|
-
if (typeof
|
|
429
|
+
function j(n, e, t = !1, s = !1, r = !1) {
|
|
430
|
+
const o = H(n, e, t, s, r);
|
|
431
|
+
if (typeof o != "function" && (O.error(
|
|
432
432
|
"parseFunction.error",
|
|
433
433
|
"not a function",
|
|
434
434
|
n,
|
|
435
435
|
e?.__self ?? e
|
|
436
436
|
), s))
|
|
437
437
|
throw new Error(`"${n.value}" not a function`);
|
|
438
|
-
return
|
|
438
|
+
return o;
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function E(n) {
|
|
441
441
|
return n && n.type === "JSExpression";
|
|
442
442
|
}
|
|
443
443
|
function b(n) {
|
|
444
444
|
return typeof n == "object" && n && n.type === "JSFunction";
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
return
|
|
446
|
+
function _t(n) {
|
|
447
|
+
return E(n) || b(n);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
return
|
|
449
|
+
function Es(n) {
|
|
450
|
+
return _t(n) ? n.value : JSON.stringify(n);
|
|
451
451
|
}
|
|
452
|
-
const
|
|
452
|
+
const wt = {
|
|
453
453
|
session: !1,
|
|
454
454
|
authKey: "Authorization",
|
|
455
455
|
storageKey: "ACCESS_STORAGE",
|
|
@@ -462,7 +462,7 @@ const bt = {
|
|
|
462
462
|
noPermissionMessage: "无权限访问该页面",
|
|
463
463
|
appName: "",
|
|
464
464
|
statusKey: "code"
|
|
465
|
-
},
|
|
465
|
+
}, Fe = Symbol("access");
|
|
466
466
|
class pe {
|
|
467
467
|
options;
|
|
468
468
|
data = null;
|
|
@@ -470,7 +470,7 @@ class pe {
|
|
|
470
470
|
interceptResponse = !0;
|
|
471
471
|
isTipShowing = !1;
|
|
472
472
|
constructor(e) {
|
|
473
|
-
this.options = Object.assign({},
|
|
473
|
+
this.options = Object.assign({}, wt, e), this.loadData();
|
|
474
474
|
}
|
|
475
475
|
enableIntercept() {
|
|
476
476
|
this.interceptResponse = !0;
|
|
@@ -483,11 +483,11 @@ class pe {
|
|
|
483
483
|
this.mode = t, s && this.mode !== w.Design && this.setGuard(s), r && this.setRequest(r);
|
|
484
484
|
}
|
|
485
485
|
login(e) {
|
|
486
|
-
const { storageKey: t, storagePrefix: s, session: r, authKey:
|
|
486
|
+
const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
|
|
487
487
|
this.setData(e), this.data && (Q.save(t, e, {
|
|
488
488
|
type: "local",
|
|
489
489
|
prefix: s
|
|
490
|
-
}), r && X.set(
|
|
490
|
+
}), r && X.set(o, this.data.token));
|
|
491
491
|
}
|
|
492
492
|
clear() {
|
|
493
493
|
const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
|
|
@@ -507,14 +507,14 @@ class pe {
|
|
|
507
507
|
}
|
|
508
508
|
can(e) {
|
|
509
509
|
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
|
510
|
-
return typeof e == "function" ? e(s) :
|
|
510
|
+
return typeof e == "function" ? e(s) : ge(e).every((o) => s[o] || s[t + "." + o]);
|
|
511
511
|
}
|
|
512
512
|
some(e) {
|
|
513
513
|
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
|
514
|
-
return
|
|
514
|
+
return ge(e).some((o) => s[o] || s[t + "." + o]);
|
|
515
515
|
}
|
|
516
516
|
install(e) {
|
|
517
|
-
e.config.globalProperties.$access = this, e.provide(
|
|
517
|
+
e.config.globalProperties.$access = this, e.provide(Fe, this);
|
|
518
518
|
}
|
|
519
519
|
isAuthPath(e) {
|
|
520
520
|
const { auth: t, isAuth: s } = this.options;
|
|
@@ -535,7 +535,7 @@ class pe {
|
|
|
535
535
|
setData(e) {
|
|
536
536
|
const { privateKey: t } = this.options;
|
|
537
537
|
if (Array.isArray(e) && t) {
|
|
538
|
-
const s = e.map((r) =>
|
|
538
|
+
const s = e.map((r) => ye(r, t));
|
|
539
539
|
try {
|
|
540
540
|
this.data = JSON.parse(s.join(""));
|
|
541
541
|
} catch (r) {
|
|
@@ -545,7 +545,7 @@ class pe {
|
|
|
545
545
|
}
|
|
546
546
|
if (typeof e == "string")
|
|
547
547
|
try {
|
|
548
|
-
const s = t ?
|
|
548
|
+
const s = t ? ye(e, t) : e;
|
|
549
549
|
s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
|
|
550
550
|
} catch (s) {
|
|
551
551
|
console.warn(s);
|
|
@@ -619,22 +619,22 @@ class pe {
|
|
|
619
619
|
);
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
return
|
|
622
|
+
function St() {
|
|
623
|
+
return je(Fe, null);
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function js(n = {}) {
|
|
626
626
|
const {
|
|
627
627
|
notify: e,
|
|
628
628
|
loading: t,
|
|
629
629
|
settings: s = {},
|
|
630
630
|
Startup: r,
|
|
631
|
-
access:
|
|
631
|
+
access: o,
|
|
632
632
|
useTitle: a,
|
|
633
|
-
alert:
|
|
633
|
+
alert: i
|
|
634
634
|
} = n;
|
|
635
635
|
let l = null;
|
|
636
636
|
return {
|
|
637
|
-
request:
|
|
637
|
+
request: be({
|
|
638
638
|
settings: {
|
|
639
639
|
type: "form",
|
|
640
640
|
validSuccess: !0,
|
|
@@ -654,19 +654,19 @@ function Cs(n = {}) {
|
|
|
654
654
|
...s
|
|
655
655
|
}
|
|
656
656
|
}),
|
|
657
|
-
jsonp:
|
|
657
|
+
jsonp: Ee,
|
|
658
658
|
notify: e,
|
|
659
659
|
loading: t,
|
|
660
660
|
useTitle: a,
|
|
661
|
-
alert:
|
|
661
|
+
alert: i,
|
|
662
662
|
startupComponent: r,
|
|
663
|
-
access:
|
|
663
|
+
access: o ? new pe({ alert: i, ...o }) : void 0
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Rs(n = {}) {
|
|
667
667
|
return new pe(n);
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function $t(n, e) {
|
|
670
670
|
const { jsonp: t, request: s } = e;
|
|
671
671
|
if (n.method === "jsonp")
|
|
672
672
|
return (r = {}) => t(n.url, {
|
|
@@ -674,7 +674,7 @@ function jt(n, e) {
|
|
|
674
674
|
query: r
|
|
675
675
|
});
|
|
676
676
|
{
|
|
677
|
-
const r = n.headers ? H(n.headers, {}, !0) : void 0,
|
|
677
|
+
const r = n.headers ? H(n.headers, {}, !0) : void 0, o = {
|
|
678
678
|
url: n.url,
|
|
679
679
|
method: n.method,
|
|
680
680
|
settings: {
|
|
@@ -682,72 +682,72 @@ function jt(n, e) {
|
|
|
682
682
|
headers: r
|
|
683
683
|
}
|
|
684
684
|
};
|
|
685
|
-
return (a,
|
|
685
|
+
return (a, i) => (delete o.data, s.send(ze(o, i || {}, { data: a })));
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function bt(n, e) {
|
|
689
689
|
const { metaQuery: t } = e;
|
|
690
690
|
if (!t) return;
|
|
691
691
|
const { code: s, queryCode: r } = n;
|
|
692
|
-
return (
|
|
692
|
+
return (o, a) => {
|
|
693
693
|
if (!t) {
|
|
694
694
|
console.warn("adapter.metaQuery is not defined!");
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
697
|
-
return t(s, r,
|
|
697
|
+
return t(s, r, o, a);
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function Et(n = [], e = [], t) {
|
|
701
701
|
const s = {};
|
|
702
702
|
for (const r of n) {
|
|
703
|
-
const
|
|
704
|
-
s[r.id] =
|
|
703
|
+
const o = $t(r, t);
|
|
704
|
+
s[r.id] = o, s[r.name] = o;
|
|
705
705
|
}
|
|
706
706
|
for (const r of e)
|
|
707
|
-
s[r.id] =
|
|
707
|
+
s[r.id] = bt(r, t);
|
|
708
708
|
return s;
|
|
709
709
|
}
|
|
710
|
-
async function
|
|
710
|
+
async function jt(n = [], e = window) {
|
|
711
711
|
const t = D(e);
|
|
712
|
-
t && (
|
|
712
|
+
t && (ke(e), n.forEach((s) => Pt(t, s)));
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
const t = b(n.mockTemplate) && n.mockTemplate.value ?
|
|
714
|
+
function Rt(n, e = window) {
|
|
715
|
+
const t = b(n.mockTemplate) && n.mockTemplate.value ? j(n.mockTemplate, {}, !0) : void 0, s = D(e);
|
|
716
716
|
return async (...r) => {
|
|
717
|
-
let
|
|
717
|
+
let o = {};
|
|
718
718
|
if (t)
|
|
719
719
|
try {
|
|
720
|
-
|
|
720
|
+
o = await t.apply(t, r);
|
|
721
721
|
} catch (a) {
|
|
722
722
|
O.warn("模拟数据模版异常", a);
|
|
723
723
|
}
|
|
724
|
-
return s?.mock(
|
|
724
|
+
return s?.mock(o);
|
|
725
725
|
};
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function Pt(n, e) {
|
|
728
728
|
if (!e.mock) return;
|
|
729
729
|
const { url: t, mockTemplate: s } = e;
|
|
730
730
|
if (t && s)
|
|
731
731
|
try {
|
|
732
|
-
const r = te(t) ? new URL(t).pathname : t,
|
|
733
|
-
n.mock(
|
|
734
|
-
const c =
|
|
732
|
+
const r = te(t) ? new URL(t).pathname : t, o = Ve(`(.*)${r}(.*)`), a = We(r, { decode: decodeURIComponent }), i = H(s, {}, !0);
|
|
733
|
+
n.mock(o, (l) => {
|
|
734
|
+
const c = k.parse(l.url) || {}, f = l.body instanceof FormData ? Qe(l.body) : l.body, u = te(l.url) ? new URL(l.url).pathname : l.url.split("?")[0], p = a(u)?.params;
|
|
735
735
|
Object.assign(l, { data: f, params: p, query: c });
|
|
736
736
|
try {
|
|
737
|
-
return n.mock(
|
|
737
|
+
return n.mock(i(l));
|
|
738
738
|
} catch (h) {
|
|
739
|
-
return console.warn("[mockApi]",
|
|
739
|
+
return console.warn("[mockApi]", o, l, h), null;
|
|
740
740
|
}
|
|
741
741
|
});
|
|
742
742
|
} catch (r) {
|
|
743
743
|
console.warn("mockApi", r);
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function ke(n = window) {
|
|
747
747
|
const e = D(n);
|
|
748
748
|
e && (e._mocked = {});
|
|
749
749
|
}
|
|
750
|
-
class
|
|
750
|
+
class Ct {
|
|
751
751
|
__id = null;
|
|
752
752
|
__mode;
|
|
753
753
|
__instance = null;
|
|
@@ -791,12 +791,12 @@ class kt {
|
|
|
791
791
|
});
|
|
792
792
|
}
|
|
793
793
|
__proxy() {
|
|
794
|
-
this.__instance &&
|
|
794
|
+
this.__instance && Se.forEach((e) => {
|
|
795
795
|
this[e] = this.__instance?.[e];
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
798
|
__cleanup() {
|
|
799
|
-
|
|
799
|
+
Se.forEach((e) => {
|
|
800
800
|
this[e] = null;
|
|
801
801
|
}), this.__reset();
|
|
802
802
|
}
|
|
@@ -807,9 +807,9 @@ class kt {
|
|
|
807
807
|
if (e)
|
|
808
808
|
if (this.__mode === w.Runtime) {
|
|
809
809
|
const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
|
810
|
-
return
|
|
810
|
+
return j({ type: s, value: r }, this);
|
|
811
811
|
} else
|
|
812
|
-
return
|
|
812
|
+
return j(e, this);
|
|
813
813
|
}
|
|
814
814
|
__parseExpression(e) {
|
|
815
815
|
if (e)
|
|
@@ -834,8 +834,8 @@ class kt {
|
|
|
834
834
|
__getRefEl(e, t, s) {
|
|
835
835
|
const r = e[t];
|
|
836
836
|
if (r && s !== r) {
|
|
837
|
-
const
|
|
838
|
-
return Array.from(
|
|
837
|
+
const o = new Set([].concat(r, s));
|
|
838
|
+
return Array.from(o);
|
|
839
839
|
} else
|
|
840
840
|
return s;
|
|
841
841
|
}
|
|
@@ -847,40 +847,40 @@ class kt {
|
|
|
847
847
|
return s.context.__proto__ = this.context, s.__proto__ = this, s;
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function ie(n) {
|
|
851
851
|
const {
|
|
852
852
|
Vue: e = K,
|
|
853
853
|
mode: t = w.Runtime,
|
|
854
854
|
components: s = {},
|
|
855
855
|
libs: r = {},
|
|
856
|
-
apis:
|
|
856
|
+
apis: o = {},
|
|
857
857
|
loader: a
|
|
858
|
-
} = n,
|
|
858
|
+
} = n, i = e.computed(() => n.dsl), l = {
|
|
859
859
|
$components: s,
|
|
860
860
|
$libs: r,
|
|
861
|
-
$apis:
|
|
862
|
-
}, c = new
|
|
861
|
+
$apis: o
|
|
862
|
+
}, c = new Ct({
|
|
863
863
|
mode: t,
|
|
864
|
-
dsl:
|
|
864
|
+
dsl: i.value,
|
|
865
865
|
attrs: l
|
|
866
866
|
}), f = e.defineComponent({
|
|
867
|
-
name:
|
|
868
|
-
__scopeId:
|
|
867
|
+
name: i.value.name,
|
|
868
|
+
__scopeId: i.value.id ? `data-v-${i.value.id}` : void 0,
|
|
869
869
|
props: {
|
|
870
|
-
...
|
|
870
|
+
...It(i.value.props ?? [], c)
|
|
871
871
|
},
|
|
872
872
|
async setup(u) {
|
|
873
|
-
c.$props = u, c.props = u,
|
|
873
|
+
c.$props = u, c.props = u, i.value.id && fe(
|
|
874
874
|
n.window || window,
|
|
875
|
-
|
|
876
|
-
|
|
875
|
+
i.value.id,
|
|
876
|
+
i.value.css || "",
|
|
877
877
|
!0
|
|
878
|
-
), c.state =
|
|
879
|
-
const p =
|
|
878
|
+
), c.state = Ft(e, i.value.state ?? {}, c);
|
|
879
|
+
const p = kt(e, i.value.computed ?? {}, c), h = Ot(i.value.methods ?? {}, c), d = Mt(e, i.value.inject, c);
|
|
880
880
|
for (const [y, _] of Object.entries(d || {}))
|
|
881
881
|
d[y] = e.inject(y, _);
|
|
882
|
-
const m =
|
|
883
|
-
|
|
882
|
+
const m = Tt(
|
|
883
|
+
i.value.dataSources || {},
|
|
884
884
|
c
|
|
885
885
|
), g = {
|
|
886
886
|
...d,
|
|
@@ -888,41 +888,41 @@ function oe(n) {
|
|
|
888
888
|
...h,
|
|
889
889
|
...m
|
|
890
890
|
};
|
|
891
|
-
return c.setup(g, e),
|
|
891
|
+
return c.setup(g, e), xt(e, i.value.watch ?? [], c), {
|
|
892
892
|
vtj: c,
|
|
893
893
|
state: c.state,
|
|
894
894
|
...p,
|
|
895
895
|
...h
|
|
896
896
|
};
|
|
897
897
|
},
|
|
898
|
-
emits:
|
|
899
|
-
expose: ["vtj", ...
|
|
898
|
+
emits: At(i.value.emits),
|
|
899
|
+
expose: ["vtj", ...i.value.expose || []],
|
|
900
900
|
render() {
|
|
901
|
-
if (!
|
|
902
|
-
const u =
|
|
901
|
+
if (!i.value.nodes) return null;
|
|
902
|
+
const u = i.value.nodes || [];
|
|
903
903
|
return u.length === 1 ? M(u[0], c, e, a, u) : u.map(
|
|
904
904
|
(p) => M(p, c, e, a, u)
|
|
905
905
|
);
|
|
906
906
|
},
|
|
907
|
-
...
|
|
907
|
+
...Dt(i.value.lifeCycles ?? {}, c)
|
|
908
908
|
});
|
|
909
909
|
return {
|
|
910
910
|
renderer: e.markRaw(f),
|
|
911
911
|
context: c
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function At(n = []) {
|
|
915
915
|
return n.map((e) => I(e) ? e : e.name);
|
|
916
916
|
}
|
|
917
|
-
function
|
|
918
|
-
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((
|
|
917
|
+
function It(n = [], e) {
|
|
918
|
+
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => nt[o]) : void 0;
|
|
919
919
|
return n.map((s) => I(s) ? {
|
|
920
920
|
name: s
|
|
921
921
|
} : {
|
|
922
922
|
name: s.name,
|
|
923
923
|
type: s.type,
|
|
924
924
|
required: s.required,
|
|
925
|
-
default:
|
|
925
|
+
default: E(s.default) ? e.__parseExpression(s.default) : s.default
|
|
926
926
|
}).reduce(
|
|
927
927
|
(s, r) => (s[r.name] = {
|
|
928
928
|
type: t(r.type),
|
|
@@ -932,50 +932,50 @@ function Ot(n = [], e) {
|
|
|
932
932
|
{}
|
|
933
933
|
);
|
|
934
934
|
}
|
|
935
|
-
function
|
|
935
|
+
function Ft(n, e, t) {
|
|
936
936
|
return n.reactive(
|
|
937
937
|
Object.keys(e || {}).reduce(
|
|
938
938
|
(s, r) => {
|
|
939
|
-
let
|
|
940
|
-
return
|
|
939
|
+
let o = e[r];
|
|
940
|
+
return E(o) ? o = t.__parseExpression(o) : b(o) && (o = t.__parseFunction(o)), s[r] = o, s;
|
|
941
941
|
},
|
|
942
942
|
{}
|
|
943
943
|
)
|
|
944
944
|
);
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function kt(n, e, t) {
|
|
947
947
|
return Object.entries(e ?? {}).reduce(
|
|
948
|
-
(s, [r,
|
|
948
|
+
(s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
|
|
949
949
|
{}
|
|
950
950
|
);
|
|
951
951
|
}
|
|
952
|
-
function
|
|
952
|
+
function Ot(n, e) {
|
|
953
953
|
return Object.entries(n ?? {}).reduce(
|
|
954
954
|
(t, [s, r]) => (t[s] = e.__parseFunction(r), t),
|
|
955
955
|
{}
|
|
956
956
|
);
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function Mt(n, e = [], t) {
|
|
959
959
|
return e.reduce(
|
|
960
960
|
(s, r) => {
|
|
961
|
-
const { name:
|
|
961
|
+
const { name: o, from: a } = r || {};
|
|
962
962
|
r.default;
|
|
963
|
-
const
|
|
964
|
-
return s[
|
|
963
|
+
const i = E(a) ? t.__parseExpression(a) || o : a ?? o, l = E(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
|
|
964
|
+
return s[o] = n.inject(i, l), s;
|
|
965
965
|
},
|
|
966
966
|
{}
|
|
967
967
|
);
|
|
968
968
|
}
|
|
969
|
-
function
|
|
969
|
+
function Tt(n, e) {
|
|
970
970
|
return Object.keys(n).reduce(
|
|
971
971
|
(t, s) => {
|
|
972
972
|
const r = n[s];
|
|
973
973
|
if (r.type === "mock")
|
|
974
|
-
t[s] =
|
|
974
|
+
t[s] = Rt(r);
|
|
975
975
|
else if (r.ref) {
|
|
976
|
-
const
|
|
977
|
-
t[s] = async (...
|
|
978
|
-
const l = await
|
|
976
|
+
const o = e.$apis[r.ref], a = b(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
|
|
977
|
+
t[s] = async (...i) => {
|
|
978
|
+
const l = await o.apply(e, i);
|
|
979
979
|
return a ? a(l) : l;
|
|
980
980
|
};
|
|
981
981
|
}
|
|
@@ -984,7 +984,7 @@ function Ht(n, e) {
|
|
|
984
984
|
{}
|
|
985
985
|
);
|
|
986
986
|
}
|
|
987
|
-
function
|
|
987
|
+
function xt(n, e = [], t) {
|
|
988
988
|
e.forEach((s) => {
|
|
989
989
|
n.watch(
|
|
990
990
|
t.__parseExpression(s.source),
|
|
@@ -996,161 +996,155 @@ function Bt(n, e = [], t) {
|
|
|
996
996
|
);
|
|
997
997
|
});
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function Dt(n, e) {
|
|
1000
1000
|
return Object.entries(n ?? {}).reduce(
|
|
1001
1001
|
(t, [s, r]) => {
|
|
1002
|
-
const
|
|
1002
|
+
const o = e.__parseFunction(r);
|
|
1003
1003
|
return t[s] = async () => {
|
|
1004
|
-
q(
|
|
1004
|
+
q(o) && await o();
|
|
1005
1005
|
}, t;
|
|
1006
1006
|
},
|
|
1007
1007
|
{}
|
|
1008
1008
|
);
|
|
1009
1009
|
}
|
|
1010
|
-
const
|
|
1011
|
-
let Y = [],
|
|
1012
|
-
const
|
|
1013
|
-
async function
|
|
1014
|
-
const { urls: t = [], library: s } = n, r = t.filter((
|
|
1010
|
+
const Oe = new Xe();
|
|
1011
|
+
let Y = [], F = {};
|
|
1012
|
+
const Ht = (n) => n;
|
|
1013
|
+
async function Me(n, e = window) {
|
|
1014
|
+
const { urls: t = [], library: s } = n, r = t.filter((i) => z(i));
|
|
1015
1015
|
if (r.length === 0 || !s) return null;
|
|
1016
|
-
const
|
|
1017
|
-
return
|
|
1018
|
-
(
|
|
1016
|
+
const o = t.filter((i) => G(i));
|
|
1017
|
+
return o.length && Ae(o, e), await Ie(r, s, e).catch(
|
|
1018
|
+
(i) => (console.warn("loadScriptUrl error", r, s, i), null)
|
|
1019
1019
|
);
|
|
1020
1020
|
}
|
|
1021
1021
|
function ae(n) {
|
|
1022
1022
|
const { getDsl: e, getDslByUrl: t, options: s } = n;
|
|
1023
1023
|
return s.window && (Y.forEach((r) => {
|
|
1024
1024
|
delete s.window[r];
|
|
1025
|
-
}), Y = []), (r,
|
|
1026
|
-
if (!
|
|
1027
|
-
if (
|
|
1025
|
+
}), Y = []), (r, o, a = K) => {
|
|
1026
|
+
if (!o || typeof o == "string") return r;
|
|
1027
|
+
if (o.type === "Schema" && o.id)
|
|
1028
1028
|
return a.defineAsyncComponent(async () => {
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
() => e(
|
|
1029
|
+
const i = F[o.id] || await Oe.add(
|
|
1030
|
+
o.id,
|
|
1031
|
+
() => e(o.id)
|
|
1032
1032
|
);
|
|
1033
|
-
return
|
|
1033
|
+
return i && (i.name = r, F[o.id] = i), i ? ie({
|
|
1034
1034
|
...s,
|
|
1035
1035
|
Vue: a,
|
|
1036
|
-
dsl:
|
|
1036
|
+
dsl: ve(i),
|
|
1037
1037
|
mode: w.Runtime,
|
|
1038
1038
|
loader: ae(n)
|
|
1039
1039
|
}).renderer : null;
|
|
1040
1040
|
});
|
|
1041
|
-
if (
|
|
1041
|
+
if (o.type === "UrlSchema" && o.url)
|
|
1042
1042
|
return a.defineAsyncComponent(async () => {
|
|
1043
|
-
const
|
|
1044
|
-
return
|
|
1043
|
+
const i = F[o.url] || await t(o.url);
|
|
1044
|
+
return i && (i.name = r, F[o.url] = i), i ? ie({
|
|
1045
1045
|
...s,
|
|
1046
1046
|
Vue: a,
|
|
1047
|
-
dsl:
|
|
1047
|
+
dsl: ve(i),
|
|
1048
1048
|
mode: w.Runtime,
|
|
1049
1049
|
loader: ae(n)
|
|
1050
1050
|
}).renderer : null;
|
|
1051
1051
|
});
|
|
1052
|
-
if (
|
|
1053
|
-
let
|
|
1054
|
-
return
|
|
1052
|
+
if (o.type === "Plugin") {
|
|
1053
|
+
let i = o.library ? F[o.library] : null;
|
|
1054
|
+
return i || (o.library && Y.push(o.library), i = F[o.library || Symbol()] = a.defineAsyncComponent(
|
|
1055
1055
|
async () => {
|
|
1056
|
-
const l = await
|
|
1057
|
-
return l || (console.warn("getPlugin result is null",
|
|
1056
|
+
const l = await Me(o, s.window);
|
|
1057
|
+
return l || (console.warn("getPlugin result is null", o), null);
|
|
1058
1058
|
}
|
|
1059
|
-
),
|
|
1059
|
+
), i);
|
|
1060
1060
|
}
|
|
1061
1061
|
return r;
|
|
1062
1062
|
};
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1065
|
-
|
|
1064
|
+
function Ps() {
|
|
1065
|
+
F = {}, Oe.clearAllCache();
|
|
1066
1066
|
}
|
|
1067
|
-
function M(n, e, t = K, s =
|
|
1067
|
+
function M(n, e, t = K, s = Ht, r = [], o = !1) {
|
|
1068
1068
|
if (!n || !n.name || n.invisible) return null;
|
|
1069
|
-
const a = t.getCurrentInstance()?.appContext, { id:
|
|
1070
|
-
if (!
|
|
1069
|
+
const a = t.getCurrentInstance()?.appContext, { id: i = null, directives: l = [] } = n, { vIf: c, vElseIf: f, vElse: u, vFor: p, vShow: h, vModels: d, vBind: m, vHtml: g, others: y } = Te(l);
|
|
1070
|
+
if (!o && (f || u))
|
|
1071
1071
|
return null;
|
|
1072
|
-
if (c && !
|
|
1073
|
-
return
|
|
1072
|
+
if (c && !Lt(c, e))
|
|
1073
|
+
return Jt(n, e, t, s, r);
|
|
1074
1074
|
const _ = (v, S = 0) => {
|
|
1075
|
-
const
|
|
1075
|
+
const A = v.$components, V = (() => {
|
|
1076
1076
|
if (n.name === "component")
|
|
1077
|
-
return
|
|
1077
|
+
return Nt(v, n.props?.is);
|
|
1078
1078
|
if (n.name === "slot") return n.name;
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
if (et(E) && n.id) {
|
|
1083
|
-
const ge = `Loader${n.id}_${S}`, ye = P[ge];
|
|
1084
|
-
return ye || (P[ge] = E);
|
|
1085
|
-
}
|
|
1086
|
-
return E;
|
|
1087
|
-
})(), C = Kt(o, n.props ?? {}, v), qe = Gt(t, n.events ?? {}, v);
|
|
1079
|
+
const R = s(n.name, n.from, t);
|
|
1080
|
+
return I(R) ? yt(R) || vt(R) ? R : A[R] ?? a?.app?.component(R) ?? R : R;
|
|
1081
|
+
})(), P = Ut(i, n.props ?? {}, v), Ne = qt(t, n.events ?? {}, v);
|
|
1088
1082
|
if (n.name === "slot")
|
|
1089
|
-
return
|
|
1090
|
-
m && Object.assign(
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
)), g && Object.assign(
|
|
1094
|
-
Object.assign(
|
|
1083
|
+
return Kt(t, n, P, v, s);
|
|
1084
|
+
m && Object.assign(P, v.__parseExpression(m.value)), h && (P.style = Object.assign(
|
|
1085
|
+
P.style ?? {},
|
|
1086
|
+
zt(h, v)
|
|
1087
|
+
)), g && Object.assign(P, Vt(g, v)), d.forEach((R) => {
|
|
1088
|
+
Object.assign(P, Wt(t, R, v));
|
|
1095
1089
|
});
|
|
1096
|
-
const
|
|
1090
|
+
const Ue = Qt(
|
|
1097
1091
|
t,
|
|
1098
1092
|
n.children ?? [],
|
|
1099
1093
|
v,
|
|
1100
1094
|
s,
|
|
1101
1095
|
n
|
|
1102
|
-
), he = v?.__id ? `data-v-${v.__id}` : void 0,
|
|
1096
|
+
), he = v?.__id ? `data-v-${v.__id}` : void 0, qe = he ? { [he]: "" } : {};
|
|
1103
1097
|
let W = t.createVNode(
|
|
1104
1098
|
V,
|
|
1105
|
-
{ key: `${
|
|
1106
|
-
|
|
1099
|
+
{ key: `${i}_${S}`, ...qe, ...P, ...Ne },
|
|
1100
|
+
Ue
|
|
1107
1101
|
);
|
|
1108
|
-
const me = a ?
|
|
1102
|
+
const me = a ? Bt(a, y, v) : [];
|
|
1109
1103
|
return me.length && (W = t.withDirectives(W, me)), W;
|
|
1110
1104
|
};
|
|
1111
|
-
return p ?
|
|
1105
|
+
return p ? Zt(p, _, e) : _(e);
|
|
1112
1106
|
}
|
|
1113
|
-
function
|
|
1107
|
+
function Bt(n, e, t) {
|
|
1114
1108
|
const s = n.app;
|
|
1115
1109
|
return e.map((r) => {
|
|
1116
|
-
const
|
|
1117
|
-
if (!
|
|
1118
|
-
const a = [
|
|
1110
|
+
const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
|
|
1111
|
+
if (!o) return null;
|
|
1112
|
+
const a = [o];
|
|
1119
1113
|
return r.value && a.push(t.__parseExpression(r.value)), r.arg && a.push(r.arg), r.modifiers && a.push(r.modifiers), a;
|
|
1120
1114
|
}).filter((r) => !!r);
|
|
1121
1115
|
}
|
|
1122
|
-
function
|
|
1123
|
-
const e = n.find((f) =>
|
|
1124
|
-
(f) =>
|
|
1125
|
-
), s = n.find((f) =>
|
|
1126
|
-
(f) =>
|
|
1116
|
+
function Te(n = []) {
|
|
1117
|
+
const e = n.find((f) => C(f.name) === "vIf"), t = n.find(
|
|
1118
|
+
(f) => C(f.name) === "vElseIf"
|
|
1119
|
+
), s = n.find((f) => C(f.name) === "vElse"), r = n.find((f) => C(f.name) === "vFor"), o = n.find((f) => C(f.name) === "vShow"), a = n.find((f) => C(f.name) === "vBind"), i = n.find((f) => C(f.name) === "vHtml"), l = n.filter(
|
|
1120
|
+
(f) => C(f.name) === "vModel"
|
|
1127
1121
|
), c = n.filter(
|
|
1128
|
-
(f) => !
|
|
1122
|
+
(f) => !st.includes(C(f.name))
|
|
1129
1123
|
);
|
|
1130
1124
|
return {
|
|
1131
1125
|
vIf: e,
|
|
1132
1126
|
vElseIf: t,
|
|
1133
1127
|
vElse: s,
|
|
1134
1128
|
vFor: r,
|
|
1135
|
-
vShow:
|
|
1129
|
+
vShow: o,
|
|
1136
1130
|
vModels: l,
|
|
1137
1131
|
vBind: a,
|
|
1138
1132
|
others: c,
|
|
1139
|
-
vHtml:
|
|
1133
|
+
vHtml: i
|
|
1140
1134
|
};
|
|
1141
1135
|
}
|
|
1142
|
-
function
|
|
1136
|
+
function Lt(n, e) {
|
|
1143
1137
|
return !!e.__parseExpression(n.value);
|
|
1144
1138
|
}
|
|
1145
|
-
function
|
|
1146
|
-
return e ?
|
|
1139
|
+
function Nt(n, e) {
|
|
1140
|
+
return e ? E(e) ? n.__parseExpression(e) : e : "div";
|
|
1147
1141
|
}
|
|
1148
|
-
function
|
|
1142
|
+
function Ut(n, e, t) {
|
|
1149
1143
|
const s = ce(e, t);
|
|
1150
1144
|
return s.ref = t.__ref(n, s.ref), s;
|
|
1151
1145
|
}
|
|
1152
1146
|
function ce(n, e) {
|
|
1153
|
-
return
|
|
1147
|
+
return E(n) ? e.__parseExpression(n) : b(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) => ce(t, e)) : typeof n == "object" ? Object.keys(n || {}).reduce(
|
|
1154
1148
|
(t, s) => {
|
|
1155
1149
|
let r = n[s];
|
|
1156
1150
|
return t[s] = ce(r, e), t;
|
|
@@ -1158,24 +1152,24 @@ function ce(n, e) {
|
|
|
1158
1152
|
{}
|
|
1159
1153
|
) : n;
|
|
1160
1154
|
}
|
|
1161
|
-
function
|
|
1155
|
+
function qt(n, e, t) {
|
|
1162
1156
|
const s = ["passive", "capture", "once"], r = {
|
|
1163
1157
|
capture: "Capture",
|
|
1164
1158
|
once: "Once",
|
|
1165
1159
|
passive: "OnceCapture"
|
|
1166
1160
|
};
|
|
1167
1161
|
return Object.keys(e || {}).reduce(
|
|
1168
|
-
(
|
|
1169
|
-
const
|
|
1170
|
-
return u && (
|
|
1162
|
+
(o, a) => {
|
|
1163
|
+
const i = e[a], l = xe(i.modifiers), c = l.find((p) => s.includes(p)), f = "on" + Ye(a) + (c && r[c] || ""), u = t.__parseFunction(i.handler);
|
|
1164
|
+
return u && (o[f] = n.withModifiers(u, l)), o;
|
|
1171
1165
|
},
|
|
1172
1166
|
{}
|
|
1173
1167
|
);
|
|
1174
1168
|
}
|
|
1175
|
-
function
|
|
1176
|
-
let
|
|
1177
|
-
for (let a = ++
|
|
1178
|
-
const { directives:
|
|
1169
|
+
function Jt(n, e, t, s, r = []) {
|
|
1170
|
+
let o = r.findIndex((a) => a.id === n.id);
|
|
1171
|
+
for (let a = ++o; a < r.length; a++) {
|
|
1172
|
+
const { directives: i = [] } = r[a], { vElseIf: l, vElse: c } = Te(i);
|
|
1179
1173
|
if (l) {
|
|
1180
1174
|
if (e.__parseExpression(l.value))
|
|
1181
1175
|
return M(r[a], e, t, s, r, !0);
|
|
@@ -1186,79 +1180,79 @@ function zt(n, e, t, s, r = []) {
|
|
|
1186
1180
|
}
|
|
1187
1181
|
return null;
|
|
1188
1182
|
}
|
|
1189
|
-
function
|
|
1183
|
+
function xe(n = {}, e = !1) {
|
|
1190
1184
|
const t = Object.keys(n);
|
|
1191
1185
|
return e ? t.map((s) => "." + s) : t;
|
|
1192
1186
|
}
|
|
1193
|
-
function
|
|
1194
|
-
const { children:
|
|
1195
|
-
return
|
|
1196
|
-
|
|
1197
|
-
) : Array.isArray(
|
|
1198
|
-
(l) => M(l, s, n, r,
|
|
1187
|
+
function Kt(n, e, t, s, r) {
|
|
1188
|
+
const { children: o } = e, a = Gt(e, s), i = s.$slots?.[a.name];
|
|
1189
|
+
return i ? i(t) : o ? I(o) ? n.createTextVNode(o) : E(o) ? n.createTextVNode(
|
|
1190
|
+
Ce(s.__parseExpression(o))
|
|
1191
|
+
) : Array.isArray(o) ? o.map(
|
|
1192
|
+
(l) => M(l, s, n, r, o)
|
|
1199
1193
|
) : null : null;
|
|
1200
1194
|
}
|
|
1201
|
-
function
|
|
1195
|
+
function Gt(n, e) {
|
|
1202
1196
|
const { props: t } = n, s = t?.name || "default";
|
|
1203
1197
|
return {
|
|
1204
|
-
name:
|
|
1198
|
+
name: E(s) ? e.__parseExpression(s) : s,
|
|
1205
1199
|
params: []
|
|
1206
1200
|
};
|
|
1207
1201
|
}
|
|
1208
|
-
function
|
|
1202
|
+
function zt(n, e) {
|
|
1209
1203
|
return e.__parseExpression(n.value) ? {} : {
|
|
1210
1204
|
display: "none"
|
|
1211
1205
|
};
|
|
1212
1206
|
}
|
|
1213
|
-
function
|
|
1207
|
+
function Vt(n, e) {
|
|
1214
1208
|
return {
|
|
1215
1209
|
innerHTML: e.__parseExpression(n.value) || ""
|
|
1216
1210
|
};
|
|
1217
1211
|
}
|
|
1218
|
-
function
|
|
1212
|
+
function Wt(n, e, t) {
|
|
1219
1213
|
const s = {
|
|
1220
1214
|
type: "JSFunction",
|
|
1221
1215
|
value: e.value?.value ? `(v) => {
|
|
1222
1216
|
${e.value.value} = v;
|
|
1223
1217
|
}` : "(v) => {}"
|
|
1224
|
-
}, r = t.__parseFunction(s),
|
|
1225
|
-
|
|
1226
|
-
), a =
|
|
1218
|
+
}, r = t.__parseFunction(s), o = xe(
|
|
1219
|
+
E(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
|
|
1220
|
+
), a = E(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
|
1227
1221
|
return {
|
|
1228
1222
|
[a]: t.__parseExpression(e.value),
|
|
1229
|
-
[`onUpdate:${a}`]:
|
|
1223
|
+
[`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
|
|
1230
1224
|
};
|
|
1231
1225
|
}
|
|
1232
|
-
function
|
|
1226
|
+
function Qt(n, e, t, s, r) {
|
|
1233
1227
|
if (!e) return null;
|
|
1234
1228
|
if (I(e))
|
|
1235
1229
|
return { default: () => e };
|
|
1236
|
-
if (
|
|
1230
|
+
if (E(e))
|
|
1237
1231
|
return {
|
|
1238
|
-
default: () =>
|
|
1232
|
+
default: () => Ce(t.__parseExpression(e))
|
|
1239
1233
|
};
|
|
1240
1234
|
if (Array.isArray(e) && e.length > 0) {
|
|
1241
|
-
const
|
|
1242
|
-
[l]:
|
|
1235
|
+
const o = Xt(e), a = (i, l) => !i || !r ? {} : r?.id && Object.keys(i).length ? l ? {
|
|
1236
|
+
[l]: i
|
|
1243
1237
|
} : {
|
|
1244
|
-
[`scope_${r.id}`]:
|
|
1238
|
+
[`scope_${r.id}`]: i
|
|
1245
1239
|
} : l ? { [l]: /* @__PURE__ */ Object.create(null) } : {};
|
|
1246
|
-
return Object.entries(
|
|
1247
|
-
(
|
|
1248
|
-
const h = f.length ?
|
|
1240
|
+
return Object.entries(o).reduce(
|
|
1241
|
+
(i, [l, { nodes: c, params: f, scope: u }]) => (i[l] = (p) => {
|
|
1242
|
+
const h = f.length ? Ze(p ?? {}, f) : a(p, u);
|
|
1249
1243
|
return c.map(
|
|
1250
1244
|
(d) => M(d, t.__clone(h), n, s, c)
|
|
1251
1245
|
);
|
|
1252
|
-
},
|
|
1246
|
+
}, i),
|
|
1253
1247
|
{}
|
|
1254
1248
|
);
|
|
1255
1249
|
}
|
|
1256
1250
|
return null;
|
|
1257
1251
|
}
|
|
1258
|
-
function
|
|
1252
|
+
function Xt(n) {
|
|
1259
1253
|
const e = {};
|
|
1260
1254
|
for (const t of n) {
|
|
1261
|
-
const s =
|
|
1255
|
+
const s = Yt(t.slot), r = s.name;
|
|
1262
1256
|
e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params), e[r].scope = s.scope || "") : e[r] = {
|
|
1263
1257
|
nodes: [t],
|
|
1264
1258
|
params: s.params,
|
|
@@ -1267,24 +1261,24 @@ function es(n) {
|
|
|
1267
1261
|
}
|
|
1268
1262
|
return e;
|
|
1269
1263
|
}
|
|
1270
|
-
function
|
|
1264
|
+
function Yt(n = "default") {
|
|
1271
1265
|
return I(n) ? { name: n, params: [], scope: "" } : { params: [], scope: "", ...n };
|
|
1272
1266
|
}
|
|
1273
|
-
function
|
|
1274
|
-
const { value: s, iterator: r } = n, { item:
|
|
1275
|
-
let
|
|
1276
|
-
return Number.isInteger(
|
|
1267
|
+
function Zt(n, e, t) {
|
|
1268
|
+
const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
|
|
1269
|
+
let i = t.__parseExpression(s) || [];
|
|
1270
|
+
return Number.isInteger(i) && (i = new Array(i).fill(!0).map((l, c) => c + 1)), Array.isArray(i) ? i.map((l, c) => e(t.__clone({ [o]: l, [a]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
|
1277
1271
|
}
|
|
1278
|
-
const Z =
|
|
1272
|
+
const Z = Re({
|
|
1279
1273
|
name: "VtjPageContainer",
|
|
1280
1274
|
async setup() {
|
|
1281
|
-
const n =
|
|
1275
|
+
const n = Be(), e = Pe(), t = e.meta.__vtj__ || e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = oe(Symbol());
|
|
1282
1276
|
if (s) {
|
|
1283
1277
|
Object.assign(e.meta, s.meta || {}, { cache: s.cache });
|
|
1284
1278
|
const { useTitle: a } = n?.adapter;
|
|
1285
1279
|
if (a) {
|
|
1286
|
-
const
|
|
1287
|
-
a(
|
|
1280
|
+
const i = e.meta.title || s.title || "VTJ.PRO";
|
|
1281
|
+
a(i);
|
|
1288
1282
|
}
|
|
1289
1283
|
}
|
|
1290
1284
|
return {
|
|
@@ -1293,7 +1287,7 @@ const Z = Ce({
|
|
|
1293
1287
|
file: s,
|
|
1294
1288
|
query: e.query,
|
|
1295
1289
|
meta: e.meta,
|
|
1296
|
-
sid:
|
|
1290
|
+
sid: o,
|
|
1297
1291
|
route: e
|
|
1298
1292
|
};
|
|
1299
1293
|
},
|
|
@@ -1304,7 +1298,7 @@ const Z = Ce({
|
|
|
1304
1298
|
activated() {
|
|
1305
1299
|
this.meta.cache === !1 && (this.sid = Symbol());
|
|
1306
1300
|
}
|
|
1307
|
-
}),
|
|
1301
|
+
}), es = Re({
|
|
1308
1302
|
name: "VtjStartupContainer",
|
|
1309
1303
|
render() {
|
|
1310
1304
|
return re("div", "page not found!");
|
|
@@ -1313,17 +1307,17 @@ const Z = Ce({
|
|
|
1313
1307
|
function J(n, e, t = []) {
|
|
1314
1308
|
const s = [];
|
|
1315
1309
|
for (const r of t) {
|
|
1316
|
-
const { id:
|
|
1310
|
+
const { id: o, title: a, icon: i, children: l, hidden: c, layout: f } = r;
|
|
1317
1311
|
if (f) {
|
|
1318
1312
|
const u = J(n, e, l || []);
|
|
1319
1313
|
s.push(...u);
|
|
1320
1314
|
} else {
|
|
1321
1315
|
const u = {
|
|
1322
|
-
id:
|
|
1316
|
+
id: o,
|
|
1323
1317
|
title: a,
|
|
1324
|
-
icon:
|
|
1318
|
+
icon: i,
|
|
1325
1319
|
hidden: c,
|
|
1326
|
-
url: `${n}/${e}/${
|
|
1320
|
+
url: `${n}/${e}/${o}`,
|
|
1327
1321
|
children: l && l.length ? J(n, e, l) : void 0
|
|
1328
1322
|
};
|
|
1329
1323
|
s.push(u);
|
|
@@ -1331,27 +1325,27 @@ function J(n, e, t = []) {
|
|
|
1331
1325
|
}
|
|
1332
1326
|
return s;
|
|
1333
1327
|
}
|
|
1334
|
-
function
|
|
1328
|
+
function De(n, e) {
|
|
1335
1329
|
if (!e) return n;
|
|
1336
1330
|
let t = [];
|
|
1337
1331
|
for (const s of n)
|
|
1338
1332
|
if (s.children && s.children.length) {
|
|
1339
|
-
const r =
|
|
1333
|
+
const r = De(s.children, e);
|
|
1340
1334
|
r.length && (s.children = r, t.push(s));
|
|
1341
1335
|
} else
|
|
1342
1336
|
e.can(s.id.toString()) && t.push(s);
|
|
1343
1337
|
return t;
|
|
1344
1338
|
}
|
|
1345
|
-
function
|
|
1339
|
+
function Cs(n) {
|
|
1346
1340
|
const {
|
|
1347
1341
|
menuPathPrefix: e = "",
|
|
1348
1342
|
pageRouteName: t = "page",
|
|
1349
1343
|
disableMenusFilter: s = !1
|
|
1350
|
-
} = n || {}, r =
|
|
1351
|
-
|
|
1344
|
+
} = n || {}, r = Be(), o = Pe(), a = St(), i = oe(!1), l = oe(!1), c = r.project, f = (h, d) => {
|
|
1345
|
+
i.value = !h?.mask, l.value = d?.pure ?? !!h?.pure;
|
|
1352
1346
|
};
|
|
1353
|
-
|
|
1354
|
-
const { name: h, params: d, meta: m } =
|
|
1347
|
+
tt(() => {
|
|
1348
|
+
const { name: h, params: d, meta: m } = o;
|
|
1355
1349
|
if (h === x) {
|
|
1356
1350
|
const g = r.getPage(d.id);
|
|
1357
1351
|
f(g, m);
|
|
@@ -1364,7 +1358,7 @@ function ks(n) {
|
|
|
1364
1358
|
const y = r.getPage(g);
|
|
1365
1359
|
f(y, m);
|
|
1366
1360
|
} else
|
|
1367
|
-
|
|
1361
|
+
i.value = !m.mask, l.value = !!m.pure;
|
|
1368
1362
|
}
|
|
1369
1363
|
});
|
|
1370
1364
|
const u = J(
|
|
@@ -1373,20 +1367,20 @@ function ks(n) {
|
|
|
1373
1367
|
c?.pages
|
|
1374
1368
|
), p = c?.config;
|
|
1375
1369
|
return {
|
|
1376
|
-
disabled:
|
|
1370
|
+
disabled: i,
|
|
1377
1371
|
logo: p?.logo,
|
|
1378
1372
|
themeSwitchable: p?.themeSwitchable,
|
|
1379
1373
|
title: p?.title || c?.description || c?.name || "VTJ App",
|
|
1380
|
-
menus: s ? u :
|
|
1374
|
+
menus: s ? u : De(u, a),
|
|
1381
1375
|
pure: l
|
|
1382
1376
|
};
|
|
1383
1377
|
}
|
|
1384
1378
|
function ee(n, e) {
|
|
1385
|
-
const { id: t, title: s, meta: r } = n, { name:
|
|
1379
|
+
const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: a = "", component: i, routeMeta: l } = e;
|
|
1386
1380
|
return {
|
|
1387
1381
|
name: t,
|
|
1388
|
-
path: `${a}${
|
|
1389
|
-
component:
|
|
1382
|
+
path: `${a}${o}/${t}`,
|
|
1383
|
+
component: i,
|
|
1390
1384
|
meta: {
|
|
1391
1385
|
title: s,
|
|
1392
1386
|
...l,
|
|
@@ -1401,9 +1395,9 @@ function le(n) {
|
|
|
1401
1395
|
prefix: t = "",
|
|
1402
1396
|
pages: s = [],
|
|
1403
1397
|
component: r,
|
|
1404
|
-
loader:
|
|
1398
|
+
loader: o,
|
|
1405
1399
|
routeMeta: a,
|
|
1406
|
-
homepage:
|
|
1400
|
+
homepage: i
|
|
1407
1401
|
} = n, l = [];
|
|
1408
1402
|
for (const c of s) {
|
|
1409
1403
|
const { id: f, title: u, dir: p, layout: h, children: d, meta: m } = c;
|
|
@@ -1413,8 +1407,8 @@ function le(n) {
|
|
|
1413
1407
|
prefix: t,
|
|
1414
1408
|
component: r,
|
|
1415
1409
|
routeMeta: a,
|
|
1416
|
-
homepage:
|
|
1417
|
-
loader:
|
|
1410
|
+
homepage: i,
|
|
1411
|
+
loader: o,
|
|
1418
1412
|
pages: d || []
|
|
1419
1413
|
});
|
|
1420
1414
|
l.push(...g);
|
|
@@ -1424,13 +1418,13 @@ function le(n) {
|
|
|
1424
1418
|
prefix: t,
|
|
1425
1419
|
component: r,
|
|
1426
1420
|
routeMeta: a,
|
|
1427
|
-
homepage:
|
|
1428
|
-
loader:
|
|
1421
|
+
homepage: i,
|
|
1422
|
+
loader: o,
|
|
1429
1423
|
pages: d || []
|
|
1430
1424
|
}), y = {
|
|
1431
1425
|
name: `layout_${f}`,
|
|
1432
1426
|
path: t,
|
|
1433
|
-
component: () =>
|
|
1427
|
+
component: () => o(f),
|
|
1434
1428
|
meta: {
|
|
1435
1429
|
title: u,
|
|
1436
1430
|
...a,
|
|
@@ -1440,86 +1434,86 @@ function le(n) {
|
|
|
1440
1434
|
children: g
|
|
1441
1435
|
};
|
|
1442
1436
|
l.push(y), l.push(ee(c, n));
|
|
1443
|
-
} else if (l.push(ee(c, n)),
|
|
1437
|
+
} else if (l.push(ee(c, n)), i === f) {
|
|
1444
1438
|
const g = ee(c, n);
|
|
1445
1439
|
g.path = "", g.name = `home_${f}`, l.push(g);
|
|
1446
1440
|
}
|
|
1447
1441
|
}
|
|
1448
1442
|
return l;
|
|
1449
1443
|
}
|
|
1450
|
-
function
|
|
1451
|
-
const { css: t, store: s, enhance: r } = n, { window:
|
|
1452
|
-
a.config.globalProperties.$libs =
|
|
1444
|
+
function ts(n = {}, e) {
|
|
1445
|
+
const { css: t, store: s, enhance: r } = n, { window: o, app: a, library: i = {}, adapter: l, mode: c } = e, { Pinia: f } = i;
|
|
1446
|
+
a.config.globalProperties.$libs = i, fe(o, "global-css", t || ""), f && s && ss(s, a, f), rs(a, l, n), !l.access && n.access && ns(n.access, a, c, l), os(a, n), r && is(r, a, i);
|
|
1453
1447
|
}
|
|
1454
|
-
function
|
|
1448
|
+
function ss(n, e, t) {
|
|
1455
1449
|
const s = t.createPinia();
|
|
1456
1450
|
if (e.use(s), b(n) && n.value) {
|
|
1457
|
-
const r =
|
|
1458
|
-
e.config.globalProperties.$store =
|
|
1451
|
+
const r = j(n, {}, !1, !1, !0), o = t.defineStore("$store", r(e) || {});
|
|
1452
|
+
e.config.globalProperties.$store = o();
|
|
1459
1453
|
}
|
|
1460
1454
|
}
|
|
1461
|
-
function
|
|
1455
|
+
function ns(n, e, t, s) {
|
|
1462
1456
|
if (b(n) && n.value) {
|
|
1463
|
-
const r =
|
|
1464
|
-
alert:
|
|
1457
|
+
const r = j(n, {}, !1, !1, !0), { alert: o, request: a } = s, i = new pe({
|
|
1458
|
+
alert: o,
|
|
1465
1459
|
storagePrefix: "__VTJ_APP_",
|
|
1466
1460
|
...r(e)
|
|
1467
1461
|
}), l = e.config.globalProperties.$router;
|
|
1468
|
-
|
|
1462
|
+
i.connect({ mode: t, router: l, request: a }), e.use(i);
|
|
1469
1463
|
}
|
|
1470
1464
|
}
|
|
1471
|
-
function
|
|
1465
|
+
function rs(n, e, t) {
|
|
1472
1466
|
if (!e.request) return;
|
|
1473
|
-
const { axios: s, request: r, response:
|
|
1467
|
+
const { axios: s, request: r, response: o } = t;
|
|
1474
1468
|
if (s && b(s) && s.value) {
|
|
1475
|
-
const a =
|
|
1469
|
+
const a = j(s, {}, !1, !1, !0);
|
|
1476
1470
|
e.request.setConfig(a(n));
|
|
1477
1471
|
}
|
|
1478
1472
|
if (r && b(r) && r.value) {
|
|
1479
|
-
const a =
|
|
1480
|
-
|
|
1473
|
+
const a = j(r, {}, !1, !1, !0), i = e.request;
|
|
1474
|
+
i.__unReq && i.__unReq(), i.__unReq = e.request.useRequest((l) => a(l, n));
|
|
1481
1475
|
}
|
|
1482
|
-
if (
|
|
1483
|
-
const a =
|
|
1484
|
-
|
|
1476
|
+
if (o && b(o) && o.value) {
|
|
1477
|
+
const a = j(o, {}, !1, !1, !0), i = e.request;
|
|
1478
|
+
i.__unRes && i.__unRes(), i.__unRes = e.request.useResponse((l) => a(l, n));
|
|
1485
1479
|
}
|
|
1486
1480
|
}
|
|
1487
|
-
function
|
|
1481
|
+
function os(n, e) {
|
|
1488
1482
|
const { beforeEach: t, afterEach: s } = e, r = n.config.globalProperties.$router;
|
|
1489
1483
|
if (t && b(t) && t.value) {
|
|
1490
|
-
const
|
|
1491
|
-
r && r.beforeEach((a,
|
|
1484
|
+
const o = j(t, {}, !1, !1, !0);
|
|
1485
|
+
r && r.beforeEach((a, i, l) => o(a, i, l, n));
|
|
1492
1486
|
}
|
|
1493
1487
|
if (s && b(s) && s.value) {
|
|
1494
|
-
const
|
|
1495
|
-
r && r.afterEach((a,
|
|
1488
|
+
const o = j(s, {}, !1, !1, !0);
|
|
1489
|
+
r && r.afterEach((a, i, l) => o(a, i, l, n));
|
|
1496
1490
|
}
|
|
1497
1491
|
}
|
|
1498
|
-
function
|
|
1499
|
-
b(n) && n.value &&
|
|
1492
|
+
function is(n, e, t = {}) {
|
|
1493
|
+
b(n) && n.value && j(n, {}, !1, !1, !0)(e, t);
|
|
1500
1494
|
}
|
|
1501
|
-
function
|
|
1495
|
+
function as(n, e, t) {
|
|
1502
1496
|
if (!n || !e || !t) return;
|
|
1503
1497
|
const { VueI18n: s } = e;
|
|
1504
1498
|
if (s) {
|
|
1505
|
-
const { locale: r, fallbackLocale:
|
|
1499
|
+
const { locale: r, fallbackLocale: o, messages: a = [] } = t, i = {};
|
|
1506
1500
|
for (let c of a) {
|
|
1507
1501
|
const f = Object.keys(c).filter((u) => u !== "key");
|
|
1508
1502
|
for (const u of f)
|
|
1509
|
-
|
|
1503
|
+
i[u] || (i[u] = {}), i[u][c.key] = c[u];
|
|
1510
1504
|
}
|
|
1511
1505
|
const l = s.createI18n({
|
|
1512
1506
|
legacy: !1,
|
|
1513
1507
|
locale: r,
|
|
1514
|
-
fallbackLocale:
|
|
1515
|
-
messages:
|
|
1508
|
+
fallbackLocale: o,
|
|
1509
|
+
messages: i
|
|
1516
1510
|
});
|
|
1517
1511
|
n.use(l);
|
|
1518
1512
|
}
|
|
1519
1513
|
}
|
|
1520
|
-
const
|
|
1521
|
-
var
|
|
1522
|
-
class
|
|
1514
|
+
const He = Symbol("Provider");
|
|
1515
|
+
var cs = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(cs || {});
|
|
1516
|
+
class ls extends Je {
|
|
1523
1517
|
// DSL缓存
|
|
1524
1518
|
/**
|
|
1525
1519
|
* 创建Provider实例
|
|
@@ -1531,9 +1525,9 @@ class ps extends Ge {
|
|
|
1531
1525
|
service: t,
|
|
1532
1526
|
mode: s = w.Raw,
|
|
1533
1527
|
dependencies: r,
|
|
1534
|
-
materials:
|
|
1528
|
+
materials: o,
|
|
1535
1529
|
project: a = {},
|
|
1536
|
-
adapter:
|
|
1530
|
+
adapter: i = {},
|
|
1537
1531
|
globals: l = {},
|
|
1538
1532
|
modules: c = {},
|
|
1539
1533
|
router: f = null,
|
|
@@ -1541,7 +1535,7 @@ class ps extends Ge {
|
|
|
1541
1535
|
nodeEnv: p = "development"
|
|
1542
1536
|
/* Development */
|
|
1543
1537
|
} = e;
|
|
1544
|
-
this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r),
|
|
1538
|
+
this.mode = s, this.modules = c, this.service = t, this.router = f, this.materialPath = u, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, i);
|
|
1545
1539
|
const { access: h, request: d } = this.adapter;
|
|
1546
1540
|
h && h.connect({ mode: s, router: f, request: d }), a && s !== w.Design ? this.load(a) : this.project = a;
|
|
1547
1541
|
}
|
|
@@ -1551,7 +1545,7 @@ class ps extends Ge {
|
|
|
1551
1545
|
// 全局变量
|
|
1552
1546
|
modules = {};
|
|
1553
1547
|
// 异步模块加载器
|
|
1554
|
-
adapter = { request: ne, jsonp:
|
|
1548
|
+
adapter = { request: ne, jsonp: Ee };
|
|
1555
1549
|
// 适配器接口
|
|
1556
1550
|
apis = {};
|
|
1557
1551
|
// API集合
|
|
@@ -1586,8 +1580,8 @@ class ps extends Ge {
|
|
|
1586
1580
|
if (e)
|
|
1587
1581
|
try {
|
|
1588
1582
|
s = await e.apply(e, t);
|
|
1589
|
-
} catch (
|
|
1590
|
-
O.warn("模拟数据模版异常",
|
|
1583
|
+
} catch (o) {
|
|
1584
|
+
O.warn("模拟数据模版异常", o);
|
|
1591
1585
|
}
|
|
1592
1586
|
return D()?.mock(s);
|
|
1593
1587
|
};
|
|
@@ -1605,8 +1599,8 @@ class ps extends Ge {
|
|
|
1605
1599
|
const { vtjDir: t = ".vtj" } = this.options, s = this.modules[`${t}/projects/${e.id}.json`] || this.modules[`/src/${t}/projects/${e.id}.json`];
|
|
1606
1600
|
if (this.project = s ? await s() : await this.service.init(e), !this.project)
|
|
1607
1601
|
throw new Error("project is null");
|
|
1608
|
-
const { apis: r = [], meta:
|
|
1609
|
-
|
|
1602
|
+
const { apis: r = [], meta: o = [], env: a = [] } = this.project, i = window;
|
|
1603
|
+
i && (i.CKEDITOR_VERSION = void 0), this.initEnv(a), this.mode === w.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = Et(r, o, this.adapter), ke(i), jt(r, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
|
|
1610
1604
|
}
|
|
1611
1605
|
initMock(e) {
|
|
1612
1606
|
const t = D(e);
|
|
@@ -1623,9 +1617,9 @@ class ps extends Ge {
|
|
|
1623
1617
|
const { dependencies: t = [] } = this.project, {
|
|
1624
1618
|
dependencies: s,
|
|
1625
1619
|
library: r,
|
|
1626
|
-
components:
|
|
1620
|
+
components: o,
|
|
1627
1621
|
materialPath: a,
|
|
1628
|
-
nodeEnv:
|
|
1622
|
+
nodeEnv: i,
|
|
1629
1623
|
libraryLocales: l
|
|
1630
1624
|
} = this, {
|
|
1631
1625
|
libraryExports: c,
|
|
@@ -1634,10 +1628,10 @@ class ps extends Ge {
|
|
|
1634
1628
|
materialExports: p,
|
|
1635
1629
|
materialMapLibrary: h,
|
|
1636
1630
|
libraryLocaleMap: d
|
|
1637
|
-
} =
|
|
1631
|
+
} = ct(
|
|
1638
1632
|
t,
|
|
1639
1633
|
a,
|
|
1640
|
-
|
|
1634
|
+
i === "development"
|
|
1641
1635
|
/* Development */
|
|
1642
1636
|
);
|
|
1643
1637
|
Object.assign(this.libraryLocaleMap, d);
|
|
@@ -1650,7 +1644,7 @@ class ps extends Ge {
|
|
|
1650
1644
|
else {
|
|
1651
1645
|
const v = f[m] || [];
|
|
1652
1646
|
for (const S of v)
|
|
1653
|
-
G(S) && await
|
|
1647
|
+
G(S) && await mt(S, k.append(S, { v: T })), z(S) && await _e(k.append(S, { v: T }));
|
|
1654
1648
|
r[m] = e[m];
|
|
1655
1649
|
}
|
|
1656
1650
|
const _ = d[m];
|
|
@@ -1659,20 +1653,20 @@ class ps extends Ge {
|
|
|
1659
1653
|
l[_] = v ? await v() : e[_];
|
|
1660
1654
|
}
|
|
1661
1655
|
}
|
|
1662
|
-
if (
|
|
1656
|
+
if (i === "development") {
|
|
1663
1657
|
for (const g of u)
|
|
1664
|
-
await
|
|
1658
|
+
await _e(k.append(g, { v: T }));
|
|
1665
1659
|
const m = this.materials || {};
|
|
1666
1660
|
for (const g of p) {
|
|
1667
|
-
const y = e[h[g]], _ = y?.default || y, v =
|
|
1661
|
+
const y = e[h[g]], _ = y?.default || y, v = Ke[g];
|
|
1668
1662
|
if (v)
|
|
1669
1663
|
_ && v.forEach((S) => {
|
|
1670
|
-
|
|
1664
|
+
o[S] = _[S];
|
|
1671
1665
|
});
|
|
1672
1666
|
else {
|
|
1673
1667
|
const S = m[g] ? (await m[g]()).default : e[g];
|
|
1674
|
-
S && _ && (S.components || []).forEach((
|
|
1675
|
-
|
|
1668
|
+
S && _ && (S.components || []).forEach((A) => {
|
|
1669
|
+
o[A.name] = lt(A, _);
|
|
1676
1670
|
});
|
|
1677
1671
|
}
|
|
1678
1672
|
}
|
|
@@ -1681,24 +1675,24 @@ class ps extends Ge {
|
|
|
1681
1675
|
initRouter() {
|
|
1682
1676
|
const { router: e, project: t, options: s, adapter: r } = this;
|
|
1683
1677
|
if (!e) return;
|
|
1684
|
-
const
|
|
1678
|
+
const o = t?.platform === "uniapp" ? "pages" : "page", {
|
|
1685
1679
|
routeAppendTo: a,
|
|
1686
|
-
pageRouteName:
|
|
1680
|
+
pageRouteName: i = o,
|
|
1687
1681
|
routeMeta: l
|
|
1688
1682
|
} = s, c = a ? "" : "/", f = {
|
|
1689
|
-
path: `${c}${
|
|
1683
|
+
path: `${c}${i}/:id`,
|
|
1690
1684
|
name: x,
|
|
1691
1685
|
component: Z
|
|
1692
1686
|
}, u = {
|
|
1693
1687
|
path: c,
|
|
1694
1688
|
name: N,
|
|
1695
|
-
component: t?.homepage ? Z : r.startupComponent ||
|
|
1689
|
+
component: t?.homepage ? Z : r.startupComponent || es,
|
|
1696
1690
|
meta: l
|
|
1697
1691
|
};
|
|
1698
1692
|
if (e.hasRoute(x) && e.removeRoute(x), e.hasRoute(N) && e.removeRoute(N), s.enableStaticRoute) {
|
|
1699
1693
|
const p = t?.pages || [];
|
|
1700
1694
|
le({
|
|
1701
|
-
name:
|
|
1695
|
+
name: i,
|
|
1702
1696
|
prefix: c,
|
|
1703
1697
|
pages: p,
|
|
1704
1698
|
component: Z,
|
|
@@ -1721,44 +1715,44 @@ class ps extends Ge {
|
|
|
1721
1715
|
* @param app Vue 应用实例
|
|
1722
1716
|
*/
|
|
1723
1717
|
install(e) {
|
|
1724
|
-
const { libraryLocaleMap: t, libraryLocales: s } = this, { libraryOptions: r = {} } = this.options,
|
|
1725
|
-
for (const [a,
|
|
1726
|
-
if (!
|
|
1718
|
+
const { libraryLocaleMap: t, libraryLocales: s } = this, { libraryOptions: r = {} } = this.options, o = e.config.globalProperties.installed || {};
|
|
1719
|
+
for (const [a, i] of Object.entries(this.library))
|
|
1720
|
+
if (!o[a] && gt(i)) {
|
|
1727
1721
|
const c = { locale: s[t[a]] }, f = r[a] || {}, u = { ...c, ...f };
|
|
1728
|
-
e.use(
|
|
1722
|
+
e.use(i, u), o[a] = !0;
|
|
1729
1723
|
}
|
|
1730
|
-
e.provide(
|
|
1724
|
+
e.provide(He, this), e.config.globalProperties.$provider = this, e.config.globalProperties.$request = this.adapter?.request, this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), this.project?.platform !== "uniapp" && this.mode !== w.Design && this.initGlobals(this.project?.globals || {}, {
|
|
1731
1725
|
app: e,
|
|
1732
1726
|
window,
|
|
1733
1727
|
adapter: this.adapter,
|
|
1734
1728
|
library: this.library,
|
|
1735
1729
|
mode: this.mode
|
|
1736
|
-
}), this.mode !== w.Design && this.project?.i18n && this.initI18n(e, this.library, this.project.i18n), this.options.enhance && e.use(this.options.enhance, this), this.mode === w.Design && (e.config.errorHandler = (a,
|
|
1737
|
-
const c =
|
|
1730
|
+
}), this.mode !== w.Design && this.project?.i18n && this.initI18n(e, this.library, this.project.i18n), this.options.enhance && e.use(this.options.enhance, this), this.mode === w.Design && (e.config.errorHandler = (a, i, l) => {
|
|
1731
|
+
const c = i?.$options.name, f = typeof a == "string" ? a : a?.message || a?.msg || "未知错误", u = `[ ${c} ] ${f} ${l}`;
|
|
1738
1732
|
console.error(
|
|
1739
1733
|
"[VTJ Error]:",
|
|
1740
1734
|
{
|
|
1741
1735
|
err: a,
|
|
1742
|
-
instance:
|
|
1736
|
+
instance: i,
|
|
1743
1737
|
info: l
|
|
1744
1738
|
},
|
|
1745
1739
|
a?.stack
|
|
1746
1740
|
), this.adapter.notify && this.adapter.notify(u, "组件渲染错误", "error");
|
|
1747
|
-
}), e.config.globalProperties.installed =
|
|
1741
|
+
}), e.config.globalProperties.installed = o;
|
|
1748
1742
|
}
|
|
1749
1743
|
getFile(e) {
|
|
1750
1744
|
const { blocks: t = [] } = this.project || {};
|
|
1751
1745
|
return this.getPage(e) || t.find((s) => s.id === e) || null;
|
|
1752
1746
|
}
|
|
1753
1747
|
getPage(e) {
|
|
1754
|
-
const { pages: t = [] } = this.project || {}, s = (r,
|
|
1755
|
-
for (const a of
|
|
1748
|
+
const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
|
|
1749
|
+
for (const a of o) {
|
|
1756
1750
|
if (a.id === r)
|
|
1757
1751
|
return a;
|
|
1758
1752
|
if (a.children && a.children.length) {
|
|
1759
|
-
const
|
|
1760
|
-
if (
|
|
1761
|
-
return
|
|
1753
|
+
const i = s(r, a.children);
|
|
1754
|
+
if (i)
|
|
1755
|
+
return i;
|
|
1762
1756
|
}
|
|
1763
1757
|
}
|
|
1764
1758
|
};
|
|
@@ -1796,8 +1790,8 @@ class ps extends Ge {
|
|
|
1796
1790
|
* @returns 渲染器实例
|
|
1797
1791
|
*/
|
|
1798
1792
|
createDslRenderer(e, t = {}) {
|
|
1799
|
-
const { library: s, components: r, mode:
|
|
1800
|
-
mode:
|
|
1793
|
+
const { library: s, components: r, mode: o, apis: a } = this, i = {
|
|
1794
|
+
mode: o,
|
|
1801
1795
|
Vue: s.Vue,
|
|
1802
1796
|
components: r,
|
|
1803
1797
|
libs: s,
|
|
@@ -1807,10 +1801,10 @@ class ps extends Ge {
|
|
|
1807
1801
|
}, l = ae({
|
|
1808
1802
|
getDsl: async (c) => await this.getDsl(c) || null,
|
|
1809
1803
|
getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
|
|
1810
|
-
options:
|
|
1804
|
+
options: i
|
|
1811
1805
|
});
|
|
1812
|
-
return
|
|
1813
|
-
...
|
|
1806
|
+
return ie({
|
|
1807
|
+
...i,
|
|
1814
1808
|
dsl: e,
|
|
1815
1809
|
loader: l
|
|
1816
1810
|
});
|
|
@@ -1830,8 +1824,8 @@ class ps extends Ge {
|
|
|
1830
1824
|
if (!s)
|
|
1831
1825
|
return O.warn(`Can not find file: ${e}`), null;
|
|
1832
1826
|
if (t && t(s), this.mode === w.Raw) {
|
|
1833
|
-
const { vtjRawDir:
|
|
1834
|
-
return
|
|
1827
|
+
const { vtjRawDir: o = ".vtj/vue" } = this.options, a = `${o}/${e}.vue`, i = this.modules[a] || this.modules[`/src/pages/${e}.vue`];
|
|
1828
|
+
return i ? (await i())?.default : this.nodeEnv === "development" && this.adapter.startupComponent || null;
|
|
1835
1829
|
}
|
|
1836
1830
|
const r = await this.getDsl(s.id);
|
|
1837
1831
|
return r ? this.createDslRenderer(r).renderer : (O.warn(`Can not find dsl: ${e}`), null);
|
|
@@ -1846,7 +1840,7 @@ class ps extends Ge {
|
|
|
1846
1840
|
* @returns Vue异步组件
|
|
1847
1841
|
*/
|
|
1848
1842
|
defineUrlSchemaComponent(e, t) {
|
|
1849
|
-
return
|
|
1843
|
+
return we(async () => {
|
|
1850
1844
|
const s = await this.getDslByUrl(e);
|
|
1851
1845
|
return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
|
|
1852
1846
|
});
|
|
@@ -1859,7 +1853,7 @@ class ps extends Ge {
|
|
|
1859
1853
|
* @returns Vue异步组件
|
|
1860
1854
|
*/
|
|
1861
1855
|
definePluginComponent(e) {
|
|
1862
|
-
return
|
|
1856
|
+
return we(async () => await Me(e, window));
|
|
1863
1857
|
}
|
|
1864
1858
|
/**
|
|
1865
1859
|
* 设置应用全局
|
|
@@ -1874,10 +1868,10 @@ class ps extends Ge {
|
|
|
1874
1868
|
},
|
|
1875
1869
|
t
|
|
1876
1870
|
);
|
|
1877
|
-
|
|
1871
|
+
ts(e, s);
|
|
1878
1872
|
}
|
|
1879
1873
|
initI18n(e, t, s) {
|
|
1880
|
-
|
|
1874
|
+
as(e, t, s);
|
|
1881
1875
|
}
|
|
1882
1876
|
initEnv(e = []) {
|
|
1883
1877
|
this.env = e.reduce(
|
|
@@ -1886,15 +1880,15 @@ class ps extends Ge {
|
|
|
1886
1880
|
);
|
|
1887
1881
|
}
|
|
1888
1882
|
}
|
|
1889
|
-
function
|
|
1890
|
-
const e = new
|
|
1883
|
+
function As(n) {
|
|
1884
|
+
const e = new ls(n);
|
|
1891
1885
|
return {
|
|
1892
1886
|
provider: e,
|
|
1893
1887
|
onReady: (s) => e.ready(s)
|
|
1894
1888
|
};
|
|
1895
1889
|
}
|
|
1896
|
-
function
|
|
1897
|
-
const e =
|
|
1890
|
+
function Be(n = {}) {
|
|
1891
|
+
const e = je(He, null);
|
|
1898
1892
|
if (!e)
|
|
1899
1893
|
throw new Error("Can not find provider");
|
|
1900
1894
|
if (e.nodeEnv === "development") {
|
|
@@ -1910,21 +1904,21 @@ function Ne(n = {}) {
|
|
|
1910
1904
|
}
|
|
1911
1905
|
return e;
|
|
1912
1906
|
}
|
|
1913
|
-
async function
|
|
1914
|
-
const { name: t, urls: s = [] } = n || {}, r = s.map((
|
|
1915
|
-
if (
|
|
1916
|
-
return await
|
|
1907
|
+
async function Is(n, e = "") {
|
|
1908
|
+
const { name: t, urls: s = [] } = n || {}, r = s.map((i) => e + i), { css: o, js: a } = ut(r);
|
|
1909
|
+
if (o.length && Ae(o), a.length)
|
|
1910
|
+
return await Ie(a, t).catch(
|
|
1917
1911
|
() => {
|
|
1918
1912
|
}
|
|
1919
1913
|
);
|
|
1920
1914
|
}
|
|
1921
|
-
const
|
|
1915
|
+
const Le = {
|
|
1922
1916
|
type: "json",
|
|
1923
1917
|
validSuccess: !0,
|
|
1924
1918
|
originResponse: !1,
|
|
1925
1919
|
failMessage: !0,
|
|
1926
1920
|
validate: (n) => n.data?.code === 0
|
|
1927
|
-
},
|
|
1921
|
+
}, us = (n, e = "/__vtj__/api/:type.json") => (t, s, r) => n.send({
|
|
1928
1922
|
url: e,
|
|
1929
1923
|
method: "post",
|
|
1930
1924
|
params: { type: t },
|
|
@@ -1933,8 +1927,8 @@ const Ue = {
|
|
|
1933
1927
|
type: t,
|
|
1934
1928
|
data: s
|
|
1935
1929
|
},
|
|
1936
|
-
settings:
|
|
1937
|
-
}),
|
|
1930
|
+
settings: Le
|
|
1931
|
+
}), fs = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
|
|
1938
1932
|
url: e,
|
|
1939
1933
|
method: "post",
|
|
1940
1934
|
data: {
|
|
@@ -1942,12 +1936,12 @@ const Ue = {
|
|
|
1942
1936
|
projectId: s
|
|
1943
1937
|
},
|
|
1944
1938
|
settings: {
|
|
1945
|
-
...
|
|
1939
|
+
...Le,
|
|
1946
1940
|
type: "data"
|
|
1947
1941
|
}
|
|
1948
1942
|
}).then((r) => r && r[0] ? r[0] : null).catch(() => null);
|
|
1949
|
-
function
|
|
1950
|
-
return
|
|
1943
|
+
function Fs(n) {
|
|
1944
|
+
return be({
|
|
1951
1945
|
settings: {
|
|
1952
1946
|
type: "json",
|
|
1953
1947
|
validSuccess: !0,
|
|
@@ -1962,7 +1956,7 @@ function Ms(n) {
|
|
|
1962
1956
|
}
|
|
1963
1957
|
class de {
|
|
1964
1958
|
constructor(e = ne) {
|
|
1965
|
-
this.req = e, this.api =
|
|
1959
|
+
this.req = e, this.api = us(e), this.uploader = fs(e);
|
|
1966
1960
|
}
|
|
1967
1961
|
api;
|
|
1968
1962
|
pluginCaches = {};
|
|
@@ -2046,7 +2040,7 @@ class de {
|
|
|
2046
2040
|
return await this.api("clearStaticFiles", e).catch(() => "");
|
|
2047
2041
|
}
|
|
2048
2042
|
async getPluginMaterial(e) {
|
|
2049
|
-
const { urls: t = [] } = e, s = t.filter((
|
|
2043
|
+
const { urls: t = [] } = e, s = t.filter((o) => it(o))[0];
|
|
2050
2044
|
if (!s) return null;
|
|
2051
2045
|
const r = this.pluginCaches[s];
|
|
2052
2046
|
return r || (this.pluginCaches[s] = ne.send({
|
|
@@ -2056,18 +2050,18 @@ class de {
|
|
|
2056
2050
|
validSuccess: !1,
|
|
2057
2051
|
originResponse: !0
|
|
2058
2052
|
}
|
|
2059
|
-
}).then((
|
|
2053
|
+
}).then((o) => o.data).catch(() => null));
|
|
2060
2054
|
}
|
|
2061
2055
|
async genSource(e) {
|
|
2062
2056
|
return console.log("BaseService.genSource", e), "";
|
|
2063
2057
|
}
|
|
2064
2058
|
}
|
|
2065
|
-
const $ = new
|
|
2059
|
+
const $ = new et({
|
|
2066
2060
|
type: "local",
|
|
2067
2061
|
expired: 0,
|
|
2068
2062
|
prefix: "__VTJ_"
|
|
2069
2063
|
});
|
|
2070
|
-
class
|
|
2064
|
+
class ks extends de {
|
|
2071
2065
|
init(e) {
|
|
2072
2066
|
const t = new U(e), s = $.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
|
|
2073
2067
|
return $.save(`project_${t.id}`, r), Promise.resolve(r);
|
|
@@ -2095,13 +2089,13 @@ class Ts extends de {
|
|
|
2095
2089
|
removeHistory(e) {
|
|
2096
2090
|
const t = $.get(`history_${e}`);
|
|
2097
2091
|
if (t) {
|
|
2098
|
-
const r = (t.items || []).map((
|
|
2092
|
+
const r = (t.items || []).map((o) => o.id);
|
|
2099
2093
|
this.removeHistoryItem(e, r), $.remove(`history_${e}`);
|
|
2100
2094
|
}
|
|
2101
2095
|
return Promise.resolve(!0);
|
|
2102
2096
|
}
|
|
2103
2097
|
getHistory(e) {
|
|
2104
|
-
const t = $.get(`history_${e}`), s = new
|
|
2098
|
+
const t = $.get(`history_${e}`), s = new $e(t || { id: e });
|
|
2105
2099
|
return Promise.resolve(s.toDsl());
|
|
2106
2100
|
}
|
|
2107
2101
|
getHistoryItem(e, t) {
|
|
@@ -2117,7 +2111,7 @@ class Ts extends de {
|
|
|
2117
2111
|
}), Promise.resolve(!0);
|
|
2118
2112
|
}
|
|
2119
2113
|
}
|
|
2120
|
-
class
|
|
2114
|
+
class ps extends de {
|
|
2121
2115
|
projects = {};
|
|
2122
2116
|
materials = {};
|
|
2123
2117
|
files = {};
|
|
@@ -2150,13 +2144,13 @@ class ms extends de {
|
|
|
2150
2144
|
removeHistory(e) {
|
|
2151
2145
|
const t = this.histories[e];
|
|
2152
2146
|
if (t) {
|
|
2153
|
-
const r = (t.items || []).map((
|
|
2147
|
+
const r = (t.items || []).map((o) => o.id);
|
|
2154
2148
|
this.removeHistoryItem(e, r), delete this.historyItems[e];
|
|
2155
2149
|
}
|
|
2156
2150
|
return Promise.resolve(!0);
|
|
2157
2151
|
}
|
|
2158
2152
|
getHistory(e) {
|
|
2159
|
-
const t = this.histories[e], s = new
|
|
2153
|
+
const t = this.histories[e], s = new $e(t || { id: e });
|
|
2160
2154
|
return Promise.resolve(s);
|
|
2161
2155
|
}
|
|
2162
2156
|
getHistoryItem(e, t) {
|
|
@@ -2175,10 +2169,10 @@ class ms extends de {
|
|
|
2175
2169
|
}
|
|
2176
2170
|
}
|
|
2177
2171
|
let L = null;
|
|
2178
|
-
function
|
|
2179
|
-
return L || (L = new
|
|
2172
|
+
function Os() {
|
|
2173
|
+
return L || (L = new ps(), L);
|
|
2180
2174
|
}
|
|
2181
|
-
class
|
|
2175
|
+
class Ms extends de {
|
|
2182
2176
|
getFileCaches = {};
|
|
2183
2177
|
async getExtension() {
|
|
2184
2178
|
return await this.api("getExtension", {}).catch(() => {
|
|
@@ -2236,82 +2230,82 @@ class Ds extends de {
|
|
|
2236
2230
|
}
|
|
2237
2231
|
}
|
|
2238
2232
|
export {
|
|
2239
|
-
|
|
2240
|
-
|
|
2233
|
+
_s as ACCESS,
|
|
2234
|
+
Fe as ACCESS_KEY,
|
|
2241
2235
|
pe as Access,
|
|
2242
|
-
|
|
2243
|
-
|
|
2236
|
+
ot as BUILD_IN_TAGS,
|
|
2237
|
+
st as BUILT_IN_DIRECTIVES,
|
|
2244
2238
|
de as BaseService,
|
|
2245
|
-
|
|
2246
|
-
|
|
2239
|
+
Se as CONTEXT_HOST,
|
|
2240
|
+
Ct as Context,
|
|
2247
2241
|
w as ContextMode,
|
|
2248
|
-
|
|
2242
|
+
nt as DATA_TYPES,
|
|
2249
2243
|
N as HOMEPAGE_ROUTE_NAME,
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2244
|
+
rt as HTML_TAGS,
|
|
2245
|
+
Es as JSCodeToString,
|
|
2246
|
+
ys as LIFE_CYCLES_LIST,
|
|
2247
|
+
Ms as LocalService,
|
|
2248
|
+
ps as MemoryService,
|
|
2249
|
+
cs as NodeEnv,
|
|
2256
2250
|
x as PAGE_ROUTE_NAME,
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2251
|
+
ls as Provider,
|
|
2252
|
+
vs as REMOTE,
|
|
2253
|
+
ks as StorageService,
|
|
2260
2254
|
T as VTJ_RENDERER_VERSION,
|
|
2261
|
-
|
|
2255
|
+
$s as adoptStylesToInline,
|
|
2262
2256
|
fe as adoptedStyleSheets,
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2257
|
+
Ps as clearLoaderCache,
|
|
2258
|
+
ft as compileScopedCSS,
|
|
2259
|
+
ht as convertCssRpx,
|
|
2260
|
+
Rs as createAccess,
|
|
2261
|
+
js as createAdapter,
|
|
2262
|
+
ws as createAssetScripts,
|
|
2263
|
+
Ss as createAssetsCss,
|
|
2264
|
+
Tt as createDataSources,
|
|
2271
2265
|
ae as createLoader,
|
|
2272
|
-
|
|
2266
|
+
Os as createMemoryService,
|
|
2273
2267
|
J as createMenus,
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2268
|
+
bt as createMetaApi,
|
|
2269
|
+
Rt as createMock,
|
|
2270
|
+
As as createProvider,
|
|
2271
|
+
ie as createRenderer,
|
|
2272
|
+
$t as createSchemaApi,
|
|
2273
|
+
Et as createSchemaApis,
|
|
2274
|
+
Fs as createServiceRequest,
|
|
2275
|
+
Ht as defaultLoader,
|
|
2282
2276
|
B as fillBasePath,
|
|
2283
2277
|
D as getMock,
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2278
|
+
xe as getModifiers,
|
|
2279
|
+
Me as getPlugin,
|
|
2280
|
+
lt as getRawComponent,
|
|
2281
|
+
yt as isBuiltInTag,
|
|
2288
2282
|
G as isCSSUrl,
|
|
2289
|
-
|
|
2290
|
-
|
|
2283
|
+
_t as isJSCode,
|
|
2284
|
+
E as isJSExpression,
|
|
2291
2285
|
b as isJSFunction,
|
|
2292
|
-
|
|
2286
|
+
it as isJSON,
|
|
2293
2287
|
z as isJSUrl,
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2288
|
+
vt as isNativeTag,
|
|
2289
|
+
gt as isVuePlugin,
|
|
2290
|
+
mt as loadCss,
|
|
2291
|
+
Ae as loadCssUrl,
|
|
2292
|
+
Is as loadEnhance,
|
|
2293
|
+
Ie as loadScriptUrl,
|
|
2294
|
+
De as menusFilter,
|
|
2295
|
+
Pt as mockApi,
|
|
2296
|
+
jt as mockApis,
|
|
2297
|
+
ke as mockCleanup,
|
|
2304
2298
|
M as nodeRender,
|
|
2305
|
-
|
|
2299
|
+
ct as parseDeps,
|
|
2306
2300
|
H as parseExpression,
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2301
|
+
j as parseFunction,
|
|
2302
|
+
ut as parseUrls,
|
|
2303
|
+
He as providerKey,
|
|
2304
|
+
at as removeProdFlag,
|
|
2305
|
+
dt as rpxToPx,
|
|
2306
|
+
bs as setupPageSetting,
|
|
2307
|
+
Ce as toString,
|
|
2308
|
+
St as useAccess,
|
|
2309
|
+
Cs as useMask,
|
|
2310
|
+
Be as useProvider
|
|
2317
2311
|
};
|