@lcap/nasl 0.3.10-beta → 0.3.10-beta.10
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/service/app/api.d.ts +1 -15
- package/out/service/app/api.js +7 -17
- package/out/service/app/api.js.map +1 -1
- package/out/service/create/errHandles.js +12 -0
- package/out/service/create/errHandles.js.map +1 -1
- package/out/service/create/index.js +3 -0
- package/out/service/create/index.js.map +1 -1
- package/out/service/logic/logic.d.ts +26 -17
- package/out/service/logic/logic.js +6 -0
- package/out/service/logic/logic.js.map +1 -1
- package/out/types/app/App.d.ts +5 -4
- package/out/types/app/App.js +31 -25
- package/out/types/app/App.js.map +1 -1
- package/out/types/app/History.js +3 -2
- package/out/types/app/History.js.map +1 -1
- package/out/types/app/Service.d.ts +3 -0
- package/out/types/app/Service.js +10 -2
- package/out/types/app/Service.js.map +1 -1
- package/out/types/cacheData.js.map +1 -1
- package/out/types/data/Entity.d.ts +4 -0
- package/out/types/data/Entity.js +8 -0
- package/out/types/data/Entity.js.map +1 -1
- package/out/types/data/EntityProperty.d.ts +5 -0
- package/out/types/data/EntityProperty.js +16 -0
- package/out/types/data/EntityProperty.js.map +1 -1
- package/out/types/data/dataTypes.js +1 -1
- package/out/types/data/dataTypes.js.map +1 -1
- package/out/types/data/genBlock/genCurdEditTableBlock.d.ts +3 -0
- package/out/types/data/genBlock/genCurdEditTableBlock.js +578 -0
- package/out/types/data/genBlock/genCurdEditTableBlock.js.map +1 -0
- package/out/types/data/genBlock/genEditTableBlock.d.ts +234 -0
- package/out/types/data/genBlock/genEditTableBlock.js +419 -0
- package/out/types/data/genBlock/genEditTableBlock.js.map +1 -0
- package/out/types/data/genBlock/genQueryComponent.d.ts +20 -0
- package/out/types/data/genBlock/genQueryComponent.js +57 -1
- package/out/types/data/genBlock/genQueryComponent.js.map +1 -1
- package/out/types/data/genBlock/genTableBlock.js +9 -5
- package/out/types/data/genBlock/genTableBlock.js.map +1 -1
- package/out/types/data/genBlock/index.d.ts +2 -0
- package/out/types/data/genBlock/index.js +2 -0
- package/out/types/data/genBlock/index.js.map +1 -1
- package/out/types/data/genBlock/utils.d.ts +7 -0
- package/out/types/data/genBlock/utils.js +38 -1
- package/out/types/data/genBlock/utils.js.map +1 -1
- package/out/types/index.d.ts +2 -4
- package/out/types/index.js +3 -6
- package/out/types/index.js.map +1 -1
- package/out/types/logic/Logic.d.ts +4 -12
- package/out/types/logic/Logic.js +35 -24
- package/out/types/logic/Logic.js.map +1 -1
- package/out/types/logic/LogicItem.d.ts +1 -20
- package/out/types/logic/LogicItem.js +5 -191
- package/out/types/logic/LogicItem.js.map +1 -1
- package/out/types/logic/Param.js +5 -13
- package/out/types/logic/Param.js.map +1 -1
- package/out/types/logic/Return.js +3 -11
- package/out/types/logic/Return.js.map +1 -1
- package/out/types/logic/Variable.js +3 -6
- package/out/types/logic/Variable.js.map +1 -1
- package/out/types/logic/translator.js +39 -8
- package/out/types/logic/translator.js.map +1 -1
- package/out/types/page/Element.d.ts +21 -2
- package/out/types/page/Element.js +89 -7
- package/out/types/page/Element.js.map +1 -1
- package/out/types/page/Page.d.ts +4 -0
- package/out/types/page/Page.js +7 -0
- package/out/types/page/Page.js.map +1 -1
- package/out/types/page/View.d.ts +19 -16
- package/out/types/page/View.js +73 -15
- package/out/types/page/View.js.map +1 -1
- package/out/types/page/ViewVariable.js +0 -6
- package/out/types/page/ViewVariable.js.map +1 -1
- package/out/types/process/ProcessParam.js +3 -1
- package/out/types/process/ProcessParam.js.map +1 -1
- package/out/types/utils/index.d.ts +1 -0
- package/out/types/utils/index.js +16 -7
- package/out/types/utils/index.js.map +1 -1
- package/package.json +1 -2
- package/src/service/app/api.js +8 -17
- package/src/service/create/errHandles.js +12 -0
- package/src/service/create/index.js +4 -0
- package/src/service/logic/logic.js +6 -0
- package/src/types/app/App.ts +37 -28
- package/src/types/app/History.ts +3 -2
- package/src/types/app/Service.ts +14 -5
- package/src/types/cacheData.ts +7 -7
- package/src/types/data/Entity.ts +7 -0
- package/src/types/data/EntityProperty.ts +12 -0
- package/src/types/data/dataTypes.ts +1 -1
- package/src/types/data/genBlock/genCurdEditTableBlock.ts +581 -0
- package/src/types/data/genBlock/genEditTableBlock.ts +470 -0
- package/src/types/data/genBlock/genQueryComponent.ts +56 -0
- package/src/types/data/genBlock/genTableBlock.ts +14 -10
- package/src/types/data/genBlock/index.ts +2 -0
- package/src/types/data/genBlock/utils.ts +38 -0
- package/src/types/index.ts +2 -4
- package/src/types/logic/Logic.ts +45 -41
- package/src/types/logic/LogicItem.ts +12 -217
- package/src/types/logic/Param.ts +25 -35
- package/src/types/logic/Return.ts +18 -26
- package/src/types/logic/Variable.ts +18 -20
- package/src/types/logic/translator.js +125 -154
- package/src/types/page/Element.ts +160 -73
- package/src/types/page/Page.ts +7 -0
- package/src/types/page/View.ts +112 -61
- package/src/types/page/ViewVariable.ts +13 -19
- package/src/types/page/dist/View.js +727 -0
- package/src/types/process/ProcessParam.ts +4 -1
- package/src/types/utils/index.ts +16 -7
- package/tsconfig.json +1 -1
- package/out/service/debugger/debugger.d.ts +0 -3
- package/out/service/debugger/debugger.js +0 -95
- package/out/service/debugger/debugger.js.map +0 -1
- package/out/test/units/config.spec.d.ts +0 -1
- package/out/test/units/config.spec.js +0 -12
- package/out/test/units/config.spec.js.map +0 -1
- package/out/types/logic/BreakPoint.d.ts +0 -42
- package/out/types/logic/BreakPoint.js +0 -155
- package/out/types/logic/BreakPoint.js.map +0 -1
- package/out/types/logic/Debugger.d.ts +0 -156
- package/out/types/logic/Debugger.js +0 -912
- package/out/types/logic/Debugger.js.map +0 -1
- package/src/service/debugger/debugger.js +0 -90
- package/src/types/logic/BreakPoint.ts +0 -200
- package/src/types/logic/Debugger.ts +0 -1140
- package/src/types/logic/translator.d.ts +0 -16
package/src/types/logic/Param.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { immutable,
|
|
2
|
-
import { config,
|
|
1
|
+
import { immutable, action } from '../decorators';
|
|
2
|
+
import { config, utils, LEVEL_ENUM, Vertex, Logic, Schema, BaseVariable, ActionOptions, Interface } from '..';
|
|
3
3
|
import { paramService } from '../../service/logic';
|
|
4
|
-
import { convert2RefType
|
|
4
|
+
import { convert2RefType } from '../data/dataTypeUtils';
|
|
5
5
|
import { getBasicTypeDefaultValue } from '../data/basicTypes';
|
|
6
6
|
import { schemaService } from '../../service/common';
|
|
7
7
|
import { refreshLogic, refreshInterfaces, refreshView } from '../cache';
|
|
@@ -11,21 +11,19 @@ export function catchFn(logic: Logic) {
|
|
|
11
11
|
return async (err: any) => {
|
|
12
12
|
const code = err?.code;
|
|
13
13
|
// 节点已存在; 节点不存在
|
|
14
|
-
if([BusinessCode.ElementExist, BusinessCode.ElementNotExist].includes(code)) {
|
|
14
|
+
if ([BusinessCode.ElementExist, BusinessCode.ElementNotExist].includes(code)) {
|
|
15
15
|
await refreshLogic(logic);
|
|
16
|
-
} else if(code === BusinessCode.ParentElementNotExist) {
|
|
17
|
-
if(logic.interface) {
|
|
16
|
+
} else if (code === BusinessCode.ParentElementNotExist) { // 父节点不存在,即逻辑不存在
|
|
17
|
+
if (logic.interface) {
|
|
18
18
|
await refreshInterfaces();
|
|
19
|
-
} else if(logic.view) {
|
|
19
|
+
} else if (logic.view) {
|
|
20
20
|
await refreshView(logic.view);
|
|
21
21
|
}
|
|
22
22
|
} else
|
|
23
23
|
config.defaultApp?.emit('saved', err);
|
|
24
|
-
|
|
25
24
|
config.defaultApp?.history.load();
|
|
26
|
-
|
|
27
25
|
throw err;
|
|
28
|
-
}
|
|
26
|
+
};
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
/**
|
|
@@ -73,23 +71,21 @@ export class Param extends BaseVariable {
|
|
|
73
71
|
config.defaultApp?.emit('saving');
|
|
74
72
|
|
|
75
73
|
const body = this.toJSON();
|
|
76
|
-
// convert2SchemaType(body.schema);
|
|
77
74
|
body._posIndex = this.logic.params.indexOf(this);
|
|
78
75
|
utils.logger.debug('添加逻辑输入参数', body);
|
|
79
76
|
const result: Param = await paramService.create({
|
|
80
77
|
headers: {
|
|
78
|
+
moduleType: this.logic && this.logic.moduleType,
|
|
81
79
|
appId: config.defaultApp?.id,
|
|
82
80
|
operationAction: actionOptions?.actionName || 'Param.create',
|
|
83
81
|
operationDesc: actionOptions?.actionDesc || `添加逻辑"${this.logic.name}"输入参数"${this.name}"`,
|
|
84
82
|
},
|
|
85
83
|
body,
|
|
86
84
|
}).catch(catchFn(this.logic));
|
|
87
|
-
// convert2RefType(result.schema);
|
|
88
85
|
this.deepPick(result, ['id']);
|
|
89
86
|
this.assign({ code: this.genCode() });
|
|
90
87
|
if (this.logic.interface) {
|
|
91
88
|
const interfaceItem = Vertex.getVertexByRef(this.logic.interface.id) as Interface;
|
|
92
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
93
89
|
interfaceItem.setParamAndReturn();
|
|
94
90
|
} else if (this.logic.view) {
|
|
95
91
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -98,6 +94,9 @@ export class Param extends BaseVariable {
|
|
|
98
94
|
|
|
99
95
|
await config.defaultApp?.history.load();
|
|
100
96
|
config.defaultApp?.emit('saved');
|
|
97
|
+
|
|
98
|
+
// 更新所有调用此Logic的LogicItem
|
|
99
|
+
await this.logic.callLogicUpdate();
|
|
101
100
|
return this;
|
|
102
101
|
}
|
|
103
102
|
/**
|
|
@@ -108,24 +107,24 @@ export class Param extends BaseVariable {
|
|
|
108
107
|
config.defaultApp?.emit('saving');
|
|
109
108
|
|
|
110
109
|
if (this.id) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
110
|
+
await paramService.delete({
|
|
111
|
+
headers: {
|
|
112
|
+
moduleType: this.logic && this.logic.moduleType,
|
|
113
|
+
appId: config.defaultApp?.id,
|
|
114
|
+
operationAction: actionOptions?.actionName || 'Param.create',
|
|
115
|
+
operationDesc: actionOptions?.actionDesc || `删除逻辑"${this.logic.name}"输入参数"${this.name}"`,
|
|
116
|
+
},
|
|
117
|
+
query: {
|
|
118
|
+
loValId: this.id,
|
|
119
|
+
logicId: this.logic.id,
|
|
120
|
+
},
|
|
121
|
+
}).catch(catchFn(this.logic));
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
const index = this.logic.params.indexOf(this);
|
|
125
125
|
~index && this.logic.params.splice(index, 1);
|
|
126
126
|
this.destroy();
|
|
127
127
|
if (this.logic.interface) {
|
|
128
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
129
128
|
this.logic.interface.setParamAndReturn();
|
|
130
129
|
} else if (this.logic.view) {
|
|
131
130
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -142,10 +141,10 @@ export class Param extends BaseVariable {
|
|
|
142
141
|
config.defaultApp?.emit('saving');
|
|
143
142
|
|
|
144
143
|
const body = this.toJSON();
|
|
145
|
-
// convert2SchemaType(body.schema);
|
|
146
144
|
utils.logger.debug('修改逻辑输入参数', body);
|
|
147
145
|
const result = await paramService.update({
|
|
148
146
|
headers: {
|
|
147
|
+
moduleType: this.logic && this.logic.moduleType,
|
|
149
148
|
appId: config.defaultApp?.id,
|
|
150
149
|
operationAction: actionOptions?.actionName || 'Param.update',
|
|
151
150
|
operationDesc: actionOptions?.actionDesc || `修改逻辑输入参数"${this.name}"`,
|
|
@@ -153,9 +152,6 @@ export class Param extends BaseVariable {
|
|
|
153
152
|
body,
|
|
154
153
|
}).catch(catchFn(this.logic));
|
|
155
154
|
this.schema.id = result.schema.id;
|
|
156
|
-
// convert2RefType(result.schema);
|
|
157
|
-
// this.plainAssign(result);
|
|
158
|
-
|
|
159
155
|
await then?.();
|
|
160
156
|
await config.defaultApp?.history.load();
|
|
161
157
|
config.defaultApp?.emit('saved');
|
|
@@ -174,7 +170,6 @@ export class Param extends BaseVariable {
|
|
|
174
170
|
});
|
|
175
171
|
|
|
176
172
|
if (this.logic.interface) {
|
|
177
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
178
173
|
this.logic.interface.setParamAndReturn();
|
|
179
174
|
} else if (this.logic.view) {
|
|
180
175
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -231,7 +226,6 @@ export class Param extends BaseVariable {
|
|
|
231
226
|
typeInstantiation: undefined,
|
|
232
227
|
});
|
|
233
228
|
Object.assign(this.schema, schema);
|
|
234
|
-
// if (this.defaultValue)
|
|
235
229
|
this.assign({ defaultValue: getBasicTypeDefaultValue() });
|
|
236
230
|
|
|
237
231
|
try {
|
|
@@ -241,7 +235,6 @@ export class Param extends BaseVariable {
|
|
|
241
235
|
this.genSchemaChildren();
|
|
242
236
|
|
|
243
237
|
if (this.logic.interface) {
|
|
244
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
245
238
|
this.logic.interface.setParamAndReturn();
|
|
246
239
|
} else if (this.logic.view) {
|
|
247
240
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -268,7 +261,6 @@ export class Param extends BaseVariable {
|
|
|
268
261
|
this.genSchemaChildren();
|
|
269
262
|
|
|
270
263
|
if (this.logic.interface) {
|
|
271
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
272
264
|
this.logic.interface.setParamAndReturn();
|
|
273
265
|
} else if (this.logic.view) {
|
|
274
266
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -304,7 +296,6 @@ export class Param extends BaseVariable {
|
|
|
304
296
|
});
|
|
305
297
|
|
|
306
298
|
if (this.logic.interface) {
|
|
307
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
308
299
|
this.logic.interface.setParamAndReturn();
|
|
309
300
|
} else if (this.logic.view) {
|
|
310
301
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -323,7 +314,6 @@ export class Param extends BaseVariable {
|
|
|
323
314
|
});
|
|
324
315
|
|
|
325
316
|
if (this.logic.interface) {
|
|
326
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
327
317
|
this.logic.interface.setParamAndReturn();
|
|
328
318
|
} else if (this.logic.view) {
|
|
329
319
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { immutable,
|
|
2
|
-
import { config,
|
|
1
|
+
import { immutable, action } from '../decorators';
|
|
2
|
+
import { config, utils, ActionOptions, LEVEL_ENUM, Logic, Schema, BaseVariable, genRefSchemaChildren } from '..';
|
|
3
3
|
import { paramService } from '../../service/logic';
|
|
4
|
-
import { convert2RefType
|
|
4
|
+
import { convert2RefType } from '../data/dataTypeUtils';
|
|
5
5
|
import { getBasicTypeDefaultValue } from '../data/basicTypes';
|
|
6
6
|
import { schemaService } from '../../service/common';
|
|
7
7
|
import { catchFn } from './Param';
|
|
@@ -40,23 +40,21 @@ export class Return extends BaseVariable {
|
|
|
40
40
|
config.defaultApp?.emit('saving');
|
|
41
41
|
|
|
42
42
|
const body = this.toJSON();
|
|
43
|
-
// convert2SchemaType(body.schema);
|
|
44
43
|
body._posIndex = this.logic.returns.indexOf(this);
|
|
45
44
|
utils.logger.debug('添加逻辑输出参数', body);
|
|
46
45
|
const result: Return = await paramService.create({
|
|
47
46
|
headers: {
|
|
47
|
+
moduleType: this.logic && this.logic.moduleType,
|
|
48
48
|
appId: config.defaultApp?.id,
|
|
49
49
|
operationAction: actionOptions?.actionName || 'Return.create',
|
|
50
50
|
operationDesc: actionOptions?.actionDesc || `添加逻辑"${this.logic.name}"输出参数"${this.name}"`,
|
|
51
51
|
},
|
|
52
52
|
body,
|
|
53
53
|
}).catch(catchFn(this.logic));
|
|
54
|
-
// convert2RefType(result.schema);
|
|
55
54
|
this.deepPick(result, ['id']);
|
|
56
55
|
this.assign({ code: this.genCode() });
|
|
57
56
|
|
|
58
57
|
if (this.logic.interface) {
|
|
59
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
60
58
|
this.logic.interface.setParamAndReturn();
|
|
61
59
|
} else if (this.logic.view) {
|
|
62
60
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -75,24 +73,24 @@ export class Return extends BaseVariable {
|
|
|
75
73
|
config.defaultApp?.emit('saving');
|
|
76
74
|
|
|
77
75
|
if (this.id) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
76
|
+
await paramService.delete({
|
|
77
|
+
headers: {
|
|
78
|
+
moduleType: this.logic && this.logic.moduleType,
|
|
79
|
+
appId: config.defaultApp?.id,
|
|
80
|
+
operationAction: actionOptions?.actionName || 'Return.create',
|
|
81
|
+
operationDesc: `删除逻辑"${this.logic.name}"输出参数"${this.name}"`,
|
|
82
|
+
},
|
|
83
|
+
query: {
|
|
84
|
+
loValId: this.id,
|
|
85
|
+
logicId: this.logic.id,
|
|
86
|
+
},
|
|
87
|
+
}).catch(catchFn(this.logic));
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
const index = this.logic.returns.indexOf(this);
|
|
92
91
|
~index && this.logic.returns.splice(index, 1);
|
|
93
92
|
|
|
94
93
|
if (this.logic.interface) {
|
|
95
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
96
94
|
this.logic.interface.setParamAndReturn();
|
|
97
95
|
} else if (this.logic.view) {
|
|
98
96
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -109,10 +107,10 @@ export class Return extends BaseVariable {
|
|
|
109
107
|
config.defaultApp?.emit('saving');
|
|
110
108
|
|
|
111
109
|
const body = this.toJSON();
|
|
112
|
-
// convert2SchemaType(body.schema);
|
|
113
110
|
utils.logger.debug('修改逻辑输出参数', body);
|
|
114
111
|
const result = await paramService.update({
|
|
115
112
|
headers: {
|
|
113
|
+
moduleType: this.logic && this.logic.moduleType,
|
|
116
114
|
appId: config.defaultApp?.id,
|
|
117
115
|
operationAction: actionOptions?.actionName || 'Return.update',
|
|
118
116
|
operationDesc: actionOptions?.actionDesc || `修改逻辑输出参数"${this.name}"`,
|
|
@@ -120,8 +118,6 @@ export class Return extends BaseVariable {
|
|
|
120
118
|
body,
|
|
121
119
|
}).catch(catchFn(this.logic));
|
|
122
120
|
this.schema.id = result.schema.id;
|
|
123
|
-
// convert2RefType(result.schema);
|
|
124
|
-
// this.plainAssign(result);
|
|
125
121
|
|
|
126
122
|
await then?.();
|
|
127
123
|
await config.defaultApp?.history.load();
|
|
@@ -141,7 +137,6 @@ export class Return extends BaseVariable {
|
|
|
141
137
|
});
|
|
142
138
|
|
|
143
139
|
if (this.logic.interface) {
|
|
144
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
145
140
|
this.logic.interface.setParamAndReturn();
|
|
146
141
|
} else if (this.logic.view) {
|
|
147
142
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -192,13 +187,12 @@ export class Return extends BaseVariable {
|
|
|
192
187
|
defaultValue: this.defaultValue,
|
|
193
188
|
};
|
|
194
189
|
Object.assign(this.schema, {
|
|
195
|
-
$ref: undefined,
|
|
190
|
+
$ref: undefined, // 引用到Entity或者structure
|
|
196
191
|
type: undefined,
|
|
197
192
|
format: undefined,
|
|
198
193
|
typeInstantiation: undefined,
|
|
199
194
|
});
|
|
200
195
|
Object.assign(this.schema, schema);
|
|
201
|
-
// if (this.defaultValue)
|
|
202
196
|
this.assign({ defaultValue: getBasicTypeDefaultValue() });
|
|
203
197
|
try {
|
|
204
198
|
await this.update(undefined, {
|
|
@@ -207,7 +201,6 @@ export class Return extends BaseVariable {
|
|
|
207
201
|
this.genSchemaChildren();
|
|
208
202
|
|
|
209
203
|
if (this.logic.interface) {
|
|
210
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
211
204
|
this.logic.interface.setParamAndReturn();
|
|
212
205
|
} else if (this.logic.view) {
|
|
213
206
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -234,7 +227,6 @@ export class Return extends BaseVariable {
|
|
|
234
227
|
this.genSchemaChildren();
|
|
235
228
|
|
|
236
229
|
if (this.logic.interface) {
|
|
237
|
-
// this.logic.interface.service.emit('interfacesChange');
|
|
238
230
|
this.logic.interface.setParamAndReturn();
|
|
239
231
|
} else if (this.logic.view) {
|
|
240
232
|
this.logic.view.page.service.emit('pageTreeChange');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { immutable,
|
|
2
|
-
import { config,
|
|
1
|
+
import { immutable, action } from '../decorators';
|
|
2
|
+
import { config, utils, LEVEL_ENUM, Logic, Schema, BaseVariable, ActionOptions } from '..';
|
|
3
3
|
import { paramService } from '../../service/logic';
|
|
4
|
-
import { convert2RefType
|
|
4
|
+
import { convert2RefType } from '../data/dataTypeUtils';
|
|
5
5
|
import { getBasicTypeDefaultValue } from '../data/basicTypes';
|
|
6
6
|
import { schemaService } from '../../service/common';
|
|
7
7
|
import { catchFn } from './Param';
|
|
@@ -40,18 +40,18 @@ export class Variable extends BaseVariable {
|
|
|
40
40
|
config.defaultApp?.emit('saving');
|
|
41
41
|
|
|
42
42
|
const body = this.toJSON();
|
|
43
|
-
// convert2SchemaType(body.schema);
|
|
44
43
|
body._posIndex = this.logic.variables.indexOf(this);
|
|
45
44
|
utils.logger.debug('添加逻辑局部变量', body);
|
|
46
45
|
const result: Variable = await paramService.create({
|
|
47
46
|
headers: {
|
|
47
|
+
moduleType: this.logic && this.logic.moduleType,
|
|
48
48
|
appId: config.defaultApp?.id,
|
|
49
49
|
operationAction: actionOptions?.actionName || 'Variable.create',
|
|
50
50
|
operationDesc: actionOptions?.actionDesc || `添加逻辑"${this.logic.name}"局部变量"${this.name}"`,
|
|
51
51
|
},
|
|
52
52
|
body,
|
|
53
53
|
}).catch(catchFn(this.logic));
|
|
54
|
-
|
|
54
|
+
|
|
55
55
|
this.deepPick(result, ['id']);
|
|
56
56
|
this.assign({ code: this.genCode() });
|
|
57
57
|
|
|
@@ -74,17 +74,18 @@ export class Variable extends BaseVariable {
|
|
|
74
74
|
config.defaultApp?.emit('saving');
|
|
75
75
|
|
|
76
76
|
if (this.id) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
77
|
+
await paramService.delete({
|
|
78
|
+
headers: {
|
|
79
|
+
moduleType: this.logic && this.logic.moduleType,
|
|
80
|
+
appId: config.defaultApp?.id,
|
|
81
|
+
operationAction: actionOptions?.actionName || 'Param.create',
|
|
82
|
+
operationDesc: actionOptions?.actionDesc || `删除逻辑"${this.logic.name}"局部变量"${this.name}"`,
|
|
83
|
+
},
|
|
84
|
+
query: {
|
|
85
|
+
loValId: this.id,
|
|
86
|
+
logicId: this.logic.id,
|
|
87
|
+
},
|
|
88
|
+
}).catch(catchFn(this.logic));
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
const index = this.logic.variables.indexOf(this);
|
|
@@ -107,10 +108,10 @@ export class Variable extends BaseVariable {
|
|
|
107
108
|
config.defaultApp?.emit('saving');
|
|
108
109
|
|
|
109
110
|
const body = this.toJSON();
|
|
110
|
-
// convert2SchemaType(body.schema);
|
|
111
111
|
utils.logger.debug('修改逻辑局部变量', body);
|
|
112
112
|
const result = await paramService.update({
|
|
113
113
|
headers: {
|
|
114
|
+
moduleType: this.logic && this.logic.moduleType,
|
|
114
115
|
appId: config.defaultApp?.id,
|
|
115
116
|
operationAction: actionOptions?.actionName || 'Param.update',
|
|
116
117
|
operationDesc: actionOptions?.actionDesc || `修改逻辑局部变量"${this.name}"`,
|
|
@@ -118,8 +119,6 @@ export class Variable extends BaseVariable {
|
|
|
118
119
|
body,
|
|
119
120
|
}).catch(catchFn(this.logic));
|
|
120
121
|
this.schema.id = result.schema.id;
|
|
121
|
-
// convert2RefType(result.schema);
|
|
122
|
-
// this.plainAssign(result);
|
|
123
122
|
|
|
124
123
|
await then?.();
|
|
125
124
|
await config.defaultApp?.history.load();
|
|
@@ -195,7 +194,6 @@ export class Variable extends BaseVariable {
|
|
|
195
194
|
typeInstantiation: undefined,
|
|
196
195
|
});
|
|
197
196
|
Object.assign(this.schema, schema);
|
|
198
|
-
// if (this.defaultValue)
|
|
199
197
|
this.assign({ defaultValue: getBasicTypeDefaultValue() });
|
|
200
198
|
try {
|
|
201
199
|
await this.update(undefined, {
|