@lcap/nasl 2.22.0-beta.0 → 2.22.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.
Files changed (276) hide show
  1. package/out/automate/engine/operators.d.ts +9 -0
  2. package/out/automate/engine/viewCache.d.ts +1 -0
  3. package/out/automate/template/myProcess.d.ts +1 -0
  4. package/out/common/BaseNode.d.ts +1 -0
  5. package/out/common/BaseNode.js +7 -1
  6. package/out/common/BaseNode.js.map +1 -1
  7. package/out/common/Command.d.ts +1 -1
  8. package/out/common/EventEmitter.d.ts +1 -1
  9. package/out/concepts/Abort__.js.map +1 -1
  10. package/out/concepts/Anchor__.js.map +1 -1
  11. package/out/concepts/AnonymousFunction__.js.map +1 -1
  12. package/out/concepts/App__.d.ts +22 -0
  13. package/out/concepts/App__.js +78 -12
  14. package/out/concepts/App__.js.map +1 -1
  15. package/out/concepts/Argument__.js.map +1 -1
  16. package/out/concepts/Assignee__.js.map +1 -1
  17. package/out/concepts/AssignmentLine__.js.map +1 -1
  18. package/out/concepts/Assignment__.js.map +1 -1
  19. package/out/concepts/Attribute__.js.map +1 -1
  20. package/out/concepts/BatchAssignment__.js.map +1 -1
  21. package/out/concepts/BinaryExpression__.js.map +1 -1
  22. package/out/concepts/BindAttribute__.js.map +1 -1
  23. package/out/concepts/BindDirective__.js.map +1 -1
  24. package/out/concepts/BindEvent__.js.map +1 -1
  25. package/out/concepts/BindStyle__.js.map +1 -1
  26. package/out/concepts/BooleanLiteral__.js.map +1 -1
  27. package/out/concepts/CallFunction__.js.map +1 -1
  28. package/out/concepts/CallInterface__.js +9 -1
  29. package/out/concepts/CallInterface__.js.map +1 -1
  30. package/out/concepts/CallLogic__.js +2 -1
  31. package/out/concepts/CallLogic__.js.map +1 -1
  32. package/out/concepts/CallQueryComponent__.d.ts +2 -0
  33. package/out/concepts/CallQueryComponent__.js +76 -24
  34. package/out/concepts/CallQueryComponent__.js.map +1 -1
  35. package/out/concepts/Comment__.js.map +1 -1
  36. package/out/concepts/CompletionProperty__.js.map +1 -1
  37. package/out/concepts/ConfigGroup__.js.map +1 -1
  38. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  39. package/out/concepts/ConfigProperty__.d.ts +4 -0
  40. package/out/concepts/ConfigProperty__.js +18 -1
  41. package/out/concepts/ConfigProperty__.js.map +1 -1
  42. package/out/concepts/Configuration__.js.map +1 -1
  43. package/out/concepts/Constant__.js.map +1 -1
  44. package/out/concepts/DataElement__.js.map +1 -1
  45. package/out/concepts/DataSource__.js.map +1 -1
  46. package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
  47. package/out/concepts/Destination__.js +2 -2
  48. package/out/concepts/Destination__.js.map +1 -1
  49. package/out/concepts/End__.js.map +1 -1
  50. package/out/concepts/EntityIndex__.d.ts +1 -1
  51. package/out/concepts/EntityIndex__.js.map +1 -1
  52. package/out/concepts/EntityProperty__.d.ts +7 -2
  53. package/out/concepts/EntityProperty__.js +100 -1
  54. package/out/concepts/EntityProperty__.js.map +1 -1
  55. package/out/concepts/Entity__.d.ts +2 -1
  56. package/out/concepts/Entity__.js +30 -1
  57. package/out/concepts/Entity__.js.map +1 -1
  58. package/out/concepts/EnumItem__.js.map +1 -1
  59. package/out/concepts/Enum__.js.map +1 -1
  60. package/out/concepts/Event__.js.map +1 -1
  61. package/out/concepts/ExternalDestination__.js.map +1 -1
  62. package/out/concepts/ForEachStatement__.js.map +1 -1
  63. package/out/concepts/FrontendLibrary__.js.map +1 -1
  64. package/out/concepts/Frontend__.js.map +1 -1
  65. package/out/concepts/Function__.js.map +1 -1
  66. package/out/concepts/Identifier__.js +7 -0
  67. package/out/concepts/Identifier__.js.map +1 -1
  68. package/out/concepts/IfStatement__.js +2 -2
  69. package/out/concepts/IfStatement__.js.map +1 -1
  70. package/out/concepts/Integration__.d.ts +53 -0
  71. package/out/concepts/Integration__.js +143 -0
  72. package/out/concepts/Integration__.js.map +1 -0
  73. package/out/concepts/InterfaceParam__.js.map +1 -1
  74. package/out/concepts/Interface__.js.map +1 -1
  75. package/out/concepts/JSBlock__.js.map +1 -1
  76. package/out/concepts/JavaLogic__.d.ts +42 -0
  77. package/out/concepts/JavaLogic__.js +122 -0
  78. package/out/concepts/JavaLogic__.js.map +1 -0
  79. package/out/concepts/LogicItem__.d.ts +1 -1
  80. package/out/concepts/LogicItem__.js.map +1 -1
  81. package/out/concepts/Logic__.js +12 -7
  82. package/out/concepts/Logic__.js.map +1 -1
  83. package/out/concepts/MatchCase__.js.map +1 -1
  84. package/out/concepts/Match__.js +11 -6
  85. package/out/concepts/Match__.js.map +1 -1
  86. package/out/concepts/MemberExpression__.js +1 -1
  87. package/out/concepts/MemberExpression__.js.map +1 -1
  88. package/out/concepts/MicroApp__.d.ts +51 -0
  89. package/out/concepts/MicroApp__.js +113 -0
  90. package/out/concepts/MicroApp__.js.map +1 -0
  91. package/out/concepts/Module__.d.ts +20 -9
  92. package/out/concepts/Module__.js +72 -14
  93. package/out/concepts/Module__.js.map +1 -1
  94. package/out/concepts/Namespace__.js.map +1 -1
  95. package/out/concepts/NewComposite__.d.ts +1 -1
  96. package/out/concepts/NewComposite__.js +25 -11
  97. package/out/concepts/NewComposite__.js.map +1 -1
  98. package/out/concepts/NewList__.js.map +1 -1
  99. package/out/concepts/NewMap__.js.map +1 -1
  100. package/out/concepts/New__.js.map +1 -1
  101. package/out/concepts/NullLiteral__.js.map +1 -1
  102. package/out/concepts/NumericLiteral__.js.map +1 -1
  103. package/out/concepts/OqlQueryComponent__.js +1 -1
  104. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  105. package/out/concepts/Param__.d.ts +1 -0
  106. package/out/concepts/Param__.js +5 -0
  107. package/out/concepts/Param__.js.map +1 -1
  108. package/out/concepts/Point__.js.map +1 -1
  109. package/out/concepts/ProcessComponent__.js.map +1 -1
  110. package/out/concepts/ProcessElement__.js.map +1 -1
  111. package/out/concepts/ProcessOutcome__.js.map +1 -1
  112. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  113. package/out/concepts/Process__.js.map +1 -1
  114. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  115. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  116. package/out/concepts/QueryFromExpression__.js.map +1 -1
  117. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  118. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  119. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  120. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  121. package/out/concepts/QuerySelectExpression__.d.ts +104 -16
  122. package/out/concepts/QuerySelectExpression__.js +99 -9
  123. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  124. package/out/concepts/Rect__.js.map +1 -1
  125. package/out/concepts/Return__.js.map +1 -1
  126. package/out/concepts/Role__.js.map +1 -1
  127. package/out/concepts/SelectMembers__.js.map +1 -1
  128. package/out/concepts/Slot__.js.map +1 -1
  129. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  130. package/out/concepts/Start__.js.map +1 -1
  131. package/out/concepts/StringInterpolation__.js.map +1 -1
  132. package/out/concepts/StringLiteral__.js.map +1 -1
  133. package/out/concepts/StructureProperty__.js.map +1 -1
  134. package/out/concepts/Structure__.js.map +1 -1
  135. package/out/concepts/SwitchCase__.js +2 -2
  136. package/out/concepts/SwitchCase__.js.map +1 -1
  137. package/out/concepts/SwitchStatement__.js.map +1 -1
  138. package/out/concepts/Theme__.js.map +1 -1
  139. package/out/concepts/Transactional__.js.map +1 -1
  140. package/out/concepts/TypeAnnotation__.js +8 -3
  141. package/out/concepts/TypeAnnotation__.js.map +1 -1
  142. package/out/concepts/TypeParam__.js.map +1 -1
  143. package/out/concepts/UnaryExpression__.js.map +1 -1
  144. package/out/concepts/Unparsed__.js.map +1 -1
  145. package/out/concepts/UseComponent__.js.map +1 -1
  146. package/out/concepts/ValidationRule__.js.map +1 -1
  147. package/out/concepts/Variable__.js.map +1 -1
  148. package/out/concepts/ViewBlock__.js.map +1 -1
  149. package/out/concepts/ViewComponent__.js.map +1 -1
  150. package/out/concepts/ViewElement__.js +26 -6
  151. package/out/concepts/ViewElement__.js.map +1 -1
  152. package/out/concepts/View__.d.ts +1 -1
  153. package/out/concepts/View__.js +3 -1
  154. package/out/concepts/View__.js.map +1 -1
  155. package/out/concepts/WhileStatement__.js.map +1 -1
  156. package/out/concepts/basics/stdlib/nasl.ui.js +15 -0
  157. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  158. package/out/concepts/basics/stdlib/nasl.util.js +94 -0
  159. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  160. package/out/concepts/index__.d.ts +3 -0
  161. package/out/concepts/index__.js +3 -0
  162. package/out/concepts/index__.js.map +1 -1
  163. package/out/config.d.ts +1 -1
  164. package/out/decorators/index.d.ts +2 -2
  165. package/out/generator/genBundleFiles.js +20 -3
  166. package/out/generator/genBundleFiles.js.map +1 -1
  167. package/out/generator/genReleaseBody.js +2 -2
  168. package/out/generator/genReleaseBody.js.map +1 -1
  169. package/out/generator/icestark.d.ts +2 -0
  170. package/out/generator/icestark.js +48 -0
  171. package/out/generator/icestark.js.map +1 -0
  172. package/out/generator/microApp.d.ts +2 -0
  173. package/out/generator/microApp.js +35 -0
  174. package/out/generator/microApp.js.map +1 -0
  175. package/out/generator/permission.d.ts +1 -1
  176. package/out/generator/permission.js +0 -13
  177. package/out/generator/permission.js.map +1 -1
  178. package/out/generator/qiankun.d.ts +2 -0
  179. package/out/generator/qiankun.js +52 -0
  180. package/out/generator/qiankun.js.map +1 -0
  181. package/out/index.d.ts +1 -0
  182. package/out/index.js +1 -0
  183. package/out/index.js.map +1 -1
  184. package/out/manager/stepRecorder.d.ts +20 -0
  185. package/out/manager/stepRecorder.js +110 -0
  186. package/out/manager/stepRecorder.js.map +1 -0
  187. package/out/sentry/index.d.ts +5 -4
  188. package/out/sentry/index.js +9 -2
  189. package/out/sentry/index.js.map +1 -1
  190. package/out/server/formatTsUtils.d.ts +1 -1
  191. package/out/server/formatTsUtils.js +40 -14
  192. package/out/server/formatTsUtils.js.map +1 -1
  193. package/out/server/getLogics.js +38 -6
  194. package/out/server/getLogics.js.map +1 -1
  195. package/out/server/getMemberIdentifier.js +5 -4
  196. package/out/server/getMemberIdentifier.js.map +1 -1
  197. package/out/server/getProcesses.d.ts +3 -3
  198. package/out/server/getScope.d.ts +1 -1
  199. package/out/server/naslServer.d.ts +7 -3
  200. package/out/server/naslServer.js +270 -102
  201. package/out/server/naslServer.js.map +1 -1
  202. package/out/server/translator.js +25 -7
  203. package/out/server/translator.js.map +1 -1
  204. package/out/service/storage/init.d.ts +3 -3
  205. package/out/service/storage/init.js +6 -0
  206. package/out/service/storage/init.js.map +1 -1
  207. package/out/templator/genCreateBlock.js +6 -1
  208. package/out/templator/genCreateBlock.js.map +1 -1
  209. package/out/templator/genQueryComponent.js +20 -6
  210. package/out/templator/genQueryComponent.js.map +1 -1
  211. package/out/templator/genUpdateBlock.js +7 -1
  212. package/out/templator/genUpdateBlock.js.map +1 -1
  213. package/out/templator/utils.d.ts +16 -0
  214. package/out/templator/utils.js +2 -0
  215. package/out/templator/utils.js.map +1 -1
  216. package/out/translator/index.d.ts +1 -1
  217. package/out/translator/lsp.d.ts +3 -3
  218. package/out/utils/index.d.ts +4 -4
  219. package/package.json +1 -1
  220. package/sandbox/stdlib/nasl.ui.ts +16 -11
  221. package/sandbox/stdlib/nasl.util.ts +4 -0
  222. package/sandbox/stdlib/nasl.validation.ts +2 -2
  223. package/src/automate/upgrader/2.17.js +1 -1
  224. package/src/common/BaseNode.ts +10 -2
  225. package/src/concepts/App__.ts +90 -46
  226. package/src/concepts/CallInterface__.ts +9 -1
  227. package/src/concepts/CallLogic__.ts +2 -1
  228. package/src/concepts/CallQueryComponent__.ts +73 -82
  229. package/src/concepts/ConfigProperty__.ts +18 -1
  230. package/src/concepts/Destination__.ts +2 -20
  231. package/src/concepts/EntityProperty__.ts +102 -8
  232. package/src/concepts/Entity__.ts +31 -8
  233. package/src/concepts/Identifier__.ts +9 -2
  234. package/src/concepts/IfStatement__.ts +2 -2
  235. package/src/concepts/Integration__.ts +162 -0
  236. package/src/concepts/JavaLogic__.ts +129 -0
  237. package/src/concepts/LogicItem__.ts +1 -1
  238. package/src/concepts/Logic__.ts +12 -45
  239. package/src/concepts/Match__.ts +10 -5
  240. package/src/concepts/MemberExpression__.ts +1 -1
  241. package/src/concepts/MicroApp__.ts +118 -0
  242. package/src/concepts/Module__.ts +106 -79
  243. package/src/concepts/NewComposite__.ts +23 -11
  244. package/src/concepts/OqlQueryComponent__.ts +1 -1
  245. package/src/concepts/Param__.ts +3 -0
  246. package/src/concepts/QueryFieldExpression__.ts +0 -7
  247. package/src/concepts/QuerySelectExpression__.ts +206 -30
  248. package/src/concepts/SwitchCase__.ts +2 -2
  249. package/src/concepts/TypeAnnotation__.ts +8 -42
  250. package/src/concepts/ViewElement__.ts +24 -6
  251. package/src/concepts/View__.ts +3 -24
  252. package/src/concepts/basics/stdlib/nasl.ui.ts +15 -0
  253. package/src/concepts/basics/stdlib/nasl.util.ts +94 -0
  254. package/src/concepts/index__.ts +3 -0
  255. package/src/generator/genBundleFiles.ts +22 -4
  256. package/src/generator/genReleaseBody.ts +2 -2
  257. package/src/generator/icestark.ts +45 -0
  258. package/src/generator/microApp.ts +32 -0
  259. package/src/generator/permission.ts +1 -15
  260. package/src/generator/qiankun.ts +49 -0
  261. package/src/index.ts +1 -0
  262. package/src/manager/stepRecorder.ts +112 -0
  263. package/src/sentry/index.ts +8 -2
  264. package/src/server/formatTsUtils.ts +42 -14
  265. package/src/server/getLogics.ts +41 -6
  266. package/src/server/getMemberIdentifier.ts +5 -4
  267. package/src/server/naslServer.ts +270 -101
  268. package/src/server/translator.ts +25 -7
  269. package/src/service/storage/init.ts +7 -0
  270. package/src/templator/genCreateBlock.ts +6 -1
  271. package/src/templator/genQueryComponent.ts +22 -8
  272. package/src/templator/genUpdateBlock.ts +7 -1
  273. package/src/templator/utils.ts +2 -0
  274. package/ts-worker/src/index.js +1 -4
  275. package/src/manager/history.ts +0 -0
  276. package/src/manager/problem.ts +0 -0
