@vtj/renderer 0.13.8 → 0.13.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +465 -457
- package/package.json +6 -6
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
import { Base as
|
2
|
-
import { isUrl as
|
1
|
+
import { Base as ze, BUILT_IN_COMPONENTS as Ge, ProjectModel as L, HistoryModel as Ee } from "@vtj/core";
|
2
|
+
import { isUrl as se, url as F, dedupArray as Ve, isString as C, isFunction as q, logger as k, storage as X, cookie as Y, toArray as ye, unRSA as _e, delay as J, createRequest as be, jsonp as Re, merge as Qe, pathToRegexp as We, pathToRegexpMatch as Xe, formDataToJson as Ye, Queue as Ze, cloneDeep as we, camelCase as P, isObject as et, upperFirst as tt, pick as st, request as ne, loadScript as Se, Storage as nt, mapToObject as ue } from "@vtj/utils";
|
3
3
|
import * as z from "vue";
|
4
|
-
import { inject as
|
5
|
-
import { useRoute as
|
4
|
+
import { inject as Pe, defineComponent as Ce, h as re, ref as oe, watchEffect as rt, defineAsyncComponent as $e } from "vue";
|
5
|
+
import { useRoute as Ae } from "vue-router";
|
6
6
|
/**!
|
7
7
|
* Copyright (c) 2025, VTJ.PRO All rights reserved.
|
8
8
|
* @name @vtj/renderer
|
9
9
|
* @author CHC chenhuachun1549@dingtalk.com
|
10
|
-
* @version 0.13.
|
10
|
+
* @version 0.13.10
|
11
11
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
12
12
|
*/
|
13
|
-
const O = "0.13.
|
13
|
+
const O = "0.13.10";
|
14
14
|
var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
|
15
|
-
const
|
15
|
+
const je = [
|
16
16
|
"$el",
|
17
17
|
"$emit",
|
18
18
|
"$nextTick",
|
@@ -55,7 +55,7 @@ const $e = [
|
|
55
55
|
Object,
|
56
56
|
Function,
|
57
57
|
Date
|
58
|
-
}, D = "VtjPage",
|
58
|
+
}, D = "VtjPage", N = "VtjHomepage", at = "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
|
), ct = "component,slot".split(","), vs = [
|
61
61
|
"h",
|
@@ -140,7 +140,7 @@ const $e = [
|
|
140
140
|
privateKey: "MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"
|
141
141
|
};
|
142
142
|
function B(n, e) {
|
143
|
-
return n.map((t) =>
|
143
|
+
return n.map((t) => se(t) || t.startsWith("/") ? t : `${e}${t}`);
|
144
144
|
}
|
145
145
|
function G(n) {
|
146
146
|
return /\.css$/.test(n);
|
@@ -165,21 +165,21 @@ function ut(n, e = !1) {
|
|
165
165
|
return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
|
166
166
|
}
|
167
167
|
function ft(n, e, t = !1) {
|
168
|
-
const s = n.filter((h) => !!h.enabled), r = [], o = [],
|
168
|
+
const s = n.filter((h) => !!h.enabled), r = [], o = [], i = [], a = [], l = {}, c = {}, u = [], f = {};
|
169
169
|
return s.forEach(
|
170
|
-
({ urls: h, assetsUrl:
|
170
|
+
({ urls: h, assetsUrl: p, library: d, assetsLibrary: g, localeLibrary: v }) => {
|
171
171
|
h?.forEach((m) => {
|
172
172
|
V(m) && r.push(ut(m, t)), G(m) && o.push(m);
|
173
|
-
}),
|
173
|
+
}), d && (a.push(d), l[d] = B(h || [], e), v && (c[d] = v)), p && i.push(p), g && u.push(g), d && g && (f[g] = d);
|
174
174
|
}
|
175
175
|
), {
|
176
176
|
scripts: B(r, e),
|
177
177
|
css: B(o, e),
|
178
|
-
materials: B(
|
179
|
-
libraryExports:
|
180
|
-
materialExports: Ve(
|
181
|
-
materialMapLibrary:
|
182
|
-
libraryMap:
|
178
|
+
materials: B(i, e),
|
179
|
+
libraryExports: a,
|
180
|
+
materialExports: Ve(u),
|
181
|
+
materialMapLibrary: f,
|
182
|
+
libraryMap: l,
|
183
183
|
libraryLocaleMap: c
|
184
184
|
};
|
185
185
|
}
|
@@ -196,37 +196,37 @@ function dt(n = []) {
|
|
196
196
|
}
|
197
197
|
function ht(n, e) {
|
198
198
|
const t = (c) => {
|
199
|
-
const
|
200
|
-
let
|
201
|
-
for (;
|
202
|
-
if (/\s/.test(c[
|
203
|
-
|
199
|
+
const u = [];
|
200
|
+
let f = 0;
|
201
|
+
for (; f < c.length; ) {
|
202
|
+
if (/\s/.test(c[f])) {
|
203
|
+
f++;
|
204
204
|
continue;
|
205
205
|
}
|
206
|
-
if (c.substring(
|
207
|
-
const m = c.indexOf("*/",
|
206
|
+
if (c.substring(f, f + 2) === "/*") {
|
207
|
+
const m = c.indexOf("*/", f + 2);
|
208
208
|
if (m !== -1) {
|
209
|
-
|
209
|
+
f = m + 2;
|
210
210
|
continue;
|
211
211
|
}
|
212
212
|
}
|
213
|
-
if (c[
|
214
|
-
const m =
|
215
|
-
for (;
|
216
|
-
|
217
|
-
const b = c.substring(m,
|
218
|
-
if (c[
|
219
|
-
|
213
|
+
if (c[f] === "@") {
|
214
|
+
const m = f;
|
215
|
+
for (; f < c.length && c[f] !== "{" && c[f] !== ";"; )
|
216
|
+
f++;
|
217
|
+
const b = c.substring(m, f).trim(), y = b.includes("@keyframes");
|
218
|
+
if (c[f] === ";")
|
219
|
+
u.push({
|
220
220
|
type: "simple-at-rule",
|
221
|
-
content: c.substring(m,
|
222
|
-
}),
|
223
|
-
else if (c[
|
224
|
-
const x =
|
221
|
+
content: c.substring(m, f + 1)
|
222
|
+
}), f++;
|
223
|
+
else if (c[f] === "{") {
|
224
|
+
const x = f + 1;
|
225
225
|
let A = 1;
|
226
|
-
for (
|
227
|
-
c[
|
228
|
-
const Q = c.substring(m,
|
229
|
-
|
226
|
+
for (f++; f < c.length && A > 0; )
|
227
|
+
c[f] === "{" ? A++ : c[f] === "}" && A--, f++;
|
228
|
+
const Q = c.substring(m, f), R = c.substring(x, f - 1);
|
229
|
+
u.push({
|
230
230
|
type: y ? "keyframes" : "at-rule",
|
231
231
|
rule: b,
|
232
232
|
content: Q,
|
@@ -235,119 +235,119 @@ function ht(n, e) {
|
|
235
235
|
}
|
236
236
|
continue;
|
237
237
|
}
|
238
|
-
const h =
|
239
|
-
for (;
|
240
|
-
|
241
|
-
if (
|
242
|
-
const
|
243
|
-
if (!
|
244
|
-
|
238
|
+
const h = f;
|
239
|
+
for (; f < c.length && c[f] !== "{"; )
|
240
|
+
f++;
|
241
|
+
if (f >= c.length) break;
|
242
|
+
const p = c.substring(h, f).trim();
|
243
|
+
if (!p) {
|
244
|
+
f++;
|
245
245
|
continue;
|
246
246
|
}
|
247
|
-
const
|
247
|
+
const d = f + 1;
|
248
248
|
let g = 1;
|
249
|
-
for (
|
250
|
-
c[
|
251
|
-
const v = c.substring(
|
252
|
-
|
249
|
+
for (f++; f < c.length && g > 0; )
|
250
|
+
c[f] === "{" ? g++ : c[f] === "}" && g--, f++;
|
251
|
+
const v = c.substring(d, f - 1);
|
252
|
+
u.push({
|
253
253
|
type: "rule",
|
254
|
-
selector:
|
254
|
+
selector: p,
|
255
255
|
content: v.trim()
|
256
256
|
});
|
257
257
|
}
|
258
|
-
return
|
258
|
+
return u;
|
259
259
|
}, s = (c) => {
|
260
|
-
const
|
261
|
-
return /^(from|to|\d+(\.\d+)?%)$/.test(
|
262
|
-
}, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (
|
263
|
-
const
|
264
|
-
return
|
260
|
+
const u = c.trim();
|
261
|
+
return /^(from|to|\d+(\.\d+)?%)$/.test(u);
|
262
|
+
}, r = (c) => c.replace(/::v-deep\(/g, ":deep(").replace(/::v-deep\s+/g, ":deep(").replace(/\/deep\//g, " ").replace(/>>>/g, " ").replace(/(.*?):deep\(([^)]+)\)/g, (u, f, h) => {
|
263
|
+
const p = f.trim(), d = h.trim();
|
264
|
+
return p ? `${p}[${e}] ${d}` : d;
|
265
265
|
}), o = (c) => {
|
266
|
-
const
|
267
|
-
if (!
|
268
|
-
return
|
269
|
-
const
|
270
|
-
if (
|
271
|
-
const [, h,
|
272
|
-
return
|
266
|
+
const u = c.trim();
|
267
|
+
if (!u || u.includes(`[${e}]`) || /^(:root|:host|html|body)(\s|$|:|\.|\#|\[)/.test(u) || s(u))
|
268
|
+
return u;
|
269
|
+
const f = u.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
|
270
|
+
if (f) {
|
271
|
+
const [, h, p = ""] = f, d = h.trim();
|
272
|
+
return d ? `${d}[${e}]${p}` : u;
|
273
273
|
}
|
274
|
-
return `${
|
275
|
-
},
|
276
|
-
switch (
|
274
|
+
return `${u}[${e}]`;
|
275
|
+
}, i = (c) => r(c).split(",").map((f) => o(f)).filter((f) => f.trim()).join(", "), a = (c) => c.map((u) => {
|
276
|
+
switch (u.type) {
|
277
277
|
case "simple-at-rule":
|
278
|
-
return
|
278
|
+
return u.content;
|
279
279
|
case "keyframes":
|
280
|
-
return
|
280
|
+
return u.content;
|
281
281
|
case "at-rule":
|
282
282
|
try {
|
283
|
-
const h = t(
|
284
|
-
return `${
|
283
|
+
const h = t(u.inner), p = a(h);
|
284
|
+
return `${u.rule} { ${p} }`;
|
285
285
|
} catch {
|
286
|
-
return
|
286
|
+
return u.content;
|
287
287
|
}
|
288
288
|
case "rule":
|
289
|
-
if (!
|
289
|
+
if (!u.selector || !u.content)
|
290
290
|
return "";
|
291
|
-
const
|
292
|
-
return
|
291
|
+
const f = i(u.selector);
|
292
|
+
return f.trim() ? `${f} { ${u.content} }` : "";
|
293
293
|
default:
|
294
294
|
return "";
|
295
295
|
}
|
296
|
-
}).filter((
|
296
|
+
}).filter((u) => u.trim()).join(" "), l = (c) => c.replace(/\s*{\s*/g, " { ").replace(/\s*}\s*/g, " } ").replace(/\s*;\s*/g, "; ").replace(/\s*,\s*/g, ", ").replace(/\s+/g, " ").replace(/^\s+|\s+$/g, "").replace(/\s*}\s*}/g, " } }").trim();
|
297
297
|
try {
|
298
298
|
const c = n.replace(/\/\*(?!\s*!)[\s\S]*?\*\//g, "").replace(/^\s+|\s+$/gm, "").replace(/\n\s*\n/g, `
|
299
|
-
`),
|
300
|
-
return f
|
299
|
+
`), u = t(c), f = a(u);
|
300
|
+
return l(f);
|
301
301
|
} catch (c) {
|
302
302
|
return console.error("CSS scoping failed:", c), console.error("Input CSS:", n), n.replace(/\/\*[\s\S]*?\*\//g, "").replace(
|
303
303
|
/(@keyframes\s+[^{]+\s*{[^{}]*(?:{[^}]*}[^{}]*)*})/g,
|
304
|
-
(
|
305
|
-
).replace(/([^{}@]+)(?=\s*{)/g, (
|
306
|
-
const
|
307
|
-
return !
|
304
|
+
(u) => u
|
305
|
+
).replace(/([^{}@]+)(?=\s*{)/g, (u) => {
|
306
|
+
const f = u.trim();
|
307
|
+
return !f || f.startsWith("@") || f.includes(`[${e}]`) || s(f) ? u : `${f}[${e}]`;
|
308
308
|
});
|
309
309
|
}
|
310
310
|
}
|
311
|
-
function
|
311
|
+
function Ie(n) {
|
312
312
|
return C(n) ? n : JSON.stringify(n);
|
313
313
|
}
|
314
|
-
function
|
315
|
-
const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e,
|
314
|
+
function fe(n, e, t, s = !1) {
|
315
|
+
const r = n.CSSStyleSheet, o = s ? `data-v-${e}` : e, i = s ? ht(t, o) : t;
|
316
316
|
if (r.prototype.replaceSync) {
|
317
|
-
const
|
318
|
-
|
319
|
-
const
|
320
|
-
(
|
317
|
+
const a = new r();
|
318
|
+
a.id = e, a.replaceSync(i);
|
319
|
+
const l = n.document, c = l.adoptedStyleSheets, u = Array.from(c).filter(
|
320
|
+
(f) => f.id !== e
|
321
321
|
);
|
322
|
-
|
322
|
+
l.adoptedStyleSheets = [...u, a];
|
323
323
|
} else {
|
324
|
-
const
|
325
|
-
let
|
326
|
-
|
324
|
+
const a = n.document;
|
325
|
+
let l = a.getElementById(e);
|
326
|
+
l ? l.innerHTML = i : (l = a.createElement("style"), l.id = e, l.innerHTML = i, a.head.appendChild(l));
|
327
327
|
}
|
328
328
|
}
|
329
329
|
async function mt(n, e) {
|
330
330
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
331
|
-
t &&
|
331
|
+
t && fe(window, n, t);
|
332
332
|
}
|
333
|
-
function
|
333
|
+
function Fe(n, e = window) {
|
334
334
|
const t = e.document, s = e.document.head;
|
335
335
|
for (const r of n)
|
336
336
|
if (!t.getElementById(r)) {
|
337
|
-
const
|
338
|
-
|
337
|
+
const i = t.createElement("link");
|
338
|
+
i.rel = "stylesheet", i.id = r, i.href = r, s.appendChild(i);
|
339
339
|
}
|
340
340
|
}
|
341
|
-
async function
|
341
|
+
async function ke(n, e, t = window) {
|
342
342
|
const s = t.document, r = t.document.head;
|
343
343
|
let o = t[e];
|
344
|
-
return o ? o.default || o : new Promise((
|
345
|
-
for (const
|
344
|
+
return o ? o.default || o : new Promise((i, a) => {
|
345
|
+
for (const l of n) {
|
346
346
|
const c = s.createElement("script");
|
347
|
-
c.src =
|
348
|
-
o = t[e], o ?
|
349
|
-
}, c.onerror = (
|
350
|
-
|
347
|
+
c.src = l, c.onload = () => {
|
348
|
+
o = t[e], o ? i(o.default || o) : a(null);
|
349
|
+
}, c.onerror = (u) => {
|
350
|
+
a(u);
|
351
351
|
}, r.appendChild(c);
|
352
352
|
}
|
353
353
|
});
|
@@ -377,13 +377,13 @@ function H(n, e, t = !1, s = !1, r = !1) {
|
|
377
377
|
try {
|
378
378
|
const o = ['"use strict";', "var __self = arguments[0];"];
|
379
379
|
o.push("return ");
|
380
|
-
let
|
381
|
-
r || (
|
382
|
-
`) +
|
383
|
-
const
|
384
|
-
${
|
385
|
-
` : `with(${t ? "{}" : "$scope || {}"}) { ${
|
386
|
-
return new Function("$scope",
|
380
|
+
let i = (n.value || "").trim();
|
381
|
+
r || (i = i.replace(/this(\W|$)/g, (l, c) => `__self${c}`)), i = o.join(`
|
382
|
+
`) + i;
|
383
|
+
const a = r ? `
|
384
|
+
${i}
|
385
|
+
` : `with(${t ? "{}" : "$scope || {}"}) { ${i} }`;
|
386
|
+
return new Function("$scope", a)(e);
|
387
387
|
} catch (o) {
|
388
388
|
if (k.error("parseExpression.error", o, n, e?.__self ?? e), s)
|
389
389
|
throw o;
|
@@ -425,8 +425,8 @@ const wt = {
|
|
425
425
|
noPermissionMessage: "无权限访问该页面",
|
426
426
|
appName: "",
|
427
427
|
statusKey: "code"
|
428
|
-
},
|
429
|
-
class
|
428
|
+
}, Me = Symbol("access");
|
429
|
+
class pe {
|
430
430
|
options;
|
431
431
|
data = null;
|
432
432
|
mode = _.Raw;
|
@@ -469,14 +469,14 @@ class fe {
|
|
469
469
|
}
|
470
470
|
can(e) {
|
471
471
|
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
472
|
-
return typeof e == "function" ? e(s) :
|
472
|
+
return typeof e == "function" ? e(s) : ye(e).every((o) => s[o] || s[t + "." + o]);
|
473
473
|
}
|
474
474
|
some(e) {
|
475
475
|
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
476
|
-
return
|
476
|
+
return ye(e).some((o) => s[o] || s[t + "." + o]);
|
477
477
|
}
|
478
478
|
install(e) {
|
479
|
-
e.config.globalProperties.$access = this, e.provide(
|
479
|
+
e.config.globalProperties.$access = this, e.provide(Me, this);
|
480
480
|
}
|
481
481
|
isAuthPath(e) {
|
482
482
|
const { auth: t, isAuth: s } = this.options;
|
@@ -497,7 +497,7 @@ class fe {
|
|
497
497
|
setData(e) {
|
498
498
|
const { privateKey: t } = this.options;
|
499
499
|
if (Array.isArray(e) && t) {
|
500
|
-
const s = e.map((r) =>
|
500
|
+
const s = e.map((r) => _e(r, t));
|
501
501
|
try {
|
502
502
|
this.data = JSON.parse(s.join(""));
|
503
503
|
} catch (r) {
|
@@ -507,7 +507,7 @@ class fe {
|
|
507
507
|
}
|
508
508
|
if (typeof e == "string")
|
509
509
|
try {
|
510
|
-
const s = t ?
|
510
|
+
const s = t ? _e(e, t) : e;
|
511
511
|
s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
|
512
512
|
} catch (s) {
|
513
513
|
console.warn(s);
|
@@ -580,7 +580,7 @@ class fe {
|
|
580
580
|
}
|
581
581
|
}
|
582
582
|
function St() {
|
583
|
-
return
|
583
|
+
return Pe(Me, null);
|
584
584
|
}
|
585
585
|
function js(n = {}) {
|
586
586
|
const {
|
@@ -589,42 +589,42 @@ function js(n = {}) {
|
|
589
589
|
settings: s = {},
|
590
590
|
Startup: r,
|
591
591
|
access: o,
|
592
|
-
useTitle:
|
593
|
-
alert:
|
592
|
+
useTitle: i,
|
593
|
+
alert: a
|
594
594
|
} = n;
|
595
|
-
let
|
595
|
+
let l = null;
|
596
596
|
return {
|
597
|
-
request:
|
597
|
+
request: be({
|
598
598
|
settings: {
|
599
599
|
type: "form",
|
600
600
|
validSuccess: !0,
|
601
601
|
originResponse: !1,
|
602
602
|
loading: !0,
|
603
|
-
validate: (
|
603
|
+
validate: (u) => u.data?.code === 0 || !!u.data?.success,
|
604
604
|
failMessage: !0,
|
605
|
-
showError: (
|
606
|
-
e && e(
|
605
|
+
showError: (u) => {
|
606
|
+
e && e(u || "未知错误");
|
607
607
|
},
|
608
608
|
showLoading: () => {
|
609
|
-
|
609
|
+
l && l.close(), t && (l = t());
|
610
610
|
},
|
611
611
|
hideLoading: () => {
|
612
|
-
|
612
|
+
l && (l.close(), l = null);
|
613
613
|
},
|
614
614
|
...s
|
615
615
|
}
|
616
616
|
}),
|
617
|
-
jsonp:
|
617
|
+
jsonp: Re,
|
618
618
|
notify: e,
|
619
619
|
loading: t,
|
620
|
-
useTitle:
|
621
|
-
alert:
|
620
|
+
useTitle: i,
|
621
|
+
alert: a,
|
622
622
|
startupComponent: r,
|
623
|
-
access: o ? new
|
623
|
+
access: o ? new pe({ alert: a, ...o }) : void 0
|
624
624
|
};
|
625
625
|
}
|
626
626
|
function Es(n = {}) {
|
627
|
-
return new
|
627
|
+
return new pe(n);
|
628
628
|
}
|
629
629
|
function $t(n, e) {
|
630
630
|
const { jsonp: t, request: s } = e;
|
@@ -642,19 +642,19 @@ function $t(n, e) {
|
|
642
642
|
headers: r
|
643
643
|
}
|
644
644
|
};
|
645
|
-
return (
|
645
|
+
return (i, a) => (delete o.data, s.send(Qe(o, a || {}, { data: i })));
|
646
646
|
}
|
647
647
|
}
|
648
648
|
function jt(n, e) {
|
649
649
|
const { metaQuery: t } = e;
|
650
650
|
if (!t) return;
|
651
651
|
const { code: s, queryCode: r } = n;
|
652
|
-
return (o,
|
652
|
+
return (o, i) => {
|
653
653
|
if (!t) {
|
654
654
|
console.warn("adapter.metaQuery is not defined!");
|
655
655
|
return;
|
656
656
|
}
|
657
|
-
return t(s, r, o,
|
657
|
+
return t(s, r, o, i);
|
658
658
|
};
|
659
659
|
}
|
660
660
|
function Et(n = [], e = [], t) {
|
@@ -667,7 +667,7 @@ function Et(n = [], e = [], t) {
|
|
667
667
|
}
|
668
668
|
async function bt(n = [], e = window) {
|
669
669
|
const t = T(e);
|
670
|
-
t && (
|
670
|
+
t && (Oe(e), n.forEach((s) => Pt(t, s)));
|
671
671
|
}
|
672
672
|
function Rt(n, e = window) {
|
673
673
|
const t = S(n.mockTemplate) && n.mockTemplate.value ? E(n.mockTemplate, {}, !0) : void 0, s = T(e);
|
@@ -676,8 +676,8 @@ function Rt(n, e = window) {
|
|
676
676
|
if (t)
|
677
677
|
try {
|
678
678
|
o = await t.apply(t, r);
|
679
|
-
} catch (
|
680
|
-
k.warn("模拟数据模版异常",
|
679
|
+
} catch (i) {
|
680
|
+
k.warn("模拟数据模版异常", i);
|
681
681
|
}
|
682
682
|
return s?.mock(o);
|
683
683
|
};
|
@@ -685,15 +685,23 @@ function Rt(n, e = window) {
|
|
685
685
|
function Pt(n, e) {
|
686
686
|
if (!e.mock) return;
|
687
687
|
const { url: t, mockTemplate: s } = e;
|
688
|
-
if (t && s)
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
688
|
+
if (t && s)
|
689
|
+
try {
|
690
|
+
const r = se(t) ? new URL(t).pathname : t, o = We(`(.*)${r}(.*)`), i = Xe(r, { decode: decodeURIComponent }), a = H(s, {}, !0);
|
691
|
+
n.mock(o, (l) => {
|
692
|
+
const c = F.parse(l.url) || {}, u = l.body instanceof FormData ? Ye(l.body) : l.body, f = se(l.url) ? new URL(l.url).pathname : l.url.split("?")[0], h = i(f)?.params;
|
693
|
+
Object.assign(l, { data: u, params: h, query: c });
|
694
|
+
try {
|
695
|
+
return n.mock(a(l));
|
696
|
+
} catch (p) {
|
697
|
+
return console.warn("[mockApi]", o, l, p), null;
|
698
|
+
}
|
699
|
+
});
|
700
|
+
} catch (r) {
|
701
|
+
console.warn("mockApi", r);
|
702
|
+
}
|
695
703
|
}
|
696
|
-
function
|
704
|
+
function Oe(n = window) {
|
697
705
|
const e = T(n);
|
698
706
|
e && (e._mocked = {});
|
699
707
|
}
|
@@ -740,12 +748,12 @@ class Ct {
|
|
740
748
|
});
|
741
749
|
}
|
742
750
|
__proxy() {
|
743
|
-
this.__instance &&
|
751
|
+
this.__instance && je.forEach((e) => {
|
744
752
|
this[e] = this.__instance?.[e];
|
745
753
|
});
|
746
754
|
}
|
747
755
|
__cleanup() {
|
748
|
-
|
756
|
+
je.forEach((e) => {
|
749
757
|
this[e] = null;
|
750
758
|
}), this.__reset();
|
751
759
|
}
|
@@ -796,64 +804,64 @@ class Ct {
|
|
796
804
|
return s.context.__proto__ = this.context, s.__proto__ = this, s;
|
797
805
|
}
|
798
806
|
}
|
799
|
-
function
|
807
|
+
function ie(n) {
|
800
808
|
const {
|
801
809
|
Vue: e = z,
|
802
810
|
mode: t = _.Runtime,
|
803
811
|
components: s = {},
|
804
812
|
libs: r = {},
|
805
813
|
apis: o = {},
|
806
|
-
loader:
|
807
|
-
} = n,
|
814
|
+
loader: i
|
815
|
+
} = n, a = e.computed(() => n.dsl), l = {
|
808
816
|
$components: s,
|
809
817
|
$libs: r,
|
810
818
|
$apis: o
|
811
819
|
}, c = new Ct({
|
812
820
|
mode: t,
|
813
|
-
dsl:
|
814
|
-
attrs:
|
815
|
-
}),
|
816
|
-
name:
|
817
|
-
__scopeId:
|
821
|
+
dsl: a.value,
|
822
|
+
attrs: l
|
823
|
+
}), u = e.defineComponent({
|
824
|
+
name: a.value.name,
|
825
|
+
__scopeId: a.value.id ? `data-v-${a.value.id}` : void 0,
|
818
826
|
props: {
|
819
|
-
...It(
|
827
|
+
...It(a.value.props ?? [], c)
|
820
828
|
},
|
821
|
-
setup(
|
822
|
-
c.$props =
|
829
|
+
setup(f) {
|
830
|
+
c.$props = f, c.props = f, a.value.id && fe(
|
823
831
|
n.window || window,
|
824
|
-
|
825
|
-
|
832
|
+
a.value.id,
|
833
|
+
a.value.css || "",
|
826
834
|
!0
|
827
|
-
), c.state = Ft(e,
|
828
|
-
const h = kt(e,
|
829
|
-
for (const [m, b] of Object.entries(
|
830
|
-
|
835
|
+
), c.state = Ft(e, a.value.state ?? {}, c);
|
836
|
+
const h = kt(e, a.value.computed ?? {}, c), p = Mt(a.value.methods ?? {}, c), d = Ot(e, a.value.inject, c);
|
837
|
+
for (const [m, b] of Object.entries(d || {}))
|
838
|
+
d[m] = e.inject(m, b);
|
831
839
|
const g = Dt(
|
832
|
-
|
840
|
+
a.value.dataSources || {},
|
833
841
|
c
|
834
842
|
), v = {
|
835
|
-
...p,
|
836
|
-
...h,
|
837
843
|
...d,
|
844
|
+
...h,
|
845
|
+
...p,
|
838
846
|
...g
|
839
847
|
};
|
840
|
-
return c.setup(v, e), Tt(e,
|
848
|
+
return c.setup(v, e), Tt(e, a.value.watch ?? [], c), {
|
841
849
|
vtj: c
|
842
850
|
};
|
843
851
|
},
|
844
|
-
emits: At(
|
852
|
+
emits: At(a.value.emits),
|
845
853
|
expose: ["vtj"],
|
846
854
|
render() {
|
847
|
-
if (!
|
848
|
-
const
|
849
|
-
return
|
850
|
-
(h) => M(h, c, e,
|
855
|
+
if (!a.value.nodes) return null;
|
856
|
+
const f = a.value.nodes || [];
|
857
|
+
return f.length === 1 ? M(f[0], c, e, i, f) : f.map(
|
858
|
+
(h) => M(h, c, e, i, f)
|
851
859
|
);
|
852
860
|
},
|
853
|
-
...Ht(
|
861
|
+
...Ht(a.value.lifeCycles ?? {}, c)
|
854
862
|
});
|
855
863
|
return {
|
856
|
-
renderer: e.markRaw(
|
864
|
+
renderer: e.markRaw(u),
|
857
865
|
context: c
|
858
866
|
};
|
859
867
|
}
|
@@ -904,10 +912,10 @@ function Mt(n, e) {
|
|
904
912
|
function Ot(n, e = [], t) {
|
905
913
|
return e.reduce(
|
906
914
|
(s, r) => {
|
907
|
-
const { name: o, from:
|
915
|
+
const { name: o, from: i } = r || {};
|
908
916
|
r.default;
|
909
|
-
const
|
910
|
-
return s[o] = n.inject(
|
917
|
+
const a = j(i) ? t.__parseExpression(i) || o : i ?? o, l = j(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
|
918
|
+
return s[o] = n.inject(a, l), s;
|
911
919
|
},
|
912
920
|
{}
|
913
921
|
);
|
@@ -919,10 +927,10 @@ function Dt(n, e) {
|
|
919
927
|
if (r.type === "mock")
|
920
928
|
t[s] = Rt(r);
|
921
929
|
else if (r.ref) {
|
922
|
-
const o = e.$apis[r.ref],
|
923
|
-
t[s] = async (...
|
924
|
-
const
|
925
|
-
return
|
930
|
+
const o = e.$apis[r.ref], i = S(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
|
931
|
+
t[s] = async (...a) => {
|
932
|
+
const l = await o.apply(e, a);
|
933
|
+
return i ? i(l) : l;
|
926
934
|
};
|
927
935
|
}
|
928
936
|
return t;
|
@@ -953,106 +961,106 @@ function Ht(n, e) {
|
|
953
961
|
{}
|
954
962
|
);
|
955
963
|
}
|
956
|
-
const
|
964
|
+
const De = new Ze();
|
957
965
|
let Z = [], I = {};
|
958
966
|
const xt = (n) => n;
|
959
|
-
async function
|
960
|
-
const { urls: t = [], library: s } = n, r = t.filter((
|
967
|
+
async function Te(n, e = window) {
|
968
|
+
const { urls: t = [], library: s } = n, r = t.filter((a) => V(a));
|
961
969
|
if (r.length === 0 || !s) return null;
|
962
|
-
const o = t.filter((
|
963
|
-
return o.length &&
|
964
|
-
(
|
970
|
+
const o = t.filter((a) => G(a));
|
971
|
+
return o.length && Fe(o, e), await ke(r, s, e).catch(
|
972
|
+
(a) => (console.warn("loadScriptUrl error", r, s, a), null)
|
965
973
|
);
|
966
974
|
}
|
967
|
-
function
|
975
|
+
function ae(n) {
|
968
976
|
const { getDsl: e, getDslByUrl: t, options: s } = n;
|
969
977
|
return s.window && (Z.forEach((r) => {
|
970
978
|
delete s.window[r];
|
971
|
-
}), Z = []), (r, o,
|
979
|
+
}), Z = []), (r, o, i = z) => {
|
972
980
|
if (!o || typeof o == "string") return r;
|
973
981
|
if (o.type === "Schema" && o.id)
|
974
|
-
return
|
975
|
-
const
|
982
|
+
return i.defineAsyncComponent(async () => {
|
983
|
+
const a = I[o.id] || await De.add(
|
976
984
|
o.id,
|
977
985
|
() => e(o.id)
|
978
986
|
);
|
979
|
-
return
|
987
|
+
return a && (a.name = r, I[o.id] = a), a ? ie({
|
980
988
|
...s,
|
981
|
-
Vue:
|
982
|
-
dsl:
|
989
|
+
Vue: i,
|
990
|
+
dsl: we(a),
|
983
991
|
mode: _.Runtime,
|
984
|
-
loader:
|
992
|
+
loader: ae(n)
|
985
993
|
}).renderer : null;
|
986
994
|
});
|
987
995
|
if (o.type === "UrlSchema" && o.url)
|
988
|
-
return
|
989
|
-
const
|
990
|
-
return
|
996
|
+
return i.defineAsyncComponent(async () => {
|
997
|
+
const a = I[o.url] || await t(o.url);
|
998
|
+
return a && (a.name = r, I[o.url] = a), a ? ie({
|
991
999
|
...s,
|
992
|
-
Vue:
|
993
|
-
dsl:
|
1000
|
+
Vue: i,
|
1001
|
+
dsl: we(a),
|
994
1002
|
mode: _.Runtime,
|
995
|
-
loader:
|
1003
|
+
loader: ae(n)
|
996
1004
|
}).renderer : null;
|
997
1005
|
});
|
998
1006
|
if (o.type === "Plugin") {
|
999
|
-
let
|
1000
|
-
return
|
1007
|
+
let a = o.library ? I[o.library] : null;
|
1008
|
+
return a || (o.library && Z.push(o.library), a = I[o.library || Symbol()] = i.defineAsyncComponent(
|
1001
1009
|
async () => {
|
1002
|
-
const
|
1003
|
-
return
|
1010
|
+
const l = await Te(o, s.window);
|
1011
|
+
return l || (console.warn("getPlugin result is null", o), null);
|
1004
1012
|
}
|
1005
|
-
),
|
1013
|
+
), a);
|
1006
1014
|
}
|
1007
1015
|
return r;
|
1008
1016
|
};
|
1009
1017
|
}
|
1010
1018
|
function bs() {
|
1011
|
-
I = {},
|
1019
|
+
I = {}, De.clearAllCache();
|
1012
1020
|
}
|
1013
1021
|
function M(n, e, t = z, s = xt, r = [], o = !1) {
|
1014
1022
|
if (!n || !n.name || n.invisible) return null;
|
1015
|
-
const
|
1016
|
-
if (!o && (
|
1023
|
+
const i = t.getCurrentInstance()?.appContext, { id: a = null, directives: l = [] } = n, { vIf: c, vElseIf: u, vElse: f, vFor: h, vShow: p, vModels: d, vBind: g, vHtml: v, others: m } = He(l);
|
1024
|
+
if (!o && (u || f))
|
1017
1025
|
return null;
|
1018
|
-
if (c && !
|
1026
|
+
if (c && !Ut(c, e))
|
1019
1027
|
return Jt(n, e, t, s, r);
|
1020
1028
|
const b = (y, x = 0) => {
|
1021
1029
|
const A = y.$components, Q = (() => {
|
1022
1030
|
if (n.name === "component")
|
1023
|
-
return
|
1031
|
+
return Nt(y, n.props?.is);
|
1024
1032
|
if (n.name === "slot") return n.name;
|
1025
1033
|
const $ = s(n.name, n.from, t);
|
1026
1034
|
if (C($))
|
1027
|
-
return vt($) || yt($) ? $ : A[$] ??
|
1035
|
+
return vt($) || yt($) ? $ : A[$] ?? i?.app?.component($) ?? $;
|
1028
1036
|
if (et($) && n.id) {
|
1029
|
-
const
|
1030
|
-
return
|
1037
|
+
const ge = `Loader${n.id}_${x}`, ve = A[ge];
|
1038
|
+
return ve || (A[ge] = $);
|
1031
1039
|
}
|
1032
1040
|
return $;
|
1033
|
-
})(), R = Lt(
|
1041
|
+
})(), R = Lt(a, n.props ?? {}, y), qe = qt(t, n.events ?? {}, y);
|
1034
1042
|
if (n.name === "slot")
|
1035
1043
|
return Kt(t, n, R, y, s);
|
1036
|
-
g && Object.assign(R, y.__parseExpression(g.value)),
|
1044
|
+
g && Object.assign(R, y.__parseExpression(g.value)), p && (R.style = Object.assign(
|
1037
1045
|
R.style ?? {},
|
1038
|
-
Gt(
|
1039
|
-
)), v && Object.assign(R, Vt(v, y)),
|
1046
|
+
Gt(p, y)
|
1047
|
+
)), v && Object.assign(R, Vt(v, y)), d.forEach(($) => {
|
1040
1048
|
Object.assign(R, Qt(t, $, y));
|
1041
1049
|
});
|
1042
|
-
const
|
1050
|
+
const Je = Wt(
|
1043
1051
|
t,
|
1044
1052
|
n.children ?? [],
|
1045
1053
|
y,
|
1046
1054
|
s,
|
1047
1055
|
n
|
1048
|
-
),
|
1056
|
+
), he = y?.__id ? `data-v-${y.__id}` : void 0, Ke = he ? { [he]: "" } : {};
|
1049
1057
|
let W = t.createVNode(
|
1050
1058
|
Q,
|
1051
|
-
{ key: `${
|
1052
|
-
|
1059
|
+
{ key: `${a}_${x}`, ...Ke, ...R, ...qe },
|
1060
|
+
Je
|
1053
1061
|
);
|
1054
|
-
const
|
1055
|
-
return
|
1062
|
+
const me = i ? Bt(i, m, y) : [];
|
1063
|
+
return me.length && (W = t.withDirectives(W, me)), W;
|
1056
1064
|
};
|
1057
1065
|
return h ? Zt(h, b, e) : b(e);
|
1058
1066
|
}
|
@@ -1061,17 +1069,17 @@ function Bt(n, e, t) {
|
|
1061
1069
|
return e.map((r) => {
|
1062
1070
|
const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
|
1063
1071
|
if (!o) return null;
|
1064
|
-
const
|
1065
|
-
return r.value &&
|
1072
|
+
const i = [o];
|
1073
|
+
return r.value && i.push(t.__parseExpression(r.value)), r.arg && i.push(r.arg), r.modifiers && i.push(r.modifiers), i;
|
1066
1074
|
}).filter((r) => !!r);
|
1067
1075
|
}
|
1068
|
-
function
|
1069
|
-
const e = n.find((
|
1070
|
-
(
|
1071
|
-
), s = n.find((
|
1072
|
-
(
|
1076
|
+
function He(n = []) {
|
1077
|
+
const e = n.find((u) => P(u.name) === "vIf"), t = n.find(
|
1078
|
+
(u) => P(u.name) === "vElseIf"
|
1079
|
+
), s = n.find((u) => P(u.name) === "vElse"), r = n.find((u) => P(u.name) === "vFor"), o = n.find((u) => P(u.name) === "vShow"), i = n.find((u) => P(u.name) === "vBind"), a = n.find((u) => P(u.name) === "vHtml"), l = n.filter(
|
1080
|
+
(u) => P(u.name) === "vModel"
|
1073
1081
|
), c = n.filter(
|
1074
|
-
(
|
1082
|
+
(u) => !ot.includes(P(u.name))
|
1075
1083
|
);
|
1076
1084
|
return {
|
1077
1085
|
vIf: e,
|
@@ -1079,27 +1087,27 @@ function Te(n = []) {
|
|
1079
1087
|
vElse: s,
|
1080
1088
|
vFor: r,
|
1081
1089
|
vShow: o,
|
1082
|
-
vModels:
|
1083
|
-
vBind:
|
1090
|
+
vModels: l,
|
1091
|
+
vBind: i,
|
1084
1092
|
others: c,
|
1085
|
-
vHtml:
|
1093
|
+
vHtml: a
|
1086
1094
|
};
|
1087
1095
|
}
|
1088
|
-
function
|
1096
|
+
function Ut(n, e) {
|
1089
1097
|
return !!e.__parseExpression(n.value);
|
1090
1098
|
}
|
1091
|
-
function
|
1099
|
+
function Nt(n, e) {
|
1092
1100
|
return e ? j(e) ? n.__parseExpression(e) : e : "div";
|
1093
1101
|
}
|
1094
1102
|
function Lt(n, e, t) {
|
1095
|
-
const s =
|
1103
|
+
const s = ce(e, t);
|
1096
1104
|
return s.ref = t.__ref(n, s.ref), s;
|
1097
1105
|
}
|
1098
|
-
function
|
1099
|
-
return j(n) ? e.__parseExpression(n) : S(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) =>
|
1106
|
+
function ce(n, e) {
|
1107
|
+
return j(n) ? e.__parseExpression(n) : S(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) => ce(t, e)) : typeof n == "object" ? Object.keys(n || {}).reduce(
|
1100
1108
|
(t, s) => {
|
1101
1109
|
let r = n[s];
|
1102
|
-
return t[s] =
|
1110
|
+
return t[s] = ce(r, e), t;
|
1103
1111
|
},
|
1104
1112
|
{}
|
1105
1113
|
) : n;
|
@@ -1111,37 +1119,37 @@ function qt(n, e, t) {
|
|
1111
1119
|
passive: "OnceCapture"
|
1112
1120
|
};
|
1113
1121
|
return Object.keys(e || {}).reduce(
|
1114
|
-
(o,
|
1115
|
-
const
|
1116
|
-
return
|
1122
|
+
(o, i) => {
|
1123
|
+
const a = e[i], l = xe(a.modifiers), c = l.find((h) => s.includes(h)), u = "on" + tt(i) + (c && r[c] || ""), f = t.__parseFunction(a.handler);
|
1124
|
+
return f && (o[u] = n.withModifiers(f, l)), o;
|
1117
1125
|
},
|
1118
1126
|
{}
|
1119
1127
|
);
|
1120
1128
|
}
|
1121
1129
|
function Jt(n, e, t, s, r = []) {
|
1122
|
-
let o = r.findIndex((
|
1123
|
-
for (let
|
1124
|
-
const { directives:
|
1125
|
-
if (
|
1126
|
-
if (e.__parseExpression(
|
1127
|
-
return M(r[
|
1130
|
+
let o = r.findIndex((i) => i.id === n.id);
|
1131
|
+
for (let i = ++o; i < r.length; i++) {
|
1132
|
+
const { directives: a = [] } = r[i], { vElseIf: l, vElse: c } = He(a);
|
1133
|
+
if (l) {
|
1134
|
+
if (e.__parseExpression(l.value))
|
1135
|
+
return M(r[i], e, t, s, r, !0);
|
1128
1136
|
continue;
|
1129
1137
|
}
|
1130
1138
|
if (c)
|
1131
|
-
return M(r[
|
1139
|
+
return M(r[i], e, t, s, r, !0);
|
1132
1140
|
}
|
1133
1141
|
return null;
|
1134
1142
|
}
|
1135
|
-
function
|
1143
|
+
function xe(n = {}, e = !1) {
|
1136
1144
|
const t = Object.keys(n);
|
1137
1145
|
return e ? t.map((s) => "." + s) : t;
|
1138
1146
|
}
|
1139
1147
|
function Kt(n, e, t, s, r) {
|
1140
|
-
const { children: o } = e,
|
1141
|
-
return
|
1142
|
-
|
1148
|
+
const { children: o } = e, i = zt(e, s), a = s.$slots?.[i.name];
|
1149
|
+
return a ? a(t) : o ? C(o) ? n.createTextVNode(o) : j(o) ? n.createTextVNode(
|
1150
|
+
Ie(s.__parseExpression(o))
|
1143
1151
|
) : Array.isArray(o) ? o.map(
|
1144
|
-
(
|
1152
|
+
(l) => M(l, s, n, r, o)
|
1145
1153
|
) : null : null;
|
1146
1154
|
}
|
1147
1155
|
function zt(n, e) {
|
@@ -1167,12 +1175,12 @@ function Qt(n, e, t) {
|
|
1167
1175
|
value: e.value?.value ? `(v) => {
|
1168
1176
|
${e.value.value} = v;
|
1169
1177
|
}` : "(v) => {}"
|
1170
|
-
}, r = t.__parseFunction(s), o =
|
1178
|
+
}, r = t.__parseFunction(s), o = xe(
|
1171
1179
|
j(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
|
1172
|
-
),
|
1180
|
+
), i = j(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
1173
1181
|
return {
|
1174
|
-
[
|
1175
|
-
[`onUpdate:${
|
1182
|
+
[i]: t.__parseExpression(e.value),
|
1183
|
+
[`onUpdate:${i}`]: o.length && r ? n.withModifiers(r, o) : r
|
1176
1184
|
};
|
1177
1185
|
}
|
1178
1186
|
function Wt(n, e, t, s, r) {
|
@@ -1181,21 +1189,21 @@ function Wt(n, e, t, s, r) {
|
|
1181
1189
|
return { default: () => e };
|
1182
1190
|
if (j(e))
|
1183
1191
|
return {
|
1184
|
-
default: () =>
|
1192
|
+
default: () => Ie(t.__parseExpression(e))
|
1185
1193
|
};
|
1186
1194
|
if (Array.isArray(e) && e.length > 0) {
|
1187
|
-
const o = Xt(e),
|
1188
|
-
[
|
1195
|
+
const o = Xt(e), i = (a, l) => !a || !r ? {} : r?.id && Object.keys(a).length ? l ? {
|
1196
|
+
[l]: a
|
1189
1197
|
} : {
|
1190
|
-
[`scope_${r.id}`]:
|
1191
|
-
} :
|
1198
|
+
[`scope_${r.id}`]: a
|
1199
|
+
} : l ? { [l]: /* @__PURE__ */ Object.create(null) } : {};
|
1192
1200
|
return Object.entries(o).reduce(
|
1193
|
-
(
|
1194
|
-
const
|
1201
|
+
(a, [l, { nodes: c, params: u, scope: f }]) => (a[l] = (h) => {
|
1202
|
+
const p = u.length ? st(h ?? {}, u) : i(h, f);
|
1195
1203
|
return c.map(
|
1196
|
-
(
|
1204
|
+
(d) => M(d, t.__clone(p), n, s, c)
|
1197
1205
|
);
|
1198
|
-
},
|
1206
|
+
}, a),
|
1199
1207
|
{}
|
1200
1208
|
);
|
1201
1209
|
}
|
@@ -1217,18 +1225,18 @@ function Yt(n = "default") {
|
|
1217
1225
|
return C(n) ? { name: n, params: [], scope: "" } : { params: [], scope: "", ...n };
|
1218
1226
|
}
|
1219
1227
|
function Zt(n, e, t) {
|
1220
|
-
const { value: s, iterator: r } = n, { item: o = "item", index:
|
1221
|
-
let
|
1222
|
-
return Number.isInteger(
|
1228
|
+
const { value: s, iterator: r } = n, { item: o = "item", index: i = "index" } = r || {};
|
1229
|
+
let a = t.__parseExpression(s) || [];
|
1230
|
+
return Number.isInteger(a) && (a = new Array(a).fill(!0).map((l, c) => c + 1)), Array.isArray(a) ? a.map((l, c) => e(t.__clone({ [o]: l, [i]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
1223
1231
|
}
|
1224
|
-
const ee =
|
1232
|
+
const ee = Ce({
|
1225
1233
|
name: "VtjPageContainer",
|
1226
1234
|
async setup() {
|
1227
|
-
const n = Ne(), e =
|
1235
|
+
const n = Ne(), e = Ae(), t = e.meta.__vtj__ || e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null, o = oe(Symbol());
|
1228
1236
|
if (s) {
|
1229
1237
|
Object.assign(e.meta, s.meta || {}, { cache: s.cache });
|
1230
|
-
const { useTitle:
|
1231
|
-
|
1238
|
+
const { useTitle: i } = n?.adapter;
|
1239
|
+
i && i(s.title || "VTJ");
|
1232
1240
|
}
|
1233
1241
|
return {
|
1234
1242
|
provider: n,
|
@@ -1242,44 +1250,44 @@ const ee = Pe({
|
|
1242
1250
|
},
|
1243
1251
|
render() {
|
1244
1252
|
const { component: n, query: e, sid: t } = this;
|
1245
|
-
return n ?
|
1253
|
+
return n ? re(n, { ...e, key: t }) : re("div", "页面不存在");
|
1246
1254
|
},
|
1247
1255
|
activated() {
|
1248
1256
|
this.meta.cache === !1 && (this.sid = Symbol());
|
1249
1257
|
}
|
1250
|
-
}), es =
|
1258
|
+
}), es = Ce({
|
1251
1259
|
name: "VtjStartupContainer",
|
1252
1260
|
render() {
|
1253
|
-
return
|
1261
|
+
return re("div", "page not found!");
|
1254
1262
|
}
|
1255
1263
|
});
|
1256
1264
|
function K(n, e, t = []) {
|
1257
1265
|
const s = [];
|
1258
1266
|
for (const r of t) {
|
1259
|
-
const { id: o, title:
|
1260
|
-
if (
|
1261
|
-
const
|
1262
|
-
s.push(...
|
1267
|
+
const { id: o, title: i, icon: a, children: l, hidden: c, layout: u } = r;
|
1268
|
+
if (u) {
|
1269
|
+
const f = K(n, e, l || []);
|
1270
|
+
s.push(...f);
|
1263
1271
|
} else {
|
1264
|
-
const
|
1272
|
+
const f = {
|
1265
1273
|
id: o,
|
1266
|
-
title:
|
1267
|
-
icon:
|
1274
|
+
title: i,
|
1275
|
+
icon: a,
|
1268
1276
|
hidden: c,
|
1269
1277
|
url: `${n}/${e}/${o}`,
|
1270
|
-
children:
|
1278
|
+
children: l && l.length ? K(n, e, l) : void 0
|
1271
1279
|
};
|
1272
|
-
s.push(
|
1280
|
+
s.push(f);
|
1273
1281
|
}
|
1274
1282
|
}
|
1275
1283
|
return s;
|
1276
1284
|
}
|
1277
|
-
function
|
1285
|
+
function Be(n, e) {
|
1278
1286
|
if (!e) return n;
|
1279
1287
|
let t = [];
|
1280
1288
|
for (const s of n)
|
1281
1289
|
if (s.children && s.children.length) {
|
1282
|
-
const r =
|
1290
|
+
const r = Be(s.children, e);
|
1283
1291
|
r.length && (s.children = r, t.push(s));
|
1284
1292
|
} else
|
1285
1293
|
e.can(s.id.toString()) && t.push(s);
|
@@ -1290,109 +1298,109 @@ function Rs(n) {
|
|
1290
1298
|
menuPathPrefix: e = "",
|
1291
1299
|
pageRouteName: t = "page",
|
1292
1300
|
disableMenusFilter: s = !1
|
1293
|
-
} = n || {}, r = Ne(), o =
|
1294
|
-
|
1301
|
+
} = n || {}, r = Ne(), o = Ae(), i = St(), a = oe(!1), l = oe(!1), c = r.project, u = (p, d) => {
|
1302
|
+
a.value = !p?.mask, l.value = d?.pure ?? !!p?.pure;
|
1295
1303
|
};
|
1296
1304
|
rt(() => {
|
1297
|
-
const { name:
|
1298
|
-
if (
|
1299
|
-
const v = r.getPage(
|
1300
|
-
|
1301
|
-
} else if (
|
1305
|
+
const { name: p, params: d, meta: g } = o;
|
1306
|
+
if (p === D) {
|
1307
|
+
const v = r.getPage(d.id);
|
1308
|
+
u(v, g);
|
1309
|
+
} else if (p === N) {
|
1302
1310
|
const v = r.getHomepage();
|
1303
|
-
|
1311
|
+
u(v, g);
|
1304
1312
|
} else {
|
1305
1313
|
const v = g.__vtj__;
|
1306
1314
|
if (v) {
|
1307
1315
|
const m = r.getPage(v);
|
1308
|
-
|
1316
|
+
u(m, g);
|
1309
1317
|
} else
|
1310
|
-
|
1318
|
+
a.value = !g.mask, l.value = !!g.pure;
|
1311
1319
|
}
|
1312
1320
|
});
|
1313
|
-
const
|
1321
|
+
const f = K(
|
1314
1322
|
e,
|
1315
1323
|
t,
|
1316
1324
|
c?.pages
|
1317
1325
|
), h = c?.config;
|
1318
1326
|
return {
|
1319
|
-
disabled:
|
1327
|
+
disabled: a,
|
1320
1328
|
logo: h?.logo,
|
1321
1329
|
themeSwitchable: h?.themeSwitchable,
|
1322
1330
|
title: h?.title || c?.description || c?.name || "VTJ App",
|
1323
|
-
menus: s ?
|
1324
|
-
pure:
|
1331
|
+
menus: s ? f : Be(f, i),
|
1332
|
+
pure: l
|
1325
1333
|
};
|
1326
1334
|
}
|
1327
1335
|
function te(n, e) {
|
1328
|
-
const { id: t, title: s, meta: r } = n, { name: o = "page", prefix:
|
1336
|
+
const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: i = "", component: a, routeMeta: l } = e;
|
1329
1337
|
return {
|
1330
1338
|
name: t,
|
1331
|
-
path: `${
|
1332
|
-
component:
|
1339
|
+
path: `${i}${o}/${t}`,
|
1340
|
+
component: a,
|
1333
1341
|
meta: {
|
1334
1342
|
title: s,
|
1335
|
-
...
|
1343
|
+
...l,
|
1336
1344
|
...r,
|
1337
1345
|
__vtj__: t
|
1338
1346
|
}
|
1339
1347
|
};
|
1340
1348
|
}
|
1341
|
-
function
|
1349
|
+
function le(n) {
|
1342
1350
|
const {
|
1343
1351
|
name: e = "page",
|
1344
1352
|
prefix: t = "",
|
1345
1353
|
pages: s = [],
|
1346
1354
|
component: r,
|
1347
1355
|
loader: o,
|
1348
|
-
routeMeta:
|
1349
|
-
homepage:
|
1350
|
-
} = n,
|
1356
|
+
routeMeta: i,
|
1357
|
+
homepage: a
|
1358
|
+
} = n, l = [];
|
1351
1359
|
for (const c of s) {
|
1352
|
-
const { id:
|
1360
|
+
const { id: u, title: f, dir: h, layout: p, children: d, meta: g } = c;
|
1353
1361
|
if (h) {
|
1354
|
-
const v =
|
1362
|
+
const v = le({
|
1355
1363
|
name: e,
|
1356
1364
|
prefix: t,
|
1357
1365
|
component: r,
|
1358
|
-
routeMeta:
|
1359
|
-
homepage:
|
1366
|
+
routeMeta: i,
|
1367
|
+
homepage: a,
|
1360
1368
|
loader: o,
|
1361
|
-
pages:
|
1369
|
+
pages: d || []
|
1362
1370
|
});
|
1363
|
-
|
1364
|
-
} else if (
|
1365
|
-
const v =
|
1371
|
+
l.push(...v);
|
1372
|
+
} else if (p) {
|
1373
|
+
const v = le({
|
1366
1374
|
name: e,
|
1367
1375
|
prefix: t,
|
1368
1376
|
component: r,
|
1369
|
-
routeMeta:
|
1370
|
-
homepage:
|
1377
|
+
routeMeta: i,
|
1378
|
+
homepage: a,
|
1371
1379
|
loader: o,
|
1372
|
-
pages:
|
1380
|
+
pages: d || []
|
1373
1381
|
}), m = {
|
1374
|
-
name: `layout_${
|
1382
|
+
name: `layout_${u}`,
|
1375
1383
|
path: t,
|
1376
|
-
component: () => o(
|
1384
|
+
component: () => o(u),
|
1377
1385
|
meta: {
|
1378
|
-
title:
|
1379
|
-
...
|
1386
|
+
title: f,
|
1387
|
+
...i,
|
1380
1388
|
...g,
|
1381
|
-
__vtj__:
|
1389
|
+
__vtj__: u
|
1382
1390
|
},
|
1383
1391
|
children: v
|
1384
1392
|
};
|
1385
|
-
|
1386
|
-
} else if (
|
1393
|
+
l.push(m), l.push(te(c, n));
|
1394
|
+
} else if (l.push(te(c, n)), a === u) {
|
1387
1395
|
const v = te(c, n);
|
1388
|
-
v.path = "", v.name = `home_${
|
1396
|
+
v.path = "", v.name = `home_${u}`, l.push(v);
|
1389
1397
|
}
|
1390
1398
|
}
|
1391
|
-
return
|
1399
|
+
return l;
|
1392
1400
|
}
|
1393
1401
|
function ts(n = {}, e) {
|
1394
|
-
const { css: t, store: s, enhance: r } = n, { window: o, app:
|
1395
|
-
|
1402
|
+
const { css: t, store: s, enhance: r } = n, { window: o, app: i, library: a = {}, adapter: l, mode: c } = e, { Pinia: u } = a;
|
1403
|
+
fe(o, "global-css", t || ""), u && s && ss(s, i, u), rs(i, l, n), !l.access && n.access && ns(n.access, i, c, l), os(i, n), r && is(r, i);
|
1396
1404
|
}
|
1397
1405
|
function ss(n, e, t) {
|
1398
1406
|
const s = t.createPinia();
|
@@ -1403,47 +1411,47 @@ function ss(n, e, t) {
|
|
1403
1411
|
}
|
1404
1412
|
function ns(n, e, t, s) {
|
1405
1413
|
if (S(n) && n.value) {
|
1406
|
-
const r = E(n, {}, !1, !1, !0), { alert: o, request:
|
1414
|
+
const r = E(n, {}, !1, !1, !0), { alert: o, request: i } = s, a = new pe({
|
1407
1415
|
alert: o,
|
1408
1416
|
storagePrefix: "__VTJ_APP_",
|
1409
1417
|
...r(e)
|
1410
|
-
}),
|
1411
|
-
|
1418
|
+
}), l = e.config.globalProperties.$router;
|
1419
|
+
a.connect({ mode: t, router: l, request: i }), e.use(a);
|
1412
1420
|
}
|
1413
1421
|
}
|
1414
1422
|
function rs(n, e, t) {
|
1415
1423
|
if (!e.request) return;
|
1416
1424
|
const { axios: s, request: r, response: o } = t;
|
1417
1425
|
if (s && S(s) && s.value) {
|
1418
|
-
const
|
1419
|
-
e.request.setConfig(
|
1426
|
+
const i = E(s, {}, !1, !1, !0);
|
1427
|
+
e.request.setConfig(i(n));
|
1420
1428
|
}
|
1421
1429
|
if (r && S(r) && r.value) {
|
1422
|
-
const
|
1423
|
-
e.request.useRequest((
|
1430
|
+
const i = E(r, {}, !1, !1, !0);
|
1431
|
+
e.request.useRequest((a) => i(a, n));
|
1424
1432
|
}
|
1425
1433
|
if (o && S(o) && o.value) {
|
1426
|
-
const
|
1427
|
-
e.request.useResponse((
|
1434
|
+
const i = E(o, {}, !1, !1, !0);
|
1435
|
+
e.request.useResponse((a) => i(a, n));
|
1428
1436
|
}
|
1429
1437
|
}
|
1430
1438
|
function os(n, e) {
|
1431
1439
|
const { beforeEach: t, afterEach: s } = e, r = n.config.globalProperties.$router;
|
1432
1440
|
if (t && S(t) && t.value) {
|
1433
1441
|
const o = E(t, {}, !1, !1, !0);
|
1434
|
-
r && r.beforeEach((
|
1442
|
+
r && r.beforeEach((i, a, l) => o(i, a, l, n));
|
1435
1443
|
}
|
1436
1444
|
if (s && S(s) && s.value) {
|
1437
1445
|
const o = E(s, {}, !1, !1, !0);
|
1438
|
-
r && r.afterEach((
|
1446
|
+
r && r.afterEach((i, a, l) => o(i, a, l, n));
|
1439
1447
|
}
|
1440
1448
|
}
|
1441
1449
|
function is(n, e) {
|
1442
1450
|
S(n) && n.value && E(n, {}, !1, !1, !0)(e);
|
1443
1451
|
}
|
1444
|
-
const
|
1452
|
+
const Ue = Symbol("Provider");
|
1445
1453
|
var as = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(as || {});
|
1446
|
-
class cs extends
|
1454
|
+
class cs extends ze {
|
1447
1455
|
// DSL缓存
|
1448
1456
|
/**
|
1449
1457
|
* 创建Provider实例
|
@@ -1456,18 +1464,18 @@ class cs extends Ke {
|
|
1456
1464
|
mode: s = _.Raw,
|
1457
1465
|
dependencies: r,
|
1458
1466
|
materials: o,
|
1459
|
-
project:
|
1460
|
-
adapter:
|
1461
|
-
globals:
|
1467
|
+
project: i = {},
|
1468
|
+
adapter: a = {},
|
1469
|
+
globals: l = {},
|
1462
1470
|
modules: c = {},
|
1463
|
-
router:
|
1464
|
-
materialPath:
|
1471
|
+
router: u = null,
|
1472
|
+
materialPath: f = "./",
|
1465
1473
|
nodeEnv: h = "development"
|
1466
1474
|
/* Development */
|
1467
1475
|
} = e;
|
1468
|
-
this.mode = s, this.modules = c, this.service = t, this.router =
|
1469
|
-
const { access:
|
1470
|
-
|
1476
|
+
this.mode = s, this.modules = c, this.service = t, this.router = u, this.materialPath = f, this.nodeEnv = h, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, l), Object.assign(this.adapter, a);
|
1477
|
+
const { access: p, request: d } = this.adapter;
|
1478
|
+
p && p.connect({ mode: s, router: u, request: d }), i && s !== _.Design ? this.load(i) : this.project = i;
|
1471
1479
|
}
|
1472
1480
|
mode;
|
1473
1481
|
// 当前运行模式(设计/源码/预览等)
|
@@ -1475,7 +1483,7 @@ class cs extends Ke {
|
|
1475
1483
|
// 全局变量
|
1476
1484
|
modules = {};
|
1477
1485
|
// 异步模块加载器
|
1478
|
-
adapter = { request:
|
1486
|
+
adapter = { request: ne, jsonp: Re };
|
1479
1487
|
// 适配器接口
|
1480
1488
|
apis = {};
|
1481
1489
|
// API集合
|
@@ -1523,8 +1531,8 @@ class cs extends Ke {
|
|
1523
1531
|
const { vtjDir: t = ".vtj" } = this.options, s = this.modules[`${t}/projects/${e.id}.json`] || this.modules[`/src/${t}/projects/${e.id}.json`];
|
1524
1532
|
if (this.project = s ? await s() : await this.service.init(e), !this.project)
|
1525
1533
|
throw new Error("project is null");
|
1526
|
-
const { apis: r = [], meta: o = [] } = this.project,
|
1527
|
-
|
1534
|
+
const { apis: r = [], meta: o = [] } = this.project, i = window;
|
1535
|
+
i && (i.CKEDITOR_VERSION = void 0), this.mode === _.Raw ? await this.loadDependencies(i) : await this.loadAssets(i), this.initMock(i), this.apis = Et(r, o, this.adapter), Oe(i), bt(r, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
|
1528
1536
|
}
|
1529
1537
|
initMock(e) {
|
1530
1538
|
const t = T(e);
|
@@ -1538,43 +1546,43 @@ class cs extends Ke {
|
|
1538
1546
|
e[s] || (e[s] = this.library[s] = await r());
|
1539
1547
|
}
|
1540
1548
|
async loadAssets(e) {
|
1541
|
-
const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath:
|
1542
|
-
libraryExports:
|
1549
|
+
const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: i, nodeEnv: a } = this, {
|
1550
|
+
libraryExports: l,
|
1543
1551
|
libraryMap: c,
|
1544
|
-
materials:
|
1545
|
-
materialExports:
|
1552
|
+
materials: u,
|
1553
|
+
materialExports: f,
|
1546
1554
|
materialMapLibrary: h
|
1547
1555
|
} = ft(
|
1548
1556
|
t,
|
1549
|
-
|
1550
|
-
|
1557
|
+
i,
|
1558
|
+
a === "development"
|
1551
1559
|
/* Development */
|
1552
1560
|
);
|
1553
|
-
for (const
|
1554
|
-
const
|
1561
|
+
for (const p of l) {
|
1562
|
+
const d = s[p], g = e[p];
|
1555
1563
|
if (g)
|
1556
|
-
r[
|
1557
|
-
else if (
|
1558
|
-
e[
|
1564
|
+
r[p] = g;
|
1565
|
+
else if (d)
|
1566
|
+
e[p] = r[p] = await d();
|
1559
1567
|
else {
|
1560
|
-
const v = c[
|
1568
|
+
const v = c[p] || [];
|
1561
1569
|
for (const m of v)
|
1562
|
-
G(m) && await mt(m, F.append(m, { v: O })), V(m) && await
|
1563
|
-
r[
|
1570
|
+
G(m) && await mt(m, F.append(m, { v: O })), V(m) && await Se(F.append(m, { v: O }));
|
1571
|
+
r[p] = e[p];
|
1564
1572
|
}
|
1565
1573
|
}
|
1566
|
-
if (
|
1567
|
-
for (const
|
1568
|
-
await
|
1569
|
-
const
|
1570
|
-
for (const
|
1571
|
-
const g = e[h[
|
1574
|
+
if (a === "development") {
|
1575
|
+
for (const d of u)
|
1576
|
+
await Se(F.append(d, { v: O }));
|
1577
|
+
const p = this.materials || {};
|
1578
|
+
for (const d of f) {
|
1579
|
+
const g = e[h[d]], v = Ge[d];
|
1572
1580
|
if (v)
|
1573
1581
|
g && v.forEach((m) => {
|
1574
1582
|
o[m] = g[m];
|
1575
1583
|
});
|
1576
1584
|
else {
|
1577
|
-
const m = d
|
1585
|
+
const m = p[d] ? (await p[d]()).default : e[d];
|
1578
1586
|
m && g && (m.components || []).forEach((b) => {
|
1579
1587
|
o[b.name] = pt(b, g);
|
1580
1588
|
});
|
@@ -1586,33 +1594,33 @@ class cs extends Ke {
|
|
1586
1594
|
const { router: e, project: t, options: s, adapter: r } = this;
|
1587
1595
|
if (!e) return;
|
1588
1596
|
const o = t?.platform === "uniapp" ? "pages" : "page", {
|
1589
|
-
routeAppendTo:
|
1590
|
-
pageRouteName:
|
1591
|
-
routeMeta:
|
1592
|
-
} = s, c =
|
1593
|
-
path: `${c}${
|
1597
|
+
routeAppendTo: i,
|
1598
|
+
pageRouteName: a = o,
|
1599
|
+
routeMeta: l
|
1600
|
+
} = s, c = i ? "" : "/", u = {
|
1601
|
+
path: `${c}${a}/:id`,
|
1594
1602
|
name: D,
|
1595
1603
|
component: ee
|
1596
|
-
},
|
1604
|
+
}, f = {
|
1597
1605
|
path: c,
|
1598
|
-
name:
|
1606
|
+
name: N,
|
1599
1607
|
component: t?.homepage ? ee : r.startupComponent || es,
|
1600
|
-
meta:
|
1608
|
+
meta: l
|
1601
1609
|
};
|
1602
|
-
if (e.hasRoute(D) && e.removeRoute(D), e.hasRoute(
|
1610
|
+
if (e.hasRoute(D) && e.removeRoute(D), e.hasRoute(N) && e.removeRoute(N), s.enableStaticRoute) {
|
1603
1611
|
const h = t?.pages || [];
|
1604
|
-
|
1605
|
-
name:
|
1612
|
+
le({
|
1613
|
+
name: a,
|
1606
1614
|
prefix: c,
|
1607
1615
|
pages: h,
|
1608
1616
|
component: ee,
|
1609
1617
|
loader: this.getRenderComponent.bind(this),
|
1610
1618
|
homepage: t?.homepage
|
1611
|
-
}).forEach((
|
1612
|
-
|
1613
|
-
}), t?.homepage || (
|
1619
|
+
}).forEach((d) => {
|
1620
|
+
i ? e.addRoute(i, d) : e.addRoute(d);
|
1621
|
+
}), t?.homepage || (i ? e.addRoute(i, f) : e.addRoute(f));
|
1614
1622
|
} else
|
1615
|
-
|
1623
|
+
i ? (e.addRoute(i, u), e.addRoute(i, f)) : (e.addRoute(u), e.addRoute(f));
|
1616
1624
|
}
|
1617
1625
|
/**
|
1618
1626
|
* Vue 插件安装方法
|
@@ -1628,14 +1636,14 @@ class cs extends Ke {
|
|
1628
1636
|
const t = e.config.globalProperties.installed || {};
|
1629
1637
|
for (const [s, r] of Object.entries(this.library))
|
1630
1638
|
!t[s] && gt(r) && (e.use(r), t[s] = !0);
|
1631
|
-
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(
|
1639
|
+
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Ue, this), e.config.globalProperties.$provider = this, this.project?.platform !== "uniapp" && this.initGlobals(this.project?.globals || {}, {
|
1632
1640
|
app: e,
|
1633
1641
|
window,
|
1634
1642
|
adapter: this.adapter,
|
1635
1643
|
library: this.library,
|
1636
1644
|
mode: this.mode
|
1637
1645
|
}), this.options.enhance && e.use(this.options.enhance, this), this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
|
1638
|
-
const
|
1646
|
+
const i = r?.$options.name, a = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", l = `[ ${i} ] ${a} ${o}`;
|
1639
1647
|
console.error(
|
1640
1648
|
"[VTJ Error]:",
|
1641
1649
|
{
|
@@ -1644,7 +1652,7 @@ class cs extends Ke {
|
|
1644
1652
|
info: o
|
1645
1653
|
},
|
1646
1654
|
s?.stack
|
1647
|
-
), this.adapter.notify && this.adapter.notify(
|
1655
|
+
), this.adapter.notify && this.adapter.notify(l, "组件渲染错误", "error");
|
1648
1656
|
}), e.config.globalProperties.installed = t;
|
1649
1657
|
}
|
1650
1658
|
getFile(e) {
|
@@ -1653,13 +1661,13 @@ class cs extends Ke {
|
|
1653
1661
|
}
|
1654
1662
|
getPage(e) {
|
1655
1663
|
const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
|
1656
|
-
for (const
|
1657
|
-
if (
|
1658
|
-
return
|
1659
|
-
if (
|
1660
|
-
const
|
1661
|
-
if (
|
1662
|
-
return
|
1664
|
+
for (const i of o) {
|
1665
|
+
if (i.id === r)
|
1666
|
+
return i;
|
1667
|
+
if (i.children && i.children.length) {
|
1668
|
+
const a = s(r, i.children);
|
1669
|
+
if (a)
|
1670
|
+
return a;
|
1663
1671
|
}
|
1664
1672
|
}
|
1665
1673
|
};
|
@@ -1697,23 +1705,23 @@ class cs extends Ke {
|
|
1697
1705
|
* @returns 渲染器实例
|
1698
1706
|
*/
|
1699
1707
|
createDslRenderer(e, t = {}) {
|
1700
|
-
const { library: s, components: r, mode: o, apis:
|
1708
|
+
const { library: s, components: r, mode: o, apis: i } = this, a = {
|
1701
1709
|
mode: o,
|
1702
1710
|
Vue: s.Vue,
|
1703
1711
|
components: r,
|
1704
1712
|
libs: s,
|
1705
|
-
apis:
|
1713
|
+
apis: i,
|
1706
1714
|
window,
|
1707
1715
|
...t
|
1708
|
-
},
|
1716
|
+
}, l = ae({
|
1709
1717
|
getDsl: async (c) => await this.getDsl(c) || null,
|
1710
1718
|
getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
|
1711
|
-
options:
|
1719
|
+
options: a
|
1712
1720
|
});
|
1713
|
-
return
|
1714
|
-
...
|
1721
|
+
return ie({
|
1722
|
+
...a,
|
1715
1723
|
dsl: e,
|
1716
|
-
loader:
|
1724
|
+
loader: l
|
1717
1725
|
});
|
1718
1726
|
}
|
1719
1727
|
/**
|
@@ -1731,8 +1739,8 @@ class cs extends Ke {
|
|
1731
1739
|
if (!s)
|
1732
1740
|
return k.warn(`Can not find file: ${e}`), null;
|
1733
1741
|
if (t && t(s), this.mode === _.Raw) {
|
1734
|
-
const { vtjRawDir: o = ".vtj/vue" } = this.options,
|
1735
|
-
return
|
1742
|
+
const { vtjRawDir: o = ".vtj/vue" } = this.options, i = `${o}/${e}.vue`, a = this.modules[i] || this.modules[`/src/pages/${e}.vue`];
|
1743
|
+
return a ? (await a())?.default : this.nodeEnv === "development" && this.adapter.startupComponent || null;
|
1736
1744
|
}
|
1737
1745
|
const r = await this.getDsl(s.id);
|
1738
1746
|
return r ? this.createDslRenderer(r).renderer : (k.warn(`Can not find dsl: ${e}`), null);
|
@@ -1747,7 +1755,7 @@ class cs extends Ke {
|
|
1747
1755
|
* @returns Vue异步组件
|
1748
1756
|
*/
|
1749
1757
|
defineUrlSchemaComponent(e, t) {
|
1750
|
-
return
|
1758
|
+
return $e(async () => {
|
1751
1759
|
const s = await this.getDslByUrl(e);
|
1752
1760
|
return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
|
1753
1761
|
});
|
@@ -1760,7 +1768,7 @@ class cs extends Ke {
|
|
1760
1768
|
* @returns Vue异步组件
|
1761
1769
|
*/
|
1762
1770
|
definePluginComponent(e) {
|
1763
|
-
return
|
1771
|
+
return $e(async () => await Te(e, window));
|
1764
1772
|
}
|
1765
1773
|
/**
|
1766
1774
|
* 设置应用全局
|
@@ -1786,7 +1794,7 @@ function Ps(n) {
|
|
1786
1794
|
};
|
1787
1795
|
}
|
1788
1796
|
function Ne(n = {}) {
|
1789
|
-
const e =
|
1797
|
+
const e = Pe(Ue, null);
|
1790
1798
|
if (!e)
|
1791
1799
|
throw new Error("Can not find provider");
|
1792
1800
|
if (e.nodeEnv === "development") {
|
@@ -1803,14 +1811,14 @@ function Ne(n = {}) {
|
|
1803
1811
|
return e;
|
1804
1812
|
}
|
1805
1813
|
async function Cs(n, e = "") {
|
1806
|
-
const { name: t, urls: s = [] } = n || {}, r = s.map((
|
1807
|
-
if (o.length &&
|
1808
|
-
return await
|
1814
|
+
const { name: t, urls: s = [] } = n || {}, r = s.map((a) => e + a), { css: o, js: i } = dt(r);
|
1815
|
+
if (o.length && Fe(o), i.length)
|
1816
|
+
return await ke(i, t).catch(
|
1809
1817
|
() => {
|
1810
1818
|
}
|
1811
1819
|
);
|
1812
1820
|
}
|
1813
|
-
const
|
1821
|
+
const Le = {
|
1814
1822
|
type: "json",
|
1815
1823
|
validSuccess: !0,
|
1816
1824
|
originResponse: !1,
|
@@ -1825,7 +1833,7 @@ const Ue = {
|
|
1825
1833
|
type: t,
|
1826
1834
|
data: s
|
1827
1835
|
},
|
1828
|
-
settings:
|
1836
|
+
settings: Le
|
1829
1837
|
}), us = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
|
1830
1838
|
url: e,
|
1831
1839
|
method: "post",
|
@@ -1834,12 +1842,12 @@ const Ue = {
|
|
1834
1842
|
projectId: s
|
1835
1843
|
},
|
1836
1844
|
settings: {
|
1837
|
-
...
|
1845
|
+
...Le,
|
1838
1846
|
type: "data"
|
1839
1847
|
}
|
1840
1848
|
}).then((r) => r && r[0] ? r[0] : null).catch(() => null);
|
1841
1849
|
function As(n) {
|
1842
|
-
return
|
1850
|
+
return be({
|
1843
1851
|
settings: {
|
1844
1852
|
type: "json",
|
1845
1853
|
validSuccess: !0,
|
@@ -1852,8 +1860,8 @@ function As(n) {
|
|
1852
1860
|
}
|
1853
1861
|
});
|
1854
1862
|
}
|
1855
|
-
class
|
1856
|
-
constructor(e =
|
1863
|
+
class de {
|
1864
|
+
constructor(e = ne) {
|
1857
1865
|
this.req = e, this.api = ls(e), this.uploader = us(e);
|
1858
1866
|
}
|
1859
1867
|
api;
|
@@ -1941,7 +1949,7 @@ class pe {
|
|
1941
1949
|
const { urls: t = [] } = e, s = t.filter((o) => lt(o))[0];
|
1942
1950
|
if (!s) return null;
|
1943
1951
|
const r = this.pluginCaches[s];
|
1944
|
-
return r || (this.pluginCaches[s] =
|
1952
|
+
return r || (this.pluginCaches[s] = ne.send({
|
1945
1953
|
url: s,
|
1946
1954
|
method: "get",
|
1947
1955
|
settings: {
|
@@ -1959,7 +1967,7 @@ const w = new nt({
|
|
1959
1967
|
expired: 0,
|
1960
1968
|
prefix: "__VTJ_"
|
1961
1969
|
});
|
1962
|
-
class Is extends
|
1970
|
+
class Is extends de {
|
1963
1971
|
init(e) {
|
1964
1972
|
const t = new L(e), s = w.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
|
1965
1973
|
return w.save(`project_${t.id}`, r), Promise.resolve(r);
|
@@ -1969,7 +1977,7 @@ class Is extends pe {
|
|
1969
1977
|
return w.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
1970
1978
|
}
|
1971
1979
|
saveMaterials(e, t) {
|
1972
|
-
return w.save(`materials_${e.id}`,
|
1980
|
+
return w.save(`materials_${e.id}`, ue(t)), Promise.resolve(!0);
|
1973
1981
|
}
|
1974
1982
|
saveFile(e) {
|
1975
1983
|
return w.save(`file_${e.id}`, e), Promise.resolve(!0);
|
@@ -1993,7 +2001,7 @@ class Is extends pe {
|
|
1993
2001
|
return Promise.resolve(!0);
|
1994
2002
|
}
|
1995
2003
|
getHistory(e) {
|
1996
|
-
const t = w.get(`history_${e}`), s = new
|
2004
|
+
const t = w.get(`history_${e}`), s = new Ee(t || { id: e });
|
1997
2005
|
return Promise.resolve(s.toDsl());
|
1998
2006
|
}
|
1999
2007
|
getHistoryItem(e, t) {
|
@@ -2009,7 +2017,7 @@ class Is extends pe {
|
|
2009
2017
|
}), Promise.resolve(!0);
|
2010
2018
|
}
|
2011
2019
|
}
|
2012
|
-
class fs extends
|
2020
|
+
class fs extends de {
|
2013
2021
|
projects = {};
|
2014
2022
|
materials = {};
|
2015
2023
|
files = {};
|
@@ -2024,7 +2032,7 @@ class fs extends pe {
|
|
2024
2032
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
2025
2033
|
}
|
2026
2034
|
saveMaterials(e, t) {
|
2027
|
-
return e.id && (this.materials[e.id] =
|
2035
|
+
return e.id && (this.materials[e.id] = ue(t)), Promise.resolve(!0);
|
2028
2036
|
}
|
2029
2037
|
saveFile(e) {
|
2030
2038
|
return this.files[e.id] = e, Promise.resolve(!0);
|
@@ -2048,7 +2056,7 @@ class fs extends pe {
|
|
2048
2056
|
return Promise.resolve(!0);
|
2049
2057
|
}
|
2050
2058
|
getHistory(e) {
|
2051
|
-
const t = this.histories[e], s = new
|
2059
|
+
const t = this.histories[e], s = new Ee(t || { id: e });
|
2052
2060
|
return Promise.resolve(s);
|
2053
2061
|
}
|
2054
2062
|
getHistoryItem(e, t) {
|
@@ -2066,11 +2074,11 @@ class fs extends pe {
|
|
2066
2074
|
}), Promise.resolve(!0);
|
2067
2075
|
}
|
2068
2076
|
}
|
2069
|
-
let
|
2077
|
+
let U = null;
|
2070
2078
|
function Fs() {
|
2071
|
-
return
|
2079
|
+
return U || (U = new fs(), U);
|
2072
2080
|
}
|
2073
|
-
class ks extends
|
2081
|
+
class ks extends de {
|
2074
2082
|
getFileCaches = {};
|
2075
2083
|
async getExtension() {
|
2076
2084
|
return await this.api("getExtension", {}).catch(() => {
|
@@ -2087,7 +2095,7 @@ class ks extends pe {
|
|
2087
2095
|
async saveMaterials(e, t) {
|
2088
2096
|
return !!await this.api("saveMaterials", {
|
2089
2097
|
project: e,
|
2090
|
-
materials:
|
2098
|
+
materials: ue(t)
|
2091
2099
|
}).catch(() => !1);
|
2092
2100
|
}
|
2093
2101
|
async saveFile(e) {
|
@@ -2129,16 +2137,16 @@ class ks extends pe {
|
|
2129
2137
|
}
|
2130
2138
|
export {
|
2131
2139
|
ys as ACCESS,
|
2132
|
-
|
2133
|
-
|
2140
|
+
Me as ACCESS_KEY,
|
2141
|
+
pe as Access,
|
2134
2142
|
ct as BUILD_IN_TAGS,
|
2135
2143
|
ot as BUILT_IN_DIRECTIVES,
|
2136
|
-
|
2137
|
-
|
2144
|
+
de as BaseService,
|
2145
|
+
je as CONTEXT_HOST,
|
2138
2146
|
Ct as Context,
|
2139
2147
|
_ as ContextMode,
|
2140
2148
|
it as DATA_TYPES,
|
2141
|
-
|
2149
|
+
N as HOMEPAGE_ROUTE_NAME,
|
2142
2150
|
at as HTML_TAGS,
|
2143
2151
|
$s as JSCodeToString,
|
2144
2152
|
gs as LIFE_CYCLES_LIST,
|
@@ -2150,7 +2158,7 @@ export {
|
|
2150
2158
|
vs as REMOTE,
|
2151
2159
|
Is as StorageService,
|
2152
2160
|
O as VTJ_RENDERER_VERSION,
|
2153
|
-
|
2161
|
+
fe as adoptedStyleSheets,
|
2154
2162
|
bs as clearLoaderCache,
|
2155
2163
|
ht as compileScopedCSS,
|
2156
2164
|
Es as createAccess,
|
@@ -2158,21 +2166,21 @@ export {
|
|
2158
2166
|
_s as createAssetScripts,
|
2159
2167
|
ws as createAssetsCss,
|
2160
2168
|
Dt as createDataSources,
|
2161
|
-
|
2169
|
+
ae as createLoader,
|
2162
2170
|
Fs as createMemoryService,
|
2163
2171
|
K as createMenus,
|
2164
2172
|
jt as createMetaApi,
|
2165
2173
|
Rt as createMock,
|
2166
2174
|
Ps as createProvider,
|
2167
|
-
|
2175
|
+
ie as createRenderer,
|
2168
2176
|
$t as createSchemaApi,
|
2169
2177
|
Et as createSchemaApis,
|
2170
2178
|
As as createServiceRequest,
|
2171
2179
|
xt as defaultLoader,
|
2172
2180
|
B as fillBasePath,
|
2173
2181
|
T as getMock,
|
2174
|
-
|
2175
|
-
|
2182
|
+
xe as getModifiers,
|
2183
|
+
Te as getPlugin,
|
2176
2184
|
pt as getRawComponent,
|
2177
2185
|
vt as isBuiltInTag,
|
2178
2186
|
G as isCSSUrl,
|
@@ -2184,22 +2192,22 @@ export {
|
|
2184
2192
|
yt as isNativeTag,
|
2185
2193
|
gt as isVuePlugin,
|
2186
2194
|
mt as loadCss,
|
2187
|
-
|
2195
|
+
Fe as loadCssUrl,
|
2188
2196
|
Cs as loadEnhance,
|
2189
|
-
|
2190
|
-
|
2197
|
+
ke as loadScriptUrl,
|
2198
|
+
Be as menusFilter,
|
2191
2199
|
Pt as mockApi,
|
2192
2200
|
bt as mockApis,
|
2193
|
-
|
2201
|
+
Oe as mockCleanup,
|
2194
2202
|
M as nodeRender,
|
2195
2203
|
ft as parseDeps,
|
2196
2204
|
H as parseExpression,
|
2197
2205
|
E as parseFunction,
|
2198
2206
|
dt as parseUrls,
|
2199
|
-
|
2207
|
+
Ue as providerKey,
|
2200
2208
|
ut as removeProdFlag,
|
2201
2209
|
Ss as setupPageSetting,
|
2202
|
-
|
2210
|
+
Ie as toString,
|
2203
2211
|
St as useAccess,
|
2204
2212
|
Rs as useMask,
|
2205
2213
|
Ne as useProvider
|