@vtj/renderer 0.12.34 → 0.12.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/index.cjs +6 -5
- package/dist/index.mjs +736 -654
- package/package.json +5 -5
- package/types/utils/index.d.ts +1 -0
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
import { Base as
|
2
|
-
import { isUrl as
|
1
|
+
import { Base as xe, BUILT_IN_COMPONENTS as Ne, ProjectModel as B, HistoryModel as he } from "@vtj/core";
|
2
|
+
import { isUrl as Be, url as C, dedupArray as Ue, isString as P, isFunction as Y, logger as k, storage as V, cookie as W, toArray as ae, unRSA as ce, delay as me, createRequest as ge, jsonp as ve, merge as Le, pathToRegexp as qe, pathToRegexpMatch as Je, formDataToJson as Ke, cloneDeep as le, camelCase as b, upperFirst as ze, pick as Ve, request as Q, loadScript as ue, Storage as We, mapToObject as ne } from "@vtj/utils";
|
3
3
|
import * as U from "vue";
|
4
|
-
import { inject as
|
5
|
-
import { useRoute as
|
4
|
+
import { inject as ye, defineComponent as _e, h as X, ref as Z, defineAsyncComponent as pe, watchEffect as Ge } from "vue";
|
5
|
+
import { useRoute as we } from "vue-router";
|
6
6
|
/**!
|
7
7
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
8
8
|
* @name @vtj/renderer
|
9
9
|
* @author CHC chenhuachun1549@dingtalk.com
|
10
|
-
* @version 0.12.
|
10
|
+
* @version 0.12.36
|
11
11
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
12
12
|
*/
|
13
|
-
const
|
14
|
-
var _ = /* @__PURE__ */ ((
|
15
|
-
const
|
13
|
+
const I = "0.12.36";
|
14
|
+
var _ = /* @__PURE__ */ ((r) => (r.Runtime = "Runtime", r.Design = "Design", r.Raw = "Raw", r.VNode = "VNode", r))(_ || {});
|
15
|
+
const fe = [
|
16
16
|
"$el",
|
17
17
|
"$emit",
|
18
18
|
"$nextTick",
|
@@ -24,7 +24,7 @@ const le = [
|
|
24
24
|
"$props",
|
25
25
|
"$options",
|
26
26
|
"$forceUpdate"
|
27
|
-
],
|
27
|
+
], ts = [
|
28
28
|
"beforeCreate",
|
29
29
|
"created",
|
30
30
|
"beforeMount",
|
@@ -38,7 +38,7 @@ const le = [
|
|
38
38
|
"renderTriggered",
|
39
39
|
"activated",
|
40
40
|
"deactivated"
|
41
|
-
],
|
41
|
+
], Ye = [
|
42
42
|
"vIf",
|
43
43
|
"vElseIf",
|
44
44
|
"vElse",
|
@@ -47,7 +47,7 @@ const le = [
|
|
47
47
|
"vFor",
|
48
48
|
"vBind",
|
49
49
|
"vHtml"
|
50
|
-
],
|
50
|
+
], Qe = {
|
51
51
|
String,
|
52
52
|
Number,
|
53
53
|
Boolean,
|
@@ -55,199 +55,281 @@ const le = [
|
|
55
55
|
Object,
|
56
56
|
Function,
|
57
57
|
Date
|
58
|
-
}, M = "VtjPage",
|
58
|
+
}, M = "VtjPage", N = "VtjHomepage", Xe = "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".split(
|
59
59
|
","
|
60
|
-
),
|
61
|
-
function
|
62
|
-
return
|
60
|
+
), Ze = "component,slot".split(",");
|
61
|
+
function O(r, e) {
|
62
|
+
return r.map((t) => Be(t) || t.startsWith("/") ? t : `${e}${t}`);
|
63
63
|
}
|
64
|
-
function
|
65
|
-
return /\.css$/.test(
|
64
|
+
function L(r) {
|
65
|
+
return /\.css$/.test(r);
|
66
66
|
}
|
67
|
-
function
|
68
|
-
return /\.js$/.test(
|
67
|
+
function q(r) {
|
68
|
+
return /\.js$/.test(r);
|
69
69
|
}
|
70
|
-
function
|
71
|
-
return /\.json$/.test(
|
70
|
+
function et(r) {
|
71
|
+
return /\.json$/.test(r);
|
72
72
|
}
|
73
|
-
function
|
74
|
-
return
|
75
|
-
(e) => `<script src="${C.append(e, { v:
|
73
|
+
function ss(r) {
|
74
|
+
return r.map(
|
75
|
+
(e) => `<script src="${C.append(e, { v: I })}"><\/script>`
|
76
76
|
).join("");
|
77
77
|
}
|
78
|
-
function
|
79
|
-
return
|
80
|
-
(e) => `<link rel="stylesheet" href="${C.append(e, { v:
|
78
|
+
function rs(r = []) {
|
79
|
+
return r.map(
|
80
|
+
(e) => `<link rel="stylesheet" href="${C.append(e, { v: I })}" />`
|
81
81
|
).join("");
|
82
82
|
}
|
83
|
-
function
|
84
|
-
return e &&
|
83
|
+
function tt(r, e = !1) {
|
84
|
+
return e && r.endsWith(".prod.js") ? r.replace(".prod.js", ".js") : r;
|
85
85
|
}
|
86
|
-
function
|
87
|
-
const s =
|
86
|
+
function st(r, e, t = !1) {
|
87
|
+
const s = r.filter((h) => !!h.enabled), n = [], i = [], a = [], o = [], p = {}, c = {}, u = [], l = {};
|
88
88
|
return s.forEach(
|
89
89
|
({ urls: h, assetsUrl: f, library: d, assetsLibrary: m, localeLibrary: v }) => {
|
90
90
|
h?.forEach((g) => {
|
91
|
-
|
92
|
-
}), d && (o.push(d),
|
91
|
+
q(g) && n.push(tt(g, t)), L(g) && i.push(g);
|
92
|
+
}), d && (o.push(d), p[d] = O(h || [], e), v && (c[d] = v)), f && a.push(f), m && u.push(m), d && m && (l[m] = d);
|
93
93
|
}
|
94
94
|
), {
|
95
|
-
scripts:
|
96
|
-
css:
|
97
|
-
materials:
|
95
|
+
scripts: O(n, e),
|
96
|
+
css: O(i, e),
|
97
|
+
materials: O(a, e),
|
98
98
|
libraryExports: o,
|
99
99
|
materialExports: Ue(u),
|
100
|
-
materialMapLibrary:
|
101
|
-
libraryMap:
|
102
|
-
libraryLocaleMap:
|
100
|
+
materialMapLibrary: l,
|
101
|
+
libraryMap: p,
|
102
|
+
libraryLocaleMap: c
|
103
103
|
};
|
104
104
|
}
|
105
|
-
function
|
106
|
-
const { name: t, parent: s, alias:
|
107
|
-
return s ? e[s]?.[
|
105
|
+
function rt(r, e) {
|
106
|
+
const { name: t, parent: s, alias: n } = r;
|
107
|
+
return s ? e[s]?.[n || t] : e[n || t];
|
108
108
|
}
|
109
|
-
function nt(
|
110
|
-
const e =
|
109
|
+
function nt(r = []) {
|
110
|
+
const e = r.filter((s) => L(s)), t = r.filter((s) => q(s));
|
111
111
|
return {
|
112
112
|
css: e,
|
113
113
|
js: t
|
114
114
|
};
|
115
115
|
}
|
116
|
-
function
|
117
|
-
const t =
|
118
|
-
|
119
|
-
|
120
|
-
(
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
const
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
116
|
+
function it(r, e) {
|
117
|
+
const t = (c) => {
|
118
|
+
const u = [];
|
119
|
+
let l = 0;
|
120
|
+
for (; l < c.length; ) {
|
121
|
+
if (/\s/.test(c[l])) {
|
122
|
+
l++;
|
123
|
+
continue;
|
124
|
+
}
|
125
|
+
if (c.substring(l, l + 2) === "/*") {
|
126
|
+
const g = c.indexOf("*/", l + 2);
|
127
|
+
if (g !== -1) {
|
128
|
+
l = g + 2;
|
129
|
+
continue;
|
130
|
+
}
|
131
|
+
}
|
132
|
+
if (c[l] === "@") {
|
133
|
+
const g = l;
|
134
|
+
for (; l < c.length && c[l] !== "{" && c[l] !== ";"; )
|
135
|
+
l++;
|
136
|
+
const $ = c.substring(g, l).trim(), w = $.includes("@keyframes");
|
137
|
+
if (c[l] === ";")
|
138
|
+
u.push({
|
139
|
+
type: "simple-at-rule",
|
140
|
+
content: c.substring(g, l + 1)
|
141
|
+
}), l++;
|
142
|
+
else if (c[l] === "{") {
|
143
|
+
const J = l + 1;
|
144
|
+
let A = 1;
|
145
|
+
for (l++; l < c.length && A > 0; )
|
146
|
+
c[l] === "{" ? A++ : c[l] === "}" && A--, l++;
|
147
|
+
const K = c.substring(g, l), E = c.substring(J, l - 1);
|
148
|
+
u.push({
|
149
|
+
type: w ? "keyframes" : "at-rule",
|
150
|
+
rule: $,
|
151
|
+
content: K,
|
152
|
+
inner: E
|
153
|
+
});
|
154
|
+
}
|
155
|
+
continue;
|
156
|
+
}
|
157
|
+
const h = l;
|
158
|
+
for (; l < c.length && c[l] !== "{"; )
|
159
|
+
l++;
|
160
|
+
if (l >= c.length) break;
|
161
|
+
const f = c.substring(h, l).trim();
|
162
|
+
if (!f) {
|
163
|
+
l++;
|
164
|
+
continue;
|
165
|
+
}
|
166
|
+
const d = l + 1;
|
167
|
+
let m = 1;
|
168
|
+
for (l++; l < c.length && m > 0; )
|
169
|
+
c[l] === "{" ? m++ : c[l] === "}" && m--, l++;
|
170
|
+
const v = c.substring(d, l - 1);
|
171
|
+
u.push({
|
172
|
+
type: "rule",
|
173
|
+
selector: f,
|
174
|
+
content: v.trim()
|
175
|
+
});
|
176
|
+
}
|
177
|
+
return u;
|
178
|
+
}, s = (c) => {
|
179
|
+
const u = c.trim();
|
180
|
+
return /^(from|to|\d+(\.\d+)?%)$/.test(u);
|
181
|
+
}, n = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (u, l, h) => {
|
182
|
+
const f = l.trim(), d = h.trim();
|
183
|
+
return f ? `${f}[${e}] ${d}` : d;
|
184
|
+
}), i = (c) => {
|
185
|
+
const u = c.trim();
|
186
|
+
if (!u || u.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(u) || s(u))
|
187
|
+
return u;
|
188
|
+
const l = u.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
|
189
|
+
if (l) {
|
190
|
+
const [, h, f = ""] = l, d = h.trim();
|
191
|
+
return d ? `${d}[${e}]${f}` : u;
|
192
|
+
}
|
193
|
+
return `${u}[${e}]`;
|
194
|
+
}, a = (c) => n(c).split(",").map((l) => i(l)).filter((l) => l.trim()).join(", "), o = (c) => c.map((u) => {
|
195
|
+
switch (u.type) {
|
196
|
+
case "simple-at-rule":
|
197
|
+
return u.content;
|
198
|
+
case "keyframes":
|
199
|
+
return u.content;
|
200
|
+
case "at-rule":
|
201
|
+
try {
|
202
|
+
const h = t(u.inner), f = o(h);
|
203
|
+
return `${u.rule} { ${f} }`;
|
204
|
+
} catch {
|
205
|
+
return u.content;
|
206
|
+
}
|
207
|
+
case "rule":
|
208
|
+
if (!u.selector || !u.content)
|
209
|
+
return "";
|
210
|
+
const l = a(u.selector);
|
211
|
+
return l.trim() ? `${l} { ${u.content} }` : "";
|
212
|
+
default:
|
213
|
+
return "";
|
214
|
+
}
|
215
|
+
}).filter((u) => u.trim()).join(" "), p = (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();
|
216
|
+
try {
|
217
|
+
const c = r.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g, "").replace(/^\s+|\s+$/gm, "").replace(/\n\s*\n/g, `
|
218
|
+
`), u = t(c), l = o(u);
|
219
|
+
return p(l);
|
220
|
+
} catch (c) {
|
221
|
+
return console.error("CSS scoping failed:", c), console.error("Input CSS:", r), r.replace(/\/\*[\s\S]*?\*\//g, "").replace(
|
222
|
+
/(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,
|
223
|
+
(u) => u
|
224
|
+
).replace(/([^{}@]+)(?=\s*{)/g, (u) => {
|
225
|
+
const l = u.trim();
|
226
|
+
return !l || l.startsWith("@") || l.includes(`[${e}]`) || s(l) ? u : `${l}[${e}]`;
|
227
|
+
});
|
228
|
+
}
|
147
229
|
}
|
148
|
-
function
|
149
|
-
return
|
230
|
+
function Se(r) {
|
231
|
+
return P(r) ? r : JSON.stringify(r);
|
150
232
|
}
|
151
|
-
function
|
152
|
-
const
|
153
|
-
if (
|
154
|
-
const o = new
|
233
|
+
function $e(r, e, t, s = !1) {
|
234
|
+
const n = r.CSSStyleSheet, i = s ? `data-v-${e}` : e, a = s ? it(t, i) : t;
|
235
|
+
if (n.prototype.replaceSync) {
|
236
|
+
const o = new n();
|
155
237
|
o.id = e, o.replaceSync(a);
|
156
|
-
const
|
157
|
-
(
|
238
|
+
const p = r.document, c = p.adoptedStyleSheets, u = Array.from(c).filter(
|
239
|
+
(l) => l.id !== e
|
158
240
|
);
|
159
|
-
|
241
|
+
p.adoptedStyleSheets = [...u, o];
|
160
242
|
} else {
|
161
|
-
const o =
|
162
|
-
let
|
163
|
-
|
243
|
+
const o = r.document;
|
244
|
+
let p = o.getElementById(e);
|
245
|
+
p ? p.innerHTML = a : (p = o.createElement("style"), p.id = e, p.innerHTML = a, o.head.appendChild(p));
|
164
246
|
}
|
165
247
|
}
|
166
|
-
async function
|
248
|
+
async function ot(r, e) {
|
167
249
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
168
|
-
t &&
|
250
|
+
t && $e(window, r, t);
|
169
251
|
}
|
170
|
-
function
|
252
|
+
function je(r, e = window) {
|
171
253
|
const t = e.document, s = e.document.head;
|
172
|
-
for (const
|
173
|
-
if (!t.getElementById(
|
254
|
+
for (const n of r)
|
255
|
+
if (!t.getElementById(n)) {
|
174
256
|
const a = t.createElement("link");
|
175
|
-
a.rel = "stylesheet", a.id =
|
257
|
+
a.rel = "stylesheet", a.id = n, a.href = n, s.appendChild(a);
|
176
258
|
}
|
177
259
|
}
|
178
|
-
async function
|
179
|
-
const s = t.document,
|
260
|
+
async function Ee(r, e, t = window) {
|
261
|
+
const s = t.document, n = t.document.head;
|
180
262
|
let i = t[e];
|
181
263
|
return i ? i.default || i : new Promise((a, o) => {
|
182
|
-
for (const
|
183
|
-
const
|
184
|
-
|
264
|
+
for (const p of r) {
|
265
|
+
const c = s.createElement("script");
|
266
|
+
c.src = p, c.onload = () => {
|
185
267
|
i = t[e], i ? a(i.default || i) : o(null);
|
186
|
-
},
|
268
|
+
}, c.onerror = (u) => {
|
187
269
|
o(u);
|
188
|
-
},
|
270
|
+
}, n.appendChild(c);
|
189
271
|
}
|
190
272
|
});
|
191
273
|
}
|
192
|
-
function
|
193
|
-
return
|
274
|
+
function at(r) {
|
275
|
+
return Y(r) || Y(r?.install);
|
194
276
|
}
|
195
|
-
function
|
196
|
-
return
|
277
|
+
function ct(r) {
|
278
|
+
return Ze.includes(r);
|
197
279
|
}
|
198
|
-
function
|
199
|
-
return
|
280
|
+
function lt(r) {
|
281
|
+
return Xe.includes(r);
|
200
282
|
}
|
201
|
-
function
|
283
|
+
function D(r = window) {
|
202
284
|
const e = window?.Mock;
|
203
285
|
if (e) return e;
|
204
|
-
const t =
|
286
|
+
const t = r?.Mock;
|
205
287
|
if (t && window)
|
206
288
|
return window.Mock = t, t;
|
207
289
|
}
|
208
|
-
function ns(
|
290
|
+
function ns(r, e, t) {
|
209
291
|
Object.assign(e.meta, t.meta);
|
210
|
-
const s =
|
292
|
+
const s = r?._container;
|
211
293
|
t?.type === "page" && s.classList.add("is-page"), t?.pure && s.classList.add("is-pure");
|
212
294
|
}
|
213
|
-
function
|
295
|
+
function T(r, e, t = !1, s = !1) {
|
214
296
|
try {
|
215
|
-
const
|
216
|
-
|
217
|
-
let i = (
|
218
|
-
i = i.replace(/this(\W|$)/g, (o,
|
297
|
+
const n = ['"use strict";', "var __self = arguments[0];"];
|
298
|
+
n.push("return ");
|
299
|
+
let i = (r.value || "").trim();
|
300
|
+
i = i.replace(/this(\W|$)/g, (o, p) => `__self${p}`), i = n.join(`
|
219
301
|
`) + i;
|
220
302
|
const a = `with(${t ? "{}" : "$scope || {}"}) { ${i} }`;
|
221
303
|
return new Function("$scope", a)(e);
|
222
|
-
} catch (
|
223
|
-
if (
|
224
|
-
throw
|
304
|
+
} catch (n) {
|
305
|
+
if (k.error("parseExpression.error", n, r, e?.__self ?? e), s)
|
306
|
+
throw n;
|
225
307
|
}
|
226
308
|
}
|
227
|
-
function
|
228
|
-
const
|
229
|
-
if (typeof
|
309
|
+
function ee(r, e, t = !1, s = !1) {
|
310
|
+
const n = T(r, e, t, s);
|
311
|
+
if (typeof n != "function" && (k.error(
|
230
312
|
"parseFunction.error",
|
231
313
|
"not a function",
|
232
|
-
|
314
|
+
r,
|
233
315
|
e?.__self ?? e
|
234
316
|
), s))
|
235
|
-
throw new Error(`"${
|
236
|
-
return
|
317
|
+
throw new Error(`"${r.value}" not a function`);
|
318
|
+
return n;
|
237
319
|
}
|
238
|
-
function
|
239
|
-
return
|
320
|
+
function S(r) {
|
321
|
+
return r && r.type === "JSExpression";
|
240
322
|
}
|
241
|
-
function
|
242
|
-
return typeof
|
323
|
+
function H(r) {
|
324
|
+
return typeof r == "object" && r && r.type === "JSFunction";
|
243
325
|
}
|
244
|
-
function
|
245
|
-
return
|
326
|
+
function ut(r) {
|
327
|
+
return S(r) || H(r);
|
246
328
|
}
|
247
|
-
function
|
248
|
-
return
|
329
|
+
function is(r) {
|
330
|
+
return ut(r) ? r.value : JSON.stringify(r);
|
249
331
|
}
|
250
|
-
const
|
332
|
+
const pt = {
|
251
333
|
session: !1,
|
252
334
|
authKey: "Authorization",
|
253
335
|
storageKey: "ACCESS_STORAGE",
|
@@ -260,14 +342,14 @@ const ut = {
|
|
260
342
|
noPermissionMessage: "无权限访问该页面",
|
261
343
|
appName: "",
|
262
344
|
statusKey: "code"
|
263
|
-
},
|
264
|
-
class
|
345
|
+
}, be = Symbol("access");
|
346
|
+
class Pe {
|
265
347
|
options;
|
266
348
|
data = null;
|
267
349
|
mode = _.Raw;
|
268
350
|
interceptResponse = !0;
|
269
351
|
constructor(e) {
|
270
|
-
this.options = Object.assign({},
|
352
|
+
this.options = Object.assign({}, pt, e), this.loadData();
|
271
353
|
}
|
272
354
|
enableIntercept() {
|
273
355
|
this.interceptResponse = !0;
|
@@ -276,22 +358,22 @@ class Ee {
|
|
276
358
|
this.interceptResponse = !1;
|
277
359
|
}
|
278
360
|
connect(e) {
|
279
|
-
const { mode: t, router: s, request:
|
280
|
-
this.mode = t, s && this.mode === _.Raw && this.setGuard(s),
|
361
|
+
const { mode: t, router: s, request: n } = e;
|
362
|
+
this.mode = t, s && this.mode === _.Raw && this.setGuard(s), n && this.setRequest(n);
|
281
363
|
}
|
282
364
|
login(e) {
|
283
|
-
const { storageKey: t, storagePrefix: s, session:
|
284
|
-
this.setData(e), this.data && (
|
365
|
+
const { storageKey: t, storagePrefix: s, session: n, authKey: i } = this.options;
|
366
|
+
this.setData(e), this.data && (V.save(t, e, {
|
285
367
|
type: "local",
|
286
368
|
prefix: s
|
287
|
-
}),
|
369
|
+
}), n && W.set(i, this.data.token));
|
288
370
|
}
|
289
371
|
clear() {
|
290
|
-
const { storageKey: e, storagePrefix: t, session: s, authKey:
|
291
|
-
this.data = null,
|
372
|
+
const { storageKey: e, storagePrefix: t, session: s, authKey: n } = this.options;
|
373
|
+
this.data = null, V.remove(e, {
|
292
374
|
type: "local",
|
293
375
|
prefix: t
|
294
|
-
}), s &&
|
376
|
+
}), s && W.remove(n);
|
295
377
|
}
|
296
378
|
logout() {
|
297
379
|
this.clear(), this.toLogin();
|
@@ -304,22 +386,22 @@ class Ee {
|
|
304
386
|
}
|
305
387
|
can(e) {
|
306
388
|
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
307
|
-
return typeof e == "function" ? e(s) :
|
389
|
+
return typeof e == "function" ? e(s) : ae(e).every((i) => s[i] || s[t + "." + i]);
|
308
390
|
}
|
309
391
|
some(e) {
|
310
392
|
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
311
|
-
return
|
393
|
+
return ae(e).some((i) => s[i] || s[t + "." + i]);
|
312
394
|
}
|
313
395
|
install(e) {
|
314
|
-
e.config.globalProperties.$access = this, e.provide(
|
396
|
+
e.config.globalProperties.$access = this, e.provide(be, this);
|
315
397
|
}
|
316
398
|
isAuthPath(e) {
|
317
399
|
const { auth: t, isAuth: s } = this.options;
|
318
400
|
if (s)
|
319
401
|
return s(e);
|
320
402
|
if (e.path && typeof t == "string") {
|
321
|
-
const
|
322
|
-
return e.path ===
|
403
|
+
const n = t.split("#")[1] || t;
|
404
|
+
return e.path === n;
|
323
405
|
}
|
324
406
|
return !1;
|
325
407
|
}
|
@@ -332,17 +414,17 @@ class Ee {
|
|
332
414
|
setData(e) {
|
333
415
|
const { privateKey: t } = this.options;
|
334
416
|
if (Array.isArray(e) && t) {
|
335
|
-
const s = e.map((
|
417
|
+
const s = e.map((n) => ce(n, t));
|
336
418
|
try {
|
337
419
|
this.data = JSON.parse(s.join(""));
|
338
|
-
} catch (
|
339
|
-
console.warn(
|
420
|
+
} catch (n) {
|
421
|
+
console.warn(n);
|
340
422
|
}
|
341
423
|
return;
|
342
424
|
}
|
343
425
|
if (typeof e == "string")
|
344
426
|
try {
|
345
|
-
const s = t ?
|
427
|
+
const s = t ? ce(e, t) : e;
|
346
428
|
s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
|
347
429
|
} catch (s) {
|
348
430
|
console.warn(s);
|
@@ -351,7 +433,7 @@ class Ee {
|
|
351
433
|
this.data = e;
|
352
434
|
}
|
353
435
|
loadData() {
|
354
|
-
const { storageKey: e, storagePrefix: t } = this.options, s =
|
436
|
+
const { storageKey: e, storagePrefix: t } = this.options, s = V.get(e, {
|
355
437
|
type: "local",
|
356
438
|
prefix: t
|
357
439
|
});
|
@@ -359,7 +441,7 @@ class Ee {
|
|
359
441
|
}
|
360
442
|
isLogined() {
|
361
443
|
const { session: e, authKey: t } = this.options;
|
362
|
-
return e && t ? !!
|
444
|
+
return e && t ? !!W.get(t) : !!this.getToken();
|
363
445
|
}
|
364
446
|
hasRoutePermission(e) {
|
365
447
|
if (e.name === M) {
|
@@ -369,7 +451,7 @@ class Ee {
|
|
369
451
|
return !0;
|
370
452
|
}
|
371
453
|
setGuard(e) {
|
372
|
-
e.beforeEach((t, s,
|
454
|
+
e.beforeEach((t, s, n) => this.guard(t, n));
|
373
455
|
}
|
374
456
|
async guard(e, t) {
|
375
457
|
if (this.isWhiteList(e) || this.isAuthPath(e))
|
@@ -378,8 +460,8 @@ class Ee {
|
|
378
460
|
if (this.hasRoutePermission(e))
|
379
461
|
return t();
|
380
462
|
{
|
381
|
-
const { noPermissionMessage: s = "无权限访问", unauthorized:
|
382
|
-
return await this.showTip(s),
|
463
|
+
const { noPermissionMessage: s = "无权限访问", unauthorized: n = !1 } = this.options;
|
464
|
+
return await this.showTip(s), Y(n) ? (n(), t(!1)) : P(n) ? t(n) : t(!1);
|
383
465
|
}
|
384
466
|
}
|
385
467
|
t(!1), this.toLogin();
|
@@ -398,7 +480,7 @@ class Ee {
|
|
398
480
|
}
|
399
481
|
async showTip(e) {
|
400
482
|
const { alert: t } = this.options;
|
401
|
-
return t ? (await
|
483
|
+
return t ? (await me(150), await t(e, {
|
402
484
|
title: "提示",
|
403
485
|
type: "warning"
|
404
486
|
}).catch(() => !1)) : !1;
|
@@ -414,22 +496,22 @@ class Ee {
|
|
414
496
|
);
|
415
497
|
}
|
416
498
|
}
|
417
|
-
function
|
418
|
-
return
|
499
|
+
function ft() {
|
500
|
+
return ye(be, null);
|
419
501
|
}
|
420
|
-
function
|
502
|
+
function os(r = {}) {
|
421
503
|
const {
|
422
504
|
notify: e,
|
423
505
|
loading: t,
|
424
506
|
settings: s = {},
|
425
|
-
Startup:
|
507
|
+
Startup: n,
|
426
508
|
access: i,
|
427
509
|
useTitle: a,
|
428
510
|
alert: o
|
429
|
-
} =
|
430
|
-
let
|
511
|
+
} = r;
|
512
|
+
let p = null;
|
431
513
|
return {
|
432
|
-
request:
|
514
|
+
request: ge({
|
433
515
|
settings: {
|
434
516
|
type: "form",
|
435
517
|
validSuccess: !0,
|
@@ -441,97 +523,97 @@ function is(n = {}) {
|
|
441
523
|
e && e(u || "未知错误");
|
442
524
|
},
|
443
525
|
showLoading: () => {
|
444
|
-
|
526
|
+
p && p.close(), t && (p = t());
|
445
527
|
},
|
446
528
|
hideLoading: () => {
|
447
|
-
|
529
|
+
p && (p.close(), p = null);
|
448
530
|
},
|
449
531
|
...s
|
450
532
|
}
|
451
533
|
}),
|
452
|
-
jsonp:
|
534
|
+
jsonp: ve,
|
453
535
|
notify: e,
|
454
536
|
loading: t,
|
455
537
|
useTitle: a,
|
456
|
-
startupComponent:
|
457
|
-
access: i ? new
|
538
|
+
startupComponent: n,
|
539
|
+
access: i ? new Pe({ alert: o, ...i }) : void 0
|
458
540
|
};
|
459
541
|
}
|
460
|
-
function
|
461
|
-
return new
|
542
|
+
function as(r = {}) {
|
543
|
+
return new Pe(r);
|
462
544
|
}
|
463
|
-
function dt(
|
545
|
+
function dt(r, e) {
|
464
546
|
const { jsonp: t, request: s } = e;
|
465
|
-
if (
|
466
|
-
return (
|
467
|
-
...
|
468
|
-
query:
|
547
|
+
if (r.method === "jsonp")
|
548
|
+
return (n = {}) => t(r.url, {
|
549
|
+
...r.jsonpOptions,
|
550
|
+
query: n
|
469
551
|
});
|
470
552
|
{
|
471
|
-
const
|
472
|
-
url:
|
473
|
-
method:
|
553
|
+
const n = r.headers ? T(r.headers, {}, !0) : void 0, i = {
|
554
|
+
url: r.url,
|
555
|
+
method: r.method,
|
474
556
|
settings: {
|
475
|
-
...
|
476
|
-
headers:
|
557
|
+
...r.settings,
|
558
|
+
headers: n
|
477
559
|
}
|
478
560
|
};
|
479
|
-
return (a, o) => (delete i.data, s.send(
|
561
|
+
return (a, o) => (delete i.data, s.send(Le(i, o || {}, { data: a })));
|
480
562
|
}
|
481
563
|
}
|
482
|
-
function
|
564
|
+
function ht(r, e) {
|
483
565
|
const { metaQuery: t } = e;
|
484
566
|
if (!t) return;
|
485
|
-
const { code: s, queryCode:
|
567
|
+
const { code: s, queryCode: n } = r;
|
486
568
|
return (i, a) => {
|
487
569
|
if (!t) {
|
488
570
|
console.warn("adapter.metaQuery is not defined!");
|
489
571
|
return;
|
490
572
|
}
|
491
|
-
return t(s,
|
573
|
+
return t(s, n, i, a);
|
492
574
|
};
|
493
575
|
}
|
494
|
-
function
|
576
|
+
function mt(r = [], e = [], t) {
|
495
577
|
const s = {};
|
496
|
-
for (const
|
497
|
-
s[
|
498
|
-
for (const
|
499
|
-
s[
|
578
|
+
for (const n of r)
|
579
|
+
s[n.id] = dt(n, t);
|
580
|
+
for (const n of e)
|
581
|
+
s[n.id] = ht(n, t);
|
500
582
|
return s;
|
501
583
|
}
|
502
|
-
async function
|
503
|
-
const t =
|
504
|
-
t && (
|
584
|
+
async function gt(r = [], e = window) {
|
585
|
+
const t = D(e);
|
586
|
+
t && (Re(e), r.forEach((s) => yt(t, s)));
|
505
587
|
}
|
506
|
-
function
|
507
|
-
const t =
|
508
|
-
return async (...
|
588
|
+
function vt(r, e = window) {
|
589
|
+
const t = H(r.mockTemplate) && r.mockTemplate.value ? ee(r.mockTemplate, {}, !0) : void 0, s = D(e);
|
590
|
+
return async (...n) => {
|
509
591
|
let i = {};
|
510
592
|
if (t)
|
511
593
|
try {
|
512
|
-
i = await t.apply(t,
|
594
|
+
i = await t.apply(t, n);
|
513
595
|
} catch (a) {
|
514
|
-
|
596
|
+
k.warn("模拟数据模版异常", a);
|
515
597
|
}
|
516
598
|
return s?.mock(i);
|
517
599
|
};
|
518
600
|
}
|
519
|
-
function
|
601
|
+
function yt(r, e) {
|
520
602
|
if (!e.mock) return;
|
521
603
|
const { url: t, mockTemplate: s } = e;
|
522
604
|
if (t && s) {
|
523
|
-
const
|
524
|
-
|
525
|
-
const
|
526
|
-
return Object.assign(o, { data:
|
605
|
+
const n = qe(`${t}(.*)`), i = Je(t, { decode: decodeURIComponent }), a = T(s, {}, !0);
|
606
|
+
r.mock(n, (o) => {
|
607
|
+
const p = C.parse(o.url) || {}, c = o.body instanceof FormData ? Ke(o.body) : o.body, u = i(o.url)?.params;
|
608
|
+
return Object.assign(o, { data: c, params: p, query: u }), r.mock(a(o));
|
527
609
|
});
|
528
610
|
}
|
529
611
|
}
|
530
|
-
function
|
531
|
-
const e =
|
612
|
+
function Re(r = window) {
|
613
|
+
const e = D(r);
|
532
614
|
e && (e._mocked = {});
|
533
615
|
}
|
534
|
-
class
|
616
|
+
class _t {
|
535
617
|
__id = null;
|
536
618
|
__mode;
|
537
619
|
__instance = null;
|
@@ -557,15 +639,15 @@ class yt {
|
|
557
639
|
$apis = {};
|
558
640
|
__transform = {};
|
559
641
|
constructor(e) {
|
560
|
-
const { mode: t, dsl: s, attrs:
|
561
|
-
this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}),
|
642
|
+
const { mode: t, dsl: s, attrs: n } = e;
|
643
|
+
this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), n && Object.assign(this, n);
|
562
644
|
}
|
563
645
|
setup(e, t = U) {
|
564
646
|
const s = t.getCurrentInstance();
|
565
647
|
if (!s) return;
|
566
648
|
this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
|
567
|
-
const
|
568
|
-
Object.assign(this,
|
649
|
+
const n = s.appContext.config.globalProperties;
|
650
|
+
Object.assign(this, n), Object.assign(this, e || {}), this.__proxy(), t.onMounted(() => {
|
569
651
|
this.__proxy();
|
570
652
|
}), t.onUnmounted(() => {
|
571
653
|
this.__cleanup();
|
@@ -574,12 +656,12 @@ class yt {
|
|
574
656
|
});
|
575
657
|
}
|
576
658
|
__proxy() {
|
577
|
-
this.__instance &&
|
659
|
+
this.__instance && fe.forEach((e) => {
|
578
660
|
this[e] = this.__instance?.[e];
|
579
661
|
});
|
580
662
|
}
|
581
663
|
__cleanup() {
|
582
|
-
|
664
|
+
fe.forEach((e) => {
|
583
665
|
this[e] = null;
|
584
666
|
}), this.__reset();
|
585
667
|
}
|
@@ -589,35 +671,35 @@ class yt {
|
|
589
671
|
__parseFunction(e) {
|
590
672
|
if (e)
|
591
673
|
if (this.__mode === _.Runtime) {
|
592
|
-
const { id: t, type: s } = e,
|
593
|
-
return
|
674
|
+
const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
|
675
|
+
return ee({ type: s, value: n }, this);
|
594
676
|
} else
|
595
|
-
return
|
677
|
+
return ee(e, this);
|
596
678
|
}
|
597
679
|
__parseExpression(e) {
|
598
680
|
if (e)
|
599
681
|
if (this.__mode === _.Runtime) {
|
600
|
-
const { id: t, type: s } = e,
|
601
|
-
return
|
682
|
+
const { id: t, type: s } = e, n = t ? this.__transform[t] ?? e.value : e.value;
|
683
|
+
return T({ type: s, value: n }, this);
|
602
684
|
} else
|
603
|
-
return
|
685
|
+
return T(e, this);
|
604
686
|
}
|
605
687
|
__ref(e = null, t) {
|
606
688
|
if (this.__mode !== _.VNode)
|
607
689
|
return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
|
608
|
-
await
|
609
|
-
let
|
610
|
-
if (!
|
690
|
+
await me(0);
|
691
|
+
let n = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
|
692
|
+
if (!n) {
|
611
693
|
typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
|
612
694
|
return;
|
613
695
|
}
|
614
|
-
return
|
696
|
+
return n.nodeType === 3 && n.nextSibling && (n = n.nextSibling), n.__vtj__ = e, _.Design === this.__mode && (n.__context__ = this, n.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, s)), typeof t == "function" ? t(s) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, s)), s;
|
615
697
|
};
|
616
698
|
}
|
617
699
|
__getRefEl(e, t, s) {
|
618
|
-
const
|
619
|
-
if (
|
620
|
-
const i = new Set([].concat(
|
700
|
+
const n = e[t];
|
701
|
+
if (n && s !== n) {
|
702
|
+
const i = new Set([].concat(n, s));
|
621
703
|
return Array.from(i);
|
622
704
|
} else
|
623
705
|
return s;
|
@@ -630,133 +712,133 @@ class yt {
|
|
630
712
|
return s.context.__proto__ = this.context, s.__proto__ = this, s;
|
631
713
|
}
|
632
714
|
}
|
633
|
-
function
|
715
|
+
function te(r) {
|
634
716
|
const {
|
635
717
|
Vue: e = U,
|
636
718
|
mode: t = _.Runtime,
|
637
719
|
components: s = {},
|
638
|
-
libs:
|
720
|
+
libs: n = {},
|
639
721
|
apis: i = {},
|
640
722
|
loader: a
|
641
|
-
} =
|
723
|
+
} = r, o = e.computed(() => r.dsl), p = {
|
642
724
|
$components: s,
|
643
|
-
$libs:
|
725
|
+
$libs: n,
|
644
726
|
$apis: i
|
645
|
-
},
|
727
|
+
}, c = new _t({
|
646
728
|
mode: t,
|
647
729
|
dsl: o.value,
|
648
|
-
attrs:
|
730
|
+
attrs: p
|
649
731
|
}), u = e.defineComponent({
|
650
732
|
name: o.value.name,
|
651
733
|
__scopeId: o.value.id ? `data-v-${o.value.id}` : void 0,
|
652
734
|
props: {
|
653
|
-
...
|
735
|
+
...St(o.value.props ?? [], c)
|
654
736
|
},
|
655
|
-
setup(
|
656
|
-
|
657
|
-
|
737
|
+
setup(l) {
|
738
|
+
c.$props = l, c.props = l, o.value.id && $e(
|
739
|
+
r.window || window,
|
658
740
|
o.value.id,
|
659
741
|
o.value.css || "",
|
660
742
|
!0
|
661
|
-
),
|
662
|
-
const h =
|
663
|
-
for (const [g,
|
664
|
-
d[g] = e.inject(g,
|
665
|
-
const m =
|
743
|
+
), c.state = $t(e, o.value.state ?? {}, c);
|
744
|
+
const h = jt(e, o.value.computed ?? {}, c), f = Et(o.value.methods ?? {}, c), d = bt(e, o.value.inject, c);
|
745
|
+
for (const [g, $] of Object.entries(d || {}))
|
746
|
+
d[g] = e.inject(g, $);
|
747
|
+
const m = Pt(
|
666
748
|
o.value.dataSources || {},
|
667
|
-
|
749
|
+
c
|
668
750
|
), v = {
|
669
751
|
...d,
|
670
752
|
...h,
|
671
753
|
...f,
|
672
754
|
...m
|
673
755
|
};
|
674
|
-
return
|
675
|
-
vtj:
|
756
|
+
return c.setup(v, e), Rt(e, o.value.watch ?? [], c), {
|
757
|
+
vtj: c
|
676
758
|
};
|
677
759
|
},
|
678
|
-
emits:
|
760
|
+
emits: wt(o.value.emits),
|
679
761
|
expose: ["vtj"],
|
680
762
|
render() {
|
681
763
|
if (!o.value.nodes) return null;
|
682
|
-
const
|
683
|
-
return
|
684
|
-
(h) =>
|
764
|
+
const l = o.value.nodes || [];
|
765
|
+
return l.length === 1 ? F(l[0], c, e, a, l) : l.map(
|
766
|
+
(h) => F(h, c, e, a, l)
|
685
767
|
);
|
686
768
|
},
|
687
|
-
...
|
769
|
+
...Ct(o.value.lifeCycles ?? {}, c)
|
688
770
|
});
|
689
771
|
return {
|
690
772
|
renderer: e.markRaw(u),
|
691
|
-
context:
|
773
|
+
context: c
|
692
774
|
};
|
693
775
|
}
|
694
|
-
function
|
695
|
-
return
|
776
|
+
function wt(r = []) {
|
777
|
+
return r.map((e) => P(e) ? e : e.name);
|
696
778
|
}
|
697
|
-
function
|
698
|
-
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((i) =>
|
699
|
-
return
|
779
|
+
function St(r = [], e) {
|
780
|
+
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((i) => Qe[i]) : void 0;
|
781
|
+
return r.map((s) => P(s) ? {
|
700
782
|
name: s
|
701
783
|
} : {
|
702
784
|
name: s.name,
|
703
785
|
type: s.type,
|
704
786
|
required: s.required,
|
705
|
-
default:
|
787
|
+
default: S(s.default) ? e.__parseExpression(s.default) : s.default
|
706
788
|
}).reduce(
|
707
|
-
(s,
|
708
|
-
type: t(
|
709
|
-
required:
|
710
|
-
default:
|
789
|
+
(s, n) => (s[n.name] = {
|
790
|
+
type: t(n.type),
|
791
|
+
required: n.required,
|
792
|
+
default: n.default
|
711
793
|
}, s),
|
712
794
|
{}
|
713
795
|
);
|
714
796
|
}
|
715
|
-
function
|
716
|
-
return
|
797
|
+
function $t(r, e, t) {
|
798
|
+
return r.reactive(
|
717
799
|
Object.keys(e || {}).reduce(
|
718
|
-
(s,
|
719
|
-
let i = e[
|
720
|
-
return
|
800
|
+
(s, n) => {
|
801
|
+
let i = e[n];
|
802
|
+
return S(i) ? i = t.__parseExpression(i) : H(i) && (i = t.__parseFunction(i)), s[n] = i, s;
|
721
803
|
},
|
722
804
|
{}
|
723
805
|
)
|
724
806
|
);
|
725
807
|
}
|
726
|
-
function
|
808
|
+
function jt(r, e, t) {
|
727
809
|
return Object.entries(e ?? {}).reduce(
|
728
|
-
(s, [
|
810
|
+
(s, [n, i]) => (s[n] = r.computed(t.__parseFunction(i)), s),
|
729
811
|
{}
|
730
812
|
);
|
731
813
|
}
|
732
|
-
function Et(
|
733
|
-
return Object.entries(
|
734
|
-
(t, [s,
|
814
|
+
function Et(r, e) {
|
815
|
+
return Object.entries(r ?? {}).reduce(
|
816
|
+
(t, [s, n]) => (t[s] = e.__parseFunction(n), t),
|
735
817
|
{}
|
736
818
|
);
|
737
819
|
}
|
738
|
-
function
|
820
|
+
function bt(r, e = [], t) {
|
739
821
|
return e.reduce(
|
740
|
-
(s,
|
741
|
-
const { name: i, from: a } =
|
742
|
-
|
743
|
-
const o =
|
744
|
-
return s[i] =
|
822
|
+
(s, n) => {
|
823
|
+
const { name: i, from: a } = n || {};
|
824
|
+
n.default;
|
825
|
+
const o = S(a) ? t.__parseExpression(a) || i : a ?? i, p = S(n.default) ? t.__parseExpression(n.default) : n.default ?? null;
|
826
|
+
return s[i] = r.inject(o, p), s;
|
745
827
|
},
|
746
828
|
{}
|
747
829
|
);
|
748
830
|
}
|
749
|
-
function
|
750
|
-
return Object.keys(
|
831
|
+
function Pt(r, e) {
|
832
|
+
return Object.keys(r).reduce(
|
751
833
|
(t, s) => {
|
752
|
-
const
|
753
|
-
if (
|
754
|
-
t[s] =
|
755
|
-
else if (
|
756
|
-
const i = e.$apis[
|
834
|
+
const n = r[s];
|
835
|
+
if (n.type === "mock")
|
836
|
+
t[s] = vt(n);
|
837
|
+
else if (n.ref) {
|
838
|
+
const i = e.$apis[n.ref], a = H(n.transform) ? n.transform.value ? e.__parseFunction(n.transform) : void 0 : n.transform;
|
757
839
|
t[s] = async (...o) => {
|
758
|
-
const
|
759
|
-
return a ? a(
|
840
|
+
const p = await i.apply(e, o);
|
841
|
+
return a ? a(p) : p;
|
760
842
|
};
|
761
843
|
}
|
762
844
|
return t;
|
@@ -764,9 +846,9 @@ function Rt(n, e) {
|
|
764
846
|
{}
|
765
847
|
);
|
766
848
|
}
|
767
|
-
function
|
849
|
+
function Rt(r, e = [], t) {
|
768
850
|
e.forEach((s) => {
|
769
|
-
|
851
|
+
r.watch(
|
770
852
|
t.__parseExpression(s.source),
|
771
853
|
t.__parseFunction(s.handler),
|
772
854
|
{
|
@@ -776,277 +858,276 @@ function Pt(n, e = [], t) {
|
|
776
858
|
);
|
777
859
|
});
|
778
860
|
}
|
779
|
-
function
|
780
|
-
return Object.entries(
|
781
|
-
(t, [s,
|
861
|
+
function Ct(r, e) {
|
862
|
+
return Object.entries(r ?? {}).reduce(
|
863
|
+
(t, [s, n]) => (t[s] = e.__parseFunction(n), t),
|
782
864
|
{}
|
783
865
|
);
|
784
866
|
}
|
785
|
-
let
|
786
|
-
const
|
787
|
-
async function
|
788
|
-
const { urls: t = [], library: s } =
|
789
|
-
if (
|
790
|
-
const i = t.filter((o) =>
|
791
|
-
return i.length &&
|
792
|
-
(o) => (console.warn("loadScriptUrl error",
|
867
|
+
let G = [], R = {};
|
868
|
+
const kt = (r) => r;
|
869
|
+
async function Ce(r, e = window) {
|
870
|
+
const { urls: t = [], library: s } = r, n = t.filter((o) => q(o));
|
871
|
+
if (n.length === 0 || !s) return null;
|
872
|
+
const i = t.filter((o) => L(o));
|
873
|
+
return i.length && je(i, e), await Ee(n, s, e).catch(
|
874
|
+
(o) => (console.warn("loadScriptUrl error", n, s, o), null)
|
793
875
|
);
|
794
876
|
}
|
795
|
-
function
|
796
|
-
const { getDsl: e, getDslByUrl: t, options: s } =
|
797
|
-
return s.window && (
|
798
|
-
delete s.window[
|
799
|
-
}),
|
800
|
-
if (!i || typeof i == "string") return
|
877
|
+
function se(r) {
|
878
|
+
const { getDsl: e, getDslByUrl: t, options: s } = r;
|
879
|
+
return s.window && (G.forEach((n) => {
|
880
|
+
delete s.window[n];
|
881
|
+
}), G = []), (n, i, a = U) => {
|
882
|
+
if (!i || typeof i == "string") return n;
|
801
883
|
if (i.type === "Schema" && i.id)
|
802
884
|
return a.defineAsyncComponent(async () => {
|
803
|
-
const o =
|
804
|
-
return o && (o.name =
|
885
|
+
const o = R[i.id] || await e(i.id);
|
886
|
+
return o && (o.name = n, R[i.id] = o), o ? te({
|
805
887
|
...s,
|
806
888
|
Vue: a,
|
807
|
-
dsl:
|
889
|
+
dsl: le(o),
|
808
890
|
mode: _.Runtime,
|
809
|
-
loader:
|
891
|
+
loader: se(r)
|
810
892
|
}).renderer : null;
|
811
893
|
});
|
812
894
|
if (i.type === "UrlSchema" && i.url)
|
813
895
|
return a.defineAsyncComponent(async () => {
|
814
|
-
const o =
|
815
|
-
return o && (o.name =
|
896
|
+
const o = R[i.url] || await t(i.url);
|
897
|
+
return o && (o.name = n, R[i.url] = o), o ? te({
|
816
898
|
...s,
|
817
899
|
Vue: a,
|
818
|
-
dsl:
|
900
|
+
dsl: le(o),
|
819
901
|
mode: _.Runtime,
|
820
|
-
loader:
|
902
|
+
loader: se(r)
|
821
903
|
}).renderer : null;
|
822
904
|
});
|
823
905
|
if (i.type === "Plugin") {
|
824
|
-
let o = i.library ?
|
825
|
-
return o || (i.library &&
|
906
|
+
let o = i.library ? R[i.library] : null;
|
907
|
+
return o || (i.library && G.push(i.library), o = R[i.library || Symbol()] = a.defineAsyncComponent(
|
826
908
|
async () => {
|
827
|
-
const
|
828
|
-
return
|
909
|
+
const p = await Ce(i, s.window);
|
910
|
+
return p || (console.warn("getPlugin result is null", i), null);
|
829
911
|
}
|
830
912
|
), o);
|
831
913
|
}
|
832
|
-
return
|
914
|
+
return n;
|
833
915
|
};
|
834
916
|
}
|
835
|
-
function
|
836
|
-
|
917
|
+
function cs() {
|
918
|
+
R = {};
|
837
919
|
}
|
838
|
-
function
|
839
|
-
if (!
|
840
|
-
const a = t.getCurrentInstance()?.appContext, { id: o = null, directives:
|
841
|
-
if (!i && (u ||
|
920
|
+
function F(r, e, t = U, s = kt, n = [], i = !1) {
|
921
|
+
if (!r || !r.name || r.invisible) return null;
|
922
|
+
const a = t.getCurrentInstance()?.appContext, { id: o = null, directives: p = [] } = r, { vIf: c, vElseIf: u, vElse: l, vFor: h, vShow: f, vModels: d, vBind: m, vHtml: v, others: g } = ke(p);
|
923
|
+
if (!i && (u || l))
|
842
924
|
return null;
|
843
|
-
if (
|
844
|
-
return
|
845
|
-
const
|
846
|
-
const
|
847
|
-
if (
|
848
|
-
return
|
849
|
-
if (
|
850
|
-
const
|
851
|
-
return
|
852
|
-
})(),
|
853
|
-
if (
|
854
|
-
return
|
855
|
-
m && Object.assign(
|
856
|
-
|
857
|
-
|
858
|
-
)), v && Object.assign(
|
859
|
-
Object.assign(
|
925
|
+
if (c && !At(c, e))
|
926
|
+
return Tt(r, e, t, s, n);
|
927
|
+
const $ = (w, J = 0) => {
|
928
|
+
const A = w.$components, K = (() => {
|
929
|
+
if (r.name === "component")
|
930
|
+
return It(w, r.props?.is);
|
931
|
+
if (r.name === "slot") return r.name;
|
932
|
+
const j = s(r.name, r.from, t);
|
933
|
+
return P(j) ? ct(j) || lt(j) ? j : A[j] ?? a?.app?.component(j) ?? j : j;
|
934
|
+
})(), E = Mt(o, r.props ?? {}, w), He = Dt(t, r.events ?? {}, w);
|
935
|
+
if (r.name === "slot")
|
936
|
+
return Ht(t, r, E, w, s);
|
937
|
+
m && Object.assign(E, w.__parseExpression(m.value)), f && (E.style = Object.assign(
|
938
|
+
E.style ?? {},
|
939
|
+
xt(f, w)
|
940
|
+
)), v && Object.assign(E, Nt(v, w)), d.forEach((j) => {
|
941
|
+
Object.assign(E, Bt(t, j, w));
|
860
942
|
});
|
861
|
-
const
|
943
|
+
const Oe = Ut(
|
862
944
|
t,
|
863
|
-
|
864
|
-
|
945
|
+
r.children ?? [],
|
946
|
+
w,
|
865
947
|
s,
|
866
|
-
|
948
|
+
r
|
949
|
+
);
|
950
|
+
let z = t.createVNode(
|
951
|
+
K,
|
952
|
+
{ key: `${o}_${J}`, ...E, ...He },
|
953
|
+
Oe
|
867
954
|
);
|
868
|
-
|
869
|
-
|
870
|
-
return ne.length && (q = t.withDirectives(q, ne)), q;
|
955
|
+
const oe = a ? Ft(a, g, w) : [];
|
956
|
+
return oe.length && (z = t.withDirectives(z, oe)), z;
|
871
957
|
};
|
872
|
-
return h ?
|
958
|
+
return h ? Jt(h, $, e) : $(e);
|
873
959
|
}
|
874
|
-
function
|
875
|
-
const s =
|
876
|
-
return e.map((
|
877
|
-
const i = typeof
|
960
|
+
function Ft(r, e, t) {
|
961
|
+
const s = r.app;
|
962
|
+
return e.map((n) => {
|
963
|
+
const i = typeof n.name == "string" ? s.directive(n.name) : t.__parseExpression(n.name);
|
878
964
|
if (!i) return null;
|
879
965
|
const a = [i];
|
880
|
-
return
|
881
|
-
}).filter((
|
882
|
-
}
|
883
|
-
function
|
884
|
-
const e =
|
885
|
-
(u) =>
|
886
|
-
), s =
|
887
|
-
(u) =>
|
888
|
-
),
|
889
|
-
(u) => !
|
966
|
+
return n.value && a.push(t.__parseExpression(n.value)), n.arg && a.push(n.arg), n.modifiers && a.push(n.modifiers), a;
|
967
|
+
}).filter((n) => !!n);
|
968
|
+
}
|
969
|
+
function ke(r = []) {
|
970
|
+
const e = r.find((u) => b(u.name) === "vIf"), t = r.find(
|
971
|
+
(u) => b(u.name) === "vElseIf"
|
972
|
+
), s = r.find((u) => b(u.name) === "vElse"), n = r.find((u) => b(u.name) === "vFor"), i = r.find((u) => b(u.name) === "vShow"), a = r.find((u) => b(u.name) === "vBind"), o = r.find((u) => b(u.name) === "vHtml"), p = r.filter(
|
973
|
+
(u) => b(u.name) === "vModel"
|
974
|
+
), c = r.filter(
|
975
|
+
(u) => !Ye.includes(b(u.name))
|
890
976
|
);
|
891
977
|
return {
|
892
978
|
vIf: e,
|
893
979
|
vElseIf: t,
|
894
980
|
vElse: s,
|
895
|
-
vFor:
|
981
|
+
vFor: n,
|
896
982
|
vShow: i,
|
897
|
-
vModels:
|
983
|
+
vModels: p,
|
898
984
|
vBind: a,
|
899
|
-
others:
|
985
|
+
others: c,
|
900
986
|
vHtml: o
|
901
987
|
};
|
902
988
|
}
|
903
|
-
function
|
904
|
-
return !!e.__parseExpression(
|
989
|
+
function At(r, e) {
|
990
|
+
return !!e.__parseExpression(r.value);
|
905
991
|
}
|
906
|
-
function
|
907
|
-
return e ?
|
992
|
+
function It(r, e) {
|
993
|
+
return e ? S(e) ? r.__parseExpression(e) : e : "div";
|
908
994
|
}
|
909
|
-
function Mt(
|
910
|
-
const s =
|
911
|
-
return s.ref = t.__ref(
|
995
|
+
function Mt(r, e, t) {
|
996
|
+
const s = re(e, t);
|
997
|
+
return s.ref = t.__ref(r, s.ref), s;
|
912
998
|
}
|
913
|
-
function
|
914
|
-
return
|
999
|
+
function re(r, e) {
|
1000
|
+
return S(r) ? e.__parseExpression(r) : H(r) ? e.__parseFunction(r) : Array.isArray(r) ? r.map((t) => re(t, e)) : typeof r == "object" ? Object.keys(r || {}).reduce(
|
915
1001
|
(t, s) => {
|
916
|
-
let
|
917
|
-
return t[s] =
|
1002
|
+
let n = r[s];
|
1003
|
+
return t[s] = re(n, e), t;
|
918
1004
|
},
|
919
1005
|
{}
|
920
|
-
) :
|
1006
|
+
) : r;
|
921
1007
|
}
|
922
|
-
function
|
923
|
-
const s = ["passive", "capture", "once"],
|
1008
|
+
function Dt(r, e, t) {
|
1009
|
+
const s = ["passive", "capture", "once"], n = {
|
924
1010
|
capture: "Capture",
|
925
1011
|
once: "Once",
|
926
1012
|
passive: "OnceCapture"
|
927
1013
|
};
|
928
1014
|
return Object.keys(e || {}).reduce(
|
929
1015
|
(i, a) => {
|
930
|
-
const o = e[a],
|
931
|
-
return
|
1016
|
+
const o = e[a], p = Fe(o.modifiers), c = p.find((h) => s.includes(h)), u = "on" + ze(a) + (c && n[c] || ""), l = t.__parseFunction(o.handler);
|
1017
|
+
return l && (i[u] = r.withModifiers(l, p)), i;
|
932
1018
|
},
|
933
1019
|
{}
|
934
1020
|
);
|
935
1021
|
}
|
936
|
-
function
|
937
|
-
let i =
|
938
|
-
for (let a = ++i; a <
|
939
|
-
const { directives: o = [] } =
|
940
|
-
if (
|
941
|
-
if (e.__parseExpression(
|
942
|
-
return
|
1022
|
+
function Tt(r, e, t, s, n = []) {
|
1023
|
+
let i = n.findIndex((a) => a.id === r.id);
|
1024
|
+
for (let a = ++i; a < n.length; a++) {
|
1025
|
+
const { directives: o = [] } = n[a], { vElseIf: p, vElse: c } = ke(o);
|
1026
|
+
if (p) {
|
1027
|
+
if (e.__parseExpression(p.value))
|
1028
|
+
return F(n[a], e, t, s, n, !0);
|
943
1029
|
continue;
|
944
1030
|
}
|
945
|
-
if (
|
946
|
-
return
|
1031
|
+
if (c)
|
1032
|
+
return F(n[a], e, t, s, n, !0);
|
947
1033
|
}
|
948
1034
|
return null;
|
949
1035
|
}
|
950
|
-
function
|
951
|
-
const t = Object.keys(
|
1036
|
+
function Fe(r = {}, e = !1) {
|
1037
|
+
const t = Object.keys(r);
|
952
1038
|
return e ? t.map((s) => "." + s) : t;
|
953
1039
|
}
|
954
|
-
function
|
955
|
-
const { children: i } = e, a =
|
956
|
-
return o ? o(t) : i ?
|
957
|
-
|
1040
|
+
function Ht(r, e, t, s, n) {
|
1041
|
+
const { children: i } = e, a = Ot(e, s), o = s.$slots?.[a.name];
|
1042
|
+
return o ? o(t) : i ? P(i) ? r.createTextVNode(i) : S(i) ? r.createTextVNode(
|
1043
|
+
Se(s.__parseExpression(i))
|
958
1044
|
) : Array.isArray(i) ? i.map(
|
959
|
-
(
|
1045
|
+
(p) => F(p, s, r, n, i)
|
960
1046
|
) : null : null;
|
961
1047
|
}
|
962
|
-
function
|
963
|
-
const { props: t } =
|
1048
|
+
function Ot(r, e) {
|
1049
|
+
const { props: t } = r, s = t?.name || "default";
|
964
1050
|
return {
|
965
|
-
name:
|
1051
|
+
name: S(s) ? e.__parseExpression(s) : s,
|
966
1052
|
params: []
|
967
1053
|
};
|
968
1054
|
}
|
969
|
-
function
|
970
|
-
return e.__parseExpression(
|
1055
|
+
function xt(r, e) {
|
1056
|
+
return e.__parseExpression(r.value) ? {} : {
|
971
1057
|
display: "none"
|
972
1058
|
};
|
973
1059
|
}
|
974
|
-
function
|
1060
|
+
function Nt(r, e) {
|
975
1061
|
return {
|
976
|
-
innerHTML: e.__parseExpression(
|
1062
|
+
innerHTML: e.__parseExpression(r.value) || ""
|
977
1063
|
};
|
978
1064
|
}
|
979
|
-
function
|
1065
|
+
function Bt(r, e, t) {
|
980
1066
|
const s = {
|
981
1067
|
type: "JSFunction",
|
982
1068
|
value: e.value?.value ? `(v) => {
|
983
1069
|
${e.value.value} = v;
|
984
1070
|
}` : "(v) => {}"
|
985
|
-
},
|
986
|
-
|
987
|
-
), a =
|
1071
|
+
}, n = t.__parseFunction(s), i = Fe(
|
1072
|
+
S(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
|
1073
|
+
), a = S(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
988
1074
|
return {
|
989
1075
|
[a]: t.__parseExpression(e.value),
|
990
|
-
[`onUpdate:${a}`]: i.length &&
|
1076
|
+
[`onUpdate:${a}`]: i.length && n ? r.withModifiers(n, i) : n
|
991
1077
|
};
|
992
1078
|
}
|
993
|
-
function Ut(
|
1079
|
+
function Ut(r, e, t, s, n) {
|
994
1080
|
if (!e) return null;
|
995
|
-
if (
|
1081
|
+
if (P(e))
|
996
1082
|
return { default: () => e };
|
997
|
-
if (
|
1083
|
+
if (S(e))
|
998
1084
|
return {
|
999
|
-
default: () =>
|
1085
|
+
default: () => Se(t.__parseExpression(e))
|
1000
1086
|
};
|
1001
1087
|
if (Array.isArray(e) && e.length > 0) {
|
1002
|
-
const i =
|
1003
|
-
[`scope_${
|
1088
|
+
const i = Lt(e), a = (o) => !o || !n ? {} : n?.id && Object.keys(o).length ? {
|
1089
|
+
[`scope_${n.id}`]: o
|
1004
1090
|
} : {};
|
1005
|
-
return Object.entries(i).reduce((o, [
|
1006
|
-
const h = u.length ?
|
1007
|
-
return
|
1008
|
-
(f) =>
|
1091
|
+
return Object.entries(i).reduce((o, [p, { nodes: c, params: u }]) => (o[p] = (l) => {
|
1092
|
+
const h = u.length ? Ve(l ?? {}, u) : a(l);
|
1093
|
+
return c.map(
|
1094
|
+
(f) => F(f, t.__clone(h), r, s, c)
|
1009
1095
|
);
|
1010
1096
|
}, o), {});
|
1011
1097
|
}
|
1012
1098
|
return null;
|
1013
1099
|
}
|
1014
|
-
function
|
1015
|
-
const e = {
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
}
|
1020
|
-
};
|
1021
|
-
for (const t of n) {
|
1022
|
-
const s = Lt(t.slot), r = s.name;
|
1023
|
-
e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
|
1100
|
+
function Lt(r) {
|
1101
|
+
const e = {};
|
1102
|
+
for (const t of r) {
|
1103
|
+
const s = qt(t.slot), n = s.name;
|
1104
|
+
e[n] ? (e[n].nodes.push(t), e[n].params = e[n].params.concat(s.params)) : e[n] = {
|
1024
1105
|
nodes: [t],
|
1025
1106
|
params: s.params
|
1026
1107
|
};
|
1027
1108
|
}
|
1028
1109
|
return e;
|
1029
1110
|
}
|
1030
|
-
function
|
1031
|
-
return
|
1111
|
+
function qt(r = "default") {
|
1112
|
+
return P(r) ? { name: r, params: [] } : { params: [], ...r };
|
1032
1113
|
}
|
1033
|
-
function
|
1034
|
-
const { value: s, iterator:
|
1114
|
+
function Jt(r, e, t) {
|
1115
|
+
const { value: s, iterator: n } = r, { item: i = "item", index: a = "index" } = n || {};
|
1035
1116
|
let o = t.__parseExpression(s) || [];
|
1036
|
-
return Number.isInteger(o) && (o = new Array(o).fill(!0).map((
|
1117
|
+
return Number.isInteger(o) && (o = new Array(o).fill(!0).map((p, c) => c + 1)), Array.isArray(o) ? o.map((p, c) => e(t.__clone({ [i]: p, [a]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
1037
1118
|
}
|
1038
|
-
const
|
1119
|
+
const de = _e({
|
1039
1120
|
name: "VtjPageContainer",
|
1040
1121
|
async setup() {
|
1041
|
-
const
|
1122
|
+
const r = Ie(), e = we(), t = e.params.id, s = t ? r.getPage(t) : r.getHomepage(), n = s ? await r.getRenderComponent(s.id) : null, i = Z(Symbol());
|
1042
1123
|
if (s) {
|
1043
1124
|
Object.assign(e.meta, s.meta || {}, { cache: s.cache });
|
1044
|
-
const { useTitle: a } =
|
1125
|
+
const { useTitle: a } = r?.adapter;
|
1045
1126
|
a && a(s.title || "VTJ");
|
1046
1127
|
}
|
1047
1128
|
return {
|
1048
|
-
provider:
|
1049
|
-
component:
|
1129
|
+
provider: r,
|
1130
|
+
component: n,
|
1050
1131
|
file: s,
|
1051
1132
|
query: e.query,
|
1052
1133
|
meta: e.meta,
|
@@ -1055,20 +1136,20 @@ const ue = ge({
|
|
1055
1136
|
};
|
1056
1137
|
},
|
1057
1138
|
render() {
|
1058
|
-
const { component:
|
1059
|
-
return
|
1139
|
+
const { component: r, query: e, sid: t } = this;
|
1140
|
+
return r ? X(r, { ...e, key: t }) : X("div", "页面不存在");
|
1060
1141
|
},
|
1061
1142
|
activated() {
|
1062
1143
|
this.meta.cache === !1 && (this.sid = Symbol());
|
1063
1144
|
}
|
1064
|
-
}),
|
1145
|
+
}), Kt = _e({
|
1065
1146
|
name: "VtjStartupContainer",
|
1066
1147
|
render() {
|
1067
|
-
return
|
1148
|
+
return X("div", "page not found!");
|
1068
1149
|
}
|
1069
|
-
}),
|
1070
|
-
var
|
1071
|
-
class
|
1150
|
+
}), Ae = Symbol("Provider");
|
1151
|
+
var zt = /* @__PURE__ */ ((r) => (r.Production = "production", r.Development = "development", r))(zt || {});
|
1152
|
+
class Vt extends xe {
|
1072
1153
|
// DSL缓存
|
1073
1154
|
/**
|
1074
1155
|
* 创建Provider实例
|
@@ -1079,18 +1160,18 @@ class zt extends Oe {
|
|
1079
1160
|
const {
|
1080
1161
|
service: t,
|
1081
1162
|
mode: s = _.Raw,
|
1082
|
-
dependencies:
|
1163
|
+
dependencies: n,
|
1083
1164
|
materials: i,
|
1084
1165
|
project: a = {},
|
1085
1166
|
adapter: o = {},
|
1086
|
-
globals:
|
1087
|
-
modules:
|
1167
|
+
globals: p = {},
|
1168
|
+
modules: c = {},
|
1088
1169
|
router: u = null,
|
1089
|
-
materialPath:
|
1170
|
+
materialPath: l = "./",
|
1090
1171
|
nodeEnv: h = "development"
|
1091
1172
|
/* Development */
|
1092
1173
|
} = e;
|
1093
|
-
this.mode = s, this.modules =
|
1174
|
+
this.mode = s, this.modules = c, this.service = t, this.router = u, this.materialPath = l, this.nodeEnv = h, n && (this.dependencies = n), i && (this.materials = i), Object.assign(this.globals, p), Object.assign(this.adapter, o);
|
1094
1175
|
const { access: f, request: d } = this.adapter;
|
1095
1176
|
f && f.connect({ mode: s, router: u, request: d }), a && s !== _.Design ? this.load(a) : this.project = a;
|
1096
1177
|
}
|
@@ -1100,7 +1181,7 @@ class zt extends Oe {
|
|
1100
1181
|
// 全局变量
|
1101
1182
|
modules = {};
|
1102
1183
|
// 异步模块加载器
|
1103
|
-
adapter = { request:
|
1184
|
+
adapter = { request: Q, jsonp: ve };
|
1104
1185
|
// 适配器接口
|
1105
1186
|
apis = {};
|
1106
1187
|
// API集合
|
@@ -1130,9 +1211,9 @@ class zt extends Oe {
|
|
1130
1211
|
try {
|
1131
1212
|
s = await e.apply(e, t);
|
1132
1213
|
} catch (i) {
|
1133
|
-
|
1214
|
+
k.warn("模拟数据模版异常", i);
|
1134
1215
|
}
|
1135
|
-
return
|
1216
|
+
return D()?.mock(s);
|
1136
1217
|
};
|
1137
1218
|
}
|
1138
1219
|
/**
|
@@ -1148,83 +1229,83 @@ class zt extends Oe {
|
|
1148
1229
|
const t = this.modules[`.vtj/projects/${e.id}.json`] || this.modules[`/src/.vtj/projects/${e.id}.json`];
|
1149
1230
|
if (this.project = t ? await t() : await this.service.init(e), !this.project)
|
1150
1231
|
throw new Error("project is null");
|
1151
|
-
const { apis: s = [], meta:
|
1152
|
-
i && (i.CKEDITOR_VERSION = void 0), this.mode === _.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis =
|
1232
|
+
const { apis: s = [], meta: n = [] } = this.project, i = window;
|
1233
|
+
i && (i.CKEDITOR_VERSION = void 0), this.mode === _.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = mt(s, n, this.adapter), Re(i), gt(s, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
|
1153
1234
|
}
|
1154
1235
|
initMock(e) {
|
1155
|
-
const t =
|
1236
|
+
const t = D(e);
|
1156
1237
|
t && t.setup({
|
1157
1238
|
timeout: "50-500"
|
1158
1239
|
});
|
1159
1240
|
}
|
1160
1241
|
async loadDependencies(e) {
|
1161
1242
|
const t = Object.entries(this.dependencies);
|
1162
|
-
for (const [s,
|
1163
|
-
e[s] || (e[s] = this.library[s] = await
|
1243
|
+
for (const [s, n] of t)
|
1244
|
+
e[s] || (e[s] = this.library[s] = await n());
|
1164
1245
|
}
|
1165
1246
|
async loadAssets(e) {
|
1166
|
-
const { dependencies: t = [] } = this.project, { dependencies: s, library:
|
1167
|
-
libraryExports:
|
1168
|
-
libraryMap:
|
1247
|
+
const { dependencies: t = [] } = this.project, { dependencies: s, library: n, components: i, materialPath: a, nodeEnv: o } = this, {
|
1248
|
+
libraryExports: p,
|
1249
|
+
libraryMap: c,
|
1169
1250
|
materials: u,
|
1170
|
-
materialExports:
|
1251
|
+
materialExports: l,
|
1171
1252
|
materialMapLibrary: h
|
1172
|
-
} =
|
1253
|
+
} = st(
|
1173
1254
|
t,
|
1174
1255
|
a,
|
1175
1256
|
o === "development"
|
1176
1257
|
/* Development */
|
1177
1258
|
);
|
1178
|
-
for (const f of
|
1259
|
+
for (const f of p) {
|
1179
1260
|
const d = s[f], m = e[f];
|
1180
1261
|
if (m)
|
1181
|
-
|
1262
|
+
n[f] = m;
|
1182
1263
|
else if (d)
|
1183
|
-
e[f] =
|
1264
|
+
e[f] = n[f] = await d();
|
1184
1265
|
else {
|
1185
|
-
const v =
|
1266
|
+
const v = c[f] || [];
|
1186
1267
|
for (const g of v)
|
1187
|
-
|
1188
|
-
|
1268
|
+
L(g) && await ot(f, C.append(g, { v: I })), q(g) && await ue(C.append(g, { v: I }));
|
1269
|
+
n[f] = e[f];
|
1189
1270
|
}
|
1190
1271
|
}
|
1191
1272
|
if (o === "development") {
|
1192
1273
|
for (const d of u)
|
1193
|
-
await
|
1274
|
+
await ue(C.append(d, { v: I }));
|
1194
1275
|
const f = this.materials || {};
|
1195
|
-
for (const d of
|
1196
|
-
const m = e[h[d]], v =
|
1276
|
+
for (const d of l) {
|
1277
|
+
const m = e[h[d]], v = Ne[d];
|
1197
1278
|
if (v)
|
1198
1279
|
m && v.forEach((g) => {
|
1199
1280
|
i[g] = m[g];
|
1200
1281
|
});
|
1201
1282
|
else {
|
1202
1283
|
const g = f[d] ? (await f[d]()).default : e[d];
|
1203
|
-
g && m && (g.components || []).forEach((
|
1204
|
-
i[
|
1284
|
+
g && m && (g.components || []).forEach(($) => {
|
1285
|
+
i[$.name] = rt($, m);
|
1205
1286
|
});
|
1206
1287
|
}
|
1207
1288
|
}
|
1208
1289
|
}
|
1209
1290
|
}
|
1210
1291
|
initRouter() {
|
1211
|
-
const { router: e, project: t, options: s, adapter:
|
1292
|
+
const { router: e, project: t, options: s, adapter: n } = this;
|
1212
1293
|
if (!e) return;
|
1213
1294
|
const i = t?.platform === "uniapp" ? "pages" : "page", {
|
1214
1295
|
routeAppendTo: a,
|
1215
1296
|
pageRouteName: o = i,
|
1216
|
-
routeMeta:
|
1217
|
-
} = s,
|
1218
|
-
path: `${
|
1297
|
+
routeMeta: p
|
1298
|
+
} = s, c = a ? "" : "/", u = {
|
1299
|
+
path: `${c}${o}/:id`,
|
1219
1300
|
name: M,
|
1220
|
-
component:
|
1221
|
-
},
|
1222
|
-
path:
|
1223
|
-
name:
|
1224
|
-
component: t?.homepage ?
|
1225
|
-
meta:
|
1301
|
+
component: de
|
1302
|
+
}, l = {
|
1303
|
+
path: c,
|
1304
|
+
name: N,
|
1305
|
+
component: t?.homepage ? de : n.startupComponent || Kt,
|
1306
|
+
meta: p
|
1226
1307
|
};
|
1227
|
-
e.hasRoute(M) && e.removeRoute(M), e.hasRoute(
|
1308
|
+
e.hasRoute(M) && e.removeRoute(M), e.hasRoute(N) && e.removeRoute(N), a ? (e.addRoute(a, u), e.addRoute(a, l)) : (e.addRoute(u), e.addRoute(l));
|
1228
1309
|
}
|
1229
1310
|
/**
|
1230
1311
|
* Vue 插件安装方法
|
@@ -1238,19 +1319,19 @@ class zt extends Oe {
|
|
1238
1319
|
*/
|
1239
1320
|
install(e) {
|
1240
1321
|
const t = e.config.globalProperties.installed || {};
|
1241
|
-
for (const [s,
|
1242
|
-
!t[s] &&
|
1243
|
-
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(
|
1244
|
-
const a =
|
1322
|
+
for (const [s, n] of Object.entries(this.library))
|
1323
|
+
!t[s] && at(n) && (e.use(n), t[s] = !0);
|
1324
|
+
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Ae, this), e.config.globalProperties.$provider = this, e.config.globalProperties.installed = t, this.mode === _.Design && (e.config.errorHandler = (s, n, i) => {
|
1325
|
+
const a = n?.$options.name, o = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", p = `[ ${a} ] ${o} ${i}`;
|
1245
1326
|
console.error(
|
1246
1327
|
"[VTJ Error]:",
|
1247
1328
|
{
|
1248
1329
|
err: s,
|
1249
|
-
instance:
|
1330
|
+
instance: n,
|
1250
1331
|
info: i
|
1251
1332
|
},
|
1252
1333
|
s?.stack
|
1253
|
-
), this.adapter.notify && this.adapter.notify(
|
1334
|
+
), this.adapter.notify && this.adapter.notify(p, "组件渲染错误", "error");
|
1254
1335
|
}), this.options.enhance && e.use(this.options.enhance, this);
|
1255
1336
|
}
|
1256
1337
|
getFile(e) {
|
@@ -1258,12 +1339,12 @@ class zt extends Oe {
|
|
1258
1339
|
return this.getPage(e) || t.find((s) => s.id === e) || null;
|
1259
1340
|
}
|
1260
1341
|
getPage(e) {
|
1261
|
-
const { pages: t = [] } = this.project || {}, s = (
|
1342
|
+
const { pages: t = [] } = this.project || {}, s = (n, i = []) => {
|
1262
1343
|
for (const a of i) {
|
1263
|
-
if (a.id ===
|
1344
|
+
if (a.id === n)
|
1264
1345
|
return a;
|
1265
1346
|
if (a.children && a.children.length) {
|
1266
|
-
const o = s(
|
1347
|
+
const o = s(n, a.children);
|
1267
1348
|
if (o)
|
1268
1349
|
return o;
|
1269
1350
|
}
|
@@ -1300,23 +1381,23 @@ class zt extends Oe {
|
|
1300
1381
|
* @returns 渲染器实例
|
1301
1382
|
*/
|
1302
1383
|
createDslRenderer(e, t = {}) {
|
1303
|
-
const { library: s, components:
|
1384
|
+
const { library: s, components: n, mode: i, apis: a } = this, o = {
|
1304
1385
|
mode: i,
|
1305
1386
|
Vue: s.Vue,
|
1306
|
-
components:
|
1387
|
+
components: n,
|
1307
1388
|
libs: s,
|
1308
1389
|
apis: a,
|
1309
1390
|
window,
|
1310
1391
|
...t
|
1311
|
-
},
|
1312
|
-
getDsl: async (
|
1313
|
-
getDslByUrl: async (
|
1392
|
+
}, p = se({
|
1393
|
+
getDsl: async (c) => await this.getDsl(c) || null,
|
1394
|
+
getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
|
1314
1395
|
options: o
|
1315
1396
|
});
|
1316
|
-
return
|
1397
|
+
return te({
|
1317
1398
|
...o,
|
1318
1399
|
dsl: e,
|
1319
|
-
loader:
|
1400
|
+
loader: p
|
1320
1401
|
});
|
1321
1402
|
}
|
1322
1403
|
/**
|
@@ -1332,13 +1413,13 @@ class zt extends Oe {
|
|
1332
1413
|
async getRenderComponent(e, t) {
|
1333
1414
|
const s = this.getFile(e);
|
1334
1415
|
if (!s)
|
1335
|
-
return
|
1416
|
+
return k.warn(`Can not find file: ${e}`), null;
|
1336
1417
|
t && t(s);
|
1337
|
-
const
|
1418
|
+
const n = `.vtj/vue/${e}.vue`, i = this.modules[n] || this.modules[`/src/pages/${e}.vue`];
|
1338
1419
|
if (i)
|
1339
1420
|
return (await i())?.default;
|
1340
1421
|
const a = await this.getDsl(s.id);
|
1341
|
-
return a ? this.createDslRenderer(a).renderer : (
|
1422
|
+
return a ? this.createDslRenderer(a).renderer : (k.warn(`Can not find dsl: ${e}`), null);
|
1342
1423
|
}
|
1343
1424
|
/**
|
1344
1425
|
* 定义基于URL的异步组件
|
@@ -1350,7 +1431,7 @@ class zt extends Oe {
|
|
1350
1431
|
* @returns Vue异步组件
|
1351
1432
|
*/
|
1352
1433
|
defineUrlSchemaComponent(e, t) {
|
1353
|
-
return
|
1434
|
+
return pe(async () => {
|
1354
1435
|
const s = await this.getDslByUrl(e);
|
1355
1436
|
return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
|
1356
1437
|
});
|
@@ -1363,26 +1444,26 @@ class zt extends Oe {
|
|
1363
1444
|
* @returns Vue异步组件
|
1364
1445
|
*/
|
1365
1446
|
definePluginComponent(e) {
|
1366
|
-
return
|
1447
|
+
return pe(async () => await Ce(e, window));
|
1367
1448
|
}
|
1368
1449
|
}
|
1369
|
-
function
|
1370
|
-
const e = new
|
1450
|
+
function ls(r) {
|
1451
|
+
const e = new Vt(r);
|
1371
1452
|
return {
|
1372
1453
|
provider: e,
|
1373
1454
|
onReady: (s) => e.ready(s)
|
1374
1455
|
};
|
1375
1456
|
}
|
1376
|
-
function
|
1377
|
-
const e =
|
1457
|
+
function Ie(r = {}) {
|
1458
|
+
const e = ye(Ae, null);
|
1378
1459
|
if (!e)
|
1379
1460
|
throw new Error("Can not find provider");
|
1380
1461
|
if (e.nodeEnv === "development") {
|
1381
|
-
const { id: t, version: s } =
|
1462
|
+
const { id: t, version: s } = r;
|
1382
1463
|
t && s && (async () => {
|
1383
|
-
const
|
1384
|
-
|
1385
|
-
`[ ${
|
1464
|
+
const n = await e.getDsl(t);
|
1465
|
+
n?.__VERSION__ !== s && e.adapter.notify && e.adapter.notify(
|
1466
|
+
`[ ${n?.name} ] 组件源码版本与运行时版本不一致,请重新发布组件`,
|
1386
1467
|
"版本不一致",
|
1387
1468
|
"warning"
|
1388
1469
|
);
|
@@ -1390,31 +1471,31 @@ function Ae(n = {}) {
|
|
1390
1471
|
}
|
1391
1472
|
return e;
|
1392
1473
|
}
|
1393
|
-
async function
|
1394
|
-
const { name: t, urls: s = [] } =
|
1395
|
-
if (i.length &&
|
1396
|
-
return await
|
1474
|
+
async function us(r, e = "") {
|
1475
|
+
const { name: t, urls: s = [] } = r || {}, n = s.map((o) => e + o), { css: i, js: a } = nt(n);
|
1476
|
+
if (i.length && je(i), a.length)
|
1477
|
+
return await Ee(a, t).catch(
|
1397
1478
|
() => {
|
1398
1479
|
}
|
1399
1480
|
);
|
1400
1481
|
}
|
1401
|
-
const
|
1482
|
+
const Me = {
|
1402
1483
|
type: "json",
|
1403
1484
|
validSuccess: !0,
|
1404
1485
|
originResponse: !1,
|
1405
1486
|
failMessage: !0,
|
1406
|
-
validate: (
|
1407
|
-
},
|
1487
|
+
validate: (r) => r.data?.code === 0
|
1488
|
+
}, Wt = (r, e = "/__vtj__/api/:type.json") => (t, s, n) => r.send({
|
1408
1489
|
url: e,
|
1409
1490
|
method: "post",
|
1410
1491
|
params: { type: t },
|
1411
|
-
query:
|
1492
|
+
query: n,
|
1412
1493
|
data: {
|
1413
1494
|
type: t,
|
1414
1495
|
data: s
|
1415
1496
|
},
|
1416
|
-
settings:
|
1417
|
-
}),
|
1497
|
+
settings: Me
|
1498
|
+
}), Gt = (r, e = "/__vtj__/api/uploader.json") => async (t, s) => await r.send({
|
1418
1499
|
url: e,
|
1419
1500
|
method: "post",
|
1420
1501
|
data: {
|
@@ -1422,12 +1503,12 @@ const ke = {
|
|
1422
1503
|
projectId: s
|
1423
1504
|
},
|
1424
1505
|
settings: {
|
1425
|
-
...
|
1506
|
+
...Me,
|
1426
1507
|
type: "data"
|
1427
1508
|
}
|
1428
|
-
}).then((
|
1429
|
-
function
|
1430
|
-
return
|
1509
|
+
}).then((n) => n && n[0] ? n[0] : null).catch(() => null);
|
1510
|
+
function ps(r) {
|
1511
|
+
return ge({
|
1431
1512
|
settings: {
|
1432
1513
|
type: "json",
|
1433
1514
|
validSuccess: !0,
|
@@ -1435,14 +1516,14 @@ function us(n) {
|
|
1435
1516
|
failMessage: !0,
|
1436
1517
|
validate: (e) => e.data?.code === 0,
|
1437
1518
|
showError: (e) => {
|
1438
|
-
|
1519
|
+
r && r(e || "未知错误");
|
1439
1520
|
}
|
1440
1521
|
}
|
1441
1522
|
});
|
1442
1523
|
}
|
1443
|
-
class
|
1444
|
-
constructor(e =
|
1445
|
-
this.req = e, this.api =
|
1524
|
+
class ie {
|
1525
|
+
constructor(e = Q) {
|
1526
|
+
this.req = e, this.api = Wt(e), this.uploader = Gt(e);
|
1446
1527
|
}
|
1447
1528
|
api;
|
1448
1529
|
pluginCaches = {};
|
@@ -1526,10 +1607,10 @@ class se {
|
|
1526
1607
|
return await this.api("clearStaticFiles", e).catch(() => "");
|
1527
1608
|
}
|
1528
1609
|
async getPluginMaterial(e) {
|
1529
|
-
const { urls: t = [] } = e, s = t.filter((i) =>
|
1610
|
+
const { urls: t = [] } = e, s = t.filter((i) => et(i))[0];
|
1530
1611
|
if (!s) return null;
|
1531
|
-
const
|
1532
|
-
return
|
1612
|
+
const n = this.pluginCaches[s];
|
1613
|
+
return n || (this.pluginCaches[s] = Q.send({
|
1533
1614
|
url: s,
|
1534
1615
|
method: "get",
|
1535
1616
|
settings: {
|
@@ -1542,22 +1623,22 @@ class se {
|
|
1542
1623
|
return console.log("BaseService.genSource", e), "";
|
1543
1624
|
}
|
1544
1625
|
}
|
1545
|
-
const y = new
|
1626
|
+
const y = new We({
|
1546
1627
|
type: "local",
|
1547
1628
|
expired: 0,
|
1548
1629
|
prefix: "__VTJ_"
|
1549
1630
|
});
|
1550
|
-
class
|
1631
|
+
class fs extends ie {
|
1551
1632
|
init(e) {
|
1552
|
-
const t = new
|
1553
|
-
return y.save(`project_${t.id}`,
|
1633
|
+
const t = new B(e), s = y.get(`project_${t.id}`), n = Object.assign(t.toDsl(), s || {});
|
1634
|
+
return y.save(`project_${t.id}`, n), Promise.resolve(n);
|
1554
1635
|
}
|
1555
1636
|
saveProject(e) {
|
1556
|
-
const t = new
|
1637
|
+
const t = new B(e);
|
1557
1638
|
return y.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
1558
1639
|
}
|
1559
1640
|
saveMaterials(e, t) {
|
1560
|
-
return y.save(`materials_${e.id}`,
|
1641
|
+
return y.save(`materials_${e.id}`, ne(t)), Promise.resolve(!0);
|
1561
1642
|
}
|
1562
1643
|
saveFile(e) {
|
1563
1644
|
return y.save(`file_${e.id}`, e), Promise.resolve(!0);
|
@@ -1575,13 +1656,13 @@ class ps extends se {
|
|
1575
1656
|
removeHistory(e) {
|
1576
1657
|
const t = y.get(`history_${e}`);
|
1577
1658
|
if (t) {
|
1578
|
-
const
|
1579
|
-
this.removeHistoryItem(e,
|
1659
|
+
const n = (t.items || []).map((i) => i.id);
|
1660
|
+
this.removeHistoryItem(e, n), y.remove(`history_${e}`);
|
1580
1661
|
}
|
1581
1662
|
return Promise.resolve(!0);
|
1582
1663
|
}
|
1583
1664
|
getHistory(e) {
|
1584
|
-
const t = y.get(`history_${e}`), s = new
|
1665
|
+
const t = y.get(`history_${e}`), s = new he(t || { id: e });
|
1585
1666
|
return Promise.resolve(s.toDsl());
|
1586
1667
|
}
|
1587
1668
|
getHistoryItem(e, t) {
|
@@ -1597,22 +1678,22 @@ class ps extends se {
|
|
1597
1678
|
}), Promise.resolve(!0);
|
1598
1679
|
}
|
1599
1680
|
}
|
1600
|
-
class
|
1681
|
+
class Yt extends ie {
|
1601
1682
|
projects = {};
|
1602
1683
|
materials = {};
|
1603
1684
|
files = {};
|
1604
1685
|
histories = {};
|
1605
1686
|
historyItems = {};
|
1606
1687
|
init(e) {
|
1607
|
-
const t = new
|
1608
|
-
return this.projects[
|
1688
|
+
const t = new B(e), s = this.projects[t.id] || {}, n = Object.assign(t.toDsl(), s);
|
1689
|
+
return this.projects[n.id] = n, Promise.resolve(n);
|
1609
1690
|
}
|
1610
1691
|
saveProject(e) {
|
1611
|
-
const t = new
|
1692
|
+
const t = new B(e);
|
1612
1693
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
1613
1694
|
}
|
1614
1695
|
saveMaterials(e, t) {
|
1615
|
-
return e.id && (this.materials[e.id] =
|
1696
|
+
return e.id && (this.materials[e.id] = ne(t)), Promise.resolve(!0);
|
1616
1697
|
}
|
1617
1698
|
saveFile(e) {
|
1618
1699
|
return this.files[e.id] = e, Promise.resolve(!0);
|
@@ -1630,18 +1711,18 @@ class Gt extends se {
|
|
1630
1711
|
removeHistory(e) {
|
1631
1712
|
const t = this.histories[e];
|
1632
1713
|
if (t) {
|
1633
|
-
const
|
1634
|
-
this.removeHistoryItem(e,
|
1714
|
+
const n = (t.items || []).map((i) => i.id);
|
1715
|
+
this.removeHistoryItem(e, n), delete this.historyItems[e];
|
1635
1716
|
}
|
1636
1717
|
return Promise.resolve(!0);
|
1637
1718
|
}
|
1638
1719
|
getHistory(e) {
|
1639
|
-
const t = this.histories[e], s = new
|
1720
|
+
const t = this.histories[e], s = new he(t || { id: e });
|
1640
1721
|
return Promise.resolve(s);
|
1641
1722
|
}
|
1642
1723
|
getHistoryItem(e, t) {
|
1643
|
-
const s = `${e}_${t}`,
|
1644
|
-
return Promise.resolve(
|
1724
|
+
const s = `${e}_${t}`, n = this.historyItems[s] || {};
|
1725
|
+
return Promise.resolve(n);
|
1645
1726
|
}
|
1646
1727
|
saveHistoryItem(e, t) {
|
1647
1728
|
const s = `${e}_${t.id}`;
|
@@ -1649,16 +1730,16 @@ class Gt extends se {
|
|
1649
1730
|
}
|
1650
1731
|
removeHistoryItem(e, t) {
|
1651
1732
|
return t.forEach((s) => {
|
1652
|
-
const
|
1653
|
-
delete this.historyItems[
|
1733
|
+
const n = `${e}_${s}`;
|
1734
|
+
delete this.historyItems[n];
|
1654
1735
|
}), Promise.resolve(!0);
|
1655
1736
|
}
|
1656
1737
|
}
|
1657
|
-
let
|
1738
|
+
let x = null;
|
1658
1739
|
function ds() {
|
1659
|
-
return
|
1740
|
+
return x || (x = new Yt(), x);
|
1660
1741
|
}
|
1661
|
-
class
|
1742
|
+
class hs extends ie {
|
1662
1743
|
getFileCaches = {};
|
1663
1744
|
async getExtension() {
|
1664
1745
|
return await this.api("getExtension", {}).catch(() => {
|
@@ -1675,7 +1756,7 @@ class fs extends se {
|
|
1675
1756
|
async saveMaterials(e, t) {
|
1676
1757
|
return !!await this.api("saveMaterials", {
|
1677
1758
|
project: e,
|
1678
|
-
materials:
|
1759
|
+
materials: ne(t)
|
1679
1760
|
}).catch(() => !1);
|
1680
1761
|
}
|
1681
1762
|
async saveFile(e) {
|
@@ -1715,130 +1796,131 @@ class fs extends se {
|
|
1715
1796
|
);
|
1716
1797
|
}
|
1717
1798
|
}
|
1718
|
-
function
|
1799
|
+
function De(r, e, t = []) {
|
1719
1800
|
return t.map((s) => {
|
1720
|
-
const { id:
|
1801
|
+
const { id: n, title: i, icon: a, children: o, hidden: p } = s;
|
1721
1802
|
return {
|
1722
|
-
id:
|
1803
|
+
id: n,
|
1723
1804
|
title: i,
|
1724
1805
|
icon: a,
|
1725
|
-
hidden:
|
1726
|
-
url: `${
|
1727
|
-
children: o && o.length ?
|
1806
|
+
hidden: p,
|
1807
|
+
url: `${r}/${e}/${n}`,
|
1808
|
+
children: o && o.length ? De(r, e, o) : void 0
|
1728
1809
|
};
|
1729
1810
|
});
|
1730
1811
|
}
|
1731
|
-
function
|
1732
|
-
if (!e) return
|
1812
|
+
function Te(r, e) {
|
1813
|
+
if (!e) return r;
|
1733
1814
|
let t = [];
|
1734
|
-
for (const s of
|
1815
|
+
for (const s of r)
|
1735
1816
|
if (s.children && s.children.length) {
|
1736
|
-
const
|
1737
|
-
|
1817
|
+
const n = Te(s.children, e);
|
1818
|
+
n.length && (s.children = n, t.push(s));
|
1738
1819
|
} else
|
1739
1820
|
e.can(s.id.toString()) && t.push(s);
|
1740
1821
|
return t;
|
1741
1822
|
}
|
1742
|
-
function
|
1823
|
+
function ms(r) {
|
1743
1824
|
const {
|
1744
1825
|
menuPathPrefix: e = "",
|
1745
1826
|
pageRouteName: t = "page",
|
1746
1827
|
disableMenusFilter: s = !1
|
1747
|
-
} =
|
1748
|
-
|
1828
|
+
} = r || {}, n = Ie(), i = we(), a = ft(), o = Z(!1), p = Z(!1), c = n.project;
|
1829
|
+
Ge(() => {
|
1749
1830
|
const { name: h, params: f, meta: d } = i;
|
1750
1831
|
if (h === M) {
|
1751
|
-
const m =
|
1752
|
-
o.value = !m?.mask,
|
1753
|
-
} else if (h ===
|
1754
|
-
const m =
|
1755
|
-
o.value = !m?.mask,
|
1832
|
+
const m = n.getPage(f.id);
|
1833
|
+
o.value = !m?.mask, p.value = !!m?.pure;
|
1834
|
+
} else if (h === N) {
|
1835
|
+
const m = n.getHomepage();
|
1836
|
+
o.value = !m?.mask, p.value = !!m?.pure;
|
1756
1837
|
} else
|
1757
|
-
o.value = !d.mask,
|
1838
|
+
o.value = !d.mask, p.value = !!d.pure;
|
1758
1839
|
});
|
1759
|
-
const u =
|
1840
|
+
const u = De(
|
1760
1841
|
e,
|
1761
1842
|
t,
|
1762
|
-
|
1763
|
-
),
|
1843
|
+
c?.pages
|
1844
|
+
), l = c?.config;
|
1764
1845
|
return {
|
1765
1846
|
disabled: o,
|
1766
|
-
logo:
|
1767
|
-
themeSwitchable:
|
1768
|
-
title:
|
1769
|
-
menus: s ? u :
|
1770
|
-
pure:
|
1847
|
+
logo: l?.logo,
|
1848
|
+
themeSwitchable: l?.themeSwitchable,
|
1849
|
+
title: l?.title || c?.description || c?.name || "VTJ App",
|
1850
|
+
menus: s ? u : Te(u, a),
|
1851
|
+
pure: p
|
1771
1852
|
};
|
1772
1853
|
}
|
1773
1854
|
export {
|
1774
|
-
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1855
|
+
be as ACCESS_KEY,
|
1856
|
+
Pe as Access,
|
1857
|
+
Ze as BUILD_IN_TAGS,
|
1858
|
+
Ye as BUILT_IN_DIRECTIVES,
|
1859
|
+
ie as BaseService,
|
1860
|
+
fe as CONTEXT_HOST,
|
1861
|
+
_t as Context,
|
1781
1862
|
_ as ContextMode,
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1863
|
+
Qe as DATA_TYPES,
|
1864
|
+
N as HOMEPAGE_ROUTE_NAME,
|
1865
|
+
Xe as HTML_TAGS,
|
1866
|
+
is as JSCodeToString,
|
1867
|
+
ts as LIFE_CYCLES_LIST,
|
1868
|
+
hs as LocalService,
|
1869
|
+
Yt as MemoryService,
|
1870
|
+
zt as NodeEnv,
|
1790
1871
|
M as PAGE_ROUTE_NAME,
|
1791
|
-
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
ss as
|
1800
|
-
|
1801
|
-
|
1872
|
+
Vt as Provider,
|
1873
|
+
fs as StorageService,
|
1874
|
+
I as VTJ_RENDERER_VERSION,
|
1875
|
+
$e as adoptedStyleSheets,
|
1876
|
+
cs as clearLoaderCache,
|
1877
|
+
it as compileScopedCSS,
|
1878
|
+
as as createAccess,
|
1879
|
+
os as createAdapter,
|
1880
|
+
ss as createAssetScripts,
|
1881
|
+
rs as createAssetsCss,
|
1882
|
+
Pt as createDataSources,
|
1883
|
+
se as createLoader,
|
1802
1884
|
ds as createMemoryService,
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
|
1885
|
+
ht as createMetaApi,
|
1886
|
+
vt as createMock,
|
1887
|
+
ls as createProvider,
|
1888
|
+
te as createRenderer,
|
1807
1889
|
dt as createSchemaApi,
|
1808
|
-
|
1809
|
-
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1818
|
-
|
1819
|
-
|
1820
|
-
|
1821
|
-
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
|
1826
|
-
|
1827
|
-
|
1828
|
-
|
1829
|
-
|
1830
|
-
|
1831
|
-
|
1832
|
-
|
1833
|
-
|
1834
|
-
|
1835
|
-
|
1890
|
+
mt as createSchemaApis,
|
1891
|
+
ps as createServiceRequest,
|
1892
|
+
kt as defaultLoader,
|
1893
|
+
O as fillBasePath,
|
1894
|
+
D as getMock,
|
1895
|
+
Fe as getModifiers,
|
1896
|
+
Ce as getPlugin,
|
1897
|
+
rt as getRawComponent,
|
1898
|
+
ct as isBuiltInTag,
|
1899
|
+
L as isCSSUrl,
|
1900
|
+
ut as isJSCode,
|
1901
|
+
S as isJSExpression,
|
1902
|
+
H as isJSFunction,
|
1903
|
+
et as isJSON,
|
1904
|
+
q as isJSUrl,
|
1905
|
+
lt as isNativeTag,
|
1906
|
+
at as isVuePlugin,
|
1907
|
+
ot as loadCss,
|
1908
|
+
je as loadCssUrl,
|
1909
|
+
us as loadEnhance,
|
1910
|
+
Ee as loadScriptUrl,
|
1911
|
+
yt as mockApi,
|
1912
|
+
gt as mockApis,
|
1913
|
+
Re as mockCleanup,
|
1914
|
+
F as nodeRender,
|
1915
|
+
st as parseDeps,
|
1916
|
+
T as parseExpression,
|
1917
|
+
ee as parseFunction,
|
1836
1918
|
nt as parseUrls,
|
1837
|
-
|
1838
|
-
|
1919
|
+
Ae as providerKey,
|
1920
|
+
tt as removeProdFlag,
|
1839
1921
|
ns as setupPageSetting,
|
1840
|
-
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1922
|
+
Se as toString,
|
1923
|
+
ft as useAccess,
|
1924
|
+
ms as useMask,
|
1925
|
+
Ie as useProvider
|
1844
1926
|
};
|