@lcap/nasl 1.0.0-alpha.2 → 1.0.0-alpha.5
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 +3 -3
- package/docs/assets/search.js +1 -1
- package/docs/classes/Entity.html +2832 -204
- package/docs/classes/View.html +4567 -365
- package/out/common/BaseNode.d.ts +1 -1
- package/out/common/BaseNode.js +38 -23
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +77 -15
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +2 -1
- package/out/concepts/Argument__.js +2 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +2 -1
- package/out/concepts/Assignment__.js +3 -8
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +2 -1
- package/out/concepts/BinaryExpression__.js +5 -5
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +2 -1
- package/out/concepts/BindAttribute__.js +9 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +2 -1
- package/out/concepts/BindDirective__.js +2 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +2 -1
- package/out/concepts/BindEvent__.js +4 -3
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +2 -1
- package/out/concepts/BooleanLiteral__.js +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +57 -1
- package/out/concepts/CallFunction__.js +119 -11
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -1
- package/out/concepts/CallInterface__.js +2 -2
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +57 -1
- package/out/concepts/CallLogic__.js +117 -10
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +1 -1
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +120 -0
- package/out/concepts/ConfigGroup__.js +214 -0
- package/out/concepts/ConfigGroup__.js.map +1 -0
- package/out/concepts/ConfigPropertyValue__.d.ts +43 -0
- package/out/concepts/ConfigPropertyValue__.js +103 -0
- package/out/concepts/ConfigPropertyValue__.js.map +1 -0
- package/out/concepts/ConfigProperty__.d.ts +128 -0
- package/out/concepts/ConfigProperty__.js +236 -0
- package/out/concepts/ConfigProperty__.js.map +1 -0
- package/out/concepts/Configuration__.d.ts +120 -0
- package/out/concepts/Configuration__.js +210 -0
- package/out/concepts/Configuration__.js.map +1 -0
- package/out/concepts/Constant__.d.ts +2 -1
- package/out/concepts/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +2 -1
- package/out/concepts/Destination__.js +4 -3
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +8 -0
- package/out/concepts/EntityIndex__.js +18 -0
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +5 -5
- package/out/concepts/EntityProperty__.js +10 -9
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +30 -26
- package/out/concepts/Entity__.js +44 -36
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +8 -8
- package/out/concepts/Enum__.js +10 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +35 -33
- package/out/concepts/ForEachStatement__.js +103 -36
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -1
- package/out/concepts/Identifier__.js +15 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +1 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +5 -1
- package/out/concepts/Interface__.js +19 -5
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -1
- package/out/concepts/LogicItem__.js +2 -2
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +9 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +2 -5
- package/out/concepts/MemberExpression__.js +12 -18
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +121 -126
- package/out/concepts/Module__.js +10 -17
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +12 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +2 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +2 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -1
- package/out/concepts/Param__.js +2 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +2 -2
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +82 -81
- package/out/concepts/ProcessElement__.js +19 -6
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.d.ts +1 -0
- package/out/concepts/Process__.js +10 -4
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +2 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +5 -0
- package/out/concepts/Role__.js +19 -2
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +2 -0
- package/out/concepts/SqlQueryComponent__.js +16 -0
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +2 -1
- package/out/concepts/StringLiteral__.js +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +1 -1
- package/out/concepts/StructureProperty__.js +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -1
- package/out/concepts/Structure__.js +4 -4
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +3 -0
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +2 -1
- package/out/concepts/UnaryExpression__.js +3 -3
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +2 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +2 -1
- package/out/concepts/ValidationRule__.js +2 -2
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +6 -5
- package/out/concepts/Variable__.js +3 -3
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +5 -5
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +5 -4
- package/out/concepts/ViewElement__.js +109 -65
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +97 -90
- package/out/concepts/View__.js +153 -118
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +2 -2
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +3 -137
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +21 -5
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.validation.js +527 -0
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
- package/out/concepts/index__.d.ts +4 -0
- package/out/concepts/index__.js +4 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/data/Module.d.ts +34 -0
- package/out/data/Module.js +53 -0
- package/out/data/Module.js.map +1 -0
- package/out/generator/compileComponent.d.ts +1 -1
- package/out/generator/genBundleFiles.d.ts +0 -1
- package/out/generator/genBundleFiles.js +1 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +35 -0
- package/out/generator/genMetaData.js +78 -0
- package/out/generator/genMetaData.js.map +1 -0
- package/out/generator/index.d.ts +1 -0
- package/out/generator/index.js +1 -0
- package/out/generator/index.js.map +1 -1
- package/out/index.d.ts +2 -2
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/server/createUiTs.d.ts +7 -0
- package/out/server/createUiTs.js +157 -0
- package/out/server/createUiTs.js.map +1 -0
- package/out/server/entity2LogicNamespace.d.ts +9 -1
- package/out/server/entity2LogicNamespace.js +11 -1
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/getExtensionModules.d.ts +3 -0
- package/out/server/getExtensionModules.js +18 -0
- package/out/server/getExtensionModules.js.map +1 -0
- package/out/server/getLogics.js +18 -15
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +3 -2
- package/out/server/getMemberIdentifier.js +47 -15
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +4 -1
- package/out/server/getProcesses.js +16 -7
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getValidates.js +1 -1
- package/out/server/getValidates.js.map +1 -1
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +23 -5
- package/out/server/naslServer.js +199 -25
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.d.ts +15 -1
- package/out/server/process2LogicNamespace.js +30 -3
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.js +28 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +5 -0
- package/out/service/storage/init.js +60 -52
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCallComponentLogic.js +2 -2
- package/out/templator/genCallComponentLogic.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -8
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +3 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -4
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -3
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +2 -2
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +1 -1
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +8 -12
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +20 -20
- package/out/templator/utils.js +22 -22
- package/out/templator/utils.js.map +1 -1
- package/package.json +3 -1
- package/src/automate/engine/index.js +37 -3
- package/src/automate/engine/utils.js +68 -64
- package/src/common/BaseNode.ts +43 -28
- package/src/concepts/App__.ts +93 -17
- package/src/concepts/Argument__.ts +4 -2
- package/src/concepts/Assignment__.ts +5 -7
- package/src/concepts/Attribute__.ts +1 -0
- package/src/concepts/BinaryExpression__.ts +7 -5
- package/src/concepts/BindAttribute__.ts +9 -4
- package/src/concepts/BindDirective__.ts +4 -2
- package/src/concepts/BindEvent__.ts +6 -4
- package/src/concepts/BooleanLiteral__.ts +3 -1
- package/src/concepts/CallFunction__.ts +195 -11
- package/src/concepts/CallInterface__.ts +4 -2
- package/src/concepts/CallLogic__.ts +211 -12
- package/src/concepts/CallQueryComponent__.ts +2 -1
- package/src/concepts/Comment__.ts +1 -0
- package/src/concepts/CompletionProperty__.ts +1 -0
- package/src/concepts/ConfigGroup__.ts +290 -0
- package/src/concepts/ConfigPropertyValue__.ts +112 -0
- package/src/concepts/ConfigProperty__.ts +306 -0
- package/src/concepts/Configuration__.ts +286 -0
- package/src/concepts/Constant__.ts +3 -1
- package/src/concepts/DataElement__.ts +1 -0
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/EntityIndex__.ts +19 -0
- package/src/concepts/EntityProperty__.ts +9 -8
- package/src/concepts/Entity__.ts +66 -59
- package/src/concepts/EnumItem__.ts +1 -0
- package/src/concepts/Enum__.ts +32 -12
- package/src/concepts/Event__.ts +2 -1
- package/src/concepts/ForEachStatement__.ts +115 -69
- package/src/concepts/Function__.ts +2 -1
- package/src/concepts/Identifier__.ts +18 -1
- package/src/concepts/IfStatement__.ts +1 -0
- package/src/concepts/InterfaceParam__.ts +2 -1
- package/src/concepts/Interface__.ts +21 -5
- package/src/concepts/JSBlock__.ts +1 -0
- package/src/concepts/LogicItem__.ts +9 -40
- package/src/concepts/Logic__.ts +48 -9
- package/src/concepts/MemberExpression__.ts +14 -17
- package/src/concepts/Module__.ts +158 -139
- package/src/concepts/Namespace__.ts +13 -12
- package/src/concepts/NullLiteral__.ts +3 -1
- package/src/concepts/NumericLiteral__.ts +3 -1
- package/src/concepts/Param__.ts +3 -2
- package/src/concepts/Point__.ts +1 -0
- package/src/concepts/ProcessComponent__.ts +3 -2
- package/src/concepts/ProcessElement__.ts +102 -107
- package/src/concepts/ProcessOutcome__.ts +1 -0
- package/src/concepts/Process__.ts +12 -4
- package/src/concepts/QueryAggregateExpression__.ts +1 -0
- package/src/concepts/QueryFieldExpression__.ts +2 -1
- package/src/concepts/QueryFromExpression__.ts +1 -0
- package/src/concepts/QueryGroupByExpression__.ts +1 -0
- package/src/concepts/QueryJoinExpression__.ts +2 -1
- package/src/concepts/QueryLimitExpression__.ts +1 -0
- package/src/concepts/QueryOrderByExpression__.ts +1 -0
- package/src/concepts/QuerySelectExpression__.ts +2 -1
- package/src/concepts/Rect__.ts +1 -0
- package/src/concepts/Return__.ts +3 -2
- package/src/concepts/Role__.ts +19 -2
- package/src/concepts/Slot__.ts +1 -0
- package/src/concepts/SqlQueryComponent__.ts +11 -1
- package/src/concepts/Start__.ts +1 -0
- package/src/concepts/StringLiteral__.ts +3 -1
- package/src/concepts/StructureProperty__.ts +2 -1
- package/src/concepts/Structure__.ts +5 -4
- package/src/concepts/SwitchCase__.ts +1 -0
- package/src/concepts/SwitchStatement__.ts +1 -0
- package/src/concepts/Theme__.ts +1 -0
- package/src/concepts/Transactional__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +4 -0
- package/src/concepts/TypeParam__.ts +1 -0
- package/src/concepts/UnaryExpression__.ts +6 -3
- package/src/concepts/Unparsed__.ts +3 -1
- package/src/concepts/UseComponent__.ts +1 -0
- package/src/concepts/ValidationRule__.ts +5 -2
- package/src/concepts/Variable__.ts +12 -6
- package/src/concepts/ViewComponent__.ts +6 -5
- package/src/concepts/ViewElement__.ts +109 -80
- package/src/concepts/View__.ts +245 -206
- package/src/concepts/WhileStatement__.ts +1 -0
- package/src/concepts/basics/stdlib/index.ts +2 -2
- package/src/concepts/basics/stdlib/nasl.ui.ts +3 -137
- package/src/concepts/basics/stdlib/nasl.util.ts +21 -5
- package/src/concepts/basics/stdlib/{nasl.validate.ts → nasl.validation.ts} +28 -28
- package/src/concepts/index__.ts +4 -0
- package/src/generator/compileComponent.ts +1 -1
- package/src/generator/genBundleFiles.ts +1 -2
- package/src/generator/genMetaData.ts +111 -0
- package/src/generator/index.ts +1 -0
- package/src/index.ts +2 -2
- package/src/server/createUiTs.ts +153 -0
- package/src/server/entity2LogicNamespace.ts +17 -1
- package/src/server/getExtensionModules.ts +13 -0
- package/src/server/getLogics.ts +19 -18
- package/src/server/getMemberIdentifier.ts +60 -19
- package/src/server/getProcesses.ts +15 -8
- package/src/server/getValidates.ts +1 -1
- package/src/server/index.ts +2 -1
- package/src/server/naslServer.ts +204 -24
- package/src/server/process2LogicNamespace.ts +44 -3
- package/src/server/translator.ts +121 -97
- package/src/service/config/api.js +32 -0
- package/src/service/config/index.js +6 -0
- package/src/service/creator/index.js +2 -2
- package/src/service/logic/checktypeSocket.js +49 -0
- package/src/service/modules/api.js +20 -0
- package/src/service/modules/index.js +6 -0
- package/src/service/storage/init.ts +62 -54
- package/src/templator/genCallComponentLogic.ts +2 -2
- package/src/templator/genCreateBlock.ts +19 -25
- package/src/templator/genCurdEditMultipleKeyBlock.ts +3 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -4
- package/src/templator/genEditTableBlock.ts +3 -3
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genListViewBlock.ts +2 -2
- package/src/templator/genSelectBlock.ts +1 -1
- package/src/templator/genUpdateBlock.ts +19 -25
- package/src/templator/utils.ts +25 -153
package/src/server/translator.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import naslServer from "./naslServer";
|
|
1
2
|
export function transformType(tsType: string): string {
|
|
2
3
|
if (tsType === 'string' || tsType === 'String')
|
|
3
4
|
return '字符串';
|
|
@@ -7,10 +8,23 @@ export function transformType(tsType: string): string {
|
|
|
7
8
|
return '小数';
|
|
8
9
|
else if (tsType === 'Long')
|
|
9
10
|
return '长整数';
|
|
11
|
+
else if (tsType === 'DateTime')
|
|
12
|
+
return '日期时间';
|
|
13
|
+
else if (tsType === 'Date')
|
|
14
|
+
return '时间';
|
|
15
|
+
else if (tsType === 'Time')
|
|
16
|
+
return '日期';
|
|
10
17
|
else if (tsType === 'boolean' || tsType === 'Boolean')
|
|
11
18
|
return '布尔值';
|
|
12
19
|
else if (tsType.endsWith('[]')) {
|
|
13
20
|
return `List<${transformType(tsType.slice(0, -2))}>`;
|
|
21
|
+
} else if (tsType.startsWith('<T extends ') && tsType.endsWith('>() => T')) {
|
|
22
|
+
const types = naslServer.getDisplayString2Type(tsType);
|
|
23
|
+
let tsStr = '';
|
|
24
|
+
types.forEach((item, index) => {
|
|
25
|
+
tsStr += index === 0 ? transformType(item) : ' | ' + transformType(item);
|
|
26
|
+
});
|
|
27
|
+
return tsStr;
|
|
14
28
|
} else {
|
|
15
29
|
return tsType;
|
|
16
30
|
}
|
|
@@ -40,103 +54,113 @@ export function translateDiagnosticMessage(message: string) {
|
|
|
40
54
|
result: string,
|
|
41
55
|
transforms?: Array<(str: string) => string>,
|
|
42
56
|
}> = [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
57
|
+
{
|
|
58
|
+
re: /^Type '(.+?)' is not assignable to type '(.+?)'\./,
|
|
59
|
+
result: '左右参数类型不一致!左边类型:$2,右边类型:$1。',
|
|
60
|
+
transforms: [transformType, transformType],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
re: /^Argument of type '(.+?)' is not assignable to parameter of type '(.+?)'\./,
|
|
64
|
+
result: '参数类型不一致!传入类型:$1,接收类型:$2。',
|
|
65
|
+
transforms: [transformType, transformType],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
re: /^This condition will always return 'false' since the types '(.+?)' and '(.+?)' have no overlap\.$/,
|
|
69
|
+
result: '参数类型不匹配!左边类型:$1,右边类型:$2。',
|
|
70
|
+
transforms: [transformType, transformType],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
re: /^Type '(.+?)' is missing the following properties from type '(.+?)'/,
|
|
74
|
+
result: '类型不匹配!左边类型:$1,右边类型:$2。',
|
|
75
|
+
transforms: [transformType, transformType],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
re: /^Expression expected\.$/,
|
|
79
|
+
result: '表达式不能为空。',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
re: /^Cannot find name '__(?:IDENTIFIER|LEFT|RIGHT)__'\.$/,
|
|
83
|
+
result: '表达式不能为空。',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
re: /^Cannot find name '__(?:QueryFieldExpression)__'\.$/,
|
|
87
|
+
result: '实体字段不能为空。',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
re: /^Cannot find name '__(?:WHERE_MULTIPLE_CONDITION)__'\.$/,
|
|
91
|
+
result: '筛选条件不能有多个表达式。',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
re: /^Cannot find name '__(?:HAVING_MULTIPLE_CONDITION)__'\.$/,
|
|
95
|
+
result: '聚合属性过滤不能有多个表达式。',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
re: /^Cannot find name '__(?:EMPTY_AGGREGATE_NAME)__'\.$/,
|
|
99
|
+
result: '聚合函数名称不能为空。',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
re: /^Cannot find name '__(?:EMPTY_AGGREGATE_ALIAS)__'\.$/,
|
|
103
|
+
result: '聚合函数别名不能为空。',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
re: /^'(.+?)' is declared but its value is never read\.$/,
|
|
107
|
+
result: "已添加'$1',但从来没有使用过。",
|
|
108
|
+
transforms: [transformType, transformType],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
re: /'(.+?)' has no exported member(?: named)? '(.+?)'/,
|
|
112
|
+
result: "找不到数据结构 '$2'。",
|
|
113
|
+
transforms: [transformType, transformNamespace],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
re: /^Unreachable code detected\.$/,
|
|
117
|
+
result: '逻辑中有未使用的。',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
re: /Property '__slice' does not exist on type '(.+?)'./,
|
|
121
|
+
result: 'For Each:循环列表:参数类型不匹配!所需类型:基础类型>字符串、数组、集合等,提供类型:$1',
|
|
122
|
+
transforms: [transformType],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
re: /Property '(.+?)' does not exist on type 'typeof logics'./,
|
|
126
|
+
result: '当前逻辑$1未找到',
|
|
127
|
+
transforms: [outOriginalvalue],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
re: /Property '(.+?)' does not exist on type 'typeof (.+?)'./,
|
|
131
|
+
result: '$2上找不到$1',
|
|
132
|
+
transforms: [transformMethod, transformType],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
re: /Property '(.+?)' does not exist on type '(.+?)'./,
|
|
136
|
+
result: '$2上找不到$1',
|
|
137
|
+
transforms: [transformMethod, transformType],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
re: /Cannot find name '(.+?)'. Did you mean '(.+?)'\?/,
|
|
141
|
+
result: '没有$1,您可以换成$2',
|
|
142
|
+
transforms: [outOriginalvalue, outOriginalvalue],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
re: /Expected (.+?) arguments, but got (.+?)./,
|
|
146
|
+
result: '预期$1个参数,但得到$2个',
|
|
147
|
+
transforms: [outOriginalvalue, outOriginalvalue],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
re: /The (.+?)-hand side of an arithmetic operation must be of type (.+?). type./,
|
|
151
|
+
result: '表达式错误',
|
|
152
|
+
transforms: [outOriginalvalue, outOriginalvalue],
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
re: /Operator '(.+?)' cannot be applied to types '(.+?)' and '(.+?)'./,
|
|
156
|
+
result: '符号$1左右类型不同,左侧$2,右侧$3',
|
|
157
|
+
transforms: [outOriginalvalue, transformType, transformType],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
re: /Object is possibly 'undefined'./,
|
|
161
|
+
result: '所选择的内容未定义',
|
|
162
|
+
},
|
|
163
|
+
];
|
|
140
164
|
|
|
141
165
|
for (const rule of translateRules) {
|
|
142
166
|
const cap = rule.re.exec(message);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
loadList: {
|
|
3
|
+
url: {
|
|
4
|
+
method: 'get',
|
|
5
|
+
path: '/api/v1/property/list/{serviceId}',
|
|
6
|
+
},
|
|
7
|
+
},
|
|
8
|
+
add: {
|
|
9
|
+
url: {
|
|
10
|
+
method: 'post',
|
|
11
|
+
path: '/api/v1/property',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
delete: {
|
|
15
|
+
url: {
|
|
16
|
+
method: 'delete',
|
|
17
|
+
path: '/api/v1/property/{serviceId}/{propertyId}',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
update: {
|
|
21
|
+
url: {
|
|
22
|
+
method: 'put',
|
|
23
|
+
path: '/api/v1/property',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
check: {
|
|
27
|
+
url: {
|
|
28
|
+
method: 'get',
|
|
29
|
+
path: '/api/v1/property/fetch/{serviceId}/{key}',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -27,7 +27,7 @@ const requester = function (requestInfo) {
|
|
|
27
27
|
headers.Cookie = aslConfig.cookie;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
headers['request-lcpAppId'] = aslConfig.defaultApp?.id;
|
|
30
|
+
headers['request-lcpAppId'] = headers['request-lcpAppId'] || aslConfig.defaultApp?.id;
|
|
31
31
|
if (aslConfig.defaultApp?.baseVersion)
|
|
32
32
|
headers['request-appBaseVersion'] = aslConfig.defaultApp.baseVersion;
|
|
33
33
|
if (aslConfig.defaultApp?.versionChangedTime)
|
|
@@ -54,7 +54,7 @@ const requester = function (requestInfo) {
|
|
|
54
54
|
withCredentials: !baseURL,
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
if (aslConfig.debugRequest && requestOptions.method !== 'GET') {
|
|
57
|
+
if (aslConfig.debugRequestAll || (aslConfig.debugRequest && requestOptions.method !== 'GET')) {
|
|
58
58
|
console.debug('[Request Debug]', requestOptions);
|
|
59
59
|
}
|
|
60
60
|
const req = axios(requestOptions);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import io from 'socket.io-client';
|
|
2
|
+
export const checkTypeClient = {
|
|
3
|
+
client: null,
|
|
4
|
+
connect: false,
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export function createLogicSocketClient(appId) {
|
|
8
|
+
const client = io('/socket/ide/checktype', {
|
|
9
|
+
reconnectionDelayMax: 10000,
|
|
10
|
+
// reconnectionAttempts: 0,
|
|
11
|
+
path: '/socket/ide/checktype',
|
|
12
|
+
// query: {
|
|
13
|
+
// id: appId,
|
|
14
|
+
// type: 'app',
|
|
15
|
+
// },
|
|
16
|
+
transports: ['websocket'],
|
|
17
|
+
upgrade: true,
|
|
18
|
+
reconnection: true,
|
|
19
|
+
rejectUnauthorized: false,
|
|
20
|
+
});
|
|
21
|
+
let timeout;
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
client.on('connect', () => {
|
|
24
|
+
console.log('connect');
|
|
25
|
+
if (timeout) {
|
|
26
|
+
clearTimeout(timeout);
|
|
27
|
+
}
|
|
28
|
+
checkTypeClient.client = client;
|
|
29
|
+
checkTypeClient.connect = true;
|
|
30
|
+
resolve(client);
|
|
31
|
+
});
|
|
32
|
+
client.on('connect_error', (err) => {
|
|
33
|
+
console.log(err);
|
|
34
|
+
if (timeout) {
|
|
35
|
+
clearTimeout(timeout);
|
|
36
|
+
}
|
|
37
|
+
checkTypeClient.client = null;
|
|
38
|
+
checkTypeClient.connect = false;
|
|
39
|
+
reject();
|
|
40
|
+
});
|
|
41
|
+
timeout = setTimeout(() => {
|
|
42
|
+
console.log('timeout');
|
|
43
|
+
checkTypeClient.client = null;
|
|
44
|
+
checkTypeClient.connect = false;
|
|
45
|
+
reject();
|
|
46
|
+
}, 1000 * 10);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
loadList: {
|
|
3
|
+
url: {
|
|
4
|
+
method: 'get',
|
|
5
|
+
path: '/api/v1/module/list',
|
|
6
|
+
},
|
|
7
|
+
},
|
|
8
|
+
add: {
|
|
9
|
+
url: {
|
|
10
|
+
method: 'post',
|
|
11
|
+
path: '/api/v1/module/add',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
delete: {
|
|
15
|
+
url: {
|
|
16
|
+
method: 'delete',
|
|
17
|
+
path: '/api/v1/module/delete',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
@@ -68,59 +68,7 @@ async function doAction(app: any, list: any[]) {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
* 加载 app
|
|
73
|
-
* @param appId 如果是从文件读,就不需要传
|
|
74
|
-
* @returns app 对象
|
|
75
|
-
*/
|
|
76
|
-
export async function loadApp(appId?: string) {
|
|
77
|
-
let app: any;
|
|
78
|
-
if (config.storage.protocol === 'http') {
|
|
79
|
-
// 请求
|
|
80
|
-
const res = await axios.post('/api/storage/batchQuery', [
|
|
81
|
-
{
|
|
82
|
-
path: 'app',
|
|
83
|
-
excludes: ['views'],
|
|
84
|
-
},
|
|
85
|
-
], {
|
|
86
|
-
headers: {
|
|
87
|
-
appId,
|
|
88
|
-
},
|
|
89
|
-
});
|
|
90
|
-
const data = res?.data?.result;
|
|
91
|
-
app = new App(data?.[0]);
|
|
92
|
-
} else if (config.storage.protocol === 'mock') {
|
|
93
|
-
app = new App({
|
|
94
|
-
id: appId,
|
|
95
|
-
concept: 'App',
|
|
96
|
-
name: 'devapp',
|
|
97
|
-
title: '开发应用',
|
|
98
|
-
scope: 'pc',
|
|
99
|
-
envs: 'dev,online',
|
|
100
|
-
hasAuth: true,
|
|
101
|
-
entities: [],
|
|
102
|
-
structures: [],
|
|
103
|
-
enums: [],
|
|
104
|
-
logics: [],
|
|
105
|
-
interfaces: [],
|
|
106
|
-
views: [],
|
|
107
|
-
processes: [],
|
|
108
|
-
roles: [],
|
|
109
|
-
dependencies: [],
|
|
110
|
-
interfaceDependencies: [],
|
|
111
|
-
componentDependencies: [],
|
|
112
|
-
});
|
|
113
|
-
} else {
|
|
114
|
-
const json = await fs.readJSON(config.storage.basePath);
|
|
115
|
-
// const result = jsoner.batchQuery(json, [
|
|
116
|
-
// {
|
|
117
|
-
// path: 'app',
|
|
118
|
-
// excludes: ['views'],
|
|
119
|
-
// },
|
|
120
|
-
// ]);
|
|
121
|
-
app = new App(json);
|
|
122
|
-
}
|
|
123
|
-
|
|
71
|
+
function handleApp(app: any) {
|
|
124
72
|
app._isCollecting = false;
|
|
125
73
|
app._collectingList = [];
|
|
126
74
|
app._historyList = [];
|
|
@@ -161,13 +109,73 @@ export async function loadApp(appId?: string) {
|
|
|
161
109
|
// 是否正在收集
|
|
162
110
|
if (!app._isCollecting) {
|
|
163
111
|
embeddedTSEmitter.emit('change', {
|
|
164
|
-
value: [event
|
|
112
|
+
value: [event],
|
|
165
113
|
});
|
|
166
114
|
doAction(app, [event]);
|
|
167
115
|
} else {
|
|
168
116
|
app._collectingList.push(event);
|
|
169
117
|
}
|
|
170
118
|
});
|
|
119
|
+
}
|
|
171
120
|
|
|
121
|
+
/**
|
|
122
|
+
* 加载 app
|
|
123
|
+
* @param appId 如果是从文件读,就不需要传
|
|
124
|
+
* @returns app 对象
|
|
125
|
+
*/
|
|
126
|
+
export async function loadApp(appId?: string) {
|
|
127
|
+
let app: App;
|
|
128
|
+
if (config.storage.protocol === 'http') {
|
|
129
|
+
// 请求
|
|
130
|
+
const res = await axios.post('/api/storage/batchQuery', [
|
|
131
|
+
{
|
|
132
|
+
path: 'app',
|
|
133
|
+
excludes: ['views'],
|
|
134
|
+
},
|
|
135
|
+
], {
|
|
136
|
+
headers: {
|
|
137
|
+
appId,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
const data = res?.data?.result;
|
|
141
|
+
app = new App(Object.assign(data?.[0], { id: appId }));
|
|
142
|
+
} else if (config.storage.protocol === 'mock') {
|
|
143
|
+
app = new App({
|
|
144
|
+
id: appId,
|
|
145
|
+
concept: 'App',
|
|
146
|
+
name: 'devapp',
|
|
147
|
+
title: '开发应用',
|
|
148
|
+
scope: 'pc',
|
|
149
|
+
envs: 'dev,online',
|
|
150
|
+
hasAuth: true,
|
|
151
|
+
entities: [],
|
|
152
|
+
structures: [],
|
|
153
|
+
enums: [],
|
|
154
|
+
logics: [],
|
|
155
|
+
interfaces: [],
|
|
156
|
+
views: [],
|
|
157
|
+
processes: [],
|
|
158
|
+
roles: [],
|
|
159
|
+
dependencies: [],
|
|
160
|
+
interfaceDependencies: [],
|
|
161
|
+
componentDependencies: [],
|
|
162
|
+
});
|
|
163
|
+
} else {
|
|
164
|
+
const json = await fs.readJSON(config.storage.basePath);
|
|
165
|
+
app = new App(Object.assign(json, { id: appId }));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
handleApp(app);
|
|
172
169
|
return app as App;
|
|
173
170
|
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 加载 app
|
|
174
|
+
* @returns app 对象
|
|
175
|
+
*/
|
|
176
|
+
export function loadAppSync() {
|
|
177
|
+
const json = fs.readJSONSync(config.storage.basePath);
|
|
178
|
+
const app = new App(json);
|
|
179
|
+
handleApp(app);
|
|
180
|
+
return app;
|
|
181
|
+
}
|
|
@@ -8,8 +8,8 @@ import { NaslLogicItem } from './utils';
|
|
|
8
8
|
*/
|
|
9
9
|
export function genCallComponentLogic(componentName: string, componentMethod: string, params: Array<string> = []) {
|
|
10
10
|
return NaslLogicItem.CallLogic({
|
|
11
|
-
calleeNamespace:
|
|
12
|
-
calleeName:
|
|
11
|
+
calleeNamespace: `elements.${componentName}.logics`,
|
|
12
|
+
calleeName: componentMethod,
|
|
13
13
|
arguments: params.map((param) => {
|
|
14
14
|
if (typeof param === 'string')
|
|
15
15
|
return NaslLogicItem.Argument({
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { config } from '../config';
|
|
2
2
|
import * as utils from '../utils';
|
|
3
3
|
import { App, Namespace, Entity, Logic, View, Enum } from '../concepts';
|
|
4
|
+
import { NaslUITypeAnnotation, NaslTypeAnnotation, NaslLogicItem, NaslNode } from './utils';
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
NameGroup,
|
|
7
|
+
genUniqueQueryNameGroup,
|
|
8
|
+
filterProperty,
|
|
9
|
+
genLogicParam,
|
|
10
|
+
getFirstDisplayedProperty,
|
|
11
|
+
genCallComponentLogic,
|
|
12
|
+
genEnumSelectBlock,
|
|
13
|
+
genLoadSelectLogic,
|
|
14
|
+
genQueryStructure,
|
|
15
|
+
genQueryLogic,
|
|
12
16
|
} from '.';
|
|
13
17
|
|
|
14
18
|
export function genCreateFormTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroupMap: Map<string, NameGroup>) {
|
|
15
|
-
const parentNode =
|
|
19
|
+
const parentNode = entity.parentNode as App | Namespace;
|
|
16
20
|
const properties = entity.properties.filter(filterProperty('inForm'));
|
|
17
21
|
|
|
18
22
|
return `<u-form ref="${nameGroup.viewElementMainView}">
|
|
@@ -32,16 +36,13 @@ export function genCreateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
32
36
|
let formItem = ` <u-form-item label="${label}"${required ? ' required' : ''}${rulesStr.length ? ` rules="${rulesStr}"` : ''}>\n`;
|
|
33
37
|
|
|
34
38
|
const { typeAnnotation } = property || {};
|
|
35
|
-
const {
|
|
36
|
-
typeName: propertyTypeName,
|
|
37
|
-
typeNamespace: propertyTypeNamespace,
|
|
38
|
-
} = typeAnnotation || {};
|
|
39
|
+
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
39
40
|
if (property.relationEntity) {
|
|
40
41
|
// 有外键关联
|
|
41
42
|
const relationEntity = parentNode?.findEntityByName(property.relationEntity);
|
|
42
43
|
if (relationEntity) {
|
|
43
44
|
const relationProperty = relationEntity.properties.find((prop) => prop.name === property.relationProperty);
|
|
44
|
-
const displayedProperty = getFirstDisplayedProperty(relationEntity
|
|
45
|
+
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
45
46
|
if (displayedProperty) {
|
|
46
47
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
47
48
|
const selectNameGroup = selectNameGroupMap.get(relationEntity.name);
|
|
@@ -107,16 +108,13 @@ export function genH5CreateFormTemplate(entity: Entity, nameGroup: NameGroup, se
|
|
|
107
108
|
|
|
108
109
|
let formItem = ` <van-field drole="other" label="${property.label || property.name}"${required ? ' required' : ''}${rulesStr.length ? ` rules="${rulesStr}"` : ''}>\n`;
|
|
109
110
|
const { typeAnnotation } = property || {};
|
|
110
|
-
const {
|
|
111
|
-
typeName: propertyTypeName,
|
|
112
|
-
typeNamespace: propertyTypeNamespace,
|
|
113
|
-
} = typeAnnotation || {};
|
|
111
|
+
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
114
112
|
if (property.relationEntity) {
|
|
115
113
|
// 有外键关联
|
|
116
114
|
const relationEntity = parentNode?.findEntityByName(property.relationEntity);
|
|
117
115
|
if (relationEntity) {
|
|
118
116
|
const relationProperty = relationEntity.properties.find((prop) => prop.name === property.relationProperty);
|
|
119
|
-
const displayedProperty = getFirstDisplayedProperty(relationEntity
|
|
117
|
+
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
120
118
|
if (displayedProperty) {
|
|
121
119
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
122
120
|
const selectNameGroup = selectNameGroupMap.get(relationEntity.name);
|
|
@@ -142,9 +140,7 @@ export function genH5CreateFormTemplate(entity: Entity, nameGroup: NameGroup, se
|
|
|
142
140
|
} else if (propertyTypeName === 'Date') {
|
|
143
141
|
formItem += `<template #input><van-calendar v-model="${vModel}" title="请输入${property.label || property.name}"></van-calendar></template>`;
|
|
144
142
|
} else if (propertyTypeName === 'Time') {
|
|
145
|
-
formItem += `<template #input><van-datetime-picker type="time" v-model="${vModel}" title="请选择${
|
|
146
|
-
property.label || property.name
|
|
147
|
-
}" label-field=""></van-datetime-picker></template>`;
|
|
143
|
+
formItem += `<template #input><van-datetime-picker type="time" v-model="${vModel}" title="请选择${property.label || property.name}" label-field=""></van-datetime-picker></template>`;
|
|
148
144
|
} else if (propertyTypeName === 'DateTime') {
|
|
149
145
|
formItem += `<template #input><van-datetime-picker type="datetime" v-model="${vModel}" title="请选择${
|
|
150
146
|
property.label || property.name
|
|
@@ -173,9 +169,7 @@ export function genH5CreateFormTemplate(entity: Entity, nameGroup: NameGroup, se
|
|
|
173
169
|
}
|
|
174
170
|
|
|
175
171
|
function genSubmitLogic(createLogic: Logic, nameGroup: NameGroup) {
|
|
176
|
-
const params = [
|
|
177
|
-
genLogicParam(`${createLogic.params[0].name}`, nameGroup.viewVariableEntity),
|
|
178
|
-
];
|
|
172
|
+
const params = [genLogicParam(`${createLogic.params[0].name}`, nameGroup.viewVariableEntity)];
|
|
179
173
|
return NaslNode.Logic({
|
|
180
174
|
name: nameGroup.viewLogicSubmit,
|
|
181
175
|
params: [],
|
|
@@ -212,7 +206,7 @@ function genSubmitLogic(createLogic: Logic, nameGroup: NameGroup) {
|
|
|
212
206
|
NaslLogicItem.CallLogic({
|
|
213
207
|
label: '弹出消息',
|
|
214
208
|
shortcut: true,
|
|
215
|
-
calleeNamespace: 'nasl.ui
|
|
209
|
+
calleeNamespace: 'nasl.ui',
|
|
216
210
|
calleeName: 'showMessage',
|
|
217
211
|
arguments: [
|
|
218
212
|
NaslLogicItem.Argument({
|
|
@@ -38,7 +38,7 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
38
38
|
const relationEntity = parentNode?.findEntityByName(property.relationEntity);
|
|
39
39
|
if (relationEntity) {
|
|
40
40
|
const relationProperty = relationEntity.properties.find((prop) => prop.name === property.relationProperty);
|
|
41
|
-
const displayedProperty = getFirstDisplayedProperty(relationEntity
|
|
41
|
+
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
42
42
|
if (displayedProperty) {
|
|
43
43
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
44
44
|
const selectNameGroup = selectNameGroupMap.get(relationEntity.name);
|
|
@@ -136,7 +136,7 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
136
136
|
const relationEntity = parentNode?.findEntityByName(property.relationEntity);
|
|
137
137
|
if (relationEntity) {
|
|
138
138
|
const relationProperty = relationEntity.properties.find((prop) => prop.name === property.relationProperty);
|
|
139
|
-
const displayedProperty = getFirstDisplayedProperty(relationEntity
|
|
139
|
+
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
140
140
|
if (displayedProperty) {
|
|
141
141
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
142
142
|
const selectNameGroup = selectNameGroupMap.get(relationEntity.name);
|
|
@@ -439,7 +439,7 @@ export function genCurdEditMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
439
439
|
"concept": "BindEvent",
|
|
440
440
|
"arguments": [],
|
|
441
441
|
"name": "created",
|
|
442
|
-
"calleeNamespace": "${view.getNamespace()}.views
|
|
442
|
+
"calleeNamespace": "${view.getNamespace()}.views.${view.name}.logics",
|
|
443
443
|
"calleeName": "${nameGroup.viewLogicInit}"
|
|
444
444
|
}
|
|
445
445
|
],
|