@vtj/renderer 0.16.18 → 0.16.20
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 +10 -10
- package/dist/index.mjs +780 -731
- package/package.json +6 -6
- package/types/render/cache.d.ts +16 -0
- package/types/render/index.d.ts +1 -0
- package/types/render/loader.d.ts +1 -1
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Base as
|
|
2
|
-
import { url as
|
|
3
|
-
import * as
|
|
4
|
-
import { inject as
|
|
5
|
-
import { useRoute as
|
|
1
|
+
import { Base as Qe, BUILT_IN_COMPONENTS as Xe, ProjectModel as J, HistoryModel as Re } from "@vtj/core";
|
|
2
|
+
import { url as O, isUrl as ie, dedupArray as Ye, isFunction as K, isString as F, logger as M, storage as te, cookie as se, toArray as we, unRSA as Se, delay as z, createRequest as Ce, jsonp as Pe, merge as Ze, pathToRegexp as et, pathToRegexpMatch as tt, formDataToJson as st, isEqual as nt, Queue as rt, cloneDeep as $e, camelCase as P, upperFirstCamelCase as ot, pick as it, request as ae, loadScript as Ee, debounce as at, Storage as ct, mapToObject as he } from "@vtj/utils";
|
|
3
|
+
import * as V from "vue";
|
|
4
|
+
import { inject as Ae, defineComponent as Ie, h as ce, ref as le, watchEffect as lt, defineAsyncComponent as be } from "vue";
|
|
5
|
+
import { useRoute as Fe } 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.16.
|
|
10
|
+
* @version 0.16.20
|
|
11
11
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
var
|
|
15
|
-
const
|
|
13
|
+
const D = "0.16.20";
|
|
14
|
+
var y = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(y || {});
|
|
15
|
+
const je = [
|
|
16
16
|
"$el",
|
|
17
17
|
"$emit",
|
|
18
18
|
"$nextTick",
|
|
@@ -24,7 +24,7 @@ const $e = [
|
|
|
24
24
|
"$props",
|
|
25
25
|
"$options",
|
|
26
26
|
"$forceUpdate"
|
|
27
|
-
],
|
|
27
|
+
], Cs = [
|
|
28
28
|
"beforeCreate",
|
|
29
29
|
"created",
|
|
30
30
|
"beforeMount",
|
|
@@ -38,7 +38,7 @@ const $e = [
|
|
|
38
38
|
"renderTriggered",
|
|
39
39
|
"activated",
|
|
40
40
|
"deactivated"
|
|
41
|
-
],
|
|
41
|
+
], ut = [
|
|
42
42
|
"vIf",
|
|
43
43
|
"vElseIf",
|
|
44
44
|
"vElse",
|
|
@@ -47,7 +47,7 @@ const $e = [
|
|
|
47
47
|
"vFor",
|
|
48
48
|
"vBind",
|
|
49
49
|
"vHtml"
|
|
50
|
-
],
|
|
50
|
+
], ft = {
|
|
51
51
|
String,
|
|
52
52
|
Number,
|
|
53
53
|
Boolean,
|
|
@@ -55,9 +55,9 @@ const $e = [
|
|
|
55
55
|
Object,
|
|
56
56
|
Function,
|
|
57
57
|
Date
|
|
58
|
-
},
|
|
58
|
+
}, H = "VtjPage", q = "VtjHomepage", ke = "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
|
+
), pt = "component,slot".split(","), Ps = [
|
|
61
61
|
"h",
|
|
62
62
|
"t",
|
|
63
63
|
"t",
|
|
@@ -77,7 +77,7 @@ const $e = [
|
|
|
77
77
|
"p",
|
|
78
78
|
"r",
|
|
79
79
|
"o"
|
|
80
|
-
].join(""),
|
|
80
|
+
].join(""), As = {
|
|
81
81
|
auth: [
|
|
82
82
|
"h",
|
|
83
83
|
"t",
|
|
@@ -138,63 +138,63 @@ const $e = [
|
|
|
138
138
|
privateKey: "MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"
|
|
139
139
|
};
|
|
140
140
|
function L(n, e) {
|
|
141
|
-
return n.map((t) =>
|
|
141
|
+
return n.map((t) => ie(t) || t.startsWith("/") ? t : `${e}${t}`);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function W(n) {
|
|
144
144
|
return /\.css$/.test(n);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function Q(n) {
|
|
147
147
|
return /\.js$/.test(n);
|
|
148
148
|
}
|
|
149
|
-
function
|
|
149
|
+
function dt(n) {
|
|
150
150
|
return /\.json$/.test(n);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function Is(n) {
|
|
153
153
|
return n.map(
|
|
154
|
-
(e) => `<script src="${
|
|
154
|
+
(e) => `<script src="${O.append(e, { v: D })}"><\/script>`
|
|
155
155
|
).join("");
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Fs(n = []) {
|
|
158
158
|
return n.map(
|
|
159
|
-
(e) => `<link rel="stylesheet" href="${
|
|
159
|
+
(e) => `<link rel="stylesheet" href="${O.append(e, { v: D })}" />`
|
|
160
160
|
).join("");
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function ht(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 mt(n, e, t = !1) {
|
|
166
|
+
const s = n.filter((p) => !!p.enabled), r = [], o = [], i = [], a = [], u = {}, c = {}, l = [], f = {};
|
|
167
167
|
return s.forEach(
|
|
168
168
|
({ urls: p, assetsUrl: d, library: m, assetsLibrary: h, localeLibrary: g }) => {
|
|
169
|
-
p?.forEach((
|
|
170
|
-
|
|
171
|
-
}), m && (
|
|
169
|
+
p?.forEach((_) => {
|
|
170
|
+
Q(_) && r.push(ht(_, t)), W(_) && o.push(_);
|
|
171
|
+
}), m && (a.push(m), u[m] = L(p || [], e), g && (c[m] = g)), d && i.push(d), h && l.push(h), m && h && (f[h] = m);
|
|
172
172
|
}
|
|
173
173
|
), {
|
|
174
174
|
scripts: L(r, e),
|
|
175
|
-
css: L(
|
|
176
|
-
materials: L(
|
|
177
|
-
libraryExports:
|
|
178
|
-
materialExports:
|
|
175
|
+
css: L(o, e),
|
|
176
|
+
materials: L(i, e),
|
|
177
|
+
libraryExports: a,
|
|
178
|
+
materialExports: Ye(l),
|
|
179
179
|
materialMapLibrary: f,
|
|
180
|
-
libraryMap:
|
|
180
|
+
libraryMap: u,
|
|
181
181
|
libraryLocaleMap: c
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function gt(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
|
|
189
|
-
const e = n.filter((s) =>
|
|
188
|
+
function _t(n = []) {
|
|
189
|
+
const e = n.filter((s) => W(s)), t = n.filter((s) => Q(s));
|
|
190
190
|
return {
|
|
191
191
|
css: e,
|
|
192
192
|
js: t
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function vt(n, e) {
|
|
196
196
|
const t = (c) => {
|
|
197
|
-
const
|
|
197
|
+
const l = [];
|
|
198
198
|
let f = 0;
|
|
199
199
|
for (; f < c.length; ) {
|
|
200
200
|
if (/\s/.test(c[f])) {
|
|
@@ -202,32 +202,32 @@ function ht(n, e) {
|
|
|
202
202
|
continue;
|
|
203
203
|
}
|
|
204
204
|
if (c.substring(f, f + 2) === "/*") {
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
f =
|
|
205
|
+
const _ = c.indexOf("*/", f + 2);
|
|
206
|
+
if (_ !== -1) {
|
|
207
|
+
f = _ + 2;
|
|
208
208
|
continue;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
if (c[f] === "@") {
|
|
212
|
-
const
|
|
212
|
+
const _ = f;
|
|
213
213
|
for (; f < c.length && c[f] !== "{" && c[f] !== ";"; )
|
|
214
214
|
f++;
|
|
215
|
-
const w = c.substring(
|
|
215
|
+
const w = c.substring(_, f).trim(), v = w.includes("@keyframes");
|
|
216
216
|
if (c[f] === ";")
|
|
217
|
-
|
|
217
|
+
l.push({
|
|
218
218
|
type: "simple-at-rule",
|
|
219
|
-
content: c.substring(
|
|
219
|
+
content: c.substring(_, f + 1)
|
|
220
220
|
}), f++;
|
|
221
221
|
else if (c[f] === "{") {
|
|
222
222
|
const S = f + 1;
|
|
223
|
-
let
|
|
224
|
-
for (f++; f < c.length &&
|
|
225
|
-
c[f] === "{" ?
|
|
226
|
-
const
|
|
227
|
-
|
|
223
|
+
let I = 1;
|
|
224
|
+
for (f++; f < c.length && I > 0; )
|
|
225
|
+
c[f] === "{" ? I++ : c[f] === "}" && I--, f++;
|
|
226
|
+
const X = c.substring(_, f), C = c.substring(S, f - 1);
|
|
227
|
+
l.push({
|
|
228
228
|
type: v ? "keyframes" : "at-rule",
|
|
229
229
|
rule: w,
|
|
230
|
-
content:
|
|
230
|
+
content: X,
|
|
231
231
|
inner: C
|
|
232
232
|
});
|
|
233
233
|
}
|
|
@@ -247,107 +247,107 @@ function ht(n, e) {
|
|
|
247
247
|
for (f++; f < c.length && h > 0; )
|
|
248
248
|
c[f] === "{" ? h++ : c[f] === "}" && h--, f++;
|
|
249
249
|
const g = c.substring(m, f - 1);
|
|
250
|
-
|
|
250
|
+
l.push({
|
|
251
251
|
type: "rule",
|
|
252
252
|
selector: d,
|
|
253
253
|
content: g.trim()
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
return
|
|
256
|
+
return l;
|
|
257
257
|
}, s = (c) => {
|
|
258
|
-
const
|
|
259
|
-
return /^(from|to|\d+(\.\d+)?%)$/.test(
|
|
260
|
-
}, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (
|
|
258
|
+
const l = c.trim();
|
|
259
|
+
return /^(from|to|\d+(\.\d+)?%)$/.test(l);
|
|
260
|
+
}, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (l, f, p) => {
|
|
261
261
|
const d = f.trim(), m = p.trim();
|
|
262
262
|
return d ? `${d}[${e}] ${m}` : m;
|
|
263
|
-
}),
|
|
264
|
-
const
|
|
265
|
-
if (!
|
|
266
|
-
return
|
|
267
|
-
const f =
|
|
263
|
+
}), o = (c) => {
|
|
264
|
+
const l = c.trim();
|
|
265
|
+
if (!l || l.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(l) || s(l))
|
|
266
|
+
return l;
|
|
267
|
+
const f = l.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
|
|
268
268
|
if (f) {
|
|
269
269
|
const [, p, d = ""] = f, m = p.trim();
|
|
270
|
-
return m ? `${m}[${e}]${d}` :
|
|
270
|
+
return m ? `${m}[${e}]${d}` : l;
|
|
271
271
|
}
|
|
272
|
-
return `${
|
|
273
|
-
},
|
|
274
|
-
switch (
|
|
272
|
+
return `${l}[${e}]`;
|
|
273
|
+
}, i = (c) => r(c).split(",").map((f) => o(f)).filter((f) => f.trim()).join(", "), a = (c) => c.map((l) => {
|
|
274
|
+
switch (l.type) {
|
|
275
275
|
case "simple-at-rule":
|
|
276
|
-
return
|
|
276
|
+
return l.content;
|
|
277
277
|
case "keyframes":
|
|
278
|
-
return
|
|
278
|
+
return l.content;
|
|
279
279
|
case "at-rule":
|
|
280
280
|
try {
|
|
281
|
-
const p = t(
|
|
282
|
-
return `${
|
|
281
|
+
const p = t(l.inner), d = a(p);
|
|
282
|
+
return `${l.rule} { ${d} }`;
|
|
283
283
|
} catch {
|
|
284
|
-
return
|
|
284
|
+
return l.content;
|
|
285
285
|
}
|
|
286
286
|
case "rule":
|
|
287
|
-
if (!
|
|
287
|
+
if (!l.selector || !l.content)
|
|
288
288
|
return "";
|
|
289
|
-
const f =
|
|
290
|
-
return f.trim() ? `${f} { ${
|
|
289
|
+
const f = i(l.selector);
|
|
290
|
+
return f.trim() ? `${f} { ${l.content} }` : "";
|
|
291
291
|
default:
|
|
292
292
|
return "";
|
|
293
293
|
}
|
|
294
|
-
}).filter((
|
|
294
|
+
}).filter((l) => l.trim()).join(" "), u = (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
|
-
`),
|
|
298
|
-
return
|
|
297
|
+
`), l = t(c), f = a(l);
|
|
298
|
+
return u(f);
|
|
299
299
|
} catch (c) {
|
|
300
300
|
return console.error("CSS scoping failed:", c), console.error("Input CSS:", n), n.replace(/\/\*[\s\S]*?\*\//g, "").replace(
|
|
301
301
|
/(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,
|
|
302
|
-
(
|
|
303
|
-
).replace(/([^{}@]+)(?=\s*{)/g, (
|
|
304
|
-
const f =
|
|
305
|
-
return !f || f.startsWith("@") || f.includes(`[${e}]`) || s(f) ?
|
|
302
|
+
(l) => l
|
|
303
|
+
).replace(/([^{}@]+)(?=\s*{)/g, (l) => {
|
|
304
|
+
const f = l.trim();
|
|
305
|
+
return !f || f.startsWith("@") || f.includes(`[${e}]`) || s(f) ? l : `${f}[${e}]`;
|
|
306
306
|
});
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
|
-
const
|
|
310
|
-
function
|
|
309
|
+
const yt = 750;
|
|
310
|
+
function wt(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 || yt;
|
|
314
314
|
return e * s / r;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
let t = !1, s = !1, r = !1,
|
|
318
|
-
for (let
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
if (
|
|
323
|
-
const c =
|
|
324
|
-
|
|
316
|
+
function St(n, e) {
|
|
317
|
+
let t = !1, s = !1, r = !1, o = "";
|
|
318
|
+
for (let i = 0; i < e.length; i++) {
|
|
319
|
+
const a = e[i];
|
|
320
|
+
if (a === "'" && !s && !r ? t = !t : a === '"' && !t && !r ? s = !s : e.substr(i, 4).toLowerCase() === "url(" && !t && !s ? r = !0 : a === ")" && r && (r = !1), !t && !s && !r) {
|
|
321
|
+
const u = e.substr(i).match(/^(-?\d+(?:\.\d+)?)\s*rpx/);
|
|
322
|
+
if (u) {
|
|
323
|
+
const c = u[1], l = parseFloat(c), p = `${wt(n, l).toFixed(6).replace(/\.?0+$/, "")}px`;
|
|
324
|
+
o += p, i += u[0].length - 1;
|
|
325
325
|
continue;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
|
|
328
|
+
o += a;
|
|
329
329
|
}
|
|
330
|
-
return
|
|
330
|
+
return o;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
return
|
|
332
|
+
function Oe(n) {
|
|
333
|
+
return F(n) ? n : JSON.stringify(n);
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
const r = n.CSSStyleSheet,
|
|
337
|
-
if (r.prototype.replaceSync && !
|
|
335
|
+
function me(n, e, t, s = !1) {
|
|
336
|
+
const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, i = n.__uniConfig ? St(n, t) : t, a = s ? vt(i, o) : i, u = !!n.__uniConfig;
|
|
337
|
+
if (r.prototype.replaceSync && !u) {
|
|
338
338
|
const c = new r();
|
|
339
|
-
c.id = e, c.replaceSync(
|
|
340
|
-
const
|
|
339
|
+
c.id = e, c.replaceSync(a);
|
|
340
|
+
const l = n.document, f = l.adoptedStyleSheets, p = Array.from(f).filter(
|
|
341
341
|
(d) => d.id !== e
|
|
342
342
|
);
|
|
343
|
-
|
|
343
|
+
l.adoptedStyleSheets = [...p, c];
|
|
344
344
|
} else {
|
|
345
345
|
const c = n.document;
|
|
346
|
-
let
|
|
347
|
-
|
|
346
|
+
let l = c.getElementById(e);
|
|
347
|
+
l ? l.innerHTML = a : (l = c.createElement("style"), l.id = e, l.innerHTML = a, c.head.appendChild(l));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function ks(n) {
|
|
351
351
|
const e = n.adoptedStyleSheets || [];
|
|
352
352
|
let t = "";
|
|
353
353
|
if (e.forEach((s) => {
|
|
@@ -363,79 +363,79 @@ function Cs(n) {
|
|
|
363
363
|
s.textContent = t, n.head.appendChild(s);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
async function
|
|
366
|
+
async function $t(n, e) {
|
|
367
367
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
|
368
|
-
t &&
|
|
368
|
+
t && me(window, n, t);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Me(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)) {
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const i = t.createElement("link");
|
|
375
|
+
i.rel = "stylesheet", i.id = r, i.href = r, s.appendChild(i);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
|
-
async function
|
|
378
|
+
async function Te(n, e, t = window) {
|
|
379
379
|
const s = t.document, r = t.document.head;
|
|
380
|
-
let
|
|
381
|
-
return
|
|
382
|
-
for (const
|
|
380
|
+
let o = t[e];
|
|
381
|
+
return o ? o.default || o : new Promise((i, a) => {
|
|
382
|
+
for (const u of n) {
|
|
383
383
|
const c = s.createElement("script");
|
|
384
|
-
c.src =
|
|
385
|
-
|
|
386
|
-
}, c.onerror = (
|
|
387
|
-
|
|
384
|
+
c.src = u, c.onload = () => {
|
|
385
|
+
o = t[e], o ? i(o.default || o) : a(null);
|
|
386
|
+
}, c.onerror = (l) => {
|
|
387
|
+
a(l);
|
|
388
388
|
}, r.appendChild(c);
|
|
389
389
|
}
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
return
|
|
392
|
+
function Et(n) {
|
|
393
|
+
return K(n) && Object.getOwnPropertyNames(n.prototype || {}).length === 0 || K(n?.install);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
396
|
-
return
|
|
395
|
+
function bt(n) {
|
|
396
|
+
return pt.includes(n);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
399
|
-
return
|
|
398
|
+
function jt(n) {
|
|
399
|
+
return ke.includes(n);
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function N(n = window) {
|
|
402
402
|
const e = window?.Mock;
|
|
403
403
|
if (e) return e;
|
|
404
404
|
const t = n?.Mock;
|
|
405
405
|
if (t && window)
|
|
406
406
|
return window.Mock = t, t;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function Os(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 B(n, e, t = !1, s = !1, r = !1) {
|
|
414
414
|
try {
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
let
|
|
418
|
-
r || (
|
|
419
|
-
`) +
|
|
420
|
-
const
|
|
421
|
-
${
|
|
422
|
-
` : `with(${t ? "{}" : "$scope || {}"}) { ${
|
|
423
|
-
return new Function("$scope",
|
|
424
|
-
} catch (
|
|
425
|
-
if (
|
|
426
|
-
throw
|
|
415
|
+
const o = ['"use strict";', "var __self = arguments[0];"];
|
|
416
|
+
o.push("return ");
|
|
417
|
+
let i = (n.value || "").trim();
|
|
418
|
+
r || (i = i.replace(/this(\W|$)/g, (u, c) => `__self${c}`)), i = o.join(`
|
|
419
|
+
`) + i;
|
|
420
|
+
const a = r ? `
|
|
421
|
+
${i}
|
|
422
|
+
` : `with(${t ? "{}" : "$scope || {}"}) { ${i} }`;
|
|
423
|
+
return new Function("$scope", a)(e);
|
|
424
|
+
} catch (o) {
|
|
425
|
+
if (M.error("parseExpression.error", o, n, e?.__self ?? e), s)
|
|
426
|
+
throw o;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
429
|
function R(n, e, t = !1, s = !1, r = !1) {
|
|
430
|
-
const
|
|
431
|
-
if (typeof
|
|
430
|
+
const o = B(n, e, t, s, r);
|
|
431
|
+
if (typeof o != "function" && (M.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
440
|
function b(n) {
|
|
441
441
|
return n && n.type === "JSExpression";
|
|
@@ -443,13 +443,13 @@ function b(n) {
|
|
|
443
443
|
function E(n) {
|
|
444
444
|
return typeof n == "object" && n && n.type === "JSFunction";
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function Rt(n) {
|
|
447
447
|
return b(n) || E(n);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
return
|
|
449
|
+
function Ms(n) {
|
|
450
|
+
return Rt(n) ? n.value : JSON.stringify(n);
|
|
451
451
|
}
|
|
452
|
-
const
|
|
452
|
+
const Ct = {
|
|
453
453
|
session: !1,
|
|
454
454
|
authKey: "Authorization",
|
|
455
455
|
storageKey: "ACCESS_STORAGE",
|
|
@@ -462,15 +462,15 @@ const Et = {
|
|
|
462
462
|
noPermissionMessage: "无权限访问该页面",
|
|
463
463
|
appName: "",
|
|
464
464
|
statusKey: "code"
|
|
465
|
-
},
|
|
466
|
-
class
|
|
465
|
+
}, xe = Symbol("access");
|
|
466
|
+
class ge {
|
|
467
467
|
options;
|
|
468
468
|
data = null;
|
|
469
|
-
mode =
|
|
469
|
+
mode = y.Raw;
|
|
470
470
|
interceptResponse = !0;
|
|
471
471
|
isTipShowing = !1;
|
|
472
472
|
constructor(e) {
|
|
473
|
-
this.options = Object.assign({},
|
|
473
|
+
this.options = Object.assign({}, Ct, e), this.loadData();
|
|
474
474
|
}
|
|
475
475
|
enableIntercept() {
|
|
476
476
|
this.interceptResponse = !0;
|
|
@@ -480,21 +480,21 @@ class de {
|
|
|
480
480
|
}
|
|
481
481
|
connect(e) {
|
|
482
482
|
const { mode: t, router: s, request: r } = e;
|
|
483
|
-
this.mode = t, s && this.mode !==
|
|
483
|
+
this.mode = t, s && this.mode !== y.Design && this.setGuard(s), r && this.setRequest(r);
|
|
484
484
|
}
|
|
485
485
|
login(e) {
|
|
486
|
-
const { storageKey: t, storagePrefix: s, session: r, authKey:
|
|
487
|
-
this.setData(e), this.data && (
|
|
486
|
+
const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
|
|
487
|
+
this.setData(e), this.data && (te.save(t, e, {
|
|
488
488
|
type: "local",
|
|
489
489
|
prefix: s
|
|
490
|
-
}), r &&
|
|
490
|
+
}), r && se.set(o, this.data.token));
|
|
491
491
|
}
|
|
492
492
|
clear() {
|
|
493
493
|
const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
|
|
494
|
-
this.data = null,
|
|
494
|
+
this.data = null, te.remove(e, {
|
|
495
495
|
type: "local",
|
|
496
496
|
prefix: t
|
|
497
|
-
}), s &&
|
|
497
|
+
}), s && se.remove(r);
|
|
498
498
|
}
|
|
499
499
|
logout() {
|
|
500
500
|
this.clear(), this.toLogin();
|
|
@@ -507,14 +507,14 @@ class de {
|
|
|
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) : we(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 we(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(xe, this);
|
|
518
518
|
}
|
|
519
519
|
isAuthPath(e) {
|
|
520
520
|
const { auth: t, isAuth: s } = this.options;
|
|
@@ -535,7 +535,7 @@ class de {
|
|
|
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) => Se(r, t));
|
|
539
539
|
try {
|
|
540
540
|
this.data = JSON.parse(s.join(""));
|
|
541
541
|
} catch (r) {
|
|
@@ -545,7 +545,7 @@ class de {
|
|
|
545
545
|
}
|
|
546
546
|
if (typeof e == "string")
|
|
547
547
|
try {
|
|
548
|
-
const s = t ?
|
|
548
|
+
const s = t ? Se(e, t) : e;
|
|
549
549
|
s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
|
|
550
550
|
} catch (s) {
|
|
551
551
|
console.warn(s);
|
|
@@ -554,7 +554,7 @@ class de {
|
|
|
554
554
|
this.data = e;
|
|
555
555
|
}
|
|
556
556
|
loadData() {
|
|
557
|
-
const { storageKey: e, storagePrefix: t } = this.options, s =
|
|
557
|
+
const { storageKey: e, storagePrefix: t } = this.options, s = te.get(e, {
|
|
558
558
|
type: "local",
|
|
559
559
|
prefix: t
|
|
560
560
|
});
|
|
@@ -562,10 +562,10 @@ class de {
|
|
|
562
562
|
}
|
|
563
563
|
isLogined() {
|
|
564
564
|
const { session: e, authKey: t } = this.options;
|
|
565
|
-
return e && t ? !!
|
|
565
|
+
return e && t ? !!se.get(t) : !!this.getToken();
|
|
566
566
|
}
|
|
567
567
|
hasRoutePermission(e) {
|
|
568
|
-
if (e.name ===
|
|
568
|
+
if (e.name === H) {
|
|
569
569
|
const t = e.params.id;
|
|
570
570
|
return t && this.can(t);
|
|
571
571
|
}
|
|
@@ -582,10 +582,10 @@ class de {
|
|
|
582
582
|
return t();
|
|
583
583
|
{
|
|
584
584
|
const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
|
|
585
|
-
return await this.showTip(s),
|
|
585
|
+
return await this.showTip(s), K(r) ? (r(), t(!1)) : F(r) ? t(r) : t(!1);
|
|
586
586
|
}
|
|
587
587
|
}
|
|
588
|
-
t(!1), await
|
|
588
|
+
t(!1), await z(0), this.toLogin();
|
|
589
589
|
}
|
|
590
590
|
isWhiteList(e) {
|
|
591
591
|
const { whiteList: t } = this.options;
|
|
@@ -601,7 +601,7 @@ class de {
|
|
|
601
601
|
}
|
|
602
602
|
async showTip(e) {
|
|
603
603
|
const { alert: t } = this.options;
|
|
604
|
-
return this.isTipShowing ? !1 : t ? (this.isTipShowing = !0, await
|
|
604
|
+
return this.isTipShowing ? !1 : t ? (this.isTipShowing = !0, await z(150), await t(e, {
|
|
605
605
|
title: "提示",
|
|
606
606
|
type: "warning"
|
|
607
607
|
})?.catch(() => !0)?.finally(() => {
|
|
@@ -619,54 +619,54 @@ class de {
|
|
|
619
619
|
);
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
return
|
|
622
|
+
function Pt() {
|
|
623
|
+
return Ae(xe, null);
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Ts(n = {}) {
|
|
626
626
|
const {
|
|
627
627
|
notify: e,
|
|
628
628
|
loading: t,
|
|
629
629
|
settings: s = {},
|
|
630
630
|
Startup: r,
|
|
631
|
-
access:
|
|
632
|
-
useTitle:
|
|
633
|
-
alert:
|
|
631
|
+
access: o,
|
|
632
|
+
useTitle: i,
|
|
633
|
+
alert: a
|
|
634
634
|
} = n;
|
|
635
|
-
let
|
|
635
|
+
let u = null;
|
|
636
636
|
return {
|
|
637
|
-
request:
|
|
637
|
+
request: Ce({
|
|
638
638
|
settings: {
|
|
639
639
|
type: "form",
|
|
640
640
|
validSuccess: !0,
|
|
641
641
|
originResponse: !1,
|
|
642
642
|
loading: !0,
|
|
643
|
-
validate: (
|
|
643
|
+
validate: (l) => l.data?.code === 0 || !!l.data?.success,
|
|
644
644
|
failMessage: !0,
|
|
645
|
-
showError: (
|
|
646
|
-
e && e(
|
|
645
|
+
showError: (l) => {
|
|
646
|
+
e && e(l || "未知错误");
|
|
647
647
|
},
|
|
648
648
|
showLoading: () => {
|
|
649
|
-
|
|
649
|
+
u && u.close(), t && (u = t());
|
|
650
650
|
},
|
|
651
651
|
hideLoading: () => {
|
|
652
|
-
|
|
652
|
+
u && (u.close(), u = null);
|
|
653
653
|
},
|
|
654
654
|
...s
|
|
655
655
|
}
|
|
656
656
|
}),
|
|
657
|
-
jsonp:
|
|
657
|
+
jsonp: Pe,
|
|
658
658
|
notify: e,
|
|
659
659
|
loading: t,
|
|
660
|
-
useTitle:
|
|
661
|
-
alert:
|
|
660
|
+
useTitle: i,
|
|
661
|
+
alert: a,
|
|
662
662
|
startupComponent: r,
|
|
663
|
-
access:
|
|
663
|
+
access: o ? new ge({ alert: a, ...o }) : void 0
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
|
-
function
|
|
667
|
-
return new
|
|
666
|
+
function xs(n = {}) {
|
|
667
|
+
return new ge(n);
|
|
668
668
|
}
|
|
669
|
-
function
|
|
669
|
+
function At(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 ? B(n.headers, {}, !0) : void 0,
|
|
677
|
+
const r = n.headers ? B(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 (
|
|
685
|
+
return (i, a) => (delete o.data, s.send(Ze(o, a || {}, { data: i })));
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function It(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, i) => {
|
|
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, i);
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function Ft(n = [], e = [], t) {
|
|
701
701
|
const s = {};
|
|
702
702
|
for (const r of n) {
|
|
703
|
-
const
|
|
704
|
-
s[r.id] =
|
|
703
|
+
const o = At(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] = It(r, t);
|
|
708
708
|
return s;
|
|
709
709
|
}
|
|
710
|
-
async function
|
|
711
|
-
const t =
|
|
712
|
-
t && (
|
|
710
|
+
async function kt(n = [], e = window) {
|
|
711
|
+
const t = N(e);
|
|
712
|
+
t && (De(e), n.forEach((s) => Mt(t, s)));
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
const t = E(n.mockTemplate) && n.mockTemplate.value ? R(n.mockTemplate, {}, !0) : void 0, s =
|
|
714
|
+
function Ot(n, e = window) {
|
|
715
|
+
const t = E(n.mockTemplate) && n.mockTemplate.value ? R(n.mockTemplate, {}, !0) : void 0, s = N(e);
|
|
716
716
|
return async (...r) => {
|
|
717
|
-
let
|
|
717
|
+
let o = {};
|
|
718
718
|
if (t)
|
|
719
719
|
try {
|
|
720
|
-
|
|
721
|
-
} catch (
|
|
722
|
-
|
|
720
|
+
o = await t.apply(t, r);
|
|
721
|
+
} catch (i) {
|
|
722
|
+
M.warn("模拟数据模版异常", i);
|
|
723
723
|
}
|
|
724
|
-
return s?.mock(
|
|
724
|
+
return s?.mock(o);
|
|
725
725
|
};
|
|
726
726
|
}
|
|
727
|
-
function
|
|
727
|
+
function Mt(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 =
|
|
733
|
-
n.mock(
|
|
734
|
-
const c =
|
|
735
|
-
Object.assign(
|
|
732
|
+
const r = ie(t) ? new URL(t).pathname : t, o = et(`(.*)${r}(.*)`), i = tt(r, { decode: decodeURIComponent }), a = B(s, {}, !0);
|
|
733
|
+
n.mock(o, (u) => {
|
|
734
|
+
const c = O.parse(u.url) || {}, l = u.body instanceof FormData ? st(u.body) : u.body, f = ie(u.url) ? new URL(u.url).pathname : u.url.split("?")[0], p = i(f)?.params;
|
|
735
|
+
Object.assign(u, { data: l, params: p, query: c });
|
|
736
736
|
try {
|
|
737
|
-
return n.mock(
|
|
737
|
+
return n.mock(a(u));
|
|
738
738
|
} catch (d) {
|
|
739
|
-
return console.warn("[mockApi]",
|
|
739
|
+
return console.warn("[mockApi]", o, u, d), null;
|
|
740
740
|
}
|
|
741
741
|
});
|
|
742
742
|
} catch (r) {
|
|
743
743
|
console.warn("mockApi", r);
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
const e =
|
|
746
|
+
function De(n = window) {
|
|
747
|
+
const e = N(n);
|
|
748
748
|
e && (e._mocked = {});
|
|
749
749
|
}
|
|
750
|
-
class
|
|
750
|
+
class Tt {
|
|
751
751
|
__id = null;
|
|
752
752
|
__mode;
|
|
753
753
|
__instance = null;
|
|
@@ -778,7 +778,7 @@ class Ft {
|
|
|
778
778
|
const { mode: t, dsl: s, attrs: r } = e;
|
|
779
779
|
this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
|
|
780
780
|
}
|
|
781
|
-
setup(e, t =
|
|
781
|
+
setup(e, t = V) {
|
|
782
782
|
const s = t.getCurrentInstance();
|
|
783
783
|
if (!s) return;
|
|
784
784
|
this.__refs = {}, this.__refCaches = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
|
|
@@ -792,12 +792,12 @@ class Ft {
|
|
|
792
792
|
});
|
|
793
793
|
}
|
|
794
794
|
__proxy() {
|
|
795
|
-
this.__instance &&
|
|
795
|
+
this.__instance && je.forEach((e) => {
|
|
796
796
|
this[e] = this.__instance?.[e];
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
799
|
__cleanup() {
|
|
800
|
-
|
|
800
|
+
je.forEach((e) => {
|
|
801
801
|
this[e] = null;
|
|
802
802
|
}), this.__reset();
|
|
803
803
|
}
|
|
@@ -806,7 +806,7 @@ class Ft {
|
|
|
806
806
|
}
|
|
807
807
|
__parseFunction(e) {
|
|
808
808
|
if (e)
|
|
809
|
-
if (this.__mode ===
|
|
809
|
+
if (this.__mode === y.Runtime) {
|
|
810
810
|
const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
|
811
811
|
return R({ type: s, value: r }, this);
|
|
812
812
|
} else
|
|
@@ -814,32 +814,32 @@ class Ft {
|
|
|
814
814
|
}
|
|
815
815
|
__parseExpression(e) {
|
|
816
816
|
if (e)
|
|
817
|
-
if (this.__mode ===
|
|
817
|
+
if (this.__mode === y.Runtime) {
|
|
818
818
|
const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
|
819
819
|
return B({ type: s, value: r }, this);
|
|
820
820
|
} else
|
|
821
821
|
return B(e, this);
|
|
822
822
|
}
|
|
823
823
|
__ref(e = null, t) {
|
|
824
|
-
if (this.__mode ===
|
|
824
|
+
if (this.__mode === y.VNode)
|
|
825
825
|
return;
|
|
826
826
|
e && e !== this.__id && (this.__contextRefs[e] = this);
|
|
827
827
|
let s = e ? this.__refCaches[e] : null;
|
|
828
828
|
return s || (s = async (r) => {
|
|
829
|
-
await
|
|
830
|
-
let
|
|
831
|
-
if (!
|
|
829
|
+
await z(0);
|
|
830
|
+
let o = r?.$vtjEl || r?.$el || r?._?.vnode?.el || r;
|
|
831
|
+
if (!o) {
|
|
832
832
|
typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
|
|
833
833
|
return;
|
|
834
834
|
}
|
|
835
|
-
return
|
|
835
|
+
return o.nodeType === 3 && o.nextSibling && (o = o.nextSibling), o.__vtj__ = e, y.Design === this.__mode && (o.__context__ = this, o.draggable = !0), e && (this.__refs[e] = this.__getRefEl(this.__refs, e, r)), typeof t == "function" ? t(r) : t && (this.$refs[t] = this.__getRefEl(this.$refs, t, r)), r;
|
|
836
836
|
}, e && (this.__refCaches[e] = s), s);
|
|
837
837
|
}
|
|
838
838
|
__getRefEl(e, t, s) {
|
|
839
839
|
const r = e[t];
|
|
840
840
|
if (r && s !== r) {
|
|
841
|
-
const
|
|
842
|
-
return Array.from(
|
|
841
|
+
const o = new Set([].concat(r, s));
|
|
842
|
+
return Array.from(o);
|
|
843
843
|
} else
|
|
844
844
|
return s;
|
|
845
845
|
}
|
|
@@ -851,40 +851,40 @@ class Ft {
|
|
|
851
851
|
return s.context.__proto__ = this.context, s.__proto__ = this, s;
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function ue(n) {
|
|
855
855
|
const {
|
|
856
|
-
Vue: e =
|
|
857
|
-
mode: t =
|
|
856
|
+
Vue: e = V,
|
|
857
|
+
mode: t = y.Runtime,
|
|
858
858
|
components: s = {},
|
|
859
859
|
libs: r = {},
|
|
860
|
-
apis:
|
|
861
|
-
loader:
|
|
862
|
-
} = n,
|
|
860
|
+
apis: o = {},
|
|
861
|
+
loader: i
|
|
862
|
+
} = n, a = e.computed(() => n.dsl), u = {
|
|
863
863
|
$components: s,
|
|
864
864
|
$libs: r,
|
|
865
|
-
$apis:
|
|
866
|
-
}, c = new
|
|
865
|
+
$apis: o
|
|
866
|
+
}, c = new Tt({
|
|
867
867
|
mode: t,
|
|
868
|
-
dsl:
|
|
869
|
-
attrs:
|
|
870
|
-
}),
|
|
871
|
-
name:
|
|
872
|
-
__scopeId:
|
|
868
|
+
dsl: a.value,
|
|
869
|
+
attrs: u
|
|
870
|
+
}), l = e.defineComponent({
|
|
871
|
+
name: a.value.name,
|
|
872
|
+
__scopeId: a.value.id ? `data-v-${a.value.id}` : void 0,
|
|
873
873
|
props: {
|
|
874
|
-
...
|
|
874
|
+
...Dt(a.value.props ?? [], c)
|
|
875
875
|
},
|
|
876
876
|
async setup(f) {
|
|
877
|
-
c.$props = f, c.props = f,
|
|
877
|
+
c.$props = f, c.props = f, a.value.id && me(
|
|
878
878
|
n.window || window,
|
|
879
|
-
|
|
880
|
-
|
|
879
|
+
a.value.id,
|
|
880
|
+
a.value.css || "",
|
|
881
881
|
!0
|
|
882
|
-
), c.state =
|
|
883
|
-
const p =
|
|
884
|
-
for (const [
|
|
885
|
-
m[
|
|
886
|
-
const h =
|
|
887
|
-
|
|
882
|
+
), c.state = Ht(e, a.value.state ?? {}, c);
|
|
883
|
+
const p = Nt(e, a.value.computed ?? {}, c), d = Bt(a.value.methods ?? {}, c), m = Lt(e, a.value.inject, c);
|
|
884
|
+
for (const [_, w] of Object.entries(m || {}))
|
|
885
|
+
m[_] = e.inject(_, w);
|
|
886
|
+
const h = Ut(
|
|
887
|
+
a.value.dataSources || {},
|
|
888
888
|
c
|
|
889
889
|
), g = {
|
|
890
890
|
...m,
|
|
@@ -892,40 +892,40 @@ function ae(n) {
|
|
|
892
892
|
...d,
|
|
893
893
|
...h
|
|
894
894
|
};
|
|
895
|
-
return c.setup(g, e),
|
|
895
|
+
return c.setup(g, e), qt(e, a.value.watch ?? [], c), {
|
|
896
896
|
vtj: c,
|
|
897
897
|
state: c.state,
|
|
898
898
|
...p,
|
|
899
899
|
...d
|
|
900
900
|
};
|
|
901
901
|
},
|
|
902
|
-
emits:
|
|
903
|
-
expose: ["vtj", ...
|
|
902
|
+
emits: xt(a.value.emits),
|
|
903
|
+
expose: ["vtj", ...a.value.expose || []],
|
|
904
904
|
render() {
|
|
905
|
-
if (!
|
|
906
|
-
const f =
|
|
905
|
+
if (!a.value.nodes) return null;
|
|
906
|
+
const f = a.value.nodes || [];
|
|
907
907
|
if (f.length === 1)
|
|
908
|
-
return
|
|
908
|
+
return T(f[0], c, e, i, f);
|
|
909
909
|
{
|
|
910
910
|
const p = f.map(
|
|
911
|
-
(d) =>
|
|
911
|
+
(d) => T(d, c, e, i, f)
|
|
912
912
|
);
|
|
913
913
|
return e.createVNode("div", {}, p);
|
|
914
914
|
}
|
|
915
915
|
},
|
|
916
|
-
...
|
|
916
|
+
...Jt(a.value.lifeCycles ?? {}, c)
|
|
917
917
|
});
|
|
918
918
|
return {
|
|
919
|
-
renderer: e.markRaw(
|
|
919
|
+
renderer: e.markRaw(l),
|
|
920
920
|
context: c
|
|
921
921
|
};
|
|
922
922
|
}
|
|
923
|
-
function
|
|
924
|
-
return n.map((e) =>
|
|
923
|
+
function xt(n = []) {
|
|
924
|
+
return n.map((e) => F(e) ? e : e.name);
|
|
925
925
|
}
|
|
926
|
-
function
|
|
927
|
-
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((
|
|
928
|
-
return n.map((s) =>
|
|
926
|
+
function Dt(n = [], e) {
|
|
927
|
+
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => ft[o]) : void 0;
|
|
928
|
+
return n.map((s) => F(s) ? {
|
|
929
929
|
name: s
|
|
930
930
|
} : {
|
|
931
931
|
name: s.name,
|
|
@@ -941,51 +941,51 @@ function Ot(n = [], e) {
|
|
|
941
941
|
{}
|
|
942
942
|
);
|
|
943
943
|
}
|
|
944
|
-
function
|
|
944
|
+
function Ht(n, e, t) {
|
|
945
945
|
return n.reactive(
|
|
946
946
|
Object.keys(e || {}).reduce(
|
|
947
947
|
(s, r) => {
|
|
948
|
-
let
|
|
949
|
-
return b(
|
|
948
|
+
let o = e[r];
|
|
949
|
+
return b(o) ? o = t.__parseExpression(o) : E(o) && (o = t.__parseFunction(o)), s[r] = o, s;
|
|
950
950
|
},
|
|
951
951
|
{}
|
|
952
952
|
)
|
|
953
953
|
);
|
|
954
954
|
}
|
|
955
|
-
function
|
|
955
|
+
function Nt(n, e, t) {
|
|
956
956
|
return Object.entries(e ?? {}).reduce(
|
|
957
|
-
(s, [r,
|
|
957
|
+
(s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
|
|
958
958
|
{}
|
|
959
959
|
);
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function Bt(n, e) {
|
|
962
962
|
return Object.entries(n ?? {}).reduce(
|
|
963
963
|
(t, [s, r]) => (t[s] = e.__parseFunction(r), t),
|
|
964
964
|
{}
|
|
965
965
|
);
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function Lt(n, e = [], t) {
|
|
968
968
|
return e.reduce(
|
|
969
969
|
(s, r) => {
|
|
970
|
-
const { name:
|
|
970
|
+
const { name: o, from: i } = r || {};
|
|
971
971
|
r.default;
|
|
972
|
-
const
|
|
973
|
-
return s[
|
|
972
|
+
const a = b(i) ? t.__parseExpression(i) || o : i ?? o, u = b(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
|
|
973
|
+
return s[o] = n.inject(a, u), s;
|
|
974
974
|
},
|
|
975
975
|
{}
|
|
976
976
|
);
|
|
977
977
|
}
|
|
978
|
-
function
|
|
978
|
+
function Ut(n, e) {
|
|
979
979
|
return Object.keys(n).reduce(
|
|
980
980
|
(t, s) => {
|
|
981
981
|
const r = n[s];
|
|
982
982
|
if (r.type === "mock")
|
|
983
|
-
t[s] =
|
|
983
|
+
t[s] = Ot(r);
|
|
984
984
|
else if (r.ref) {
|
|
985
|
-
const
|
|
986
|
-
t[s] = async (...
|
|
987
|
-
const
|
|
988
|
-
return
|
|
985
|
+
const o = e.$apis[r.ref], i = E(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
|
|
986
|
+
t[s] = async (...a) => {
|
|
987
|
+
const u = await o.apply(e, a);
|
|
988
|
+
return i ? i(u) : u;
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
991
|
return t;
|
|
@@ -993,7 +993,7 @@ function Ht(n, e) {
|
|
|
993
993
|
{}
|
|
994
994
|
);
|
|
995
995
|
}
|
|
996
|
-
function
|
|
996
|
+
function qt(n, e = [], t) {
|
|
997
997
|
e.forEach((s) => {
|
|
998
998
|
n.watch(
|
|
999
999
|
t.__parseExpression(s.source),
|
|
@@ -1005,229 +1005,277 @@ function Bt(n, e = [], t) {
|
|
|
1005
1005
|
);
|
|
1006
1006
|
});
|
|
1007
1007
|
}
|
|
1008
|
-
function
|
|
1008
|
+
function Jt(n, e) {
|
|
1009
1009
|
return Object.entries(n ?? {}).reduce(
|
|
1010
1010
|
(t, [s, r]) => {
|
|
1011
|
-
const
|
|
1011
|
+
const o = e.__parseFunction(r);
|
|
1012
1012
|
return t[s] = async () => {
|
|
1013
|
-
|
|
1013
|
+
K(o) && (await z(0), await o());
|
|
1014
1014
|
}, t;
|
|
1015
1015
|
},
|
|
1016
1016
|
{}
|
|
1017
1017
|
);
|
|
1018
1018
|
}
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1019
|
+
class Kt {
|
|
1020
|
+
__props = {};
|
|
1021
|
+
__events = {};
|
|
1022
|
+
__nodes = {};
|
|
1023
|
+
constructor() {
|
|
1024
|
+
}
|
|
1025
|
+
setProps(e, t) {
|
|
1026
|
+
this.__props[e] = t;
|
|
1027
|
+
}
|
|
1028
|
+
getProps(e) {
|
|
1029
|
+
return this.__props[e];
|
|
1030
|
+
}
|
|
1031
|
+
setEvents(e, t) {
|
|
1032
|
+
}
|
|
1033
|
+
getEvents(e) {
|
|
1034
|
+
return this.__events[e];
|
|
1035
|
+
}
|
|
1036
|
+
setNode(e, t) {
|
|
1037
|
+
this.__nodes[e] = t;
|
|
1038
|
+
}
|
|
1039
|
+
getNode(e) {
|
|
1040
|
+
return this.__nodes[e];
|
|
1041
|
+
}
|
|
1042
|
+
isEqual(e, t) {
|
|
1043
|
+
return nt(e, t);
|
|
1044
|
+
}
|
|
1045
|
+
clear() {
|
|
1046
|
+
this.__props = {}, this.__events = {}, this.__nodes = {};
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
const A = new Kt(), He = new rt();
|
|
1050
|
+
let ne = [], k = {}, x = {};
|
|
1051
|
+
const zt = (n, e) => e;
|
|
1052
|
+
async function Ne(n, e = window) {
|
|
1053
|
+
const { urls: t = [], library: s } = n, r = t.filter((a) => Q(a));
|
|
1024
1054
|
if (r.length === 0 || !s) return null;
|
|
1025
|
-
const
|
|
1026
|
-
return
|
|
1027
|
-
(
|
|
1055
|
+
const o = t.filter((a) => W(a));
|
|
1056
|
+
return o.length && Me(o, e), await Te(r, s, e).catch(
|
|
1057
|
+
(a) => (console.warn("loadScriptUrl error", r, s, a), null)
|
|
1028
1058
|
);
|
|
1029
1059
|
}
|
|
1030
|
-
function
|
|
1060
|
+
function fe(n) {
|
|
1031
1061
|
const { getDsl: e, getDslByUrl: t, options: s } = n;
|
|
1032
|
-
return s.window && (
|
|
1062
|
+
return s.window && (ne.forEach((r) => {
|
|
1033
1063
|
delete s.window[r];
|
|
1034
|
-
}),
|
|
1035
|
-
if (!i || typeof i == "string") return
|
|
1036
|
-
let
|
|
1064
|
+
}), ne = []), (r, o, i, a = V) => {
|
|
1065
|
+
if (!i || typeof i == "string") return o;
|
|
1066
|
+
let u = "";
|
|
1037
1067
|
if (i.type === "Schema" && i.id)
|
|
1038
|
-
return
|
|
1039
|
-
const
|
|
1068
|
+
return u = i.id + "_" + r, x[u] || (x[u] = a.defineAsyncComponent(async () => {
|
|
1069
|
+
const c = k[i.id] || await He.add(
|
|
1040
1070
|
i.id,
|
|
1041
1071
|
() => e(i.id)
|
|
1042
1072
|
);
|
|
1043
|
-
return
|
|
1044
|
-
...s,
|
|
1073
|
+
return c && (c.name = o, k[i.id] = c), c ? ue({
|
|
1045
1074
|
Vue: a,
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1075
|
+
mode: y.Runtime,
|
|
1076
|
+
...s,
|
|
1077
|
+
dsl: $e(c),
|
|
1078
|
+
loader: fe(n)
|
|
1049
1079
|
}).renderer : null;
|
|
1050
1080
|
}));
|
|
1051
1081
|
if (i.type === "UrlSchema" && i.url)
|
|
1052
|
-
return
|
|
1053
|
-
const
|
|
1054
|
-
return
|
|
1082
|
+
return u = i.url + "_" + r, x[u] || (x[u] = a.defineAsyncComponent(async () => {
|
|
1083
|
+
const c = k[i.url] || await t(i.url);
|
|
1084
|
+
return c && (c.name = o, k[i.url] = c), c ? ue({
|
|
1055
1085
|
...s,
|
|
1056
1086
|
Vue: a,
|
|
1057
|
-
dsl:
|
|
1058
|
-
mode:
|
|
1059
|
-
loader:
|
|
1087
|
+
dsl: $e(c),
|
|
1088
|
+
mode: y.Runtime,
|
|
1089
|
+
loader: fe(n)
|
|
1060
1090
|
}).renderer : null;
|
|
1061
1091
|
}));
|
|
1062
1092
|
if (i.type === "Plugin") {
|
|
1063
|
-
let
|
|
1064
|
-
return
|
|
1093
|
+
let c = i.library ? k[i.library] : null;
|
|
1094
|
+
return c || (i.library && ne.push(i.library), c = k[i.library || Symbol()] = a.defineAsyncComponent(
|
|
1065
1095
|
async () => {
|
|
1066
|
-
const
|
|
1067
|
-
return
|
|
1096
|
+
const l = await Ne(i, s.window);
|
|
1097
|
+
return l || (console.warn("getPlugin result is null", i), null);
|
|
1068
1098
|
}
|
|
1069
|
-
),
|
|
1099
|
+
), c);
|
|
1070
1100
|
}
|
|
1071
|
-
return
|
|
1101
|
+
return o;
|
|
1072
1102
|
};
|
|
1073
1103
|
}
|
|
1074
|
-
function
|
|
1075
|
-
|
|
1104
|
+
function Ds() {
|
|
1105
|
+
k = {}, x = {}, He.clearAllCache(), A.clear();
|
|
1076
1106
|
}
|
|
1077
|
-
function
|
|
1107
|
+
function T(n, e, t = V, s = zt, r = [], o = !1) {
|
|
1078
1108
|
if (!n || !n.name || n.invisible) return null;
|
|
1079
|
-
const
|
|
1080
|
-
if (!
|
|
1109
|
+
const i = t.getCurrentInstance()?.appContext, { id: a = null, directives: u = [] } = n, { vIf: c, vElseIf: l, vElse: f, vFor: p, vShow: d, vModels: m, vBind: h, vHtml: g, others: _ } = Be(u);
|
|
1110
|
+
if (!o && (l || f))
|
|
1081
1111
|
return null;
|
|
1082
|
-
if (c && !
|
|
1083
|
-
return
|
|
1112
|
+
if (c && !Vt(c, e))
|
|
1113
|
+
return Zt(n, e, t, s, r);
|
|
1084
1114
|
const w = (v, S = 0) => {
|
|
1085
|
-
const
|
|
1115
|
+
const I = v.$components, X = (() => {
|
|
1086
1116
|
if (n.name === "component")
|
|
1087
|
-
return
|
|
1117
|
+
return Wt(v, n.props?.is);
|
|
1088
1118
|
if (n.name === "slot") return n.name;
|
|
1089
|
-
const j = s(n.name, n.from, t);
|
|
1090
|
-
return
|
|
1091
|
-
})(), C =
|
|
1119
|
+
const j = s(`${n.id}_${S}`, n.name, n.from, t);
|
|
1120
|
+
return F(j) ? bt(j) || jt(j) ? j : I[j] ?? i?.app?.component(j) ?? j : j;
|
|
1121
|
+
})(), C = Qt(a, n.props ?? {}, v), ze = Yt(
|
|
1122
|
+
t,
|
|
1123
|
+
n.id,
|
|
1124
|
+
n.events ?? {},
|
|
1125
|
+
v
|
|
1126
|
+
);
|
|
1092
1127
|
if (n.name === "slot")
|
|
1093
|
-
return
|
|
1128
|
+
return es(t, n, C, v, s);
|
|
1094
1129
|
h && Object.assign(C, v.__parseExpression(h.value)), d && (C.style = Object.assign(
|
|
1095
1130
|
C.style ?? {},
|
|
1096
|
-
|
|
1097
|
-
)), g && Object.assign(C,
|
|
1098
|
-
|
|
1131
|
+
ss(d, v)
|
|
1132
|
+
)), g && Object.assign(C, ns(g, v)), m.forEach((j) => {
|
|
1133
|
+
ke.includes(n.name) ? Object.assign(C, rs(j, v)) : Object.assign(C, os(t, j, v));
|
|
1099
1134
|
});
|
|
1100
|
-
const
|
|
1135
|
+
const Ge = is(
|
|
1101
1136
|
t,
|
|
1102
1137
|
n.children ?? [],
|
|
1103
1138
|
v,
|
|
1104
1139
|
s,
|
|
1105
1140
|
n
|
|
1106
|
-
),
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1141
|
+
), ve = v?.__id ? `data-v-${v.__id}` : void 0, Ve = ve ? { [ve]: "" } : {}, We = v.__mode === y.Design ? { "data-vtj": a } : {}, Y = `${a}_${S}`, Z = {
|
|
1142
|
+
key: `${a}_${S}`,
|
|
1143
|
+
...Ve,
|
|
1144
|
+
...We,
|
|
1145
|
+
...C,
|
|
1146
|
+
...ze
|
|
1147
|
+
};
|
|
1148
|
+
A.isEqual(Z, A.getNode(Y)) || A.setNode(Y, Z);
|
|
1149
|
+
let ee = t.createVNode(
|
|
1150
|
+
X,
|
|
1151
|
+
A.getNode(Y) || Z || {},
|
|
1152
|
+
Ge
|
|
1111
1153
|
);
|
|
1112
|
-
const
|
|
1113
|
-
return
|
|
1154
|
+
const ye = i ? Gt(i, _, v) : [];
|
|
1155
|
+
return ye.length && (ee = t.withDirectives(ee, ye)), ee;
|
|
1114
1156
|
};
|
|
1115
|
-
return p ?
|
|
1157
|
+
return p ? ls(p, w, e) : w(e);
|
|
1116
1158
|
}
|
|
1117
|
-
function
|
|
1159
|
+
function Gt(n, e, t) {
|
|
1118
1160
|
const s = n.app;
|
|
1119
1161
|
return e.map((r) => {
|
|
1120
|
-
const
|
|
1121
|
-
if (!
|
|
1122
|
-
const
|
|
1123
|
-
return r.value &&
|
|
1162
|
+
const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
|
|
1163
|
+
if (!o) return null;
|
|
1164
|
+
const i = [o];
|
|
1165
|
+
return r.value && i.push(t.__parseExpression(r.value)), r.arg && i.push(r.arg), r.modifiers && i.push(r.modifiers), i;
|
|
1124
1166
|
}).filter((r) => !!r);
|
|
1125
1167
|
}
|
|
1126
|
-
function
|
|
1127
|
-
const e = n.find((
|
|
1128
|
-
(
|
|
1129
|
-
), s = n.find((
|
|
1130
|
-
(
|
|
1168
|
+
function Be(n = []) {
|
|
1169
|
+
const e = n.find((l) => P(l.name) === "vIf"), t = n.find(
|
|
1170
|
+
(l) => P(l.name) === "vElseIf"
|
|
1171
|
+
), s = n.find((l) => P(l.name) === "vElse"), r = n.find((l) => P(l.name) === "vFor"), o = n.find((l) => P(l.name) === "vShow"), i = n.find((l) => P(l.name) === "vBind"), a = n.find((l) => P(l.name) === "vHtml"), u = n.filter(
|
|
1172
|
+
(l) => P(l.name) === "vModel"
|
|
1131
1173
|
), c = n.filter(
|
|
1132
|
-
(
|
|
1174
|
+
(l) => !ut.includes(P(l.name))
|
|
1133
1175
|
);
|
|
1134
1176
|
return {
|
|
1135
1177
|
vIf: e,
|
|
1136
1178
|
vElseIf: t,
|
|
1137
1179
|
vElse: s,
|
|
1138
1180
|
vFor: r,
|
|
1139
|
-
vShow:
|
|
1140
|
-
vModels:
|
|
1141
|
-
vBind:
|
|
1181
|
+
vShow: o,
|
|
1182
|
+
vModels: u,
|
|
1183
|
+
vBind: i,
|
|
1142
1184
|
others: c,
|
|
1143
|
-
vHtml:
|
|
1185
|
+
vHtml: a
|
|
1144
1186
|
};
|
|
1145
1187
|
}
|
|
1146
|
-
function
|
|
1188
|
+
function Vt(n, e) {
|
|
1147
1189
|
return !!e.__parseExpression(n.value);
|
|
1148
1190
|
}
|
|
1149
|
-
function
|
|
1191
|
+
function Wt(n, e) {
|
|
1150
1192
|
return e ? b(e) ? n.__parseExpression(e) : e : "div";
|
|
1151
1193
|
}
|
|
1152
|
-
function
|
|
1153
|
-
const s =
|
|
1154
|
-
|
|
1194
|
+
function Qt(n, e, t) {
|
|
1195
|
+
const s = n ? A.getProps(n) : null;
|
|
1196
|
+
if (s)
|
|
1197
|
+
return s;
|
|
1198
|
+
const r = pe(e, t);
|
|
1199
|
+
return r.ref = t.__ref(n, r.ref), n && A.setProps(n, r), r;
|
|
1155
1200
|
}
|
|
1156
|
-
function
|
|
1157
|
-
return b(n) ? e.__parseExpression(n) : E(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) =>
|
|
1201
|
+
function pe(n, e) {
|
|
1202
|
+
return b(n) ? e.__parseExpression(n) : E(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) => pe(t, e)) : typeof n == "object" ? Object.keys(n || {}).reduce(
|
|
1158
1203
|
(t, s) => {
|
|
1159
1204
|
let r = n[s];
|
|
1160
|
-
return t[s] =
|
|
1205
|
+
return t[s] = pe(r, e), t;
|
|
1161
1206
|
},
|
|
1162
1207
|
{}
|
|
1163
1208
|
) : n;
|
|
1164
1209
|
}
|
|
1165
|
-
function
|
|
1210
|
+
function Xt(n, e) {
|
|
1166
1211
|
return (t) => {
|
|
1167
1212
|
t?.key?.toLowerCase() === e.toLowerCase() && n(t);
|
|
1168
1213
|
};
|
|
1169
1214
|
}
|
|
1170
|
-
function
|
|
1171
|
-
const
|
|
1215
|
+
function Yt(n, e, t, s) {
|
|
1216
|
+
const r = e ? A.getEvents(e) : null;
|
|
1217
|
+
if (r)
|
|
1218
|
+
return r;
|
|
1219
|
+
const o = ["passive", "capture", "once"], i = {
|
|
1172
1220
|
capture: "Capture",
|
|
1173
1221
|
once: "Once",
|
|
1174
1222
|
passive: "OnceCapture"
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
)), i;
|
|
1223
|
+
}, a = Object.keys(t || {}).reduce(
|
|
1224
|
+
(u, c) => {
|
|
1225
|
+
const l = t[c], f = Le(l.modifiers), p = f.find((h) => o.includes(h)), d = "on" + ot(c) + (p && i[p] || ""), m = s.__parseFunction(l.handler);
|
|
1226
|
+
return m && (u[d] = n.withModifiers(
|
|
1227
|
+
f.includes("enter") ? Xt(m, "enter") : m,
|
|
1228
|
+
f
|
|
1229
|
+
)), u;
|
|
1183
1230
|
},
|
|
1184
1231
|
{}
|
|
1185
1232
|
);
|
|
1233
|
+
return e && A.setEvents(e, a), a;
|
|
1186
1234
|
}
|
|
1187
|
-
function
|
|
1188
|
-
let
|
|
1189
|
-
for (let
|
|
1190
|
-
const { directives:
|
|
1191
|
-
if (
|
|
1192
|
-
if (e.__parseExpression(
|
|
1193
|
-
return
|
|
1235
|
+
function Zt(n, e, t, s, r = []) {
|
|
1236
|
+
let o = r.findIndex((i) => i.id === n.id);
|
|
1237
|
+
for (let i = ++o; i < r.length; i++) {
|
|
1238
|
+
const { directives: a = [] } = r[i], { vElseIf: u, vElse: c } = Be(a);
|
|
1239
|
+
if (u) {
|
|
1240
|
+
if (e.__parseExpression(u.value))
|
|
1241
|
+
return T(r[i], e, t, s, r, !0);
|
|
1194
1242
|
continue;
|
|
1195
1243
|
}
|
|
1196
1244
|
if (c)
|
|
1197
|
-
return
|
|
1245
|
+
return T(r[i], e, t, s, r, !0);
|
|
1198
1246
|
}
|
|
1199
1247
|
return null;
|
|
1200
1248
|
}
|
|
1201
|
-
function
|
|
1249
|
+
function Le(n = {}, e = !1) {
|
|
1202
1250
|
const t = Object.keys(n);
|
|
1203
1251
|
return e ? t.map((s) => "." + s) : t;
|
|
1204
1252
|
}
|
|
1205
|
-
function
|
|
1206
|
-
const { children:
|
|
1207
|
-
return
|
|
1208
|
-
|
|
1209
|
-
) : Array.isArray(
|
|
1210
|
-
(
|
|
1253
|
+
function es(n, e, t, s, r) {
|
|
1254
|
+
const { children: o } = e, i = ts(e, s), a = s.$slots?.[i.name];
|
|
1255
|
+
return a ? a(t) : o ? F(o) ? n.createTextVNode(o) : b(o) ? n.createTextVNode(
|
|
1256
|
+
Oe(s.__parseExpression(o))
|
|
1257
|
+
) : Array.isArray(o) ? o.map(
|
|
1258
|
+
(u) => T(u, s, n, r, o)
|
|
1211
1259
|
) : null : null;
|
|
1212
1260
|
}
|
|
1213
|
-
function
|
|
1261
|
+
function ts(n, e) {
|
|
1214
1262
|
const { props: t } = n, s = t?.name || "default";
|
|
1215
1263
|
return {
|
|
1216
1264
|
name: b(s) ? e.__parseExpression(s) : s,
|
|
1217
1265
|
params: []
|
|
1218
1266
|
};
|
|
1219
1267
|
}
|
|
1220
|
-
function
|
|
1268
|
+
function ss(n, e) {
|
|
1221
1269
|
return e.__parseExpression(n.value) ? {} : {
|
|
1222
1270
|
display: "none"
|
|
1223
1271
|
};
|
|
1224
1272
|
}
|
|
1225
|
-
function
|
|
1273
|
+
function ns(n, e) {
|
|
1226
1274
|
return {
|
|
1227
1275
|
innerHTML: e.__parseExpression(n.value) || ""
|
|
1228
1276
|
};
|
|
1229
1277
|
}
|
|
1230
|
-
function
|
|
1278
|
+
function rs(n, e) {
|
|
1231
1279
|
const t = {
|
|
1232
1280
|
type: "JSFunction",
|
|
1233
1281
|
value: n.value?.value ? `(v) => {
|
|
@@ -1239,50 +1287,50 @@ function Zt(n, e) {
|
|
|
1239
1287
|
onInput: e.__parseFunction(t)
|
|
1240
1288
|
};
|
|
1241
1289
|
}
|
|
1242
|
-
function
|
|
1290
|
+
function os(n, e, t) {
|
|
1243
1291
|
const s = {
|
|
1244
1292
|
type: "JSFunction",
|
|
1245
1293
|
value: e.value?.value ? `(v) => {
|
|
1246
1294
|
${e.value.value} = v;
|
|
1247
1295
|
}` : "(v) => {}"
|
|
1248
|
-
}, r = t.__parseFunction(s),
|
|
1296
|
+
}, r = t.__parseFunction(s), o = Le(
|
|
1249
1297
|
b(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
|
|
1250
|
-
),
|
|
1298
|
+
), i = b(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
|
1251
1299
|
return {
|
|
1252
|
-
[
|
|
1253
|
-
[`onUpdate:${
|
|
1300
|
+
[i]: t.__parseExpression(e.value),
|
|
1301
|
+
[`onUpdate:${i}`]: o.length && r ? n.withModifiers(r, o) : r
|
|
1254
1302
|
};
|
|
1255
1303
|
}
|
|
1256
|
-
function
|
|
1304
|
+
function is(n, e, t, s, r) {
|
|
1257
1305
|
if (!e) return null;
|
|
1258
|
-
if (
|
|
1306
|
+
if (F(e))
|
|
1259
1307
|
return { default: () => e };
|
|
1260
1308
|
if (b(e))
|
|
1261
1309
|
return {
|
|
1262
|
-
default: () =>
|
|
1310
|
+
default: () => Oe(t.__parseExpression(e))
|
|
1263
1311
|
};
|
|
1264
1312
|
if (Array.isArray(e) && e.length > 0) {
|
|
1265
|
-
const
|
|
1266
|
-
[
|
|
1313
|
+
const o = as(e), i = (a, u) => !a || !r ? {} : r?.id && Object.keys(a).length ? u ? {
|
|
1314
|
+
[u]: a
|
|
1267
1315
|
} : {
|
|
1268
|
-
[`scope_${r.id}`]:
|
|
1269
|
-
} :
|
|
1270
|
-
return Object.entries(
|
|
1271
|
-
(
|
|
1272
|
-
const d =
|
|
1316
|
+
[`scope_${r.id}`]: a
|
|
1317
|
+
} : u ? { [u]: /* @__PURE__ */ Object.create(null) } : {};
|
|
1318
|
+
return Object.entries(o).reduce(
|
|
1319
|
+
(a, [u, { nodes: c, params: l, scope: f }]) => (a[u] = (p) => {
|
|
1320
|
+
const d = l.length ? it(p ?? {}, l) : i(p, f);
|
|
1273
1321
|
return c.map(
|
|
1274
|
-
(m) =>
|
|
1322
|
+
(m) => T(m, t.__clone(d), n, s, c)
|
|
1275
1323
|
);
|
|
1276
|
-
},
|
|
1324
|
+
}, a),
|
|
1277
1325
|
{}
|
|
1278
1326
|
);
|
|
1279
1327
|
}
|
|
1280
1328
|
return null;
|
|
1281
1329
|
}
|
|
1282
|
-
function
|
|
1330
|
+
function as(n) {
|
|
1283
1331
|
const e = {};
|
|
1284
1332
|
for (const t of n) {
|
|
1285
|
-
const s =
|
|
1333
|
+
const s = cs(t.slot), r = s.name;
|
|
1286
1334
|
e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params), e[r].scope = s.scope || "") : e[r] = {
|
|
1287
1335
|
nodes: [t],
|
|
1288
1336
|
params: s.params,
|
|
@@ -1291,24 +1339,24 @@ function ss(n) {
|
|
|
1291
1339
|
}
|
|
1292
1340
|
return e;
|
|
1293
1341
|
}
|
|
1294
|
-
function
|
|
1295
|
-
return
|
|
1342
|
+
function cs(n = "default") {
|
|
1343
|
+
return F(n) ? { name: n, params: [], scope: "" } : { params: [], scope: "", ...n };
|
|
1296
1344
|
}
|
|
1297
|
-
function
|
|
1298
|
-
const { value: s, iterator: r } = n, { item:
|
|
1299
|
-
let
|
|
1300
|
-
return Number.isInteger(
|
|
1345
|
+
function ls(n, e, t) {
|
|
1346
|
+
const { value: s, iterator: r } = n, { item: o = "item", index: i = "index" } = r || {};
|
|
1347
|
+
let a = t.__parseExpression(s) || [];
|
|
1348
|
+
return Number.isInteger(a) && (a = new Array(a).fill(!0).map((u, c) => c + 1)), Array.isArray(a) ? a.map((u, c) => e(t.__clone({ [o]: u, [i]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
|
1301
1349
|
}
|
|
1302
|
-
const
|
|
1350
|
+
const re = Ie({
|
|
1303
1351
|
name: "VtjPageContainer",
|
|
1304
1352
|
async setup() {
|
|
1305
|
-
const n =
|
|
1353
|
+
const n = Je(), e = Fe(), t = e.meta.__vtj__ || e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = le(Symbol());
|
|
1306
1354
|
if (s) {
|
|
1307
1355
|
Object.assign(e.meta, s.meta || {}, { cache: s.cache });
|
|
1308
|
-
const { useTitle:
|
|
1309
|
-
if (
|
|
1310
|
-
const
|
|
1311
|
-
a
|
|
1356
|
+
const { useTitle: i } = n?.adapter;
|
|
1357
|
+
if (i) {
|
|
1358
|
+
const a = e.meta.title || s.title || "VTJ.PRO";
|
|
1359
|
+
i(a);
|
|
1312
1360
|
}
|
|
1313
1361
|
}
|
|
1314
1362
|
return {
|
|
@@ -1317,13 +1365,13 @@ const te = Ce({
|
|
|
1317
1365
|
file: s,
|
|
1318
1366
|
query: e.query,
|
|
1319
1367
|
meta: e.meta,
|
|
1320
|
-
sid:
|
|
1368
|
+
sid: o,
|
|
1321
1369
|
route: e
|
|
1322
1370
|
};
|
|
1323
1371
|
},
|
|
1324
1372
|
render() {
|
|
1325
1373
|
const { component: n, query: e, sid: t } = this;
|
|
1326
|
-
return n ?
|
|
1374
|
+
return n ? ce(n, { ...e, key: t }) : ce(
|
|
1327
1375
|
"div",
|
|
1328
1376
|
{ style: { padding: "10px" } },
|
|
1329
1377
|
"找不到组件,组件不存在或未发布!"
|
|
@@ -1332,222 +1380,222 @@ const te = Ce({
|
|
|
1332
1380
|
activated() {
|
|
1333
1381
|
this.meta.cache === !1 && (this.sid = Symbol());
|
|
1334
1382
|
}
|
|
1335
|
-
}),
|
|
1383
|
+
}), us = Ie({
|
|
1336
1384
|
name: "VtjStartupContainer",
|
|
1337
1385
|
render() {
|
|
1338
|
-
return
|
|
1386
|
+
return ce("div", "page not found!");
|
|
1339
1387
|
}
|
|
1340
1388
|
});
|
|
1341
|
-
function
|
|
1389
|
+
function G(n, e, t = []) {
|
|
1342
1390
|
const s = [];
|
|
1343
1391
|
for (const r of t) {
|
|
1344
|
-
const { id:
|
|
1345
|
-
if (
|
|
1346
|
-
const f =
|
|
1392
|
+
const { id: o, title: i, icon: a, children: u, hidden: c, layout: l } = r;
|
|
1393
|
+
if (l) {
|
|
1394
|
+
const f = G(n, e, u || []);
|
|
1347
1395
|
s.push(...f);
|
|
1348
1396
|
} else {
|
|
1349
1397
|
const f = {
|
|
1350
|
-
id:
|
|
1351
|
-
title:
|
|
1352
|
-
icon:
|
|
1398
|
+
id: o,
|
|
1399
|
+
title: i,
|
|
1400
|
+
icon: a,
|
|
1353
1401
|
hidden: c,
|
|
1354
|
-
url: `${n}/${e}/${
|
|
1355
|
-
children:
|
|
1402
|
+
url: `${n}/${e}/${o}`,
|
|
1403
|
+
children: u && u.length ? G(n, e, u) : void 0
|
|
1356
1404
|
};
|
|
1357
1405
|
s.push(f);
|
|
1358
1406
|
}
|
|
1359
1407
|
}
|
|
1360
1408
|
return s;
|
|
1361
1409
|
}
|
|
1362
|
-
function
|
|
1410
|
+
function Ue(n, e) {
|
|
1363
1411
|
if (!e) return n;
|
|
1364
1412
|
let t = [];
|
|
1365
1413
|
for (const s of n)
|
|
1366
1414
|
if (s.children && s.children.length) {
|
|
1367
|
-
const r =
|
|
1415
|
+
const r = Ue(s.children, e);
|
|
1368
1416
|
r.length && (s.children = r, t.push(s));
|
|
1369
1417
|
} else
|
|
1370
1418
|
e.can(s.id.toString()) && t.push(s);
|
|
1371
1419
|
return t;
|
|
1372
1420
|
}
|
|
1373
|
-
function
|
|
1421
|
+
function Hs(n) {
|
|
1374
1422
|
const {
|
|
1375
1423
|
menuPathPrefix: e = "",
|
|
1376
1424
|
pageRouteName: t = "page",
|
|
1377
1425
|
disableMenusFilter: s = !1
|
|
1378
|
-
} = n || {}, r =
|
|
1379
|
-
|
|
1426
|
+
} = n || {}, r = Je(), o = Fe(), i = Pt(), a = le(!1), u = le(!1), c = r.project, l = (d, m) => {
|
|
1427
|
+
a.value = !d?.mask, u.value = m?.pure ?? !!d?.pure;
|
|
1380
1428
|
};
|
|
1381
|
-
|
|
1382
|
-
const { name: d, params: m, meta: h } =
|
|
1383
|
-
if (d ===
|
|
1429
|
+
lt(() => {
|
|
1430
|
+
const { name: d, params: m, meta: h } = o;
|
|
1431
|
+
if (d === H) {
|
|
1384
1432
|
const g = r.getPage(m.id);
|
|
1385
|
-
|
|
1386
|
-
} else if (d ===
|
|
1433
|
+
l(g, h);
|
|
1434
|
+
} else if (d === q) {
|
|
1387
1435
|
const g = r.getHomepage();
|
|
1388
|
-
|
|
1436
|
+
l(g, h);
|
|
1389
1437
|
} else {
|
|
1390
1438
|
const g = h.__vtj__;
|
|
1391
1439
|
if (g) {
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1440
|
+
const _ = r.getPage(g);
|
|
1441
|
+
l(_, h);
|
|
1394
1442
|
} else
|
|
1395
|
-
|
|
1443
|
+
a.value = !h.mask, u.value = !!h.pure;
|
|
1396
1444
|
}
|
|
1397
1445
|
});
|
|
1398
|
-
const f =
|
|
1446
|
+
const f = G(
|
|
1399
1447
|
e,
|
|
1400
1448
|
t,
|
|
1401
1449
|
c?.pages
|
|
1402
1450
|
), p = c?.config;
|
|
1403
1451
|
return {
|
|
1404
|
-
disabled:
|
|
1452
|
+
disabled: a,
|
|
1405
1453
|
logo: p?.logo,
|
|
1406
1454
|
themeSwitchable: p?.themeSwitchable,
|
|
1407
1455
|
title: p?.title || c?.description || c?.name || "VTJ App",
|
|
1408
|
-
menus: s ? f :
|
|
1409
|
-
pure:
|
|
1456
|
+
menus: s ? f : Ue(f, i),
|
|
1457
|
+
pure: u
|
|
1410
1458
|
};
|
|
1411
1459
|
}
|
|
1412
|
-
function
|
|
1413
|
-
const { id: t, title: s, meta: r } = n, { name:
|
|
1460
|
+
function oe(n, e) {
|
|
1461
|
+
const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: i = "", component: a, routeMeta: u } = e;
|
|
1414
1462
|
return {
|
|
1415
1463
|
name: t,
|
|
1416
|
-
path: `${
|
|
1417
|
-
component:
|
|
1464
|
+
path: `${i}${o}/${t}`,
|
|
1465
|
+
component: a,
|
|
1418
1466
|
meta: {
|
|
1419
1467
|
title: s,
|
|
1420
|
-
...
|
|
1468
|
+
...u,
|
|
1421
1469
|
...r,
|
|
1422
1470
|
__vtj__: t
|
|
1423
1471
|
}
|
|
1424
1472
|
};
|
|
1425
1473
|
}
|
|
1426
|
-
function
|
|
1474
|
+
function de(n) {
|
|
1427
1475
|
const {
|
|
1428
1476
|
name: e = "page",
|
|
1429
1477
|
prefix: t = "",
|
|
1430
1478
|
pages: s = [],
|
|
1431
1479
|
component: r,
|
|
1432
|
-
loader:
|
|
1433
|
-
routeMeta:
|
|
1434
|
-
homepage:
|
|
1435
|
-
} = n,
|
|
1480
|
+
loader: o,
|
|
1481
|
+
routeMeta: i,
|
|
1482
|
+
homepage: a
|
|
1483
|
+
} = n, u = [];
|
|
1436
1484
|
for (const c of s) {
|
|
1437
|
-
const { id:
|
|
1485
|
+
const { id: l, title: f, dir: p, layout: d, children: m, meta: h } = c;
|
|
1438
1486
|
if (p) {
|
|
1439
|
-
const g =
|
|
1487
|
+
const g = de({
|
|
1440
1488
|
name: e,
|
|
1441
1489
|
prefix: t,
|
|
1442
1490
|
component: r,
|
|
1443
|
-
routeMeta:
|
|
1444
|
-
homepage:
|
|
1445
|
-
loader:
|
|
1491
|
+
routeMeta: i,
|
|
1492
|
+
homepage: a,
|
|
1493
|
+
loader: o,
|
|
1446
1494
|
pages: m || []
|
|
1447
1495
|
});
|
|
1448
|
-
|
|
1496
|
+
u.push(...g);
|
|
1449
1497
|
} else if (d) {
|
|
1450
|
-
const g =
|
|
1498
|
+
const g = de({
|
|
1451
1499
|
name: e,
|
|
1452
1500
|
prefix: t,
|
|
1453
1501
|
component: r,
|
|
1454
|
-
routeMeta:
|
|
1455
|
-
homepage:
|
|
1456
|
-
loader:
|
|
1502
|
+
routeMeta: i,
|
|
1503
|
+
homepage: a,
|
|
1504
|
+
loader: o,
|
|
1457
1505
|
pages: m || []
|
|
1458
|
-
}),
|
|
1459
|
-
name: `layout_${
|
|
1506
|
+
}), _ = {
|
|
1507
|
+
name: `layout_${l}`,
|
|
1460
1508
|
path: t,
|
|
1461
|
-
component: () =>
|
|
1509
|
+
component: () => o(l),
|
|
1462
1510
|
meta: {
|
|
1463
1511
|
title: f,
|
|
1464
|
-
...
|
|
1512
|
+
...i,
|
|
1465
1513
|
...h,
|
|
1466
|
-
__vtj__:
|
|
1514
|
+
__vtj__: l
|
|
1467
1515
|
},
|
|
1468
1516
|
children: g
|
|
1469
1517
|
};
|
|
1470
|
-
|
|
1471
|
-
} else if (
|
|
1472
|
-
const g =
|
|
1473
|
-
g.path = "", g.name = `home_${
|
|
1518
|
+
u.push(_), u.push(oe(c, n));
|
|
1519
|
+
} else if (u.push(oe(c, n)), a === l) {
|
|
1520
|
+
const g = oe(c, n);
|
|
1521
|
+
g.path = "", g.name = `home_${l}`, u.push(g);
|
|
1474
1522
|
}
|
|
1475
1523
|
}
|
|
1476
|
-
return
|
|
1524
|
+
return u;
|
|
1477
1525
|
}
|
|
1478
|
-
function
|
|
1479
|
-
const { css: t, store: s, enhance: r } = n, { window:
|
|
1480
|
-
|
|
1526
|
+
function fs(n = {}, e) {
|
|
1527
|
+
const { css: t, store: s, enhance: r } = n, { window: o, app: i, library: a = {}, adapter: u, mode: c } = e, { Pinia: l } = a;
|
|
1528
|
+
i.config.globalProperties.$libs = a, me(o, "global-css", t || ""), l && s && ps(s, i, l), hs(i, u, n), !u.access && n.access && ds(n.access, i, c, u), ms(i, n), r && gs(r, i, a);
|
|
1481
1529
|
}
|
|
1482
|
-
function
|
|
1530
|
+
function ps(n, e, t) {
|
|
1483
1531
|
const s = t.createPinia();
|
|
1484
1532
|
if (e.use(s), E(n) && n.value) {
|
|
1485
|
-
const r = R(n, {}, !1, !1, !0),
|
|
1486
|
-
e.config.globalProperties.$store =
|
|
1533
|
+
const r = R(n, {}, !1, !1, !0), o = t.defineStore("$store", r(e) || {});
|
|
1534
|
+
e.config.globalProperties.$store = o();
|
|
1487
1535
|
}
|
|
1488
1536
|
}
|
|
1489
|
-
function
|
|
1537
|
+
function ds(n, e, t, s) {
|
|
1490
1538
|
if (E(n) && n.value) {
|
|
1491
|
-
const r = R(n, {}, !1, !1, !0), { alert:
|
|
1492
|
-
alert:
|
|
1539
|
+
const r = R(n, {}, !1, !1, !0), { alert: o, request: i } = s, a = new ge({
|
|
1540
|
+
alert: o,
|
|
1493
1541
|
storagePrefix: "__VTJ_APP_",
|
|
1494
1542
|
...r(e)
|
|
1495
|
-
}),
|
|
1496
|
-
|
|
1543
|
+
}), u = e.config.globalProperties.$router;
|
|
1544
|
+
a.connect({ mode: t, router: u, request: i }), e.use(a);
|
|
1497
1545
|
}
|
|
1498
1546
|
}
|
|
1499
|
-
function
|
|
1547
|
+
function hs(n, e, t) {
|
|
1500
1548
|
if (!e.request) return;
|
|
1501
|
-
const { axios: s, request: r, response:
|
|
1549
|
+
const { axios: s, request: r, response: o } = t;
|
|
1502
1550
|
if (s && E(s) && s.value) {
|
|
1503
|
-
const
|
|
1504
|
-
e.request.setConfig(
|
|
1551
|
+
const i = R(s, {}, !1, !1, !0);
|
|
1552
|
+
e.request.setConfig(i(n));
|
|
1505
1553
|
}
|
|
1506
1554
|
if (r && E(r) && r.value) {
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1555
|
+
const i = R(r, {}, !1, !1, !0), a = e.request;
|
|
1556
|
+
a.__unReq && a.__unReq(), a.__unReq = e.request.useRequest((u) => i(u, n));
|
|
1509
1557
|
}
|
|
1510
|
-
if (
|
|
1511
|
-
const
|
|
1512
|
-
|
|
1558
|
+
if (o && E(o) && o.value) {
|
|
1559
|
+
const i = R(o, {}, !1, !1, !0), a = e.request;
|
|
1560
|
+
a.__unRes && a.__unRes(), a.__unRes = e.request.useResponse((u) => i(u, n));
|
|
1513
1561
|
}
|
|
1514
1562
|
}
|
|
1515
|
-
function
|
|
1563
|
+
function ms(n, e) {
|
|
1516
1564
|
const { beforeEach: t, afterEach: s } = e, r = n.config.globalProperties.$router;
|
|
1517
1565
|
if (t && E(t) && t.value) {
|
|
1518
|
-
const
|
|
1519
|
-
r && r.beforeEach((
|
|
1566
|
+
const o = R(t, {}, !1, !1, !0);
|
|
1567
|
+
r && r.beforeEach((i, a, u) => o(i, a, u, n));
|
|
1520
1568
|
}
|
|
1521
1569
|
if (s && E(s) && s.value) {
|
|
1522
|
-
const
|
|
1523
|
-
r && r.afterEach((
|
|
1570
|
+
const o = R(s, {}, !1, !1, !0);
|
|
1571
|
+
r && r.afterEach((i, a, u) => o(i, a, u, n));
|
|
1524
1572
|
}
|
|
1525
1573
|
}
|
|
1526
|
-
function
|
|
1574
|
+
function gs(n, e, t = {}) {
|
|
1527
1575
|
E(n) && n.value && R(n, {}, !1, !1, !0)(e, t);
|
|
1528
1576
|
}
|
|
1529
|
-
function
|
|
1577
|
+
function _s(n, e, t) {
|
|
1530
1578
|
if (!n || !e || !t) return;
|
|
1531
1579
|
const { VueI18n: s } = e;
|
|
1532
1580
|
if (s) {
|
|
1533
|
-
const { locale: r, fallbackLocale:
|
|
1534
|
-
for (let c of
|
|
1535
|
-
const
|
|
1536
|
-
for (const f of
|
|
1537
|
-
|
|
1581
|
+
const { locale: r, fallbackLocale: o, messages: i = [] } = t, a = {};
|
|
1582
|
+
for (let c of i) {
|
|
1583
|
+
const l = Object.keys(c).filter((f) => f !== "key");
|
|
1584
|
+
for (const f of l)
|
|
1585
|
+
a[f] || (a[f] = {}), a[f][c.key] = c[f];
|
|
1538
1586
|
}
|
|
1539
|
-
const
|
|
1587
|
+
const u = s.createI18n({
|
|
1540
1588
|
legacy: !1,
|
|
1541
1589
|
locale: r,
|
|
1542
|
-
fallbackLocale:
|
|
1543
|
-
messages:
|
|
1590
|
+
fallbackLocale: o,
|
|
1591
|
+
messages: a
|
|
1544
1592
|
});
|
|
1545
|
-
n.use(
|
|
1593
|
+
n.use(u);
|
|
1546
1594
|
}
|
|
1547
1595
|
}
|
|
1548
|
-
const
|
|
1549
|
-
var
|
|
1550
|
-
class
|
|
1596
|
+
const qe = Symbol("Provider");
|
|
1597
|
+
var vs = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(vs || {});
|
|
1598
|
+
class ys extends Qe {
|
|
1551
1599
|
/**
|
|
1552
1600
|
* 创建Provider实例
|
|
1553
1601
|
* @param options 配置选项
|
|
@@ -1556,21 +1604,21 @@ class hs extends Ge {
|
|
|
1556
1604
|
super(), this.options = e;
|
|
1557
1605
|
const {
|
|
1558
1606
|
service: t,
|
|
1559
|
-
mode: s =
|
|
1607
|
+
mode: s = y.Raw,
|
|
1560
1608
|
dependencies: r,
|
|
1561
|
-
materials:
|
|
1562
|
-
project:
|
|
1563
|
-
adapter:
|
|
1564
|
-
globals:
|
|
1609
|
+
materials: o,
|
|
1610
|
+
project: i = {},
|
|
1611
|
+
adapter: a = {},
|
|
1612
|
+
globals: u = {},
|
|
1565
1613
|
modules: c = {},
|
|
1566
|
-
router:
|
|
1614
|
+
router: l = null,
|
|
1567
1615
|
materialPath: f = "./",
|
|
1568
1616
|
nodeEnv: p = "development"
|
|
1569
1617
|
/* Development */
|
|
1570
1618
|
} = e;
|
|
1571
|
-
this.mode = s, this.modules = c, this.service = t, this.router =
|
|
1619
|
+
this.mode = s, this.modules = c, this.service = t, this.router = l, this.materialPath = f, this.nodeEnv = p, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, u), Object.assign(this.adapter, a);
|
|
1572
1620
|
const { access: d, request: m } = this.adapter;
|
|
1573
|
-
d && d.connect({ mode: s, router:
|
|
1621
|
+
d && d.connect({ mode: s, router: l, request: m }), i && s !== y.Design ? this.load(i) : this.project = i;
|
|
1574
1622
|
}
|
|
1575
1623
|
mode;
|
|
1576
1624
|
// 当前运行模式(设计/源码/预览等)
|
|
@@ -1578,7 +1626,7 @@ class hs extends Ge {
|
|
|
1578
1626
|
// 全局变量
|
|
1579
1627
|
modules = {};
|
|
1580
1628
|
// 异步模块加载器
|
|
1581
|
-
adapter = { request:
|
|
1629
|
+
adapter = { request: ae, jsonp: Pe };
|
|
1582
1630
|
// 适配器接口
|
|
1583
1631
|
apis = {};
|
|
1584
1632
|
// API集合
|
|
@@ -1615,10 +1663,10 @@ class hs extends Ge {
|
|
|
1615
1663
|
if (e)
|
|
1616
1664
|
try {
|
|
1617
1665
|
s = await e.apply(e, t);
|
|
1618
|
-
} catch (
|
|
1619
|
-
|
|
1666
|
+
} catch (o) {
|
|
1667
|
+
M.warn("模拟数据模版异常", o);
|
|
1620
1668
|
}
|
|
1621
|
-
return
|
|
1669
|
+
return N()?.mock(s);
|
|
1622
1670
|
};
|
|
1623
1671
|
}
|
|
1624
1672
|
/**
|
|
@@ -1634,11 +1682,11 @@ class hs extends Ge {
|
|
|
1634
1682
|
const { vtjDir: t = ".vtj" } = this.options, s = this.modules[`${t}/projects/${e.id}.json`] || this.modules[`/src/${t}/projects/${e.id}.json`];
|
|
1635
1683
|
if (this.project = s ? await s() : await this.service.init(e), !this.project)
|
|
1636
1684
|
throw new Error("project is null");
|
|
1637
|
-
const { apis: r = [], meta:
|
|
1638
|
-
|
|
1685
|
+
const { apis: r = [], meta: o = [], env: i = [] } = this.project, a = window;
|
|
1686
|
+
a && (a.CKEDITOR_VERSION = void 0), this.initEnv(i), this.mode === y.Raw ? await this.loadDependencies(a) : await this.loadAssets(a), this.initMock(a), this.apis = Ft(r, o, this.adapter), De(a), kt(r, a), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
|
|
1639
1687
|
}
|
|
1640
1688
|
initMock(e) {
|
|
1641
|
-
const t =
|
|
1689
|
+
const t = N(e);
|
|
1642
1690
|
t && t.setup({
|
|
1643
1691
|
timeout: "50-500"
|
|
1644
1692
|
});
|
|
@@ -1652,56 +1700,56 @@ class hs extends Ge {
|
|
|
1652
1700
|
const { dependencies: t = [] } = this.project, {
|
|
1653
1701
|
dependencies: s,
|
|
1654
1702
|
library: r,
|
|
1655
|
-
components:
|
|
1656
|
-
materialPath:
|
|
1657
|
-
nodeEnv:
|
|
1658
|
-
libraryLocales:
|
|
1703
|
+
components: o,
|
|
1704
|
+
materialPath: i,
|
|
1705
|
+
nodeEnv: a,
|
|
1706
|
+
libraryLocales: u
|
|
1659
1707
|
} = this, {
|
|
1660
1708
|
libraryExports: c,
|
|
1661
|
-
libraryMap:
|
|
1709
|
+
libraryMap: l,
|
|
1662
1710
|
materials: f,
|
|
1663
1711
|
materialExports: p,
|
|
1664
1712
|
materialMapLibrary: d,
|
|
1665
1713
|
libraryLocaleMap: m
|
|
1666
|
-
} =
|
|
1714
|
+
} = mt(
|
|
1667
1715
|
t,
|
|
1668
|
-
|
|
1669
|
-
|
|
1716
|
+
i,
|
|
1717
|
+
a === "development"
|
|
1670
1718
|
/* Development */
|
|
1671
1719
|
);
|
|
1672
1720
|
Object.assign(this.libraryLocaleMap, m);
|
|
1673
1721
|
for (const h of c) {
|
|
1674
|
-
const g = s[h],
|
|
1675
|
-
if (
|
|
1676
|
-
r[h] =
|
|
1722
|
+
const g = s[h], _ = e[h];
|
|
1723
|
+
if (_)
|
|
1724
|
+
r[h] = _;
|
|
1677
1725
|
else if (g)
|
|
1678
1726
|
e[h] = r[h] = await g();
|
|
1679
1727
|
else {
|
|
1680
|
-
const v =
|
|
1728
|
+
const v = l[h] || [];
|
|
1681
1729
|
for (const S of v)
|
|
1682
|
-
|
|
1730
|
+
W(S) && await $t(S, O.append(S, { v: D })), Q(S) && await Ee(O.append(S, { v: D }));
|
|
1683
1731
|
r[h] = e[h];
|
|
1684
1732
|
}
|
|
1685
1733
|
const w = m[h];
|
|
1686
1734
|
if (w) {
|
|
1687
1735
|
const v = s[w];
|
|
1688
|
-
|
|
1736
|
+
u[w] = v ? await v() : e[w];
|
|
1689
1737
|
}
|
|
1690
1738
|
}
|
|
1691
|
-
if (
|
|
1739
|
+
if (a === "development") {
|
|
1692
1740
|
for (const g of f)
|
|
1693
|
-
await
|
|
1741
|
+
await Ee(O.append(g, { v: D }));
|
|
1694
1742
|
const h = this.materials || {};
|
|
1695
1743
|
for (const g of p) {
|
|
1696
|
-
const
|
|
1744
|
+
const _ = e[d[g]], w = _?.default || _, v = Xe[g];
|
|
1697
1745
|
if (v)
|
|
1698
1746
|
w && v.forEach((S) => {
|
|
1699
|
-
|
|
1747
|
+
o[S] = w[S];
|
|
1700
1748
|
});
|
|
1701
1749
|
else {
|
|
1702
1750
|
const S = h[g] ? (await h[g]()).default : e[g];
|
|
1703
|
-
S && w && (S.components || []).forEach((
|
|
1704
|
-
|
|
1751
|
+
S && w && (S.components || []).forEach((I) => {
|
|
1752
|
+
o[I.name] = gt(I, w);
|
|
1705
1753
|
});
|
|
1706
1754
|
}
|
|
1707
1755
|
}
|
|
@@ -1710,39 +1758,39 @@ class hs extends Ge {
|
|
|
1710
1758
|
initRouter() {
|
|
1711
1759
|
const { router: e, project: t, options: s, adapter: r } = this;
|
|
1712
1760
|
if (!e) return;
|
|
1713
|
-
const
|
|
1714
|
-
routeAppendTo:
|
|
1715
|
-
pageRouteName:
|
|
1716
|
-
routeMeta:
|
|
1717
|
-
} = s, c =
|
|
1718
|
-
path: `${c}${
|
|
1719
|
-
name:
|
|
1720
|
-
component:
|
|
1761
|
+
const o = t?.platform === "uniapp" ? "pages" : "page", {
|
|
1762
|
+
routeAppendTo: i,
|
|
1763
|
+
pageRouteName: a = o,
|
|
1764
|
+
routeMeta: u
|
|
1765
|
+
} = s, c = i ? "" : "/", l = {
|
|
1766
|
+
path: `${c}${a}/:id`,
|
|
1767
|
+
name: H,
|
|
1768
|
+
component: re
|
|
1721
1769
|
}, f = this.getHomepage(), p = {
|
|
1722
1770
|
path: c,
|
|
1723
|
-
name:
|
|
1724
|
-
component: f ?
|
|
1725
|
-
meta:
|
|
1771
|
+
name: q,
|
|
1772
|
+
component: f ? re : r.startupComponent || us,
|
|
1773
|
+
meta: u
|
|
1726
1774
|
};
|
|
1727
|
-
if (e.hasRoute(
|
|
1775
|
+
if (e.hasRoute(H) && e.removeRoute(H), e.hasRoute(q) && e.removeRoute(q), s.enableStaticRoute) {
|
|
1728
1776
|
const d = t?.pages || [];
|
|
1729
|
-
|
|
1730
|
-
name:
|
|
1777
|
+
de({
|
|
1778
|
+
name: a,
|
|
1731
1779
|
prefix: c,
|
|
1732
1780
|
pages: d,
|
|
1733
|
-
component:
|
|
1781
|
+
component: re,
|
|
1734
1782
|
loader: this.getRenderComponent.bind(this),
|
|
1735
1783
|
homepage: f?.id
|
|
1736
1784
|
}).forEach((h) => {
|
|
1737
|
-
|
|
1738
|
-
}), f || (
|
|
1785
|
+
i ? e.addRoute(i, h) : e.addRoute(h);
|
|
1786
|
+
}), f || (i ? e.addRoute(i, p) : e.addRoute(p));
|
|
1739
1787
|
} else
|
|
1740
|
-
|
|
1788
|
+
i ? (e.addRoute(i, l), e.addRoute(i, p)) : (e.addRoute(l), e.addRoute(p));
|
|
1741
1789
|
}
|
|
1742
1790
|
setErrorHandler(e) {
|
|
1743
|
-
e.config.errorHandler =
|
|
1744
|
-
const
|
|
1745
|
-
["getComputedStyle", "ResizeObserver"].some((c) =>
|
|
1791
|
+
e.config.errorHandler = at((t, s, r) => {
|
|
1792
|
+
const o = s?.$options.name, i = typeof t == "string" ? t : t?.message || t?.msg || "未知错误", a = `[ ${o} ] ${i} ${r}`;
|
|
1793
|
+
["getComputedStyle", "ResizeObserver"].some((c) => a.includes(c)) || (console.error(
|
|
1746
1794
|
"[VTJ Error]:",
|
|
1747
1795
|
{
|
|
1748
1796
|
err: t,
|
|
@@ -1750,7 +1798,7 @@ class hs extends Ge {
|
|
|
1750
1798
|
info: r
|
|
1751
1799
|
},
|
|
1752
1800
|
t?.stack
|
|
1753
|
-
), this.errorHandler && this.errorHandler(t), this.adapter.notify && this.adapter.notify(
|
|
1801
|
+
), this.errorHandler && this.errorHandler(t), this.adapter.notify && this.adapter.notify(a, "组件渲染错误", "error"));
|
|
1754
1802
|
}, 300);
|
|
1755
1803
|
}
|
|
1756
1804
|
/**
|
|
@@ -1764,33 +1812,33 @@ class hs extends Ge {
|
|
|
1764
1812
|
* @param app Vue 应用实例
|
|
1765
1813
|
*/
|
|
1766
1814
|
install(e) {
|
|
1767
|
-
const { libraryLocaleMap: t, libraryLocales: s } = this, { libraryOptions: r = {} } = this.options,
|
|
1768
|
-
for (const [
|
|
1769
|
-
if (!i
|
|
1770
|
-
const c = { locale: s[t[
|
|
1771
|
-
e.use(
|
|
1815
|
+
const { libraryLocaleMap: t, libraryLocales: s } = this, { libraryOptions: r = {} } = this.options, o = e.config.globalProperties.installed || {};
|
|
1816
|
+
for (const [i, a] of Object.entries(this.library))
|
|
1817
|
+
if (!o[i] && Et(a)) {
|
|
1818
|
+
const c = { locale: s[t[i]] }, l = r[i] || {}, f = { ...c, ...l };
|
|
1819
|
+
e.use(a, f), o[i] = !0;
|
|
1772
1820
|
}
|
|
1773
|
-
e.provide(
|
|
1821
|
+
e.provide(qe, 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 !== y.Design && this.initGlobals(this.project?.globals || {}, {
|
|
1774
1822
|
app: e,
|
|
1775
1823
|
window,
|
|
1776
1824
|
adapter: this.adapter,
|
|
1777
1825
|
library: this.library,
|
|
1778
1826
|
mode: this.mode
|
|
1779
|
-
}), this.mode !==
|
|
1827
|
+
}), this.mode !== y.Design && this.project?.i18n && this.initI18n(e, this.library, this.project.i18n), this.options.enhance && e.use(this.options.enhance, this), this.mode === y.Design && this.setErrorHandler(e), e.config.globalProperties.installed = o;
|
|
1780
1828
|
}
|
|
1781
1829
|
getFile(e) {
|
|
1782
1830
|
const { blocks: t = [] } = this.project || {};
|
|
1783
1831
|
return this.getPage(e) || t.find((s) => s.id === e) || null;
|
|
1784
1832
|
}
|
|
1785
1833
|
getPage(e) {
|
|
1786
|
-
const { pages: t = [] } = this.project || {}, s = (r,
|
|
1787
|
-
for (const
|
|
1788
|
-
if (
|
|
1789
|
-
return
|
|
1790
|
-
if (
|
|
1791
|
-
const
|
|
1792
|
-
if (
|
|
1793
|
-
return
|
|
1834
|
+
const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
|
|
1835
|
+
for (const i of o) {
|
|
1836
|
+
if (i.id === r)
|
|
1837
|
+
return i;
|
|
1838
|
+
if (i.children && i.children.length) {
|
|
1839
|
+
const a = s(r, i.children);
|
|
1840
|
+
if (a)
|
|
1841
|
+
return a;
|
|
1794
1842
|
}
|
|
1795
1843
|
}
|
|
1796
1844
|
};
|
|
@@ -1804,16 +1852,16 @@ class hs extends Ge {
|
|
|
1804
1852
|
if (r.type === "page" && !r.dir && !r.layout)
|
|
1805
1853
|
return r;
|
|
1806
1854
|
if (r.children && r.children.length) {
|
|
1807
|
-
const
|
|
1808
|
-
if (
|
|
1809
|
-
return
|
|
1855
|
+
const o = t(r.children);
|
|
1856
|
+
if (o)
|
|
1857
|
+
return o;
|
|
1810
1858
|
}
|
|
1811
1859
|
}
|
|
1812
1860
|
};
|
|
1813
1861
|
return t(e) || null;
|
|
1814
1862
|
}
|
|
1815
1863
|
getMenus(e = "page", t = "") {
|
|
1816
|
-
return
|
|
1864
|
+
return G(t, e, this.project?.pages || []);
|
|
1817
1865
|
}
|
|
1818
1866
|
getHomepage() {
|
|
1819
1867
|
const { homepage: e } = this.project || {};
|
|
@@ -1844,23 +1892,23 @@ class hs extends Ge {
|
|
|
1844
1892
|
* @returns 渲染器实例
|
|
1845
1893
|
*/
|
|
1846
1894
|
createDslRenderer(e, t = {}) {
|
|
1847
|
-
const { library: s, components: r, mode:
|
|
1848
|
-
mode:
|
|
1895
|
+
const { library: s, components: r, mode: o, apis: i } = this, a = {
|
|
1896
|
+
mode: o,
|
|
1849
1897
|
Vue: s.Vue,
|
|
1850
1898
|
components: r,
|
|
1851
1899
|
libs: s,
|
|
1852
|
-
apis:
|
|
1900
|
+
apis: i,
|
|
1853
1901
|
window,
|
|
1854
1902
|
...t
|
|
1855
|
-
},
|
|
1903
|
+
}, u = fe({
|
|
1856
1904
|
getDsl: async (c) => await this.getDsl(c) || null,
|
|
1857
1905
|
getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
|
|
1858
|
-
options:
|
|
1906
|
+
options: a
|
|
1859
1907
|
});
|
|
1860
|
-
return
|
|
1861
|
-
...
|
|
1908
|
+
return ue({
|
|
1909
|
+
...a,
|
|
1862
1910
|
dsl: e,
|
|
1863
|
-
loader:
|
|
1911
|
+
loader: u
|
|
1864
1912
|
});
|
|
1865
1913
|
}
|
|
1866
1914
|
/**
|
|
@@ -1876,13 +1924,13 @@ class hs extends Ge {
|
|
|
1876
1924
|
async getRenderComponent(e, t) {
|
|
1877
1925
|
const s = this.getFile(e);
|
|
1878
1926
|
if (!s)
|
|
1879
|
-
return
|
|
1880
|
-
if (t && t(s), this.mode ===
|
|
1881
|
-
const { vtjRawDir:
|
|
1882
|
-
return
|
|
1927
|
+
return M.warn(`Can not find file: ${e}`), null;
|
|
1928
|
+
if (t && t(s), this.mode === y.Raw) {
|
|
1929
|
+
const { vtjRawDir: o = ".vtj/vue" } = this.options, i = `${o}/${e}.vue`, a = this.modules[i] || this.modules[`/src/pages/${e}.vue`];
|
|
1930
|
+
return a ? (await a())?.default : this.nodeEnv === "development" && this.adapter.startupComponent || null;
|
|
1883
1931
|
}
|
|
1884
1932
|
const r = await this.getDsl(s.id);
|
|
1885
|
-
return r ? this.createDslRenderer(r).renderer : (
|
|
1933
|
+
return r ? this.createDslRenderer(r).renderer : (M.warn(`Can not find dsl: ${e}`), null);
|
|
1886
1934
|
}
|
|
1887
1935
|
/**
|
|
1888
1936
|
* 定义基于URL的异步组件
|
|
@@ -1894,7 +1942,7 @@ class hs extends Ge {
|
|
|
1894
1942
|
* @returns Vue异步组件
|
|
1895
1943
|
*/
|
|
1896
1944
|
defineUrlSchemaComponent(e, t) {
|
|
1897
|
-
return
|
|
1945
|
+
return be(async () => {
|
|
1898
1946
|
const s = await this.getDslByUrl(e);
|
|
1899
1947
|
return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
|
|
1900
1948
|
});
|
|
@@ -1907,7 +1955,7 @@ class hs extends Ge {
|
|
|
1907
1955
|
* @returns Vue异步组件
|
|
1908
1956
|
*/
|
|
1909
1957
|
definePluginComponent(e) {
|
|
1910
|
-
return
|
|
1958
|
+
return be(async () => await Ne(e, window));
|
|
1911
1959
|
}
|
|
1912
1960
|
/**
|
|
1913
1961
|
* 设置应用全局
|
|
@@ -1922,10 +1970,10 @@ class hs extends Ge {
|
|
|
1922
1970
|
},
|
|
1923
1971
|
t
|
|
1924
1972
|
);
|
|
1925
|
-
|
|
1973
|
+
fs(e, s);
|
|
1926
1974
|
}
|
|
1927
1975
|
initI18n(e, t, s) {
|
|
1928
|
-
|
|
1976
|
+
_s(e, t, s);
|
|
1929
1977
|
}
|
|
1930
1978
|
initEnv(e = []) {
|
|
1931
1979
|
this.env = e.reduce(
|
|
@@ -1934,15 +1982,15 @@ class hs extends Ge {
|
|
|
1934
1982
|
);
|
|
1935
1983
|
}
|
|
1936
1984
|
}
|
|
1937
|
-
function
|
|
1938
|
-
const e = new
|
|
1985
|
+
function Ns(n) {
|
|
1986
|
+
const e = new ys(n);
|
|
1939
1987
|
return {
|
|
1940
1988
|
provider: e,
|
|
1941
1989
|
onReady: (s) => e.ready(s)
|
|
1942
1990
|
};
|
|
1943
1991
|
}
|
|
1944
|
-
function
|
|
1945
|
-
const e =
|
|
1992
|
+
function Je(n = {}) {
|
|
1993
|
+
const e = Ae(qe, null);
|
|
1946
1994
|
if (!e)
|
|
1947
1995
|
throw new Error("Can not find provider");
|
|
1948
1996
|
if (e.nodeEnv === "development") {
|
|
@@ -1958,21 +2006,21 @@ function Ne(n = {}) {
|
|
|
1958
2006
|
}
|
|
1959
2007
|
return e;
|
|
1960
2008
|
}
|
|
1961
|
-
async function
|
|
1962
|
-
const { name: t, urls: s = [] } = n || {}, r = s.map((
|
|
1963
|
-
if (
|
|
1964
|
-
return await
|
|
2009
|
+
async function Bs(n, e = "") {
|
|
2010
|
+
const { name: t, urls: s = [] } = n || {}, r = s.map((a) => e + a), { css: o, js: i } = _t(r);
|
|
2011
|
+
if (o.length && Me(o), i.length)
|
|
2012
|
+
return await Te(i, t).catch(
|
|
1965
2013
|
() => {
|
|
1966
2014
|
}
|
|
1967
2015
|
);
|
|
1968
2016
|
}
|
|
1969
|
-
const
|
|
2017
|
+
const Ke = {
|
|
1970
2018
|
type: "json",
|
|
1971
2019
|
validSuccess: !0,
|
|
1972
2020
|
originResponse: !1,
|
|
1973
2021
|
failMessage: !0,
|
|
1974
2022
|
validate: (n) => n.data?.code === 0
|
|
1975
|
-
},
|
|
2023
|
+
}, ws = (n, e = "/__vtj__/api/:type.json") => (t, s, r) => n.send({
|
|
1976
2024
|
url: e,
|
|
1977
2025
|
method: "post",
|
|
1978
2026
|
params: { type: t },
|
|
@@ -1981,8 +2029,8 @@ const Ue = {
|
|
|
1981
2029
|
type: t,
|
|
1982
2030
|
data: s
|
|
1983
2031
|
},
|
|
1984
|
-
settings:
|
|
1985
|
-
}),
|
|
2032
|
+
settings: Ke
|
|
2033
|
+
}), Ss = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
|
|
1986
2034
|
url: e,
|
|
1987
2035
|
method: "post",
|
|
1988
2036
|
data: {
|
|
@@ -1990,12 +2038,12 @@ const Ue = {
|
|
|
1990
2038
|
projectId: s
|
|
1991
2039
|
},
|
|
1992
2040
|
settings: {
|
|
1993
|
-
...
|
|
2041
|
+
...Ke,
|
|
1994
2042
|
type: "data"
|
|
1995
2043
|
}
|
|
1996
2044
|
}).then((r) => r && r[0] ? r[0] : null).catch(() => null);
|
|
1997
|
-
function
|
|
1998
|
-
return
|
|
2045
|
+
function Ls(n) {
|
|
2046
|
+
return Ce({
|
|
1999
2047
|
settings: {
|
|
2000
2048
|
type: "json",
|
|
2001
2049
|
validSuccess: !0,
|
|
@@ -2008,9 +2056,9 @@ function xs(n) {
|
|
|
2008
2056
|
}
|
|
2009
2057
|
});
|
|
2010
2058
|
}
|
|
2011
|
-
class
|
|
2012
|
-
constructor(e =
|
|
2013
|
-
this.req = e, this.api =
|
|
2059
|
+
class _e {
|
|
2060
|
+
constructor(e = ae) {
|
|
2061
|
+
this.req = e, this.api = ws(e), this.uploader = Ss(e);
|
|
2014
2062
|
}
|
|
2015
2063
|
api;
|
|
2016
2064
|
pluginCaches = {};
|
|
@@ -2094,38 +2142,38 @@ class he {
|
|
|
2094
2142
|
return await this.api("clearStaticFiles", e).catch(() => "");
|
|
2095
2143
|
}
|
|
2096
2144
|
async getPluginMaterial(e) {
|
|
2097
|
-
const { urls: t = [] } = e, s = t.filter((
|
|
2145
|
+
const { urls: t = [] } = e, s = t.filter((o) => dt(o))[0];
|
|
2098
2146
|
if (!s) return null;
|
|
2099
2147
|
const r = this.pluginCaches[s];
|
|
2100
|
-
return r || (this.pluginCaches[s] =
|
|
2148
|
+
return r || (this.pluginCaches[s] = ae.send({
|
|
2101
2149
|
url: s,
|
|
2102
2150
|
method: "get",
|
|
2103
2151
|
settings: {
|
|
2104
2152
|
validSuccess: !1,
|
|
2105
2153
|
originResponse: !0
|
|
2106
2154
|
}
|
|
2107
|
-
}).then((
|
|
2155
|
+
}).then((o) => o.data).catch(() => null));
|
|
2108
2156
|
}
|
|
2109
2157
|
async genSource(e) {
|
|
2110
2158
|
return console.log("BaseService.genSource", e), "";
|
|
2111
2159
|
}
|
|
2112
2160
|
}
|
|
2113
|
-
const $ = new
|
|
2161
|
+
const $ = new ct({
|
|
2114
2162
|
type: "local",
|
|
2115
2163
|
expired: 0,
|
|
2116
2164
|
prefix: "__VTJ_"
|
|
2117
2165
|
});
|
|
2118
|
-
class
|
|
2166
|
+
class Us extends _e {
|
|
2119
2167
|
init(e) {
|
|
2120
|
-
const t = new
|
|
2168
|
+
const t = new J(e), s = $.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
|
|
2121
2169
|
return $.save(`project_${t.id}`, r), Promise.resolve(r);
|
|
2122
2170
|
}
|
|
2123
2171
|
saveProject(e) {
|
|
2124
|
-
const t = new
|
|
2172
|
+
const t = new J(e);
|
|
2125
2173
|
return $.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
|
2126
2174
|
}
|
|
2127
2175
|
saveMaterials(e, t) {
|
|
2128
|
-
return $.save(`materials_${e.id}`,
|
|
2176
|
+
return $.save(`materials_${e.id}`, he(t)), Promise.resolve(!0);
|
|
2129
2177
|
}
|
|
2130
2178
|
saveFile(e) {
|
|
2131
2179
|
return $.save(`file_${e.id}`, e), Promise.resolve(!0);
|
|
@@ -2143,13 +2191,13 @@ class Ds extends he {
|
|
|
2143
2191
|
removeHistory(e) {
|
|
2144
2192
|
const t = $.get(`history_${e}`);
|
|
2145
2193
|
if (t) {
|
|
2146
|
-
const r = (t.items || []).map((
|
|
2194
|
+
const r = (t.items || []).map((o) => o.id);
|
|
2147
2195
|
this.removeHistoryItem(e, r), $.remove(`history_${e}`);
|
|
2148
2196
|
}
|
|
2149
2197
|
return Promise.resolve(!0);
|
|
2150
2198
|
}
|
|
2151
2199
|
getHistory(e) {
|
|
2152
|
-
const t = $.get(`history_${e}`), s = new
|
|
2200
|
+
const t = $.get(`history_${e}`), s = new Re(t || { id: e });
|
|
2153
2201
|
return Promise.resolve(s.toDsl());
|
|
2154
2202
|
}
|
|
2155
2203
|
getHistoryItem(e, t) {
|
|
@@ -2165,22 +2213,22 @@ class Ds extends he {
|
|
|
2165
2213
|
}), Promise.resolve(!0);
|
|
2166
2214
|
}
|
|
2167
2215
|
}
|
|
2168
|
-
class
|
|
2216
|
+
class $s extends _e {
|
|
2169
2217
|
projects = {};
|
|
2170
2218
|
materials = {};
|
|
2171
2219
|
files = {};
|
|
2172
2220
|
histories = {};
|
|
2173
2221
|
historyItems = {};
|
|
2174
2222
|
init(e) {
|
|
2175
|
-
const t = new
|
|
2223
|
+
const t = new J(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
|
|
2176
2224
|
return this.projects[r.id] = r, Promise.resolve(r);
|
|
2177
2225
|
}
|
|
2178
2226
|
saveProject(e) {
|
|
2179
|
-
const t = new
|
|
2227
|
+
const t = new J(e);
|
|
2180
2228
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
|
2181
2229
|
}
|
|
2182
2230
|
saveMaterials(e, t) {
|
|
2183
|
-
return e.id && (this.materials[e.id] =
|
|
2231
|
+
return e.id && (this.materials[e.id] = he(t)), Promise.resolve(!0);
|
|
2184
2232
|
}
|
|
2185
2233
|
saveFile(e) {
|
|
2186
2234
|
return this.files[e.id] = e, Promise.resolve(!0);
|
|
@@ -2198,13 +2246,13 @@ class ys extends he {
|
|
|
2198
2246
|
removeHistory(e) {
|
|
2199
2247
|
const t = this.histories[e];
|
|
2200
2248
|
if (t) {
|
|
2201
|
-
const r = (t.items || []).map((
|
|
2249
|
+
const r = (t.items || []).map((o) => o.id);
|
|
2202
2250
|
this.removeHistoryItem(e, r), delete this.historyItems[e];
|
|
2203
2251
|
}
|
|
2204
2252
|
return Promise.resolve(!0);
|
|
2205
2253
|
}
|
|
2206
2254
|
getHistory(e) {
|
|
2207
|
-
const t = this.histories[e], s = new
|
|
2255
|
+
const t = this.histories[e], s = new Re(t || { id: e });
|
|
2208
2256
|
return Promise.resolve(s);
|
|
2209
2257
|
}
|
|
2210
2258
|
getHistoryItem(e, t) {
|
|
@@ -2222,11 +2270,11 @@ class ys extends he {
|
|
|
2222
2270
|
}), Promise.resolve(!0);
|
|
2223
2271
|
}
|
|
2224
2272
|
}
|
|
2225
|
-
let
|
|
2226
|
-
function
|
|
2227
|
-
return
|
|
2273
|
+
let U = null;
|
|
2274
|
+
function qs() {
|
|
2275
|
+
return U || (U = new $s(), U);
|
|
2228
2276
|
}
|
|
2229
|
-
class
|
|
2277
|
+
class Js extends _e {
|
|
2230
2278
|
getFileCaches = {};
|
|
2231
2279
|
async getExtension() {
|
|
2232
2280
|
return await this.api("getExtension", {}).catch(() => {
|
|
@@ -2243,7 +2291,7 @@ class Bs extends he {
|
|
|
2243
2291
|
async saveMaterials(e, t) {
|
|
2244
2292
|
return !!await this.api("saveMaterials", {
|
|
2245
2293
|
project: e,
|
|
2246
|
-
materials:
|
|
2294
|
+
materials: he(t)
|
|
2247
2295
|
}).catch(() => !1);
|
|
2248
2296
|
}
|
|
2249
2297
|
async saveFile(e) {
|
|
@@ -2284,82 +2332,83 @@ class Bs extends he {
|
|
|
2284
2332
|
}
|
|
2285
2333
|
}
|
|
2286
2334
|
export {
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2335
|
+
As as ACCESS,
|
|
2336
|
+
xe as ACCESS_KEY,
|
|
2337
|
+
ge as Access,
|
|
2338
|
+
pt as BUILD_IN_TAGS,
|
|
2339
|
+
ut as BUILT_IN_DIRECTIVES,
|
|
2340
|
+
_e as BaseService,
|
|
2341
|
+
je as CONTEXT_HOST,
|
|
2342
|
+
Tt as Context,
|
|
2343
|
+
y as ContextMode,
|
|
2344
|
+
ft as DATA_TYPES,
|
|
2345
|
+
q as HOMEPAGE_ROUTE_NAME,
|
|
2346
|
+
ke as HTML_TAGS,
|
|
2347
|
+
Ms as JSCodeToString,
|
|
2348
|
+
Cs as LIFE_CYCLES_LIST,
|
|
2349
|
+
Js as LocalService,
|
|
2350
|
+
$s as MemoryService,
|
|
2351
|
+
vs as NodeEnv,
|
|
2352
|
+
H as PAGE_ROUTE_NAME,
|
|
2353
|
+
ys as Provider,
|
|
2354
|
+
Ps as REMOTE,
|
|
2355
|
+
Us as StorageService,
|
|
2356
|
+
D as VTJ_RENDERER_VERSION,
|
|
2357
|
+
ks as adoptStylesToInline,
|
|
2358
|
+
me as adoptedStyleSheets,
|
|
2359
|
+
Ds as clearLoaderCache,
|
|
2360
|
+
vt as compileScopedCSS,
|
|
2361
|
+
St as convertCssRpx,
|
|
2362
|
+
xs as createAccess,
|
|
2363
|
+
Ts as createAdapter,
|
|
2364
|
+
Is as createAssetScripts,
|
|
2365
|
+
Fs as createAssetsCss,
|
|
2366
|
+
Ut as createDataSources,
|
|
2367
|
+
fe as createLoader,
|
|
2368
|
+
qs as createMemoryService,
|
|
2369
|
+
G as createMenus,
|
|
2370
|
+
It as createMetaApi,
|
|
2371
|
+
Ot as createMock,
|
|
2372
|
+
Ns as createProvider,
|
|
2373
|
+
ue as createRenderer,
|
|
2374
|
+
At as createSchemaApi,
|
|
2375
|
+
Ft as createSchemaApis,
|
|
2376
|
+
Ls as createServiceRequest,
|
|
2377
|
+
zt as defaultLoader,
|
|
2330
2378
|
L as fillBasePath,
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2379
|
+
N as getMock,
|
|
2380
|
+
Le as getModifiers,
|
|
2381
|
+
Ne as getPlugin,
|
|
2382
|
+
gt as getRawComponent,
|
|
2383
|
+
bt as isBuiltInTag,
|
|
2384
|
+
W as isCSSUrl,
|
|
2385
|
+
Rt as isJSCode,
|
|
2338
2386
|
b as isJSExpression,
|
|
2339
2387
|
E as isJSFunction,
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2388
|
+
dt as isJSON,
|
|
2389
|
+
Q as isJSUrl,
|
|
2390
|
+
jt as isNativeTag,
|
|
2391
|
+
Et as isVuePlugin,
|
|
2392
|
+
$t as loadCss,
|
|
2393
|
+
Me as loadCssUrl,
|
|
2394
|
+
Bs as loadEnhance,
|
|
2395
|
+
Te as loadScriptUrl,
|
|
2396
|
+
Ue as menusFilter,
|
|
2397
|
+
Mt as mockApi,
|
|
2398
|
+
kt as mockApis,
|
|
2399
|
+
De as mockCleanup,
|
|
2400
|
+
A as nodeCache,
|
|
2401
|
+
T as nodeRender,
|
|
2402
|
+
mt as parseDeps,
|
|
2354
2403
|
B as parseExpression,
|
|
2355
2404
|
R as parseFunction,
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2405
|
+
_t as parseUrls,
|
|
2406
|
+
qe as providerKey,
|
|
2407
|
+
ht as removeProdFlag,
|
|
2408
|
+
wt as rpxToPx,
|
|
2409
|
+
Os as setupPageSetting,
|
|
2410
|
+
Oe as toString,
|
|
2411
|
+
Pt as useAccess,
|
|
2412
|
+
Hs as useMask,
|
|
2413
|
+
Je as useProvider
|
|
2365
2414
|
};
|