@@ -70,7 +70,7 @@ function transformType(tsType: string): string {
70
70
  else if (tsType === 'Decimal')
71
71
  return '小数';
72
72
  else if (tsType === 'Long')
73
- return '长整数';
73
+ return '整数';
74
74
  else if (tsType === 'DateTime')
75
75
  return '日期时间';
76
76
  else if (tsType === 'Date')
@@ -177,6 +177,11 @@ const TS_RULES: Array<{
177
177
  result: string;
178
178
  transforms?: Array<(str: string) => string>;
179
179
  }> = [
180
+ {
181
+ re: /Property '(FrontEnd|BackEnd)(.+?)' is private and only accessible within/,
182
+ result: '找不到配置参数$2',
183
+ transforms: [transformType, transformType],
184
+ },
180
185
  {
181
186
  re: /Object literal may only specify known properties, and '(.+?)' does not exist in type/,
182
187
  result: '当前参数$1,不可用。',
@@ -394,6 +399,11 @@ const TS_RULES: Array<{
394
399
  result: '$1推导不出类型!请连线或手动设置',
395
400
  transforms: [transformType],
396
401
  },
402
+ {
403
+ re: /'(.+?)' refers to a value, but is being used as a type here. Did you mean 'typeof (.+?)'?/,
404
+ result: '$1未初始化!请连线',
405
+ transforms: [transformType],
406
+ },
397
407
  ];
398
408
 
399
409
  const POST_RULES: Array<{
@@ -411,7 +421,7 @@ const POST_RULES: Array<{
411
421
  },
412
422
  {
413
423
  re: /Long|"Long"/g,
414
- result: '长整数',
424
+ result: '整数',
415
425
  },
416
426
  {
417
427
  re: /Double|"Double"/g,
@@ -419,7 +429,7 @@ const POST_RULES: Array<{
419
429
  },
420
430
  {
421
431
  re: /Decimal|"Decimal"/g,
422
- result: '精确小数',
432
+ result: '小数',
423
433
  },
424
434
  {
425
435
  re: /String|"String"/g,
@@ -462,8 +472,8 @@ export function translateDiagnosticMessage(message: string) {
462
472
  * @returns
463
473
  */
464
474
  export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diagnostic) {
465
- const text = tsErrorDetail.originalDiagnostic.text;
466
- let node = minRange.node;
475
+ const text = tsErrorDetail?.originalDiagnostic?.text;
476
+ let node = minRange?.node;
467
477
  // 有一些节点报错信息不向外暴露,缺失一些原生标签等等的展示
468
478
  if (node instanceof View || node instanceof ViewElement) {
469
479
  if (text.startsWith(`'nasl.ui' has no exported member named `)) {
@@ -551,7 +561,7 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
551
561
  } else if (node.parentNode instanceof NewMap) {
552
562
  if (text.includes(`is not assignable to parameter of type 'None'`)) {
553
563
  const cap = /Argument of type '(.+?)' is not assignable to parameter of type '(.+?)'/.exec(text);
554
- tsErrorDetail.message = tsErrorDetail.message = `参数类型不一致!传入类型:${transformType(cap[1])},接收类型:字符串 整数 或 布尔值 或 长整数精确小数`;
564
+ tsErrorDetail.message = tsErrorDetail.message = `参数类型不一致!传入类型:${transformType(cap[1])},接收类型:字符串 或 布尔值 或 整数小数`;
555
565
  } else if (text.includes(`parameter of type 'never'`)) {
556
566
  tsErrorDetail.message = '自动推导不出类型!newMap中有未知类型';
557
567
  }
@@ -693,6 +703,12 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
693
703
  }
694
704
  }
695
705
  }
706
+ if (/Property '(.+?)' is missing in type '(.+?)' but required in type '(.+?)'/.exec(text)) {
707
+ if (node.parentNode instanceof NewComposite) {
708
+ tsErrorDetail.message = tsErrorDetail.message.replace('类型不一致', '接收与传入类型不一致').replace('左边类型', '左边接收类型').replace('右边类型', '右边传入类型');
709
+ tsErrorDetail.message = node.name + tsErrorDetail.message;
710
+ }
711
+ }
696
712
  // 参数类型不一致!
697
713
  if (/^Type '(.+?)' does not satisfy the constraint '(.+?)'\./.exec(text)) {
698
714
  // match
@@ -749,7 +765,9 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
749
765
  });
750
766
  }
751
767
  }
752
- node.tsErrorDetail = tsErrorDetail;
768
+ if (node && tsErrorDetail) {
769
+ node.tsErrorDetail = tsErrorDetail;
770
+ }
753
771
 
754
772
  return {
755
773
  node,
@@ -4,6 +4,7 @@ import { config } from '../../config';
4
4
  import Vue from 'vue';
5
5
  import storageService from './service';
6
6
  import { v4 as uuidv4 } from 'uuid';
7
+ import stepRecorder from '../../manager/stepRecorder';
7
8
  /// #if !process.env.NODE_ENV || process.env.BUILD_TARGET === 'node'
8
9
  import * as fs from 'fs-extra';
9
10
  import * as jsoner from './jsoner';
@@ -303,6 +304,7 @@ async function doAction(app: any, actionItem: any) {
303
304
  Vue.prototype.$toast.info(msg);
304
305
  app._historying = false;
305
306
  }
307
+ stepRecorder.initialized && stepRecorder.record(actionMsg, actionItem, actionList);
306
308
  }
307
309
 
308
310
  type Instruct = {
@@ -618,6 +620,7 @@ export function handleApp(app: any) {
618
620
  export async function loadApp(appId?: string) {
619
621
  let app: App;
620
622
  if (config.storage.protocol === 'http') {
623
+ console.time('batchQuery');
621
624
  // 请求
622
625
  const res = await storageService.batchQuery({
623
626
  body: [
@@ -635,10 +638,14 @@ export async function loadApp(appId?: string) {
635
638
  shortResponse: false,
636
639
  },
637
640
  });
641
+ console.timeEnd('batchQuery');
638
642
 
639
643
  tabTimestamp = res?.headers?.tabtimestamp;
640
644
  const data = res?.data?.result;
645
+
646
+ console.time('new App');
641
647
  app = new App(Object.assign(data?.[0], { id: appId }));
648
+ console.timeEnd('new App');
642
649
  if (!app.id) {
643
650
  app.id = appId;
644
651
  }
@@ -57,7 +57,12 @@ export function genCreateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
57
57
  } else
58
58
  return '';
59
59
  } else if (propertyTypeName === 'Boolean') {
60
- formItem += `<u-checkbox v-model="${vModel}"></u-checkbox>`;
60
+ formItem += `
61
+ <u-select clearable v-model="${vModel}" placeholder="请输入${label}">
62
+ <u-select-item :value="true" text="是">是</u-select-item>
63
+ <u-select-item :value="false" text="否">否</u-select-item>
64
+ </u-select>
65
+ `;
61
66
  } else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
62
67
  formItem += `<u-number-input v-model="${vModel}" placeholder="请输入${label}"></u-number-input>`;
63
68
  } else if (propertyTypeName === 'Double') {
@@ -1,5 +1,5 @@
1
1
  import * as utils from '../utils';
2
- import { App, Module, Namespace, Entity, Structure, QueryJoinExpression, CallQueryComponent, StructureProperty, DataSource, TypeAnnotation } from '../concepts';
2
+ import { App, Module, Namespace, Entity, Structure, QueryJoinExpression, QueryAggregateExpression, QueryFieldExpression, CallQueryComponent, StructureProperty, DataSource, TypeAnnotation } from '../concepts';
3
3
  import { NameGroup, NaslCoreTypeAnnotation, NaslCollectionTypeAnnotation, NaslTypeAnnotation, NaslQueryExpression, NaslLogicItem, NaslNode } from './utils';
4
4
 
5
5
  export function genQueryStructure(allEntities: Array<Entity>, nameGroup: NameGroup) {
@@ -97,6 +97,23 @@ export function genQueryAssignment(allEntities: Array<Entity>, nameGroup: NameGr
97
97
  });
98
98
  }),
99
99
  });
100
+ const selectElements: Array<QueryAggregateExpression | QueryFieldExpression> = [];
101
+ selectElements.push(QueryFieldExpression.from({
102
+ entityAsName: entity.name,
103
+ isDotStar: true,
104
+ }));
105
+ from.joinParts.forEach((joinPart) => {
106
+ selectElements.push(QueryFieldExpression.from({
107
+ entityAsName: joinPart.entityName,
108
+ isDotStar: true,
109
+ }));
110
+ });
111
+ const select = NaslQueryExpression.QuerySelectExpression({
112
+ label: '查询组件Select子句',
113
+ distinct: false,
114
+ star: true,
115
+ selectElements,
116
+ });
100
117
  const where: any = supportFilter ? genWhereExpression(entity) : undefined;
101
118
  const aStructureProperties = [NaslNode.StructureProperty({
102
119
  name: utils.firstLowerCase(entity.name),
@@ -117,14 +134,11 @@ export function genQueryAssignment(allEntities: Array<Entity>, nameGroup: NameGr
117
134
  }),
118
135
  right: NaslQueryExpression.CallQueryComponent({
119
136
  label: '数据查询',
120
- ideVersion: '2.11', // 2.11版本新创建的数据查询组件,返回类型将自动推断
137
+ // 2.11版本的数据查询,返回类型将自动推断
138
+ // 2.22版本的数据查询,实体支持列筛选,(select.selectElements 会初始化实体对应的 QueryFieldExpression 节点)
139
+ ideVersion: '2.11', // 回滚功能
121
140
  typeAnnotation: NaslTypeAnnotation.AnonymousStructure(aStructureProperties),
122
- select: NaslQueryExpression.QuerySelectExpression({
123
- label: '查询组件Select子句',
124
- distinct: false,
125
- star: true,
126
- selectElements: [],
127
- }),
141
+ select,
128
142
  from,
129
143
  where,
130
144
  groupBy: [],
@@ -57,7 +57,12 @@ export function genUpdateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
57
57
  } else
58
58
  return '';
59
59
  } else if (propertyTypeName === 'Boolean') {
60
- formItem += `<u-checkbox v-model="${vModel}"></u-checkbox>`;
60
+ formItem += `
61
+ <u-select clearable v-model="${vModel}" placeholder="请输入${label}">
62
+ <u-select-item :value="true" text="是">是</u-select-item>
63
+ <u-select-item :value="false" text="否">否</u-select-item>
64
+ </u-select>
65
+ `;
61
66
  } else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
62
67
  formItem += `<u-number-input v-model="${vModel}" placeholder="请输入${label}"></u-number-input>`;
63
68
  } else if (propertyTypeName === 'Double') {
@@ -260,6 +265,7 @@ function genLoadLogic(getLogic: Logic, nameGroup: NameGroup) {
260
265
  });
261
266
  }
262
267
 
268
+ // 生成修改区块
263
269
  export function genUpdateBlock(entity: Entity, oldNode: ViewElement) {
264
270
  const view = oldNode.view;
265
271
  const dataSource = entity.parentNode as DataSource;
@@ -228,6 +228,8 @@ export const NaslUITypeAnnotation = {
228
228
  PoiInfo: genNaslUITypeAnnotation('PoiInfo'),
229
229
  File: genNaslUITypeAnnotation('File'),
230
230
  Current: genNaslUIGenericTypeAnnotation('Current'),
231
+ DragAndDropEvent: genNaslUIGenericTypeAnnotation('DragAndDropEvent'),
232
+ ExpandEvent: genNaslUIGenericTypeAnnotation('ExpandEvent'),
231
233
  };
232
234
 
233
235
  export const NaslTypeAnnotation = {
@@ -237,8 +237,7 @@ const context = {
237
237
  publishDiagnostics(remain) {
238
238
  webHost.diagnosticRecords = [];
239
239
  try {
240
- const chunk = Math.min(500, remain);
241
- for (let i = 0; i < chunk; i++) {
240
+ for (let i = 0; i < remain; i++) {
242
241
  this.system.checkTimeoutQueueLengthAndRun(1);
243
242
  this.system.runQueuedImmediateCallbacks(1);
244
243
  this.system.runQueuedImmediateCallbacks(1);
@@ -247,8 +246,6 @@ const context = {
247
246
  event: 'publishDiagnostics',
248
247
  records: webHost.diagnosticRecords,
249
248
  });
250
- remain -= chunk;
251
- remain && setTimeout(() => this.publishDiagnostics(remain), 0);
252
249
  } catch (e) {
253
250
  if (e.operator === 'strictEqual')
254
251
  console.error(e);
File without changes
File without changes