@vtj/renderer 0.12.70 → 0.13.0
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 -6
- package/dist/index.mjs +674 -603
- package/package.json +5 -5
- package/types/provider/globals.d.ts +12 -0
- package/types/provider/provider.d.ts +8 -1
- package/types/utils/parser.d.ts +2 -2
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
import { Base as Ke, BUILT_IN_COMPONENTS as ze, ProjectModel as
|
2
|
-
import { isUrl as Ge, url as
|
3
|
-
import * as
|
4
|
-
import { inject as
|
5
|
-
import { useRoute as
|
1
|
+
import { Base as Ke, BUILT_IN_COMPONENTS as ze, ProjectModel as L, HistoryModel as je } from "@vtj/core";
|
2
|
+
import { isUrl as Ge, url as F, dedupArray as Ve, isString as C, isFunction as q, logger as k, storage as X, cookie as Y, toArray as ve, unRSA as ye, delay as J, createRequest as Ee, jsonp as be, merge as Qe, pathToRegexp as We, pathToRegexpMatch as Xe, formDataToJson as Ye, Queue as Ze, cloneDeep as _e, camelCase as P, isObject as et, upperFirst as tt, pick as st, request as se, loadScript as we, Storage as nt, mapToObject as ue } from "@vtj/utils";
|
3
|
+
import * as z from "vue";
|
4
|
+
import { inject as Re, defineComponent as Pe, h as ne, ref as re, watchEffect as rt, defineAsyncComponent as Se } from "vue";
|
5
|
+
import { useRoute as Ce } 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.
|
10
|
+
* @version 0.13.0
|
11
11
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
12
12
|
*/
|
13
|
-
const
|
14
|
-
var
|
15
|
-
const
|
13
|
+
const O = "0.13.0";
|
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 we = [
|
|
24
24
|
"$props",
|
25
25
|
"$options",
|
26
26
|
"$forceUpdate"
|
27
|
-
],
|
27
|
+
], gs = [
|
28
28
|
"beforeCreate",
|
29
29
|
"created",
|
30
30
|
"beforeMount",
|
@@ -55,9 +55,9 @@ const we = [
|
|
55
55
|
Object,
|
56
56
|
Function,
|
57
57
|
Date
|
58
|
-
},
|
58
|
+
}, D = "VtjPage", U = "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
|
-
), ct = "component,slot".split(","),
|
60
|
+
), ct = "component,slot".split(","), vs = [
|
61
61
|
"h",
|
62
62
|
"t",
|
63
63
|
"t",
|
@@ -78,7 +78,7 @@ const we = [
|
|
78
78
|
"p",
|
79
79
|
"r",
|
80
80
|
"o"
|
81
|
-
].join(""),
|
81
|
+
].join(""), ys = {
|
82
82
|
auth: [
|
83
83
|
"h",
|
84
84
|
"t",
|
@@ -139,56 +139,56 @@ const we = [
|
|
139
139
|
].join(""),
|
140
140
|
privateKey: "MIIBOgIBAAJBAKoIzmn1FYQ1YOhOBw9EhABxZ+PySAIaydI+zdhoKflrdgJ4A5E4/5gbQmRpk09hPWG8nvX7h+l/QLU8kXxAIBECAwEAAQJAAlgpxQY6sByLsXqzJcthC8LSGsLf2JEJkHwlnpwFqlEV8UCkoINpuZ2Wzl+aftURu5rIfAzRCQBvHmeOTW9/zQIhAO5ufWDmnSLyfAAsNo5JRNpVuLFCFodR8Xm+ulDlosR/AiEAtpAltyP9wmCABKG/v/hrtTr3mcvFNGCjoGa9bUAok28CIHbrVs9w1ijrBlvTsXYwJw46uP539uKRRT4ymZzlm9QjAiB+1KH/G9f9pEEL9rtaSOG7JF5D0JcOjlze4MGVFs+ZrQIhALKOUFBNr2zEsyJIjw2PlvEucdlG77UniszjXTROHSPd"
|
141
141
|
};
|
142
|
-
function
|
142
|
+
function B(n, e) {
|
143
143
|
return n.map((t) => Ge(t) || t.startsWith("/") ? t : `${e}${t}`);
|
144
144
|
}
|
145
|
-
function
|
145
|
+
function G(n) {
|
146
146
|
return /\.css$/.test(n);
|
147
147
|
}
|
148
|
-
function
|
148
|
+
function V(n) {
|
149
149
|
return /\.js$/.test(n);
|
150
150
|
}
|
151
|
-
function
|
151
|
+
function ut(n) {
|
152
152
|
return /\.json$/.test(n);
|
153
153
|
}
|
154
|
-
function
|
154
|
+
function _s(n) {
|
155
155
|
return n.map(
|
156
|
-
(e) => `<script src="${
|
156
|
+
(e) => `<script src="${F.append(e, { v: O })}"><\/script>`
|
157
157
|
).join("");
|
158
158
|
}
|
159
|
-
function
|
159
|
+
function ws(n = []) {
|
160
160
|
return n.map(
|
161
|
-
(e) => `<link rel="stylesheet" href="${
|
161
|
+
(e) => `<link rel="stylesheet" href="${F.append(e, { v: O })}" />`
|
162
162
|
).join("");
|
163
163
|
}
|
164
|
-
function
|
164
|
+
function lt(n, e = !1) {
|
165
165
|
return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
|
166
166
|
}
|
167
|
-
function
|
168
|
-
const s = n.filter((h) => !!h.enabled), r = [], o = [],
|
167
|
+
function ft(n, e, t = !1) {
|
168
|
+
const s = n.filter((h) => !!h.enabled), r = [], o = [], i = [], a = [], f = {}, c = {}, u = [], l = {};
|
169
169
|
return s.forEach(
|
170
|
-
({ urls: h, assetsUrl:
|
170
|
+
({ urls: h, assetsUrl: p, library: d, assetsLibrary: v, localeLibrary: g }) => {
|
171
171
|
h?.forEach((m) => {
|
172
|
-
|
173
|
-
}), d && (
|
172
|
+
V(m) && r.push(lt(m, t)), G(m) && o.push(m);
|
173
|
+
}), d && (a.push(d), f[d] = B(h || [], e), g && (c[d] = g)), p && i.push(p), v && u.push(v), d && v && (l[v] = d);
|
174
174
|
}
|
175
175
|
), {
|
176
|
-
scripts:
|
177
|
-
css:
|
178
|
-
materials:
|
179
|
-
libraryExports:
|
180
|
-
materialExports: Ve(
|
181
|
-
materialMapLibrary:
|
182
|
-
libraryMap:
|
176
|
+
scripts: B(r, e),
|
177
|
+
css: B(o, e),
|
178
|
+
materials: B(i, e),
|
179
|
+
libraryExports: a,
|
180
|
+
materialExports: Ve(u),
|
181
|
+
materialMapLibrary: l,
|
182
|
+
libraryMap: f,
|
183
183
|
libraryLocaleMap: c
|
184
184
|
};
|
185
185
|
}
|
186
|
-
function
|
186
|
+
function pt(n, e) {
|
187
187
|
const { name: t, parent: s, alias: r } = n;
|
188
188
|
return s ? e[s]?.[r || t] : e[r || t];
|
189
189
|
}
|
190
190
|
function dt(n = []) {
|
191
|
-
const e = n.filter((s) =>
|
191
|
+
const e = n.filter((s) => G(s)), t = n.filter((s) => V(s));
|
192
192
|
return {
|
193
193
|
css: e,
|
194
194
|
js: t
|
@@ -196,164 +196,164 @@ 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 l = 0;
|
201
|
+
for (; l < c.length; ) {
|
202
|
+
if (/\s/.test(c[l])) {
|
203
|
+
l++;
|
204
204
|
continue;
|
205
205
|
}
|
206
|
-
if (c.substring(
|
207
|
-
const m = c.indexOf("*/",
|
206
|
+
if (c.substring(l, l + 2) === "/*") {
|
207
|
+
const m = c.indexOf("*/", l + 2);
|
208
208
|
if (m !== -1) {
|
209
|
-
|
209
|
+
l = m + 2;
|
210
210
|
continue;
|
211
211
|
}
|
212
212
|
}
|
213
|
-
if (c[
|
214
|
-
const m =
|
215
|
-
for (;
|
216
|
-
|
217
|
-
const
|
218
|
-
if (c[
|
219
|
-
|
213
|
+
if (c[l] === "@") {
|
214
|
+
const m = l;
|
215
|
+
for (; l < c.length && c[l] !== "{" && c[l] !== ";"; )
|
216
|
+
l++;
|
217
|
+
const b = c.substring(m, l).trim(), y = b.includes("@keyframes");
|
218
|
+
if (c[l] === ";")
|
219
|
+
u.push({
|
220
220
|
type: "simple-at-rule",
|
221
|
-
content: c.substring(m,
|
222
|
-
}),
|
223
|
-
else if (c[
|
224
|
-
const
|
225
|
-
let
|
226
|
-
for (
|
227
|
-
c[
|
228
|
-
const
|
229
|
-
|
221
|
+
content: c.substring(m, l + 1)
|
222
|
+
}), l++;
|
223
|
+
else if (c[l] === "{") {
|
224
|
+
const x = l + 1;
|
225
|
+
let A = 1;
|
226
|
+
for (l++; l < c.length && A > 0; )
|
227
|
+
c[l] === "{" ? A++ : c[l] === "}" && A--, l++;
|
228
|
+
const Q = c.substring(m, l), R = c.substring(x, l - 1);
|
229
|
+
u.push({
|
230
230
|
type: y ? "keyframes" : "at-rule",
|
231
|
-
rule:
|
232
|
-
content:
|
233
|
-
inner:
|
231
|
+
rule: b,
|
232
|
+
content: Q,
|
233
|
+
inner: R
|
234
234
|
});
|
235
235
|
}
|
236
236
|
continue;
|
237
237
|
}
|
238
|
-
const h =
|
239
|
-
for (;
|
240
|
-
|
241
|
-
if (
|
242
|
-
const
|
243
|
-
if (!
|
244
|
-
|
238
|
+
const h = l;
|
239
|
+
for (; l < c.length && c[l] !== "{"; )
|
240
|
+
l++;
|
241
|
+
if (l >= c.length) break;
|
242
|
+
const p = c.substring(h, l).trim();
|
243
|
+
if (!p) {
|
244
|
+
l++;
|
245
245
|
continue;
|
246
246
|
}
|
247
|
-
const d =
|
247
|
+
const d = l + 1;
|
248
248
|
let v = 1;
|
249
|
-
for (
|
250
|
-
c[
|
251
|
-
const g = c.substring(d,
|
252
|
-
|
249
|
+
for (l++; l < c.length && v > 0; )
|
250
|
+
c[l] === "{" ? v++ : c[l] === "}" && v--, l++;
|
251
|
+
const g = c.substring(d, l - 1);
|
252
|
+
u.push({
|
253
253
|
type: "rule",
|
254
|
-
selector:
|
254
|
+
selector: p,
|
255
255
|
content: g.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, l, h) => {
|
263
|
+
const p = l.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 d ? `${d}[${e}]${
|
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 l = u.match(/^(.+?)((?:::?[\w-]+(?:\([^)]*\))?)*)\s*$/);
|
270
|
+
if (l) {
|
271
|
+
const [, h, p = ""] = l, 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((l) => o(l)).filter((l) => l.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 l = i(u.selector);
|
292
|
+
return l.trim() ? `${l} { ${u.content} }` : "";
|
293
293
|
default:
|
294
294
|
return "";
|
295
295
|
}
|
296
|
-
}).filter((
|
296
|
+
}).filter((u) => u.trim()).join(" "), f = (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
|
299
|
+
`), u = t(c), l = a(u);
|
300
|
+
return f(l);
|
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 l = u.trim();
|
307
|
+
return !l || l.startsWith("@") || l.includes(`[${e}]`) || s(l) ? u : `${l}[${e}]`;
|
308
308
|
});
|
309
309
|
}
|
310
310
|
}
|
311
|
-
function
|
312
|
-
return
|
311
|
+
function Ae(n) {
|
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 le(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 f = n.document, c = f.adoptedStyleSheets, u = Array.from(c).filter(
|
320
|
+
(l) => l.id !== e
|
321
321
|
);
|
322
|
-
|
322
|
+
f.adoptedStyleSheets = [...u, a];
|
323
323
|
} else {
|
324
|
-
const
|
325
|
-
let
|
326
|
-
|
324
|
+
const a = n.document;
|
325
|
+
let f = a.getElementById(e);
|
326
|
+
f ? f.innerHTML = i : (f = a.createElement("style"), f.id = e, f.innerHTML = i, a.head.appendChild(f));
|
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 && le(window, n, t);
|
332
332
|
}
|
333
|
-
function
|
333
|
+
function Ie(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 Fe(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 f of n) {
|
346
346
|
const c = s.createElement("script");
|
347
|
-
c.src =
|
348
|
-
o = t[e], o ?
|
349
|
-
}, c.onerror = (
|
350
|
-
|
347
|
+
c.src = f, 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
|
});
|
354
354
|
}
|
355
355
|
function gt(n) {
|
356
|
-
return
|
356
|
+
return q(n) || q(n?.install);
|
357
357
|
}
|
358
358
|
function vt(n) {
|
359
359
|
return ct.includes(n);
|
@@ -361,53 +361,55 @@ function vt(n) {
|
|
361
361
|
function yt(n) {
|
362
362
|
return at.includes(n);
|
363
363
|
}
|
364
|
-
function
|
364
|
+
function T(n = window) {
|
365
365
|
const e = window?.Mock;
|
366
366
|
if (e) return e;
|
367
367
|
const t = n?.Mock;
|
368
368
|
if (t && window)
|
369
369
|
return window.Mock = t, t;
|
370
370
|
}
|
371
|
-
function
|
371
|
+
function Ss(n, e, t) {
|
372
372
|
Object.assign(e.meta, t.meta);
|
373
373
|
const s = n?._container;
|
374
374
|
t?.type === "page" && s.classList.add("is-page"), t?.pure && s.classList.add("is-pure");
|
375
375
|
}
|
376
|
-
function
|
376
|
+
function H(n, e, t = !1, s = !1, r = !1) {
|
377
377
|
try {
|
378
|
-
const
|
379
|
-
|
380
|
-
let
|
381
|
-
|
382
|
-
`) +
|
383
|
-
const a =
|
378
|
+
const o = ['"use strict";', "var __self = arguments[0];"];
|
379
|
+
o.push("return ");
|
380
|
+
let i = (n.value || "").trim();
|
381
|
+
r || (i = i.replace(/this(\W|$)/g, (f, c) => `__self${c}`)), i = o.join(`
|
382
|
+
`) + i;
|
383
|
+
const a = r ? `
|
384
|
+
${i}
|
385
|
+
` : `with(${t ? "{}" : "$scope || {}"}) { ${i} }`;
|
384
386
|
return new Function("$scope", a)(e);
|
385
|
-
} catch (
|
386
|
-
if (
|
387
|
-
throw
|
387
|
+
} catch (o) {
|
388
|
+
if (k.error("parseExpression.error", o, n, e?.__self ?? e), s)
|
389
|
+
throw o;
|
388
390
|
}
|
389
391
|
}
|
390
|
-
function
|
391
|
-
const
|
392
|
-
if (typeof
|
392
|
+
function E(n, e, t = !1, s = !1, r = !1) {
|
393
|
+
const o = H(n, e, t, s, r);
|
394
|
+
if (typeof o != "function" && (k.error(
|
393
395
|
"parseFunction.error",
|
394
396
|
"not a function",
|
395
397
|
n,
|
396
398
|
e?.__self ?? e
|
397
399
|
), s))
|
398
400
|
throw new Error(`"${n.value}" not a function`);
|
399
|
-
return
|
401
|
+
return o;
|
400
402
|
}
|
401
|
-
function
|
403
|
+
function j(n) {
|
402
404
|
return n && n.type === "JSExpression";
|
403
405
|
}
|
404
|
-
function
|
406
|
+
function S(n) {
|
405
407
|
return typeof n == "object" && n && n.type === "JSFunction";
|
406
408
|
}
|
407
409
|
function _t(n) {
|
408
|
-
return
|
410
|
+
return j(n) || S(n);
|
409
411
|
}
|
410
|
-
function
|
412
|
+
function $s(n) {
|
411
413
|
return _t(n) ? n.value : JSON.stringify(n);
|
412
414
|
}
|
413
415
|
const wt = {
|
@@ -423,11 +425,11 @@ const wt = {
|
|
423
425
|
noPermissionMessage: "无权限访问该页面",
|
424
426
|
appName: "",
|
425
427
|
statusKey: "code"
|
426
|
-
},
|
427
|
-
class
|
428
|
+
}, ke = Symbol("access");
|
429
|
+
class fe {
|
428
430
|
options;
|
429
431
|
data = null;
|
430
|
-
mode =
|
432
|
+
mode = _.Raw;
|
431
433
|
interceptResponse = !0;
|
432
434
|
constructor(e) {
|
433
435
|
this.options = Object.assign({}, wt, e), this.loadData();
|
@@ -440,21 +442,21 @@ class ke {
|
|
440
442
|
}
|
441
443
|
connect(e) {
|
442
444
|
const { mode: t, router: s, request: r } = e;
|
443
|
-
this.mode = t, s && this.mode
|
445
|
+
this.mode = t, s && this.mode !== _.Design && this.setGuard(s), r && this.setRequest(r);
|
444
446
|
}
|
445
447
|
login(e) {
|
446
448
|
const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
|
447
|
-
this.setData(e), this.data && (
|
449
|
+
this.setData(e), this.data && (X.save(t, e, {
|
448
450
|
type: "local",
|
449
451
|
prefix: s
|
450
|
-
}), r &&
|
452
|
+
}), r && Y.set(o, this.data.token));
|
451
453
|
}
|
452
454
|
clear() {
|
453
455
|
const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
|
454
|
-
this.data = null,
|
456
|
+
this.data = null, X.remove(e, {
|
455
457
|
type: "local",
|
456
458
|
prefix: t
|
457
|
-
}), s &&
|
459
|
+
}), s && Y.remove(r);
|
458
460
|
}
|
459
461
|
logout() {
|
460
462
|
this.clear(), this.toLogin();
|
@@ -467,14 +469,14 @@ class ke {
|
|
467
469
|
}
|
468
470
|
can(e) {
|
469
471
|
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
470
|
-
return typeof e == "function" ? e(s) :
|
472
|
+
return typeof e == "function" ? e(s) : ve(e).every((o) => s[o] || s[t + "." + o]);
|
471
473
|
}
|
472
474
|
some(e) {
|
473
475
|
const { appName: t } = this.options, { permissions: s = {} } = this.data || {};
|
474
|
-
return
|
476
|
+
return ve(e).some((o) => s[o] || s[t + "." + o]);
|
475
477
|
}
|
476
478
|
install(e) {
|
477
|
-
e.config.globalProperties.$access = this, e.provide(
|
479
|
+
e.config.globalProperties.$access = this, e.provide(ke, this);
|
478
480
|
}
|
479
481
|
isAuthPath(e) {
|
480
482
|
const { auth: t, isAuth: s } = this.options;
|
@@ -495,7 +497,7 @@ class ke {
|
|
495
497
|
setData(e) {
|
496
498
|
const { privateKey: t } = this.options;
|
497
499
|
if (Array.isArray(e) && t) {
|
498
|
-
const s = e.map((r) =>
|
500
|
+
const s = e.map((r) => ye(r, t));
|
499
501
|
try {
|
500
502
|
this.data = JSON.parse(s.join(""));
|
501
503
|
} catch (r) {
|
@@ -505,7 +507,7 @@ class ke {
|
|
505
507
|
}
|
506
508
|
if (typeof e == "string")
|
507
509
|
try {
|
508
|
-
const s = t ?
|
510
|
+
const s = t ? ye(e, t) : e;
|
509
511
|
s ? this.data = JSON.parse(s) : console.warn("RSA解密失败或登录信息缺失");
|
510
512
|
} catch (s) {
|
511
513
|
console.warn(s);
|
@@ -514,7 +516,7 @@ class ke {
|
|
514
516
|
this.data = e;
|
515
517
|
}
|
516
518
|
loadData() {
|
517
|
-
const { storageKey: e, storagePrefix: t } = this.options, s =
|
519
|
+
const { storageKey: e, storagePrefix: t } = this.options, s = X.get(e, {
|
518
520
|
type: "local",
|
519
521
|
prefix: t
|
520
522
|
});
|
@@ -522,10 +524,10 @@ class ke {
|
|
522
524
|
}
|
523
525
|
isLogined() {
|
524
526
|
const { session: e, authKey: t } = this.options;
|
525
|
-
return e && t ? !!
|
527
|
+
return e && t ? !!Y.get(t) : !!this.getToken();
|
526
528
|
}
|
527
529
|
hasRoutePermission(e) {
|
528
|
-
if (e.name ===
|
530
|
+
if (e.name === D) {
|
529
531
|
const t = e.params.id;
|
530
532
|
return t && this.can(t);
|
531
533
|
}
|
@@ -542,10 +544,10 @@ class ke {
|
|
542
544
|
return t();
|
543
545
|
{
|
544
546
|
const { noPermissionMessage: s = "无权限访问", unauthorized: r = !1 } = this.options;
|
545
|
-
return await this.showTip(s),
|
547
|
+
return await this.showTip(s), q(r) ? (r(), t(!1)) : C(r) ? t(r) : t(!1);
|
546
548
|
}
|
547
549
|
}
|
548
|
-
t(!1), this.toLogin();
|
550
|
+
t(!1), await J(0), this.toLogin();
|
549
551
|
}
|
550
552
|
isWhiteList(e) {
|
551
553
|
const { whiteList: t } = this.options;
|
@@ -561,7 +563,7 @@ class ke {
|
|
561
563
|
}
|
562
564
|
async showTip(e) {
|
563
565
|
const { alert: t } = this.options;
|
564
|
-
return t ? (await
|
566
|
+
return t ? (await J(150), await t(e, {
|
565
567
|
title: "提示",
|
566
568
|
type: "warning"
|
567
569
|
})?.catch(() => !1)) : !1;
|
@@ -578,50 +580,50 @@ class ke {
|
|
578
580
|
}
|
579
581
|
}
|
580
582
|
function St() {
|
581
|
-
return
|
583
|
+
return Re(ke, null);
|
582
584
|
}
|
583
|
-
function
|
585
|
+
function js(n = {}) {
|
584
586
|
const {
|
585
587
|
notify: e,
|
586
588
|
loading: t,
|
587
589
|
settings: s = {},
|
588
590
|
Startup: r,
|
589
591
|
access: o,
|
590
|
-
useTitle:
|
591
|
-
alert:
|
592
|
+
useTitle: i,
|
593
|
+
alert: a
|
592
594
|
} = n;
|
593
|
-
let
|
595
|
+
let f = null;
|
594
596
|
return {
|
595
|
-
request:
|
597
|
+
request: Ee({
|
596
598
|
settings: {
|
597
599
|
type: "form",
|
598
600
|
validSuccess: !0,
|
599
601
|
originResponse: !1,
|
600
602
|
loading: !0,
|
601
|
-
validate: (
|
603
|
+
validate: (u) => u.data?.code === 0 || !!u.data?.success,
|
602
604
|
failMessage: !0,
|
603
|
-
showError: (
|
604
|
-
e && e(
|
605
|
+
showError: (u) => {
|
606
|
+
e && e(u || "未知错误");
|
605
607
|
},
|
606
608
|
showLoading: () => {
|
607
|
-
|
609
|
+
f && f.close(), t && (f = t());
|
608
610
|
},
|
609
611
|
hideLoading: () => {
|
610
|
-
|
612
|
+
f && (f.close(), f = null);
|
611
613
|
},
|
612
614
|
...s
|
613
615
|
}
|
614
616
|
}),
|
615
|
-
jsonp:
|
617
|
+
jsonp: be,
|
616
618
|
notify: e,
|
617
619
|
loading: t,
|
618
|
-
useTitle:
|
620
|
+
useTitle: i,
|
619
621
|
startupComponent: r,
|
620
|
-
access: o ? new
|
622
|
+
access: o ? new fe({ alert: a, ...o }) : void 0
|
621
623
|
};
|
622
624
|
}
|
623
|
-
function
|
624
|
-
return new
|
625
|
+
function Es(n = {}) {
|
626
|
+
return new fe(n);
|
625
627
|
}
|
626
628
|
function $t(n, e) {
|
627
629
|
const { jsonp: t, request: s } = e;
|
@@ -631,7 +633,7 @@ function $t(n, e) {
|
|
631
633
|
query: r
|
632
634
|
});
|
633
635
|
{
|
634
|
-
const r = n.headers ?
|
636
|
+
const r = n.headers ? H(n.headers, {}, !0) : void 0, o = {
|
635
637
|
url: n.url,
|
636
638
|
method: n.method,
|
637
639
|
settings: {
|
@@ -639,19 +641,19 @@ function $t(n, e) {
|
|
639
641
|
headers: r
|
640
642
|
}
|
641
643
|
};
|
642
|
-
return (
|
644
|
+
return (i, a) => (delete o.data, s.send(Qe(o, a || {}, { data: i })));
|
643
645
|
}
|
644
646
|
}
|
645
647
|
function jt(n, e) {
|
646
648
|
const { metaQuery: t } = e;
|
647
649
|
if (!t) return;
|
648
650
|
const { code: s, queryCode: r } = n;
|
649
|
-
return (o,
|
651
|
+
return (o, i) => {
|
650
652
|
if (!t) {
|
651
653
|
console.warn("adapter.metaQuery is not defined!");
|
652
654
|
return;
|
653
655
|
}
|
654
|
-
return t(s, r, o,
|
656
|
+
return t(s, r, o, i);
|
655
657
|
};
|
656
658
|
}
|
657
659
|
function Et(n = [], e = [], t) {
|
@@ -662,19 +664,19 @@ function Et(n = [], e = [], t) {
|
|
662
664
|
s[r.id] = jt(r, t);
|
663
665
|
return s;
|
664
666
|
}
|
665
|
-
async function
|
666
|
-
const t =
|
667
|
+
async function bt(n = [], e = window) {
|
668
|
+
const t = T(e);
|
667
669
|
t && (Me(e), n.forEach((s) => Pt(t, s)));
|
668
670
|
}
|
669
|
-
function
|
670
|
-
const t =
|
671
|
+
function Rt(n, e = window) {
|
672
|
+
const t = S(n.mockTemplate) && n.mockTemplate.value ? E(n.mockTemplate, {}, !0) : void 0, s = T(e);
|
671
673
|
return async (...r) => {
|
672
674
|
let o = {};
|
673
675
|
if (t)
|
674
676
|
try {
|
675
677
|
o = await t.apply(t, r);
|
676
|
-
} catch (
|
677
|
-
|
678
|
+
} catch (i) {
|
679
|
+
k.warn("模拟数据模版异常", i);
|
678
680
|
}
|
679
681
|
return s?.mock(o);
|
680
682
|
};
|
@@ -683,15 +685,15 @@ function Pt(n, e) {
|
|
683
685
|
if (!e.mock) return;
|
684
686
|
const { url: t, mockTemplate: s } = e;
|
685
687
|
if (t && s) {
|
686
|
-
const r =
|
687
|
-
n.mock(r, (
|
688
|
-
const
|
689
|
-
return Object.assign(
|
688
|
+
const r = We(`${t}(.*)`), o = Xe(t, { decode: decodeURIComponent }), i = H(s, {}, !0);
|
689
|
+
n.mock(r, (a) => {
|
690
|
+
const f = F.parse(a.url) || {}, c = a.body instanceof FormData ? Ye(a.body) : a.body, u = o(a.url)?.params;
|
691
|
+
return Object.assign(a, { data: c, params: f, query: u }), n.mock(i(a));
|
690
692
|
});
|
691
693
|
}
|
692
694
|
}
|
693
695
|
function Me(n = window) {
|
694
|
-
const e =
|
696
|
+
const e = T(n);
|
695
697
|
e && (e._mocked = {});
|
696
698
|
}
|
697
699
|
class Ct {
|
@@ -723,7 +725,7 @@ class Ct {
|
|
723
725
|
const { mode: t, dsl: s, attrs: r } = e;
|
724
726
|
this.__mode = t, s && (this.__id = s.id || null, this.__transform = s.transform || {}), r && Object.assign(this, r);
|
725
727
|
}
|
726
|
-
setup(e, t =
|
728
|
+
setup(e, t = z) {
|
727
729
|
const s = t.getCurrentInstance();
|
728
730
|
if (!s) return;
|
729
731
|
this.__refs = {}, this.$refs = {}, this.context = {}, this.__contextRefs = {}, this.__instance = s.proxy;
|
@@ -737,12 +739,12 @@ class Ct {
|
|
737
739
|
});
|
738
740
|
}
|
739
741
|
__proxy() {
|
740
|
-
this.__instance &&
|
742
|
+
this.__instance && $e.forEach((e) => {
|
741
743
|
this[e] = this.__instance?.[e];
|
742
744
|
});
|
743
745
|
}
|
744
746
|
__cleanup() {
|
745
|
-
|
747
|
+
$e.forEach((e) => {
|
746
748
|
this[e] = null;
|
747
749
|
}), this.__reset();
|
748
750
|
}
|
@@ -751,30 +753,30 @@ class Ct {
|
|
751
753
|
}
|
752
754
|
__parseFunction(e) {
|
753
755
|
if (e)
|
754
|
-
if (this.__mode ===
|
756
|
+
if (this.__mode === _.Runtime) {
|
755
757
|
const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
756
|
-
return
|
758
|
+
return E({ type: s, value: r }, this);
|
757
759
|
} else
|
758
|
-
return
|
760
|
+
return E(e, this);
|
759
761
|
}
|
760
762
|
__parseExpression(e) {
|
761
763
|
if (e)
|
762
|
-
if (this.__mode ===
|
764
|
+
if (this.__mode === _.Runtime) {
|
763
765
|
const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
764
|
-
return
|
766
|
+
return H({ type: s, value: r }, this);
|
765
767
|
} else
|
766
|
-
return
|
768
|
+
return H(e, this);
|
767
769
|
}
|
768
770
|
__ref(e = null, t) {
|
769
|
-
if (this.__mode !==
|
771
|
+
if (this.__mode !== _.VNode)
|
770
772
|
return e && e !== this.__id && (this.__contextRefs[e] = this), async (s) => {
|
771
|
-
await
|
773
|
+
await J(0);
|
772
774
|
let r = s?.$vtjEl || s?.$el || s?._?.vnode?.el || s;
|
773
775
|
if (!r) {
|
774
776
|
typeof t == "string" && (delete this.$refs[t], e && delete this.__refs[e]);
|
775
777
|
return;
|
776
778
|
}
|
777
|
-
return r.nodeType === 3 && r.nextSibling && (r = r.nextSibling), r.__vtj__ = e,
|
779
|
+
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;
|
778
780
|
};
|
779
781
|
}
|
780
782
|
__getRefEl(e, t, s) {
|
@@ -793,79 +795,79 @@ class Ct {
|
|
793
795
|
return s.context.__proto__ = this.context, s.__proto__ = this, s;
|
794
796
|
}
|
795
797
|
}
|
796
|
-
function
|
798
|
+
function oe(n) {
|
797
799
|
const {
|
798
|
-
Vue: e =
|
799
|
-
mode: t =
|
800
|
+
Vue: e = z,
|
801
|
+
mode: t = _.Runtime,
|
800
802
|
components: s = {},
|
801
803
|
libs: r = {},
|
802
804
|
apis: o = {},
|
803
|
-
loader:
|
804
|
-
} = n,
|
805
|
+
loader: i
|
806
|
+
} = n, a = e.computed(() => n.dsl), f = {
|
805
807
|
$components: s,
|
806
808
|
$libs: r,
|
807
809
|
$apis: o
|
808
810
|
}, c = new Ct({
|
809
811
|
mode: t,
|
810
|
-
dsl:
|
811
|
-
attrs:
|
812
|
-
}),
|
813
|
-
name:
|
814
|
-
__scopeId:
|
812
|
+
dsl: a.value,
|
813
|
+
attrs: f
|
814
|
+
}), u = e.defineComponent({
|
815
|
+
name: a.value.name,
|
816
|
+
__scopeId: a.value.id ? `data-v-${a.value.id}` : void 0,
|
815
817
|
props: {
|
816
|
-
...It(
|
818
|
+
...It(a.value.props ?? [], c)
|
817
819
|
},
|
818
|
-
setup(
|
819
|
-
c.$props =
|
820
|
+
setup(l) {
|
821
|
+
c.$props = l, c.props = l, a.value.id && le(
|
820
822
|
n.window || window,
|
821
|
-
|
822
|
-
|
823
|
+
a.value.id,
|
824
|
+
a.value.css || "",
|
823
825
|
!0
|
824
|
-
), c.state = Ft(e,
|
825
|
-
const h = kt(e,
|
826
|
-
for (const [m,
|
827
|
-
d[m] = e.inject(m,
|
826
|
+
), c.state = Ft(e, a.value.state ?? {}, c);
|
827
|
+
const h = kt(e, a.value.computed ?? {}, c), p = Mt(a.value.methods ?? {}, c), d = Ot(e, a.value.inject, c);
|
828
|
+
for (const [m, b] of Object.entries(d || {}))
|
829
|
+
d[m] = e.inject(m, b);
|
828
830
|
const v = Dt(
|
829
|
-
|
831
|
+
a.value.dataSources || {},
|
830
832
|
c
|
831
833
|
), g = {
|
832
834
|
...d,
|
833
835
|
...h,
|
834
|
-
...
|
836
|
+
...p,
|
835
837
|
...v
|
836
838
|
};
|
837
|
-
return c.setup(g, e), Tt(e,
|
839
|
+
return c.setup(g, e), Tt(e, a.value.watch ?? [], c), {
|
838
840
|
vtj: c
|
839
841
|
};
|
840
842
|
},
|
841
|
-
emits: At(
|
843
|
+
emits: At(a.value.emits),
|
842
844
|
expose: ["vtj"],
|
843
845
|
render() {
|
844
|
-
if (!
|
845
|
-
const
|
846
|
-
return
|
847
|
-
(h) =>
|
846
|
+
if (!a.value.nodes) return null;
|
847
|
+
const l = a.value.nodes || [];
|
848
|
+
return l.length === 1 ? M(l[0], c, e, i, l) : l.map(
|
849
|
+
(h) => M(h, c, e, i, l)
|
848
850
|
);
|
849
851
|
},
|
850
|
-
...Ht(
|
852
|
+
...Ht(a.value.lifeCycles ?? {}, c)
|
851
853
|
});
|
852
854
|
return {
|
853
|
-
renderer: e.markRaw(
|
855
|
+
renderer: e.markRaw(u),
|
854
856
|
context: c
|
855
857
|
};
|
856
858
|
}
|
857
859
|
function At(n = []) {
|
858
|
-
return n.map((e) =>
|
860
|
+
return n.map((e) => C(e) ? e : e.name);
|
859
861
|
}
|
860
862
|
function It(n = [], e) {
|
861
863
|
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => it[o]) : void 0;
|
862
|
-
return n.map((s) =>
|
864
|
+
return n.map((s) => C(s) ? {
|
863
865
|
name: s
|
864
866
|
} : {
|
865
867
|
name: s.name,
|
866
868
|
type: s.type,
|
867
869
|
required: s.required,
|
868
|
-
default:
|
870
|
+
default: j(s.default) ? e.__parseExpression(s.default) : s.default
|
869
871
|
}).reduce(
|
870
872
|
(s, r) => (s[r.name] = {
|
871
873
|
type: t(r.type),
|
@@ -880,7 +882,7 @@ function Ft(n, e, t) {
|
|
880
882
|
Object.keys(e || {}).reduce(
|
881
883
|
(s, r) => {
|
882
884
|
let o = e[r];
|
883
|
-
return
|
885
|
+
return j(o) ? o = t.__parseExpression(o) : S(o) && (o = t.__parseFunction(o)), s[r] = o, s;
|
884
886
|
},
|
885
887
|
{}
|
886
888
|
)
|
@@ -901,10 +903,10 @@ function Mt(n, e) {
|
|
901
903
|
function Ot(n, e = [], t) {
|
902
904
|
return e.reduce(
|
903
905
|
(s, r) => {
|
904
|
-
const { name: o, from:
|
906
|
+
const { name: o, from: i } = r || {};
|
905
907
|
r.default;
|
906
|
-
const
|
907
|
-
return s[o] = n.inject(
|
908
|
+
const a = j(i) ? t.__parseExpression(i) || o : i ?? o, f = j(r.default) ? t.__parseExpression(r.default) : r.default ?? null;
|
909
|
+
return s[o] = n.inject(a, f), s;
|
908
910
|
},
|
909
911
|
{}
|
910
912
|
);
|
@@ -914,12 +916,12 @@ function Dt(n, e) {
|
|
914
916
|
(t, s) => {
|
915
917
|
const r = n[s];
|
916
918
|
if (r.type === "mock")
|
917
|
-
t[s] =
|
919
|
+
t[s] = Rt(r);
|
918
920
|
else if (r.ref) {
|
919
|
-
const o = e.$apis[r.ref],
|
920
|
-
t[s] = async (...
|
921
|
-
const
|
922
|
-
return
|
921
|
+
const o = e.$apis[r.ref], i = S(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
|
922
|
+
t[s] = async (...a) => {
|
923
|
+
const f = await o.apply(e, a);
|
924
|
+
return i ? i(f) : f;
|
923
925
|
};
|
924
926
|
}
|
925
927
|
return t;
|
@@ -944,131 +946,131 @@ function Ht(n, e) {
|
|
944
946
|
(t, [s, r]) => {
|
945
947
|
const o = e.__parseFunction(r);
|
946
948
|
return t[s] = async () => {
|
947
|
-
await
|
949
|
+
await J(0), q(o) && o();
|
948
950
|
}, t;
|
949
951
|
},
|
950
952
|
{}
|
951
953
|
);
|
952
954
|
}
|
953
955
|
const Oe = new Ze();
|
954
|
-
let
|
956
|
+
let Z = [], I = {};
|
955
957
|
const xt = (n) => n;
|
956
958
|
async function De(n, e = window) {
|
957
|
-
const { urls: t = [], library: s } = n, r = t.filter((
|
959
|
+
const { urls: t = [], library: s } = n, r = t.filter((a) => V(a));
|
958
960
|
if (r.length === 0 || !s) return null;
|
959
|
-
const o = t.filter((
|
960
|
-
return o.length &&
|
961
|
-
(
|
961
|
+
const o = t.filter((a) => G(a));
|
962
|
+
return o.length && Ie(o, e), await Fe(r, s, e).catch(
|
963
|
+
(a) => (console.warn("loadScriptUrl error", r, s, a), null)
|
962
964
|
);
|
963
965
|
}
|
964
|
-
function
|
966
|
+
function ie(n) {
|
965
967
|
const { getDsl: e, getDslByUrl: t, options: s } = n;
|
966
|
-
return s.window && (
|
968
|
+
return s.window && (Z.forEach((r) => {
|
967
969
|
delete s.window[r];
|
968
|
-
}),
|
970
|
+
}), Z = []), (r, o, i = z) => {
|
969
971
|
if (!o || typeof o == "string") return r;
|
970
972
|
if (o.type === "Schema" && o.id)
|
971
|
-
return
|
972
|
-
const
|
973
|
+
return i.defineAsyncComponent(async () => {
|
974
|
+
const a = I[o.id] || await Oe.add(
|
973
975
|
o.id,
|
974
976
|
() => e(o.id)
|
975
977
|
);
|
976
|
-
return
|
978
|
+
return a && (a.name = r, I[o.id] = a), a ? oe({
|
977
979
|
...s,
|
978
|
-
Vue:
|
979
|
-
dsl:
|
980
|
-
mode:
|
981
|
-
loader:
|
980
|
+
Vue: i,
|
981
|
+
dsl: _e(a),
|
982
|
+
mode: _.Runtime,
|
983
|
+
loader: ie(n)
|
982
984
|
}).renderer : null;
|
983
985
|
});
|
984
986
|
if (o.type === "UrlSchema" && o.url)
|
985
|
-
return
|
986
|
-
const
|
987
|
-
return
|
987
|
+
return i.defineAsyncComponent(async () => {
|
988
|
+
const a = I[o.url] || await t(o.url);
|
989
|
+
return a && (a.name = r, I[o.url] = a), a ? oe({
|
988
990
|
...s,
|
989
|
-
Vue:
|
990
|
-
dsl:
|
991
|
-
mode:
|
992
|
-
loader:
|
991
|
+
Vue: i,
|
992
|
+
dsl: _e(a),
|
993
|
+
mode: _.Runtime,
|
994
|
+
loader: ie(n)
|
993
995
|
}).renderer : null;
|
994
996
|
});
|
995
997
|
if (o.type === "Plugin") {
|
996
|
-
let
|
997
|
-
return
|
998
|
+
let a = o.library ? I[o.library] : null;
|
999
|
+
return a || (o.library && Z.push(o.library), a = I[o.library || Symbol()] = i.defineAsyncComponent(
|
998
1000
|
async () => {
|
999
|
-
const
|
1000
|
-
return
|
1001
|
+
const f = await De(o, s.window);
|
1002
|
+
return f || (console.warn("getPlugin result is null", o), null);
|
1001
1003
|
}
|
1002
|
-
),
|
1004
|
+
), a);
|
1003
1005
|
}
|
1004
1006
|
return r;
|
1005
1007
|
};
|
1006
1008
|
}
|
1007
|
-
function
|
1008
|
-
|
1009
|
+
function bs() {
|
1010
|
+
I = {}, Oe.clearAllCache();
|
1009
1011
|
}
|
1010
|
-
function
|
1012
|
+
function M(n, e, t = z, s = xt, r = [], o = !1) {
|
1011
1013
|
if (!n || !n.name || n.invisible) return null;
|
1012
|
-
const
|
1013
|
-
if (!o && (
|
1014
|
+
const i = t.getCurrentInstance()?.appContext, { id: a = null, directives: f = [] } = n, { vIf: c, vElseIf: u, vElse: l, vFor: h, vShow: p, vModels: d, vBind: v, vHtml: g, others: m } = Te(f);
|
1015
|
+
if (!o && (u || l))
|
1014
1016
|
return null;
|
1015
1017
|
if (c && !Nt(c, e))
|
1016
|
-
return
|
1017
|
-
const
|
1018
|
-
const
|
1018
|
+
return Jt(n, e, t, s, r);
|
1019
|
+
const b = (y, x = 0) => {
|
1020
|
+
const A = y.$components, Q = (() => {
|
1019
1021
|
if (n.name === "component")
|
1020
1022
|
return Ut(y, n.props?.is);
|
1021
1023
|
if (n.name === "slot") return n.name;
|
1022
|
-
const
|
1023
|
-
if (
|
1024
|
-
return vt(
|
1025
|
-
if (et(
|
1026
|
-
const
|
1027
|
-
return
|
1024
|
+
const $ = s(n.name, n.from, t);
|
1025
|
+
if (C($))
|
1026
|
+
return vt($) || yt($) ? $ : A[$] ?? i?.app?.component($) ?? $;
|
1027
|
+
if (et($) && n.id) {
|
1028
|
+
const me = `Loader${n.id}_${x}`, ge = A[me];
|
1029
|
+
return ge || (A[me] = $);
|
1028
1030
|
}
|
1029
|
-
return
|
1030
|
-
})(),
|
1031
|
+
return $;
|
1032
|
+
})(), R = Lt(a, n.props ?? {}, y), Le = qt(t, n.events ?? {}, y);
|
1031
1033
|
if (n.name === "slot")
|
1032
|
-
return Kt(t, n,
|
1033
|
-
v && Object.assign(
|
1034
|
-
|
1035
|
-
Gt(
|
1036
|
-
)), g && Object.assign(
|
1037
|
-
Object.assign(
|
1034
|
+
return Kt(t, n, R, y, s);
|
1035
|
+
v && Object.assign(R, y.__parseExpression(v.value)), p && (R.style = Object.assign(
|
1036
|
+
R.style ?? {},
|
1037
|
+
Gt(p, y)
|
1038
|
+
)), g && Object.assign(R, Vt(g, y)), d.forEach(($) => {
|
1039
|
+
Object.assign(R, Qt(t, $, y));
|
1038
1040
|
});
|
1039
|
-
const
|
1041
|
+
const qe = Wt(
|
1040
1042
|
t,
|
1041
1043
|
n.children ?? [],
|
1042
1044
|
y,
|
1043
1045
|
s,
|
1044
1046
|
n
|
1045
|
-
),
|
1046
|
-
let
|
1047
|
-
|
1048
|
-
{ key: `${
|
1049
|
-
|
1047
|
+
), de = y?.__id ? `data-v-${y.__id}` : void 0, Je = de ? { [de]: "" } : {};
|
1048
|
+
let W = t.createVNode(
|
1049
|
+
Q,
|
1050
|
+
{ key: `${a}_${x}`, ...Je, ...R, ...Le },
|
1051
|
+
qe
|
1050
1052
|
);
|
1051
|
-
const
|
1052
|
-
return
|
1053
|
+
const he = i ? Bt(i, m, y) : [];
|
1054
|
+
return he.length && (W = t.withDirectives(W, he)), W;
|
1053
1055
|
};
|
1054
|
-
return h ? Zt(h,
|
1056
|
+
return h ? Zt(h, b, e) : b(e);
|
1055
1057
|
}
|
1056
1058
|
function Bt(n, e, t) {
|
1057
1059
|
const s = n.app;
|
1058
1060
|
return e.map((r) => {
|
1059
1061
|
const o = typeof r.name == "string" ? s.directive(r.name) : t.__parseExpression(r.name);
|
1060
1062
|
if (!o) return null;
|
1061
|
-
const
|
1062
|
-
return r.value &&
|
1063
|
+
const i = [o];
|
1064
|
+
return r.value && i.push(t.__parseExpression(r.value)), r.arg && i.push(r.arg), r.modifiers && i.push(r.modifiers), i;
|
1063
1065
|
}).filter((r) => !!r);
|
1064
1066
|
}
|
1065
1067
|
function Te(n = []) {
|
1066
|
-
const e = n.find((
|
1067
|
-
(
|
1068
|
-
), s = n.find((
|
1069
|
-
(
|
1068
|
+
const e = n.find((u) => P(u.name) === "vIf"), t = n.find(
|
1069
|
+
(u) => P(u.name) === "vElseIf"
|
1070
|
+
), 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"), f = n.filter(
|
1071
|
+
(u) => P(u.name) === "vModel"
|
1070
1072
|
), c = n.filter(
|
1071
|
-
(
|
1073
|
+
(u) => !ot.includes(P(u.name))
|
1072
1074
|
);
|
1073
1075
|
return {
|
1074
1076
|
vIf: e,
|
@@ -1076,56 +1078,56 @@ function Te(n = []) {
|
|
1076
1078
|
vElse: s,
|
1077
1079
|
vFor: r,
|
1078
1080
|
vShow: o,
|
1079
|
-
vModels:
|
1080
|
-
vBind:
|
1081
|
+
vModels: f,
|
1082
|
+
vBind: i,
|
1081
1083
|
others: c,
|
1082
|
-
vHtml:
|
1084
|
+
vHtml: a
|
1083
1085
|
};
|
1084
1086
|
}
|
1085
1087
|
function Nt(n, e) {
|
1086
1088
|
return !!e.__parseExpression(n.value);
|
1087
1089
|
}
|
1088
1090
|
function Ut(n, e) {
|
1089
|
-
return e ?
|
1091
|
+
return e ? j(e) ? n.__parseExpression(e) : e : "div";
|
1090
1092
|
}
|
1091
1093
|
function Lt(n, e, t) {
|
1092
|
-
const s =
|
1094
|
+
const s = ae(e, t);
|
1093
1095
|
return s.ref = t.__ref(n, s.ref), s;
|
1094
1096
|
}
|
1095
|
-
function
|
1096
|
-
return
|
1097
|
+
function ae(n, e) {
|
1098
|
+
return j(n) ? e.__parseExpression(n) : S(n) ? e.__parseFunction(n) : Array.isArray(n) ? n.map((t) => ae(t, e)) : typeof n == "object" ? Object.keys(n || {}).reduce(
|
1097
1099
|
(t, s) => {
|
1098
1100
|
let r = n[s];
|
1099
|
-
return t[s] =
|
1101
|
+
return t[s] = ae(r, e), t;
|
1100
1102
|
},
|
1101
1103
|
{}
|
1102
1104
|
) : n;
|
1103
1105
|
}
|
1104
|
-
function
|
1106
|
+
function qt(n, e, t) {
|
1105
1107
|
const s = ["passive", "capture", "once"], r = {
|
1106
1108
|
capture: "Capture",
|
1107
1109
|
once: "Once",
|
1108
1110
|
passive: "OnceCapture"
|
1109
1111
|
};
|
1110
1112
|
return Object.keys(e || {}).reduce(
|
1111
|
-
(o,
|
1112
|
-
const
|
1113
|
-
return
|
1113
|
+
(o, i) => {
|
1114
|
+
const a = e[i], f = He(a.modifiers), c = f.find((h) => s.includes(h)), u = "on" + tt(i) + (c && r[c] || ""), l = t.__parseFunction(a.handler);
|
1115
|
+
return l && (o[u] = n.withModifiers(l, f)), o;
|
1114
1116
|
},
|
1115
1117
|
{}
|
1116
1118
|
);
|
1117
1119
|
}
|
1118
|
-
function
|
1119
|
-
let o = r.findIndex((
|
1120
|
-
for (let
|
1121
|
-
const { directives:
|
1122
|
-
if (
|
1123
|
-
if (e.__parseExpression(
|
1124
|
-
return
|
1120
|
+
function Jt(n, e, t, s, r = []) {
|
1121
|
+
let o = r.findIndex((i) => i.id === n.id);
|
1122
|
+
for (let i = ++o; i < r.length; i++) {
|
1123
|
+
const { directives: a = [] } = r[i], { vElseIf: f, vElse: c } = Te(a);
|
1124
|
+
if (f) {
|
1125
|
+
if (e.__parseExpression(f.value))
|
1126
|
+
return M(r[i], e, t, s, r, !0);
|
1125
1127
|
continue;
|
1126
1128
|
}
|
1127
1129
|
if (c)
|
1128
|
-
return
|
1130
|
+
return M(r[i], e, t, s, r, !0);
|
1129
1131
|
}
|
1130
1132
|
return null;
|
1131
1133
|
}
|
@@ -1134,17 +1136,17 @@ function He(n = {}, e = !1) {
|
|
1134
1136
|
return e ? t.map((s) => "." + s) : t;
|
1135
1137
|
}
|
1136
1138
|
function Kt(n, e, t, s, r) {
|
1137
|
-
const { children: o } = e,
|
1138
|
-
return
|
1139
|
-
|
1139
|
+
const { children: o } = e, i = zt(e, s), a = s.$slots?.[i.name];
|
1140
|
+
return a ? a(t) : o ? C(o) ? n.createTextVNode(o) : j(o) ? n.createTextVNode(
|
1141
|
+
Ae(s.__parseExpression(o))
|
1140
1142
|
) : Array.isArray(o) ? o.map(
|
1141
|
-
(
|
1143
|
+
(f) => M(f, s, n, r, o)
|
1142
1144
|
) : null : null;
|
1143
1145
|
}
|
1144
1146
|
function zt(n, e) {
|
1145
1147
|
const { props: t } = n, s = t?.name || "default";
|
1146
1148
|
return {
|
1147
|
-
name:
|
1149
|
+
name: j(s) ? e.__parseExpression(s) : s,
|
1148
1150
|
params: []
|
1149
1151
|
};
|
1150
1152
|
}
|
@@ -1158,41 +1160,41 @@ function Vt(n, e) {
|
|
1158
1160
|
innerHTML: e.__parseExpression(n.value) || ""
|
1159
1161
|
};
|
1160
1162
|
}
|
1161
|
-
function
|
1163
|
+
function Qt(n, e, t) {
|
1162
1164
|
const s = {
|
1163
1165
|
type: "JSFunction",
|
1164
1166
|
value: e.value?.value ? `(v) => {
|
1165
1167
|
${e.value.value} = v;
|
1166
1168
|
}` : "(v) => {}"
|
1167
1169
|
}, r = t.__parseFunction(s), o = He(
|
1168
|
-
|
1169
|
-
),
|
1170
|
+
j(e.modifiers) ? t.__parseExpression(e.modifiers) : e.modifiers
|
1171
|
+
), i = j(e.arg) ? t.__parseExpression(e.arg) : e.arg || "modelValue";
|
1170
1172
|
return {
|
1171
|
-
[
|
1172
|
-
[`onUpdate:${
|
1173
|
+
[i]: t.__parseExpression(e.value),
|
1174
|
+
[`onUpdate:${i}`]: o.length && r ? n.withModifiers(r, o) : r
|
1173
1175
|
};
|
1174
1176
|
}
|
1175
|
-
function
|
1177
|
+
function Wt(n, e, t, s, r) {
|
1176
1178
|
if (!e) return null;
|
1177
|
-
if (
|
1179
|
+
if (C(e))
|
1178
1180
|
return { default: () => e };
|
1179
|
-
if (
|
1181
|
+
if (j(e))
|
1180
1182
|
return {
|
1181
|
-
default: () =>
|
1183
|
+
default: () => Ae(t.__parseExpression(e))
|
1182
1184
|
};
|
1183
1185
|
if (Array.isArray(e) && e.length > 0) {
|
1184
|
-
const o = Xt(e),
|
1185
|
-
[
|
1186
|
+
const o = Xt(e), i = (a, f) => !a || !r ? {} : r?.id && Object.keys(a).length ? f ? {
|
1187
|
+
[f]: a
|
1186
1188
|
} : {
|
1187
|
-
[`scope_${r.id}`]:
|
1188
|
-
} :
|
1189
|
+
[`scope_${r.id}`]: a
|
1190
|
+
} : f ? { [f]: /* @__PURE__ */ Object.create(null) } : {};
|
1189
1191
|
return Object.entries(o).reduce(
|
1190
|
-
(
|
1191
|
-
const
|
1192
|
+
(a, [f, { nodes: c, params: u, scope: l }]) => (a[f] = (h) => {
|
1193
|
+
const p = u.length ? st(h ?? {}, u) : i(h, l);
|
1192
1194
|
return c.map(
|
1193
|
-
(d) =>
|
1195
|
+
(d) => M(d, t.__clone(p), n, s, c)
|
1194
1196
|
);
|
1195
|
-
},
|
1197
|
+
}, a),
|
1196
1198
|
{}
|
1197
1199
|
);
|
1198
1200
|
}
|
@@ -1211,21 +1213,21 @@ function Xt(n) {
|
|
1211
1213
|
return e;
|
1212
1214
|
}
|
1213
1215
|
function Yt(n = "default") {
|
1214
|
-
return
|
1216
|
+
return C(n) ? { name: n, params: [], scope: "" } : { params: [], scope: "", ...n };
|
1215
1217
|
}
|
1216
1218
|
function Zt(n, e, t) {
|
1217
|
-
const { value: s, iterator: r } = n, { item: o = "item", index:
|
1218
|
-
let
|
1219
|
-
return Number.isInteger(
|
1219
|
+
const { value: s, iterator: r } = n, { item: o = "item", index: i = "index" } = r || {};
|
1220
|
+
let a = t.__parseExpression(s) || [];
|
1221
|
+
return Number.isInteger(a) && (a = new Array(a).fill(!0).map((f, c) => c + 1)), Array.isArray(a) ? a.map((f, c) => e(t.__clone({ [o]: f, [i]: c }), c)) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
1220
1222
|
}
|
1221
|
-
const
|
1223
|
+
const ee = Pe({
|
1222
1224
|
name: "VtjPageContainer",
|
1223
1225
|
async setup() {
|
1224
|
-
const n = Ne(), e =
|
1226
|
+
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, o = re(Symbol());
|
1225
1227
|
if (s) {
|
1226
1228
|
Object.assign(e.meta, s.meta || {}, { cache: s.cache });
|
1227
|
-
const { useTitle:
|
1228
|
-
|
1229
|
+
const { useTitle: i } = n?.adapter;
|
1230
|
+
i && i(s.title || "VTJ");
|
1229
1231
|
}
|
1230
1232
|
return {
|
1231
1233
|
provider: n,
|
@@ -1239,34 +1241,34 @@ const Y = Re({
|
|
1239
1241
|
},
|
1240
1242
|
render() {
|
1241
1243
|
const { component: n, query: e, sid: t } = this;
|
1242
|
-
return n ?
|
1244
|
+
return n ? ne(n, { ...e, key: t }) : ne("div", "页面不存在");
|
1243
1245
|
},
|
1244
1246
|
activated() {
|
1245
1247
|
this.meta.cache === !1 && (this.sid = Symbol());
|
1246
1248
|
}
|
1247
|
-
}), es =
|
1249
|
+
}), es = Pe({
|
1248
1250
|
name: "VtjStartupContainer",
|
1249
1251
|
render() {
|
1250
|
-
return
|
1252
|
+
return ne("div", "page not found!");
|
1251
1253
|
}
|
1252
1254
|
});
|
1253
|
-
function
|
1255
|
+
function K(n, e, t = []) {
|
1254
1256
|
const s = [];
|
1255
1257
|
for (const r of t) {
|
1256
|
-
const { id: o, title:
|
1257
|
-
if (
|
1258
|
-
const
|
1259
|
-
s.push(...
|
1258
|
+
const { id: o, title: i, icon: a, children: f, hidden: c, layout: u } = r;
|
1259
|
+
if (u) {
|
1260
|
+
const l = K(n, e, f || []);
|
1261
|
+
s.push(...l);
|
1260
1262
|
} else {
|
1261
|
-
const
|
1263
|
+
const l = {
|
1262
1264
|
id: o,
|
1263
|
-
title:
|
1264
|
-
icon:
|
1265
|
+
title: i,
|
1266
|
+
icon: a,
|
1265
1267
|
hidden: c,
|
1266
1268
|
url: `${n}/${e}/${o}`,
|
1267
|
-
children:
|
1269
|
+
children: f && f.length ? K(n, e, f) : void 0
|
1268
1270
|
};
|
1269
|
-
s.push(
|
1271
|
+
s.push(l);
|
1270
1272
|
}
|
1271
1273
|
}
|
1272
1274
|
return s;
|
@@ -1282,114 +1284,161 @@ function xe(n, e) {
|
|
1282
1284
|
e.can(s.id.toString()) && t.push(s);
|
1283
1285
|
return t;
|
1284
1286
|
}
|
1285
|
-
function
|
1287
|
+
function Rs(n) {
|
1286
1288
|
const {
|
1287
1289
|
menuPathPrefix: e = "",
|
1288
1290
|
pageRouteName: t = "page",
|
1289
1291
|
disableMenusFilter: s = !1
|
1290
|
-
} = n || {}, r = Ne(), o =
|
1291
|
-
|
1292
|
+
} = n || {}, r = Ne(), o = Ce(), i = St(), a = re(!1), f = re(!1), c = r.project, u = (p) => {
|
1293
|
+
a.value = !p?.mask, f.value = !!p?.pure;
|
1292
1294
|
};
|
1293
1295
|
rt(() => {
|
1294
|
-
const { name:
|
1295
|
-
if (
|
1296
|
+
const { name: p, params: d, meta: v } = o;
|
1297
|
+
if (p === D) {
|
1296
1298
|
const g = r.getPage(d.id);
|
1297
|
-
|
1298
|
-
} else if (
|
1299
|
+
u(g);
|
1300
|
+
} else if (p === U) {
|
1299
1301
|
const g = r.getHomepage();
|
1300
|
-
|
1302
|
+
u(g);
|
1301
1303
|
} else {
|
1302
1304
|
const g = v.__vtj__;
|
1303
1305
|
if (g) {
|
1304
1306
|
const m = r.getPage(g);
|
1305
|
-
|
1307
|
+
u(m);
|
1306
1308
|
} else
|
1307
|
-
|
1309
|
+
a.value = !v.mask, f.value = !!v.pure;
|
1308
1310
|
}
|
1309
1311
|
});
|
1310
|
-
const
|
1312
|
+
const l = K(
|
1311
1313
|
e,
|
1312
1314
|
t,
|
1313
1315
|
c?.pages
|
1314
1316
|
), h = c?.config;
|
1315
1317
|
return {
|
1316
|
-
disabled:
|
1318
|
+
disabled: a,
|
1317
1319
|
logo: h?.logo,
|
1318
1320
|
themeSwitchable: h?.themeSwitchable,
|
1319
1321
|
title: h?.title || c?.description || c?.name || "VTJ App",
|
1320
|
-
menus: s ?
|
1321
|
-
pure:
|
1322
|
+
menus: s ? l : xe(l, i),
|
1323
|
+
pure: f
|
1322
1324
|
};
|
1323
1325
|
}
|
1324
|
-
function
|
1325
|
-
const { id: t, title: s, meta: r } = n, { name: o = "page", prefix:
|
1326
|
+
function te(n, e) {
|
1327
|
+
const { id: t, title: s, meta: r } = n, { name: o = "page", prefix: i = "", component: a, routeMeta: f } = e;
|
1326
1328
|
return {
|
1327
1329
|
name: t,
|
1328
|
-
path: `${
|
1329
|
-
component:
|
1330
|
+
path: `${i}${o}/${t}`,
|
1331
|
+
component: a,
|
1330
1332
|
meta: {
|
1331
1333
|
title: s,
|
1332
|
-
...
|
1334
|
+
...f,
|
1333
1335
|
...r,
|
1334
1336
|
__vtj__: t
|
1335
1337
|
}
|
1336
1338
|
};
|
1337
1339
|
}
|
1338
|
-
function
|
1340
|
+
function ce(n) {
|
1339
1341
|
const {
|
1340
1342
|
name: e = "page",
|
1341
1343
|
prefix: t = "",
|
1342
1344
|
pages: s = [],
|
1343
1345
|
component: r,
|
1344
1346
|
loader: o,
|
1345
|
-
routeMeta:
|
1346
|
-
homepage:
|
1347
|
-
} = n,
|
1347
|
+
routeMeta: i,
|
1348
|
+
homepage: a
|
1349
|
+
} = n, f = [];
|
1348
1350
|
for (const c of s) {
|
1349
|
-
const { id:
|
1351
|
+
const { id: u, title: l, dir: h, layout: p, children: d, meta: v } = c;
|
1350
1352
|
if (h) {
|
1351
|
-
const g =
|
1353
|
+
const g = ce({
|
1352
1354
|
name: e,
|
1353
1355
|
prefix: t,
|
1354
1356
|
component: r,
|
1355
|
-
routeMeta:
|
1356
|
-
homepage:
|
1357
|
+
routeMeta: i,
|
1358
|
+
homepage: a,
|
1357
1359
|
loader: o,
|
1358
1360
|
pages: d || []
|
1359
1361
|
});
|
1360
|
-
|
1361
|
-
} else if (
|
1362
|
-
const g =
|
1362
|
+
f.push(...g);
|
1363
|
+
} else if (p) {
|
1364
|
+
const g = ce({
|
1363
1365
|
name: e,
|
1364
1366
|
prefix: t,
|
1365
1367
|
component: r,
|
1366
|
-
routeMeta:
|
1367
|
-
homepage:
|
1368
|
+
routeMeta: i,
|
1369
|
+
homepage: a,
|
1368
1370
|
loader: o,
|
1369
1371
|
pages: d || []
|
1370
1372
|
}), m = {
|
1371
|
-
name: `layout_${
|
1373
|
+
name: `layout_${u}`,
|
1372
1374
|
path: t,
|
1373
|
-
component: () => o(
|
1375
|
+
component: () => o(u),
|
1374
1376
|
meta: {
|
1375
|
-
title:
|
1376
|
-
...
|
1377
|
+
title: l,
|
1378
|
+
...i,
|
1377
1379
|
...v,
|
1378
|
-
__vtj__:
|
1380
|
+
__vtj__: u
|
1379
1381
|
},
|
1380
1382
|
children: g
|
1381
1383
|
};
|
1382
|
-
|
1383
|
-
} else if (
|
1384
|
-
const g =
|
1385
|
-
g.path = "", g.name = `home_${
|
1384
|
+
f.push(m), f.push(te(c, n));
|
1385
|
+
} else if (f.push(te(c, n)), a === u) {
|
1386
|
+
const g = te(c, n);
|
1387
|
+
g.path = "", g.name = `home_${u}`, f.push(g);
|
1386
1388
|
}
|
1387
1389
|
}
|
1388
|
-
return
|
1390
|
+
return f;
|
1391
|
+
}
|
1392
|
+
function ts(n = {}, e) {
|
1393
|
+
const { css: t, store: s, enhance: r } = n, { window: o, app: i, library: a = {}, adapter: f, mode: c } = e, { Pinia: u } = a;
|
1394
|
+
le(o, "global-css", t || ""), u && s && ss(s, i, u), rs(i, f, n), !f.access && n.access && ns(n.access, i, c, f), os(i, n), r && is(r, i);
|
1395
|
+
}
|
1396
|
+
function ss(n, e, t) {
|
1397
|
+
const s = t.createPinia();
|
1398
|
+
if (e.use(s), S(n) && n.value) {
|
1399
|
+
const r = E(n, {}, !1, !1, !0), o = t.defineStore("$store", r(e) || {});
|
1400
|
+
e.config.globalProperties.$store = o();
|
1401
|
+
}
|
1402
|
+
}
|
1403
|
+
function ns(n, e, t, s) {
|
1404
|
+
if (S(n) && n.value) {
|
1405
|
+
const r = E(n, {}, !1, !1, !0), o = new fe(r(e)), i = e.config.globalProperties.$router, a = s.request;
|
1406
|
+
o.connect({ mode: t, router: i, request: a }), e.use(o);
|
1407
|
+
}
|
1408
|
+
}
|
1409
|
+
function rs(n, e, t) {
|
1410
|
+
if (!e.request) return;
|
1411
|
+
const { axios: s, request: r, response: o } = t;
|
1412
|
+
if (s && S(s) && s.value) {
|
1413
|
+
const i = E(s, {}, !1, !1, !0);
|
1414
|
+
e.request.setConfig(i(n));
|
1415
|
+
}
|
1416
|
+
if (r && S(r) && r.value) {
|
1417
|
+
const i = E(r, {}, !1, !1, !0);
|
1418
|
+
e.request.useRequest((a) => i(a, n));
|
1419
|
+
}
|
1420
|
+
if (o && S(o) && o.value) {
|
1421
|
+
const i = E(o, {}, !1, !1, !0);
|
1422
|
+
e.request.useResponse((a) => i(a, n));
|
1423
|
+
}
|
1424
|
+
}
|
1425
|
+
function os(n, e) {
|
1426
|
+
const { beforeEach: t, afterEach: s } = e, r = n.config.globalProperties.$router;
|
1427
|
+
if (t && S(t) && t.value) {
|
1428
|
+
const o = E(t, {}, !1, !1, !0);
|
1429
|
+
r && r.beforeEach((i, a, f) => o(i, a, f, n));
|
1430
|
+
}
|
1431
|
+
if (s && S(s) && s.value) {
|
1432
|
+
const o = E(s, {}, !1, !1, !0);
|
1433
|
+
r && r.afterEach((i, a, f) => o(i, a, f, n));
|
1434
|
+
}
|
1435
|
+
}
|
1436
|
+
function is(n, e) {
|
1437
|
+
S(n) && n.value && E(n, {}, !1, !1, !0)(e);
|
1389
1438
|
}
|
1390
1439
|
const Be = Symbol("Provider");
|
1391
|
-
var
|
1392
|
-
class
|
1440
|
+
var as = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(as || {});
|
1441
|
+
class cs extends Ke {
|
1393
1442
|
// DSL缓存
|
1394
1443
|
/**
|
1395
1444
|
* 创建Provider实例
|
@@ -1399,21 +1448,21 @@ class ss extends Ke {
|
|
1399
1448
|
super(), this.options = e;
|
1400
1449
|
const {
|
1401
1450
|
service: t,
|
1402
|
-
mode: s =
|
1451
|
+
mode: s = _.Raw,
|
1403
1452
|
dependencies: r,
|
1404
1453
|
materials: o,
|
1405
|
-
project:
|
1406
|
-
adapter:
|
1407
|
-
globals:
|
1454
|
+
project: i = {},
|
1455
|
+
adapter: a = {},
|
1456
|
+
globals: f = {},
|
1408
1457
|
modules: c = {},
|
1409
|
-
router:
|
1410
|
-
materialPath:
|
1458
|
+
router: u = null,
|
1459
|
+
materialPath: l = "./",
|
1411
1460
|
nodeEnv: h = "development"
|
1412
1461
|
/* Development */
|
1413
1462
|
} = e;
|
1414
|
-
this.mode = s, this.modules = c, this.service = t, this.router =
|
1415
|
-
const { access:
|
1416
|
-
|
1463
|
+
this.mode = s, this.modules = c, this.service = t, this.router = u, this.materialPath = l, this.nodeEnv = h, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, f), Object.assign(this.adapter, a);
|
1464
|
+
const { access: p, request: d } = this.adapter;
|
1465
|
+
p && p.connect({ mode: s, router: u, request: d }), i && s !== _.Design ? this.load(i) : this.project = i;
|
1417
1466
|
}
|
1418
1467
|
mode;
|
1419
1468
|
// 当前运行模式(设计/源码/预览等)
|
@@ -1421,7 +1470,7 @@ class ss extends Ke {
|
|
1421
1470
|
// 全局变量
|
1422
1471
|
modules = {};
|
1423
1472
|
// 异步模块加载器
|
1424
|
-
adapter = { request:
|
1473
|
+
adapter = { request: se, jsonp: be };
|
1425
1474
|
// 适配器接口
|
1426
1475
|
apis = {};
|
1427
1476
|
// API集合
|
@@ -1451,9 +1500,9 @@ class ss extends Ke {
|
|
1451
1500
|
try {
|
1452
1501
|
s = await e.apply(e, t);
|
1453
1502
|
} catch (o) {
|
1454
|
-
|
1503
|
+
k.warn("模拟数据模版异常", o);
|
1455
1504
|
}
|
1456
|
-
return
|
1505
|
+
return T()?.mock(s);
|
1457
1506
|
};
|
1458
1507
|
}
|
1459
1508
|
/**
|
@@ -1469,11 +1518,11 @@ class ss extends Ke {
|
|
1469
1518
|
const { vtjDir: t = ".vtj" } = this.options, s = this.modules[`${t}/projects/${e.id}.json`] || this.modules[`/src/${t}/projects/${e.id}.json`];
|
1470
1519
|
if (this.project = s ? await s() : await this.service.init(e), !this.project)
|
1471
1520
|
throw new Error("project is null");
|
1472
|
-
const { apis: r = [], meta: o = [] } = this.project,
|
1473
|
-
|
1521
|
+
const { apis: r = [], meta: o = [] } = this.project, i = window;
|
1522
|
+
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), Me(i), bt(r, i), e.platform !== "uniapp" && this.initRouter(), this.triggerReady();
|
1474
1523
|
}
|
1475
1524
|
initMock(e) {
|
1476
|
-
const t =
|
1525
|
+
const t = T(e);
|
1477
1526
|
t && t.setup({
|
1478
1527
|
timeout: "50-500"
|
1479
1528
|
});
|
@@ -1484,45 +1533,45 @@ class ss extends Ke {
|
|
1484
1533
|
e[s] || (e[s] = this.library[s] = await r());
|
1485
1534
|
}
|
1486
1535
|
async loadAssets(e) {
|
1487
|
-
const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath:
|
1488
|
-
libraryExports:
|
1536
|
+
const { dependencies: t = [] } = this.project, { dependencies: s, library: r, components: o, materialPath: i, nodeEnv: a } = this, {
|
1537
|
+
libraryExports: f,
|
1489
1538
|
libraryMap: c,
|
1490
|
-
materials:
|
1491
|
-
materialExports:
|
1539
|
+
materials: u,
|
1540
|
+
materialExports: l,
|
1492
1541
|
materialMapLibrary: h
|
1493
|
-
} =
|
1542
|
+
} = ft(
|
1494
1543
|
t,
|
1495
|
-
|
1496
|
-
|
1544
|
+
i,
|
1545
|
+
a === "development"
|
1497
1546
|
/* Development */
|
1498
1547
|
);
|
1499
|
-
for (const
|
1500
|
-
const d = s[
|
1548
|
+
for (const p of f) {
|
1549
|
+
const d = s[p], v = e[p];
|
1501
1550
|
if (v)
|
1502
|
-
r[
|
1551
|
+
r[p] = v;
|
1503
1552
|
else if (d)
|
1504
|
-
e[
|
1553
|
+
e[p] = r[p] = await d();
|
1505
1554
|
else {
|
1506
|
-
const g = c[
|
1555
|
+
const g = c[p] || [];
|
1507
1556
|
for (const m of g)
|
1508
|
-
|
1509
|
-
r[
|
1557
|
+
G(m) && await mt(m, F.append(m, { v: O })), V(m) && await we(F.append(m, { v: O }));
|
1558
|
+
r[p] = e[p];
|
1510
1559
|
}
|
1511
1560
|
}
|
1512
|
-
if (
|
1513
|
-
for (const d of
|
1514
|
-
await
|
1515
|
-
const
|
1516
|
-
for (const d of
|
1561
|
+
if (a === "development") {
|
1562
|
+
for (const d of u)
|
1563
|
+
await we(F.append(d, { v: O }));
|
1564
|
+
const p = this.materials || {};
|
1565
|
+
for (const d of l) {
|
1517
1566
|
const v = e[h[d]], g = ze[d];
|
1518
1567
|
if (g)
|
1519
1568
|
v && g.forEach((m) => {
|
1520
1569
|
o[m] = v[m];
|
1521
1570
|
});
|
1522
1571
|
else {
|
1523
|
-
const m =
|
1524
|
-
m && v && (m.components || []).forEach((
|
1525
|
-
o[
|
1572
|
+
const m = p[d] ? (await p[d]()).default : e[d];
|
1573
|
+
m && v && (m.components || []).forEach((b) => {
|
1574
|
+
o[b.name] = pt(b, v);
|
1526
1575
|
});
|
1527
1576
|
}
|
1528
1577
|
}
|
@@ -1532,33 +1581,33 @@ class ss extends Ke {
|
|
1532
1581
|
const { router: e, project: t, options: s, adapter: r } = this;
|
1533
1582
|
if (!e) return;
|
1534
1583
|
const o = t?.platform === "uniapp" ? "pages" : "page", {
|
1535
|
-
routeAppendTo:
|
1536
|
-
pageRouteName:
|
1537
|
-
routeMeta:
|
1538
|
-
} = s, c =
|
1539
|
-
path: `${c}${
|
1540
|
-
name:
|
1541
|
-
component:
|
1542
|
-
},
|
1584
|
+
routeAppendTo: i,
|
1585
|
+
pageRouteName: a = o,
|
1586
|
+
routeMeta: f
|
1587
|
+
} = s, c = i ? "" : "/", u = {
|
1588
|
+
path: `${c}${a}/:id`,
|
1589
|
+
name: D,
|
1590
|
+
component: ee
|
1591
|
+
}, l = {
|
1543
1592
|
path: c,
|
1544
|
-
name:
|
1545
|
-
component: t?.homepage ?
|
1546
|
-
meta:
|
1593
|
+
name: U,
|
1594
|
+
component: t?.homepage ? ee : r.startupComponent || es,
|
1595
|
+
meta: f
|
1547
1596
|
};
|
1548
|
-
if (e.hasRoute(
|
1597
|
+
if (e.hasRoute(D) && e.removeRoute(D), e.hasRoute(U) && e.removeRoute(U), s.enableStaticRoute) {
|
1549
1598
|
const h = t?.pages || [];
|
1550
|
-
|
1551
|
-
name:
|
1599
|
+
ce({
|
1600
|
+
name: a,
|
1552
1601
|
prefix: c,
|
1553
1602
|
pages: h,
|
1554
|
-
component:
|
1603
|
+
component: ee,
|
1555
1604
|
loader: this.getRenderComponent.bind(this),
|
1556
1605
|
homepage: t?.homepage
|
1557
1606
|
}).forEach((d) => {
|
1558
|
-
|
1559
|
-
}), t?.homepage || (
|
1607
|
+
i ? e.addRoute(i, d) : e.addRoute(d);
|
1608
|
+
}), t?.homepage || (i ? e.addRoute(i, l) : e.addRoute(l));
|
1560
1609
|
} else
|
1561
|
-
|
1610
|
+
i ? (e.addRoute(i, u), e.addRoute(i, l)) : (e.addRoute(u), e.addRoute(l));
|
1562
1611
|
}
|
1563
1612
|
/**
|
1564
1613
|
* Vue 插件安装方法
|
@@ -1574,8 +1623,14 @@ class ss extends Ke {
|
|
1574
1623
|
const t = e.config.globalProperties.installed || {};
|
1575
1624
|
for (const [s, r] of Object.entries(this.library))
|
1576
1625
|
!t[s] && gt(r) && (e.use(r), t[s] = !0);
|
1577
|
-
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Be, this), e.config.globalProperties.$provider = this,
|
1578
|
-
|
1626
|
+
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(Be, this), e.config.globalProperties.$provider = this, this.project?.platform !== "uniapp" && this.initGlobals(this.project?.globals || {}, {
|
1627
|
+
app: e,
|
1628
|
+
window,
|
1629
|
+
adapter: this.adapter,
|
1630
|
+
library: this.library,
|
1631
|
+
mode: this.mode
|
1632
|
+
}), this.options.enhance && e.use(this.options.enhance, this), this.mode === _.Design && (e.config.errorHandler = (s, r, o) => {
|
1633
|
+
const i = r?.$options.name, a = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", f = `[ ${i} ] ${a} ${o}`;
|
1579
1634
|
console.error(
|
1580
1635
|
"[VTJ Error]:",
|
1581
1636
|
{
|
@@ -1584,8 +1639,8 @@ class ss extends Ke {
|
|
1584
1639
|
info: o
|
1585
1640
|
},
|
1586
1641
|
s?.stack
|
1587
|
-
), this.adapter.notify && this.adapter.notify(
|
1588
|
-
}),
|
1642
|
+
), this.adapter.notify && this.adapter.notify(f, "组件渲染错误", "error");
|
1643
|
+
}), e.config.globalProperties.installed = t;
|
1589
1644
|
}
|
1590
1645
|
getFile(e) {
|
1591
1646
|
const { blocks: t = [] } = this.project || {};
|
@@ -1593,20 +1648,20 @@ class ss extends Ke {
|
|
1593
1648
|
}
|
1594
1649
|
getPage(e) {
|
1595
1650
|
const { pages: t = [] } = this.project || {}, s = (r, o = []) => {
|
1596
|
-
for (const
|
1597
|
-
if (
|
1598
|
-
return
|
1599
|
-
if (
|
1600
|
-
const
|
1601
|
-
if (
|
1602
|
-
return
|
1651
|
+
for (const i of o) {
|
1652
|
+
if (i.id === r)
|
1653
|
+
return i;
|
1654
|
+
if (i.children && i.children.length) {
|
1655
|
+
const a = s(r, i.children);
|
1656
|
+
if (a)
|
1657
|
+
return a;
|
1603
1658
|
}
|
1604
1659
|
}
|
1605
1660
|
};
|
1606
1661
|
return s(e, t) || null;
|
1607
1662
|
}
|
1608
1663
|
getMenus(e = "page", t = "") {
|
1609
|
-
return
|
1664
|
+
return K(t, e, this.project?.pages || []);
|
1610
1665
|
}
|
1611
1666
|
getHomepage() {
|
1612
1667
|
const { homepage: e } = this.project || {};
|
@@ -1637,23 +1692,23 @@ class ss extends Ke {
|
|
1637
1692
|
* @returns 渲染器实例
|
1638
1693
|
*/
|
1639
1694
|
createDslRenderer(e, t = {}) {
|
1640
|
-
const { library: s, components: r, mode: o, apis:
|
1695
|
+
const { library: s, components: r, mode: o, apis: i } = this, a = {
|
1641
1696
|
mode: o,
|
1642
1697
|
Vue: s.Vue,
|
1643
1698
|
components: r,
|
1644
1699
|
libs: s,
|
1645
|
-
apis:
|
1700
|
+
apis: i,
|
1646
1701
|
window,
|
1647
1702
|
...t
|
1648
|
-
},
|
1703
|
+
}, f = ie({
|
1649
1704
|
getDsl: async (c) => await this.getDsl(c) || null,
|
1650
1705
|
getDslByUrl: async (c) => await this.getDslByUrl(c) || null,
|
1651
|
-
options:
|
1706
|
+
options: a
|
1652
1707
|
});
|
1653
|
-
return
|
1654
|
-
...
|
1708
|
+
return oe({
|
1709
|
+
...a,
|
1655
1710
|
dsl: e,
|
1656
|
-
loader:
|
1711
|
+
loader: f
|
1657
1712
|
});
|
1658
1713
|
}
|
1659
1714
|
/**
|
@@ -1669,13 +1724,14 @@ class ss extends Ke {
|
|
1669
1724
|
async getRenderComponent(e, t) {
|
1670
1725
|
const s = this.getFile(e);
|
1671
1726
|
if (!s)
|
1672
|
-
return
|
1673
|
-
t && t(s)
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1727
|
+
return k.warn(`Can not find file: ${e}`), null;
|
1728
|
+
if (t && t(s), this.mode === _.Raw) {
|
1729
|
+
const { vtjRawDir: o = ".vtj/vue" } = this.options, i = `${o}/${e}.vue`, a = this.modules[i] || this.modules[`/src/pages/${e}.vue`];
|
1730
|
+
if (a)
|
1731
|
+
return (await a())?.default;
|
1732
|
+
}
|
1733
|
+
const r = await this.getDsl(s.id);
|
1734
|
+
return r ? this.createDslRenderer(r).renderer : (k.warn(`Can not find dsl: ${e}`), null);
|
1679
1735
|
}
|
1680
1736
|
/**
|
1681
1737
|
* 定义基于URL的异步组件
|
@@ -1687,7 +1743,7 @@ class ss extends Ke {
|
|
1687
1743
|
* @returns Vue异步组件
|
1688
1744
|
*/
|
1689
1745
|
defineUrlSchemaComponent(e, t) {
|
1690
|
-
return
|
1746
|
+
return Se(async () => {
|
1691
1747
|
const s = await this.getDslByUrl(e);
|
1692
1748
|
return s ? (s.name = t || s.name, this.createDslRenderer(s).renderer) : null;
|
1693
1749
|
});
|
@@ -1700,18 +1756,33 @@ class ss extends Ke {
|
|
1700
1756
|
* @returns Vue异步组件
|
1701
1757
|
*/
|
1702
1758
|
definePluginComponent(e) {
|
1703
|
-
return
|
1759
|
+
return Se(async () => await De(e, window));
|
1760
|
+
}
|
1761
|
+
/**
|
1762
|
+
* 设置应用全局
|
1763
|
+
* @param css
|
1764
|
+
* @param win
|
1765
|
+
*/
|
1766
|
+
initGlobals(e, t) {
|
1767
|
+
const s = Object.assign(
|
1768
|
+
{
|
1769
|
+
adapter: this.adapter,
|
1770
|
+
window
|
1771
|
+
},
|
1772
|
+
t
|
1773
|
+
);
|
1774
|
+
ts(e, s);
|
1704
1775
|
}
|
1705
1776
|
}
|
1706
|
-
function
|
1707
|
-
const e = new
|
1777
|
+
function Ps(n) {
|
1778
|
+
const e = new cs(n);
|
1708
1779
|
return {
|
1709
1780
|
provider: e,
|
1710
1781
|
onReady: (s) => e.ready(s)
|
1711
1782
|
};
|
1712
1783
|
}
|
1713
1784
|
function Ne(n = {}) {
|
1714
|
-
const e =
|
1785
|
+
const e = Re(Be, null);
|
1715
1786
|
if (!e)
|
1716
1787
|
throw new Error("Can not find provider");
|
1717
1788
|
if (e.nodeEnv === "development") {
|
@@ -1727,10 +1798,10 @@ function Ne(n = {}) {
|
|
1727
1798
|
}
|
1728
1799
|
return e;
|
1729
1800
|
}
|
1730
|
-
async function
|
1731
|
-
const { name: t, urls: s = [] } = n || {}, r = s.map((
|
1732
|
-
if (o.length &&
|
1733
|
-
return await
|
1801
|
+
async function Cs(n, e = "") {
|
1802
|
+
const { name: t, urls: s = [] } = n || {}, r = s.map((a) => e + a), { css: o, js: i } = dt(r);
|
1803
|
+
if (o.length && Ie(o), i.length)
|
1804
|
+
return await Fe(i, t).catch(
|
1734
1805
|
() => {
|
1735
1806
|
}
|
1736
1807
|
);
|
@@ -1741,7 +1812,7 @@ const Ue = {
|
|
1741
1812
|
originResponse: !1,
|
1742
1813
|
failMessage: !0,
|
1743
1814
|
validate: (n) => n.data?.code === 0
|
1744
|
-
},
|
1815
|
+
}, us = (n, e = "/__vtj__/api/:type.json") => (t, s, r) => n.send({
|
1745
1816
|
url: e,
|
1746
1817
|
method: "post",
|
1747
1818
|
params: { type: t },
|
@@ -1751,7 +1822,7 @@ const Ue = {
|
|
1751
1822
|
data: s
|
1752
1823
|
},
|
1753
1824
|
settings: Ue
|
1754
|
-
}),
|
1825
|
+
}), ls = (n, e = "/__vtj__/api/uploader.json") => async (t, s) => await n.send({
|
1755
1826
|
url: e,
|
1756
1827
|
method: "post",
|
1757
1828
|
data: {
|
@@ -1763,8 +1834,8 @@ const Ue = {
|
|
1763
1834
|
type: "data"
|
1764
1835
|
}
|
1765
1836
|
}).then((r) => r && r[0] ? r[0] : null).catch(() => null);
|
1766
|
-
function
|
1767
|
-
return
|
1837
|
+
function As(n) {
|
1838
|
+
return Ee({
|
1768
1839
|
settings: {
|
1769
1840
|
type: "json",
|
1770
1841
|
validSuccess: !0,
|
@@ -1777,9 +1848,9 @@ function js(n) {
|
|
1777
1848
|
}
|
1778
1849
|
});
|
1779
1850
|
}
|
1780
|
-
class
|
1781
|
-
constructor(e =
|
1782
|
-
this.req = e, this.api =
|
1851
|
+
class pe {
|
1852
|
+
constructor(e = se) {
|
1853
|
+
this.req = e, this.api = us(e), this.uploader = ls(e);
|
1783
1854
|
}
|
1784
1855
|
api;
|
1785
1856
|
pluginCaches = {};
|
@@ -1863,10 +1934,10 @@ class ue {
|
|
1863
1934
|
return await this.api("clearStaticFiles", e).catch(() => "");
|
1864
1935
|
}
|
1865
1936
|
async getPluginMaterial(e) {
|
1866
|
-
const { urls: t = [] } = e, s = t.filter((o) =>
|
1937
|
+
const { urls: t = [] } = e, s = t.filter((o) => ut(o))[0];
|
1867
1938
|
if (!s) return null;
|
1868
1939
|
const r = this.pluginCaches[s];
|
1869
|
-
return r || (this.pluginCaches[s] =
|
1940
|
+
return r || (this.pluginCaches[s] = se.send({
|
1870
1941
|
url: s,
|
1871
1942
|
method: "get",
|
1872
1943
|
settings: {
|
@@ -1879,77 +1950,77 @@ class ue {
|
|
1879
1950
|
return console.log("BaseService.genSource", e), "";
|
1880
1951
|
}
|
1881
1952
|
}
|
1882
|
-
const
|
1953
|
+
const w = new nt({
|
1883
1954
|
type: "local",
|
1884
1955
|
expired: 0,
|
1885
1956
|
prefix: "__VTJ_"
|
1886
1957
|
});
|
1887
|
-
class
|
1958
|
+
class Is extends pe {
|
1888
1959
|
init(e) {
|
1889
|
-
const t = new
|
1890
|
-
return
|
1960
|
+
const t = new L(e), s = w.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
|
1961
|
+
return w.save(`project_${t.id}`, r), Promise.resolve(r);
|
1891
1962
|
}
|
1892
1963
|
saveProject(e) {
|
1893
|
-
const t = new
|
1894
|
-
return
|
1964
|
+
const t = new L(e);
|
1965
|
+
return w.save(`project_${t.id}`, t.toDsl()), Promise.resolve(!0);
|
1895
1966
|
}
|
1896
1967
|
saveMaterials(e, t) {
|
1897
|
-
return
|
1968
|
+
return w.save(`materials_${e.id}`, ue(t)), Promise.resolve(!0);
|
1898
1969
|
}
|
1899
1970
|
saveFile(e) {
|
1900
|
-
return
|
1971
|
+
return w.save(`file_${e.id}`, e), Promise.resolve(!0);
|
1901
1972
|
}
|
1902
1973
|
getFile(e) {
|
1903
|
-
const t =
|
1974
|
+
const t = w.get(`file_${e}`);
|
1904
1975
|
return t ? Promise.resolve(t) : Promise.reject(null);
|
1905
1976
|
}
|
1906
1977
|
removeFile(e) {
|
1907
|
-
return
|
1978
|
+
return w.remove(`file_${e}`), Promise.resolve(!0);
|
1908
1979
|
}
|
1909
1980
|
saveHistory(e) {
|
1910
|
-
return
|
1981
|
+
return w.save(`history_${e.id}`, e), Promise.resolve(!0);
|
1911
1982
|
}
|
1912
1983
|
removeHistory(e) {
|
1913
|
-
const t =
|
1984
|
+
const t = w.get(`history_${e}`);
|
1914
1985
|
if (t) {
|
1915
1986
|
const r = (t.items || []).map((o) => o.id);
|
1916
|
-
this.removeHistoryItem(e, r),
|
1987
|
+
this.removeHistoryItem(e, r), w.remove(`history_${e}`);
|
1917
1988
|
}
|
1918
1989
|
return Promise.resolve(!0);
|
1919
1990
|
}
|
1920
1991
|
getHistory(e) {
|
1921
|
-
const t =
|
1992
|
+
const t = w.get(`history_${e}`), s = new je(t || { id: e });
|
1922
1993
|
return Promise.resolve(s.toDsl());
|
1923
1994
|
}
|
1924
1995
|
getHistoryItem(e, t) {
|
1925
|
-
const s =
|
1996
|
+
const s = w.get(`history_${e}_${t}`);
|
1926
1997
|
return Promise.resolve(s);
|
1927
1998
|
}
|
1928
1999
|
saveHistoryItem(e, t) {
|
1929
|
-
return
|
2000
|
+
return w.save(`history_${e}_${t.id}`, t), Promise.resolve(!0);
|
1930
2001
|
}
|
1931
2002
|
removeHistoryItem(e, t) {
|
1932
2003
|
return t.forEach((s) => {
|
1933
|
-
|
2004
|
+
w.remove(`history_${e}_${s}`);
|
1934
2005
|
}), Promise.resolve(!0);
|
1935
2006
|
}
|
1936
2007
|
}
|
1937
|
-
class
|
2008
|
+
class fs extends pe {
|
1938
2009
|
projects = {};
|
1939
2010
|
materials = {};
|
1940
2011
|
files = {};
|
1941
2012
|
histories = {};
|
1942
2013
|
historyItems = {};
|
1943
2014
|
init(e) {
|
1944
|
-
const t = new
|
2015
|
+
const t = new L(e), s = this.projects[t.id] || {}, r = Object.assign(t.toDsl(), s);
|
1945
2016
|
return this.projects[r.id] = r, Promise.resolve(r);
|
1946
2017
|
}
|
1947
2018
|
saveProject(e) {
|
1948
|
-
const t = new
|
2019
|
+
const t = new L(e);
|
1949
2020
|
return this.projects[t.id] = t.toDsl(), Promise.resolve(!0);
|
1950
2021
|
}
|
1951
2022
|
saveMaterials(e, t) {
|
1952
|
-
return e.id && (this.materials[e.id] =
|
2023
|
+
return e.id && (this.materials[e.id] = ue(t)), Promise.resolve(!0);
|
1953
2024
|
}
|
1954
2025
|
saveFile(e) {
|
1955
2026
|
return this.files[e.id] = e, Promise.resolve(!0);
|
@@ -1973,7 +2044,7 @@ class os extends ue {
|
|
1973
2044
|
return Promise.resolve(!0);
|
1974
2045
|
}
|
1975
2046
|
getHistory(e) {
|
1976
|
-
const t = this.histories[e], s = new
|
2047
|
+
const t = this.histories[e], s = new je(t || { id: e });
|
1977
2048
|
return Promise.resolve(s);
|
1978
2049
|
}
|
1979
2050
|
getHistoryItem(e, t) {
|
@@ -1991,11 +2062,11 @@ class os extends ue {
|
|
1991
2062
|
}), Promise.resolve(!0);
|
1992
2063
|
}
|
1993
2064
|
}
|
1994
|
-
let
|
1995
|
-
function
|
1996
|
-
return
|
2065
|
+
let N = null;
|
2066
|
+
function Fs() {
|
2067
|
+
return N || (N = new fs(), N);
|
1997
2068
|
}
|
1998
|
-
class
|
2069
|
+
class ks extends pe {
|
1999
2070
|
getFileCaches = {};
|
2000
2071
|
async getExtension() {
|
2001
2072
|
return await this.api("getExtension", {}).catch(() => {
|
@@ -2012,7 +2083,7 @@ class bs extends ue {
|
|
2012
2083
|
async saveMaterials(e, t) {
|
2013
2084
|
return !!await this.api("saveMaterials", {
|
2014
2085
|
project: e,
|
2015
|
-
materials:
|
2086
|
+
materials: ue(t)
|
2016
2087
|
}).catch(() => !1);
|
2017
2088
|
}
|
2018
2089
|
async saveFile(e) {
|
@@ -2053,79 +2124,79 @@ class bs extends ue {
|
|
2053
2124
|
}
|
2054
2125
|
}
|
2055
2126
|
export {
|
2056
|
-
|
2057
|
-
|
2058
|
-
|
2127
|
+
ys as ACCESS,
|
2128
|
+
ke as ACCESS_KEY,
|
2129
|
+
fe as Access,
|
2059
2130
|
ct as BUILD_IN_TAGS,
|
2060
2131
|
ot as BUILT_IN_DIRECTIVES,
|
2061
|
-
|
2062
|
-
|
2132
|
+
pe as BaseService,
|
2133
|
+
$e as CONTEXT_HOST,
|
2063
2134
|
Ct as Context,
|
2064
|
-
|
2135
|
+
_ as ContextMode,
|
2065
2136
|
it as DATA_TYPES,
|
2066
|
-
|
2137
|
+
U as HOMEPAGE_ROUTE_NAME,
|
2067
2138
|
at as HTML_TAGS,
|
2068
|
-
|
2069
|
-
|
2070
|
-
|
2071
|
-
|
2072
|
-
|
2073
|
-
|
2074
|
-
|
2075
|
-
|
2076
|
-
|
2077
|
-
|
2078
|
-
|
2079
|
-
|
2139
|
+
$s as JSCodeToString,
|
2140
|
+
gs as LIFE_CYCLES_LIST,
|
2141
|
+
ks as LocalService,
|
2142
|
+
fs as MemoryService,
|
2143
|
+
as as NodeEnv,
|
2144
|
+
D as PAGE_ROUTE_NAME,
|
2145
|
+
cs as Provider,
|
2146
|
+
vs as REMOTE,
|
2147
|
+
Is as StorageService,
|
2148
|
+
O as VTJ_RENDERER_VERSION,
|
2149
|
+
le as adoptedStyleSheets,
|
2150
|
+
bs as clearLoaderCache,
|
2080
2151
|
ht as compileScopedCSS,
|
2081
|
-
|
2082
|
-
|
2083
|
-
|
2084
|
-
|
2152
|
+
Es as createAccess,
|
2153
|
+
js as createAdapter,
|
2154
|
+
_s as createAssetScripts,
|
2155
|
+
ws as createAssetsCss,
|
2085
2156
|
Dt as createDataSources,
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2157
|
+
ie as createLoader,
|
2158
|
+
Fs as createMemoryService,
|
2159
|
+
K as createMenus,
|
2089
2160
|
jt as createMetaApi,
|
2090
|
-
|
2091
|
-
|
2092
|
-
|
2161
|
+
Rt as createMock,
|
2162
|
+
Ps as createProvider,
|
2163
|
+
oe as createRenderer,
|
2093
2164
|
$t as createSchemaApi,
|
2094
2165
|
Et as createSchemaApis,
|
2095
|
-
|
2166
|
+
As as createServiceRequest,
|
2096
2167
|
xt as defaultLoader,
|
2097
|
-
|
2098
|
-
|
2168
|
+
B as fillBasePath,
|
2169
|
+
T as getMock,
|
2099
2170
|
He as getModifiers,
|
2100
2171
|
De as getPlugin,
|
2101
|
-
|
2172
|
+
pt as getRawComponent,
|
2102
2173
|
vt as isBuiltInTag,
|
2103
|
-
|
2174
|
+
G as isCSSUrl,
|
2104
2175
|
_t as isJSCode,
|
2105
|
-
|
2106
|
-
|
2107
|
-
|
2108
|
-
|
2176
|
+
j as isJSExpression,
|
2177
|
+
S as isJSFunction,
|
2178
|
+
ut as isJSON,
|
2179
|
+
V as isJSUrl,
|
2109
2180
|
yt as isNativeTag,
|
2110
2181
|
gt as isVuePlugin,
|
2111
2182
|
mt as loadCss,
|
2112
|
-
|
2113
|
-
|
2114
|
-
|
2183
|
+
Ie as loadCssUrl,
|
2184
|
+
Cs as loadEnhance,
|
2185
|
+
Fe as loadScriptUrl,
|
2115
2186
|
xe as menusFilter,
|
2116
2187
|
Pt as mockApi,
|
2117
|
-
|
2188
|
+
bt as mockApis,
|
2118
2189
|
Me as mockCleanup,
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2190
|
+
M as nodeRender,
|
2191
|
+
ft as parseDeps,
|
2192
|
+
H as parseExpression,
|
2193
|
+
E as parseFunction,
|
2123
2194
|
dt as parseUrls,
|
2124
2195
|
Be as providerKey,
|
2125
|
-
|
2126
|
-
|
2127
|
-
|
2196
|
+
lt as removeProdFlag,
|
2197
|
+
Ss as setupPageSetting,
|
2198
|
+
Ae as toString,
|
2128
2199
|
St as useAccess,
|
2129
|
-
|
2200
|
+
Rs as useMask,
|
2130
2201
|
Ne as useProvider
|
2131
2202
|
};
|