@lcap/nasl 2.12.0-beta → 2.12.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/out/automate/engine/index.d.ts +1 -0
- package/out/automate/engine/index.js +23 -12
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/operators.d.ts +10 -2
- package/out/automate/engine/operators.js +105 -7
- package/out/automate/engine/operators.js.map +1 -1
- package/out/automate/engine/uniqueName.d.ts +8 -2
- package/out/automate/engine/uniqueName.js +72 -4
- package/out/automate/engine/uniqueName.js.map +1 -1
- package/out/automate/engine/utils.js +4 -1
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/process.d.ts +9 -0
- package/out/automate/template/process.js +10976 -0
- package/out/automate/template/process.js.map +1 -0
- package/out/bak/translator.js +1 -0
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +5 -0
- package/out/common/BaseNode.js +24 -3
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.js +3 -2
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/Assignment__.js +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +9 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +6 -2
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +4 -0
- package/out/concepts/BooleanLiteral__.js +12 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js +2 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +1 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +27 -11
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +1 -1
- package/out/concepts/CallQueryComponent__.js +3 -3
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +1 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.js +2 -0
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/End__.js +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.js +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +1 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +1 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +1 -1
- 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__.js +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +2 -2
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +3 -2
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +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__.js +2 -2
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +2 -4
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.js +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +7 -6
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +118 -112
- package/out/concepts/Module__.js +25 -7
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +2 -2
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.js +2 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +7 -2
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.d.ts +1 -1
- package/out/concepts/Process__.js +2 -2
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +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 +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js +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 +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +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 +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js +2 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +4 -0
- package/out/concepts/SqlQueryComponent__.js +16 -0
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -2
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +5 -4
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +1 -1
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +1 -1
- package/out/concepts/SwitchCase__.js +19 -21
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +2 -7
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +2 -2
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +2 -2
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +1 -1
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +9 -4
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +0 -2
- package/out/concepts/View__.js +4 -11
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +20 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.d.ts +4 -0
- package/out/concepts/basics/stdlib/nasl.process.js +410 -0
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +1 -11
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +25 -25
- 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/generator/genBundleFiles.d.ts +3 -1
- package/out/generator/genBundleFiles.js +16 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +1 -0
- package/out/generator/genMetaData.js +7 -0
- package/out/generator/genMetaData.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.js +2 -1
- package/out/index.js.map +1 -1
- package/out/server/getLogics.js +18 -0
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +5 -0
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +1 -0
- package/out/server/getProcesses.js +9 -1
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.d.ts +1 -0
- package/out/server/naslServer.js +98 -23
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +21 -3
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -0
- package/out/service/storage/init.js +94 -83
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +20 -14
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +13 -6
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +20 -8
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -1
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +1 -1
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +8 -4
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +1 -2
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +20 -21
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genTableBlock.js +14 -6
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +20 -14
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.js +19 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/automate/engine/index.js +21 -7
- package/src/automate/engine/operators.js +114 -17
- package/src/automate/engine/uniqueName.js +77 -9
- package/src/automate/engine/utils.js +4 -2
- package/src/automate/template/process.js +10999 -0
- package/src/bak/translator.js +1 -0
- package/src/common/BaseNode.ts +21 -4
- package/src/concepts/App__.ts +4 -40
- package/src/concepts/Argument__.ts +1 -1
- package/src/concepts/Assignee__.ts +1 -1
- package/src/concepts/Assignment__.ts +1 -1
- package/src/concepts/Attribute__.ts +1 -1
- package/src/concepts/BinaryExpression__.ts +1 -1
- package/src/concepts/BindAttribute__.ts +1 -1
- package/src/concepts/BindDirective__.ts +8 -6
- package/src/concepts/BindEvent__.ts +6 -2
- package/src/concepts/BooleanLiteral__.ts +13 -1
- package/src/concepts/CallFunction__.ts +15 -14
- package/src/concepts/CallInterface__.ts +1 -1
- package/src/concepts/CallLogic__.ts +26 -11
- package/src/concepts/CallQueryComponent__.ts +32 -4
- package/src/concepts/Comment__.ts +1 -1
- package/src/concepts/CompletionProperty__.ts +1 -1
- package/src/concepts/ConfigGroup__.ts +1 -1
- package/src/concepts/ConfigPropertyValue__.ts +1 -1
- package/src/concepts/ConfigProperty__.ts +1 -1
- package/src/concepts/Configuration__.ts +1 -1
- package/src/concepts/Constant__.ts +1 -1
- package/src/concepts/DataElement__.ts +1 -1
- package/src/concepts/DataSource__.ts +2 -0
- package/src/concepts/End__.ts +1 -1
- package/src/concepts/EntityIndex__.ts +1 -1
- package/src/concepts/EntityProperty__.ts +1 -1
- package/src/concepts/Entity__.ts +1 -1
- package/src/concepts/EnumItem__.ts +1 -1
- package/src/concepts/Enum__.ts +1 -1
- package/src/concepts/Event__.ts +1 -1
- package/src/concepts/ForEachStatement__.ts +1 -1
- package/src/concepts/Function__.ts +5 -5
- package/src/concepts/Identifier__.ts +3 -2
- package/src/concepts/IfStatement__.ts +1 -1
- package/src/concepts/InterfaceParam__.ts +1 -1
- package/src/concepts/Interface__.ts +2 -2
- package/src/concepts/JSBlock__.ts +2 -11
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +8 -44
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/Module__.ts +141 -147
- package/src/concepts/Namespace__.ts +2 -2
- package/src/concepts/NullLiteral__.ts +1 -1
- package/src/concepts/NumericLiteral__.ts +1 -1
- package/src/concepts/Param__.ts +2 -2
- package/src/concepts/Point__.ts +1 -1
- package/src/concepts/ProcessComponent__.ts +1 -1
- package/src/concepts/ProcessElement__.ts +8 -3
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/Process__.ts +3 -3
- package/src/concepts/QueryAggregateExpression__.ts +1 -1
- package/src/concepts/QueryFieldExpression__.ts +1 -1
- package/src/concepts/QueryFromExpression__.ts +1 -1
- package/src/concepts/QueryGroupByExpression__.ts +1 -1
- package/src/concepts/QueryJoinExpression__.ts +1 -1
- package/src/concepts/QueryLimitExpression__.ts +1 -1
- package/src/concepts/QueryOrderByExpression__.ts +1 -1
- package/src/concepts/QuerySelectExpression__.ts +1 -1
- package/src/concepts/Rect__.ts +1 -1
- package/src/concepts/Return__.ts +2 -2
- package/src/concepts/Role__.ts +1 -1
- package/src/concepts/Slot__.ts +1 -1
- package/src/concepts/SqlQueryComponent__.ts +17 -0
- package/src/concepts/Start__.ts +1 -1
- package/src/concepts/StringLiteral__.ts +2 -2
- package/src/concepts/StructureProperty__.ts +5 -8
- package/src/concepts/Structure__.ts +1 -1
- package/src/concepts/SwitchCase__.ts +19 -23
- package/src/concepts/SwitchStatement__.ts +2 -6
- package/src/concepts/Theme__.ts +1 -1
- package/src/concepts/Transactional__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +21 -2
- package/src/concepts/TypeParam__.ts +1 -1
- package/src/concepts/UnaryExpression__.ts +1 -1
- package/src/concepts/Unparsed__.ts +1 -1
- package/src/concepts/UseComponent__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +1 -1
- package/src/concepts/Variable__.ts +2 -2
- package/src/concepts/ViewComponent__.ts +1 -1
- package/src/concepts/ViewElement__.ts +10 -23
- package/src/concepts/View__.ts +6 -13
- package/src/concepts/WhileStatement__.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.auth.ts +20 -0
- package/src/concepts/basics/stdlib/nasl.process.ts +406 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +1 -11
- package/src/concepts/basics/stdlib/nasl.util.ts +25 -25
- package/src/concepts/basics/types/index.ts +1 -0
- package/src/generator/genBundleFiles.ts +21 -5
- package/src/generator/genMetaData.ts +10 -1
- package/src/index.ts +1 -1
- package/src/server/getLogics.ts +18 -1
- package/src/server/getMemberIdentifier.ts +4 -0
- package/src/server/getProcesses.ts +8 -1
- package/src/server/naslServer.ts +107 -28
- package/src/server/translator.ts +20 -3
- package/src/service/creator/errHandles.js +6 -0
- package/src/service/storage/init.ts +96 -85
- package/src/templator/genCreateBlock.ts +20 -14
- package/src/templator/genCurdEditMultipleKeyBlock.ts +13 -8
- package/src/templator/genCurdMultipleKeyBlock.ts +20 -9
- package/src/templator/genEditTableBlock.ts +3 -1
- package/src/templator/genEnumSelectBlock.ts +1 -1
- package/src/templator/genGridViewBlock.ts +8 -4
- package/src/templator/genListViewBlock.ts +1 -2
- package/src/templator/genQueryComponent.ts +22 -21
- package/src/templator/genTableBlock.ts +14 -7
- package/src/templator/genUpdateBlock.ts +20 -14
- package/src/utils/index.ts +19 -0
|
@@ -26,10 +26,10 @@ function getLogic(key: string, app: any, diffLogicList: string[]) {
|
|
|
26
26
|
const _path = _pathArr[3];
|
|
27
27
|
const _list = app.dependencies;
|
|
28
28
|
const _module = _list.find((it: Module) => {
|
|
29
|
-
const name = it.name.
|
|
29
|
+
const name = it.name.replaceAll('-', '_');
|
|
30
30
|
return name === _name;
|
|
31
31
|
});
|
|
32
|
-
const logic = _module
|
|
32
|
+
const logic = _module?.logics?.find((item: Logic) => item.name === _path);
|
|
33
33
|
if (logic && logic.body && logic.body.length > 2) {
|
|
34
34
|
logic.body.map((item: any) => getStatement(item, app, diffLogicList));
|
|
35
35
|
}
|
|
@@ -50,7 +50,7 @@ function getStatement(state: any, app: any, diffLogicList: string[]) {
|
|
|
50
50
|
logicItems = [...state.body, state.each, state.start, state.end];
|
|
51
51
|
break;
|
|
52
52
|
case 'SwitchStatement':
|
|
53
|
-
logicItems = state.cases.map(getStatement);
|
|
53
|
+
logicItems = state.cases.map(getStatement).flat(1);
|
|
54
54
|
break;
|
|
55
55
|
case 'SwitchCase':
|
|
56
56
|
logicItems = [state.test, ...state.consequent];
|
|
@@ -97,104 +97,110 @@ async function doAction(app: any, actionItem: any) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
const itemloop = (_i: LogicItem, app: any, diffArr: string[]) => {
|
|
112
|
-
const _l = getStatement(_i, app, diffArr);
|
|
113
|
-
if (_l.length) {
|
|
114
|
-
_l.map((_ii: LogicItem) => itemloop(_ii, app, diffArr));
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
if (emitTarget.concept === 'Logic') {
|
|
118
|
-
const diffArr: string[] = [];
|
|
119
|
-
if (emitTarget.body.length > 2) {
|
|
120
|
-
emitTarget.body.forEach((it: LogicItem) => {
|
|
121
|
-
itemloop(it, app, diffArr);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
const result = diffArr.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
125
|
-
if (result.length) {
|
|
100
|
+
try {
|
|
101
|
+
if (Array.isArray(list)) {
|
|
102
|
+
list.forEach((event) => {
|
|
103
|
+
const emitTarget = event?.originEvent?.target;
|
|
104
|
+
const _path: string = event.originEvent.path;
|
|
105
|
+
const _root = _path.split('.')?.[1] || '';
|
|
106
|
+
if (
|
|
107
|
+
['dataSources', 'processes', 'logics', 'enums', 'structures', 'interfaces', 'interfaceDependencies', 'componentDependencies', 'configuration', 'dependencies'].some((item) =>
|
|
108
|
+
_root.startsWith(item))
|
|
109
|
+
) {
|
|
126
110
|
hasBackEnd = true;
|
|
127
111
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (isDelete || isUpdateAuth) {
|
|
136
|
-
const app = emitTarget.app;
|
|
112
|
+
const itemloop = (_i: LogicItem, app: any, diffArr: string[]) => {
|
|
113
|
+
const _l = getStatement(_i, app, diffArr);
|
|
114
|
+
if (_l.length) {
|
|
115
|
+
_l.map((_ii: LogicItem) => itemloop(_ii, app, diffArr));
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
if (emitTarget.concept === 'Logic') {
|
|
137
119
|
const diffArr: string[] = [];
|
|
138
|
-
emitTarget.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
});
|
|
120
|
+
if (emitTarget.body.length > 2) {
|
|
121
|
+
emitTarget.body.forEach((it: LogicItem) => {
|
|
122
|
+
itemloop(it, app, diffArr);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
145
125
|
const result = diffArr.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
146
126
|
if (result.length) {
|
|
147
127
|
hasBackEnd = true;
|
|
148
128
|
}
|
|
149
|
-
emitTarget.children.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
150
|
-
emitTarget.elements.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
151
129
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (emitTarget.concept === 'ViewElement') {
|
|
155
|
-
loopEle(emitTarget, true);
|
|
156
|
-
}
|
|
157
|
-
if (emitTarget.concept === 'BindAttribute' && emitTarget.name === 'url' && emitTarget.value.endsWith('/import')) {
|
|
158
|
-
if (!emitTarget.view.parentAuth) {
|
|
159
|
-
hasBackEnd = true;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if (emitTarget.concept === 'CallLogic') {
|
|
163
|
-
const arrlist: string[] = [];
|
|
164
|
-
getLogic(emitTarget.calleeKey, emitTarget.app, arrlist);
|
|
165
|
-
const result = arrlist.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
166
|
-
// console.log(result, 'CallLogic');
|
|
167
|
-
if (result.length) {
|
|
168
|
-
hasBackEnd = true;
|
|
130
|
+
if (emitTarget.view) {
|
|
131
|
+
hasFrontEnd = true;
|
|
169
132
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
133
|
+
if (emitTarget.concept === 'View') {
|
|
134
|
+
const isDelete = event?.originEvent?.action === 'delete';
|
|
135
|
+
const isUpdateAuth = event?.originEvent?.action === 'update' && event?.originEvent?.object && 'auth' in event?.originEvent?.object;
|
|
136
|
+
if (isDelete || isUpdateAuth) {
|
|
137
|
+
const app = emitTarget.app;
|
|
138
|
+
const diffArr: string[] = [];
|
|
139
|
+
emitTarget.logics.forEach((logic: Logic) => {
|
|
140
|
+
if (logic.body.length > 2) {
|
|
141
|
+
logic.body.forEach((it: LogicItem) => {
|
|
142
|
+
itemloop(it, app, diffArr);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
178
145
|
});
|
|
179
|
-
|
|
180
|
-
|
|
146
|
+
const result = diffArr.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
147
|
+
if (result.length) {
|
|
148
|
+
hasBackEnd = true;
|
|
149
|
+
}
|
|
150
|
+
emitTarget.children.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
151
|
+
emitTarget.elements.forEach((item: View | ViewElement) => loopEle(item, isDelete));
|
|
152
|
+
}
|
|
153
|
+
hasFrontEnd = true;
|
|
154
|
+
}
|
|
155
|
+
if (emitTarget.concept === 'ViewElement') {
|
|
156
|
+
loopEle(emitTarget, true);
|
|
157
|
+
}
|
|
158
|
+
if (emitTarget.concept === 'BindAttribute' && emitTarget.name === 'url' && emitTarget.value.endsWith('/import')) {
|
|
159
|
+
if (!emitTarget.view.parentAuth) {
|
|
160
|
+
hasBackEnd = true;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (emitTarget.concept === 'CallLogic') {
|
|
164
|
+
const arrlist: string[] = [];
|
|
165
|
+
getLogic(emitTarget.calleeKey, emitTarget.app, arrlist);
|
|
166
|
+
const result = arrlist.filter((item) => item.startsWith('app') || item.startsWith('extensions'));
|
|
167
|
+
// console.log(result, 'CallLogic');
|
|
168
|
+
if (result.length) {
|
|
169
|
+
hasBackEnd = true;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
event.eventList.forEach(({ action, path, object: objItem }: { action: string; path: string; object: any }) => {
|
|
173
|
+
if (Array.isArray(objItem)) {
|
|
174
|
+
if (action === 'update') {
|
|
181
175
|
actionList.push({
|
|
182
176
|
action,
|
|
183
177
|
path,
|
|
184
|
-
node:
|
|
178
|
+
node: objItem[0],
|
|
185
179
|
});
|
|
180
|
+
} else {
|
|
181
|
+
objItem.forEach((item, index) => {
|
|
182
|
+
actionList.push({
|
|
183
|
+
action,
|
|
184
|
+
path,
|
|
185
|
+
node: item,
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
actionList.push({
|
|
191
|
+
action,
|
|
192
|
+
path,
|
|
193
|
+
object: objItem,
|
|
186
194
|
});
|
|
187
195
|
}
|
|
188
|
-
}
|
|
189
|
-
actionList.push({
|
|
190
|
-
action,
|
|
191
|
-
path,
|
|
192
|
-
object: objItem,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
196
|
+
});
|
|
195
197
|
});
|
|
196
|
-
}
|
|
198
|
+
}
|
|
199
|
+
} catch (error) {
|
|
200
|
+
console.log(error);
|
|
201
|
+
app.emit('refresh');
|
|
197
202
|
}
|
|
203
|
+
|
|
198
204
|
let ChangedNASLType = '';
|
|
199
205
|
if (hasFrontEnd && hasBackEnd) {
|
|
200
206
|
ChangedNASLType = 'both';
|
|
@@ -213,11 +219,15 @@ async function doAction(app: any, actionItem: any) {
|
|
|
213
219
|
ChangedNASLType,
|
|
214
220
|
'request-appBaseVersion': (window as any).appData?.baseVersion || '',
|
|
215
221
|
'request-versionChangedTime': (window as any).appData?.versionChangedTime || '',
|
|
222
|
+
operateArea: (window as any).appData?.branchStatus === 'merging' ? 'merge_conflict' : '',
|
|
216
223
|
},
|
|
217
224
|
});
|
|
218
225
|
} catch (error) {
|
|
219
226
|
err = error;
|
|
220
|
-
|
|
227
|
+
|
|
228
|
+
// 401650, 检测到当前应用拉取操作已被强制结束, 用户确认后再刷新
|
|
229
|
+
if (error?.code !== 401650)
|
|
230
|
+
app.emit('refresh');
|
|
221
231
|
}
|
|
222
232
|
} else if (config.storage.protocol === 'mock') {
|
|
223
233
|
// Do nothing
|
|
@@ -250,7 +260,7 @@ async function doAction(app: any, actionItem: any) {
|
|
|
250
260
|
}
|
|
251
261
|
}
|
|
252
262
|
|
|
253
|
-
function handleApp(app: any) {
|
|
263
|
+
export function handleApp(app: any) {
|
|
254
264
|
app._isCollectingCount = 0;
|
|
255
265
|
app._collectingList = [];
|
|
256
266
|
app._historyList = [];
|
|
@@ -379,6 +389,7 @@ export async function loadApp(appId?: string) {
|
|
|
379
389
|
appId,
|
|
380
390
|
'request-appBaseVersion': (window as any).appData?.baseVersion || '',
|
|
381
391
|
'request-versionChangedTime': (window as any).appData?.versionChangedTime || '',
|
|
392
|
+
operateArea: (window as any).appData?.branchStatus === 'merging' ? 'merge_conflict' : '',
|
|
382
393
|
},
|
|
383
394
|
});
|
|
384
395
|
// const data = res?.data?.result;
|
|
@@ -46,7 +46,9 @@ export function genCreateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
46
46
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
47
47
|
if (displayedProperty) {
|
|
48
48
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
49
|
-
|
|
49
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
50
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
51
|
+
const selectNameGroup = selectNameGroupMap.get(key);
|
|
50
52
|
formItem += `
|
|
51
53
|
<u-select clearable placeholder="请选择${label}" :data-source="${selectNameGroup.viewLogicLoad}"
|
|
52
54
|
text-field="${lowerEntityName}.${displayedProperty.name}" value-field="${lowerEntityName}.${relationProperty.name}" :pageable="true" :remote-paging="true" v-model="${vModel}">
|
|
@@ -119,39 +121,41 @@ export function genH5CreateFormTemplate(entity: Entity, nameGroup: NameGroup, se
|
|
|
119
121
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
120
122
|
if (displayedProperty) {
|
|
121
123
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
122
|
-
|
|
124
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
125
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
126
|
+
const selectNameGroup = selectNameGroupMap.get(key);
|
|
123
127
|
formItem += `
|
|
124
|
-
<template #input><van-cascader title="请选择${label}" placeholder="请选择${label}"
|
|
128
|
+
<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-cascader title="请选择${label}" placeholder="请选择${label}"
|
|
125
129
|
v-model="${vModel}" :data-source="${selectNameGroup.viewLogicLoad}"
|
|
126
130
|
text-field="${lowerEntityName}.${displayedProperty.name}" value-field="${lowerEntityName}.${relationProperty.name}"
|
|
127
131
|
:notitleblock="true"
|
|
128
|
-
:pageable="true" :remote-paging="true"></van-cascader></template>
|
|
132
|
+
:pageable="true" input-align="left" :remote-paging="true"></van-cascader></van-linear-layout></template>
|
|
129
133
|
`;
|
|
130
134
|
} else
|
|
131
135
|
return '';
|
|
132
136
|
} else
|
|
133
137
|
return '';
|
|
134
138
|
} else if (propertyTypeName === 'Boolean') {
|
|
135
|
-
formItem += `<template #input><van-switch v-model="${vModel}"></van-switch></template>`;
|
|
139
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-switch v-model="${vModel}"></van-switch></van-linear-layout></template>`;
|
|
136
140
|
} else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
|
|
137
|
-
formItem += `<template #input><van-stepper v-model="${vModel}" placeholder="请输入${property.label || property.name}"></van-stepper></template>`;
|
|
141
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-stepper-new v-model="${vModel}" placeholder="请输入${property.label || property.name}" :showPlus="false" :showMinus="false" align="left"></van-stepper-new></van-linear-layout></template>`;
|
|
138
142
|
} else if (propertyTypeName === 'Double') {
|
|
139
|
-
formItem += `<template #input><van-stepper v-model="${vModel}" placeholder="请输入${property.label || property.name}"></van-stepper></template>`;
|
|
143
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-stepper-new v-model="${vModel}" placeholder="请输入${property.label || property.name}" :showPlus="false" :showMinus="false" align="left"></van-stepper-new></van-linear-layout></template>`;
|
|
140
144
|
} else if (propertyTypeName === 'Text') {
|
|
141
|
-
formItem += `<template #input><van-fieldtextarea v-model="${vModel}" placeholder="请输入${property.label || property.name}"></van-fieldtextarea></template>`;
|
|
145
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-fieldtextarea v-model="${vModel}" placeholder="请输入${property.label || property.name}"></van-fieldtextarea></van-linear-layout></template>`;
|
|
142
146
|
} else if (propertyTypeName === 'Date') {
|
|
143
|
-
formItem += `<template #input><van-calendar :default-date.sync="${vModel}" title="选择日期"></van-calendar></template>`;
|
|
147
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-calendar :default-date.sync="${vModel}" title="选择日期" input-align="left"></van-calendar></van-linear-layout></template>`;
|
|
144
148
|
} else if (propertyTypeName === 'Time') {
|
|
145
|
-
formItem += `<template #input><van-datetime-picker type="time" v-model="${vModel}" title="请选择${property.label || property.name}" label-field=""></van-datetime-picker></template>`;
|
|
149
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-datetime-picker type="time" v-model="${vModel}" title="请选择${property.label || property.name}" label-field="" input-align="left"></van-datetime-picker></van-linear-layout></template>`;
|
|
146
150
|
} else if (propertyTypeName === 'DateTime') {
|
|
147
|
-
formItem += `<template #input><van-datetime-picker type="datetime" v-model="${vModel}" title="请选择${property.label || property.name}" label-field=""></van-datetime-picker></template>`;
|
|
151
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-datetime-picker type="datetime" v-model="${vModel}" title="请选择${property.label || property.name}" label-field="" input-align="left"></van-datetime-picker></van-linear-layout></template>`;
|
|
148
152
|
} else {
|
|
149
153
|
const namespaceArr = propertyTypeNamespace.split('.');
|
|
150
154
|
const type = namespaceArr.pop();
|
|
151
155
|
if (type === 'enums') {
|
|
152
|
-
formItem += '<template #input>' + genEnumSelectBlock(module.findEnumByName(propertyTypeName) as Enum, `${vModel}`, '', `请选择${label}`, true) + '</template>';
|
|
156
|
+
formItem += '<template #input><van-linear-layout style="width:100%;" direction="horizontal">' + genEnumSelectBlock(module.findEnumByName(propertyTypeName) as Enum, `${vModel}`, '', `请选择${label}`, true) + '</van-linear-layout></template>';
|
|
153
157
|
} else {
|
|
154
|
-
formItem += `<template #input><van-fieldinput v-model="${vModel}" placeholder="请输入${property.label || property.name}"></van-fieldinput></template>`;
|
|
158
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-fieldinput v-model="${vModel}" placeholder="请输入${property.label || property.name}"></van-fieldinput></van-linear-layout></template>`;
|
|
155
159
|
}
|
|
156
160
|
}
|
|
157
161
|
formItem += `<template #title><van-text text="${property.label || property.name}"><van-text></template>`;
|
|
@@ -254,7 +258,9 @@ export function genCreateBlock(entity: Entity, view: View) {
|
|
|
254
258
|
const viewElementSelect = view.getViewElementUniqueName('select');
|
|
255
259
|
const selectNameGroup = genUniqueQueryNameGroup(module, view, viewElementSelect, false, relationEntity.name);
|
|
256
260
|
selectNameGroup.viewElementSelect = viewElementSelect;
|
|
257
|
-
|
|
261
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
262
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
263
|
+
selectNameGroupMap.set(key, selectNameGroup);
|
|
258
264
|
const newStructure = genQueryStructure([relationEntity], selectNameGroup);
|
|
259
265
|
const newLogic = genQueryLogic([relationEntity], selectNameGroup, false, false, module);
|
|
260
266
|
newStructures.push(newStructure);
|
|
@@ -48,7 +48,9 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
48
48
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
49
49
|
if (displayedProperty) {
|
|
50
50
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
51
|
-
|
|
51
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
52
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
53
|
+
const selectNameGroup = selectNameGroupMap.get(key);
|
|
52
54
|
formItem += `
|
|
53
55
|
<u-select clearable placeholder="请选择${label}" :data-source="${selectNameGroup.viewLogicLoad}"
|
|
54
56
|
text-field="${lowerEntityName}.${displayedProperty.name}" value-field="${lowerEntityName}.${relationProperty.name}" :pageable="true" :remote-paging="true" v-model="${vModel}">
|
|
@@ -144,7 +146,9 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
144
146
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
145
147
|
if (displayedProperty) {
|
|
146
148
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
147
|
-
|
|
149
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
150
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
151
|
+
const selectNameGroup = selectNameGroupMap.get(key);
|
|
148
152
|
formItem += `
|
|
149
153
|
<u-select clearable placeholder="请选择${label}" :data-source="${selectNameGroup.load}"
|
|
150
154
|
text-field="${lowerEntityName}.${displayedProperty.name}" value-field="${lowerEntityName}.${relationProperty.name}" :pageable="true" :remote-paging="true" v-model="${vModel}">
|
|
@@ -353,7 +357,8 @@ export function genCurdEditMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
353
357
|
nameGroup.viewVariableIsUpdate = view.getVariableUniqueName('isUpdate');
|
|
354
358
|
|
|
355
359
|
// 收集所有和本实体关联的实体
|
|
356
|
-
const
|
|
360
|
+
const entitySet: Set<Entity> = new Set();
|
|
361
|
+
entitySet.add(entity);
|
|
357
362
|
const selectNameGroupMap: Map<string, NameGroup> = new Map();
|
|
358
363
|
const newStructures: any[] = [];
|
|
359
364
|
const newLogics: any[] = [];
|
|
@@ -365,11 +370,13 @@ export function genCurdEditMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
365
370
|
if (relationEntity) {
|
|
366
371
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
367
372
|
if (displayedProperty) {
|
|
368
|
-
|
|
373
|
+
entitySet.add(relationEntity);
|
|
369
374
|
const viewElementSelect = view.getViewElementUniqueName('select');
|
|
370
375
|
const selectNameGroup = genUniqueQueryNameGroup(module, view, viewElementSelect, false, relationEntity.name);
|
|
371
376
|
selectNameGroup.viewElementSelect = viewElementSelect;
|
|
372
|
-
|
|
377
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
378
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
379
|
+
selectNameGroupMap.set(key, selectNameGroup);
|
|
373
380
|
const newStructure = genQueryStructure([relationEntity], selectNameGroup);
|
|
374
381
|
const newLogic = genQueryLogic([relationEntity], selectNameGroup, false, false, module);
|
|
375
382
|
newStructures.push(newStructure);
|
|
@@ -379,13 +386,11 @@ export function genCurdEditMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
379
386
|
}
|
|
380
387
|
}
|
|
381
388
|
});
|
|
389
|
+
const allEntities = [...entitySet];
|
|
382
390
|
const entityStructure = genEditQueryStructure(allEntities, nameGroup);
|
|
383
391
|
newStructures.push(entityStructure);
|
|
384
392
|
const entityLogic = genQueryLogic(allEntities, nameGroup, true, true, module);
|
|
385
393
|
newLogics.push(entityLogic);
|
|
386
|
-
|
|
387
|
-
// console.log(entityStructure);
|
|
388
|
-
|
|
389
394
|
return `<template>
|
|
390
395
|
<u-linear-layout direction="vertical">
|
|
391
396
|
${genFilterTemplate(entity, nameGroup, selectNameGroupMap)}
|
|
@@ -43,7 +43,9 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
43
43
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
44
44
|
if (displayedProperty) {
|
|
45
45
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
46
|
-
|
|
46
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
47
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
48
|
+
const selectNameGroup = selectNameGroupMap.get(key);
|
|
47
49
|
formItem += `
|
|
48
50
|
<u-select clearable placeholder="请选择${label}" :data-source="${selectNameGroup.viewLogicLoad}"
|
|
49
51
|
text-field="${lowerEntityName}.${displayedProperty.name}" value-field="${lowerEntityName}.${relationProperty.name}" :pageable="true" :remote-paging="true" v-model="${vModel}">
|
|
@@ -137,7 +139,9 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
137
139
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
138
140
|
if (displayedProperty) {
|
|
139
141
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
140
|
-
|
|
142
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
143
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
144
|
+
const selectNameGroup = selectNameGroupMap.get(key);
|
|
141
145
|
formItem += `
|
|
142
146
|
<u-select clearable placeholder="请选择${label}"
|
|
143
147
|
text-field="${lowerEntityName}.${displayedProperty.name}"
|
|
@@ -427,7 +431,8 @@ export function genCurdMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
427
431
|
nameGroup.viewVariableIsUpdate = view.getVariableUniqueName('isUpdate');
|
|
428
432
|
|
|
429
433
|
// 收集所有和本实体关联的实体
|
|
430
|
-
const
|
|
434
|
+
const entitySet: Set<Entity> = new Set();
|
|
435
|
+
entitySet.add(entity);
|
|
431
436
|
const selectNameGroupMap: Map<string, NameGroup> = new Map();
|
|
432
437
|
const newStructures: any[] = [];
|
|
433
438
|
const newLogics: any[] = [];
|
|
@@ -439,11 +444,13 @@ export function genCurdMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
439
444
|
if (relationEntity) {
|
|
440
445
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
441
446
|
if (displayedProperty) {
|
|
442
|
-
|
|
447
|
+
entitySet.add(relationEntity);
|
|
443
448
|
const viewElementSelect = view.getViewElementUniqueName('select');
|
|
444
449
|
const selectNameGroup = genUniqueQueryNameGroup(module, view, viewElementSelect, false, relationEntity.name);
|
|
445
450
|
selectNameGroup.viewElementSelect = viewElementSelect;
|
|
446
|
-
|
|
451
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
452
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
453
|
+
selectNameGroupMap.set(key, selectNameGroup);
|
|
447
454
|
const newStructure = genQueryStructure([relationEntity], selectNameGroup);
|
|
448
455
|
const newLogic = genQueryLogic([relationEntity], selectNameGroup, false, false, module);
|
|
449
456
|
newStructures.push(newStructure);
|
|
@@ -453,7 +460,7 @@ export function genCurdMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
453
460
|
}
|
|
454
461
|
}
|
|
455
462
|
});
|
|
456
|
-
|
|
463
|
+
const allEntities = [...entitySet];
|
|
457
464
|
const entityStructure = genQueryStructure(allEntities, nameGroup);
|
|
458
465
|
newStructures.push(entityStructure);
|
|
459
466
|
const entityLogic = genQueryLogic(allEntities, nameGroup, true, true, module);
|
|
@@ -547,7 +554,8 @@ export function genGridViewMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
547
554
|
nameGroup.viewVariableIsUpdate = view.getVariableUniqueName('isUpdate');
|
|
548
555
|
|
|
549
556
|
// 收集所有和本实体关联的实体
|
|
550
|
-
const
|
|
557
|
+
const entitySet: Set<Entity> = new Set();
|
|
558
|
+
entitySet.add(entity);
|
|
551
559
|
const selectNameGroupMap: Map<string, NameGroup> = new Map();
|
|
552
560
|
const newStructures: any[] = [];
|
|
553
561
|
const newLogics: any[] = [];
|
|
@@ -559,11 +567,13 @@ export function genGridViewMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
559
567
|
if (relationEntity) {
|
|
560
568
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
561
569
|
if (displayedProperty) {
|
|
562
|
-
|
|
570
|
+
entitySet.add(relationEntity);
|
|
563
571
|
const viewElementSelect = view.getViewElementUniqueName('select');
|
|
564
572
|
const selectNameGroup = genUniqueQueryNameGroup(module, view, viewElementSelect, false, relationEntity.name);
|
|
565
573
|
selectNameGroup.viewElementSelect = viewElementSelect;
|
|
566
|
-
|
|
574
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
575
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
576
|
+
selectNameGroupMap.set(key, selectNameGroup);
|
|
567
577
|
const newStructure = genQueryStructure([
|
|
568
578
|
relationEntity,
|
|
569
579
|
], selectNameGroup);
|
|
@@ -577,6 +587,7 @@ export function genGridViewMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
577
587
|
}
|
|
578
588
|
}
|
|
579
589
|
});
|
|
590
|
+
const allEntities = [...entitySet];
|
|
580
591
|
const entityStructure = genQueryStructure(allEntities, nameGroup);
|
|
581
592
|
newStructures.push(entityStructure);
|
|
582
593
|
const entityLogic = genQueryLogic(allEntities, nameGroup, true, true, module);
|
|
@@ -51,7 +51,9 @@ export function genEditTableColumnTemplate(entity: Entity, property: EntityPrope
|
|
|
51
51
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
52
52
|
if (displayedProperty) {
|
|
53
53
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
54
|
-
|
|
54
|
+
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
55
|
+
const key = [property.name, relationEntity.name].join('-');
|
|
56
|
+
const selectNameGroup = selectNameGroupMap.get(key);
|
|
55
57
|
formItem += `
|
|
56
58
|
<u-select clearable placeholder="请选择${label}" :data-source="${selectNameGroup.viewLogicLoad}"
|
|
57
59
|
:autofocus="true" :opened="true" append-to="body" @blur="${nameGroup.viewLogicBlurUpdate}" @select="${nameGroup.viewLogicBlurUpdate}"
|
|
@@ -10,7 +10,7 @@ import { Enum } from '../concepts';
|
|
|
10
10
|
*/
|
|
11
11
|
export function genEnumSelectBlock(enumeration: Enum, vModel?: string, size?: string, placeholder?: string, hiddenAll?: boolean) {
|
|
12
12
|
if (config.scope === 'h5')
|
|
13
|
-
return `<van-cascader ${vModel ? ` v-model="${vModel}"` : ''}${placeholder ? ` title="${placeholder}" placeholder="${placeholder}"` : ''}
|
|
13
|
+
return `<van-cascader input-align="left" ${vModel ? ` v-model="${vModel}"` : ''}${placeholder ? ` title="${placeholder}" placeholder="${placeholder}"` : ''}
|
|
14
14
|
:data-source="$utils.EnumList('${enumeration.name}', '${enumeration.getNamespace()}')" labelField="${!hiddenAll ? (placeholder || '') : ''}" :notitleblock="${hiddenAll}"></van-cascader>`;
|
|
15
15
|
|
|
16
16
|
return `<u-select clearable${vModel ? ` v-model="${vModel}"` : ''}${size ? ` size="${size}"` : ''}${placeholder ? ` placeholder="${placeholder}"` : ''}
|
|
@@ -269,7 +269,8 @@ export function genGridViewBlock(entity: Entity, view: View) {
|
|
|
269
269
|
nameGroup.viewLogicRemove = view.getLogicUniqueName('remove');
|
|
270
270
|
|
|
271
271
|
// 收集所有和本实体关联的实体
|
|
272
|
-
const
|
|
272
|
+
const entitySet: Set<Entity> = new Set();
|
|
273
|
+
entitySet.add(entity);
|
|
273
274
|
const newStructures: any[] = [];
|
|
274
275
|
const newLogics: any[] = [];
|
|
275
276
|
entity.properties.forEach((property) => {
|
|
@@ -279,10 +280,11 @@ export function genGridViewBlock(entity: Entity, view: View) {
|
|
|
279
280
|
if (relationEntity) {
|
|
280
281
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
281
282
|
if (displayedProperty)
|
|
282
|
-
|
|
283
|
+
entitySet.add(relationEntity);
|
|
283
284
|
}
|
|
284
285
|
}
|
|
285
286
|
});
|
|
287
|
+
const allEntities = [...entitySet];
|
|
286
288
|
const entityStructure = genQueryStructure(allEntities, nameGroup);
|
|
287
289
|
newStructures.push(entityStructure);
|
|
288
290
|
const entityLogic = genQueryLogic(allEntities, nameGroup, false, true, module);
|
|
@@ -318,7 +320,8 @@ export function genGridViewCardBlock(property: EntityProperty, view: View) {
|
|
|
318
320
|
nameGroup.viewLogicRemove = view.getLogicUniqueName('remove');
|
|
319
321
|
|
|
320
322
|
// 收集所有和本实体关联的实体
|
|
321
|
-
const
|
|
323
|
+
const entitySet: Set<Entity> = new Set();
|
|
324
|
+
entitySet.add(entity);
|
|
322
325
|
const newStructures: any[] = [];
|
|
323
326
|
const newLogics: any[] = [];
|
|
324
327
|
entity.properties.forEach((property) => {
|
|
@@ -328,10 +331,11 @@ export function genGridViewCardBlock(property: EntityProperty, view: View) {
|
|
|
328
331
|
if (relationEntity) {
|
|
329
332
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
330
333
|
if (displayedProperty)
|
|
331
|
-
|
|
334
|
+
entitySet.add(relationEntity);
|
|
332
335
|
}
|
|
333
336
|
}
|
|
334
337
|
});
|
|
338
|
+
const allEntities = [...entitySet];
|
|
335
339
|
const entityStructure = genQueryStructure(allEntities, nameGroup);
|
|
336
340
|
newStructures.push(entityStructure);
|
|
337
341
|
const entityLogic = genQueryLogic(allEntities, nameGroup, true, true, module);
|
|
@@ -40,7 +40,6 @@ export function genH5ListViewTemplate(property: EntityProperty, nameGroup: NameG
|
|
|
40
40
|
|
|
41
41
|
export function genLoadListViewLogic(entity: Entity, nameGroup: NameGroup, newStructures: Array<any>, newLogics: Array<any>) {
|
|
42
42
|
const parentNode = entity.parentNode as App | Module | Namespace;
|
|
43
|
-
const parentNamespace = parentNode?.getNamespace();
|
|
44
43
|
|
|
45
44
|
const moduleNode = utils.findClosestModule(entity) as App | Module;
|
|
46
45
|
const moduleNamespace = moduleNode?.getNamespace();
|
|
@@ -78,7 +77,7 @@ export function genLoadListViewLogic(entity: Entity, nameGroup: NameGroup, newSt
|
|
|
78
77
|
name: 'result',
|
|
79
78
|
}),
|
|
80
79
|
right: NaslLogicItem.CallLogic({
|
|
81
|
-
calleeNamespace: `${
|
|
80
|
+
calleeNamespace: `${moduleNamespace}.logics`,
|
|
82
81
|
calleeName: entityLogic.name,
|
|
83
82
|
arguments: [
|
|
84
83
|
genLogicParam(`${entityLogic.params[0].name}`, 'params.page'),
|