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