@lcap/nasl 3.9.0-beta.46 → 3.9.0-beta.47
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/out/common/Messager.d.ts +0 -1
- package/out/common/Messager.d.ts.map +1 -1
- package/out/common/Messager.js +5 -12
- package/out/common/Messager.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +30 -1
- package/out/generator/genBundleFiles.d.ts.map +1 -1
- package/out/generator/genBundleFiles.js +101 -122
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/release-body/body.d.ts +0 -1
- package/out/generator/release-body/body.d.ts.map +1 -1
- package/out/generator/release-body/body.js +7 -19
- package/out/generator/release-body/body.js.map +1 -1
- package/out/generator/release-body/data.d.ts +0 -1
- package/out/generator/release-body/data.d.ts.map +1 -1
- package/out/generator/release-body/data.js +3 -3
- package/out/generator/release-body/data.js.map +1 -1
- package/out/generator/release-body/internal.d.ts +0 -1
- package/out/generator/release-body/internal.d.ts.map +1 -1
- package/out/generator/release-body/internal.js.map +1 -1
- package/out/generator/release-body/types.d.ts +0 -31
- package/out/generator/release-body/types.d.ts.map +1 -1
- package/out/generator/release-body/types.js.map +1 -1
- package/out/generator/release-body/utils.d.ts +4 -5
- package/out/generator/release-body/utils.d.ts.map +1 -1
- package/out/generator/release-body/utils.js +1 -53
- package/out/generator/release-body/utils.js.map +1 -1
- package/out/generator/ui-library-declaration/dependency.d.ts.map +1 -1
- package/out/generator/ui-library-declaration/dependency.js +1 -0
- package/out/generator/ui-library-declaration/dependency.js.map +1 -1
- package/out/natural/tools.d.ts +0 -5
- package/out/natural/tools.d.ts.map +1 -1
- package/out/natural/tools.js +1 -30
- package/out/natural/tools.js.map +1 -1
- package/out/natural/transformTS2UI.d.ts.map +1 -1
- package/out/natural/transformTS2UI.js +2 -5
- package/out/natural/transformTS2UI.js.map +1 -1
- package/out/natural/transformTSCode.d.ts +1 -1
- package/out/natural/transformTSCode.d.ts.map +1 -1
- package/out/natural/transformTSCode.js +1 -3
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/naslServer.d.ts.map +1 -1
- package/out/server/naslServer.js +9 -12
- package/out/server/naslServer.js.map +1 -1
- package/out/service/storage/init.d.ts.map +1 -1
- package/out/service/storage/init.js +0 -8
- package/out/service/storage/init.js.map +1 -1
- package/package.json +11 -11
- package/ts-worker/lib/Messager.js +2 -1
package/out/common/Messager.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Messager.d.ts","sourceRoot":"","sources":["../../src/common/Messager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Messager.d.ts","sourceRoot":"","sources":["../../src/common/Messager.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAClB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/B,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,GAAG,CAAC;IACb;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC;IACpC;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,OAAO,EAAE,OAAO,CAAC;IAEjB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAEnB,OAAO,EAAE,OAAO;IA6B5B,OAAO;IAQP;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,OAAO;IAW5B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,GAAG;IASlB;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAU3C;;;OAGG;IACH,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IA0BnE;;;OAGG;IACH,WAAW,CAAC,IAAI,EAAE,GAAG;IAWrB;;;OAGG;IACH,cAAc,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;IAYrE;;;OAGG;IACH,iBAAiB,CAAC,CAAC,EAAE,YAAY;IAKjC;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,GAAG;CAoDzB"}
|
package/out/common/Messager.js
CHANGED
|
@@ -7,7 +7,6 @@ const uuid_1 = require("uuid");
|
|
|
7
7
|
*/
|
|
8
8
|
class Messager {
|
|
9
9
|
constructor(options) {
|
|
10
|
-
this.count = 0;
|
|
11
10
|
this.options = {
|
|
12
11
|
protocol: 'vusion',
|
|
13
12
|
sender: 'platform',
|
|
@@ -51,10 +50,10 @@ class Messager {
|
|
|
51
50
|
* 比较原生,直接给目标 window 中 postMessage
|
|
52
51
|
*/
|
|
53
52
|
sendMessage(message) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
const logLevel = message.logLevel || this.options.logLevel;
|
|
54
|
+
if (logLevel === 'info') {
|
|
55
|
+
// console.info(`[messager]`, str);
|
|
56
|
+
}
|
|
58
57
|
const sender = this.options.getSender.call(this.options.context);
|
|
59
58
|
if (typeof window !== 'undefined' && sender instanceof Window)
|
|
60
59
|
sender.postMessage(message, '*');
|
|
@@ -159,13 +158,7 @@ class Messager {
|
|
|
159
158
|
* @override
|
|
160
159
|
*/
|
|
161
160
|
onDataReceived(data) {
|
|
162
|
-
|
|
163
|
-
if (this.count === 5) {
|
|
164
|
-
this.count = 0;
|
|
165
|
-
// 预留时间做 minor gc,减少峰值内存占用
|
|
166
|
-
// 虽然是错误的写法,但起效果了
|
|
167
|
-
(async () => await new Promise(resolve => setTimeout(resolve, 30)))();
|
|
168
|
-
}
|
|
161
|
+
// console.log('nasl onDataReceived: ', data);
|
|
169
162
|
if (data.protocol !== this.options.protocol)
|
|
170
163
|
return;
|
|
171
164
|
if (data.type === 'response') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Messager.js","sourceRoot":"","sources":["../../src/common/Messager.ts"],"names":[],"mappings":";;AAAA,+BAAoC;
|
|
1
|
+
{"version":3,"file":"Messager.js","sourceRoot":"","sources":["../../src/common/Messager.ts"],"names":[],"mappings":";;AAAA,+BAAoC;AAsCpC;;;GAGG;AACH,MAAqB,QAAQ;IAK3B,YAAY,OAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG;YACb,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,UAAU;YAClB,QAAQ,EAAE,MAAM;YAChB,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,KAAK;YACf,SAAS;gBAC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CAAC;YACD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC5B,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC;qBACxB,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;oBACf,IAAI,CAAC,WAAW,CAAC;wBACf,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;wBAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;wBAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;wBACvB,IAAI,EAAE,UAAU;wBAChB,OAAO,EAAE,IAAI,CAAC,OAAO;wBACrB,MAAM;qBACP,CAAC,CAAC;gBACL,CAAC,CAAC;qBACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;oBACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBACrB,IAAI,CAAC,WAAW,CAAC;wBACf,EAAE,EAAE,IAAI,CAAC,EAAE;wBACX,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;wBAC/B,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;wBAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;wBACvB,IAAI,EAAE,UAAU;wBAChB,OAAO,EAAE,IAAI,CAAC,OAAO;wBACrB,KAAK;qBACN,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACP,CAAC;YACD,OAAO;QACT,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;CACF;AAvND,2BAuNC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { App, View, Frontend } from '../concepts';
|
|
2
2
|
import { RawOptions } from '.';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Asset } from './release-body/internal';
|
|
4
4
|
export interface Route {
|
|
5
5
|
path?: string;
|
|
6
6
|
component?: RawOptions;
|
|
@@ -11,6 +11,34 @@ export interface Route {
|
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
+
interface Config {
|
|
15
|
+
tenant: string;
|
|
16
|
+
env: string;
|
|
17
|
+
debug: boolean;
|
|
18
|
+
nuimsDomain: string;
|
|
19
|
+
STATIC_URL: string;
|
|
20
|
+
USER_STATIC_URL: string;
|
|
21
|
+
extendedConfig: string;
|
|
22
|
+
lowcodeDomain: string;
|
|
23
|
+
envLcpDomain: any;
|
|
24
|
+
envNuimsDomain: any;
|
|
25
|
+
tenantType: any;
|
|
26
|
+
tenantLevel: any;
|
|
27
|
+
appid: string;
|
|
28
|
+
isExport?: string;
|
|
29
|
+
sysPrefixPath?: string;
|
|
30
|
+
isPureFeMode?: Boolean;
|
|
31
|
+
realRelease?: string;
|
|
32
|
+
devDnsAddr: string;
|
|
33
|
+
miniEnable: boolean;
|
|
34
|
+
isPreviewFe?: boolean;
|
|
35
|
+
framework?: 'vue' | 'react';
|
|
36
|
+
previewVersion?: string;
|
|
37
|
+
assets: Array<Asset>;
|
|
38
|
+
assetsMap: Map<string, Asset>;
|
|
39
|
+
diffNodePaths: Array<string>;
|
|
40
|
+
isFull: boolean;
|
|
41
|
+
}
|
|
14
42
|
export declare function genBundleFiles(app: App, frontend: Frontend, config: Config): any[];
|
|
15
43
|
export declare function genFrontendBundleFiles(app: App, frontends: Array<Frontend>, config: Config): Promise<any[]>;
|
|
16
44
|
export declare function getOneFiles(options: {
|
|
@@ -18,4 +46,5 @@ export declare function getOneFiles(options: {
|
|
|
18
46
|
action: string;
|
|
19
47
|
cacheRouters: Route[];
|
|
20
48
|
}): any[];
|
|
49
|
+
export {};
|
|
21
50
|
//# sourceMappingURL=genBundleFiles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genBundleFiles.d.ts","sourceRoot":"","sources":["../../src/generator/genBundleFiles.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,GAAG,EAAU,IAAI,EA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AAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAE9B,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7B,MAAM,EAAE,OAAO,CAAC;CACjB;AA0JD,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAm3B1E;AAED,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,kBAoBhG;AAGD,wBAAgB,WAAW,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,KAAK,EAAE,CAAA;CAAE,SAiGzF"}
|
|
@@ -200,13 +200,10 @@ function genBundleFiles(app, frontend, config) {
|
|
|
200
200
|
const componentMap = {};
|
|
201
201
|
// 需要放在清除断点节点之前
|
|
202
202
|
let compRegStr = '';
|
|
203
|
-
let viewCount = 0;
|
|
204
203
|
try {
|
|
205
204
|
config?.debug && (0, breakpoint_1.genBreakpoints)(app);
|
|
206
205
|
if ((!config?.isExport && config?.env === 'dev') || config?.debug) {
|
|
207
206
|
(0, nasl_log_1.genLogs)(app);
|
|
208
|
-
// utils.delay 是错误用法,但不知为何能降峰值内存,写成 await utils.delay 反而没太大效果
|
|
209
|
-
utils.delay(100);
|
|
210
207
|
}
|
|
211
208
|
app.curDeployEnv = config.env;
|
|
212
209
|
console.time('toVueOptions');
|
|
@@ -216,41 +213,33 @@ function genBundleFiles(app, frontend, config) {
|
|
|
216
213
|
if (!config?.isFull && config?.diffNodePaths?.length) {
|
|
217
214
|
diffNodePaths = config.diffNodePaths;
|
|
218
215
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (viewCount === 10) {
|
|
226
|
-
// 预留时间做 minor gc,防止峰值内存过高
|
|
227
|
-
utils.delay(55);
|
|
228
|
-
viewCount = 0;
|
|
229
|
-
}
|
|
230
|
-
let viewFlag = false;
|
|
231
|
-
if (nd.toVueOptions) {
|
|
232
|
-
if (diffNodePaths.length) {
|
|
233
|
-
// 如果当前有列表长度,而且当前节点路径在列表中,表示需要生成代码
|
|
234
|
-
if (diffNodePaths.includes(nd.nodePath)) {
|
|
235
|
-
viewFlag = true;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
// 如果没有配置diffNodePaths,表示全部导出
|
|
240
|
-
// 每个页面都发就对了
|
|
216
|
+
utils.traverse((current) => {
|
|
217
|
+
let viewFlag = false;
|
|
218
|
+
if (current.node.toVueOptions) {
|
|
219
|
+
if (diffNodePaths.length) {
|
|
220
|
+
// 如果当前有列表长度,而且当前节点路径在列表中,表示需要生成代码
|
|
221
|
+
if (diffNodePaths.includes(current.node.nodePath)) {
|
|
241
222
|
viewFlag = true;
|
|
242
223
|
}
|
|
243
224
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
});
|
|
225
|
+
else {
|
|
226
|
+
// 如果没有配置diffNodePaths,表示全部导出
|
|
227
|
+
// 每个页面都发就对了
|
|
228
|
+
viewFlag = true;
|
|
249
229
|
}
|
|
250
|
-
}
|
|
230
|
+
}
|
|
231
|
+
if (viewFlag) {
|
|
232
|
+
componentMap[current.node.id] = current.node.toVueOptions({
|
|
233
|
+
isExport: !!config.isExport,
|
|
234
|
+
isRelease: !!config.realRelease,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
238
|
+
node: {
|
|
239
|
+
children: views,
|
|
240
|
+
},
|
|
251
241
|
});
|
|
252
242
|
console.timeEnd('toVueOptions');
|
|
253
|
-
utils.delay(55);
|
|
254
243
|
businessComponents.forEach((businessComponent) => {
|
|
255
244
|
const frontendI18nEnabled = frontend?.i18nInfo?.enabled;
|
|
256
245
|
const vueOptions = businessComponent.toVueOptions({ frontendI18nEnabled });
|
|
@@ -261,10 +250,8 @@ function genBundleFiles(app, frontend, config) {
|
|
|
261
250
|
finally {
|
|
262
251
|
if ((!config?.isExport && config?.env === 'dev') || config?.debug) {
|
|
263
252
|
(0, nasl_log_1.clearLogs)(app);
|
|
264
|
-
utils.delay(100);
|
|
265
253
|
}
|
|
266
254
|
config?.debug && (0, breakpoint_1.clearBreakpoints)(app);
|
|
267
|
-
utils.delay(100);
|
|
268
255
|
}
|
|
269
256
|
const getBundleFileName = () => {
|
|
270
257
|
if (config.isPreviewFe && config.previewVersion) {
|
|
@@ -290,15 +277,8 @@ function genBundleFiles(app, frontend, config) {
|
|
|
290
277
|
const baseResourcePaths = [];
|
|
291
278
|
const rootViewData = [];
|
|
292
279
|
let defaultRoute = '';
|
|
293
|
-
viewCount = 0;
|
|
294
280
|
// 遍历页面
|
|
295
281
|
const traverseViews = (view, isParentViewAuth) => {
|
|
296
|
-
viewCount++;
|
|
297
|
-
if (viewCount === 10) {
|
|
298
|
-
// 预留时间做 minor gc,防止峰值内存过高
|
|
299
|
-
utils.delay(55);
|
|
300
|
-
viewCount = 0;
|
|
301
|
-
}
|
|
302
282
|
const parentNode = view.parentNode || {};
|
|
303
283
|
const isRootView = parentNode.concept !== 'View';
|
|
304
284
|
const viewName = view.name;
|
|
@@ -489,10 +469,7 @@ function genBundleFiles(app, frontend, config) {
|
|
|
489
469
|
let metaDataStr;
|
|
490
470
|
try {
|
|
491
471
|
metaData = (0, nasl_unified_frontend_generator_1.genMetaData)(app, frontend, config);
|
|
492
|
-
utils.delay(55);
|
|
493
472
|
metaDataStr = stringifyMetaData(metaData);
|
|
494
|
-
metaData = null;
|
|
495
|
-
utils.delay(55);
|
|
496
473
|
}
|
|
497
474
|
catch (error) {
|
|
498
475
|
throw error;
|
|
@@ -502,11 +479,10 @@ function genBundleFiles(app, frontend, config) {
|
|
|
502
479
|
}
|
|
503
480
|
const assetsInfo = app.genAllAssetsInfo(STATIC_URL, frontend.type, frontendType.frameworkKind);
|
|
504
481
|
const customNames = JSON5.stringify(assetsInfo.custom.names);
|
|
505
|
-
let
|
|
482
|
+
let content = `(async function(){
|
|
506
483
|
`;
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
contentScale = `{
|
|
484
|
+
if (frontend.globalScaleEnabled && frontendType.kind === 'pc') {
|
|
485
|
+
content += `{
|
|
510
486
|
// 如果是顶层页面,才使用iframe缩放,否则会死循环
|
|
511
487
|
if(!window.isScaledFrame){
|
|
512
488
|
// 顶层页面里有个iframe,用来缩放页面
|
|
@@ -565,8 +541,9 @@ function genBundleFiles(app, frontend, config) {
|
|
|
565
541
|
});
|
|
566
542
|
}
|
|
567
543
|
}`;
|
|
544
|
+
}
|
|
568
545
|
if (frontend.globalScaleEnabled && frontendType.kind === 'h5') {
|
|
569
|
-
|
|
546
|
+
content += `{
|
|
570
547
|
// 使用viewport缩放,用js计算viewport的缩放比例
|
|
571
548
|
// 创建meta标签
|
|
572
549
|
const meta = document.createElement('meta');
|
|
@@ -585,22 +562,25 @@ function genBundleFiles(app, frontend, config) {
|
|
|
585
562
|
scalePage();
|
|
586
563
|
}`;
|
|
587
564
|
}
|
|
588
|
-
|
|
589
|
-
|
|
565
|
+
const themeCSS = frontend.genThemeCSS();
|
|
566
|
+
if (themeCSS) {
|
|
567
|
+
content += `{
|
|
590
568
|
const el = document.createElement('style');
|
|
591
569
|
el.id = 'theme';
|
|
592
570
|
el.innerHTML = \`${themeCSS}\`;
|
|
593
571
|
document.head.appendChild(el);
|
|
594
572
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
573
|
+
`;
|
|
574
|
+
}
|
|
575
|
+
if (frontend.documentIcon) {
|
|
576
|
+
content += `{
|
|
598
577
|
const link = document.createElement('link');
|
|
599
578
|
link.rel = 'shortcut icon';
|
|
600
579
|
link.href = \`${frontend.documentIcon}\`;
|
|
601
580
|
document.head.appendChild(link);
|
|
602
|
-
}
|
|
603
|
-
|
|
581
|
+
}`;
|
|
582
|
+
}
|
|
583
|
+
content += `
|
|
604
584
|
var customNames = ${customNames};
|
|
605
585
|
for(var i=0;i<customNames.length;i++){
|
|
606
586
|
var name = window.kebab2Camel(customNames[i]);
|
|
@@ -609,7 +589,7 @@ function genBundleFiles(app, frontend, config) {
|
|
|
609
589
|
install(window.Vue, window[name]);
|
|
610
590
|
}
|
|
611
591
|
}`;
|
|
612
|
-
|
|
592
|
+
content += `
|
|
613
593
|
var platformConfig = ${platformConfig};
|
|
614
594
|
var metaData = ${metaDataStr};
|
|
615
595
|
|
|
@@ -670,37 +650,39 @@ function genBundleFiles(app, frontend, config) {
|
|
|
670
650
|
`;
|
|
671
651
|
// 按页面维度发布先不考虑鉴权,页面维度新增的页面都算是不鉴权的数组中
|
|
672
652
|
// 只有完全页面维度新增的才会进入到这个数组中
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
653
|
+
if (config.env === 'dev') {
|
|
654
|
+
content += (0, nasl_log_1.logReportCode)(app?.sysPrefixPath);
|
|
655
|
+
content += `
|
|
656
|
+
function iterateRouters(routers, parentPath = '') {
|
|
657
|
+
routers.forEach(function(route) {
|
|
658
|
+
var fullPath = parentPath + route.path;
|
|
659
|
+
if (fullPath === '*') return;
|
|
660
|
+
if (!(platformConfig.authResourcePaths.includes(fullPath) || platformConfig.baseResourcePaths.includes(fullPath))) {
|
|
661
|
+
platformConfig.baseResourcePaths.push(fullPath);
|
|
662
|
+
}
|
|
663
|
+
if (route.children) {
|
|
664
|
+
iterateRouters(route.children, fullPath + '/');
|
|
665
|
+
}
|
|
666
|
+
});
|
|
685
667
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
}
|
|
698
|
-
} catch (e) { console.error(e) }
|
|
668
|
+
iterateRouters(routes);`;
|
|
669
|
+
}
|
|
670
|
+
content += `
|
|
671
|
+
window.createLcapApp = () => {
|
|
672
|
+
${compRegStr}
|
|
673
|
+
appVM = window.cloudAdminDesigner.init(platformConfig.appConfig, platformConfig, routes, metaData);
|
|
674
|
+
try {
|
|
675
|
+
var push = appVM.$router.history.push;
|
|
676
|
+
appVM.$router.history.push = function (a, b) {
|
|
677
|
+
push.apply(this, [a, b, console.warn]);
|
|
678
|
+
};
|
|
679
|
+
} catch (e) { console.error(e) }
|
|
699
680
|
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
681
|
+
return window.appVM = appVM;
|
|
682
|
+
};
|
|
683
|
+
window.createLcapApp();`;
|
|
684
|
+
if (frontend.globalScaleEnabled && frontendType.kind === 'pc') {
|
|
685
|
+
content += `
|
|
704
686
|
// 同步逻辑仅在 iframe 内部执行
|
|
705
687
|
if(window.isScaledFrame) {
|
|
706
688
|
/**
|
|
@@ -767,10 +749,25 @@ function genBundleFiles(app, frontend, config) {
|
|
|
767
749
|
if(shortcutIconLink) parent.document.head.appendChild(shortcutIconLink);
|
|
768
750
|
});
|
|
769
751
|
}
|
|
770
|
-
|
|
771
|
-
|
|
752
|
+
`;
|
|
753
|
+
}
|
|
754
|
+
content += `
|
|
772
755
|
})();`;
|
|
773
|
-
|
|
756
|
+
if (config.env === 'dev') {
|
|
757
|
+
// 加载资源js
|
|
758
|
+
// const domain = fnLowcodeDomain.slice(fnLowcodeDomain.indexOf('.') + 1);
|
|
759
|
+
// const targetUrl = `${typeof location !== 'undefined' ? location.origin : `http://${config.tenant}.${fnLowcodeDomain}`}/empty?url=${domain}&appid=${config.appid}`;
|
|
760
|
+
// if(!document.querySelector("iframe[name='iframeEmpty']")){
|
|
761
|
+
// var el = document.createElement('iframe');
|
|
762
|
+
// el.setAttribute('src', "${targetUrl}");
|
|
763
|
+
// el.setAttribute('name', 'iframeEmpty');
|
|
764
|
+
// el.setAttribute('width', 0);
|
|
765
|
+
// el.setAttribute('height', 0);
|
|
766
|
+
// el.style.borderWidth = 0
|
|
767
|
+
// el.style.display= "block"
|
|
768
|
+
// document.getElementsByTagName('body')[0].appendChild(el);
|
|
769
|
+
// document.domain = '${domain}'
|
|
770
|
+
const str = `
|
|
774
771
|
var _div = document.createElement('div');
|
|
775
772
|
_div.classList = "div-load"
|
|
776
773
|
_div.innerHTML = "<div class='loading-container'></div><div>正在更新最新发布内容...</div>"
|
|
@@ -829,15 +826,17 @@ function genBundleFiles(app, frontend, config) {
|
|
|
829
826
|
window.location.reload();
|
|
830
827
|
}
|
|
831
828
|
})
|
|
832
|
-
|
|
829
|
+
`;
|
|
830
|
+
content += str;
|
|
831
|
+
}
|
|
833
832
|
let annoDep = app?.dependencies?.filter(dep => dep?.annotations?.length > 0);
|
|
834
|
-
|
|
833
|
+
annoDep?.map(dep => {
|
|
835
834
|
dep?.annotations?.filter(anno => anno.applyTo.includes('ViewElement'))
|
|
836
835
|
.map(anno => {
|
|
837
836
|
let depName = dep.name;
|
|
838
837
|
let annoName = anno.name;
|
|
839
838
|
let annoStr = `
|
|
840
|
-
|
|
839
|
+
const ${annoName} = {
|
|
841
840
|
async handle(el, binding, vnode, oldVnode) {
|
|
842
841
|
if(window.Vue.prototype.$library && window.Vue.prototype.$library['${depName}']){
|
|
843
842
|
window.Vue.prototype.$library['${depName}'].${annoName}(el, binding, vnode, oldVnode)
|
|
@@ -851,11 +850,12 @@ function genBundleFiles(app, frontend, config) {
|
|
|
851
850
|
},
|
|
852
851
|
};
|
|
853
852
|
window.Vue.directive('${annoName}', ${annoName});`;
|
|
854
|
-
|
|
853
|
+
content += annoStr;
|
|
855
854
|
});
|
|
856
855
|
});
|
|
857
856
|
let hasViewElementAnno = annoDep?.filter(dep => dep?.annotations?.filter(anno => anno.applyTo.includes('ViewElement'))?.length > 0)?.length > 0;
|
|
858
|
-
|
|
857
|
+
if (hasViewElementAnno) {
|
|
858
|
+
const fetchAnnoData = `
|
|
859
859
|
function fetchAnnoData() {
|
|
860
860
|
return new Promise(async (resolve, reject) => {
|
|
861
861
|
if (window.annotationAllData) {
|
|
@@ -881,25 +881,10 @@ function genBundleFiles(app, frontend, config) {
|
|
|
881
881
|
});
|
|
882
882
|
};
|
|
883
883
|
fetchAnnoData();
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
content1 = null;
|
|
889
|
-
contentScale = null;
|
|
890
|
-
contentStyleCss = null;
|
|
891
|
-
contentDocIcon = null;
|
|
892
|
-
contentCustomNames = null;
|
|
893
|
-
contentImport = null;
|
|
894
|
-
contentLogReportCode = null;
|
|
895
|
-
contentRouter = null;
|
|
896
|
-
contentCreateLCAPApp = null;
|
|
897
|
-
contentPCIframe = null;
|
|
898
|
-
content10 = null;
|
|
899
|
-
contentDevOnly = null;
|
|
900
|
-
contentVueDirectives = null;
|
|
901
|
-
contentViewElemAnno = null;
|
|
902
|
-
utils.delay(100);
|
|
884
|
+
|
|
885
|
+
`;
|
|
886
|
+
content += fetchAnnoData;
|
|
887
|
+
}
|
|
903
888
|
let bundleMinPath = completePath + getCompletePath(getBundleFileName(), content, config);
|
|
904
889
|
const otherJsList = frontend?.appletsConfig?.enable ? ['//res.wx.qq.com/open/js/jweixin-1.3.2.js'] : [];
|
|
905
890
|
const microAppIntegration = (0, microApp_1.integrateMicroApp)(frontend);
|
|
@@ -1005,14 +990,11 @@ function genBundleFiles(app, frontend, config) {
|
|
|
1005
990
|
loadJSWrap(${JSON5.stringify(jsAssetsList)});
|
|
1006
991
|
loadCSSWrap(${JSON5.stringify(cssAssetsList)});
|
|
1007
992
|
}`;
|
|
1008
|
-
|
|
1009
|
-
cssAssetsList = null;
|
|
1010
|
-
let assetsContent = `(function() {
|
|
993
|
+
const assetsContent = `(function() {
|
|
1011
994
|
${config.isPreviewFe ? loadMockAssets : loadAssets}
|
|
1012
995
|
${microAppIntegration || 'loadAssets();'}
|
|
1013
996
|
})()
|
|
1014
997
|
`;
|
|
1015
|
-
utils.delay(20);
|
|
1016
998
|
const outputs = [
|
|
1017
999
|
{
|
|
1018
1000
|
name: bundleMinPath,
|
|
@@ -1024,9 +1006,6 @@ function genBundleFiles(app, frontend, config) {
|
|
|
1024
1006
|
},
|
|
1025
1007
|
...routerFiles,
|
|
1026
1008
|
];
|
|
1027
|
-
assetsContent = null;
|
|
1028
|
-
content = null;
|
|
1029
|
-
utils.delay(20);
|
|
1030
1009
|
processAssetsInOutputs(outputs, frontend, config);
|
|
1031
1010
|
return outputs;
|
|
1032
1011
|
}
|
|
@@ -1044,9 +1023,9 @@ async function genFrontendBundleFiles(app, frontends, config) {
|
|
|
1044
1023
|
result.push(...outputs);
|
|
1045
1024
|
}
|
|
1046
1025
|
else {
|
|
1047
|
-
const data = genBundleFiles(app, frontend, config);
|
|
1026
|
+
const data = await genBundleFiles(app, frontend, config);
|
|
1048
1027
|
result.push(...data);
|
|
1049
|
-
await utils.delay(
|
|
1028
|
+
await utils.delay(1000);
|
|
1050
1029
|
}
|
|
1051
1030
|
}
|
|
1052
1031
|
return result;
|