@lcap/nasl 2.22.0-beta.5 → 3.0.0-beta.1
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/README.md +13 -0
- package/docs/classes/Module.html +15 -15
- package/docs/classes/Namespace.html +15 -15
- package/docs/classes/ViewComponent.html +19 -19
- package/out/automate/engine/utils.js +4 -0
- package/out/automate/engine/utils.js.map +1 -1
- package/out/breakpoint/generator/AfterStartNode.d.ts +7 -0
- package/out/breakpoint/generator/AfterStartNode.js +27 -0
- package/out/breakpoint/generator/AfterStartNode.js.map +1 -0
- package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -0
- package/out/breakpoint/generator/BeforeEndNode.js +27 -0
- package/out/breakpoint/generator/BeforeEndNode.js.map +1 -0
- package/out/breakpoint/generator/BreakpointNode.d.ts +14 -0
- package/out/breakpoint/generator/BreakpointNode.js +166 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -0
- package/out/breakpoint/generator/index.d.ts +4 -0
- package/out/breakpoint/generator/index.js +98 -0
- package/out/breakpoint/generator/index.js.map +1 -0
- package/out/breakpoint/index.d.ts +3 -0
- package/out/breakpoint/index.js +20 -0
- package/out/breakpoint/index.js.map +1 -0
- package/out/breakpoint/shared/constants.d.ts +30 -0
- package/out/breakpoint/shared/constants.js +87 -0
- package/out/breakpoint/shared/constants.js.map +1 -0
- package/out/breakpoint/shared/index.d.ts +3 -0
- package/out/breakpoint/shared/index.js +33 -0
- package/out/breakpoint/shared/index.js.map +1 -0
- package/out/breakpoint/shared/operations.d.ts +10 -0
- package/out/breakpoint/shared/operations.js +25 -0
- package/out/breakpoint/shared/operations.js.map +1 -0
- package/out/breakpoint/shared/socket.d.ts +47 -0
- package/out/breakpoint/shared/socket.js +210 -0
- package/out/breakpoint/shared/socket.js.map +1 -0
- package/out/breakpoint/shared/utils.d.ts +20 -0
- package/out/breakpoint/shared/utils.js +133 -0
- package/out/breakpoint/shared/utils.js.map +1 -0
- package/out/breakpoint/store/core.d.ts +30 -0
- package/out/breakpoint/store/core.js +341 -0
- package/out/breakpoint/store/core.js.map +1 -0
- package/out/breakpoint/store/dock.d.ts +1 -0
- package/out/breakpoint/store/dock.js +127 -0
- package/out/breakpoint/store/dock.js.map +1 -0
- package/out/breakpoint/store/index.d.ts +2 -0
- package/out/breakpoint/store/index.js +19 -0
- package/out/breakpoint/store/index.js.map +1 -0
- package/out/common/BaseNode.d.ts +8 -0
- package/out/common/BaseNode.js +19 -0
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +365 -16
- package/out/concepts/App__.js +431 -10
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Assignment__.js +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +37 -0
- package/out/concepts/AuthInterface__.js +141 -0
- package/out/concepts/AuthInterface__.js.map +1 -0
- package/out/concepts/AuthLogicForCallInterface__.d.ts +138 -0
- package/out/concepts/AuthLogicForCallInterface__.js +493 -0
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
- package/out/concepts/AuthLogic__.d.ts +66 -0
- package/out/concepts/AuthLogic__.js +206 -0
- package/out/concepts/AuthLogic__.js.map +1 -0
- package/out/concepts/BackendVariable__.d.ts +137 -0
- package/out/concepts/BackendVariable__.js +422 -0
- package/out/concepts/BackendVariable__.js.map +1 -0
- package/out/concepts/Backend__.d.ts +134 -0
- package/out/concepts/Backend__.js +274 -0
- package/out/concepts/Backend__.js.map +1 -0
- package/out/concepts/BindAttribute__.d.ts +1 -1
- package/out/concepts/BindAttribute__.js +3 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +12 -0
- package/out/concepts/BindEvent__.js +68 -0
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +126 -0
- package/out/concepts/CallAuthInterface__.js +408 -0
- package/out/concepts/CallAuthInterface__.js.map +1 -0
- package/out/concepts/CallInterface__.d.ts +6 -1
- package/out/concepts/CallInterface__.js +9 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +3 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +9 -7
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Destination__.js +1 -1
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +29 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +1 -2
- package/out/concepts/Entity__.js +1 -31
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +9 -4
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +29 -29
- package/out/concepts/FrontendLibrary__.js +2 -2
- package/out/concepts/FrontendVariable__.d.ts +21 -0
- package/out/concepts/FrontendVariable__.js +64 -0
- package/out/concepts/FrontendVariable__.js.map +1 -0
- package/out/concepts/Frontend__.d.ts +151 -47
- package/out/concepts/Frontend__.js +188 -32
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +1 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +18 -3
- package/out/concepts/LogicItem__.js +22 -4
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +14 -9
- package/out/concepts/Logic__.js +43 -5
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +29 -29
- package/out/concepts/Namespace__.js +2 -2
- package/out/concepts/NewComposite__.js +2 -2
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +643 -0
- package/out/concepts/OverriddenLogic__.js +1602 -0
- package/out/concepts/OverriddenLogic__.js.map +1 -0
- package/out/concepts/Param__.d.ts +6 -0
- package/out/concepts/Param__.js +10 -0
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +2 -0
- package/out/concepts/QueryFieldExpression__.js +9 -0
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +2 -2
- package/out/concepts/QuerySelectExpression__.js +2 -2
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +6 -6
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +10 -0
- package/out/concepts/Variable__.js +12 -0
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.d.ts +33 -33
- package/out/concepts/ViewComponent__.js +7 -7
- package/out/concepts/ViewElement__.d.ts +6 -0
- package/out/concepts/ViewElement__.js +104 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +2 -2
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +2 -1
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +24 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.http.d.ts +7 -0
- package/out/concepts/basics/stdlib/nasl.http.js +167 -0
- package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.process.js +68 -0
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +4 -19
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +83 -17
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +1 -0
- package/out/concepts/basics/types/index.js +4 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/concepts/index__.d.ts +8 -0
- package/out/concepts/index__.js +8 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/enums/KEYWORDS.js +0 -1
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +1 -0
- package/out/generator/genBundleFiles.js +27 -0
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +4 -1
- package/out/generator/genMetaData.js +14 -0
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +2 -1
- package/out/generator/genReleaseBody.js +2 -1
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/index.d.ts +2 -1
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/server/extendBaseNode.js +16 -4
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +2 -1
- package/out/server/formatTsUtils.js +39 -4
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getExtensionModules.d.ts +2 -2
- package/out/server/getExtensionModules.js +16 -2
- package/out/server/getExtensionModules.js.map +1 -1
- package/out/server/getLogics.js +5 -5
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +1 -0
- package/out/server/getMemberIdentifier.js +34 -7
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +64 -64
- package/out/server/naslServer.js +249 -121
- package/out/server/naslServer.js.map +1 -1
- package/out/server/naslStdlibMap.js +2 -0
- package/out/server/naslStdlibMap.js.map +1 -1
- package/out/server/translator.d.ts +1 -0
- package/out/server/translator.js +67 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/defaultErrorMessage.json +1 -0
- package/out/service/storage/api.d.ts +10 -1
- package/out/service/storage/api.js +6 -0
- package/out/service/storage/api.js.map +1 -1
- package/out/service/storage/init.d.ts +4 -0
- package/out/service/storage/init.js +55 -35
- package/out/service/storage/init.js.map +1 -1
- package/out/service/storage/service.d.ts +3 -0
- package/out/service/storage/service.js +14 -0
- package/out/service/storage/service.js.map +1 -1
- package/out/utils/sortTsString.d.ts +1 -0
- package/out/utils/sortTsString.js +36 -0
- package/out/utils/sortTsString.js.map +1 -0
- package/out/utils/traverse.js +2 -2
- package/out/utils/traverse.js.map +1 -1
- package/package.json +7 -2
- package/sandbox/stdlib/nasl.auth.ts +8 -4
- package/sandbox/stdlib/nasl.core.d.ts +206 -0
- package/sandbox/stdlib/nasl.core.js +1 -0
- package/sandbox/stdlib/nasl.core.js.map +1 -0
- package/sandbox/stdlib/nasl.http.ts +35 -0
- package/sandbox/stdlib/nasl.process.ts +13 -0
- package/sandbox/stdlib/nasl.ui.ts +0 -5
- package/src/automate/engine/utils.js +4 -1
- package/src/breakpoint/generator/AfterStartNode.ts +27 -0
- package/src/breakpoint/generator/BeforeEndNode.ts +27 -0
- package/src/breakpoint/generator/BreakpointNode.ts +228 -0
- package/src/breakpoint/generator/index.ts +114 -0
- package/src/breakpoint/index.ts +3 -0
- package/src/breakpoint/shared/constants.ts +95 -0
- package/src/breakpoint/shared/index.ts +3 -0
- package/src/breakpoint/shared/operations.ts +25 -0
- package/src/breakpoint/shared/socket.ts +326 -0
- package/src/breakpoint/shared/utils.ts +195 -0
- package/src/breakpoint/store/core.ts +411 -0
- package/src/breakpoint/store/dock.ts +166 -0
- package/src/breakpoint/store/index.ts +2 -0
- package/src/breakpoint/types/index.d.ts +19 -0
- package/src/common/BaseNode.ts +19 -1
- package/src/concepts/App__.ts +828 -26
- package/src/concepts/Assignment__.ts +1 -1
- package/src/concepts/AuthInterface__.ts +148 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +573 -0
- package/src/concepts/AuthLogic__.ts +225 -0
- package/src/concepts/BackendVariable__.ts +466 -0
- package/src/concepts/Backend__.ts +347 -0
- package/src/concepts/BindAttribute__.ts +4 -3
- package/src/concepts/BindEvent__.ts +71 -2
- package/src/concepts/CallAuthInterface__.ts +490 -0
- package/src/concepts/CallInterface__.ts +10 -2
- package/src/concepts/CallLogic__.ts +3 -1
- package/src/concepts/CallQueryComponent__.ts +67 -7
- package/src/concepts/Destination__.ts +19 -1
- package/src/concepts/End__.ts +31 -3
- package/src/concepts/EntityProperty__.ts +6 -0
- package/src/concepts/Entity__.ts +8 -31
- package/src/concepts/ForEachStatement__.ts +9 -4
- package/src/concepts/FrontendLibrary__.ts +30 -30
- package/src/concepts/FrontendVariable__.ts +76 -0
- package/src/concepts/Frontend__.ts +352 -89
- package/src/concepts/Function__.ts +1 -1
- package/src/concepts/Identifier__.ts +5 -5
- package/src/concepts/Interface__.ts +1 -1
- package/src/concepts/LogicItem__.ts +26 -6
- package/src/concepts/Logic__.ts +86 -8
- package/src/concepts/Module__.ts +32 -2
- package/src/concepts/Namespace__.ts +30 -30
- package/src/concepts/NewComposite__.ts +2 -3
- package/src/concepts/OverriddenLogic__.ts +2165 -0
- package/src/concepts/Param__.ts +13 -3
- package/src/concepts/QueryFieldExpression__.ts +18 -0
- package/src/concepts/QuerySelectExpression__.ts +11 -3
- package/src/concepts/TypeAnnotation__.ts +45 -6
- package/src/concepts/Variable__.ts +14 -0
- package/src/concepts/ViewComponent__.ts +35 -35
- package/src/concepts/ViewElement__.ts +104 -1
- package/src/concepts/View__.ts +24 -2
- package/src/concepts/basics/stdlib/index.ts +2 -1
- package/src/concepts/basics/stdlib/nasl.auth.ts +24 -0
- package/src/concepts/basics/stdlib/nasl.http.ts +166 -0
- package/src/concepts/basics/stdlib/nasl.process.ts +68 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +4 -19
- package/src/concepts/basics/stdlib/nasl.util.ts +83 -17
- package/src/concepts/basics/types/index.ts +5 -4
- package/src/concepts/index__.ts +8 -0
- package/src/enums/KEYWORDS.ts +0 -1
- package/src/generator/genBundleFiles.ts +36 -2
- package/src/generator/genMetaData.ts +16 -1
- package/src/generator/genReleaseBody.ts +4 -1
- package/src/index.ts +2 -1
- package/src/server/extendBaseNode.ts +18 -7
- package/src/server/formatTsUtils.ts +37 -5
- package/src/server/getExtensionModules.ts +18 -3
- package/src/server/getLogics.ts +6 -6
- package/src/server/getMemberIdentifier.ts +35 -9
- package/src/server/naslServer.ts +250 -124
- package/src/server/naslStdlibMap.ts +2 -0
- package/src/server/translator.ts +67 -1
- package/src/service/defaultErrorMessage.json +1 -0
- package/src/service/storage/api.js +7 -1
- package/src/service/storage/init.ts +66 -35
- package/src/service/storage/service.ts +18 -2
- package/src/utils/sortTsString.ts +32 -0
- package/src/utils/traverse.ts +2 -2
- package/test/examples/app-simple.json +73635 -0
- package/ts-worker/lib/tsserver.js +3 -3
- package/ts-worker/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
2
2
|
import { AssetsInfo } from './App__';
|
|
3
3
|
import Namespace from './Namespace__';
|
|
4
|
+
import Variable from './Variable__';
|
|
4
5
|
|
|
5
6
|
//================================================================================
|
|
6
7
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -13,8 +14,9 @@ import * as utils from '../utils';
|
|
|
13
14
|
import { v4 as uuidv4 } from 'uuid';
|
|
14
15
|
import BaseNode from '../common/BaseNode';
|
|
15
16
|
import classMap from '../common/classMap';
|
|
17
|
+
import BindEvent from './BindEvent__';
|
|
16
18
|
import View from './View__';
|
|
17
|
-
import
|
|
19
|
+
import FrontendVariable from './FrontendVariable__';
|
|
18
20
|
import Theme from './Theme__';
|
|
19
21
|
import Module from './Module__';
|
|
20
22
|
import App from './App__';
|
|
@@ -66,6 +68,12 @@ export class Frontend extends BaseNode {
|
|
|
66
68
|
@property()
|
|
67
69
|
documentIcon: string = undefined;
|
|
68
70
|
|
|
71
|
+
/**
|
|
72
|
+
* 元素绑定事件列表
|
|
73
|
+
*/
|
|
74
|
+
@property('BindEvent')
|
|
75
|
+
bindEvents: Array<BindEvent> = [];
|
|
76
|
+
|
|
69
77
|
/**
|
|
70
78
|
* 页面列表
|
|
71
79
|
*/
|
|
@@ -73,10 +81,10 @@ export class Frontend extends BaseNode {
|
|
|
73
81
|
views: Array<View> = [];
|
|
74
82
|
|
|
75
83
|
/**
|
|
76
|
-
*
|
|
84
|
+
* 前端全局变量列表
|
|
77
85
|
*/
|
|
78
|
-
@property('
|
|
79
|
-
variables: Array<
|
|
86
|
+
@property('FrontendVariable')
|
|
87
|
+
variables: Array<FrontendVariable> = [];
|
|
80
88
|
|
|
81
89
|
/**
|
|
82
90
|
* 主题配置
|
|
@@ -90,6 +98,18 @@ export class Frontend extends BaseNode {
|
|
|
90
98
|
@property('Module')
|
|
91
99
|
componentDependencies: Array<Module> = [];
|
|
92
100
|
|
|
101
|
+
/**
|
|
102
|
+
* 全局缩放开关
|
|
103
|
+
*/
|
|
104
|
+
@property()
|
|
105
|
+
globalScaleEnabled: boolean = false;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* 画布宽度
|
|
109
|
+
*/
|
|
110
|
+
@property()
|
|
111
|
+
canvasWidth: number = 0;
|
|
112
|
+
|
|
93
113
|
/**
|
|
94
114
|
* 祖先 App
|
|
95
115
|
*/
|
|
@@ -185,7 +205,172 @@ export class Frontend extends BaseNode {
|
|
|
185
205
|
});
|
|
186
206
|
}
|
|
187
207
|
|
|
188
|
-
|
|
208
|
+
/**
|
|
209
|
+
* 设置全局缩放开关
|
|
210
|
+
*/
|
|
211
|
+
setGlobalScaleEnabled(globalScaleEnabled: boolean) {
|
|
212
|
+
const object = {
|
|
213
|
+
globalScaleEnabled,
|
|
214
|
+
};
|
|
215
|
+
this.update({
|
|
216
|
+
...object,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* 设置画布宽度
|
|
222
|
+
*/
|
|
223
|
+
setCanvasWidth(canvasWidth: number) {
|
|
224
|
+
const object = {
|
|
225
|
+
canvasWidth,
|
|
226
|
+
};
|
|
227
|
+
this.update({
|
|
228
|
+
...object,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
getBindEventExistingNames(excludedList: Array<BindEvent> = []) {
|
|
233
|
+
const excludedSet = new Set(excludedList);
|
|
234
|
+
return ((this.bindEvents as BindEvent[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
235
|
+
}
|
|
236
|
+
getBindEventUniqueName(name = 'bindEvent1') {
|
|
237
|
+
return utils.unique(name, this.getBindEventExistingNames(), undefined, false);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* 插入元素绑定事件
|
|
242
|
+
* @internal
|
|
243
|
+
* @param name 元素绑定事件名称,如果不填会自动生成一个唯一名称
|
|
244
|
+
*/
|
|
245
|
+
_insertBindEventAt(name: string, index: number): BindEvent;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* 插入元素绑定事件
|
|
249
|
+
* @internal
|
|
250
|
+
* @param bindEventOptions 元素绑定事件参数
|
|
251
|
+
*/
|
|
252
|
+
_insertBindEventAt(bindEventOptions: Partial<BindEvent>, index: number): BindEvent;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* 插入元素绑定事件
|
|
256
|
+
* @internal
|
|
257
|
+
* @param bindEvent 已有的元素绑定事件实例
|
|
258
|
+
*/
|
|
259
|
+
_insertBindEventAt(bindEvent: BindEvent, index: number): BindEvent;
|
|
260
|
+
|
|
261
|
+
_insertBindEventAt(options: string | Partial<BindEvent> | BindEvent, index: number) {
|
|
262
|
+
const bindEventOptions: any = {};
|
|
263
|
+
const relationOptions = { parentNode: this, parentKey: 'bindEvents' };
|
|
264
|
+
let bindEvent: BindEvent;
|
|
265
|
+
if (!options) {
|
|
266
|
+
bindEvent = BindEvent.from({
|
|
267
|
+
...bindEventOptions,
|
|
268
|
+
name: this.getBindEventUniqueName(),
|
|
269
|
+
}, this, 'bindEvents');
|
|
270
|
+
} else if (typeof options === 'string') {
|
|
271
|
+
bindEvent = BindEvent.from({
|
|
272
|
+
...bindEventOptions,
|
|
273
|
+
name: options,
|
|
274
|
+
}, this, 'bindEvents');
|
|
275
|
+
} else if (options instanceof BindEvent) {
|
|
276
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
277
|
+
bindEvent = options;
|
|
278
|
+
Object.assign(bindEvent, relationOptions);
|
|
279
|
+
} else {
|
|
280
|
+
bindEvent = BindEvent.from({
|
|
281
|
+
...bindEventOptions,
|
|
282
|
+
...options,
|
|
283
|
+
}, this, 'bindEvents');
|
|
284
|
+
}
|
|
285
|
+
this.bindEvents.splice(index, 0, bindEvent);
|
|
286
|
+
return bindEvent;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* 插入元素绑定事件
|
|
291
|
+
* @param name 元素绑定事件名称,如果不填会自动生成一个唯一名称
|
|
292
|
+
*/
|
|
293
|
+
insertBindEventAt(name: string, index: number): BindEvent;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* 插入元素绑定事件
|
|
297
|
+
* @param bindEventOptions 元素绑定事件参数
|
|
298
|
+
*/
|
|
299
|
+
insertBindEventAt(bindEventOptions: Partial<BindEvent>, index: number): BindEvent;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* 插入元素绑定事件
|
|
303
|
+
* @param bindEvent 已有的元素绑定事件实例
|
|
304
|
+
*/
|
|
305
|
+
insertBindEventAt(bindEvent: BindEvent, index: number): BindEvent;
|
|
306
|
+
|
|
307
|
+
insertBindEventAt(options: string | Partial<BindEvent> | BindEvent, index: number) {
|
|
308
|
+
const node = this._insertBindEventAt(options as any, index);
|
|
309
|
+
node.create({
|
|
310
|
+
index,
|
|
311
|
+
parentNode: this,
|
|
312
|
+
parentKey: 'bindEvents',
|
|
313
|
+
});
|
|
314
|
+
return node;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* 添加元素绑定事件
|
|
319
|
+
* @internal
|
|
320
|
+
* @param name 元素绑定事件名称,如果不填会自动生成一个唯一名称
|
|
321
|
+
*/
|
|
322
|
+
_addBindEvent(name?: string): BindEvent;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* 添加元素绑定事件
|
|
326
|
+
* @internal
|
|
327
|
+
* @param bindEventOptions 元素绑定事件参数
|
|
328
|
+
*/
|
|
329
|
+
_addBindEvent(bindEventOptions: Partial<BindEvent>): BindEvent;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* 添加元素绑定事件
|
|
333
|
+
* @internal
|
|
334
|
+
* @param bindEvent 已有的元素绑定事件实例
|
|
335
|
+
*/
|
|
336
|
+
_addBindEvent(bindEvent: BindEvent): BindEvent;
|
|
337
|
+
|
|
338
|
+
_addBindEvent(options?: string | Partial<BindEvent> | BindEvent) {
|
|
339
|
+
const index = this.bindEvents.length;
|
|
340
|
+
return this._insertBindEventAt(options as any, index);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* 添加元素绑定事件
|
|
345
|
+
* @internal
|
|
346
|
+
* @param name 元素绑定事件名称,如果不填会自动生成一个唯一名称
|
|
347
|
+
*/
|
|
348
|
+
addBindEvent(name?: string): BindEvent;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* 添加元素绑定事件
|
|
352
|
+
* @param bindEventOptions 元素绑定事件参数
|
|
353
|
+
*/
|
|
354
|
+
addBindEvent(bindEventOptions: Partial<BindEvent>): BindEvent;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* 添加元素绑定事件
|
|
358
|
+
* @param bindEvent 已有的元素绑定事件实例
|
|
359
|
+
*/
|
|
360
|
+
addBindEvent(bindEvent: BindEvent): BindEvent;
|
|
361
|
+
|
|
362
|
+
addBindEvent(options?: string | Partial<BindEvent> | BindEvent) {
|
|
363
|
+
const node = this._addBindEvent(options as any);
|
|
364
|
+
const index = this.bindEvents.indexOf(node);
|
|
365
|
+
node.create({
|
|
366
|
+
index,
|
|
367
|
+
parentNode: this,
|
|
368
|
+
parentKey: 'bindEvents',
|
|
369
|
+
});
|
|
370
|
+
return node;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
getViewExistingNames(excludedList: Array<View> = []) {
|
|
189
374
|
const excludedSet = new Set(excludedList);
|
|
190
375
|
return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
191
376
|
}
|
|
@@ -326,84 +511,83 @@ export class Frontend extends BaseNode {
|
|
|
326
511
|
return node;
|
|
327
512
|
}
|
|
328
513
|
|
|
329
|
-
|
|
330
|
-
getVarExistingNames(excludedList: Array<Variable> = []) {
|
|
514
|
+
getVarExistingNames(excludedList: Array<FrontendVariable> = []) {
|
|
331
515
|
const excludedSet = new Set(excludedList);
|
|
332
|
-
return ((this.variables as
|
|
516
|
+
return ((this.variables as FrontendVariable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
333
517
|
}
|
|
334
|
-
|
|
518
|
+
getFrontendVariableUniqueName(name = 'frontendVariable1') {
|
|
335
519
|
return utils.unique(name, this.getVarExistingNames(), undefined, true);
|
|
336
520
|
}
|
|
337
521
|
|
|
338
522
|
/**
|
|
339
|
-
*
|
|
523
|
+
* 插入前端全局变量
|
|
340
524
|
* @internal
|
|
341
|
-
* @param name
|
|
525
|
+
* @param name 前端全局变量名称,如果不填会自动生成一个唯一名称
|
|
342
526
|
*/
|
|
343
|
-
|
|
527
|
+
_insertFrontendVariableAt(name: string, index: number): FrontendVariable;
|
|
344
528
|
|
|
345
529
|
/**
|
|
346
|
-
*
|
|
530
|
+
* 插入前端全局变量
|
|
347
531
|
* @internal
|
|
348
|
-
* @param
|
|
532
|
+
* @param frontendVariableOptions 前端全局变量参数
|
|
349
533
|
*/
|
|
350
|
-
|
|
534
|
+
_insertFrontendVariableAt(frontendVariableOptions: Partial<FrontendVariable>, index: number): FrontendVariable;
|
|
351
535
|
|
|
352
536
|
/**
|
|
353
|
-
*
|
|
537
|
+
* 插入前端全局变量
|
|
354
538
|
* @internal
|
|
355
|
-
* @param
|
|
539
|
+
* @param frontendVariable 已有的前端全局变量实例
|
|
356
540
|
*/
|
|
357
|
-
|
|
541
|
+
_insertFrontendVariableAt(frontendVariable: FrontendVariable, index: number): FrontendVariable;
|
|
358
542
|
|
|
359
|
-
|
|
360
|
-
const
|
|
543
|
+
_insertFrontendVariableAt(options: string | Partial<FrontendVariable> | FrontendVariable, index: number) {
|
|
544
|
+
const frontendVariableOptions: any = {};
|
|
361
545
|
const relationOptions = { parentNode: this, parentKey: 'variables' };
|
|
362
|
-
let
|
|
546
|
+
let frontendVariable: FrontendVariable;
|
|
363
547
|
if (!options) {
|
|
364
|
-
|
|
365
|
-
...
|
|
366
|
-
name: this.
|
|
548
|
+
frontendVariable = FrontendVariable.from({
|
|
549
|
+
...frontendVariableOptions,
|
|
550
|
+
name: this.getFrontendVariableUniqueName(),
|
|
367
551
|
}, this, 'variables');
|
|
368
552
|
} else if (typeof options === 'string') {
|
|
369
|
-
|
|
370
|
-
...
|
|
553
|
+
frontendVariable = FrontendVariable.from({
|
|
554
|
+
...frontendVariableOptions,
|
|
371
555
|
name: options,
|
|
372
556
|
}, this, 'variables');
|
|
373
|
-
} else if (options instanceof
|
|
557
|
+
} else if (options instanceof FrontendVariable) {
|
|
374
558
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
375
|
-
|
|
376
|
-
Object.assign(
|
|
559
|
+
frontendVariable = options;
|
|
560
|
+
Object.assign(frontendVariable, relationOptions);
|
|
377
561
|
} else {
|
|
378
|
-
|
|
379
|
-
...
|
|
562
|
+
frontendVariable = FrontendVariable.from({
|
|
563
|
+
...frontendVariableOptions,
|
|
380
564
|
...options,
|
|
381
565
|
}, this, 'variables');
|
|
382
566
|
}
|
|
383
|
-
this.variables.splice(index, 0,
|
|
384
|
-
return
|
|
567
|
+
this.variables.splice(index, 0, frontendVariable);
|
|
568
|
+
return frontendVariable;
|
|
385
569
|
}
|
|
386
570
|
|
|
387
571
|
/**
|
|
388
|
-
*
|
|
389
|
-
* @param name
|
|
572
|
+
* 插入前端全局变量
|
|
573
|
+
* @param name 前端全局变量名称,如果不填会自动生成一个唯一名称
|
|
390
574
|
*/
|
|
391
|
-
|
|
575
|
+
insertFrontendVariableAt(name: string, index: number): FrontendVariable;
|
|
392
576
|
|
|
393
577
|
/**
|
|
394
|
-
*
|
|
395
|
-
* @param
|
|
578
|
+
* 插入前端全局变量
|
|
579
|
+
* @param frontendVariableOptions 前端全局变量参数
|
|
396
580
|
*/
|
|
397
|
-
|
|
581
|
+
insertFrontendVariableAt(frontendVariableOptions: Partial<FrontendVariable>, index: number): FrontendVariable;
|
|
398
582
|
|
|
399
583
|
/**
|
|
400
|
-
*
|
|
401
|
-
* @param
|
|
584
|
+
* 插入前端全局变量
|
|
585
|
+
* @param frontendVariable 已有的前端全局变量实例
|
|
402
586
|
*/
|
|
403
|
-
|
|
587
|
+
insertFrontendVariableAt(frontendVariable: FrontendVariable, index: number): FrontendVariable;
|
|
404
588
|
|
|
405
|
-
|
|
406
|
-
const node = this.
|
|
589
|
+
insertFrontendVariableAt(options: string | Partial<FrontendVariable> | FrontendVariable, index: number) {
|
|
590
|
+
const node = this._insertFrontendVariableAt(options as any, index);
|
|
407
591
|
node.create({
|
|
408
592
|
index,
|
|
409
593
|
parentNode: this,
|
|
@@ -413,52 +597,52 @@ export class Frontend extends BaseNode {
|
|
|
413
597
|
}
|
|
414
598
|
|
|
415
599
|
/**
|
|
416
|
-
*
|
|
600
|
+
* 添加前端全局变量
|
|
417
601
|
* @internal
|
|
418
|
-
* @param name
|
|
602
|
+
* @param name 前端全局变量名称,如果不填会自动生成一个唯一名称
|
|
419
603
|
*/
|
|
420
|
-
|
|
604
|
+
_addFrontendVariable(name?: string): FrontendVariable;
|
|
421
605
|
|
|
422
606
|
/**
|
|
423
|
-
*
|
|
607
|
+
* 添加前端全局变量
|
|
424
608
|
* @internal
|
|
425
|
-
* @param
|
|
609
|
+
* @param frontendVariableOptions 前端全局变量参数
|
|
426
610
|
*/
|
|
427
|
-
|
|
611
|
+
_addFrontendVariable(frontendVariableOptions: Partial<FrontendVariable>): FrontendVariable;
|
|
428
612
|
|
|
429
613
|
/**
|
|
430
|
-
*
|
|
614
|
+
* 添加前端全局变量
|
|
431
615
|
* @internal
|
|
432
|
-
* @param
|
|
616
|
+
* @param frontendVariable 已有的前端全局变量实例
|
|
433
617
|
*/
|
|
434
|
-
|
|
618
|
+
_addFrontendVariable(frontendVariable: FrontendVariable): FrontendVariable;
|
|
435
619
|
|
|
436
|
-
|
|
620
|
+
_addFrontendVariable(options?: string | Partial<FrontendVariable> | FrontendVariable) {
|
|
437
621
|
const index = this.variables.length;
|
|
438
|
-
return this.
|
|
622
|
+
return this._insertFrontendVariableAt(options as any, index);
|
|
439
623
|
}
|
|
440
624
|
|
|
441
625
|
/**
|
|
442
|
-
*
|
|
626
|
+
* 添加前端全局变量
|
|
443
627
|
* @internal
|
|
444
|
-
* @param name
|
|
628
|
+
* @param name 前端全局变量名称,如果不填会自动生成一个唯一名称
|
|
445
629
|
*/
|
|
446
|
-
|
|
630
|
+
addFrontendVariable(name?: string): FrontendVariable;
|
|
447
631
|
|
|
448
632
|
/**
|
|
449
|
-
*
|
|
450
|
-
* @param
|
|
633
|
+
* 添加前端全局变量
|
|
634
|
+
* @param frontendVariableOptions 前端全局变量参数
|
|
451
635
|
*/
|
|
452
|
-
|
|
636
|
+
addFrontendVariable(frontendVariableOptions: Partial<FrontendVariable>): FrontendVariable;
|
|
453
637
|
|
|
454
638
|
/**
|
|
455
|
-
*
|
|
456
|
-
* @param
|
|
639
|
+
* 添加前端全局变量
|
|
640
|
+
* @param frontendVariable 已有的前端全局变量实例
|
|
457
641
|
*/
|
|
458
|
-
|
|
642
|
+
addFrontendVariable(frontendVariable: FrontendVariable): FrontendVariable;
|
|
459
643
|
|
|
460
|
-
|
|
461
|
-
const node = this.
|
|
644
|
+
addFrontendVariable(options?: string | Partial<FrontendVariable> | FrontendVariable) {
|
|
645
|
+
const node = this._addFrontendVariable(options as any);
|
|
462
646
|
const index = this.variables.indexOf(node);
|
|
463
647
|
node.create({
|
|
464
648
|
index,
|
|
@@ -468,7 +652,6 @@ export class Frontend extends BaseNode {
|
|
|
468
652
|
return node;
|
|
469
653
|
}
|
|
470
654
|
|
|
471
|
-
|
|
472
655
|
getModuleExistingNames(excludedList: Array<Module> = []) {
|
|
473
656
|
const excludedSet = new Set(excludedList);
|
|
474
657
|
return ((this.componentDependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -610,8 +793,53 @@ export class Frontend extends BaseNode {
|
|
|
610
793
|
return node;
|
|
611
794
|
}
|
|
612
795
|
|
|
796
|
+
/**
|
|
797
|
+
* 删除元素绑定事件
|
|
798
|
+
* @param name 元素绑定事件名称
|
|
799
|
+
*/
|
|
800
|
+
removeBindEvent(name: string): void;
|
|
613
801
|
|
|
614
|
-
|
|
802
|
+
/**
|
|
803
|
+
* 删除元素绑定事件
|
|
804
|
+
* @param bindEvent 已有的元素绑定事件实例
|
|
805
|
+
*/
|
|
806
|
+
removeBindEvent(bindEvent: BindEvent): void;
|
|
807
|
+
|
|
808
|
+
removeBindEvent(options: string | BindEvent) {
|
|
809
|
+
let bindEvent: BindEvent;
|
|
810
|
+
if (typeof options === 'string') {
|
|
811
|
+
bindEvent = (this.bindEvents as BindEvent[]).find((item) => item.name === options);
|
|
812
|
+
if (!bindEvent) {
|
|
813
|
+
throw new Error('找不到元素绑定事件 ' + options);
|
|
814
|
+
}
|
|
815
|
+
} else {
|
|
816
|
+
bindEvent = options;
|
|
817
|
+
}
|
|
818
|
+
return bindEvent.delete();
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
__removeBindEvent(bindEvent: BindEvent) {
|
|
822
|
+
const parentKey = bindEvent.parentKey;
|
|
823
|
+
const params: Params = {
|
|
824
|
+
parentNode: this,
|
|
825
|
+
parentKey,
|
|
826
|
+
index: -1,
|
|
827
|
+
object: null,
|
|
828
|
+
oldObject: bindEvent,
|
|
829
|
+
};
|
|
830
|
+
if (parentKey) {
|
|
831
|
+
params.parentKey = parentKey;
|
|
832
|
+
if (Array.isArray((this as any)[parentKey])) {
|
|
833
|
+
const index = (this as any)[parentKey].indexOf(bindEvent);
|
|
834
|
+
~index && (this as any)[parentKey].splice(index, 1);
|
|
835
|
+
params.index = index;
|
|
836
|
+
} else if ((this as any)[parentKey] === bindEvent) {
|
|
837
|
+
params.index = 0;
|
|
838
|
+
(this as any)[parentKey] = undefined;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
return params;
|
|
842
|
+
}
|
|
615
843
|
|
|
616
844
|
/**
|
|
617
845
|
* 删除页面
|
|
@@ -661,31 +889,29 @@ export class Frontend extends BaseNode {
|
|
|
661
889
|
return params;
|
|
662
890
|
}
|
|
663
891
|
|
|
664
|
-
|
|
665
|
-
|
|
666
892
|
/**
|
|
667
|
-
*
|
|
668
|
-
* @param name
|
|
893
|
+
* 删除前端全局变量
|
|
894
|
+
* @param name 前端全局变量名称
|
|
669
895
|
*/
|
|
670
|
-
|
|
896
|
+
removeFrontendVariable(name: string): void;
|
|
671
897
|
|
|
672
898
|
/**
|
|
673
|
-
*
|
|
674
|
-
* @param
|
|
899
|
+
* 删除前端全局变量
|
|
900
|
+
* @param frontendVariable 已有的前端全局变量实例
|
|
675
901
|
*/
|
|
676
|
-
|
|
902
|
+
removeFrontendVariable(frontendVariable: FrontendVariable): void;
|
|
677
903
|
|
|
678
|
-
|
|
679
|
-
let
|
|
904
|
+
removeFrontendVariable(options: string | FrontendVariable) {
|
|
905
|
+
let frontendVariable: FrontendVariable;
|
|
680
906
|
if (typeof options === 'string') {
|
|
681
|
-
|
|
682
|
-
if (!
|
|
683
|
-
throw new Error('
|
|
907
|
+
frontendVariable = (this.variables as FrontendVariable[]).find((item) => item.name === options);
|
|
908
|
+
if (!frontendVariable) {
|
|
909
|
+
throw new Error('找不到前端全局变量 ' + options);
|
|
684
910
|
}
|
|
685
911
|
} else {
|
|
686
|
-
|
|
912
|
+
frontendVariable = options;
|
|
687
913
|
}
|
|
688
|
-
return
|
|
914
|
+
return frontendVariable.delete();
|
|
689
915
|
}
|
|
690
916
|
|
|
691
917
|
__removeVariable(variable: Variable) {
|
|
@@ -711,8 +937,6 @@ export class Frontend extends BaseNode {
|
|
|
711
937
|
return params;
|
|
712
938
|
}
|
|
713
939
|
|
|
714
|
-
|
|
715
|
-
|
|
716
940
|
/**
|
|
717
941
|
* 删除主题
|
|
718
942
|
* @param name 主题名称
|
|
@@ -761,8 +985,6 @@ export class Frontend extends BaseNode {
|
|
|
761
985
|
return params;
|
|
762
986
|
}
|
|
763
987
|
|
|
764
|
-
|
|
765
|
-
|
|
766
988
|
/**
|
|
767
989
|
* 删除模块
|
|
768
990
|
* @param name 模块名称
|
|
@@ -852,6 +1074,18 @@ export class Frontend extends BaseNode {
|
|
|
852
1074
|
${keys.map((key) => ` ${key}: ${this.theme?.variableMap[key]};`).join('\n')}
|
|
853
1075
|
}`;
|
|
854
1076
|
}
|
|
1077
|
+
getTsNamespace() {
|
|
1078
|
+
if (this.parentNode && (this.parentNode as Namespace).getNamespace) {
|
|
1079
|
+
const parentNamespace = (this.parentNode as Namespace).getNamespace();
|
|
1080
|
+
const parentName = this.parentNode.name;
|
|
1081
|
+
const arr = [parentNamespace];
|
|
1082
|
+
if (this.parentNode.concept !== 'App' && parentName) {
|
|
1083
|
+
arr.push(parentName);
|
|
1084
|
+
}
|
|
1085
|
+
return `${arr.join('.')}.frontends`;
|
|
1086
|
+
} else
|
|
1087
|
+
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
1088
|
+
}
|
|
855
1089
|
|
|
856
1090
|
getNamespace() {
|
|
857
1091
|
if (this.parentNode && (this.parentNode as Namespace).getNamespace) {
|
|
@@ -953,13 +1187,42 @@ export class Frontend extends BaseNode {
|
|
|
953
1187
|
}
|
|
954
1188
|
|
|
955
1189
|
getExtensionsCallbackLogics() {
|
|
956
|
-
let resultLogics:string[] = [];
|
|
957
|
-
this.views.forEach((item:View) => {
|
|
1190
|
+
let resultLogics: string[] = [];
|
|
1191
|
+
this.views.forEach((item: View) => {
|
|
958
1192
|
resultLogics = [...resultLogics, ...item.getViewCallLogics()];
|
|
959
1193
|
});
|
|
960
1194
|
return Array.from(new Set(resultLogics));
|
|
961
1195
|
}
|
|
962
1196
|
|
|
1197
|
+
get defaultCanvasWidth() {
|
|
1198
|
+
return this.type === 'pc' ? 1440 : 375;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* 获取当前页面下所有elements上bindEvents下的logic
|
|
1202
|
+
*/
|
|
1203
|
+
// elementLogicRoot: any[] = [];
|
|
1204
|
+
|
|
1205
|
+
// getElementLogicRoot() {
|
|
1206
|
+
// const logics: Array<Logic> = [];
|
|
1207
|
+
// // 页面上的绑定的事件
|
|
1208
|
+
// this.bindEvents.forEach((bindEvent) => {
|
|
1209
|
+
// bindEvent.logics.forEach((logic) => {
|
|
1210
|
+
// // 声明周期没有event
|
|
1211
|
+
// logics.push(logic);
|
|
1212
|
+
// });
|
|
1213
|
+
// });
|
|
1214
|
+
// if (logics.length) {
|
|
1215
|
+
// const expanded = (this.elementLogicRoot.length && this.elementLogicRoot[0].expanded) || false;
|
|
1216
|
+
// this.elementLogicRoot = [{
|
|
1217
|
+
// concept: 'elementLogicRoot',
|
|
1218
|
+
// expanded,
|
|
1219
|
+
// children: logics,
|
|
1220
|
+
// }];
|
|
1221
|
+
// } else {
|
|
1222
|
+
// this.elementLogicRoot = [];
|
|
1223
|
+
// }
|
|
1224
|
+
// }
|
|
1225
|
+
|
|
963
1226
|
//================================================================================
|
|
964
1227
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
965
1228
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -969,7 +969,7 @@ export class Function extends BaseNode {
|
|
|
969
969
|
let code = '';
|
|
970
970
|
code += '(';
|
|
971
971
|
this.params.forEach((param, index) => {
|
|
972
|
-
code += param.
|
|
972
|
+
code += param.name;
|
|
973
973
|
if (index !== this.params.length - 1) {
|
|
974
974
|
code += ',';
|
|
975
975
|
}
|
|
@@ -75,10 +75,10 @@ export class Identifier extends LogicItem {
|
|
|
75
75
|
globalDataMap: {
|
|
76
76
|
[name: string]: boolean;
|
|
77
77
|
} = {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
$route: true,
|
|
79
|
+
$global: true,
|
|
80
|
+
$refs: true,
|
|
81
|
+
};
|
|
82
82
|
|
|
83
83
|
isEnum() {
|
|
84
84
|
return findConceptKeyWordByNamespace(this.namespace) === 'enums';
|
|
@@ -209,7 +209,7 @@ export class Identifier extends LogicItem {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
// 全局变量在不是页面的地方放置,就会报错
|
|
212
|
-
if (this.namespace?.startsWith('app.frontends') && this.namespace?.endsWith('variables') && !this.
|
|
212
|
+
if (this.namespace?.startsWith('app.frontends') && this.namespace?.endsWith('variables') && !this.frontend) {
|
|
213
213
|
return '__FRONTENDVARIABLES__';
|
|
214
214
|
}
|
|
215
215
|
|