@lcap/nasl 2.12.0-beta → 2.12.0-beta.1

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