@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.
Files changed (126) hide show
  1. package/out/service/app/api.d.ts +1 -15
  2. package/out/service/app/api.js +7 -17
  3. package/out/service/app/api.js.map +1 -1
  4. package/out/service/create/errHandles.js +12 -0
  5. package/out/service/create/errHandles.js.map +1 -1
  6. package/out/service/create/index.js +3 -0
  7. package/out/service/create/index.js.map +1 -1
  8. package/out/service/logic/logic.d.ts +26 -17
  9. package/out/service/logic/logic.js +6 -0
  10. package/out/service/logic/logic.js.map +1 -1
  11. package/out/types/app/App.d.ts +5 -4
  12. package/out/types/app/App.js +31 -25
  13. package/out/types/app/App.js.map +1 -1
  14. package/out/types/app/History.js +3 -2
  15. package/out/types/app/History.js.map +1 -1
  16. package/out/types/app/Service.d.ts +3 -0
  17. package/out/types/app/Service.js +10 -2
  18. package/out/types/app/Service.js.map +1 -1
  19. package/out/types/cacheData.js.map +1 -1
  20. package/out/types/data/Entity.d.ts +4 -0
  21. package/out/types/data/Entity.js +8 -0
  22. package/out/types/data/Entity.js.map +1 -1
  23. package/out/types/data/EntityProperty.d.ts +5 -0
  24. package/out/types/data/EntityProperty.js +16 -0
  25. package/out/types/data/EntityProperty.js.map +1 -1
  26. package/out/types/data/dataTypes.js +1 -1
  27. package/out/types/data/dataTypes.js.map +1 -1
  28. package/out/types/data/genBlock/genCurdEditTableBlock.d.ts +3 -0
  29. package/out/types/data/genBlock/genCurdEditTableBlock.js +578 -0
  30. package/out/types/data/genBlock/genCurdEditTableBlock.js.map +1 -0
  31. package/out/types/data/genBlock/genEditTableBlock.d.ts +234 -0
  32. package/out/types/data/genBlock/genEditTableBlock.js +419 -0
  33. package/out/types/data/genBlock/genEditTableBlock.js.map +1 -0
  34. package/out/types/data/genBlock/genQueryComponent.d.ts +20 -0
  35. package/out/types/data/genBlock/genQueryComponent.js +57 -1
  36. package/out/types/data/genBlock/genQueryComponent.js.map +1 -1
  37. package/out/types/data/genBlock/genTableBlock.js +9 -5
  38. package/out/types/data/genBlock/genTableBlock.js.map +1 -1
  39. package/out/types/data/genBlock/index.d.ts +2 -0
  40. package/out/types/data/genBlock/index.js +2 -0
  41. package/out/types/data/genBlock/index.js.map +1 -1
  42. package/out/types/data/genBlock/utils.d.ts +7 -0
  43. package/out/types/data/genBlock/utils.js +38 -1
  44. package/out/types/data/genBlock/utils.js.map +1 -1
  45. package/out/types/index.d.ts +2 -4
  46. package/out/types/index.js +3 -6
  47. package/out/types/index.js.map +1 -1
  48. package/out/types/logic/Logic.d.ts +4 -12
  49. package/out/types/logic/Logic.js +35 -24
  50. package/out/types/logic/Logic.js.map +1 -1
  51. package/out/types/logic/LogicItem.d.ts +1 -20
  52. package/out/types/logic/LogicItem.js +5 -191
  53. package/out/types/logic/LogicItem.js.map +1 -1
  54. package/out/types/logic/Param.js +5 -13
  55. package/out/types/logic/Param.js.map +1 -1
  56. package/out/types/logic/Return.js +3 -11
  57. package/out/types/logic/Return.js.map +1 -1
  58. package/out/types/logic/Variable.js +3 -6
  59. package/out/types/logic/Variable.js.map +1 -1
  60. package/out/types/logic/translator.js +39 -8
  61. package/out/types/logic/translator.js.map +1 -1
  62. package/out/types/page/Element.d.ts +21 -2
  63. package/out/types/page/Element.js +89 -7
  64. package/out/types/page/Element.js.map +1 -1
  65. package/out/types/page/Page.d.ts +4 -0
  66. package/out/types/page/Page.js +7 -0
  67. package/out/types/page/Page.js.map +1 -1
  68. package/out/types/page/View.d.ts +19 -16
  69. package/out/types/page/View.js +73 -15
  70. package/out/types/page/View.js.map +1 -1
  71. package/out/types/page/ViewVariable.js +0 -6
  72. package/out/types/page/ViewVariable.js.map +1 -1
  73. package/out/types/process/ProcessParam.js +3 -1
  74. package/out/types/process/ProcessParam.js.map +1 -1
  75. package/out/types/utils/index.d.ts +1 -0
  76. package/out/types/utils/index.js +16 -7
  77. package/out/types/utils/index.js.map +1 -1
  78. package/package.json +1 -2
  79. package/src/service/app/api.js +8 -17
  80. package/src/service/create/errHandles.js +12 -0
  81. package/src/service/create/index.js +4 -0
  82. package/src/service/logic/logic.js +6 -0
  83. package/src/types/app/App.ts +37 -28
  84. package/src/types/app/History.ts +3 -2
  85. package/src/types/app/Service.ts +14 -5
  86. package/src/types/cacheData.ts +7 -7
  87. package/src/types/data/Entity.ts +7 -0
  88. package/src/types/data/EntityProperty.ts +12 -0
  89. package/src/types/data/dataTypes.ts +1 -1
  90. package/src/types/data/genBlock/genCurdEditTableBlock.ts +581 -0
  91. package/src/types/data/genBlock/genEditTableBlock.ts +470 -0
  92. package/src/types/data/genBlock/genQueryComponent.ts +56 -0
  93. package/src/types/data/genBlock/genTableBlock.ts +14 -10
  94. package/src/types/data/genBlock/index.ts +2 -0
  95. package/src/types/data/genBlock/utils.ts +38 -0
  96. package/src/types/index.ts +2 -4
  97. package/src/types/logic/Logic.ts +45 -41
  98. package/src/types/logic/LogicItem.ts +12 -217
  99. package/src/types/logic/Param.ts +25 -35
  100. package/src/types/logic/Return.ts +18 -26
  101. package/src/types/logic/Variable.ts +18 -20
  102. package/src/types/logic/translator.js +125 -154
  103. package/src/types/page/Element.ts +160 -73
  104. package/src/types/page/Page.ts +7 -0
  105. package/src/types/page/View.ts +112 -61
  106. package/src/types/page/ViewVariable.ts +13 -19
  107. package/src/types/page/dist/View.js +727 -0
  108. package/src/types/process/ProcessParam.ts +4 -1
  109. package/src/types/utils/index.ts +16 -7
  110. package/tsconfig.json +1 -1
  111. package/out/service/debugger/debugger.d.ts +0 -3
  112. package/out/service/debugger/debugger.js +0 -95
  113. package/out/service/debugger/debugger.js.map +0 -1
  114. package/out/test/units/config.spec.d.ts +0 -1
  115. package/out/test/units/config.spec.js +0 -12
  116. package/out/test/units/config.spec.js.map +0 -1
  117. package/out/types/logic/BreakPoint.d.ts +0 -42
  118. package/out/types/logic/BreakPoint.js +0 -155
  119. package/out/types/logic/BreakPoint.js.map +0 -1
  120. package/out/types/logic/Debugger.d.ts +0 -156
  121. package/out/types/logic/Debugger.js +0 -912
  122. package/out/types/logic/Debugger.js.map +0 -1
  123. package/src/service/debugger/debugger.js +0 -90
  124. package/src/types/logic/BreakPoint.ts +0 -200
  125. package/src/types/logic/Debugger.ts +0 -1140
  126. package/src/types/logic/translator.d.ts +0 -16
