@vtj/renderer 0.8.167 → 0.8.169
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 +5 -5
- package/dist/index.mjs +280 -257
- package/package.json +5 -5
- package/types/plugins/access.d.ts +10 -2
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Base as
|
|
2
|
-
import { isUrl as
|
|
1
|
+
import { Base as $e, BUILT_IN_COMPONENTS as je, ProjectModel as I, HistoryModel as ne } from "@vtj/core";
|
|
2
|
+
import { isUrl as Ee, url as b, dedupArray as Pe, isString as $, isFunction as Y, logger as D, createRequest as be, merge as Ce, pathToRegexp as Re, pathToRegexpMatch as Fe, formDataToJson as xe, storage as k, cookie as T, toArray as Q, unAES as Ie, MD5 as De, delay as re, camelCase as j, upperFirst as Ae, pick as Oe, jsonp as He, loadScript as X, Request as Me, Storage as ke, mapToObject as q } from "@vtj/utils";
|
|
3
3
|
import * as O from "vue";
|
|
4
|
-
import { inject as oe, toRef as
|
|
4
|
+
import { inject as oe, toRef as Te, readonly as Be, customRef as Ue, ref as J, onBeforeUnmount as Ne, getCurrentScope as Le, onScopeDispose as qe, unref as Je, getCurrentInstance as ie, watch as ae, computed as ce, onMounted as Ve, defineComponent as ue, h as U, defineAsyncComponent as Z, watchEffect as ze } from "vue";
|
|
5
5
|
import { useRoute as le } from "vue-router";
|
|
6
|
-
import { ElNotification as
|
|
7
|
-
import { XStartup as
|
|
6
|
+
import { ElNotification as H, ElLoading as Ke } from "element-plus";
|
|
7
|
+
import { XStartup as We } from "@vtj/ui";
|
|
8
8
|
/**!
|
|
9
9
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
|
10
10
|
* @name @vtj/renderer
|
|
11
11
|
* @author CHC chenhuachun1549@dingtalk.com
|
|
12
|
-
* @version 0.8.
|
|
12
|
+
* @version 0.8.169
|
|
13
13
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
|
14
14
|
*/
|
|
15
|
-
const
|
|
15
|
+
const C = "0.8.169";
|
|
16
16
|
var _ = /* @__PURE__ */ ((n) => (n.Runtime = "Runtime", n.Design = "Design", n.Raw = "Raw", n.VNode = "VNode", n))(_ || {});
|
|
17
17
|
const ee = [
|
|
18
18
|
"$el",
|
|
@@ -26,7 +26,7 @@ const ee = [
|
|
|
26
26
|
"$props",
|
|
27
27
|
"$options",
|
|
28
28
|
"$forceUpdate"
|
|
29
|
-
],
|
|
29
|
+
], us = [
|
|
30
30
|
"beforeCreate",
|
|
31
31
|
"created",
|
|
32
32
|
"beforeMount",
|
|
@@ -40,7 +40,7 @@ const ee = [
|
|
|
40
40
|
"renderTriggered",
|
|
41
41
|
"activated",
|
|
42
42
|
"deactivated"
|
|
43
|
-
],
|
|
43
|
+
], Ge = ["vIf", "vShow", "vModel", "vFor", "vBind"], Ye = {
|
|
44
44
|
String,
|
|
45
45
|
Number,
|
|
46
46
|
Boolean,
|
|
@@ -50,7 +50,7 @@ const ee = [
|
|
|
50
50
|
Date
|
|
51
51
|
};
|
|
52
52
|
function F(n, e) {
|
|
53
|
-
return n.map((t) =>
|
|
53
|
+
return n.map((t) => Ee(t) || t.startsWith("/") ? t : `${e}${t}`);
|
|
54
54
|
}
|
|
55
55
|
function V(n) {
|
|
56
56
|
return /\.css$/.test(n);
|
|
@@ -58,42 +58,42 @@ function V(n) {
|
|
|
58
58
|
function z(n) {
|
|
59
59
|
return /\.js$/.test(n);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Qe(n) {
|
|
62
62
|
return /\.json$/.test(n);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function ls(n) {
|
|
65
65
|
return n.map(
|
|
66
|
-
(e) => `<script src="${b.append(e, { v:
|
|
66
|
+
(e) => `<script src="${b.append(e, { v: C })}"><\/script>`
|
|
67
67
|
).join("");
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function fs(n = []) {
|
|
70
70
|
return n.map(
|
|
71
|
-
(e) => `<link rel="stylesheet" href="${b.append(e, { v:
|
|
71
|
+
(e) => `<link rel="stylesheet" href="${b.append(e, { v: C })}" />`
|
|
72
72
|
).join("");
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Xe(n, e = !1) {
|
|
75
75
|
return e && n.endsWith(".prod.js") ? n.replace(".prod.js", ".js") : n;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const s = n.filter((
|
|
77
|
+
function Ze(n, e, t = !1) {
|
|
78
|
+
const s = n.filter((f) => !!f.enabled), r = [], o = [], a = [], i = [], u = {}, c = {}, p = [], l = {};
|
|
79
79
|
return s.forEach(
|
|
80
|
-
({ urls:
|
|
81
|
-
|
|
82
|
-
z(v) && r.push(
|
|
83
|
-
}), d && (i.push(d), u[d] = F(
|
|
80
|
+
({ urls: f, assetsUrl: m, library: d, assetsLibrary: h, localeLibrary: w }) => {
|
|
81
|
+
f?.forEach((v) => {
|
|
82
|
+
z(v) && r.push(Xe(v, t)), V(v) && o.push(v);
|
|
83
|
+
}), d && (i.push(d), u[d] = F(f || [], e), w && (c[d] = w)), m && a.push(m), h && p.push(h), d && h && (l[h] = d);
|
|
84
84
|
}
|
|
85
85
|
), {
|
|
86
86
|
scripts: F(r, e),
|
|
87
87
|
css: F(o, e),
|
|
88
88
|
materials: F(a, e),
|
|
89
89
|
libraryExports: i,
|
|
90
|
-
materialExports:
|
|
91
|
-
materialMapLibrary:
|
|
90
|
+
materialExports: Pe(p),
|
|
91
|
+
materialMapLibrary: l,
|
|
92
92
|
libraryMap: u,
|
|
93
93
|
libraryLocaleMap: c
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function et(n, e) {
|
|
97
97
|
const { name: t, parent: s, alias: r } = n;
|
|
98
98
|
return s ? e[s]?.[r || t] : e[r || t];
|
|
99
99
|
}
|
|
@@ -115,11 +115,11 @@ function de(n, e, t) {
|
|
|
115
115
|
o ? o.innerHTML = t : (o = r.createElement("style"), o.id = e, o.innerHTML = t, r.head.appendChild(o));
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
async function
|
|
118
|
+
async function tt(n, e) {
|
|
119
119
|
const t = await window.fetch(e).then((s) => s.text()).catch(() => "");
|
|
120
120
|
t && de(window, n, t);
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function st(n, e = window) {
|
|
123
123
|
const t = e.document, s = e.document.head;
|
|
124
124
|
for (const r of n)
|
|
125
125
|
if (!t.getElementById(r)) {
|
|
@@ -127,7 +127,7 @@ function Ze(n, e = window) {
|
|
|
127
127
|
a.rel = "stylesheet", a.id = r, a.href = r, s.appendChild(a);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
async function
|
|
130
|
+
async function nt(n, e, t = window) {
|
|
131
131
|
const s = t.document, r = t.document.head;
|
|
132
132
|
let o = t[e];
|
|
133
133
|
return o ? o.default || o : new Promise((a, i) => {
|
|
@@ -141,10 +141,10 @@ async function et(n, e, t = window) {
|
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function rt(n) {
|
|
145
145
|
return Y(n) || Y(n?.install);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function R(n, e, t = !1, s = !1) {
|
|
148
148
|
try {
|
|
149
149
|
const r = ['"use strict";', "var __self = arguments[0];"];
|
|
150
150
|
r.push("return ");
|
|
@@ -154,13 +154,13 @@ function C(n, e, t = !1, s = !1) {
|
|
|
154
154
|
const a = `with(${t ? "{}" : "$scope || {}"}) { ${o} }`;
|
|
155
155
|
return new Function("$scope", a)(e);
|
|
156
156
|
} catch (r) {
|
|
157
|
-
if (
|
|
157
|
+
if (D.error("parseExpression.error", r, n, e?.__self ?? e), s)
|
|
158
158
|
throw r;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
function te(n, e, t = !1, s = !1) {
|
|
162
|
-
const r =
|
|
163
|
-
if (typeof r != "function" && (
|
|
162
|
+
const r = R(n, e, t, s);
|
|
163
|
+
if (typeof r != "function" && (D.error(
|
|
164
164
|
"parseFunction.error",
|
|
165
165
|
"not a function",
|
|
166
166
|
n,
|
|
@@ -175,14 +175,14 @@ function S(n) {
|
|
|
175
175
|
function M(n) {
|
|
176
176
|
return typeof n == "object" && n && n.type === "JSFunction";
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function ot(n) {
|
|
179
179
|
return S(n) || M(n);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
return
|
|
181
|
+
function ds(n) {
|
|
182
|
+
return ot(n) ? n.value : JSON.stringify(n);
|
|
183
183
|
}
|
|
184
184
|
let E = null;
|
|
185
|
-
const
|
|
185
|
+
const it = be({
|
|
186
186
|
settings: {
|
|
187
187
|
type: "form",
|
|
188
188
|
validSuccess: !0,
|
|
@@ -191,12 +191,12 @@ const nt = Pe({
|
|
|
191
191
|
validate: (n) => n.data?.code === 0 || !!n.data?.success,
|
|
192
192
|
failMessage: !0,
|
|
193
193
|
showError: (n) => {
|
|
194
|
-
|
|
194
|
+
H.error({
|
|
195
195
|
message: n || "未知错误"
|
|
196
196
|
});
|
|
197
197
|
},
|
|
198
198
|
showLoading: () => {
|
|
199
|
-
E && E.close(), E =
|
|
199
|
+
E && E.close(), E = Ke.service({
|
|
200
200
|
lock: !0,
|
|
201
201
|
text: "Loading",
|
|
202
202
|
background: "rgba(0, 0, 0, 0.05)"
|
|
@@ -208,7 +208,7 @@ const nt = Pe({
|
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
210
|
let P;
|
|
211
|
-
function
|
|
211
|
+
function at(n, e) {
|
|
212
212
|
const { jsonp: t, request: s } = e;
|
|
213
213
|
if (n.method === "jsonp")
|
|
214
214
|
return (r = {}) => t(n.url, {
|
|
@@ -216,7 +216,7 @@ function rt(n, e) {
|
|
|
216
216
|
query: r
|
|
217
217
|
});
|
|
218
218
|
{
|
|
219
|
-
const r = n.headers ?
|
|
219
|
+
const r = n.headers ? R(n.headers, {}, !0) : void 0, o = {
|
|
220
220
|
url: n.url,
|
|
221
221
|
method: n.method,
|
|
222
222
|
settings: {
|
|
@@ -224,10 +224,10 @@ function rt(n, e) {
|
|
|
224
224
|
headers: r
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
|
-
return (a, i) => (delete o.data, s.send(
|
|
227
|
+
return (a, i) => (delete o.data, s.send(Ce(o, i || {}, { data: a })));
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function ct(n, e) {
|
|
231
231
|
const { metaQuery: t } = e;
|
|
232
232
|
if (!t) return;
|
|
233
233
|
const { code: s, queryCode: r } = n;
|
|
@@ -239,26 +239,26 @@ function ot(n, e) {
|
|
|
239
239
|
return t(s, r, o, a);
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function ut(n = [], e = [], t) {
|
|
243
243
|
const s = {};
|
|
244
244
|
for (const r of n)
|
|
245
|
-
s[r.id] =
|
|
245
|
+
s[r.id] = at(r, t);
|
|
246
246
|
for (const r of e)
|
|
247
|
-
s[r.id] =
|
|
247
|
+
s[r.id] = ct(r, t);
|
|
248
248
|
return s;
|
|
249
249
|
}
|
|
250
|
-
async function
|
|
250
|
+
async function lt(n = []) {
|
|
251
251
|
P = await import("mockjs").then((e) => e.default || e), P && (P.setup({
|
|
252
252
|
timeout: "50-500"
|
|
253
|
-
}), pe(), n.forEach((e) =>
|
|
253
|
+
}), pe(), n.forEach((e) => ft(P, e)));
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function ft(n, e) {
|
|
256
256
|
if (!e.mock) return;
|
|
257
257
|
const { url: t, mockTemplate: s } = e;
|
|
258
258
|
if (t && s) {
|
|
259
|
-
const r = Re(`${t}(.*)`), o =
|
|
259
|
+
const r = Re(`${t}(.*)`), o = Fe(t, { decode: decodeURIComponent }), a = R(s, {}, !0);
|
|
260
260
|
n.mock(r, (i) => {
|
|
261
|
-
const u = b.parse(i.url) || {}, c = i.body instanceof FormData ?
|
|
261
|
+
const u = b.parse(i.url) || {}, c = i.body instanceof FormData ? xe(i.body) : i.body, p = o(i.url)?.params;
|
|
262
262
|
return Object.assign(i, { data: c, params: u, query: p }), n.mock(a(i));
|
|
263
263
|
});
|
|
264
264
|
}
|
|
@@ -266,7 +266,7 @@ function ct(n, e) {
|
|
|
266
266
|
function pe() {
|
|
267
267
|
P && (P._mocked = {});
|
|
268
268
|
}
|
|
269
|
-
const
|
|
269
|
+
const dt = {
|
|
270
270
|
session: !1,
|
|
271
271
|
authKey: "Authorization",
|
|
272
272
|
storageKey: "ACCESS_STORAGE",
|
|
@@ -277,12 +277,12 @@ const ut = {
|
|
|
277
277
|
unauthorizedCode: 401,
|
|
278
278
|
unauthorizedMessage: "登录已经失效,请重新登录!"
|
|
279
279
|
}, he = Symbol("access");
|
|
280
|
-
class
|
|
280
|
+
class ps {
|
|
281
281
|
options;
|
|
282
282
|
data = null;
|
|
283
283
|
mode = _.Raw;
|
|
284
284
|
constructor(e) {
|
|
285
|
-
this.options = Object.assign({},
|
|
285
|
+
this.options = Object.assign({}, dt, e), this.loadData();
|
|
286
286
|
}
|
|
287
287
|
connect(e) {
|
|
288
288
|
const { mode: t, router: s, request: r } = e;
|
|
@@ -290,10 +290,10 @@ class us {
|
|
|
290
290
|
}
|
|
291
291
|
login(e) {
|
|
292
292
|
const { storageKey: t, storagePrefix: s, session: r, authKey: o } = this.options;
|
|
293
|
-
this.data
|
|
293
|
+
this.setData(e), this.data && (k.save(t, e, {
|
|
294
294
|
type: "local",
|
|
295
295
|
prefix: s
|
|
296
|
-
}), r && T.set(o,
|
|
296
|
+
}), r && T.set(o, this.data.token));
|
|
297
297
|
}
|
|
298
298
|
clear() {
|
|
299
299
|
const { storageKey: e, storagePrefix: t, session: s, authKey: r } = this.options;
|
|
@@ -310,7 +310,7 @@ class us {
|
|
|
310
310
|
}
|
|
311
311
|
can(e) {
|
|
312
312
|
const { permissions: t = {} } = this.data || {};
|
|
313
|
-
return Q(e).every((r) => t[r]);
|
|
313
|
+
return typeof e == "function" ? e(t) : Q(e).every((r) => t[r]);
|
|
314
314
|
}
|
|
315
315
|
some(e) {
|
|
316
316
|
const { permissions: t = {} } = this.data || {};
|
|
@@ -335,12 +335,25 @@ class us {
|
|
|
335
335
|
const s = t ? `?${t}=${encodeURIComponent(location.href)}` : "";
|
|
336
336
|
typeof e == "function" ? e(s) : location.href = t ? `${e}${s}` : e;
|
|
337
337
|
}
|
|
338
|
+
setData(e) {
|
|
339
|
+
const { crypto: t } = this.options;
|
|
340
|
+
if (typeof e == "string")
|
|
341
|
+
try {
|
|
342
|
+
this.data = JSON.parse(
|
|
343
|
+
t ? Ie(e, De(t.toLowerCase())) : e
|
|
344
|
+
);
|
|
345
|
+
} catch (s) {
|
|
346
|
+
console.warn(s);
|
|
347
|
+
}
|
|
348
|
+
else
|
|
349
|
+
this.data = e;
|
|
350
|
+
}
|
|
338
351
|
loadData() {
|
|
339
|
-
const { storageKey: e, storagePrefix: t } = this.options
|
|
340
|
-
this.data = k.get(e, {
|
|
352
|
+
const { storageKey: e, storagePrefix: t } = this.options, s = k.get(e, {
|
|
341
353
|
type: "local",
|
|
342
354
|
prefix: t
|
|
343
355
|
});
|
|
356
|
+
this.setData(s);
|
|
344
357
|
}
|
|
345
358
|
isLogined() {
|
|
346
359
|
const { session: e, authKey: t } = this.options;
|
|
@@ -370,7 +383,7 @@ class us {
|
|
|
370
383
|
}).catch((r) => r), this.toLogin());
|
|
371
384
|
}
|
|
372
385
|
setRequest(e) {
|
|
373
|
-
e.useRequest((t) => (t.headers[this.options.authKey] = this.data?.token, t)), e.useResponse(
|
|
386
|
+
e.useRequest((t) => (this.data?.token && (t.headers[this.options.authKey] = this.data?.token), t)), e.useResponse(
|
|
374
387
|
async (t) => (await this.showUnauthorizedAlert(t), t),
|
|
375
388
|
async (t) => {
|
|
376
389
|
const s = t.response || t || {};
|
|
@@ -379,11 +392,10 @@ class us {
|
|
|
379
392
|
);
|
|
380
393
|
}
|
|
381
394
|
}
|
|
382
|
-
function
|
|
383
|
-
|
|
384
|
-
return n || console.warn("access is null"), n;
|
|
395
|
+
function pt() {
|
|
396
|
+
return oe(he, null);
|
|
385
397
|
}
|
|
386
|
-
class
|
|
398
|
+
class ht {
|
|
387
399
|
__id = null;
|
|
388
400
|
__mode;
|
|
389
401
|
__instance = null;
|
|
@@ -447,9 +459,9 @@ class lt {
|
|
|
447
459
|
if (e)
|
|
448
460
|
if (this.__mode === _.Runtime) {
|
|
449
461
|
const { id: t, type: s } = e, r = t ? this.__transform[t] ?? e.value : e.value;
|
|
450
|
-
return
|
|
462
|
+
return R({ type: s, value: r }, this);
|
|
451
463
|
} else
|
|
452
|
-
return
|
|
464
|
+
return R(e, this);
|
|
453
465
|
}
|
|
454
466
|
__ref(e = null, t) {
|
|
455
467
|
if (this.__mode !== _.VNode)
|
|
@@ -493,53 +505,53 @@ function N(n) {
|
|
|
493
505
|
$components: s,
|
|
494
506
|
$libs: r,
|
|
495
507
|
$apis: o
|
|
496
|
-
}, c = new
|
|
508
|
+
}, c = new ht({
|
|
497
509
|
mode: t,
|
|
498
510
|
dsl: i.value,
|
|
499
511
|
attrs: u
|
|
500
512
|
}), p = e.defineComponent({
|
|
501
513
|
name: i.value.name,
|
|
502
514
|
props: {
|
|
503
|
-
...
|
|
515
|
+
...vt(i.value.props ?? [], c)
|
|
504
516
|
},
|
|
505
|
-
setup(
|
|
506
|
-
c.$props =
|
|
517
|
+
setup(l) {
|
|
518
|
+
c.$props = l, c.props = l, i.value.id && de(
|
|
507
519
|
n.window || window,
|
|
508
520
|
i.value.id,
|
|
509
521
|
i.value.css || ""
|
|
510
|
-
), c.state =
|
|
511
|
-
const
|
|
522
|
+
), c.state = gt(e, i.value.state ?? {}, c);
|
|
523
|
+
const f = yt(e, i.value.computed ?? {}, c), m = _t(i.value.methods ?? {}, c), d = wt(e, i.value.inject, c), h = St(
|
|
512
524
|
i.value.dataSources || {},
|
|
513
525
|
c
|
|
514
526
|
), w = {
|
|
515
527
|
...d,
|
|
516
|
-
...
|
|
528
|
+
...f,
|
|
517
529
|
...m,
|
|
518
530
|
...h
|
|
519
531
|
};
|
|
520
|
-
return c.setup(w, e),
|
|
532
|
+
return c.setup(w, e), $t(e, i.value.watch ?? [], c), {
|
|
521
533
|
vtj: c
|
|
522
534
|
};
|
|
523
535
|
},
|
|
524
|
-
emits:
|
|
536
|
+
emits: mt(i.value.emits),
|
|
525
537
|
expose: ["vtj"],
|
|
526
538
|
render() {
|
|
527
539
|
if (!i.value.nodes) return null;
|
|
528
|
-
const
|
|
529
|
-
return
|
|
540
|
+
const l = i.value.nodes || [];
|
|
541
|
+
return l.length === 1 ? A(l[0], c, e, a) : l.map((f) => A(f, c, e, a));
|
|
530
542
|
},
|
|
531
|
-
...
|
|
543
|
+
...jt(i.value.lifeCycles ?? {}, c)
|
|
532
544
|
});
|
|
533
545
|
return {
|
|
534
546
|
renderer: e.markRaw(p),
|
|
535
547
|
context: c
|
|
536
548
|
};
|
|
537
549
|
}
|
|
538
|
-
function
|
|
550
|
+
function mt(n = []) {
|
|
539
551
|
return n.map((e) => $(e) ? e : e.name);
|
|
540
552
|
}
|
|
541
|
-
function
|
|
542
|
-
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) =>
|
|
553
|
+
function vt(n = [], e) {
|
|
554
|
+
const t = (s) => s ? (Array.isArray(s) ? s : [s]).map((o) => Ye[o]) : void 0;
|
|
543
555
|
return n.map((s) => $(s) ? {
|
|
544
556
|
name: s
|
|
545
557
|
} : {
|
|
@@ -556,7 +568,7 @@ function dt(n = [], e) {
|
|
|
556
568
|
{}
|
|
557
569
|
);
|
|
558
570
|
}
|
|
559
|
-
function
|
|
571
|
+
function gt(n, e, t) {
|
|
560
572
|
return n.reactive(
|
|
561
573
|
Object.keys(e || {}).reduce(
|
|
562
574
|
(s, r) => {
|
|
@@ -567,19 +579,19 @@ function pt(n, e, t) {
|
|
|
567
579
|
)
|
|
568
580
|
);
|
|
569
581
|
}
|
|
570
|
-
function
|
|
582
|
+
function yt(n, e, t) {
|
|
571
583
|
return Object.entries(e ?? {}).reduce(
|
|
572
584
|
(s, [r, o]) => (s[r] = n.computed(t.__parseFunction(o)), s),
|
|
573
585
|
{}
|
|
574
586
|
);
|
|
575
587
|
}
|
|
576
|
-
function
|
|
588
|
+
function _t(n, e) {
|
|
577
589
|
return Object.entries(n ?? {}).reduce(
|
|
578
590
|
(t, [s, r]) => (t[s] = e.__parseFunction(r), t),
|
|
579
591
|
{}
|
|
580
592
|
);
|
|
581
593
|
}
|
|
582
|
-
function
|
|
594
|
+
function wt(n, e = [], t) {
|
|
583
595
|
return e.reduce(
|
|
584
596
|
(s, r) => {
|
|
585
597
|
const { name: o, from: a } = r || {};
|
|
@@ -590,7 +602,7 @@ function vt(n, e = [], t) {
|
|
|
590
602
|
{}
|
|
591
603
|
);
|
|
592
604
|
}
|
|
593
|
-
function
|
|
605
|
+
function St(n, e) {
|
|
594
606
|
return Object.keys(n).reduce(
|
|
595
607
|
(t, s) => {
|
|
596
608
|
const r = n[s], o = e.$apis[r.ref], a = M(r.transform) ? r.transform.value ? e.__parseFunction(r.transform) : void 0 : r.transform;
|
|
@@ -602,7 +614,7 @@ function gt(n, e) {
|
|
|
602
614
|
{}
|
|
603
615
|
);
|
|
604
616
|
}
|
|
605
|
-
function
|
|
617
|
+
function $t(n, e = [], t) {
|
|
606
618
|
e.forEach((s) => {
|
|
607
619
|
n.watch(
|
|
608
620
|
t.__parseExpression(s.source),
|
|
@@ -614,19 +626,19 @@ function yt(n, e = [], t) {
|
|
|
614
626
|
);
|
|
615
627
|
});
|
|
616
628
|
}
|
|
617
|
-
function
|
|
629
|
+
function jt(n, e) {
|
|
618
630
|
return Object.entries(n ?? {}).reduce(
|
|
619
631
|
(t, [s, r]) => (t[s] = e.__parseFunction(r), t),
|
|
620
632
|
{}
|
|
621
633
|
);
|
|
622
634
|
}
|
|
623
635
|
let B = [];
|
|
624
|
-
const
|
|
636
|
+
const Et = (n) => n;
|
|
625
637
|
async function me(n, e = window) {
|
|
626
638
|
const { urls: t = [], library: s } = n, r = t.filter((i) => z(i));
|
|
627
639
|
if (r.length === 0 || !s) return null;
|
|
628
640
|
const o = t.filter((i) => V(i));
|
|
629
|
-
return o.length &&
|
|
641
|
+
return o.length && st(o, e), await nt(r, s, e).catch(
|
|
630
642
|
(i) => (console.warn("loadScriptUrl error", r, s, i), null)
|
|
631
643
|
);
|
|
632
644
|
}
|
|
@@ -657,41 +669,41 @@ function L(n) {
|
|
|
657
669
|
return i || (console.warn("getPlugin result is null", o), null);
|
|
658
670
|
})) : r;
|
|
659
671
|
}
|
|
660
|
-
function
|
|
672
|
+
function A(n, e, t = O, s = Et) {
|
|
661
673
|
if (!n || !n.name || n.invisible) return null;
|
|
662
|
-
const { id: r = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: u, vModels: c, vBind: p } =
|
|
663
|
-
if (a &&
|
|
674
|
+
const { id: r = null, directives: o = [] } = n, { vIf: a, vFor: i, vShow: u, vModels: c, vBind: p } = Pt(o);
|
|
675
|
+
if (a && !bt(a, e))
|
|
664
676
|
return null;
|
|
665
|
-
const
|
|
666
|
-
const m =
|
|
677
|
+
const l = (f) => {
|
|
678
|
+
const m = f.$components, d = (() => {
|
|
667
679
|
if (n.name === "component")
|
|
668
|
-
return
|
|
680
|
+
return Ct(f, n.props?.is);
|
|
669
681
|
if (n.name === "slot") return n.name;
|
|
670
682
|
const g = s(n.name, n.from, t);
|
|
671
683
|
return $(g) ? m[g] ?? g : g;
|
|
672
|
-
})(), h =
|
|
684
|
+
})(), h = Rt(r, n.props ?? {}, f), w = Ft(t, n.events ?? {}, f);
|
|
673
685
|
if (n.name === "slot")
|
|
674
|
-
return
|
|
675
|
-
p && Object.assign(h,
|
|
686
|
+
return xt(t, n, h, f, s);
|
|
687
|
+
p && Object.assign(h, f.__parseExpression(p.value)), u && (h.style = Object.assign(
|
|
676
688
|
h.style ?? {},
|
|
677
|
-
|
|
689
|
+
Dt(u, f)
|
|
678
690
|
)), c.forEach((g) => {
|
|
679
|
-
Object.assign(h,
|
|
691
|
+
Object.assign(h, At(t, g, f));
|
|
680
692
|
});
|
|
681
|
-
const v =
|
|
693
|
+
const v = Ot(
|
|
682
694
|
t,
|
|
683
695
|
n.children ?? [],
|
|
684
|
-
|
|
696
|
+
f,
|
|
685
697
|
s,
|
|
686
698
|
n
|
|
687
699
|
);
|
|
688
700
|
return t.createVNode(d, { ...h, ...w }, v);
|
|
689
701
|
};
|
|
690
|
-
return i ?
|
|
702
|
+
return i ? kt(i, l, e) : l(e);
|
|
691
703
|
}
|
|
692
|
-
function
|
|
704
|
+
function Pt(n = []) {
|
|
693
705
|
const e = n.find((i) => j(i.name) === "vIf"), t = n.find((i) => j(i.name) === "vFor"), s = n.find((i) => j(i.name) === "vShow"), r = n.find((i) => j(i.name) === "vBind"), o = n.filter((i) => j(i.name) === "vModel"), a = n.filter(
|
|
694
|
-
(i) => !
|
|
706
|
+
(i) => !Ge.includes(j(i.name))
|
|
695
707
|
);
|
|
696
708
|
return {
|
|
697
709
|
vIf: e,
|
|
@@ -702,13 +714,13 @@ function St(n = []) {
|
|
|
702
714
|
others: a
|
|
703
715
|
};
|
|
704
716
|
}
|
|
705
|
-
function
|
|
717
|
+
function bt(n, e) {
|
|
706
718
|
return !!e.__parseExpression(n.value);
|
|
707
719
|
}
|
|
708
|
-
function
|
|
720
|
+
function Ct(n, e) {
|
|
709
721
|
return e ? S(e) ? n.__parseExpression(e) : e : "div";
|
|
710
722
|
}
|
|
711
|
-
function
|
|
723
|
+
function Rt(n, e, t) {
|
|
712
724
|
const s = Object.keys(e || {}).reduce(
|
|
713
725
|
(r, o) => {
|
|
714
726
|
let a = e[o];
|
|
@@ -718,7 +730,7 @@ function Et(n, e, t) {
|
|
|
718
730
|
);
|
|
719
731
|
return s.ref = t.__ref(n, s.ref), s;
|
|
720
732
|
}
|
|
721
|
-
function
|
|
733
|
+
function Ft(n, e, t) {
|
|
722
734
|
const s = ["passive", "capture", "once"], r = {
|
|
723
735
|
capture: "Capture",
|
|
724
736
|
once: "Once",
|
|
@@ -726,8 +738,8 @@ function Pt(n, e, t) {
|
|
|
726
738
|
};
|
|
727
739
|
return Object.keys(e || {}).reduce(
|
|
728
740
|
(o, a) => {
|
|
729
|
-
const i = e[a], u = ve(i.modifiers), c = u.find((
|
|
730
|
-
return
|
|
741
|
+
const i = e[a], u = ve(i.modifiers), c = u.find((f) => s.includes(f)), p = "on" + Ae(a) + (c && r[c] || ""), l = t.__parseFunction(i.handler);
|
|
742
|
+
return l && (o[p] = n.withModifiers(l, u)), o;
|
|
731
743
|
},
|
|
732
744
|
{}
|
|
733
745
|
);
|
|
@@ -736,27 +748,27 @@ function ve(n = {}, e = !1) {
|
|
|
736
748
|
const t = Object.keys(n);
|
|
737
749
|
return e ? t.map((s) => "." + s) : t;
|
|
738
750
|
}
|
|
739
|
-
function
|
|
740
|
-
const { children: o } = e, a =
|
|
751
|
+
function xt(n, e, t, s, r) {
|
|
752
|
+
const { children: o } = e, a = It(e, s), i = s.$slots?.[a.name];
|
|
741
753
|
return i ? i(t) : o ? $(o) ? n.createTextVNode(o) : S(o) ? n.createTextVNode(
|
|
742
754
|
fe(s.__parseExpression(o))
|
|
743
755
|
) : Array.isArray(o) ? o.map(
|
|
744
|
-
(u) =>
|
|
756
|
+
(u) => A(u, s, n, r)
|
|
745
757
|
) : null : null;
|
|
746
758
|
}
|
|
747
|
-
function
|
|
759
|
+
function It(n, e) {
|
|
748
760
|
const { props: t } = n, s = t?.name || "default";
|
|
749
761
|
return {
|
|
750
762
|
name: S(s) ? e.__parseExpression(s) : s,
|
|
751
763
|
params: []
|
|
752
764
|
};
|
|
753
765
|
}
|
|
754
|
-
function
|
|
766
|
+
function Dt(n, e) {
|
|
755
767
|
return e.__parseExpression(n.value) ? {} : {
|
|
756
768
|
display: "none"
|
|
757
769
|
};
|
|
758
770
|
}
|
|
759
|
-
function
|
|
771
|
+
function At(n, e, t) {
|
|
760
772
|
const s = {
|
|
761
773
|
type: "JSFunction",
|
|
762
774
|
value: e.value?.value ? `(v) => {
|
|
@@ -768,7 +780,7 @@ function Ft(n, e, t) {
|
|
|
768
780
|
[`onUpdate:${a}`]: o.length && r ? n.withModifiers(r, o) : r
|
|
769
781
|
};
|
|
770
782
|
}
|
|
771
|
-
function
|
|
783
|
+
function Ot(n, e, t, s, r) {
|
|
772
784
|
if (!e) return null;
|
|
773
785
|
if ($(e))
|
|
774
786
|
return { default: () => e };
|
|
@@ -777,19 +789,19 @@ function xt(n, e, t, s, r) {
|
|
|
777
789
|
default: () => fe(t.__parseExpression(e))
|
|
778
790
|
};
|
|
779
791
|
if (Array.isArray(e) && e.length > 0) {
|
|
780
|
-
const o =
|
|
792
|
+
const o = Ht(e), a = (i) => !i || !r ? {} : r?.id && Object.keys(i).length ? {
|
|
781
793
|
[`scope_${r.id}`]: i
|
|
782
794
|
} : {};
|
|
783
|
-
return Object.entries(o).reduce((i, [u, { nodes: c, params: p }]) => (i[u] = (
|
|
784
|
-
const
|
|
795
|
+
return Object.entries(o).reduce((i, [u, { nodes: c, params: p }]) => (i[u] = (l) => {
|
|
796
|
+
const f = p.length ? Oe(l ?? {}, p) : a(l);
|
|
785
797
|
return c.map(
|
|
786
|
-
(m) =>
|
|
798
|
+
(m) => A(m, t.__clone(f), n, s)
|
|
787
799
|
);
|
|
788
800
|
}, i), {});
|
|
789
801
|
}
|
|
790
802
|
return null;
|
|
791
803
|
}
|
|
792
|
-
function
|
|
804
|
+
function Ht(n) {
|
|
793
805
|
const e = {
|
|
794
806
|
default: {
|
|
795
807
|
params: [],
|
|
@@ -797,7 +809,7 @@ function It(n) {
|
|
|
797
809
|
}
|
|
798
810
|
};
|
|
799
811
|
for (const t of n) {
|
|
800
|
-
const s =
|
|
812
|
+
const s = Mt(t.slot), r = s.name;
|
|
801
813
|
e[r] ? (e[r].nodes.push(t), e[r].params = e[r].params.concat(s.params)) : e[r] = {
|
|
802
814
|
nodes: [t],
|
|
803
815
|
params: s.params
|
|
@@ -805,103 +817,103 @@ function It(n) {
|
|
|
805
817
|
}
|
|
806
818
|
return e;
|
|
807
819
|
}
|
|
808
|
-
function
|
|
820
|
+
function Mt(n = "default") {
|
|
809
821
|
return $(n) ? { name: n, params: [] } : { params: [], ...n };
|
|
810
822
|
}
|
|
811
|
-
function
|
|
823
|
+
function kt(n, e, t) {
|
|
812
824
|
const { value: s, iterator: r } = n, { item: o = "item", index: a = "index" } = r || {};
|
|
813
825
|
let i = t.__parseExpression(s) || [];
|
|
814
826
|
return Number.isInteger(i) && (i = new Array(i).fill(!0).map((u, c) => c + 1)), Array.isArray(i) ? i.map((u, c) => e(t.__clone({ [o]: u, [a]: c }))) : (console.warn("[vForRender]:", `${s?.value} is not a Arrary`), []);
|
|
815
827
|
}
|
|
816
|
-
function
|
|
817
|
-
return
|
|
828
|
+
function Tt(n) {
|
|
829
|
+
return Le() ? (qe(n), !0) : !1;
|
|
818
830
|
}
|
|
819
831
|
function K(n) {
|
|
820
|
-
return typeof n == "function" ? n() :
|
|
832
|
+
return typeof n == "function" ? n() : Je(n);
|
|
821
833
|
}
|
|
822
834
|
const ge = typeof window < "u" && typeof document < "u";
|
|
823
835
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
824
|
-
const
|
|
836
|
+
const Bt = (n) => n != null, Ut = () => {
|
|
825
837
|
};
|
|
826
|
-
function
|
|
838
|
+
function Nt(n) {
|
|
827
839
|
return ie();
|
|
828
840
|
}
|
|
829
|
-
function
|
|
841
|
+
function Lt(...n) {
|
|
830
842
|
if (n.length !== 1)
|
|
831
|
-
return
|
|
843
|
+
return Te(...n);
|
|
832
844
|
const e = n[0];
|
|
833
|
-
return typeof e == "function" ?
|
|
845
|
+
return typeof e == "function" ? Be(Ue(() => ({ get: e, set: Ut }))) : J(e);
|
|
834
846
|
}
|
|
835
|
-
function
|
|
836
|
-
|
|
847
|
+
function qt(n, e) {
|
|
848
|
+
Nt() && Ne(n, e);
|
|
837
849
|
}
|
|
838
|
-
const
|
|
839
|
-
function
|
|
850
|
+
const Jt = ge ? window : void 0, Vt = ge ? window.document : void 0;
|
|
851
|
+
function zt(n) {
|
|
840
852
|
var e;
|
|
841
853
|
const t = K(n);
|
|
842
854
|
return (e = t?.$el) != null ? e : t;
|
|
843
855
|
}
|
|
844
|
-
function
|
|
856
|
+
function Kt() {
|
|
845
857
|
const n = J(!1), e = ie();
|
|
846
|
-
return e &&
|
|
858
|
+
return e && Ve(() => {
|
|
847
859
|
n.value = !0;
|
|
848
860
|
}, e), n;
|
|
849
861
|
}
|
|
850
|
-
function
|
|
851
|
-
const e =
|
|
862
|
+
function Wt(n) {
|
|
863
|
+
const e = Kt();
|
|
852
864
|
return ce(() => (e.value, !!n()));
|
|
853
865
|
}
|
|
854
|
-
function
|
|
855
|
-
const { window: s =
|
|
866
|
+
function Gt(n, e, t = {}) {
|
|
867
|
+
const { window: s = Jt, ...r } = t;
|
|
856
868
|
let o;
|
|
857
|
-
const a =
|
|
869
|
+
const a = Wt(() => s && "MutationObserver" in s), i = () => {
|
|
858
870
|
o && (o.disconnect(), o = void 0);
|
|
859
871
|
}, u = ce(() => {
|
|
860
|
-
const
|
|
872
|
+
const f = K(n), m = (Array.isArray(f) ? f : [f]).map(zt).filter(Bt);
|
|
861
873
|
return new Set(m);
|
|
862
874
|
}), c = ae(
|
|
863
875
|
() => u.value,
|
|
864
|
-
(
|
|
865
|
-
i(), a.value &&
|
|
876
|
+
(f) => {
|
|
877
|
+
i(), a.value && f.size && (o = new MutationObserver(e), f.forEach((m) => o.observe(m, r)));
|
|
866
878
|
},
|
|
867
879
|
{ immediate: !0, flush: "post" }
|
|
868
|
-
), p = () => o?.takeRecords(),
|
|
880
|
+
), p = () => o?.takeRecords(), l = () => {
|
|
869
881
|
c(), i();
|
|
870
882
|
};
|
|
871
|
-
return
|
|
883
|
+
return Tt(l), {
|
|
872
884
|
isSupported: a,
|
|
873
|
-
stop:
|
|
885
|
+
stop: l,
|
|
874
886
|
takeRecords: p
|
|
875
887
|
};
|
|
876
888
|
}
|
|
877
|
-
function
|
|
889
|
+
function Yt(n = null, e = {}) {
|
|
878
890
|
var t, s, r;
|
|
879
891
|
const {
|
|
880
|
-
document: o =
|
|
881
|
-
restoreOnUnmount: a = (
|
|
882
|
-
} = e, i = (t = o?.title) != null ? t : "", u =
|
|
883
|
-
function p(
|
|
892
|
+
document: o = Vt,
|
|
893
|
+
restoreOnUnmount: a = (l) => l
|
|
894
|
+
} = e, i = (t = o?.title) != null ? t : "", u = Lt((s = n ?? o?.title) != null ? s : null), c = n && typeof n == "function";
|
|
895
|
+
function p(l) {
|
|
884
896
|
if (!("titleTemplate" in e))
|
|
885
|
-
return
|
|
886
|
-
const
|
|
887
|
-
return typeof
|
|
897
|
+
return l;
|
|
898
|
+
const f = e.titleTemplate || "%s";
|
|
899
|
+
return typeof f == "function" ? f(l) : K(f).replace(/%s/g, l);
|
|
888
900
|
}
|
|
889
901
|
return ae(
|
|
890
902
|
u,
|
|
891
|
-
(
|
|
892
|
-
|
|
903
|
+
(l, f) => {
|
|
904
|
+
l !== f && o && (o.title = p(typeof l == "string" ? l : ""));
|
|
893
905
|
},
|
|
894
906
|
{ immediate: !0 }
|
|
895
|
-
), e.observe && !e.titleTemplate && o && !c &&
|
|
907
|
+
), e.observe && !e.titleTemplate && o && !c && Gt(
|
|
896
908
|
(r = o.head) == null ? void 0 : r.querySelector("title"),
|
|
897
909
|
() => {
|
|
898
910
|
o && o.title !== u.value && (u.value = p(o.title));
|
|
899
911
|
},
|
|
900
912
|
{ childList: !0 }
|
|
901
|
-
),
|
|
913
|
+
), qt(() => {
|
|
902
914
|
if (a) {
|
|
903
|
-
const
|
|
904
|
-
|
|
915
|
+
const l = a(i, u.value || "");
|
|
916
|
+
l != null && o && (o.title = l);
|
|
905
917
|
}
|
|
906
918
|
}), u;
|
|
907
919
|
}
|
|
@@ -909,7 +921,7 @@ const se = ue({
|
|
|
909
921
|
name: "VtjPageContainer",
|
|
910
922
|
async setup() {
|
|
911
923
|
const n = _e(), e = le(), t = e.params.id, s = t ? n.getPage(t) : n.getHomepage(), r = s ? await n.getRenderComponent(s.id) : null;
|
|
912
|
-
return s &&
|
|
924
|
+
return s && Yt(s.title || "VTJ"), {
|
|
913
925
|
provider: n,
|
|
914
926
|
component: r,
|
|
915
927
|
file: s,
|
|
@@ -919,14 +931,14 @@ const se = ue({
|
|
|
919
931
|
render() {
|
|
920
932
|
return this.component ? U(this.component, this.query) : U("div", "页面不存在");
|
|
921
933
|
}
|
|
922
|
-
}),
|
|
934
|
+
}), Qt = ue({
|
|
923
935
|
name: "VtjStartupContainer",
|
|
924
936
|
render() {
|
|
925
|
-
return U(
|
|
937
|
+
return U(We);
|
|
926
938
|
}
|
|
927
939
|
}), ye = Symbol("Provider");
|
|
928
|
-
var
|
|
929
|
-
class
|
|
940
|
+
var Xt = /* @__PURE__ */ ((n) => (n.Production = "production", n.Development = "development", n))(Xt || {});
|
|
941
|
+
class Zt extends $e {
|
|
930
942
|
constructor(e) {
|
|
931
943
|
super(), this.options = e;
|
|
932
944
|
const {
|
|
@@ -939,18 +951,18 @@ class Gt extends Se {
|
|
|
939
951
|
globals: u = {},
|
|
940
952
|
modules: c = {},
|
|
941
953
|
router: p = null,
|
|
942
|
-
materialPath:
|
|
943
|
-
nodeEnv:
|
|
954
|
+
materialPath: l = "./",
|
|
955
|
+
nodeEnv: f = "development"
|
|
944
956
|
/* Development */
|
|
945
957
|
} = e;
|
|
946
|
-
this.mode = s, this.modules = c, this.service = t, this.router = p, this.materialPath =
|
|
958
|
+
this.mode = s, this.modules = c, this.service = t, this.router = p, this.materialPath = l, this.nodeEnv = f, r && (this.dependencies = r), o && (this.materials = o), Object.assign(this.globals, u), Object.assign(this.adapter, i);
|
|
947
959
|
const { access: m, request: d } = this.adapter;
|
|
948
960
|
m && m.connect({ mode: s, router: p, request: d }), s !== _.Design && this.load(a);
|
|
949
961
|
}
|
|
950
962
|
mode;
|
|
951
963
|
globals = {};
|
|
952
964
|
modules = {};
|
|
953
|
-
adapter = { request:
|
|
965
|
+
adapter = { request: it, jsonp: He };
|
|
954
966
|
apis = {};
|
|
955
967
|
dependencies = {};
|
|
956
968
|
materials = {};
|
|
@@ -967,7 +979,7 @@ class Gt extends Se {
|
|
|
967
979
|
if (this.project = t ? await t() : await this.service.init(e), !this.project)
|
|
968
980
|
throw new Error("project is null");
|
|
969
981
|
const { apis: s = [], meta: r = [] } = this.project, o = window;
|
|
970
|
-
o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis =
|
|
982
|
+
o.CKEDITOR_VERSION = void 0, this.nodeEnv !== "production" ? await this.loadAssets(o) : await this.loadDependencies(o), this.apis = ut(s, r, this.adapter), pe(), this.project.config?.mock && lt(s), this.initRouter(), this.triggerReady();
|
|
971
983
|
}
|
|
972
984
|
async loadDependencies(e) {
|
|
973
985
|
const t = Object.entries(this.dependencies);
|
|
@@ -979,9 +991,9 @@ class Gt extends Se {
|
|
|
979
991
|
libraryExports: u,
|
|
980
992
|
libraryMap: c,
|
|
981
993
|
materials: p,
|
|
982
|
-
materialExports:
|
|
983
|
-
materialMapLibrary:
|
|
984
|
-
} =
|
|
994
|
+
materialExports: l,
|
|
995
|
+
materialMapLibrary: f
|
|
996
|
+
} = Ze(
|
|
985
997
|
t,
|
|
986
998
|
a,
|
|
987
999
|
i === "development"
|
|
@@ -996,15 +1008,15 @@ class Gt extends Se {
|
|
|
996
1008
|
else {
|
|
997
1009
|
const v = c[d] || [];
|
|
998
1010
|
for (const g of v)
|
|
999
|
-
V(g) && await
|
|
1011
|
+
V(g) && await tt(d, b.append(g, { v: C })), z(g) && await X(b.append(g, { v: C }));
|
|
1000
1012
|
r[d] = e[d];
|
|
1001
1013
|
}
|
|
1002
1014
|
}
|
|
1003
1015
|
for (const d of p)
|
|
1004
|
-
await X(b.append(d, { v:
|
|
1016
|
+
await X(b.append(d, { v: C }));
|
|
1005
1017
|
const m = this.materials || {};
|
|
1006
|
-
for (const d of
|
|
1007
|
-
const h = e[
|
|
1018
|
+
for (const d of l) {
|
|
1019
|
+
const h = e[f[d]], w = je[d];
|
|
1008
1020
|
if (w)
|
|
1009
1021
|
h && w.forEach((v) => {
|
|
1010
1022
|
o[v] = h[v];
|
|
@@ -1012,7 +1024,7 @@ class Gt extends Se {
|
|
|
1012
1024
|
else {
|
|
1013
1025
|
const v = m[d] ? (await m[d]()).default : e[d];
|
|
1014
1026
|
v && h && (v.components || []).forEach((g) => {
|
|
1015
|
-
o[g.name] =
|
|
1027
|
+
o[g.name] = et(g, h);
|
|
1016
1028
|
});
|
|
1017
1029
|
}
|
|
1018
1030
|
}
|
|
@@ -1026,13 +1038,13 @@ class Gt extends Se {
|
|
|
1026
1038
|
}), e.addRoute({
|
|
1027
1039
|
path: "/",
|
|
1028
1040
|
name: "VtjHomepage",
|
|
1029
|
-
component: t?.homepage ? se :
|
|
1041
|
+
component: t?.homepage ? se : Qt
|
|
1030
1042
|
}));
|
|
1031
1043
|
}
|
|
1032
1044
|
install(e) {
|
|
1033
1045
|
const t = e.config.globalProperties.installed || {};
|
|
1034
1046
|
for (const [s, r] of Object.entries(this.library))
|
|
1035
|
-
!t[s] &&
|
|
1047
|
+
!t[s] && rt(r) && (e.use(r), t[s] = !0);
|
|
1036
1048
|
this.options.install && e.use(this.options.install), this.adapter.access && e.use(this.adapter.access), e.provide(ye, this), e.config.globalProperties.installed = t, this.nodeEnv === "development" && (e.config.errorHandler = (s, r, o) => {
|
|
1037
1049
|
const a = r?.$options.name, i = typeof s == "string" ? s : s?.message || s?.msg || "未知错误", u = `[ ${a} ] ${i} ${o}`;
|
|
1038
1050
|
console.error(
|
|
@@ -1043,7 +1055,7 @@ class Gt extends Se {
|
|
|
1043
1055
|
info: o
|
|
1044
1056
|
},
|
|
1045
1057
|
s?.stack
|
|
1046
|
-
),
|
|
1058
|
+
), H.error({
|
|
1047
1059
|
title: "运行时错误:请在控制台查看详情",
|
|
1048
1060
|
message: u
|
|
1049
1061
|
});
|
|
@@ -1109,12 +1121,12 @@ class Gt extends Se {
|
|
|
1109
1121
|
async getRenderComponent(e) {
|
|
1110
1122
|
const t = this.getFile(e);
|
|
1111
1123
|
if (!t)
|
|
1112
|
-
return
|
|
1124
|
+
return D.warn(`Can not find file: ${e}`), null;
|
|
1113
1125
|
const s = `.vtj/vue/${e}.vue`, r = this.modules[s];
|
|
1114
1126
|
if (r)
|
|
1115
1127
|
return (await r())?.default;
|
|
1116
1128
|
const o = await this.getDsl(t.id);
|
|
1117
|
-
return o ? this.createDslRenderer(o).renderer : (
|
|
1129
|
+
return o ? this.createDslRenderer(o).renderer : (D.warn(`Can not find dsl: ${e}`), null);
|
|
1118
1130
|
}
|
|
1119
1131
|
defineUrlSchemaComponent(e, t) {
|
|
1120
1132
|
return Z(async () => {
|
|
@@ -1126,8 +1138,8 @@ class Gt extends Se {
|
|
|
1126
1138
|
return Z(async () => await me(e, window));
|
|
1127
1139
|
}
|
|
1128
1140
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const e = new
|
|
1141
|
+
function hs(n) {
|
|
1142
|
+
const e = new Zt(n);
|
|
1131
1143
|
return {
|
|
1132
1144
|
provider: e,
|
|
1133
1145
|
onReady: (s) => e.ready(s)
|
|
@@ -1141,7 +1153,7 @@ function _e(n = {}) {
|
|
|
1141
1153
|
const { id: t, version: s } = n;
|
|
1142
1154
|
t && s && (async () => {
|
|
1143
1155
|
const r = await e.getDsl(t);
|
|
1144
|
-
r?.__VERSION__ !== s &&
|
|
1156
|
+
r?.__VERSION__ !== s && H.warning({
|
|
1145
1157
|
title: r?.name,
|
|
1146
1158
|
message: "当前组件源码版本与运行时版本不一致,请重新发布组件"
|
|
1147
1159
|
});
|
|
@@ -1149,7 +1161,7 @@ function _e(n = {}) {
|
|
|
1149
1161
|
}
|
|
1150
1162
|
return e;
|
|
1151
1163
|
}
|
|
1152
|
-
const W = new
|
|
1164
|
+
const W = new Me({
|
|
1153
1165
|
settings: {
|
|
1154
1166
|
type: "json",
|
|
1155
1167
|
validSuccess: !0,
|
|
@@ -1157,12 +1169,12 @@ const W = new He({
|
|
|
1157
1169
|
failMessage: !0,
|
|
1158
1170
|
validate: (n) => n.data?.code === 0,
|
|
1159
1171
|
showError: (n) => {
|
|
1160
|
-
|
|
1172
|
+
H.error({
|
|
1161
1173
|
message: n || "未知错误"
|
|
1162
1174
|
});
|
|
1163
1175
|
}
|
|
1164
1176
|
}
|
|
1165
|
-
}),
|
|
1177
|
+
}), es = (n = "/__vtj__/api/:type.json") => (e, t) => W.send({
|
|
1166
1178
|
url: n,
|
|
1167
1179
|
method: "post",
|
|
1168
1180
|
params: { type: e },
|
|
@@ -1170,7 +1182,7 @@ const W = new He({
|
|
|
1170
1182
|
type: e,
|
|
1171
1183
|
data: t
|
|
1172
1184
|
}
|
|
1173
|
-
}),
|
|
1185
|
+
}), ts = (n = "/__vtj__/api/uploader.json") => async (e, t) => await W.send({
|
|
1174
1186
|
url: n,
|
|
1175
1187
|
method: "post",
|
|
1176
1188
|
data: {
|
|
@@ -1186,7 +1198,7 @@ class G {
|
|
|
1186
1198
|
pluginCaches = {};
|
|
1187
1199
|
uploader;
|
|
1188
1200
|
constructor() {
|
|
1189
|
-
this.api =
|
|
1201
|
+
this.api = es(), this.uploader = ts();
|
|
1190
1202
|
}
|
|
1191
1203
|
async getExtension() {
|
|
1192
1204
|
console.log("BaseService.getExtension");
|
|
@@ -1259,7 +1271,7 @@ class G {
|
|
|
1259
1271
|
return await this.api("clearStaticFiles", e).catch(() => "");
|
|
1260
1272
|
}
|
|
1261
1273
|
async getPluginMaterial(e) {
|
|
1262
|
-
const { urls: t = [] } = e, s = t.filter((o) =>
|
|
1274
|
+
const { urls: t = [] } = e, s = t.filter((o) => Qe(o))[0];
|
|
1263
1275
|
if (!s) return null;
|
|
1264
1276
|
const r = this.pluginCaches[s];
|
|
1265
1277
|
return r || (this.pluginCaches[s] = W.send({
|
|
@@ -1272,12 +1284,12 @@ class G {
|
|
|
1272
1284
|
}).then((o) => o.data).catch(() => null));
|
|
1273
1285
|
}
|
|
1274
1286
|
}
|
|
1275
|
-
const y = new
|
|
1287
|
+
const y = new ke({
|
|
1276
1288
|
type: "local",
|
|
1277
1289
|
expired: 0,
|
|
1278
1290
|
prefix: "__VTJ_"
|
|
1279
1291
|
});
|
|
1280
|
-
class
|
|
1292
|
+
class ms extends G {
|
|
1281
1293
|
init(e) {
|
|
1282
1294
|
const t = new I(e), s = y.get(`project_${t.id}`), r = Object.assign(t.toDsl(), s || {});
|
|
1283
1295
|
return y.save(`project_${t.id}`, r), Promise.resolve(r);
|
|
@@ -1327,7 +1339,7 @@ class ds extends G {
|
|
|
1327
1339
|
}), Promise.resolve(!0);
|
|
1328
1340
|
}
|
|
1329
1341
|
}
|
|
1330
|
-
class
|
|
1342
|
+
class ss extends G {
|
|
1331
1343
|
projects = {};
|
|
1332
1344
|
materials = {};
|
|
1333
1345
|
files = {};
|
|
@@ -1385,10 +1397,10 @@ class Xt extends G {
|
|
|
1385
1397
|
}
|
|
1386
1398
|
}
|
|
1387
1399
|
let x = null;
|
|
1388
|
-
function
|
|
1389
|
-
return x || (x = new
|
|
1400
|
+
function vs() {
|
|
1401
|
+
return x || (x = new ss(), x);
|
|
1390
1402
|
}
|
|
1391
|
-
class
|
|
1403
|
+
class gs extends G {
|
|
1392
1404
|
getFileCaches = {};
|
|
1393
1405
|
async getExtension() {
|
|
1394
1406
|
return await this.api("getExtension", {}).catch(() => {
|
|
@@ -1456,82 +1468,93 @@ function we(n = []) {
|
|
|
1456
1468
|
};
|
|
1457
1469
|
});
|
|
1458
1470
|
}
|
|
1459
|
-
function
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
if (
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1466
|
-
} else
|
|
1467
|
-
|
|
1468
|
-
|
|
1471
|
+
function Se(n, e) {
|
|
1472
|
+
if (!e) return n;
|
|
1473
|
+
let t = [];
|
|
1474
|
+
for (const s of n)
|
|
1475
|
+
if (s.children && s.children.length) {
|
|
1476
|
+
const r = Se(s.children, e);
|
|
1477
|
+
r.length && (s.children = r, t.push(s));
|
|
1478
|
+
} else
|
|
1479
|
+
e[s.id] && t.push(s);
|
|
1480
|
+
return t;
|
|
1481
|
+
}
|
|
1482
|
+
function ys() {
|
|
1483
|
+
const n = _e(), e = le(), t = pt(), s = J(!1), r = t?.getData(), o = n.project;
|
|
1484
|
+
ze(() => {
|
|
1485
|
+
const { name: u, params: c, meta: p } = e;
|
|
1486
|
+
if (u === "VtjPage") {
|
|
1487
|
+
const l = n.getPage(c.id);
|
|
1488
|
+
s.value = !l?.mask;
|
|
1489
|
+
} else if (u === "VtjHomepage") {
|
|
1490
|
+
const l = n.getHomepage();
|
|
1491
|
+
s.value = !l?.mask;
|
|
1469
1492
|
} else
|
|
1470
|
-
|
|
1493
|
+
s.value = !p.mask;
|
|
1471
1494
|
});
|
|
1472
|
-
const
|
|
1495
|
+
const a = we(o?.pages), i = o?.config;
|
|
1473
1496
|
return {
|
|
1474
|
-
disabled:
|
|
1475
|
-
logo:
|
|
1476
|
-
themeSwitchable:
|
|
1477
|
-
title:
|
|
1478
|
-
menus: r
|
|
1497
|
+
disabled: s,
|
|
1498
|
+
logo: i?.logo,
|
|
1499
|
+
themeSwitchable: i?.themeSwitchable,
|
|
1500
|
+
title: i?.title || o?.description || o?.name || "VTJ App",
|
|
1501
|
+
menus: Se(a, r?.permissions)
|
|
1479
1502
|
};
|
|
1480
1503
|
}
|
|
1481
1504
|
export {
|
|
1482
1505
|
he as ACCESS_KEY,
|
|
1483
|
-
|
|
1484
|
-
|
|
1506
|
+
ps as Access,
|
|
1507
|
+
Ge as BUILT_IN_DIRECTIVES,
|
|
1485
1508
|
G as BaseService,
|
|
1486
1509
|
ee as CONTEXT_HOST,
|
|
1487
|
-
|
|
1510
|
+
ht as Context,
|
|
1488
1511
|
_ as ContextMode,
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1512
|
+
Ye as DATA_TYPES,
|
|
1513
|
+
ds as JSCodeToString,
|
|
1514
|
+
us as LIFE_CYCLES_LIST,
|
|
1515
|
+
gs as LocalService,
|
|
1516
|
+
ss as MemoryService,
|
|
1517
|
+
Xt as NodeEnv,
|
|
1518
|
+
Zt as Provider,
|
|
1519
|
+
ms as StorageService,
|
|
1520
|
+
C as VTJ_RENDERER_VERSION,
|
|
1498
1521
|
de as adoptedStyleSheets,
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1522
|
+
ls as createAssetScripts,
|
|
1523
|
+
fs as createAssetsCss,
|
|
1524
|
+
St as createDataSources,
|
|
1502
1525
|
L as createLoader,
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1526
|
+
vs as createMemoryService,
|
|
1527
|
+
ct as createMetaApi,
|
|
1528
|
+
hs as createProvider,
|
|
1506
1529
|
N as createRenderer,
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1530
|
+
at as createSchemaApi,
|
|
1531
|
+
ut as createSchemaApis,
|
|
1532
|
+
Et as defaultLoader,
|
|
1510
1533
|
F as fillBasePath,
|
|
1511
1534
|
ve as getModifiers,
|
|
1512
1535
|
me as getPlugin,
|
|
1513
|
-
|
|
1536
|
+
et as getRawComponent,
|
|
1514
1537
|
V as isCSSUrl,
|
|
1515
|
-
|
|
1538
|
+
ot as isJSCode,
|
|
1516
1539
|
S as isJSExpression,
|
|
1517
1540
|
M as isJSFunction,
|
|
1518
|
-
|
|
1541
|
+
Qe as isJSON,
|
|
1519
1542
|
z as isJSUrl,
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1543
|
+
rt as isVuePlugin,
|
|
1544
|
+
tt as loadCss,
|
|
1545
|
+
st as loadCssUrl,
|
|
1546
|
+
nt as loadScriptUrl,
|
|
1547
|
+
ft as mockApi,
|
|
1548
|
+
lt as mockApis,
|
|
1526
1549
|
pe as mockCleanup,
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1550
|
+
A as nodeRender,
|
|
1551
|
+
Ze as parseDeps,
|
|
1552
|
+
R as parseExpression,
|
|
1530
1553
|
te as parseFunction,
|
|
1531
1554
|
ye as providerKey,
|
|
1532
|
-
|
|
1555
|
+
Xe as removeProdFlag,
|
|
1533
1556
|
fe as toString,
|
|
1534
|
-
|
|
1535
|
-
|
|
1557
|
+
pt as useAccess,
|
|
1558
|
+
ys as useMask,
|
|
1536
1559
|
_e as useProvider
|
|
1537
1560
|
};
|