@lcap/nasl 3.5.0-beta.4 → 3.6.0-alpha.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/bak/translator.js +39 -119
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.d.ts +0 -3
- package/out/breakpoint/generator/BreakpointNode.js +0 -9
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/shared/constants.js +0 -1
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/utils.js +7 -31
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +13 -1
- package/out/common/BaseNode.js +52 -23
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.js +1 -0
- package/out/common/Command.js.map +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/common/EventEmitter.js +0 -4
- package/out/common/EventEmitter.js.map +1 -1
- package/out/concepts/App__.d.ts +76 -51
- package/out/concepts/App__.js +190 -87
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +2 -10
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +6 -16
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +0 -1
- package/out/concepts/BindDirective__.js +4 -19
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +1 -3
- package/out/concepts/BindEvent__.js +13 -38
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.js +2 -10
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +0 -2
- package/out/concepts/CallLogic__.js +27 -38
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Constant__.js +6 -7
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +1 -1
- package/out/concepts/Destination__.js +4 -6
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +1 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +1 -1
- package/out/concepts/Entity__.js +2 -0
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Event__.d.ts +0 -14
- package/out/concepts/Event__.js +0 -61
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +88 -0
- package/out/concepts/Frontend__.js +143 -1
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +0 -5
- package/out/concepts/Identifier__.js +9 -19
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -3
- package/out/concepts/Logic__.js +13 -16
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +1 -1
- package/out/concepts/MemberExpression__.js +3 -3
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/Param__.js +3 -11
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +1 -9
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Return__.js +9 -17
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Variable__.js +8 -17
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +2 -17
- package/out/concepts/ViewElement__.js +31 -143
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +6 -6
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/index__.d.ts +0 -5
- package/out/concepts/index__.js +0 -5
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/utils/asserts.d.ts +3 -258
- package/out/concepts/utils/asserts.js +13 -351
- package/out/concepts/utils/asserts.js.map +1 -1
- package/out/concepts/utils/types.d.ts +3 -20
- package/out/generator/genBundleFiles.js +11 -25
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +3 -12
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/permission.js +3 -3
- package/out/generator/permission.js.map +1 -1
- package/out/natural/transformTSCode.js +1 -1
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/extendBaseNode.js +22 -6
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/getLogics.js +27 -62
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +1 -6
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.js +11 -28
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +1 -6
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +26 -2
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -6
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +16 -16
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.d.ts +27 -0
- package/out/templator/genCurdMultipleKeyBlock.js +709 -37
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +4 -4
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +12 -12
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +4 -4
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +3 -3
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +2 -0
- package/out/templator/genTableBlock.js +124 -11
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +8 -8
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +2 -2
- package/out/templator/utils.js.map +1 -1
- package/out/translator/utils.js +18 -0
- package/out/translator/utils.js.map +1 -1
- package/out/utils/i18nInfo.js +2 -7
- package/out/utils/i18nInfo.js.map +1 -1
- package/package.json +2 -2
- package/src/bak/translator.js +43 -121
- package/src/breakpoint/generator/BreakpointNode.ts +0 -12
- package/src/breakpoint/shared/constants.ts +0 -1
- package/src/breakpoint/shared/utils.ts +10 -37
- package/src/common/BaseNode.ts +60 -22
- package/src/common/Command.ts +1 -0
- package/src/common/EventEmitter.ts +1 -6
- package/src/concepts/App__.ts +251 -139
- package/src/concepts/BackendVariable__.ts +2 -10
- package/src/concepts/BindAttribute__.ts +6 -15
- package/src/concepts/BindDirective__.ts +4 -19
- package/src/concepts/BindEvent__.ts +12 -40
- package/src/concepts/CallFunction__.ts +2 -10
- package/src/concepts/CallLogic__.ts +32 -45
- package/src/concepts/Constant__.ts +7 -5
- package/src/concepts/Destination__.ts +4 -6
- package/src/concepts/End__.ts +0 -1
- package/src/concepts/Entity__.ts +3 -1
- package/src/concepts/Event__.ts +0 -70
- package/src/concepts/Frontend__.ts +251 -3
- package/src/concepts/Identifier__.ts +13 -29
- package/src/concepts/LogicItem__.ts +0 -1
- package/src/concepts/Logic__.ts +14 -21
- package/src/concepts/MemberExpression__.ts +3 -3
- package/src/concepts/NewComposite__.ts +6 -4
- package/src/concepts/Param__.ts +3 -11
- package/src/concepts/ProcessElement__.ts +1 -8
- package/src/concepts/Return__.ts +12 -15
- package/src/concepts/Variable__.ts +9 -17
- package/src/concepts/ViewElement__.ts +54 -166
- package/src/concepts/View__.ts +6 -8
- package/src/concepts/index__.ts +0 -5
- package/src/concepts/utils/asserts.ts +4 -367
- package/src/concepts/utils/types.ts +0 -28
- package/src/generator/genBundleFiles.ts +15 -33
- package/src/generator/genReleaseBody.ts +3 -14
- package/src/generator/permission.ts +6 -8
- package/src/natural/transformTSCode.ts +1 -1
- package/src/server/extendBaseNode.ts +41 -22
- package/src/server/getLogics.ts +41 -79
- package/src/server/getMemberIdentifier.ts +1 -7
- package/src/server/naslServer.ts +12 -30
- package/src/server/translator.ts +1 -7
- package/src/service/storage/init.ts +33 -2
- package/src/templator/genCreateBlock.ts +6 -6
- package/src/templator/genCurdEditMultipleKeyBlock.ts +16 -16
- package/src/templator/genCurdMultipleKeyBlock.ts +817 -93
- package/src/templator/genGetBlock.ts +4 -4
- package/src/templator/genGridViewBlock.ts +12 -12
- package/src/templator/genListViewBlock.ts +4 -4
- package/src/templator/genSelectBlock.ts +3 -3
- package/src/templator/genTableBlock.ts +137 -12
- package/src/templator/genUpdateBlock.ts +8 -8
- package/src/templator/utils.ts +2 -2
- package/src/translator/utils.ts +20 -0
- package/src/utils/i18nInfo.ts +2 -7
- package/test/concepts/call-function/fixtures/from-string.json +59 -68
- package/test/concepts/call-function/fixtures/to-string-global-tz.json +58 -67
- package/test/concepts/call-function/fixtures/to-string-no-tz.json +48 -57
- package/test/concepts/call-function/fixtures/to-string-user-tz.json +60 -69
- package/test/concepts/call-function/fixtures/to-string-utc-tz.json +60 -69
- package/test/concepts/call-interface/fixtures/only-interface.json +72 -81
- package/test/concepts/call-interface/fixtures/with-body-complex-argument.json +214 -223
- package/test/concepts/call-interface/fixtures/with-body-no-argument.json +76 -85
- package/test/concepts/call-interface/fixtures/with-body-simple-argument.json +91 -100
- package/test/concepts/call-interface/fixtures/with-headers-no-argument.json +79 -88
- package/test/concepts/call-interface/fixtures/with-headers.json +81 -90
- package/test/concepts/call-interface/fixtures/with-query-no-argument.json +79 -88
- package/test/concepts/call-interface/fixtures/with-query.json +81 -90
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +2 -4
- package/test/concepts/call-logic/fixtures/entries-get-with-arguments.json +95 -104
- package/test/concepts/call-logic/fixtures/entries-update-with-arguments.json +200 -209
- package/test/concepts/call-logic/fixtures/global-logic-argument-no-expression.json +88 -97
- package/test/concepts/call-logic/fixtures/global-logic-argument-some-expression.json +115 -124
- package/test/concepts/call-logic/fixtures/json-deserialize.json +111 -120
- package/test/concepts/call-logic/fixtures/json-serialize-with-string.json +115 -124
- package/test/concepts/call-logic/fixtures/json-serialize.json +115 -124
- package/test/concepts/call-logic/fixtures/view-buildin-logic-with-argument.json +82 -91
- package/test/concepts/call-logic/fixtures/view-component-logic-no-argument.json +79 -88
- package/test/concepts/call-logic/fixtures/view-component-with-validation.json +135 -144
- package/test/concepts/identifier/fixtures/view-variable.json +136 -145
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +1 -1
- package/test/concepts/view-element/fixtures/default-login.json +212 -221
- package/test/concepts/view-element/fixtures/default-not-found.json +174 -183
- package/test/concepts/view-element/fixtures/with-role-auth.json +82 -91
- package/test/concepts/view-element/fixtures/with-table.json +1834 -1843
- package/test/concepts/view-element/toVue.spec.ts +0 -1
- package/ts-worker/package.json +1 -1
- package/out/concepts/BusinessComponent__.d.ts +0 -641
- package/out/concepts/BusinessComponent__.js +0 -1901
- package/out/concepts/BusinessComponent__.js.map +0 -1
- package/out/concepts/BusinessLogic__.d.ts +0 -38
- package/out/concepts/BusinessLogic__.js +0 -358
- package/out/concepts/BusinessLogic__.js.map +0 -1
- package/out/concepts/CallEvent__.d.ts +0 -97
- package/out/concepts/CallEvent__.js +0 -263
- package/out/concepts/CallEvent__.js.map +0 -1
- package/out/concepts/FrontendType__.d.ts +0 -308
- package/out/concepts/FrontendType__.js +0 -605
- package/out/concepts/FrontendType__.js.map +0 -1
- package/out/concepts/ParamWithGroup__.d.ts +0 -39
- package/out/concepts/ParamWithGroup__.js +0 -85
- package/out/concepts/ParamWithGroup__.js.map +0 -1
- package/src/concepts/BusinessComponent__.ts +0 -2669
- package/src/concepts/BusinessLogic__.ts +0 -376
- package/src/concepts/CallEvent__.ts +0 -334
- package/src/concepts/FrontendType__.ts +0 -919
- package/src/concepts/ParamWithGroup__.ts +0 -101
package/src/server/naslServer.ts
CHANGED
|
@@ -88,7 +88,6 @@ import {
|
|
|
88
88
|
UnaryExpression,
|
|
89
89
|
types,
|
|
90
90
|
asserts,
|
|
91
|
-
BusinessComponent,
|
|
92
91
|
} from '../concepts';
|
|
93
92
|
|
|
94
93
|
import * as utils from '../utils';
|
|
@@ -430,7 +429,7 @@ class NaslServer {
|
|
|
430
429
|
const {
|
|
431
430
|
structures = [],
|
|
432
431
|
metadataTypes = [],
|
|
433
|
-
|
|
432
|
+
frontends = [],
|
|
434
433
|
interfaces = [],
|
|
435
434
|
enums = [],
|
|
436
435
|
logics = [],
|
|
@@ -450,10 +449,6 @@ class NaslServer {
|
|
|
450
449
|
namespaces = [],
|
|
451
450
|
} = module as Connector;
|
|
452
451
|
|
|
453
|
-
const {
|
|
454
|
-
frontends = []
|
|
455
|
-
} = module as Module;
|
|
456
|
-
|
|
457
452
|
yield* getTsFiles(structures, 'structure');
|
|
458
453
|
yield* getTsFiles(metadataTypes, 'metadataType');
|
|
459
454
|
|
|
@@ -461,25 +456,20 @@ class NaslServer {
|
|
|
461
456
|
yield* getTsFiles(overriddenLogics, 'overriddenLogic', OverriddenLogic);
|
|
462
457
|
yield* getTsFiles(backend?.variables ?? [], 'backend_variable');
|
|
463
458
|
|
|
464
|
-
for (const
|
|
465
|
-
yield* getTsFile(
|
|
466
|
-
|
|
467
|
-
|
|
459
|
+
for (const frontend of frontends) {
|
|
460
|
+
yield* getTsFile(frontend, 'frontend');
|
|
461
|
+
yield* getTsFiles(frontend.variables, 'frontend_variable');
|
|
462
|
+
yield* getTsFiles(concat(frontend.bindEvents, 'logics'), 'frontend_bindEvent_logic');
|
|
463
|
+
|
|
464
|
+
if (!config.closeViews) {
|
|
465
|
+
yield* view2TSFile(frontend.views);
|
|
468
466
|
}
|
|
469
|
-
for (const frontend of frontendType.frontends) {
|
|
470
|
-
yield* getTsFile(frontend, 'frontend');
|
|
471
|
-
yield* getTsFiles(frontend.variables, 'frontend_variable');
|
|
472
|
-
yield* getTsFiles(concat(frontend.bindEvents, 'logics'), 'frontend_bindEvent_logic');
|
|
473
467
|
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}
|
|
468
|
+
for (const dep of frontend.componentDependencies) {
|
|
469
|
+
results.push(...(yield* self.contentToFile(dep)));
|
|
477
470
|
}
|
|
478
|
-
// 业务组件
|
|
479
|
-
yield* getTsFiles(frontendType.businessComponents, 'businessComponents');
|
|
480
471
|
}
|
|
481
472
|
} else {
|
|
482
|
-
// 依赖库
|
|
483
473
|
yield* getTsFiles(concat(frontends, 'logics' as any), 'frontend_logic');
|
|
484
474
|
}
|
|
485
475
|
|
|
@@ -820,7 +810,7 @@ class NaslServer {
|
|
|
820
810
|
|
|
821
811
|
const types = /<([^()]+)>/g.exec(displayString);
|
|
822
812
|
const typeStr = types && types[1];
|
|
823
|
-
const app = node
|
|
813
|
+
const {app} = node;
|
|
824
814
|
if (typeStr.includes('__name: "AStructure_')) {
|
|
825
815
|
const properties: StructureProperty[] = [];
|
|
826
816
|
typeStr.replace(/([^:\s]+):\s+([^;]+);/g, ($1, name, typeKey) => {
|
|
@@ -2189,7 +2179,7 @@ class NaslServer {
|
|
|
2189
2179
|
const diagnostic = {
|
|
2190
2180
|
node: fileNode,
|
|
2191
2181
|
severity: 'error',
|
|
2192
|
-
message: `连接器 ${fileNode.name}
|
|
2182
|
+
message: `连接器 ${fileNode.name} 参数配置缺失`,
|
|
2193
2183
|
// 保留原来的内容方便查询一些问题
|
|
2194
2184
|
originalDiagnostic: {
|
|
2195
2185
|
fileName: '',
|
|
@@ -2470,7 +2460,6 @@ class NaslServer {
|
|
|
2470
2460
|
node.parentKey !== 'playground' &&
|
|
2471
2461
|
node.parentKey !== 'consequent' &&
|
|
2472
2462
|
node.parentNode?.parentNode?.concept !== 'CallInterface' &&
|
|
2473
|
-
node.parentNode.concept !== 'Block' &&
|
|
2474
2463
|
!node.__TypeAnnotation
|
|
2475
2464
|
) {
|
|
2476
2465
|
let showErr = false;
|
|
@@ -3559,9 +3548,6 @@ class NaslServer {
|
|
|
3559
3548
|
if (minRange.node !== node) {
|
|
3560
3549
|
return null;
|
|
3561
3550
|
}
|
|
3562
|
-
} else if (node instanceof BusinessComponent) {
|
|
3563
|
-
minRange.setTypeMethods = 'setTag';
|
|
3564
|
-
minRange.newValue = `bs-${newValue}`;
|
|
3565
3551
|
} else if (!(node instanceof Role)) {
|
|
3566
3552
|
/**
|
|
3567
3553
|
* 无论是逻辑还是实体中的key,修改都不应该触发
|
|
@@ -3577,9 +3563,6 @@ class NaslServer {
|
|
|
3577
3563
|
if (minRange.node !== node) {
|
|
3578
3564
|
return null;
|
|
3579
3565
|
}
|
|
3580
|
-
} else if (node instanceof BusinessComponent) {
|
|
3581
|
-
minRange.setTypeMethods = 'setTag';
|
|
3582
|
-
minRange.newValue = `bs-${newValue}`;
|
|
3583
3566
|
} else if (!(node instanceof Role)) {
|
|
3584
3567
|
/**
|
|
3585
3568
|
* 无论是逻辑还是实体中的key,修改都不应该触发
|
|
@@ -3863,7 +3846,6 @@ class NaslServer {
|
|
|
3863
3846
|
!(fileNode.parentNode instanceof Backend) &&
|
|
3864
3847
|
!isConnectorLogic &&
|
|
3865
3848
|
!(fileNode instanceof View) &&
|
|
3866
|
-
!(fileNode instanceof BusinessComponent) &&
|
|
3867
3849
|
!(fileNode instanceof ConfigProperty)
|
|
3868
3850
|
) {
|
|
3869
3851
|
fileNode = fileNode.parentNode as FileNode & types.SyntaxNode;
|
package/src/server/translator.ts
CHANGED
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
EntityProperty,
|
|
12
12
|
EntityIndex,
|
|
13
13
|
View,
|
|
14
|
-
BusinessComponent,
|
|
15
14
|
Destination,
|
|
16
15
|
Enum,
|
|
17
16
|
BindEvent,
|
|
@@ -173,11 +172,6 @@ const TS_RULES: Array<{
|
|
|
173
172
|
result: '找不到配置参数$2',
|
|
174
173
|
transforms: [transformType, transformType],
|
|
175
174
|
},
|
|
176
|
-
{
|
|
177
|
-
re: /Property '(.+?)' is private and only accessible within class '(.+?)'./,
|
|
178
|
-
result: '“$1”是私有的,只能在“$2”中访问。',
|
|
179
|
-
transforms: [transformType, transformType],
|
|
180
|
-
},
|
|
181
175
|
{
|
|
182
176
|
re: /Object literal may only specify known properties, and '(.+?)' does not exist in type/,
|
|
183
177
|
result: '当前参数$1,不可用。',
|
|
@@ -479,7 +473,7 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
479
473
|
// const isFELogic = ['BindEvent', 'View'].includes(parentNode.concept);
|
|
480
474
|
|
|
481
475
|
// 有一些节点报错信息不向外暴露,缺失一些原生标签等等的展示
|
|
482
|
-
if (node instanceof View || node instanceof
|
|
476
|
+
if (node instanceof View || node instanceof ViewElement) {
|
|
483
477
|
if (text.startsWith(`'nasl.ui' has no exported member named `)) {
|
|
484
478
|
return null;
|
|
485
479
|
} else if (text.startsWith(`Property '`) && text.includes(`does not exist on type 'typeof ui'.`)) {
|
|
@@ -88,6 +88,7 @@ async function deleteExpiredRecords() {
|
|
|
88
88
|
expiredRecordsRequest.onsuccess = (event: any) => {
|
|
89
89
|
const cursor = event.target.result;
|
|
90
90
|
if (cursor) {
|
|
91
|
+
console.log(cursor);
|
|
91
92
|
objectStore.delete(cursor.primaryKey);
|
|
92
93
|
cursor.continue();
|
|
93
94
|
} else {
|
|
@@ -385,6 +386,29 @@ const handleAIPoint = (app: any, actionItem: any) => {
|
|
|
385
386
|
}
|
|
386
387
|
}
|
|
387
388
|
|
|
389
|
+
const isBreakpointEvent = (event: any) => {
|
|
390
|
+
const originEvent = event?.originEvent;
|
|
391
|
+
const object = originEvent?.object || {};
|
|
392
|
+
const oldObject = originEvent?.oldObject || {};
|
|
393
|
+
|
|
394
|
+
if (typeof object !== 'object') {
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if (typeof oldObject !== 'object') {
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
const source = { ...object, ...oldObject };
|
|
403
|
+
const keys = Object.keys(source);
|
|
404
|
+
|
|
405
|
+
if (keys.length !== 1) {
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return keys[0] === 'breakpoint';
|
|
410
|
+
};
|
|
411
|
+
|
|
388
412
|
/**
|
|
389
413
|
* 执行更新
|
|
390
414
|
*/
|
|
@@ -457,8 +481,11 @@ async function doAction(app: any, actionItem: any) {
|
|
|
457
481
|
const emitTarget = event?.originEvent?.target as types.SyntaxNode;
|
|
458
482
|
const _path: string = event.originEvent.path;
|
|
459
483
|
const _root = _path.split('.')?.[1] || '';
|
|
484
|
+
const breakabled = isBreakpointEvent(event);
|
|
460
485
|
if (['backend', 'overriddenLogics', 'dataSources', 'processes', 'roles', 'logics', 'enums', 'structures', 'interfaces', 'interfaceDependencies', 'configuration', 'dependencies', 'authLogics', 'authLogicsForCallInterface', 'triggerLaunchers', 'connections'].some((item) => _root.startsWith(item))) {
|
|
461
|
-
|
|
486
|
+
if (!breakabled) {
|
|
487
|
+
hasBackEnd = true;
|
|
488
|
+
}
|
|
462
489
|
}
|
|
463
490
|
if (emitTarget) {
|
|
464
491
|
if (emitTarget.concept === 'App') {
|
|
@@ -626,6 +653,7 @@ async function doAction(app: any, actionItem: any) {
|
|
|
626
653
|
const uuid = uuidv4().replace(/-/g, '');
|
|
627
654
|
const instructList = [{
|
|
628
655
|
uuid,
|
|
656
|
+
realAction: action,
|
|
629
657
|
actions: actionList,
|
|
630
658
|
riskList: allRiskList
|
|
631
659
|
}];
|
|
@@ -1015,6 +1043,9 @@ export function handleApp(app: ProxyApp) {
|
|
|
1015
1043
|
});
|
|
1016
1044
|
}, 2500);
|
|
1017
1045
|
}
|
|
1046
|
+
|
|
1047
|
+
if (event?.action === 'move') proxyApp._action = event.action;
|
|
1048
|
+
|
|
1018
1049
|
if (!proxyApp._isCollectingCount) {
|
|
1019
1050
|
proxyApp._actionMsg = event?.actionMsg;
|
|
1020
1051
|
proxyApp._action = event?.action;
|
|
@@ -1182,7 +1213,7 @@ export async function loadApp(appId?: string) {
|
|
|
1182
1213
|
roles: [],
|
|
1183
1214
|
dependencies: [],
|
|
1184
1215
|
interfaceDependencies: [],
|
|
1185
|
-
|
|
1216
|
+
frontends: [],
|
|
1186
1217
|
metadataTypes: []
|
|
1187
1218
|
});
|
|
1188
1219
|
} else {
|
|
@@ -287,16 +287,16 @@ function genSubmitLogic(createLogic: Logic, nameGroup: NameGroup) {
|
|
|
287
287
|
* @param resolver 实体创建 Action
|
|
288
288
|
*/
|
|
289
289
|
export function genCreateBlock(entity: Entity, oldNode: ViewElement) {
|
|
290
|
-
const
|
|
290
|
+
const { view } = oldNode;
|
|
291
291
|
const dataSource = entity.parentNode as DataSource;
|
|
292
292
|
const module = dataSource.app;
|
|
293
293
|
const { ns } = entity;
|
|
294
294
|
const createLogic = ns?.logics?.find((logic) => logic.name === `create`);
|
|
295
295
|
|
|
296
296
|
const nameGroup: NameGroup = {};
|
|
297
|
-
nameGroup.viewElementMainView =
|
|
298
|
-
nameGroup.viewVariableEntity =
|
|
299
|
-
nameGroup.viewLogicSubmit =
|
|
297
|
+
nameGroup.viewElementMainView = view.getViewElementUniqueName('form1');
|
|
298
|
+
nameGroup.viewVariableEntity = view.getVariableUniqueName(utils.firstLowerCase(entity.name));
|
|
299
|
+
nameGroup.viewLogicSubmit = view.getLogicUniqueName('submit');
|
|
300
300
|
|
|
301
301
|
// 收集所有和本实体关联的实体
|
|
302
302
|
const selectNameGroupMap: Map<string, NameGroup> = new Map();
|
|
@@ -309,8 +309,8 @@ export function genCreateBlock(entity: Entity, oldNode: ViewElement) {
|
|
|
309
309
|
if (relationEntity) {
|
|
310
310
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
311
311
|
if (displayedProperty) {
|
|
312
|
-
const viewElementSelect =
|
|
313
|
-
const selectNameGroup = genUniqueQueryNameGroup(module,
|
|
312
|
+
const viewElementSelect = view.getViewElementUniqueName('select');
|
|
313
|
+
const selectNameGroup = genUniqueQueryNameGroup(module, view, viewElementSelect, false, relationEntity.name);
|
|
314
314
|
selectNameGroup.viewElementSelect = viewElementSelect;
|
|
315
315
|
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
316
316
|
const key = [property.name, relationEntity.name].join('-');
|
|
@@ -275,24 +275,24 @@ function genCreateLogic(nameGroup: NameGroup) {
|
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
export function genCurdEditMultipleKeyBlock(entity: Entity, oldNode: ViewElement) {
|
|
278
|
-
const
|
|
278
|
+
const { view } = oldNode;
|
|
279
279
|
const dataSource = entity.parentNode as DataSource;
|
|
280
280
|
const module = dataSource.app;
|
|
281
281
|
|
|
282
|
-
const viewElementMainView =
|
|
283
|
-
const nameGroup = genUniqueQueryNameGroup(module,
|
|
282
|
+
const viewElementMainView = view.getViewElementUniqueName('tableView');
|
|
283
|
+
const nameGroup = genUniqueQueryNameGroup(module, view, viewElementMainView);
|
|
284
284
|
nameGroup.viewElementMainView = viewElementMainView;
|
|
285
|
-
nameGroup.viewElementSaveModal =
|
|
286
|
-
nameGroup.viewElementSaveModalForm =
|
|
287
|
-
nameGroup.viewLogicRemove =
|
|
288
|
-
nameGroup.viewLogicInit =
|
|
289
|
-
nameGroup.viewLogicCreate =
|
|
290
|
-
nameGroup.viewLogicSubmit =
|
|
291
|
-
nameGroup.viewLogicBlurUpdate =
|
|
292
|
-
nameGroup.viewLogicReload =
|
|
293
|
-
nameGroup.viewVariableEntity =
|
|
294
|
-
nameGroup.viewVariableInput =
|
|
295
|
-
nameGroup.viewVariableFilter =
|
|
285
|
+
nameGroup.viewElementSaveModal = view.getViewElementUniqueName('saveModal');
|
|
286
|
+
nameGroup.viewElementSaveModalForm = view.getViewElementUniqueName('saveModalForm');
|
|
287
|
+
nameGroup.viewLogicRemove = view.getLogicUniqueName('remove');
|
|
288
|
+
nameGroup.viewLogicInit = view.getLogicUniqueName('init');
|
|
289
|
+
nameGroup.viewLogicCreate = view.getLogicUniqueName('create');
|
|
290
|
+
nameGroup.viewLogicSubmit = view.getLogicUniqueName('submit');
|
|
291
|
+
nameGroup.viewLogicBlurUpdate = view.getLogicUniqueName('blurUpdate');
|
|
292
|
+
nameGroup.viewLogicReload = view.getLogicUniqueName('reload');
|
|
293
|
+
nameGroup.viewVariableEntity = view.getVariableUniqueName(utils.firstLowerCase(entity.name));
|
|
294
|
+
nameGroup.viewVariableInput = view.getVariableUniqueName('input');
|
|
295
|
+
nameGroup.viewVariableFilter = view.getVariableUniqueName('filter');
|
|
296
296
|
|
|
297
297
|
// 收集所有和本实体关联的实体
|
|
298
298
|
const entitySet: Set<Entity> = new Set();
|
|
@@ -308,8 +308,8 @@ export function genCurdEditMultipleKeyBlock(entity: Entity, oldNode: ViewElement
|
|
|
308
308
|
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
309
309
|
if (displayedProperty) {
|
|
310
310
|
entitySet.add(relationEntity);
|
|
311
|
-
const viewElementSelect =
|
|
312
|
-
const selectNameGroup = genUniqueQueryNameGroup(module,
|
|
311
|
+
const viewElementSelect = view.getViewElementUniqueName('select');
|
|
312
|
+
const selectNameGroup = genUniqueQueryNameGroup(module, view, viewElementSelect, false, relationEntity.name);
|
|
313
313
|
selectNameGroup.viewElementSelect = viewElementSelect;
|
|
314
314
|
// 存在多个属性关联同一个实体的情况,因此加上属性名用以唯一标识
|
|
315
315
|
const key = [property.name, relationEntity.name].join('-');
|