@@ -1,7 +1,7 @@
1
- import { immutable, excludedInJSON, action } from '../decorators';
2
- import { config, history, utils, LEVEL_ENUM, Vertex, Logic, PackageJSON, App, WebService, Page, Block, Schema, BaseVariable, ActionOptions, Interface } from '..';
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, convert2SchemaType } from '../data/dataTypeUtils';
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
- await paramService.delete({
112
- headers: {
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));
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, excludedInJSON, action } from '../decorators';
2
- import { config, history, utils, ActionOptions, LEVEL_ENUM, Vertex, Logic, PackageJSON, App, WebService, Page, Block, Schema, BaseVariable, genRefSchemaChildren } from '..';
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, convert2SchemaType } from '../data/dataTypeUtils';
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
- await paramService.delete({
79
- headers: {
80
- appId: config.defaultApp?.id,
81
- operationAction: actionOptions?.actionName || 'Return.create',
82
- operationDesc: `删除逻辑"${this.logic.name}"输出参数"${this.name}"`,
83
- },
84
- query: {
85
- loValId: this.id,
86
- logicId: this.logic.id,
87
- },
88
- }).catch(catchFn(this.logic));
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, //引用到Entity或者structure
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, excludedInJSON, action } from '../decorators';
2
- import { config, history, utils, LEVEL_ENUM, Vertex, Logic, PackageJSON, App, WebService, Page, Block, Schema, BaseVariable, ActionOptions } from '..';
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, convert2SchemaType } from '../data/dataTypeUtils';
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
- // convert2RefType(result.schema);
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
- await paramService.delete({
78
- headers: {
79
- appId: config.defaultApp?.id,
80
- operationAction: actionOptions?.actionName || 'Param.create',
81
- operationDesc: actionOptions?.actionDesc || `删除逻辑"${this.logic.name}"局部变量"${this.name}"`,
82
- },
83
- query: {
84
- loValId: this.id,
85
- logicId: this.logic.id,
86
- },
87
- }).catch(catchFn(this.logic));
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, {