@ibiz-template/runtime 0.0.3-beta.2 → 0.0.3-beta.4

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 (847) hide show
  1. package/dist/system/index.system.js +1 -1
  2. package/out/config/global-config.d.ts +3 -0
  3. package/out/config/global-config.d.ts.map +1 -1
  4. package/out/config/global-config.js +3 -0
  5. package/out/controller/constant/control/index.d.ts +1 -0
  6. package/out/controller/constant/control/index.d.ts.map +1 -1
  7. package/out/controller/constant/control/index.js +1 -0
  8. package/out/controller/constant/control/panel/panel-notify-state.d.ts +6 -0
  9. package/out/controller/constant/control/panel/panel-notify-state.d.ts.map +1 -0
  10. package/out/controller/constant/control/panel/panel-notify-state.js +7 -0
  11. package/out/controller/control/control.d.ts +6 -0
  12. package/out/controller/control/control.d.ts.map +1 -1
  13. package/out/controller/control/control.js +1 -0
  14. package/out/controller/control/dataview.d.ts +112 -0
  15. package/out/controller/control/dataview.d.ts.map +1 -0
  16. package/out/controller/control/dataview.js +274 -0
  17. package/out/controller/control/form/edit-form.d.ts +8 -0
  18. package/out/controller/control/form/edit-form.d.ts.map +1 -1
  19. package/out/controller/control/form/edit-form.js +28 -1
  20. package/out/controller/control/form/form-button.d.ts.map +1 -1
  21. package/out/controller/control/form/form-button.js +1 -1
  22. package/out/controller/control/form/form-detail.d.ts +2 -2
  23. package/out/controller/control/form/form-detail.d.ts.map +1 -1
  24. package/out/controller/control/form/form-detail.js +38 -26
  25. package/out/controller/control/form/form-druipart.d.ts +2 -2
  26. package/out/controller/control/form/form-druipart.d.ts.map +1 -1
  27. package/out/controller/control/form/form-druipart.js +4 -4
  28. package/out/controller/control/form/form-item.d.ts +2 -2
  29. package/out/controller/control/form/form-item.d.ts.map +1 -1
  30. package/out/controller/control/form/form-item.js +4 -4
  31. package/out/controller/control/form/form.d.ts +1 -1
  32. package/out/controller/control/form/form.d.ts.map +1 -1
  33. package/out/controller/control/form/form.js +23 -11
  34. package/out/controller/control/form/search-form.d.ts +1 -1
  35. package/out/controller/control/form/search-form.d.ts.map +1 -1
  36. package/out/controller/control/form/search-form.js +2 -2
  37. package/out/controller/control/grid/grid-field-column.d.ts +1 -1
  38. package/out/controller/control/grid/grid-field-column.d.ts.map +1 -1
  39. package/out/controller/control/grid/grid-field-column.js +8 -2
  40. package/out/controller/control/grid/grid-row.d.ts +10 -9
  41. package/out/controller/control/grid/grid-row.d.ts.map +1 -1
  42. package/out/controller/control/grid/grid-row.js +12 -4
  43. package/out/controller/control/grid/grid-ua-column.d.ts.map +1 -1
  44. package/out/controller/control/grid/grid-ua-column.js +12 -5
  45. package/out/controller/control/grid/grid.d.ts +1 -24
  46. package/out/controller/control/grid/grid.d.ts.map +1 -1
  47. package/out/controller/control/grid/grid.js +30 -39
  48. package/out/controller/control/index.d.ts +4 -0
  49. package/out/controller/control/index.d.ts.map +1 -1
  50. package/out/controller/control/index.js +4 -0
  51. package/out/controller/control/kanban.d.ts +120 -0
  52. package/out/controller/control/kanban.d.ts.map +1 -0
  53. package/out/controller/control/kanban.js +299 -0
  54. package/out/controller/control/list.d.ts +75 -2
  55. package/out/controller/control/list.d.ts.map +1 -1
  56. package/out/controller/control/list.js +205 -1
  57. package/out/controller/control/md/index.d.ts +3 -0
  58. package/out/controller/control/md/index.d.ts.map +1 -0
  59. package/out/controller/control/md/index.js +2 -0
  60. package/out/controller/control/md/md-item.d.ts +23 -0
  61. package/out/controller/control/md/md-item.d.ts.map +1 -0
  62. package/out/controller/control/md/md-item.js +20 -0
  63. package/out/controller/control/{md.d.ts → md/md.d.ts} +25 -37
  64. package/out/controller/control/md/md.d.ts.map +1 -0
  65. package/out/controller/control/{md.js → md/md.js} +60 -63
  66. package/out/controller/control/panel/index.d.ts +10 -0
  67. package/out/controller/control/panel/index.d.ts.map +1 -0
  68. package/out/controller/control/panel/index.js +9 -0
  69. package/out/controller/control/panel/layout-panel.d.ts +120 -0
  70. package/out/controller/control/panel/layout-panel.d.ts.map +1 -0
  71. package/out/controller/control/panel/layout-panel.js +204 -0
  72. package/out/controller/control/panel/panel-button.d.ts +43 -0
  73. package/out/controller/control/panel/panel-button.d.ts.map +1 -0
  74. package/out/controller/control/panel/panel-button.js +60 -0
  75. package/out/controller/control/panel/panel-container.d.ts +15 -0
  76. package/out/controller/control/panel/panel-container.d.ts.map +1 -0
  77. package/out/controller/control/panel/panel-container.js +15 -0
  78. package/out/controller/control/panel/panel-field.d.ts +75 -0
  79. package/out/controller/control/panel/panel-field.d.ts.map +1 -0
  80. package/out/controller/control/panel/panel-field.js +93 -0
  81. package/out/controller/control/panel/panel-item.d.ts +91 -0
  82. package/out/controller/control/panel/panel-item.d.ts.map +1 -0
  83. package/out/controller/control/panel/panel-item.js +135 -0
  84. package/out/controller/control/panel/panel-raw-item.d.ts +17 -0
  85. package/out/controller/control/panel/panel-raw-item.d.ts.map +1 -0
  86. package/out/controller/control/panel/panel-raw-item.js +17 -0
  87. package/out/controller/control/panel/panel-tab-page.d.ts +15 -0
  88. package/out/controller/control/panel/panel-tab-page.d.ts.map +1 -0
  89. package/out/controller/control/panel/panel-tab-page.js +15 -0
  90. package/out/controller/control/panel/panel-tab-panel.d.ts +15 -0
  91. package/out/controller/control/panel/panel-tab-panel.d.ts.map +1 -0
  92. package/out/controller/control/panel/panel-tab-panel.js +15 -0
  93. package/out/controller/control/panel/view-layout-panel.d.ts +18 -0
  94. package/out/controller/control/panel/view-layout-panel.d.ts.map +1 -0
  95. package/out/controller/control/panel/view-layout-panel.js +19 -0
  96. package/out/controller/control/portlet/portlet-part.d.ts +34 -10
  97. package/out/controller/control/portlet/portlet-part.d.ts.map +1 -1
  98. package/out/controller/control/portlet/portlet-part.js +63 -21
  99. package/out/controller/control/portlet/view-portlet.d.ts +17 -0
  100. package/out/controller/control/portlet/view-portlet.d.ts.map +1 -1
  101. package/out/controller/control/portlet/view-portlet.js +10 -0
  102. package/out/controller/control/tree.d.ts +1 -1
  103. package/out/controller/control/tree.d.ts.map +1 -1
  104. package/out/controller/control/tree.js +5 -5
  105. package/out/controller/control/wizard-panel.d.ts +117 -0
  106. package/out/controller/control/wizard-panel.d.ts.map +1 -0
  107. package/out/controller/control/wizard-panel.js +194 -0
  108. package/out/controller/editor/autocomplete.d.ts +73 -0
  109. package/out/controller/editor/autocomplete.d.ts.map +1 -0
  110. package/out/controller/editor/autocomplete.js +117 -0
  111. package/out/controller/editor/check-box.d.ts +12 -0
  112. package/out/controller/editor/check-box.d.ts.map +1 -0
  113. package/out/controller/editor/check-box.js +10 -0
  114. package/out/controller/editor/code-list-editor.d.ts.map +1 -1
  115. package/out/controller/editor/code-list-editor.js +1 -1
  116. package/out/controller/editor/editor.d.ts +4 -1
  117. package/out/controller/editor/editor.d.ts.map +1 -1
  118. package/out/controller/editor/editor.js +22 -6
  119. package/out/controller/editor/index.d.ts +9 -0
  120. package/out/controller/editor/index.d.ts.map +1 -1
  121. package/out/controller/editor/index.js +9 -0
  122. package/out/controller/editor/list-box-picker.d.ts +42 -0
  123. package/out/controller/editor/list-box-picker.d.ts.map +1 -0
  124. package/out/controller/editor/list-box-picker.js +67 -0
  125. package/out/controller/editor/list-box.d.ts +11 -0
  126. package/out/controller/editor/list-box.d.ts.map +1 -0
  127. package/out/controller/editor/list-box.js +9 -0
  128. package/out/controller/editor/picker.d.ts +6 -2
  129. package/out/controller/editor/picker.d.ts.map +1 -1
  130. package/out/controller/editor/picker.js +26 -10
  131. package/out/controller/editor/rate.d.ts +12 -0
  132. package/out/controller/editor/rate.d.ts.map +1 -0
  133. package/out/controller/editor/rate.js +10 -0
  134. package/out/controller/editor/raw.d.ts +12 -0
  135. package/out/controller/editor/raw.d.ts.map +1 -0
  136. package/out/controller/editor/raw.js +10 -0
  137. package/out/controller/editor/slider.d.ts +12 -0
  138. package/out/controller/editor/slider.d.ts.map +1 -0
  139. package/out/controller/editor/slider.js +10 -0
  140. package/out/controller/editor/stepper.d.ts +12 -0
  141. package/out/controller/editor/stepper.d.ts.map +1 -0
  142. package/out/controller/editor/stepper.js +10 -0
  143. package/out/controller/editor/switch.d.ts +12 -0
  144. package/out/controller/editor/switch.d.ts.map +1 -0
  145. package/out/controller/editor/switch.js +10 -0
  146. package/out/controller/interface/ability/control/i-dataview-ability.d.ts +21 -0
  147. package/out/controller/interface/ability/control/i-dataview-ability.d.ts.map +1 -0
  148. package/out/controller/interface/ability/control/i-dataview-ability.js +1 -0
  149. package/out/controller/interface/ability/control/i-edit-form-ability.d.ts +8 -0
  150. package/out/controller/interface/ability/control/i-edit-form-ability.d.ts.map +1 -1
  151. package/out/controller/interface/ability/control/i-kanban-ability.d.ts +12 -0
  152. package/out/controller/interface/ability/control/i-kanban-ability.d.ts.map +1 -0
  153. package/out/controller/interface/ability/control/i-kanban-ability.js +1 -0
  154. package/out/controller/interface/ability/control/i-layout-panel-ability.d.ts +11 -0
  155. package/out/controller/interface/ability/control/i-layout-panel-ability.d.ts.map +1 -0
  156. package/out/controller/interface/ability/control/i-layout-panel-ability.js +1 -0
  157. package/out/controller/interface/ability/control/i-view-layout-panel-ability.d.ts +11 -0
  158. package/out/controller/interface/ability/control/i-view-layout-panel-ability.d.ts.map +1 -0
  159. package/out/controller/interface/ability/control/i-view-layout-panel-ability.js +1 -0
  160. package/out/controller/interface/ability/control/i-wizard-panel-ability.d.ts +20 -0
  161. package/out/controller/interface/ability/control/i-wizard-panel-ability.d.ts.map +1 -0
  162. package/out/controller/interface/ability/control/i-wizard-panel-ability.js +1 -0
  163. package/out/controller/interface/ability/control/index.d.ts +5 -0
  164. package/out/controller/interface/ability/control/index.d.ts.map +1 -1
  165. package/out/controller/interface/ability/control/index.js +5 -0
  166. package/out/controller/interface/ability/view/i-dataview-view-ability.d.ts +20 -0
  167. package/out/controller/interface/ability/view/i-dataview-view-ability.d.ts.map +1 -0
  168. package/out/controller/interface/ability/view/i-dataview-view-ability.js +1 -0
  169. package/out/controller/interface/ability/view/i-kanban-view-ability.d.ts +20 -0
  170. package/out/controller/interface/ability/view/i-kanban-view-ability.d.ts.map +1 -0
  171. package/out/controller/interface/ability/view/i-kanban-view-ability.js +1 -0
  172. package/out/controller/interface/ability/view/i-list-exp-view-ability.d.ts +20 -0
  173. package/out/controller/interface/ability/view/i-list-exp-view-ability.d.ts.map +1 -0
  174. package/out/controller/interface/ability/view/i-list-exp-view-ability.js +1 -0
  175. package/out/controller/interface/ability/view/i-list-view-ability.d.ts +20 -0
  176. package/out/controller/interface/ability/view/i-list-view-ability.d.ts.map +1 -0
  177. package/out/controller/interface/ability/view/i-list-view-ability.js +1 -0
  178. package/out/controller/interface/ability/view/i-wizard-view-ability.d.ts +12 -0
  179. package/out/controller/interface/ability/view/i-wizard-view-ability.d.ts.map +1 -0
  180. package/out/controller/interface/ability/view/i-wizard-view-ability.js +1 -0
  181. package/out/controller/interface/ability/view/index.d.ts +5 -0
  182. package/out/controller/interface/ability/view/index.d.ts.map +1 -1
  183. package/out/controller/interface/ability/view/index.js +5 -0
  184. package/out/controller/interface/common/button-state/i-button-state.d.ts +1 -1
  185. package/out/controller/interface/common/button-state/i-button-state.d.ts.map +1 -1
  186. package/out/controller/interface/controller/layout/i-layout-controller.d.ts +9 -0
  187. package/out/controller/interface/controller/layout/i-layout-controller.d.ts.map +1 -1
  188. package/out/controller/interface/event/control/i-dataview-event.d.ts +11 -0
  189. package/out/controller/interface/event/control/i-dataview-event.d.ts.map +1 -0
  190. package/out/controller/interface/event/control/i-dataview-event.js +1 -0
  191. package/out/controller/interface/event/control/i-kanban-event.d.ts +11 -0
  192. package/out/controller/interface/event/control/i-kanban-event.d.ts.map +1 -0
  193. package/out/controller/interface/event/control/i-kanban-event.js +1 -0
  194. package/out/controller/interface/event/control/i-layout-panel-event.d.ts +11 -0
  195. package/out/controller/interface/event/control/i-layout-panel-event.d.ts.map +1 -0
  196. package/out/controller/interface/event/control/i-layout-panel-event.js +1 -0
  197. package/out/controller/interface/event/control/i-md-control-event.d.ts +11 -0
  198. package/out/controller/interface/event/control/i-md-control-event.d.ts.map +1 -1
  199. package/out/controller/interface/event/control/i-view-layout-panel-event.d.ts +11 -0
  200. package/out/controller/interface/event/control/i-view-layout-panel-event.d.ts.map +1 -0
  201. package/out/controller/interface/event/control/i-view-layout-panel-event.js +1 -0
  202. package/out/controller/interface/event/control/i-wizard-panel-event.d.ts +20 -0
  203. package/out/controller/interface/event/control/i-wizard-panel-event.d.ts.map +1 -0
  204. package/out/controller/interface/event/control/i-wizard-panel-event.js +1 -0
  205. package/out/controller/interface/event/control/index.d.ts +5 -0
  206. package/out/controller/interface/event/control/index.d.ts.map +1 -1
  207. package/out/controller/interface/event/control/index.js +5 -0
  208. package/out/controller/interface/event/view/i-dataview-view-event.d.ts +12 -0
  209. package/out/controller/interface/event/view/i-dataview-view-event.d.ts.map +1 -0
  210. package/out/controller/interface/event/view/i-dataview-view-event.js +1 -0
  211. package/out/controller/interface/event/view/i-kanban-view-event.d.ts +12 -0
  212. package/out/controller/interface/event/view/i-kanban-view-event.d.ts.map +1 -0
  213. package/out/controller/interface/event/view/i-kanban-view-event.js +1 -0
  214. package/out/controller/interface/event/view/i-list-exp-view-event.d.ts +10 -0
  215. package/out/controller/interface/event/view/i-list-exp-view-event.d.ts.map +1 -0
  216. package/out/controller/interface/event/view/i-list-exp-view-event.js +1 -0
  217. package/out/controller/interface/event/view/i-list-view-event.d.ts +12 -0
  218. package/out/controller/interface/event/view/i-list-view-event.d.ts.map +1 -0
  219. package/out/controller/interface/event/view/i-list-view-event.js +1 -0
  220. package/out/controller/interface/event/view/i-wizard-view-event.d.ts +12 -0
  221. package/out/controller/interface/event/view/i-wizard-view-event.d.ts.map +1 -0
  222. package/out/controller/interface/event/view/i-wizard-view-event.js +1 -0
  223. package/out/controller/interface/event/view/index.d.ts +5 -0
  224. package/out/controller/interface/event/view/index.d.ts.map +1 -1
  225. package/out/controller/interface/event/view/index.js +5 -0
  226. package/out/controller/interface/provider/i-panel-item-provider.d.ts +31 -0
  227. package/out/controller/interface/provider/i-panel-item-provider.d.ts.map +1 -0
  228. package/out/controller/interface/provider/i-panel-item-provider.js +1 -0
  229. package/out/controller/interface/provider/index.d.ts +1 -0
  230. package/out/controller/interface/provider/index.d.ts.map +1 -1
  231. package/out/controller/interface/provider/index.js +1 -0
  232. package/out/controller/interface/register/i-panel-item-register.d.ts +24 -0
  233. package/out/controller/interface/register/i-panel-item-register.d.ts.map +1 -0
  234. package/out/controller/interface/register/i-panel-item-register.js +1 -0
  235. package/out/controller/interface/register/i-view-register.d.ts +2 -2
  236. package/out/controller/interface/register/i-view-register.d.ts.map +1 -1
  237. package/out/controller/interface/register/index.d.ts +1 -0
  238. package/out/controller/interface/register/index.d.ts.map +1 -1
  239. package/out/controller/interface/register/index.js +1 -0
  240. package/out/controller/neuron/nerve/control/daraview-nerve.d.ts +25 -0
  241. package/out/controller/neuron/nerve/control/daraview-nerve.d.ts.map +1 -0
  242. package/out/controller/neuron/nerve/control/daraview-nerve.js +19 -0
  243. package/out/controller/neuron/nerve/control/edit-form-nerve.d.ts +1 -0
  244. package/out/controller/neuron/nerve/control/edit-form-nerve.d.ts.map +1 -1
  245. package/out/controller/neuron/nerve/control/edit-form-nerve.js +1 -1
  246. package/out/controller/neuron/nerve/control/index.d.ts +5 -0
  247. package/out/controller/neuron/nerve/control/index.d.ts.map +1 -1
  248. package/out/controller/neuron/nerve/control/index.js +5 -0
  249. package/out/controller/neuron/nerve/control/kanban-nerve.d.ts +16 -0
  250. package/out/controller/neuron/nerve/control/kanban-nerve.d.ts.map +1 -0
  251. package/out/controller/neuron/nerve/control/kanban-nerve.js +16 -0
  252. package/out/controller/neuron/nerve/control/layout-panel-nerve.d.ts +20 -0
  253. package/out/controller/neuron/nerve/control/layout-panel-nerve.d.ts.map +1 -0
  254. package/out/controller/neuron/nerve/control/layout-panel-nerve.js +19 -0
  255. package/out/controller/neuron/nerve/control/view-layout-panel-nerve.d.ts +20 -0
  256. package/out/controller/neuron/nerve/control/view-layout-panel-nerve.d.ts.map +1 -0
  257. package/out/controller/neuron/nerve/control/view-layout-panel-nerve.js +19 -0
  258. package/out/controller/neuron/nerve/control/wizard-panel-nerve.d.ts +29 -0
  259. package/out/controller/neuron/nerve/control/wizard-panel-nerve.d.ts.map +1 -0
  260. package/out/controller/neuron/nerve/control/wizard-panel-nerve.js +46 -0
  261. package/out/controller/neuron/nerve/view/dataview-view-nerve.d.ts +32 -0
  262. package/out/controller/neuron/nerve/view/dataview-view-nerve.d.ts.map +1 -0
  263. package/out/controller/neuron/nerve/view/dataview-view-nerve.js +43 -0
  264. package/out/controller/neuron/nerve/view/grid-exp-view-nerve.d.ts.map +1 -1
  265. package/out/controller/neuron/nerve/view/grid-exp-view-nerve.js +1 -0
  266. package/out/controller/neuron/nerve/view/index.d.ts +5 -0
  267. package/out/controller/neuron/nerve/view/index.d.ts.map +1 -1
  268. package/out/controller/neuron/nerve/view/index.js +5 -0
  269. package/out/controller/neuron/nerve/view/kanban-view-nerve.d.ts +32 -0
  270. package/out/controller/neuron/nerve/view/kanban-view-nerve.d.ts.map +1 -0
  271. package/out/controller/neuron/nerve/view/kanban-view-nerve.js +44 -0
  272. package/out/controller/neuron/nerve/view/list-exp-view-nerve.d.ts +27 -0
  273. package/out/controller/neuron/nerve/view/list-exp-view-nerve.d.ts.map +1 -0
  274. package/out/controller/neuron/nerve/view/list-exp-view-nerve.js +48 -0
  275. package/out/controller/neuron/nerve/view/list-view-nerve.d.ts +32 -0
  276. package/out/controller/neuron/nerve/view/list-view-nerve.d.ts.map +1 -0
  277. package/out/controller/neuron/nerve/view/list-view-nerve.js +43 -0
  278. package/out/controller/neuron/nerve/view/wizard-view-nerve.d.ts +19 -0
  279. package/out/controller/neuron/nerve/view/wizard-view-nerve.d.ts.map +1 -0
  280. package/out/controller/neuron/nerve/view/wizard-view-nerve.js +29 -0
  281. package/out/controller/neuron/neuron/view.d.ts +12 -2
  282. package/out/controller/neuron/neuron/view.d.ts.map +1 -1
  283. package/out/controller/neuron/neuron/view.js +10 -0
  284. package/out/controller/neuron/neuron/widget.d.ts +12 -2
  285. package/out/controller/neuron/neuron/widget.d.ts.map +1 -1
  286. package/out/controller/neuron/neuron/widget.js +10 -0
  287. package/out/controller/register/control-register.d.ts.map +1 -1
  288. package/out/controller/register/control-register.js +1 -0
  289. package/out/controller/register/editor-register.d.ts.map +1 -1
  290. package/out/controller/register/editor-register.js +2 -0
  291. package/out/controller/register/index.d.ts +1 -0
  292. package/out/controller/register/index.d.ts.map +1 -1
  293. package/out/controller/register/index.js +1 -0
  294. package/out/controller/register/panel-item-register.d.ts +17 -0
  295. package/out/controller/register/panel-item-register.d.ts.map +1 -0
  296. package/out/controller/register/panel-item-register.js +32 -0
  297. package/out/controller/register/view-register.d.ts +2 -2
  298. package/out/controller/register/view-register.d.ts.map +1 -1
  299. package/out/controller/register/view-register.js +10 -12
  300. package/out/controller/state/control/dataview-state.d.ts +22 -0
  301. package/out/controller/state/control/dataview-state.d.ts.map +1 -0
  302. package/out/controller/state/control/dataview-state.js +23 -0
  303. package/out/controller/state/control/form/form-detail/form-detail-state.d.ts +12 -7
  304. package/out/controller/state/control/form/form-detail/form-detail-state.d.ts.map +1 -1
  305. package/out/controller/state/control/form/form-detail/form-detail-state.js +27 -24
  306. package/out/controller/state/control/form/form-detail/form-item-state.d.ts +0 -9
  307. package/out/controller/state/control/form/form-detail/form-item-state.d.ts.map +1 -1
  308. package/out/controller/state/control/form/form-detail/form-item-state.js +15 -16
  309. package/out/controller/state/control/form/form-detail/form-page-state.d.ts +0 -9
  310. package/out/controller/state/control/form/form-detail/form-page-state.d.ts.map +1 -1
  311. package/out/controller/state/control/form/form-detail/form-page-state.js +0 -11
  312. package/out/controller/state/control/form/form-state.d.ts +8 -0
  313. package/out/controller/state/control/form/form-state.d.ts.map +1 -1
  314. package/out/controller/state/control/form/form-state.js +8 -0
  315. package/out/controller/state/control/index.d.ts +12 -0
  316. package/out/controller/state/control/index.d.ts.map +1 -1
  317. package/out/controller/state/control/index.js +14 -0
  318. package/out/controller/state/control/kanban-state.d.ts +22 -0
  319. package/out/controller/state/control/kanban-state.d.ts.map +1 -0
  320. package/out/controller/state/control/kanban-state.js +23 -0
  321. package/out/controller/state/control/list-state.d.ts +22 -0
  322. package/out/controller/state/control/list-state.d.ts.map +1 -0
  323. package/out/controller/state/control/list-state.js +23 -0
  324. package/out/controller/state/control/panel/layout-panel-state.d.ts +22 -0
  325. package/out/controller/state/control/panel/layout-panel-state.d.ts.map +1 -0
  326. package/out/controller/state/control/panel/layout-panel-state.js +24 -0
  327. package/out/controller/state/control/panel/panel-item/panel-button-state.d.ts +13 -0
  328. package/out/controller/state/control/panel/panel-item/panel-button-state.d.ts.map +1 -0
  329. package/out/controller/state/control/panel/panel-item/panel-button-state.js +12 -0
  330. package/out/controller/state/control/panel/panel-item/panel-container-state.d.ts +13 -0
  331. package/out/controller/state/control/panel/panel-item/panel-container-state.d.ts.map +1 -0
  332. package/out/controller/state/control/panel/panel-item/panel-container-state.js +12 -0
  333. package/out/controller/state/control/panel/panel-item/panel-field-state.d.ts +21 -0
  334. package/out/controller/state/control/panel/panel-item/panel-field-state.d.ts.map +1 -0
  335. package/out/controller/state/control/panel/panel-item/panel-field-state.js +23 -0
  336. package/out/controller/state/control/panel/panel-item/panel-item-state.d.ts +48 -0
  337. package/out/controller/state/control/panel/panel-item/panel-item-state.d.ts.map +1 -0
  338. package/out/controller/state/control/panel/panel-item/panel-item-state.js +59 -0
  339. package/out/controller/state/control/panel/panel-item/panel-raw-item-state.d.ts +13 -0
  340. package/out/controller/state/control/panel/panel-item/panel-raw-item-state.d.ts.map +1 -0
  341. package/out/controller/state/control/panel/panel-item/panel-raw-item-state.js +12 -0
  342. package/out/controller/state/control/panel/panel-item/panel-tab-page-state.d.ts +11 -0
  343. package/out/controller/state/control/panel/panel-item/panel-tab-page-state.d.ts.map +1 -0
  344. package/out/controller/state/control/panel/panel-item/panel-tab-page-state.js +10 -0
  345. package/out/controller/state/control/panel/panel-item/panel-tab-panel-state.d.ts +11 -0
  346. package/out/controller/state/control/panel/panel-item/panel-tab-panel-state.d.ts.map +1 -0
  347. package/out/controller/state/control/panel/panel-item/panel-tab-panel-state.js +10 -0
  348. package/out/controller/state/control/portlet/portlet-part-state.d.ts +25 -0
  349. package/out/controller/state/control/portlet/portlet-part-state.d.ts.map +1 -0
  350. package/out/controller/state/control/portlet/portlet-part-state.js +32 -0
  351. package/out/controller/state/control/wizard-panel-state.d.ts +13 -0
  352. package/out/controller/state/control/wizard-panel-state.d.ts.map +1 -0
  353. package/out/controller/state/control/wizard-panel-state.js +15 -0
  354. package/out/controller/state/view/dataview-view-state.d.ts +11 -0
  355. package/out/controller/state/view/dataview-view-state.d.ts.map +1 -0
  356. package/out/controller/state/view/dataview-view-state.js +10 -0
  357. package/out/controller/state/view/grid-exp-view-state.d.ts +8 -1
  358. package/out/controller/state/view/grid-exp-view-state.d.ts.map +1 -1
  359. package/out/controller/state/view/grid-exp-view-state.js +1 -1
  360. package/out/controller/state/view/index.d.ts +4 -0
  361. package/out/controller/state/view/index.d.ts.map +1 -1
  362. package/out/controller/state/view/index.js +4 -0
  363. package/out/controller/state/view/kanban-view-state.d.ts +11 -0
  364. package/out/controller/state/view/kanban-view-state.d.ts.map +1 -0
  365. package/out/controller/state/view/kanban-view-state.js +10 -0
  366. package/out/controller/state/view/list-exp-view-state.d.ts +24 -0
  367. package/out/controller/state/view/list-exp-view-state.d.ts.map +1 -0
  368. package/out/controller/state/view/list-exp-view-state.js +19 -0
  369. package/out/controller/state/view/list-view-state.d.ts +11 -0
  370. package/out/controller/state/view/list-view-state.d.ts.map +1 -0
  371. package/out/controller/state/view/list-view-state.js +10 -0
  372. package/out/controller/state/view/tree-exp-view-state.d.ts +22 -0
  373. package/out/controller/state/view/tree-exp-view-state.d.ts.map +1 -1
  374. package/out/controller/state/view/tree-exp-view-state.js +17 -0
  375. package/out/controller/utils/button-state/button-state.d.ts +2 -2
  376. package/out/controller/utils/button-state/button-state.d.ts.map +1 -1
  377. package/out/controller/utils/button-state/button-state.js +6 -1
  378. package/out/controller/utils/index.d.ts +1 -0
  379. package/out/controller/utils/index.d.ts.map +1 -1
  380. package/out/controller/utils/index.js +1 -0
  381. package/out/controller/utils/layout-helper/layout-helper.d.ts +24 -0
  382. package/out/controller/utils/layout-helper/layout-helper.d.ts.map +1 -0
  383. package/out/controller/utils/layout-helper/layout-helper.js +84 -0
  384. package/out/controller/utils/value-rule/value-rule.js +2 -2
  385. package/out/controller/view/dataview-view.d.ts +36 -0
  386. package/out/controller/view/dataview-view.d.ts.map +1 -0
  387. package/out/controller/view/dataview-view.js +51 -0
  388. package/out/controller/view/edit-view.d.ts +0 -1
  389. package/out/controller/view/edit-view.d.ts.map +1 -1
  390. package/out/controller/view/edit-view.js +0 -9
  391. package/out/controller/view/grid-exp-view.d.ts +0 -8
  392. package/out/controller/view/grid-exp-view.d.ts.map +1 -1
  393. package/out/controller/view/grid-exp-view.js +54 -64
  394. package/out/controller/view/index.d.ts +5 -0
  395. package/out/controller/view/index.d.ts.map +1 -1
  396. package/out/controller/view/index.js +5 -0
  397. package/out/controller/view/kanban-view.d.ts +34 -0
  398. package/out/controller/view/kanban-view.d.ts.map +1 -0
  399. package/out/controller/view/kanban-view.js +49 -0
  400. package/out/controller/view/list-exp-view.d.ts +44 -0
  401. package/out/controller/view/list-exp-view.d.ts.map +1 -0
  402. package/out/controller/view/list-exp-view.js +139 -0
  403. package/out/controller/view/list-view.d.ts +34 -0
  404. package/out/controller/view/list-view.d.ts.map +1 -0
  405. package/out/controller/view/list-view.js +49 -0
  406. package/out/controller/view/md-view.d.ts +0 -27
  407. package/out/controller/view/md-view.d.ts.map +1 -1
  408. package/out/controller/view/md-view.js +1 -28
  409. package/out/controller/view/opt-view.js +1 -1
  410. package/out/controller/view/pickup-grid-view.js +1 -1
  411. package/out/controller/view/tree-exp-view.d.ts.map +1 -1
  412. package/out/controller/view/tree-exp-view.js +17 -21
  413. package/out/controller/view/view.d.ts.map +1 -1
  414. package/out/controller/view/view.js +15 -4
  415. package/out/controller/view/wizard-view.d.ts +33 -0
  416. package/out/controller/view/wizard-view.d.ts.map +1 -0
  417. package/out/controller/view/wizard-view.js +47 -0
  418. package/out/de-logic/de-logic-context.d.ts +28 -0
  419. package/out/de-logic/de-logic-context.d.ts.map +1 -0
  420. package/out/de-logic/de-logic-context.js +29 -0
  421. package/out/de-logic/de-logic-link/de-logic-link-cond/de-logic-link-cond.d.ts +11 -0
  422. package/out/de-logic/de-logic-link/de-logic-link-cond/de-logic-link-cond.d.ts.map +1 -0
  423. package/out/de-logic/de-logic-link/de-logic-link-cond/de-logic-link-cond.js +10 -0
  424. package/out/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.d.ts +58 -0
  425. package/out/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.d.ts.map +1 -0
  426. package/out/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.js +79 -0
  427. package/out/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.d.ts +48 -0
  428. package/out/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.d.ts.map +1 -0
  429. package/out/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.js +65 -0
  430. package/out/de-logic/de-logic-link/de-logic-link.d.ts +59 -0
  431. package/out/de-logic/de-logic-link/de-logic-link.d.ts.map +1 -0
  432. package/out/de-logic/de-logic-link/de-logic-link.js +67 -0
  433. package/out/de-logic/de-logic-node/bind-param-node/bind-param-node.d.ts +15 -0
  434. package/out/de-logic/de-logic-node/bind-param-node/bind-param-node.d.ts.map +1 -0
  435. package/out/de-logic/de-logic-node/bind-param-node/bind-param-node.js +25 -0
  436. package/out/de-logic/de-logic-node/data-set-node/data-set-node.d.ts +15 -0
  437. package/out/de-logic/de-logic-node/data-set-node/data-set-node.d.ts.map +1 -0
  438. package/out/de-logic/de-logic-node/data-set-node/data-set-node.js +29 -0
  439. package/out/de-logic/de-logic-node/de-action-node/de-action-node.d.ts +15 -0
  440. package/out/de-logic/de-logic-node/de-action-node/de-action-node.d.ts.map +1 -0
  441. package/out/de-logic/de-logic-node/de-action-node/de-action-node.js +36 -0
  442. package/out/de-logic/de-logic-node/de-logic-node.d.ts +43 -0
  443. package/out/de-logic/de-logic-node/de-logic-node.d.ts.map +1 -0
  444. package/out/de-logic/de-logic-node/de-logic-node.js +22 -0
  445. package/out/de-logic/de-logic-node/end-node/end-node.d.ts +15 -0
  446. package/out/de-logic/de-logic-node/end-node/end-node.d.ts.map +1 -0
  447. package/out/de-logic/de-logic-node/end-node/end-node.js +37 -0
  448. package/out/de-logic/de-logic-node/index.d.ts +8 -0
  449. package/out/de-logic/de-logic-node/index.d.ts.map +1 -0
  450. package/out/de-logic/de-logic-node/index.js +7 -0
  451. package/out/de-logic/de-logic-node/prepare-param-node/prepare-param-node.d.ts +15 -0
  452. package/out/de-logic/de-logic-node/prepare-param-node/prepare-param-node.d.ts.map +1 -0
  453. package/out/de-logic/de-logic-node/prepare-param-node/prepare-param-node.js +15 -0
  454. package/out/de-logic/de-logic-node/start-node/start-node.d.ts +15 -0
  455. package/out/de-logic/de-logic-node/start-node/start-node.d.ts.map +1 -0
  456. package/out/de-logic/de-logic-node/start-node/start-node.js +15 -0
  457. package/out/de-logic/de-logic-node/throw-exception-node/throw-exception-node.d.ts +15 -0
  458. package/out/de-logic/de-logic-node/throw-exception-node/throw-exception-node.d.ts.map +1 -0
  459. package/out/de-logic/de-logic-node/throw-exception-node/throw-exception-node.js +23 -0
  460. package/out/de-logic/de-logic-param/de-logic-param.d.ts +33 -0
  461. package/out/de-logic/de-logic-param/de-logic-param.d.ts.map +1 -0
  462. package/out/de-logic/de-logic-param/de-logic-param.js +93 -0
  463. package/out/de-logic/de-logic.d.ts +79 -0
  464. package/out/de-logic/de-logic.d.ts.map +1 -0
  465. package/out/de-logic/de-logic.js +157 -0
  466. package/out/de-logic/index.d.ts +17 -0
  467. package/out/de-logic/index.d.ts.map +1 -0
  468. package/out/de-logic/index.js +38 -0
  469. package/out/interface/i-global-config/i-global-config.d.ts +31 -0
  470. package/out/interface/i-global-config/i-global-config.d.ts.map +1 -1
  471. package/out/interface/i-plugin-factory/i-plugin-factory.d.ts +31 -4
  472. package/out/interface/i-plugin-factory/i-plugin-factory.d.ts.map +1 -1
  473. package/out/interface/i-plugin-item/i-plugin-item.d.ts +28 -0
  474. package/out/interface/i-plugin-item/i-plugin-item.d.ts.map +1 -0
  475. package/out/interface/i-plugin-item/i-plugin-item.js +1 -0
  476. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts +17 -0
  477. package/out/interface/i-ui-action-result/i-ui-action-result.d.ts.map +1 -1
  478. package/out/interface/index.d.ts +1 -0
  479. package/out/interface/index.d.ts.map +1 -1
  480. package/out/model.d.ts.map +1 -1
  481. package/out/model.js +7 -1
  482. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts +12 -3
  483. package/out/plugin/remote-plugin-item/remote-plugin-item.d.ts.map +1 -1
  484. package/out/plugin/remote-plugin-item/remote-plugin-item.js +5 -3
  485. package/out/register/register-center.d.ts +10 -1
  486. package/out/register/register-center.d.ts.map +1 -1
  487. package/out/register/register-center.js +10 -1
  488. package/out/service/authority/authority.service.d.ts +3 -12
  489. package/out/service/authority/authority.service.d.ts.map +1 -1
  490. package/out/service/authority/authority.service.js +20 -27
  491. package/out/service/dto/method.dto.d.ts +3 -3
  492. package/out/service/dto/method.dto.d.ts.map +1 -1
  493. package/out/service/dto/method.dto.js +22 -22
  494. package/out/service/entity/entity.d.ts +9 -0
  495. package/out/service/entity/entity.d.ts.map +1 -1
  496. package/out/service/entity/entity.js +11 -2
  497. package/out/service/interface/i-tree-node-data/i-tree-node-data.d.ts +8 -0
  498. package/out/service/interface/i-tree-node-data/i-tree-node-data.d.ts.map +1 -1
  499. package/out/service/service/entity/method/de-action.d.ts.map +1 -1
  500. package/out/service/service/entity/method/de-action.js +13 -5
  501. package/out/service/service/entity/method/method-renturn.js +2 -2
  502. package/out/service/service/entity/method/method.d.ts +1 -1
  503. package/out/service/service/entity/method/method.d.ts.map +1 -1
  504. package/out/service/service/entity/method/method.js +28 -25
  505. package/out/service/service/widget/control-service.d.ts +1 -1
  506. package/out/service/service/widget/control-service.d.ts.map +1 -1
  507. package/out/service/service/widget/control-service.js +2 -2
  508. package/out/service/service/widget/dataview-service.d.ts +12 -0
  509. package/out/service/service/widget/dataview-service.d.ts.map +1 -0
  510. package/out/service/service/widget/dataview-service.js +34 -0
  511. package/out/service/service/widget/edit-form-service.d.ts +10 -0
  512. package/out/service/service/widget/edit-form-service.d.ts.map +1 -1
  513. package/out/service/service/widget/edit-form-service.js +27 -7
  514. package/out/service/service/widget/index.d.ts +3 -0
  515. package/out/service/service/widget/index.d.ts.map +1 -1
  516. package/out/service/service/widget/index.js +3 -0
  517. package/out/service/service/widget/kanban-service.d.ts +12 -0
  518. package/out/service/service/widget/kanban-service.d.ts.map +1 -0
  519. package/out/service/service/widget/kanban-service.js +34 -0
  520. package/out/service/service/widget/md-control-service.d.ts.map +1 -1
  521. package/out/service/service/widget/md-control-service.js +3 -3
  522. package/out/service/service/widget/tree-service.d.ts +5 -2
  523. package/out/service/service/widget/tree-service.d.ts.map +1 -1
  524. package/out/service/service/widget/tree-service.js +31 -14
  525. package/out/service/service/widget/wizard-panel-service.d.ts +37 -0
  526. package/out/service/service/widget/wizard-panel-service.d.ts.map +1 -0
  527. package/out/service/service/widget/wizard-panel-service.js +42 -0
  528. package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
  529. package/out/service/utils/dynamic-code-list/dynamic-code-list.js +5 -2
  530. package/out/service/utils/index.d.ts +0 -1
  531. package/out/service/utils/index.d.ts.map +1 -1
  532. package/out/service/utils/index.js +0 -1
  533. package/out/service/utils/route-context/route-context.d.ts +9 -1
  534. package/out/service/utils/route-context/route-context.d.ts.map +1 -1
  535. package/out/service/utils/route-context/route-context.js +31 -1
  536. package/out/service/vo/control.vo.d.ts.map +1 -1
  537. package/out/service/vo/control.vo.js +2 -1
  538. package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts +3 -3
  539. package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
  540. package/out/service/vo/tree-node-data/tree-data-set-node-data.js +8 -4
  541. package/out/service/vo/tree-node-data/tree-node-data.d.ts +11 -3
  542. package/out/service/vo/tree-node-data/tree-node-data.d.ts.map +1 -1
  543. package/out/service/vo/tree-node-data/tree-node-data.js +8 -1
  544. package/out/service/vo/tree-node-data/tree-static-node-data.d.ts +4 -3
  545. package/out/service/vo/tree-node-data/tree-static-node-data.d.ts.map +1 -1
  546. package/out/service/vo/tree-node-data/tree-static-node-data.js +16 -4
  547. package/out/ui-logic/index.d.ts +17 -0
  548. package/out/ui-logic/index.d.ts.map +1 -0
  549. package/out/ui-logic/index.js +29 -0
  550. package/out/ui-logic/ui-logic-context.d.ts +28 -0
  551. package/out/ui-logic/ui-logic-context.d.ts.map +1 -0
  552. package/out/ui-logic/ui-logic-context.js +29 -0
  553. package/out/ui-logic/ui-logic-link/ui-logic-link-cond/ui-logic-link-cond.d.ts +11 -0
  554. package/out/ui-logic/ui-logic-link/ui-logic-link-cond/ui-logic-link-cond.d.ts.map +1 -0
  555. package/out/ui-logic/ui-logic-link/ui-logic-link-cond/ui-logic-link-cond.js +10 -0
  556. package/out/ui-logic/ui-logic-link/ui-logic-link-group-cond/ui-logic-link-group-cond.d.ts +58 -0
  557. package/out/ui-logic/ui-logic-link/ui-logic-link-group-cond/ui-logic-link-group-cond.d.ts.map +1 -0
  558. package/out/ui-logic/ui-logic-link/ui-logic-link-group-cond/ui-logic-link-group-cond.js +79 -0
  559. package/out/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.d.ts +48 -0
  560. package/out/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.d.ts.map +1 -0
  561. package/out/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.js +65 -0
  562. package/out/ui-logic/ui-logic-link/ui-logic-link.d.ts +61 -0
  563. package/out/ui-logic/ui-logic-link/ui-logic-link.d.ts.map +1 -0
  564. package/out/ui-logic/ui-logic-link/ui-logic-link.js +86 -0
  565. package/out/ui-logic/ui-logic-node/de-action-node/de-action-node.d.ts +16 -0
  566. package/out/ui-logic/ui-logic-node/de-action-node/de-action-node.d.ts.map +1 -0
  567. package/out/ui-logic/ui-logic-node/de-action-node/de-action-node.js +36 -0
  568. package/out/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.d.ts +16 -0
  569. package/out/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.d.ts.map +1 -0
  570. package/out/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.js +33 -0
  571. package/out/ui-logic/ui-logic-node/end-node/end-node.d.ts +16 -0
  572. package/out/ui-logic/ui-logic-node/end-node/end-node.d.ts.map +1 -0
  573. package/out/ui-logic/ui-logic-node/end-node/end-node.js +32 -0
  574. package/out/ui-logic/ui-logic-node/index.d.ts +7 -0
  575. package/out/ui-logic/ui-logic-node/index.d.ts.map +1 -0
  576. package/out/ui-logic/ui-logic-node/index.js +6 -0
  577. package/out/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.d.ts +16 -0
  578. package/out/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.d.ts.map +1 -0
  579. package/out/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.js +15 -0
  580. package/out/ui-logic/ui-logic-node/start-node/start-node.d.ts +16 -0
  581. package/out/ui-logic/ui-logic-node/start-node/start-node.d.ts.map +1 -0
  582. package/out/ui-logic/ui-logic-node/start-node/start-node.js +15 -0
  583. package/out/ui-logic/ui-logic-node/ui-logic-node.d.ts +44 -0
  584. package/out/ui-logic/ui-logic-node/ui-logic-node.d.ts.map +1 -0
  585. package/out/ui-logic/ui-logic-node/ui-logic-node.js +22 -0
  586. package/out/ui-logic/ui-logic-param/ui-logic-param.d.ts +34 -0
  587. package/out/ui-logic/ui-logic-param/ui-logic-param.d.ts.map +1 -0
  588. package/out/ui-logic/ui-logic-param/ui-logic-param.js +94 -0
  589. package/out/ui-logic/ui-logic.d.ts +80 -0
  590. package/out/ui-logic/ui-logic.d.ts.map +1 -0
  591. package/out/ui-logic/ui-logic.js +163 -0
  592. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.d.ts.map +1 -1
  593. package/out/utils/app-de-ui-action-util/handler/backend-ui-action-handler.js +9 -2
  594. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts +1 -1
  595. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.d.ts.map +1 -1
  596. package/out/utils/app-de-ui-action-util/handler/front-ui-action-handler.js +19 -6
  597. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts +0 -9
  598. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts.map +1 -1
  599. package/out/utils/app-de-ui-action-util/handler/ui-action-handler.js +26 -31
  600. package/out/utils/index.d.ts +1 -0
  601. package/out/utils/index.d.ts.map +1 -1
  602. package/out/utils/index.js +1 -0
  603. package/out/utils/nav-params/nav-params.d.ts +1 -1
  604. package/out/utils/nav-params/nav-params.d.ts.map +1 -1
  605. package/out/utils/nav-params/nav-params.js +5 -0
  606. package/out/utils/open-redirect-view/open-redirect-view.d.ts +13 -1
  607. package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
  608. package/out/utils/open-redirect-view/open-redirect-view.js +72 -2
  609. package/out/utils/verify/de-rule-verify.d.ts +15 -0
  610. package/out/utils/verify/de-rule-verify.d.ts.map +1 -0
  611. package/out/utils/verify/de-rule-verify.js +379 -0
  612. package/out/utils/verify/form-dynamic-logic.d.ts +12 -0
  613. package/out/utils/verify/form-dynamic-logic.d.ts.map +1 -0
  614. package/out/utils/verify/form-dynamic-logic.js +51 -0
  615. package/out/utils/verify/index.d.ts +5 -0
  616. package/out/utils/verify/index.d.ts.map +1 -0
  617. package/out/utils/verify/index.js +4 -0
  618. package/out/utils/verify/panel-dynamic-logic.d.ts +12 -0
  619. package/out/utils/verify/panel-dynamic-logic.d.ts.map +1 -0
  620. package/out/utils/verify/panel-dynamic-logic.js +51 -0
  621. package/out/utils/verify/verify.d.ts +60 -0
  622. package/out/utils/verify/verify.d.ts.map +1 -0
  623. package/out/utils/verify/verify.js +179 -0
  624. package/package.json +6 -6
  625. package/src/config/global-config.ts +6 -0
  626. package/src/controller/constant/control/index.ts +1 -0
  627. package/src/controller/constant/control/panel/panel-notify-state.ts +6 -0
  628. package/src/controller/control/control.ts +8 -0
  629. package/src/controller/control/dataview.ts +333 -0
  630. package/src/controller/control/form/edit-form.ts +29 -1
  631. package/src/controller/control/form/form-button.ts +4 -1
  632. package/src/controller/control/form/form-detail.ts +41 -27
  633. package/src/controller/control/form/form-druipart.ts +4 -4
  634. package/src/controller/control/form/form-item.ts +7 -4
  635. package/src/controller/control/form/form.ts +25 -11
  636. package/src/controller/control/form/search-form.ts +2 -2
  637. package/src/controller/control/grid/grid-field-column.ts +8 -2
  638. package/src/controller/control/grid/grid-row.ts +13 -13
  639. package/src/controller/control/grid/grid-ua-column.ts +23 -9
  640. package/src/controller/control/grid/grid.ts +35 -43
  641. package/src/controller/control/index.ts +4 -0
  642. package/src/controller/control/kanban.ts +364 -0
  643. package/src/controller/control/list.ts +240 -2
  644. package/src/controller/control/md/index.ts +2 -0
  645. package/src/controller/control/md/md-item.ts +30 -0
  646. package/src/controller/control/{md.ts → md/md.ts} +74 -75
  647. package/src/controller/control/panel/index.ts +9 -0
  648. package/src/controller/control/panel/layout-panel.ts +257 -0
  649. package/src/controller/control/panel/panel-button.ts +87 -0
  650. package/src/controller/control/panel/panel-container.ts +18 -0
  651. package/src/controller/control/panel/panel-field.ts +111 -0
  652. package/src/controller/control/panel/panel-item.ts +187 -0
  653. package/src/controller/control/panel/panel-raw-item.ts +20 -0
  654. package/src/controller/control/panel/panel-tab-page.ts +18 -0
  655. package/src/controller/control/panel/panel-tab-panel.ts +18 -0
  656. package/src/controller/control/panel/view-layout-panel.ts +26 -0
  657. package/src/controller/control/portlet/portlet-part.ts +79 -24
  658. package/src/controller/control/portlet/view-portlet.ts +22 -1
  659. package/src/controller/control/tree.ts +11 -11
  660. package/src/controller/control/wizard-panel.ts +222 -0
  661. package/src/controller/editor/autocomplete.ts +138 -0
  662. package/src/controller/editor/check-box.ts +11 -0
  663. package/src/controller/editor/code-list-editor.ts +5 -1
  664. package/src/controller/editor/editor.ts +29 -16
  665. package/src/controller/editor/index.ts +9 -0
  666. package/src/controller/editor/list-box-picker.ts +78 -0
  667. package/src/controller/editor/list-box.ts +10 -0
  668. package/src/controller/editor/picker.ts +39 -10
  669. package/src/controller/editor/rate.ts +11 -0
  670. package/src/controller/editor/raw.ts +11 -0
  671. package/src/controller/editor/slider.ts +11 -0
  672. package/src/controller/editor/stepper.ts +11 -0
  673. package/src/controller/editor/switch.ts +11 -0
  674. package/src/controller/interface/ability/control/i-dataview-ability.ts +21 -0
  675. package/src/controller/interface/ability/control/i-edit-form-ability.ts +9 -0
  676. package/src/controller/interface/ability/control/i-kanban-ability.ts +12 -0
  677. package/src/controller/interface/ability/control/i-layout-panel-ability.ts +11 -0
  678. package/src/controller/interface/ability/control/i-view-layout-panel-ability.ts +11 -0
  679. package/src/controller/interface/ability/control/i-wizard-panel-ability.ts +20 -0
  680. package/src/controller/interface/ability/control/index.ts +5 -0
  681. package/src/controller/interface/ability/view/i-dataview-view-ability.ts +20 -0
  682. package/src/controller/interface/ability/view/i-kanban-view-ability.ts +20 -0
  683. package/src/controller/interface/ability/view/i-list-exp-view-ability.ts +20 -0
  684. package/src/controller/interface/ability/view/i-list-view-ability.ts +20 -0
  685. package/src/controller/interface/ability/view/i-wizard-view-ability.ts +12 -0
  686. package/src/controller/interface/ability/view/index.ts +5 -0
  687. package/src/controller/interface/common/button-state/i-button-state.ts +1 -1
  688. package/src/controller/interface/controller/layout/i-layout-controller.ts +10 -0
  689. package/src/controller/interface/event/control/i-dataview-event.ts +11 -0
  690. package/src/controller/interface/event/control/i-kanban-event.ts +11 -0
  691. package/src/controller/interface/event/control/i-layout-panel-event.ts +11 -0
  692. package/src/controller/interface/event/control/i-md-control-event.ts +12 -0
  693. package/src/controller/interface/event/control/i-view-layout-panel-event.ts +11 -0
  694. package/src/controller/interface/event/control/i-wizard-panel-event.ts +20 -0
  695. package/src/controller/interface/event/control/index.ts +5 -0
  696. package/src/controller/interface/event/view/i-dataview-view-event.ts +12 -0
  697. package/src/controller/interface/event/view/i-kanban-view-event.ts +12 -0
  698. package/src/controller/interface/event/view/i-list-exp-view-event.ts +10 -0
  699. package/src/controller/interface/event/view/i-list-view-event.ts +12 -0
  700. package/src/controller/interface/event/view/i-wizard-view-event.ts +12 -0
  701. package/src/controller/interface/event/view/index.ts +5 -0
  702. package/src/controller/interface/provider/i-panel-item-provider.ts +37 -0
  703. package/src/controller/interface/provider/index.ts +1 -0
  704. package/src/controller/interface/register/i-panel-item-register.ts +24 -0
  705. package/src/controller/interface/register/i-view-register.ts +2 -2
  706. package/src/controller/interface/register/index.ts +1 -0
  707. package/src/controller/neuron/nerve/control/daraview-nerve.ts +28 -0
  708. package/src/controller/neuron/nerve/control/edit-form-nerve.ts +1 -0
  709. package/src/controller/neuron/nerve/control/index.ts +5 -0
  710. package/src/controller/neuron/nerve/control/kanban-nerve.ts +21 -0
  711. package/src/controller/neuron/nerve/control/layout-panel-nerve.ts +27 -0
  712. package/src/controller/neuron/nerve/control/view-layout-panel-nerve.ts +27 -0
  713. package/src/controller/neuron/nerve/control/wizard-panel-nerve.ts +55 -0
  714. package/src/controller/neuron/nerve/view/dataview-view-nerve.ts +70 -0
  715. package/src/controller/neuron/nerve/view/grid-exp-view-nerve.ts +4 -0
  716. package/src/controller/neuron/nerve/view/index.ts +5 -0
  717. package/src/controller/neuron/nerve/view/kanban-view-nerve.ts +74 -0
  718. package/src/controller/neuron/nerve/view/list-exp-view-nerve.ts +86 -0
  719. package/src/controller/neuron/nerve/view/list-view-nerve.ts +70 -0
  720. package/src/controller/neuron/nerve/view/wizard-view-nerve.ts +42 -0
  721. package/src/controller/neuron/neuron/view.ts +27 -0
  722. package/src/controller/neuron/neuron/widget.ts +24 -0
  723. package/src/controller/register/control-register.ts +5 -0
  724. package/src/controller/register/editor-register.ts +6 -0
  725. package/src/controller/register/index.ts +1 -0
  726. package/src/controller/register/panel-item-register.ts +38 -0
  727. package/src/controller/register/view-register.ts +14 -14
  728. package/src/controller/state/control/dataview-state.ts +23 -0
  729. package/src/controller/state/control/form/form-detail/form-detail-state.ts +31 -22
  730. package/src/controller/state/control/form/form-detail/form-item-state.ts +16 -18
  731. package/src/controller/state/control/form/form-detail/form-page-state.ts +1 -13
  732. package/src/controller/state/control/form/form-state.ts +9 -0
  733. package/src/controller/state/control/index.ts +16 -0
  734. package/src/controller/state/control/kanban-state.ts +23 -0
  735. package/src/controller/state/control/list-state.ts +23 -0
  736. package/src/controller/state/control/panel/layout-panel-state.ts +22 -0
  737. package/src/controller/state/control/panel/panel-item/panel-button-state.ts +12 -0
  738. package/src/controller/state/control/panel/panel-item/panel-container-state.ts +12 -0
  739. package/src/controller/state/control/panel/panel-item/panel-field-state.ts +21 -0
  740. package/src/controller/state/control/panel/panel-item/panel-item-state.ts +72 -0
  741. package/src/controller/state/control/panel/panel-item/panel-raw-item-state.ts +12 -0
  742. package/src/controller/state/control/panel/panel-item/panel-tab-page-state.ts +10 -0
  743. package/src/controller/state/control/panel/panel-item/panel-tab-panel-state.ts +10 -0
  744. package/src/controller/state/control/portlet/portlet-part-state.ts +33 -0
  745. package/src/controller/state/control/wizard-panel-state.ts +13 -0
  746. package/src/controller/state/view/dataview-view-state.ts +10 -0
  747. package/src/controller/state/view/grid-exp-view-state.ts +8 -1
  748. package/src/controller/state/view/index.ts +4 -0
  749. package/src/controller/state/view/kanban-view-state.ts +10 -0
  750. package/src/controller/state/view/list-exp-view-state.ts +24 -0
  751. package/src/controller/state/view/list-view-state.ts +10 -0
  752. package/src/controller/state/view/tree-exp-view-state.ts +25 -1
  753. package/src/controller/utils/button-state/button-state.ts +8 -3
  754. package/src/controller/utils/index.ts +1 -0
  755. package/src/controller/utils/layout-helper/layout-helper.ts +86 -0
  756. package/src/controller/utils/value-rule/value-rule.ts +3 -3
  757. package/src/controller/view/dataview-view.ts +56 -0
  758. package/src/controller/view/edit-view.ts +0 -10
  759. package/src/controller/view/grid-exp-view.ts +55 -79
  760. package/src/controller/view/index.ts +5 -0
  761. package/src/controller/view/kanban-view.ts +54 -0
  762. package/src/controller/view/list-exp-view.ts +155 -0
  763. package/src/controller/view/list-view.ts +54 -0
  764. package/src/controller/view/md-view.ts +1 -31
  765. package/src/controller/view/opt-view.ts +1 -1
  766. package/src/controller/view/pickup-grid-view.ts +1 -1
  767. package/src/controller/view/tree-exp-view.ts +25 -38
  768. package/src/controller/view/view.ts +26 -7
  769. package/src/controller/view/wizard-view.ts +59 -0
  770. package/src/de-logic/de-logic-context.ts +28 -0
  771. package/src/de-logic/de-logic-link/de-logic-link-cond/de-logic-link-cond.ts +9 -0
  772. package/src/de-logic/de-logic-link/de-logic-link-group-cond/de-logic-link-group-cond.ts +97 -0
  773. package/src/de-logic/de-logic-link/de-logic-link-single-cond/de-logic-link-single-cond.ts +96 -0
  774. package/src/de-logic/de-logic-link/de-logic-link.ts +80 -0
  775. package/src/de-logic/de-logic-node/bind-param-node/bind-param-node.ts +33 -0
  776. package/src/de-logic/de-logic-node/data-set-node/data-set-node.ts +42 -0
  777. package/src/de-logic/de-logic-node/de-action-node/de-action-node.ts +49 -0
  778. package/src/de-logic/de-logic-node/de-logic-node.ts +52 -0
  779. package/src/de-logic/de-logic-node/end-node/end-node.ts +49 -0
  780. package/src/de-logic/de-logic-node/index.ts +7 -0
  781. package/src/de-logic/de-logic-node/prepare-param-node/prepare-param-node.ts +23 -0
  782. package/src/de-logic/de-logic-node/start-node/start-node.ts +23 -0
  783. package/src/de-logic/de-logic-node/throw-exception-node/throw-exception-node.ts +32 -0
  784. package/src/de-logic/de-logic-param/de-logic-param.ts +90 -0
  785. package/src/de-logic/de-logic.ts +190 -0
  786. package/src/de-logic/index.ts +45 -0
  787. package/src/interface/i-global-config/i-global-config.ts +34 -0
  788. package/src/interface/i-plugin-factory/i-plugin-factory.ts +31 -4
  789. package/src/interface/i-plugin-item/i-plugin-item.ts +27 -0
  790. package/src/interface/i-ui-action-result/i-ui-action-result.ts +20 -0
  791. package/src/interface/index.ts +1 -0
  792. package/src/model.ts +21 -1
  793. package/src/plugin/remote-plugin-item/remote-plugin-item.ts +14 -3
  794. package/src/register/register-center.ts +12 -0
  795. package/src/service/authority/authority.service.ts +31 -32
  796. package/src/service/dto/method.dto.ts +25 -23
  797. package/src/service/entity/entity.ts +12 -2
  798. package/src/service/interface/i-tree-node-data/i-tree-node-data.ts +9 -0
  799. package/src/service/service/entity/method/de-action.ts +16 -5
  800. package/src/service/service/entity/method/method-renturn.ts +2 -2
  801. package/src/service/service/entity/method/method.ts +33 -26
  802. package/src/service/service/widget/control-service.ts +7 -1
  803. package/src/service/service/widget/dataview-service.ts +34 -0
  804. package/src/service/service/widget/edit-form-service.ts +45 -7
  805. package/src/service/service/widget/index.ts +3 -0
  806. package/src/service/service/widget/kanban-service.ts +34 -0
  807. package/src/service/service/widget/md-control-service.ts +13 -3
  808. package/src/service/service/widget/tree-service.ts +55 -21
  809. package/src/service/service/widget/wizard-panel-service.ts +56 -0
  810. package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +6 -2
  811. package/src/service/utils/index.ts +0 -1
  812. package/src/service/utils/route-context/route-context.ts +33 -0
  813. package/src/service/vo/control.vo.ts +4 -1
  814. package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +11 -5
  815. package/src/service/vo/tree-node-data/tree-node-data.ts +20 -2
  816. package/src/service/vo/tree-node-data/tree-static-node-data.ts +21 -5
  817. package/src/ui-logic/index.ts +38 -0
  818. package/src/ui-logic/ui-logic-context.ts +28 -0
  819. package/src/ui-logic/ui-logic-link/ui-logic-link-cond/ui-logic-link-cond.ts +9 -0
  820. package/src/ui-logic/ui-logic-link/ui-logic-link-group-cond/ui-logic-link-group-cond.ts +97 -0
  821. package/src/ui-logic/ui-logic-link/ui-logic-link-single-cond/ui-logic-link-single-cond.ts +96 -0
  822. package/src/ui-logic/ui-logic-link/ui-logic-link.ts +112 -0
  823. package/src/ui-logic/ui-logic-node/de-action-node/de-action-node.ts +50 -0
  824. package/src/ui-logic/ui-logic-node/de-ui-action-node/de-ui-action-node.ts +52 -0
  825. package/src/ui-logic/ui-logic-node/end-node/end-node.ts +44 -0
  826. package/src/ui-logic/ui-logic-node/index.ts +6 -0
  827. package/src/ui-logic/ui-logic-node/prepare-js-param-node/prepare-js-param-node.ts +24 -0
  828. package/src/ui-logic/ui-logic-node/start-node/start-node.ts +24 -0
  829. package/src/ui-logic/ui-logic-node/ui-logic-node.ts +53 -0
  830. package/src/ui-logic/ui-logic-param/ui-logic-param.ts +86 -0
  831. package/src/ui-logic/ui-logic.ts +197 -0
  832. package/src/utils/app-de-ui-action-util/handler/backend-ui-action-handler.ts +16 -2
  833. package/src/utils/app-de-ui-action-util/handler/front-ui-action-handler.ts +27 -9
  834. package/src/utils/app-de-ui-action-util/handler/ui-action-handler.ts +40 -34
  835. package/src/utils/index.ts +1 -0
  836. package/src/utils/nav-params/nav-params.ts +7 -1
  837. package/src/utils/open-redirect-view/open-redirect-view.ts +106 -2
  838. package/src/utils/verify/de-rule-verify.ts +512 -0
  839. package/src/utils/verify/form-dynamic-logic.ts +69 -0
  840. package/src/utils/verify/index.ts +4 -0
  841. package/src/utils/verify/panel-dynamic-logic.ts +73 -0
  842. package/src/utils/verify/verify.ts +201 -0
  843. package/out/controller/control/md.d.ts.map +0 -1
  844. package/out/service/utils/ibiz-verify/ibiz-verify.d.ts +0 -209
  845. package/out/service/utils/ibiz-verify/ibiz-verify.d.ts.map +0 -1
  846. package/out/service/utils/ibiz-verify/ibiz-verify.js +0 -653
  847. package/src/service/utils/ibiz-verify/ibiz-verify.ts +0 -795
@@ -1 +1 @@
1
- System.register(["@ibiz-template/core","@ibiz-template/model","qx-util","ramda","async-validator","dayjs","qs"],(function(exports){"use strict";var RuntimeError,NOOP,pluralLower,HttpResponse,MenuPermissionMode,IBizContext,debounceAndMerge,isOverlap,downloadFileFromBlob,debounceAndAsyncMerge,Net,DefectModelError,AppEntityModel,UnsupportedModelError,getPSUIActionByModelObject,ModelUtil,ModelConst,ModelObject,clearAll,QXEvent,notNilEmpty,createUUID,isNilOrEmpty,ascSort,descSort,isArray,clone,isEmpty,isNil,equals,where,Schema,dayjs,qs;return{setters:[function(t){RuntimeError=t.RuntimeError,NOOP=t.NOOP,pluralLower=t.pluralLower,HttpResponse=t.HttpResponse,MenuPermissionMode=t.MenuPermissionMode,IBizContext=t.IBizContext,debounceAndMerge=t.debounceAndMerge,isOverlap=t.isOverlap,downloadFileFromBlob=t.downloadFileFromBlob,debounceAndAsyncMerge=t.debounceAndAsyncMerge,Net=t.Net},function(t){DefectModelError=t.DefectModelError,AppEntityModel=t.AppEntityModel,UnsupportedModelError=t.UnsupportedModelError,getPSUIActionByModelObject=t.getPSUIActionByModelObject,ModelUtil=t.ModelUtil,ModelConst=t.ModelConst,ModelObject=t.ModelObject},function(t){clearAll=t.clearAll,QXEvent=t.QXEvent,notNilEmpty=t.notNilEmpty,createUUID=t.createUUID,isNilOrEmpty=t.isNilOrEmpty,ascSort=t.ascSort,descSort=t.descSort,isArray=t.isArray},function(t){clone=t.clone,isEmpty=t.isEmpty,isNil=t.isNil,equals=t.equals,where=t.where},function(t){Schema=t.default},function(t){dayjs=t.default},function(t){qs=t.default}],execute:function(){exports({calcResPath:calcResPath,calcRouteContext:calcRouteContext,convertNavData:convertNavData,convertNavDataByArray:convertNavDataByArray,convertNavDataByObject:convertNavDataByObject,executeNewDataAppUILogic:executeNewDataAppUILogic,executeOpenDataAppUILogic:executeOpenDataAppUILogic,executeViewLogic:executeViewLogic,formatToCodeListText:formatToCodeListText,generateRules:generateRules,install:install,installCommand:installCommand,openRedirectView:openRedirectView,presetUIActionProvider:presetUIActionProvider});var GlobalConfig=function(){this.enableDataInfoBar=!0},FormNotifyState,GridNotifyState;exports("FormNotifyState",FormNotifyState),function(t){t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE"}(FormNotifyState||exports("FormNotifyState",FormNotifyState={})),exports("GridNotifyState",GridNotifyState),function(t){t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE"}(GridNotifyState||exports("GridNotifyState",GridNotifyState={}));var extendStatics=function(t,e){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},extendStatics(t,e)};function __extends(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var __assign=function(){return __assign=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},__assign.apply(this,arguments)};function __awaiter(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((n=n.apply(t,e||[])).next())}))}function __generator(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function __values(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function __spreadArray(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}var Counter=exports("Counter",function(){function t(t){this.callback=t,this.count=0,this.state="Unused",this.reusable=!0}return t.prototype.increment=function(){return"Used"===this.state||(this.count+=1),this.count},t.prototype.decrement=function(t){if("Used"!==this.state){if(0===this.count)throw new RuntimeError("错误的调用!decrement不能对count为0调用");this.count-=1,0===this.count&&(t?t():this.callback&&this.callback(),this.reusable||(this.state="Used"))}},t.prototype.destroy=function(){this.callback=void 0},t}()),LoadingState=exports("LoadingState",function(){function t(){this.isLoading=!1,this.counter=new Counter(NOOP)}return t.prototype.begin=function(){this.isLoading=!0,this.counter.increment()},t.prototype.end=function(){var t=this;this.counter.decrement((function(){t.isLoading=!1}))},t}()),NerveCounter=exports("NerveCounter",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.reusable=!1,e.neuronNames=new Map,e}return __extends(e,t),e.prototype.enroll=function(t){this.neuronNames.has(t)||(this.neuronNames.set(t,!1),this.increment())},e.prototype.attend=function(t){this.neuronNames.has(t)&&!1===this.neuronNames.get(t)&&(this.neuronNames.set(t,!0),this.decrement())},e}(Counter)),Neuron=exports("Neuron",function(){function t(t){this.evt=new QXEvent,this.call=t}return t.prototype.destroy=function(){clearAll(this.call),this.evt.reset()},t}()),ControlNeuron=exports("ControlNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),AppMenuNeuron=exports("AppMenuNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ToolbarNeuron=exports("ToolbarNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),FormNeuron=exports("FormNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),EditFormNeuron=exports("EditFormNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),SearchFormNeuron=exports("SearchFormNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),MDControlNeuron=exports("MDControlNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),GridNeuron=exports("GridNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ListNeuron=exports("ListNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),TreeNeuron=exports("TreeNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ViewPanelNeuron=exports("ViewPanelNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),PickupViewPanelNeuron=exports("PickupViewPanelNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),DashboardNeuron=exports("DashboardNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ViewNeuron=exports("ViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),EditViewNeuron=exports("EditViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),EditView3Neuron=exports("EditView3Neuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),OptViewNeuron=exports("OptViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),MDViewNeuron=exports("MDViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),GridViewNeuron=exports("GridViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),PickupGridViewNeuron=exports("PickupGridViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),PickupViewNeuron=exports("PickupViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),MPickupViewNeuron=exports("MPickupViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFViewNeuron=exports("WFViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFEditViewNeuron=exports("WFEditViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFDynaEditViewNeuron=exports("WFDynaEditViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFDynaEditView3Neuron=exports("WFDynaEditView3Neuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFDynaStartViewNeuron=exports("WFDynaStartViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFDynaActionViewNeuron=exports("WFDynaActionViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),AppPortalViewNeuron=exports("AppPortalViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),TreeExpViewNeuron=exports("TreeExpViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),TabExpViewNeuron=exports("TabExpViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),GridExpViewNeuron=exports("GridExpViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),DashboardViewNeuron=exports("DashboardViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),Nerve=exports("Nerve",function(){function t(t){this.counter=new NerveCounter(this.counterCallBack.bind(this)),this.controller=t,this.self=this.createNeuron(),this.counter.enroll("self")}return t.prototype.counterCallBack=function(){this.self.evt.emit("mounted")},t.prototype.bindAbility=function(){return{}},t.prototype.inclusive=function(t){return!1},t.prototype.connect=function(t,e){},t.prototype.onNeuronInit=function(t){var e=this;return this.inclusive(t)?(this.counter.enroll(t),function(r){e.connect(t,r)}):function(t){}},t.prototype.created=function(){this.self.evt.emit("created")},t.prototype.mounted=function(){this.counter.attend("self")},t.prototype.destroy=function(){this.self.evt.emit("destroyed"),this.self.destroy(),this.controller=void 0,this.self=void 0},t}()),ControlNerve=exports("ControlNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ControlNeuron(this.bindAbility())},e.prototype.listenCommonEvent=function(t,e){var r=this;e.evt.on("mounted",(function(){r.counter.attend(t)}))},e.prototype.connect=function(t,e){this.listenCommonEvent(t,e)},e}(Nerve)),AppMenuNerve=exports("AppMenuNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new AppMenuNeuron(this.bindAbility())},e}(ControlNerve)),MDControlNerve=exports("MDControlNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new MDControlNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{load:this.controller.load.bind(this.controller),remove:this.controller.remove.bind(this.controller),getData:this.controller.getData.bind(this.controller),selectAll:this.controller.selectAll.bind(this.controller),importData:this.controller.importData.bind(this.controller),exportData:this.controller.exportData.bind(this.controller)})},e}(ControlNerve)),GridNerve=exports("GridNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new GridNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{save:this.controller.save.bind(this.controller),newRow:this.controller.newRow.bind(this.controller)})},e}(MDControlNerve)),ListNerve=exports("ListNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ListNeuron(this.bindAbility())},e}(MDControlNerve)),TreeNerve=exports("TreeNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new TreeNeuron(this.bindAbility())},e}(MDControlNerve)),FormNerve=exports("FormNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new FormNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{load:this.controller.load.bind(this.controller),getData:this.controller.getData.bind(this.controller)})},e}(ControlNerve)),EditFormNerve=exports("EditFormNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new EditFormNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{save:this.controller.save.bind(this.controller),remove:this.controller.remove.bind(this.controller),wfStart:this.controller.wfStart.bind(this.controller),wfSubmit:this.controller.wfSubmit.bind(this.controller)})},e}(FormNerve)),SearchFormNerve=exports("SearchFormNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new SearchFormNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{getParams:this.controller.getParams.bind(this.controller)})},e}(FormNerve)),ViewPanelNerve=exports("ViewPanelNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ViewPanelNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"embedView"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"embedView"===e&&(this.embedView=r,this.embedView.evt.on("viewDataChange",(function(t){n.self.evt.asyncEmit("viewDataChange",t)})),this.embedView.evt.on("destroyed",(function(){n.embedView=void 0})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.embedView=void 0},e}(ControlNerve)),PickupViewPanelNerve=exports("PickupViewPanelNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new PickupViewPanelNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{selectAll:this.controller.selectAll.bind(this.controller)})},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"embedView"===e&&(this.embedView=r,this.embedView.evt.on("selectionChange",(function(t){n.self.evt.asyncEmit("selectionChange",t)})))},e}(ViewPanelNerve)),DashboardNerve=exports("DashboardNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new DashboardNeuron(this.bindAbility())},e}(ControlNerve)),ViewNerve=exports("ViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{refresh:this.controller.refresh.bind(this.controller),closeView:this.controller.closeView.bind(this.controller)})},e.prototype.inclusive=function(e){return"toolbar"===e||t.prototype.inclusive.call(this,e)},e.prototype.listenCommonEvent=function(t,e){var r=this;e.evt.on("beginViewLoading",(function(){r.controller.beginViewLoading()})),e.evt.on("endViewLoading",(function(){r.controller.endViewLoading()})),e.evt.on("mounted",(function(){r.counter.attend(t)}))},e.prototype.connect=function(t,e){var r=this;this.listenCommonEvent(t,e),"toolbar"===t&&(this.toolbar=e,this.toolbar.evt.on("destroyed",(function(){r.toolbar=void 0})),this.toolbar.evt.on("itemClick",this.controller.onToolbarClick.bind(this.controller)))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.toolbar=void 0},e}(Nerve)),MDViewNerve=exports("MDViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new MDViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{openData:this.controller.openData.bind(this.controller),newData:this.controller.newData.bind(this.controller),toggleFilter:this.controller.toggleFilter.bind(this.controller),importData:this.controller.importData.bind(this.controller),exportData:this.controller.exportData.bind(this.controller)})},e.prototype.inclusive=function(e){return"searchform"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"searchform"===e&&(this.searchForm=r,this.searchForm.evt.on("destroyed",(function(){n.searchForm=void 0})),this.searchForm.evt.on("search",(function(){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.controller.onSearch()]}))}))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.searchForm=void 0},e}(ViewNerve)),GridViewNerve=exports("GridViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new GridViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{remove:this.controller.remove.bind(this.controller),newRow:this.controller.newRow.bind(this.controller)})},e.prototype.inclusive=function(e){return"grid"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"grid"===e&&(this.grid=r,this.grid.evt.on("destroyed",(function(){n.grid=void 0})),this.grid.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.grid.evt.on("dataActive",this.controller.onDataActive.bind(this.controller)),this.grid.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)),this.grid.evt.on("actionClick",this.controller.executeViewLogic.bind(this.controller)),this.grid.evt.on("afterSave",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterSave.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})),this.grid.evt.on("afterRemove",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterRemove.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.grid=void 0},e}(MDViewNerve)),PickupGridViewNerve=exports("PickupGridViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new PickupGridViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{selectAll:this.controller.selectAll.bind(this.controller)})},e}(GridViewNerve)),PickupViewNerve=exports("PickupViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new PickupViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"pickupviewpanel"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"pickupviewpanel"===e&&(this.viewPanel=r,this.viewPanel.evt.on("destroyed",(function(){n.viewPanel=void 0})),this.viewPanel.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.viewPanel=void 0},e}(ViewNerve)),MPickupViewNerve=exports("MPickupViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new MPickupViewNeuron(this.bindAbility())},e}(PickupViewNerve)),EditViewNerve=exports("EditViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new EditViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{save:this.controller.save.bind(this.controller),remove:this.controller.remove.bind(this.controller),saveAndNew:this.controller.saveAndNew.bind(this.controller),wfStart:this.controller.wfStart.bind(this.controller),wfSubmit:this.controller.wfSubmit.bind(this.controller),wfWithdraw:this.controller.wfWithdraw.bind(this.controller)})},e.prototype.inclusive=function(e){return"form"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"form"===e&&(this.form=r,this.form.evt.on("actionClick",this.controller.executeViewLogic.bind(this.controller)),this.form.evt.on("afterSave",this.controller.onAfterFormSave.bind(this.controller)),this.form.evt.on("afterRemove",this.controller.onAfterFormRemove.bind(this.controller)),this.form.evt.on("destroyed",(function(){n.form=void 0})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.form=void 0},e}(ViewNerve)),EditView3Nerve=exports("EditView3Nerve",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.drViews=new Map,e}return __extends(e,t),e.prototype.createNeuron=function(){return new EditView3Neuron(this.bindAbility())},e.prototype.inclusive=function(e){return 0===e.indexOf("dritem")||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),0===e.indexOf("dritem")&&(this.drViews.set(e,r),r.evt.on("destroyed",(function(){n.drViews&&n.drViews.delete(e)})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.drViews.clear(),this.drViews=void 0},e}(EditViewNerve)),OptViewNerve=exports("OptViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new OptViewNeuron(this.bindAbility())},e}(EditViewNerve)),WFEditViewNerve=exports("WFEditViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new WFEditViewNeuron(this.bindAbility())},e.prototype.connect=function(e,r){t.prototype.connect.call(this,e,r),"form"===e&&this.form.evt.on("mounted",this.controller.onFormMounted.bind(this.controller))},e}(EditViewNerve)),WFDynaEditViewNerve=exports("WFDynaEditViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new WFEditViewNeuron(this.bindAbility())},e}(WFEditViewNerve)),WFDynaEditView3Nerve=exports("WFDynaEditView3Nerve",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.drViews=new Map,e}return __extends(e,t),e.prototype.createNeuron=function(){return new WFEditViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return 0===e.indexOf("dritem")||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),0===e.indexOf("dritem")&&(this.drViews.set(e,r),r.evt.on("destroyed",(function(){n.drViews&&n.drViews.delete(e)})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.drViews.clear(),this.drViews=void 0},e}(WFDynaEditViewNerve)),WFDynaStartViewNerve=exports("WFDynaStartViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new WFEditViewNeuron(this.bindAbility())},e}(WFEditViewNerve)),WFDynaActionViewNerve=exports("WFDynaActionViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new WFDynaActionViewNeuron(this.bindAbility())},e}(WFEditViewNerve)),AppPortalViewNerve=exports("AppPortalViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new AppPortalViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"dashboard"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){t.prototype.connect.call(this,e,r),"dashboard"===e&&(this.dashboard=r)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.dashboard=void 0},e}(ViewNerve)),TreeExpViewNerve=exports("TreeExpViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new TreeExpViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"tree"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"tree"===e&&(this.tree=r,this.tree.evt.on("destroyed",(function(){n.tree=void 0})),this.tree.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.tree.evt.on("dataActive",(function(t){return n.controller.onDataActive(t)})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tree=void 0},e}(MDViewNerve)),TabExpViewNerve=exports("TabExpViewNerve",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tabViews=new Map,e}return __extends(e,t),e.prototype.createNeuron=function(){return new TabExpViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return 0===e.indexOf("tabviewpanel")||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),0===e.indexOf("tabviewpanel")&&(this.tabViews.set(e,r),r.evt.on("destroyed",(function(){n.tabViews&&n.tabViews.delete(e)})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tabViews.clear(),this.tabViews=void 0},e}(ViewNerve)),GridExpViewNerve=exports("GridExpViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new GridExpViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{remove:this.controller.remove.bind(this.controller),newRow:this.controller.newRow.bind(this.controller)})},e.prototype.inclusive=function(e){return"gridexpbar_grid"===e||"gridexpbar_toolbar"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"gridexpbar_toolbar"===e&&(this.toolbar=r,this.toolbar.evt.on("destroyed",(function(){n.toolbar=void 0})),this.toolbar.evt.on("itemClick",this.controller.onToolbarClick.bind(this.controller))),"gridexpbar_grid"===e&&(this.grid=r,this.grid.evt.on("destroyed",(function(){n.grid=void 0})),this.grid.evt.on("dataActive",this.controller.onDataActive.bind(this.controller)),this.grid.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)),this.grid.evt.on("actionClick",this.controller.executeViewLogic.bind(this.controller)),this.grid.evt.on("afterSave",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterSave.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})),this.grid.evt.on("afterRemove",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterRemove.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.grid=void 0},e}(MDViewNerve)),DashboardViewNerve=exports("DashboardViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new DashboardViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"dashboard"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){t.prototype.connect.call(this,e,r),"dashboard"===e&&(this.dashboard=r)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.dashboard=void 0},e}(ViewNerve)),AppCounter=exports("AppCounter",function(){function t(t){this.model=t,this.destroyed=!1,this.context={},this.params={},this.evt=new QXEvent,this.data={},this.app=ibiz.hub.getApp(t.getPSModelService().app)}return Object.defineProperty(t.prototype,"isDestroyed",{get:function(){return this.destroyed},enumerable:!1,configurable:!0}),t.prototype.init=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return this.setParams(t,e),this.entity=this.model.getPSAppDataEntity(),[4,this.entity.fill(!0)];case 1:return i.sent(),r=this,[4,this.app.es.getService(this.entity.codeName)];case 2:if(r.service=i.sent(),!(n=this.model.getGetPSAppDEAction()))throw new DefectModelError(this.model,"未找到获取计数器行为!");return this.action=n.codeName,this.interval(),[4,this.load()];case 3:return i.sent(),[2]}}))}))},t.prototype.setParams=function(t,e){t&&(this.context=clone(t)),e&&(this.params=clone(e))},t.prototype.interval=function(){var t=this;this.destroyInterval(),this.intervalTimer=setInterval((function(){t.evt.getSize("change")>0&&t.load()}),this.model.timer||6e3)},t.prototype.destroyInterval=function(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)},t.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.service.exec(this.action,this.context,this.params)];case 1:return(t=e.sent()).ok&&(this.data=t.data,this.evt.emit("change",this.data)),[2,this.data]}}))}))},t.prototype.refresh=function(t,e){return this.setParams(t,e),this.load()},t.prototype.onChange=function(t,e){void 0===e&&(e=!0),this.evt.on("change",t),e&&notNilEmpty(this.data)&&t(this.data)},t.prototype.offChange=function(t){this.evt.off("change",t)},t.prototype.getCounter=function(t){return this.data[t.toLowerCase()]||0},t.prototype.destroy=function(){this.destroyed=!0,this.destroyInterval(),this.evt.reset()},t}()),PSModelCondEngineBase=function(){function t(){this.psModelGroupCondBase=null}return t.prototype.parse=function(t){if(t instanceof Array){var e=this.createPSModelGroupCond();e.parse(t),this.psModelGroupCondBase=e}},t.prototype.testSingleCond=function(t,e,r){try{if("ISNULL"===t)return null==e;if("ISNOTNULL"===t)return null!=e;if("EQ"===t||"ABSEQ"===t||"GT"===t||"GTANDEQ"===t||"LT"===t||"LTANDEQ"===t||"NOTEQ"===t){var n=-1;if(e==r?n=0:e>r&&(n=1),"EQ"===t||"ABSEQ"===t)return 0===n;if("GT"===t)return n>0;if("GTANDEQ"===t)return n>=0;if("LT"===t)return n<0;if("LTANDEQ"===t)return n<=0;if("NOTEQ"===t)return 0!==n}if("LIKE"===t)return null!=e&&null!=r&&-1!==e.toString().toUpperCase().indexOf(r.toString().toUpperCase());if("LEFTLIKE"===t)return null!=e&&null!=r&&0===e.toString().toUpperCase().indexOf(r.toString().toUpperCase())}catch(t){ibiz.log.error(t)}return!1},t.prototype.getPSModelGroupCondBase=function(){return this.psModelGroupCondBase},t}(),PSModelCondBase=function(){function t(){this.strCondOp=null}return t.prototype.getCondOp=function(){return this.strCondOp},t.prototype.setCondOp=function(t){this.strCondOp=t},t}(),PSModelSingleCondBase=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.parse=function(t){for(var e=t.length,r=!0,n=!1,i=!1,o=0;o<e;o++)if(r){var s=t[o];this.setCondOp(s),r=!1,n=!0}else if(n){s=t[o];this.setParam(s),n=!1,i=!0}else if(i){var a=t[o];if(a instanceof Object&&!(a instanceof Array)){var c=a;null!=c.type&&this.setValueType(c.type.toString()),null!=c.value&&this.setValue(c.value.toString())}else this.setValue(a);break}},e.prototype.getValueType=function(){return this.strValueType},e.prototype.setValueType=function(t){this.strValueType=t},e.prototype.getValue=function(){return this.strValue},e.prototype.setValue=function(t){this.strValue=t},e.prototype.getParamType=function(){return this.strParamType},e.prototype.setParamType=function(t){this.strParamType=t},e.prototype.getParam=function(){return this.strParam},e.prototype.setParam=function(t){this.strParam=t},e}(PSModelCondBase),PSModelGroupCondBase=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.childCondList=[],e.bNotMode=!1,e}return __extends(e,t),e.prototype.parse=function(t){for(var r=this,n=t.length,i=!0,o=!0,s=!1,a=0;a<n;a++){if(i&&o)if("!"===(c=t[a])){this.setNotMode(!0),i=!1;continue}if(o){var c=t[a];this.setCondOp(c),o=!1,i=!1,s=!0}else if(s){var u=t[a];if(!(u instanceof Array))throw new Error("值必须为数组");u.forEach((function(t){if(t.length>0){var n,i=t[0].toString();if("!"===i||"OR"===i||"AND"===i)(n=new e).parse(t),r.childCondList.push(n);else(n=new PSModelSingleCondBase).parse(t),r.childCondList.push(n)}}))}}},e.prototype.setNotMode=function(t){this.bNotMode=t},e.prototype.isNotMode=function(){return this.bNotMode},e.prototype.getChildPSModelCondBases=function(){return this.childCondList},e}(PSModelCondBase),PSDEDQGroupCond=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PSModelGroupCondBase),PSDEDQSingleCond=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PSModelSingleCondBase),PSDEDQCondEngine=exports("PSDEDQCondEngine",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.test=function(t,e){return this.testCond(this.getPSModelGroupCondBase(),t,e)},e.prototype.testCond=function(t,r,n){if(t instanceof PSModelGroupCondBase){var i=t.getChildPSModelCondBases();if(null==i||isEmpty(i))return!t.isNotMode();for(var o="AND"===t.getCondOp(),s=o,a=0;a<i.length;a++){var c=i[a];if(this.testCond(c,r,n)){if(!o){s=!0;break}}else if(o){s=!1;break}}return t.isNotMode()?!s:s}if(t instanceof PSModelSingleCondBase){isEmpty(t.getParam())&&ibiz.log.warn("没有指定属性名称",t);var u=r[t.getParam().toLowerCase()],l=null,h=t.getValueType(),p=t.getValue();return null==h||isEmpty(h)?l=t.getValue():(isEmpty(p)&&ibiz.log.warn("没有指定上下文参数名称"),e.PARAMTYPE_WEBCONTEXT===h?l=n.data[p.toLowerCase()]:e.PARAMTYPE_DATACONTEXT===h&&(l=n.getValue(p.toLowerCase()))),this.testSingleCond(t.getCondOp(),u,l)}return ibiz.log.warn("无法识别的条件对象",t),!1},e.prototype.createPSModelSingleCond=function(){return new PSDEDQSingleCond},e.prototype.createPSModelGroupCond=function(){return new PSDEDQGroupCond},e.PARAMTYPE_DATACONTEXT="DATACONTEXT",e.PARAMTYPE_WEBCONTEXT="WEBCONTEXT",e}(PSModelCondEngineBase)),DEDQCondUtil=exports("DEDQCondUtil",function(){function t(){}return t.getCond=function(t){if(this.map.has(t))return this.map.get(t);var e=t.getPSDEDQGroupConditions();if(e){var r=new PSDEDQCondEngine;return r.parse(["OR",this.calcCond(e)]),this.map.set(t,r),r}return null},t.calcCond=function(t){var e=this,r=[];return t.forEach((function(t){var n=[];if("GROUP"===t.condType){(s=t).notMode&&n.push("!"),n.push(t.condOp);var i=s.getPSDEDQConditions();if(i){var o=e.calcCond(i);n.push(o)}}else{if("SINGLE"!==t.condType)throw new Error("暂未支持的查询条件类型: ".concat(t.condType));var s=t;n.push(s.fieldName),s.condValue?s.getPSVARTypeId()?n.push({type:s.getPSVARTypeId(),value:s.getPSVARTypeId()}):n.push(s.condValue):n.push("")}r.push(n)})),r},t.map=new WeakMap,t}()),DynamicCodeListCache=exports("DynamicCodeListCache",function(){function t(t){this.cache=new Map,this.isPredefined=!1,this.codeList=t,this.app=ibiz.hub.getApp(t.getPSModelService().app)}return t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var t,e=this;return __generator(this,(function(r){return t=function(){return __awaiter(e,void 0,void 0,(function(){var t,e,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:if(t=this.codeList.predefinedType){if(this.isPredefined=!0,!["OPERATOR","RUNTIME"].includes(t))throw new UnsupportedModelError(this.codeList,"预定义类型".concat(t,"暂不支持"));return[2]}if(!(e=this.codeList.getPSAppDataEntity()))throw new DefectModelError(this.codeList,"未配置应用实体");return[4,e.fill(!0)];case 1:if(o.sent(),!(r=null===(i=this.codeList.getPSAppDEDataSet())||void 0===i?void 0:i.codeName))throw new DefectModelError(this.codeList,"未配置数据集");return[4,(n=new AppEntityModel(e)).init()];case 2:return o.sent(),this.entity=n,this.methodName=r,this.initPromise=void 0,[2]}}))}))},this.initPromise=t(),[2,this.initPromise]}))}))},t.prototype.convertData=function(t){var e={};if(this.codeList.getValuePSAppDEField()){var r=this.codeList.getValuePSAppDEField().codeName.toLowerCase();e.id=t[r],e.value=t[r]}else e.id=t[this.entity.keyName],e.value=t[this.entity.keyName];return this.codeList.getTextPSAppDEField()?e.text=t[this.codeList.getTextPSAppDEField().codeName.toLowerCase()]:e.text=t[this.entity.textName],Object.freeze(e)},t.prototype.load=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r,n,i,o=this;return __generator(this,(function(s){switch(s.label){case 0:return this.isPredefined?[4,this.app.net.get("/dictionaries/codelist/".concat(this.codeList.codeName),e)]:[3,2];case 1:return r=s.sent(),[2,Object.freeze(r.data.items)];case 2:return!this.entity||this.methodName,[4,this.app.es.getService(this.entity.source.codeName)];case 3:return[4,s.sent().exec(this.methodName,t,e)];case 4:return n=s.sent(),i=[],n.data.length&&(i=n.data.map((function(t){return o.convertData(t)}))),[2,i]}}))}))},t.prototype.get=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r,n,i,o,s;return __generator(this,(function(a){switch(a.label){case 0:return this.initPromise?[4,this.initPromise]:[3,2];case 1:a.sent(),a.label=2;case 2:if(!this.codeList.enableCache||-1===this.codeList.cacheTimeout)return[2,this.load(t,e)];if(r=JSON.stringify(t)+JSON.stringify(e),this.cache.has(r)){if((n=this.cache.get(r)).expirationTime>(new Date).getTime())return[2,n.promise?n.promise:n.items];this.cache.delete(r)}return i=this.load(t,e),o={expirationTime:(new Date).getTime()+this.codeList.cacheTimeout,promise:i},this.cache.set(r,o),[4,i];case 3:return s=a.sent(),o.items=s,delete o.promise,[2,s]}}))}))},t}());function isExistSrfKey(t,e){if(null!=e){var r=e.srfkey;if(!isNil(r)&&!isEmpty(r))return!0}throw new RuntimeError("执行「".concat(t,"」不存在「srfkey」无法处理"))}function isExistSessionId(t,e){var r=e.srfsessionid;if(!isNil(r)&&!isEmpty(r))return!0;throw new RuntimeError("执行「".concat(t,"」不存在「srfsessionid」无法处理"))}var EntityCache=exports("EntityCache",function(){function t(){this.cacheMap=new Map}return t.prototype.forceAdd=function(t,e){var r=this.getCacheByTag(t).get(e.srfkey);r&&(r.assign(e),ibiz.log.warn("forceAdd",e.srfkey,e))},t.prototype.forceUpdate=function(t,e){this.getCacheByTag(t).set(e.srfkey,clone(e)),ibiz.log.warn("forceUpdate",e.srfkey,e)},t.prototype.forceDelete=function(t,e){this.getCacheByTag(t).delete(e),ibiz.log.warn("forceDelete",e)},t.prototype.add=function(t,e){try{return isExistSessionId("add",t),(isNil(e.srfkey)||isEmpty(e.srfkey))&&(e.srfkey=createUUID()),e.srftempdate=(new Date).getTime(),this.getCacheByTag(t).set(e.srfkey,clone(e)),ibiz.log.warn("add",e.srfkey,e),e}catch(t){return ibiz.log.error(t),null}},t.prototype.get=function(t,e){try{isExistSessionId("get",t);var r=this.getCacheByTag(t).get(e);return ibiz.log.warn("get",e,r),clone(r)}catch(t){return ibiz.log.error(t),null}},t.prototype.update=function(t,e){try{isExistSessionId("update",t),isExistSrfKey("update",e),e.srftempdate=(new Date).getTime();var r=this.getCacheByTag(t),n=r.get(e.srfkey);if(n)return n.assign(e),r.set(e.srfkey,n),ibiz.log.warn("update",e.srfkey,e),clone(n);throw new Error("数据不存在,无法更新!")}catch(t){return ibiz.log.error(t),null}},t.prototype.delete=function(t,e){try{isExistSessionId("delete",t);var r=this.getCacheByTag(t),n=e;if(r.has(n)){var i=r.get(n);return i.srftempdate=(new Date).getTime(),r.delete(n),ibiz.log.warn("delete",n),i}return null}catch(t){return ibiz.log.error(t),null}},t.prototype.createBatch=function(t,e){try{isExistSessionId("add",t);for(var r=this.getCacheByTag(t),n=0;n<e.length;n++){var i=e[n];(isNil(i.srfkey)||isEmpty(i.srfkey))&&(i.srfkey=createUUID()),i.srftempdate=(new Date).getTime();var o=clone(i);r.set(i.srfkey,o),e[n]=o,ibiz.log.warn("add",i.srfkey,i)}return e}catch(t){ibiz.log.error(t)}return[]},t.prototype.updateBatch=function(t,e){try{isExistSessionId("update",t);for(var r=this.getCacheByTag(t),n=0;n<e.length;n++){var i=e[n];isExistSrfKey("update",i),i.srftempdate=(new Date).getTime();var o=r.get(i.srfkey);if(!o)throw new Error("数据[".concat(i.srfdename,"-").concat(i.srfmajortext,"(").concat(i.srfkey,")]不存在,无法更新!"));o.assign(i),r.set(i.srfkey,o),ibiz.log.warn("update",i.srfkey,i),e[n]=clone(o)}return e}catch(t){return ibiz.log.error(t),null}},t.prototype.deleteBatch=function(t,e){try{isExistSessionId("delete",t)}catch(t){return ibiz.log.error(t),e}for(var r=this.getCacheByTag(t),n=[],i=0;i<e.length;i++){var o=e[i];r.has(o)||n.push(o)}if(n.length>0)throw new Error("未找到以下数据「".concat(n.join("、"),"」,无法删除!"));for(i=0;i<e.length;i++){o=e[i];r.delete(o),ibiz.log.warn("delete",o)}return[]},t.prototype.checkData=function(t,e){return-1!==this.getList(t).findIndex((function(t){return t.srfkey===e}))},t.prototype.getList=function(t){try{isExistSessionId("getList",t);var e=this.getCacheByTag(t);if(!e)return[];var r=e.values();return Array.from(r)}catch(t){return ibiz.log.error(t),[]}},t.prototype.generatePred=function(t){void 0===t&&(t={});var e={};for(var r in t.srfkey&&(e.srfkey=equals(t.srfkey)),delete t.srfkey,t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=t[r];e[r]=equals(n)}return where(e)},t.prototype.clear=function(t){var e=t.srfsessionid;this.cacheMap.size>0&&this.cacheMap.delete(e)},t.prototype.getCacheByTag=function(t){var e=t.srfsessionid;return this.cacheMap.has(e)||this.cacheMap.set(e,new Map),this.cacheMap.get(e)},t}()),IBizVerify=exports("IBizVerify",function(){function IBizVerify(){}return IBizVerify.verifyDeRules=function(t,e,r){var n,i=this,o={isPast:!0,infoMessage:r.ruleInfo};if("GROUP"===r.condType){var s=r.getPSDEFVRConditions();(null==s?void 0:s.length)>0&&(o.isPast=this.logicForEach(s,(function(r){var n=i.verifyDeRules(t,e,r),s=n.isPast,a=n.infoMessage;return o.infoMessage=a,s}),r.condOp,!!r.notMode),!o.isPast&&("AND"===r.condOp&&r.notMode||"OR"===r.condOp&&!r.notMode)&&(o.infoMessage=r.ruleInfo))}else{t=null==r?void 0:r.dEFName.toLowerCase();try{if("SIMPLE"===r.condType)o.isPast=!this.checkFieldSimpleRule(e[t],r.condOp,r.paramValue,r.ruleInfo,r.paramType,e,r.isKeyCond);else if("VALUERANGE2"===r.condType)o.isPast=!this.checkFieldValueRangeRule(e[t],r.minValue,r.includeMinValue,r.maxValue,r.includeMaxValue,r.ruleInfo,r.isKeyCond);else if("REGEX"===r.condType)o.isPast=!this.checkFieldRegExRule(e[t],r.regExCode,r.ruleInfo,r.isKeyCond);else if("STRINGLENGTH"===r.condType)o.isPast=!this.checkFieldStringLengthRule(e[t],r.minValue,r.includeMinValue,r.maxValue,r.includeMaxValue,r.ruleInfo,r.isKeyCond);else if("SYSVALUERULE"===r.condType&&(null===(n=null==r?void 0:r.getPSSysValueRule)||void 0===n?void 0:n.call(r))){var a=r.getPSSysValueRule(),c=a.ruleType,u=a.regExCode,l=a.scriptCode,h=a.ruleInfo;if(o.infoMessage=r.ruleInfo||h,"REG"===c)o.isPast=!this.checkFieldRegExRule(e[t],u,o.infoMessage,r.isKeyCond);else if("SCRIPT"===c){var p=this.checkFieldScriptRule(e[t],e,l,o.infoMessage,r.isKeyCond),d=p.isPast,f=p.infoMessage;o.isPast=d,o.infoMessage=f||o.infoMessage}}}catch(t){o.isPast=!1}o.isPast=r.notMode?!o.isPast:o.isPast}return o},IBizVerify.logicForEach=function(t,e,r,n){if(void 0===r&&(r="AND"),void 0===n&&(n=!1),!((null==t?void 0:t.length)>0))return!1;for(var i="AND"===r,o=0,s=t.length;o<s;o++){var a=e(t[o],o);if("AND"===r){if(!a){i=!1;break}}else if("OR"===r&&a){i=!0;break}}return n?!i:i},IBizVerify.verifyGroupLogic=function(t,e){var r,n=this;if("GROUP"===e.logicType&&(null===(r=e.getPSDEFDLogics())||void 0===r?void 0:r.length)){var i=!0;if("AND"===e.groupOP)i=void 0===e.getPSDEFDLogics().find((function(e){return!n.verifyGroupLogic(t,e)}));else if("OR"===e.groupOP){i=void 0!==e.getPSDEFDLogics().find((function(e){return n.verifyGroupLogic(t,e)}))}return e.notMode?!i:i}if("SINGLE"===e.logicType){var o=e;return this.testCond(t[o.dEFDName.toLowerCase()],o.condOP,o.value)}return!1},IBizVerify.compare=function(t,e){var r;return Object.is(t,"")||Object.is(e,"")||isNaN(t)||isNaN(e)?this.isParseDate(t)&&this.isParseDate(e)?r=this.compareDate(new Date(t).getTime(),new Date(e).getTime()):t&&("boolean"==typeof t||t instanceof Boolean)?r=this.compareBoolean(t,e):t&&("string"==typeof t||t instanceof String)&&(r=this.compareString(t,e)):r=this.compareNumber(parseFloat(t),parseFloat(e)),r},IBizVerify.compareString=function(t,e){return t.localeCompare(e)},IBizVerify.compareBoolean=function(t,e){return t===e?0:-1},IBizVerify.compareDate=function(t,e){return t>e?1:t<e?-1:0},IBizVerify.isParseDate=function(t){var e=new Date(t);return!isNaN(e.getTime())},IBizVerify.compareNumber=function(t,e){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),t>e?1:t<e?-1:0},IBizVerify.contains=function(t,e){if(t&&e){var r=e.split(","),n=String.fromCharCode(2);return new RegExp(n+t+n).test(n+r.join(n)+n)}return!1},IBizVerify.testCond=function(t,e,r){var n;if(Object.is(e,"EQ"))return"".concat(t)===r;if(Object.is(e,"GT"))return null!=(n=this.compare(t,r))&&n>0;if(Object.is(e,"GTANDEQ"))return null!=(n=this.compare(t,r))&&n>=0;if(Object.is(e,"IN"))return this.contains(t,r);if(Object.is(e,"ISNOTNULL"))return notNilEmpty(t);if(Object.is(e,"ISNULL"))return isNilOrEmpty(t);if(Object.is(e,"LEFTLIKE"))return t&&r&&0===t.toUpperCase().indexOf(r.toUpperCase());if(Object.is(e,"LIKE"))return t&&r&&-1!==t.toUpperCase().indexOf(r.toUpperCase());if(Object.is(e,"LT"))return null!=(n=this.compare(t,r))&&n<0;if(Object.is(e,"LTANDEQ"))return null!=(n=this.compare(t,r))&&n<=0;if(Object.is(e,"NOTEQ"))return"".concat(t)!==r;if(Object.is(e,"NOTIN"))return!this.contains(t,r);if(Object.is(e,"RIGHTLIKE")){if(!t||!r)return!1;var i=t.toUpperCase().indexOf(r.toUpperCase());return-1!==i&&i+r.length===t.length}return!1},IBizVerify.checkFieldSimpleRule=function(t,e,r,n,i,o,s){(Object.is(i,"CURTIME")&&(r="".concat(new Date)),Object.is(i,"ENTITYFIELD"))&&(r=o[r=r?r.toLowerCase():""]?o[r]:r);(isNil(n)||isEmpty(n))&&(n="内容必须符合值规则");var a=this.testCond(t,e,r);if(!a&&s)throw new Error(n);return!a},IBizVerify.checkFieldStringLengthRule=function(t,e,r,n,i,o,s){if(isNilOrEmpty(o)&&(o="内容长度必须符合范围规则"),isNilOrEmpty(t)){if(s)throw new Error("值为空");return o="值为空",!0}var a=t.length;if(null!==e)if(r){if(a<e){if(s)throw new Error(o);return!0}}else if(a<=e){if(s)throw new Error(o);return!0}if(null!==n)if(i){if(a>n){if(s)throw new Error(o);return!0}}else if(a>=n){if(s)throw new Error(o);return!0}return o="",!1},IBizVerify.checkFieldRegExRule=function(t,e,r,n){if(isNilOrEmpty(r)&&(r="值必须符合正则规则"),isNilOrEmpty(t)){if(n)throw new Error("值为空");return r="值为空",!0}if(!new RegExp(e).test(t)){if(n)throw new Error(r);return!0}return r="",!1},IBizVerify.checkFieldValueRangeRule=function(t,e,r,n,i,o,s){if(isNilOrEmpty(o)&&(o="值必须符合值范围规则"),isNilOrEmpty(t)){if(s)throw new Error("值为空");return o="值为空",!0}if(this.checkFieldRegExRule(t,/^-?\d*\.?\d+$/,"",s))return!0;var a=Number.parseFloat(t);if(null!==e)if(r){if(a<e){if(s)throw new Error(o);return!0}}else if(a<=e){if(s)throw new Error(o);return!0}if(null!=n)if(i){if(a>n){if(s)throw new Error(o);return!0}}else if(a>=n){if(s)throw new Error(o);return!0}return o="",!1},IBizVerify.checkFieldSysValueRule=function(t,e,r,n){return this.checkFieldRegExRule(t,e,r,n)},IBizVerify.checkFieldScriptRule=function(value,data,scriptCode,errorInfo,primaryModel){isNilOrEmpty(errorInfo)&&(errorInfo="值必须符合脚本规则");var selfError="",resultBoolean=!0;try{var runScript=function(){return eval(scriptCode)};runScript()}catch(t){console.error(t)}return errorInfo="",{isPast:resultBoolean,infoMessage:selfError||errorInfo}},IBizVerify}());function calcResPath(t,e){var r=[];e.forEach((function(e){for(var n=[],i=0;i<e.length-1;i++){var o=e[i],s=t[o.name];s?(n.push(o.plural),n.push(s)):n=[]}r.push(n)}));var n=__read(r=r.sort((function(t,e){return e.length-t.length})),1)[0];return n?"".concat(n.length>1?"/":"").concat(n.join("/")):""}function calcRouteContext(t,e){var r=[];e.forEach((function(e){for(var n=[],i=0;i<e.length;i++){var o=[],s=e[i],a=t[s.name];a&&(o.push(s.name),o.push(a),n.push(o))}r.push(n)}));var n=__read(r=r.sort((function(t,e){return e.length-t.length})),1)[0];if(n){var i={};return n.forEach((function(t){var e=__read(t,2),r=e[0],n=e[1];i[r]=n})),i}return{}}var SearchFilter=exports("SearchFilter",function(){function t(t,e){var r;if(this.page=0,this.size=1e3,this.data={},this.sortField="srfordervalue",this.sortMode="ASC",this.context=t,e){if(isNil(e.page)||isEmpty(e.page)||(this.page=e.page),isNil(e.size)||isEmpty(e.size)||(this.size=e.size),isNil(e.query)||isEmpty(e.query)||(this.query=e.query),!isNil(e.sort)&&!isEmpty(e.sort)){var n=e.sort.split(",");n.length>=1&&(r=__read(n,1),this.sortField=r[0]),n.length>=2&&(this.sortMode=n[1].toUpperCase())}isNil(e.srfparentkey)||isEmpty(e.srfparentkey)||(this.srfparentkey=e.srfparentkey),isNil(e.srfparentdename)||isEmpty(e.srfparentdename)||(this.srfparentdename=e.srfparentdename),this.data=__assign({},e),delete this.data.page,delete this.data.size,delete this.data.query,delete this.data.sort,delete this.data.srfparentkey,delete this.data.srfparentdename}}return t.prototype.getValue=function(t){return this.data[t]?this.data[t]:this.context[t]},t}()),ServicePathUtil=exports("ServicePathUtil",function(){function t(t){this.modelService=t,this.allDERss=[],this.entityRsMap=new Map,this.entityRsPathMap=new Map}return t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r=this;return __generator(this,(function(n){return this.allDERss.length>0||(t=this.modelService.app,e=t.getAllPSAppDataEntities()||[],this.allDERss=t.getAllPSAppDERSs()||[],e.forEach((function(t){var e=t.isFill?t.codeName:t.refM.codeName,n=r.allDERss.filter((function(t){return t.minorDECodeName===e?t:null}));n.length>0&&r.entityRsMap.set(e,n)}))),[2]}))}))},t.prototype.calcPaths=function(t){if(this.entityRsPathMap.has(t))return this.entityRsPathMap.get(t);var e=this.entityRsMap.get(t);if(e){var r=this.calcDeepPath(e);this.deepFillPath(t,[t],r);var n=this.entityRsPathMap.get(t);if(n){var i=this.sortPath(n);return this.entityRsPathMap.set(t,i),i}}return[[{deName:t,name:t.toLowerCase(),plural:pluralLower(t)}]]},t.prototype.calcDeepPath=function(t,e){var r=this;if(void 0===e&&(e=0),e>10)throw new Error("服务路径计算超过最大层级 10");e+=1;var n=[];return t.forEach((function(t){var i=r.entityRsMap.get(t.majorDECodeName)||[];n.push([t,r.calcDeepPath(i,e)])})),n},t.prototype.deepFillPath=function(t,e,r){var n=this;r.forEach((function(r){var i=__read(r,2),o=i[0],s=i[1];s.length>0?n.deepFillPath(t,__spreadArray(__spreadArray([],__read(e),!1),[o.majorDECodeName],!1),s):(n.entityRsPathMap.has(t)||n.entityRsPathMap.set(t,[]),n.entityRsPathMap.get(t).push(__spreadArray(__spreadArray([],__read(e.map((function(t){return{deName:t,name:t.toLowerCase(),plural:pluralLower(t)}}))),!1),[{deName:o.majorDECodeName,name:o.majorDECodeName.toLowerCase(),plural:pluralLower(o.majorDECodeName)}],!1).reverse()))}))},t.prototype.sortPath=function(t){return t.sort((function(t,e){return e.length-t.length}))},t}()),CodeListService=exports("CodeListService",function(){function t(t){this.modelService=t,this.allCodeLists=new Map,this.cache=new Map}return t.prototype.initAllCodeList=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){return 0!==this.allCodeLists.size||(this.modelService.app.getAllPSAppCodeLists()||[]).forEach((function(e){var r=e.isFill?e.codeName:e.refM.codeName;t.allCodeLists.set(r,e)})),[2]}))}))},t.prototype.getStatic=function(t){if(this.cache.has(t.codeName))return this.cache.get(t.codeName);var e=t.getPSCodeItems(),r=[];return(null==e?void 0:e.length)&&(r=this.formatStaticItems(e,t.codeItemValueNumber)),this.cache.set(t.codeName,Object.freeze(r)),r},t.prototype.formatStaticItems=function(t,e){var r=this;return t.map((function(t){var n,i={text:t.text,value:e?Number(t.value):t.value,color:t.color,id:t.codeName};return(null===(n=t.getPSCodeItems())||void 0===n?void 0:n.length)&&(i.children=r.formatStaticItems(t.getPSCodeItems(),e)),Object.freeze(i)}))},t.prototype.getDynamicCodeList=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return this.cache.has(t.codeName)?(n=this.cache.get(t.codeName),[3,3]):[3,1];case 1:return n=new DynamicCodeListCache(t),this.cache.set(t.codeName,n),[4,n.init()];case 2:i.sent(),i.label=3;case 3:return[2,n.get(e,r)]}}))}))},t.prototype.get=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return 0!==this.allCodeLists.size?[3,2]:[4,this.initAllCodeList()];case 1:i.sent(),i.label=2;case 2:if(!(n=this.allCodeLists.get(t)))throw new Error("找不到".concat(t,"代码表"));return[4,n.fill(!0)];case 3:return i.sent(),"STATIC"===n.codeListType?[2,this.getStatic(n)]:"DYNAMIC"===n.codeListType?[2,this.getDynamicCodeList(n,e,r)]:[2,[]]}}))}))},t}()),CounterService=exports("CounterService",function(){function t(){}return t.getCounter=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:if(this.counterMap.has(t.id)){if(!1===(n=this.counterMap.get(t.id)).isDestroyed)return[2,n];this.counterMap.delete(t.id)}return[4,(i=new AppCounter(t)).init(e,r)];case 1:return o.sent(),this.counterMap.set(t.id,i),[2,i]}}))}))},t.getCounterByRef=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){if(!(n=t.getPSAppCounter()))throw new DefectModelError(t,"未配置应用计数器!");return[2,this.getCounter(n,e,r)]}))}))},t.counterMap=new Map,t}()),WorkFlowService=exports("WorkFlowService",function(){function t(t){this.model=t,this.app=ibiz.hub.getApp(t.modelService.app);var e=ibiz.appData.context;this.commonBaseUrl="/wfcore/".concat(e.srfsystemid,"-app-").concat(t.modelService.app.codeName.toLowerCase(),"/").concat(this.model.source.name.toLowerCase())}return t.prototype.getBaseUrl=function(){return this.commonBaseUrl},t.prototype.getWFStep=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){return e=t.processDefinitionKey,r=t.taskDefinitionKey,[2,this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions/").concat(e,"/usertasks/").concat(r))]}))}))},t.prototype.getWFLink=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){return r=t[this.model.deName],n=t.taskDefinitionKey,[2,this.app.net.post("".concat(this.getBaseUrl(),"/").concat(r,"/usertasks/").concat(n,"/ways"),{activedata:e})]}))}))},t.prototype.getWFHistory=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){return e=t[this.model.deName],[2,this.app.net.get("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/history"))]}))}))},t.prototype.getWFProcessDiagram=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){return e=t[this.model.deName],[2,this.app.net.request("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/processdiagram"),{method:"post",data:{},responseType:"blob"})]}))}))},t.prototype.getWFVersion=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions2"))]}))}))},t.prototype.wfStart=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.deName],"/process-instances"),__assign(__assign({},e),{activedata:r}))]}))}))},t.prototype.wfSubmit=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.deName],"/tasks/").concat(e.taskId),__assign(__assign({},e),{activedata:r}))]}))}))},t.prototype.wfWithdraw=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.deName],"/tasks/").concat(e.taskId,"/withdraw"),__assign(__assign({},e),{activedata:r}))]}))}))},t.prototype.exec=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(t){case"WFSTART":return[2,this.wfStart(e,r,n)];case"WFSUBMIT":return[2,this.wfSubmit(e,r,n)];default:throw new RuntimeError("「".concat(t,"」未实现"))}}))}))},t}()),Srfuf;exports("Srfuf",Srfuf),function(t){t[t.CREATE=0]="CREATE",t[t.UPDATE=1]="UPDATE"}(Srfuf||exports("Srfuf",Srfuf={}));var Entity=function(){function t(e,r){Object.defineProperty(this,"entity",{enumerable:!1,configurable:!0,value:e}),Object.defineProperty(this,"data",{enumerable:!1,configurable:!0,value:clone(r instanceof t?r.data:r)});var n=e.getKeyPSAppDEField().codeName.toLowerCase(),i=e.getMajorPSAppDEField().codeName.toLowerCase();Object.defineProperty(this,"srfdename",{get:function(){return e.codeName}}),Object.defineProperty(this,"srfkey",{set:function(t){this.data[n]=t},get:function(){return this.data[n]}}),Object.defineProperty(this,"srfmajortext",{set:function(t){this.data[i]=t},get:function(){return this.data[i]}}),this.defineProperties()}return Object.defineProperty(t.prototype,"srfuf",{get:function(){return this.srfkey?Srfuf.UPDATE:Srfuf.CREATE},enumerable:!1,configurable:!0}),t.prototype.defineProperties=function(){var t=this.data,e={};(this.entity.getAllPSAppDEFields()||[]).forEach((function(r){var n=r.codeName.toLowerCase();e[n]={enumerable:!0,set:function(e){t[n]=e},get:function(){return t[n]}}})),Object.defineProperties(this,e)},t.prototype.clone=function(){return new t(this.entity,this.data)},t.prototype.assign=function(e){return e instanceof t?Object.assign(this.data,e.data):Object.assign(this.data,e),this},t}(),MethodDto=function(){function t(t){this.dto=t,this.dtoMap=new Map,t?(this.app=ibiz.hub.getApp(t.getPSModelService().app),this.fields=t.getPSAppDEMethodDTOFields()||[]):this.fields=[]}return Object.defineProperty(t.prototype,"entity",{get:function(){var t;return this._entity||(this._entity=new AppEntityModel(null===(t=this.dto)||void 0===t?void 0:t.getParentPSModelObject("app.dataentity.IPSAppDataEntity"))),this._entity},enumerable:!1,configurable:!0}),t.prototype.get=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,s,a,c,u,l,h,p,d,f;return __generator(this,(function(v){switch(v.label){case 0:r={},n=0,v.label=1;case 1:if(!(n<this.fields.length))return[3,13];switch(i=this.fields[n],o=i.codeName.toLowerCase(),i.type){case"SIMPLE":return[3,2];case"DTOS":return[3,3]}return[3,11];case 2:return s=e[o],isNilOrEmpty(s)?r[o]=null:r[o]=s,[3,12];case 3:return[4,this.getFieldDto(i)];case 4:return a=v.sent(),c=i.getRefPSAppDataEntity(),[4,this.app.es.getService(c.codeName)];case 5:if(u=v.sent(),!(l=u.local.getList(t)))return[3,10];h=[],p=0,v.label=6;case 6:return p<l.length?(f=(d=h).push,[4,a.get(t,l[p])]):[3,9];case 7:f.apply(d,[v.sent()]),v.label=8;case 8:return p++,[3,6];case 9:r[o]=h,v.label=10;case 10:return[3,12];case 11:throw new UnsupportedModelError(i,"未支持的应用实体方法输入属性类型: ".concat(i.type));case 12:return n++,[3,1];case 13:return[2,r]}}))}))},t.prototype.set=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,s=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,this.app.es.getService(this.entity.codeName)];case 1:return r=a.sent(),[4,this.fields.filter((function(t){return"DTOS"===t.type})).map((function(r){return __awaiter(s,void 0,void 0,(function(){var n,i,o,s,a;return __generator(this,(function(c){switch(c.label){case 0:return n=r.codeName.toLowerCase(),[4,this.getFieldDto(r)];case 1:if(i=c.sent(),!(o=e[n]))return[3,5];s=0,c.label=2;case 2:return s<o.length?(a=o[s],[4,i.set(t,a)]):[3,5];case 3:c.sent(),c.label=4;case 4:return s++,[3,2];case 5:return[2]}}))}))}))];case 2:n=a.sent(),i=0,a.label=3;case 3:return i<n.length?[4,n[i]]:[3,6];case 4:a.sent(),a.label=5;case 5:return i++,[3,3];case 6:return o=new Entity(this.entity.source,e),this.entity.isLocalMode?[4,r.local.add(t,o)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[2,o]}}))}))},t.prototype.getFieldDto=function(e){var r;return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return this.dtoMap.has(e.codeName)?[2,this.dtoMap.get(e.codeName)]:[4,null===(r=e.getRefPSAppDataEntity())||void 0===r?void 0:r.fill(!0)];case 1:return i.sent(),n=new t(e.getRefPSAppDEMethodDTO()),this.dtoMap.set(e.codeName,n),[2,n]}}))}))},t}(),MethodInput=function(){function t(t,e){this.entity=t,this.input=e;var r=null==e?void 0:e.getPSAppDEMethodDTO();r&&(this.dto=new MethodDto(r))}return t.prototype.handle=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.dto?[2,this.dto.get(t,e)]:[2,e]}))}))},t}(),MethodReturn=function(){function t(t,e){this.entity=t,this.output=e,this.app=ibiz.hub.getApp(t.modelService.app);var r=null==e?void 0:e.getPSAppDEMethodDTO();r&&(this.dto=new MethodDto(r))}return t.prototype.handle=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.dto?(this.app.es.clearTempCache(t),[2,this.dto.set(t,e)]):[2,new Entity(this.entity.source,e)]}))}))},t}(),Method=function(){function t(t,e,r){this.entity=t,this.method=e,this.paths=r,this.app=ibiz.hub.getApp(t.modelService.app),this.input=new MethodInput(t,e.getPSAppDEMethodInput()),this.result=new MethodReturn(t,e.getPSAppDEMethodReturn())}return t.prototype.request=function(t,e,r,n){return __awaiter(this,void 0,void 0,(function(){var e,i,o;return __generator(this,(function(s){switch(s.label){case 0:switch(e=this.method.requestMethod,i=this.method.codeName.toLowerCase(),o=null,e){case"POST":return[3,1];case"GET":return[3,3];case"PUT":return[3,5];case"DELETE":return[3,7]}return[3,9];case 1:return[4,this.app.net.post("".concat(t,"/").concat(i),r,n)];case 2:case 4:case 6:case 8:return o=s.sent(),[3,10];case 3:return[4,this.app.net.get("".concat(t,"/").concat(i),r,n)];case 5:return[4,this.app.net.put("".concat(t,"/").concat(i),r,n)];case 7:return[4,this.app.net.delete("".concat(t,"/").concat(i),r,n)];case 9:throw new DefectModelError(this.method,e?"未支持的请求方式: ".concat(e):"未配置请求方式");case 10:return[2,o]}}))}))},t.prototype.calcPath=function(t){var e="/".concat(this.entity.deNamePlural);return calcResPath(t,this.paths)+e},t.prototype.getService=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return this.service?[3,2]:(t=this,[4,this.app.es.getService(this.entity.codeName)]);case 1:t.service=e.sent(),e.label=2;case 2:return[2,this.service]}}))}))},t.prototype.createEntity=function(t){return new Entity(this.entity.source,t)},t}(),DEActionMethod=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return this.entity.isLocalMode?[3,2]:[4,this.input.handle(t,e)];case 1:e=s.sent(),s.label=2;case 2:switch(n=this.calcPath(t),this.method.needResourceKey&&(n="".concat(n,"/").concat(t[this.entity.deName])),this.method.codeName){case"Create":return[3,3];case"Get":return[3,4];case"GetDraft":return[3,5];case"Remove":return[3,6];case"Update":return[3,7];case"CreateTemp":return[3,8];case"GetTemp":return[3,9];case"GetDraftTemp":return[3,10];case"RemoveTemp":return[3,11];case"UpdateTemp":return[3,12]}return[3,13];case 3:return[2,this.create(t,e,r)];case 4:return[2,this.get(t,e)];case 5:return[2,this.getDraft(t,e)];case 6:return[2,this.remove(t,e)];case 7:return[2,this.update(t,e,r)];case 8:return[2,this.createTemp(t,e)];case 9:return[2,this.getTemp(t,e)];case 10:return[2,this.getDraftTemp(t,e)];case 11:return[2,this.removeTemp(t,e)];case 12:return[2,this.updateTemp(t,e)];case 13:return[4,this.request(n,t,e,r)];case 14:return i=s.sent(),o=i,[4,this.result.handle(t,i.data)];case 15:return o.data=s.sent(),[2,i]}}))}))},e.prototype.create=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return this.entity.isLocalMode?[2,this.createTemp(t,this.createEntity(e))]:(n=this.calcPath(t),[4,this.app.net.post(n,e,r)]);case 1:return i=s.sent(),o=i,[4,this.result.handle(t,i.data)];case 2:return o.data=s.sent(),[2,i]}}))}))},e.prototype.remove=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return this.entity.isLocalMode?[2,this.removeTemp(t,e)]:(r=this.calcPath(t),[4,this.app.net.delete("".concat(r,"/").concat(t[this.entity.deName]),e)]);case 1:return[2,n.sent()]}}))}))},e.prototype.update=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return this.entity.isLocalMode?[2,this.updateTemp(t,this.createEntity(e))]:(n=this.calcPath(t),[4,this.app.net.put("".concat(n,"/").concat(t[this.entity.deName]),e,r)]);case 1:return i=s.sent(),o=i,[4,this.result.handle(t,i.data)];case 2:return o.data=s.sent(),[2,i]}}))}))},e.prototype.get=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return this.entity.isLocalMode?[2,this.getTemp(t,e)]:(r=this.calcPath(t),[4,this.app.net.get("".concat(r,"/").concat(t[this.entity.deName]),e)]);case 1:return n=o.sent(),i=n,[4,this.result.handle(t,n.data)];case 2:return i.data=o.sent(),[2,n]}}))}))},e.prototype.getDraft=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return this.entity.isLocalMode?[2,this.getDraftTemp(t,e)]:(r=this.calcPath(t),[4,this.app.net.get("".concat(r,"/getdraft"),e)]);case 1:return n=o.sent(),i=n,[4,this.result.handle(t,n.data)];case 2:return i.data=o.sent(),[2,n]}}))}))},e.prototype.createTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getService()];case 1:return[4,i.sent().local.add(t,this.createEntity(e))];case 2:return r=i.sent(),[2,new HttpResponse(r)];case 3:return n=i.sent(),[2,new HttpResponse(n,500)];case 4:return[2]}}))}))},e.prototype.getDraftTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){try{return(t=this.createEntity({}))?[2,new HttpResponse(t)]:[2,new HttpResponse(t,500)]}catch(t){return[2,new HttpResponse(t,500)]}return[2]}))}))},e.prototype.removeTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),r=null,e&&(r=e[this.entity.keyName]),!r&&t&&(r=t[this.entity.deName]),[4,this.getService()];case 1:return n=s.sent(),(i=n.local.delete(t,r))?[2,new HttpResponse(i)]:[2,new HttpResponse(i,500)];case 2:return o=s.sent(),[2,new HttpResponse(o,500)];case 3:return[2]}}))}))},e.prototype.updateTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getService()];case 1:return r=o.sent(),(n=r.local.update(t,this.createEntity(e)))?[2,new HttpResponse(n)]:[2,new HttpResponse(n,500)];case 2:return i=o.sent(),[2,new HttpResponse(i,500)];case 3:return[2]}}))}))},e.prototype.getTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),r=null,e&&(r=e[this.entity.keyName]),!r&&t&&(r=t[this.entity.deName]),[4,this.getService()];case 1:return n=s.sent(),(i=n.local.get(t,r))?[2,new HttpResponse(i)]:[2,new HttpResponse(i,500)];case 2:return o=s.sent(),[2,new HttpResponse(o,500)];case 3:return[2]}}))}))},e.prototype.removeBatchTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:if(!e)return[3,5];if(!(r=e[this.entity.keyName]))return[3,5];i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.getService()];case 2:return[4,i.sent().local.deleteBatch(t,r)];case 3:return i.sent(),[3,5];case 4:return n=i.sent(),[2,new HttpResponse(n,500)];case 5:return[2,new HttpResponse(!0)]}}))}))},e}(Method),FetchMethod=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,a=this;return __generator(this,(function(c){switch(c.label){case 0:return this.entity.isLocalMode?[4,this.searchLocal(null,new SearchFilter(t,e))]:[3,2];case 1:return n=c.sent(),[2,new HttpResponse(n,200)];case 2:return i=this.calcPath(t),[4,this.request(i,t,e,r)];case 3:return o=c.sent(),s=o.data||[],o.data=s.map((function(t){return a.createEntity(t)})),[2,o]}}))}))},e.prototype.selectLocal=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r,n,i,o,s,a,c,u,l,h,p,d,f;return __generator(this,(function(v){switch(v.label){case 0:return[4,this.getService()];case 1:if(r=v.sent(),n=r.local.getList(t),n=ascSort(n,"srfordervalue"),i={},notNilEmpty(t)&&(o=this.entity.majorKeyMap))for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&(l=o[u],notNilEmpty(t[u])&&(i[l]=equals(t[u])));for(u in s={},a={},c={},e.srfkey&&(i.srfkey=equals(e.srfkey),delete e.srfkey),e)Object.prototype.hasOwnProperty.call(e,u)&&(null==(l=e[u])?(s[u]=equals(null),a[u]=equals(void 0),c[u]=equals("")):i[u]=equals(l));return isEmpty(i)||(h=where(i),p=where(s),d=where(a),f=where(c),n=n.filter((function(t){if(isEmpty(s)){if(h(t))return!0}else if(h(t)&&(p(t)||d(t)||f(t)))return!0;return!1}))),[2,n.map((function(t){return t.clone()}))]}}))}))},e.prototype.searchLocal=function(t,e,r){return void 0===r&&(r=this.entity.quickSearchKeys),__awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,c;return __generator(this,(function(u){switch(u.label){case 0:return[4,this.getService()];case 1:return n=u.sent(),i=[],t?((i=n.local.getList(e.context)).length>0&&(i=i.filter((function(r){return t.test(r,e)}))),[3,4]):[3,2];case 2:return[4,this.selectLocal(e.context)];case 3:(i=u.sent()).length>0&&e.query&&""!==e.query&&r&&(i=i.filter((function(t){for(var n=new RegExp(e.query),i=0;i<r.length;i+=1){var o=t[r[i]];if(n.test(o))return!0}return!1}))),u.label=4;case 4:return isNil(e.sortField)||isEmpty(e.sortField)||(i="DESC"===e.sortMode?descSort(i,e.sortField):ascSort(i,e.sortField)),o=e.page,s=e.size,a=o*s,c=(o+1)*s-1,[2,i.slice(a,c).map((function(t){return clone(t)}))]}}))}))},e}(Method),FileService=function(){function t(t,e){this.model=t,this.paths=e}return t.prototype.exportData=function(t,e,r,n){var i=calcResPath(r,this.paths),o="".concat(i,"/").concat(this.model.deNamePlural,"/exportdata/").concat(e.toLowerCase(),"/?srfexporttag=").concat(t.codeName);return ibiz.net.request(o,{method:"post",data:n,responseType:"blob"})},t}(),EntityService=exports("EntityService",function(){function t(t,e){this.model=t,this.paths=e,this.methodMap=new Map,this.local=new EntityCache,this.wf=new WorkFlowService(t),this.file=new FileService(t,e)}return t.prototype.getMethod=function(t){if(this.methodMap.has(t))return this.methodMap.get(t);var e=this.model.findPSAppDeMethod(t),r=null;switch(e.methodType){case"DEACTION":r=new DEActionMethod(this.model,e,this.paths);break;case"FETCH":case"FETCHTEMP":r=new FetchMethod(this.model,e,this.paths);break;default:throw new UnsupportedModelError(e,"未支持的服务方法类型: ".concat(e.methodType))}return this.methodMap.set(t,r),r},t.prototype.exec=function(t,e,r,n){void 0===r&&(r={}),void 0===n&&(n={});var i=this.getMethod(t);if(i)return i.exec(e,r,n);throw new RuntimeError("".concat(this.model.deName,"未支持「").concat(t,"」方法"))},t.prototype.getPath=function(t,e,r,n){void 0===r&&(r={}),void 0===n&&(n={});var i=this.getMethod(t);if(i)return i.exec(e,r,n);throw new RuntimeError("".concat(this.model.deName,"未支持「").concat(t,"」方法"))},t}()),ControlVO=exports("ControlVO",function(){function t(t,e){var r=this;t&&e&&(Object.defineProperty(this,"$origin",{enumerable:!1,configurable:!0,value:t||{}}),Object.defineProperty(this,"$dataUIMap",{enumerable:!1,configurable:!0,value:e||new Map}),this.$dataUIMap.forEach((function(t,e){var n=t.dataKey;r.linkProperty(e,n,t.isOriginField)})),Object.keys(t).forEach((function(t){Object.prototype.hasOwnProperty.call(r,t)||r.linkProperty(t,t)})))}return Object.defineProperty(t.prototype,"srfuf",{get:function(){return isNil(this.$origin.srfuf)?this.srfkey?Srfuf.UPDATE:Srfuf.CREATE:this.$origin.srfuf},enumerable:!1,configurable:!0}),t.prototype.linkProperty=function(t,e,r){void 0===r&&(r=!0),"srfuf"!==t&&(r?Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:function(){return this.$origin[e]},set:function(t){this.$origin[e]=t}}):Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:null}))},t.prototype.getOrigin=function(){return this.$origin},t.prototype.getRequestData=function(){var t=this,e=__assign({},this.$origin);return this.$dataUIMap.forEach((function(r){r.isRequestNeed!==r.isOriginField&&(e[r.dataKey]=t[r.uiKey])})),e},t.prototype.setOrigin=function(e){this.$origin=e instanceof t?e.getOrigin():e},t.prototype.mergeOrigin=function(e){Object.assign(this.$origin,e instanceof t?e.getOrigin():e)},t.prototype.reactiveInit=function(){var t=this;this.$dataUIMap.forEach((function(e,r){void 0===t.$origin[r]&&(t.$origin[r]=null)}))},t}()),UIMapField=function(t,e,r){void 0===r&&(r={}),this.isOriginField=!1,this.isRequestNeed=!0,this.uiKey=t,this.dataKey=e,isNil(r.isOriginField)||(this.isOriginField=r.isOriginField),isNil(r.isRequestNeed)||(this.isRequestNeed=r.isRequestNeed)},ControlService=exports("ControlService",function(){function t(t){this.dataUIMap=new Map,this.app=ibiz.hub.getApp(t.modelService.app),this.model=t}return Object.defineProperty(t.prototype,"appEntity",{get:function(){return this.model.appEntity},enumerable:!1,configurable:!0}),t.prototype.init=function(t){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return t=this,[4,this.app.es.getService(this.appEntity.source.codeName)];case 1:return t.entityService=e.sent(),this.initUIDataMap(),[2]}}))}))},t.prototype.initUIDataMap=function(){var t,e=this.model.appEntity.deName.toLowerCase(),r=null===(t=this.model.source.getPSAppDataEntity().getKeyPSAppDEField())||void 0===t?void 0:t.codeName;if(r){var n=new UIMapField(e,r.toLowerCase(),{isOriginField:!0});this.dataUIMap.set(e,n),this.dataUIMap.set("srfkey",n)}},t.prototype.exec=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,this.entityService.exec(t,e,r)];case 1:return[2,n.sent()]}}))}))},t.prototype.handleResponse=function(t){return t},t.prototype.toUIData=function(t){return new ControlVO(t,this.dataUIMap)},t}()),MDControlService=exports("MDControlService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.fetch=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.fetchAction,t,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.get=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.getAction,t,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.getDraft=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.getDraftAction,t,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.remove=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,this.exec(this.model.removeAction,t,e)];case 1:return[2,r.sent()]}}))}))},e.prototype.create=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.createAction,t,e.getRequestData())];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.update=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.updateAction,t,e.getRequestData())];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.exportData=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.entityService.file.exportData(t,this.model.fetchAction,e,r)]}))}))},e.prototype.handleResponse=function(e){var r=this,n=t.prototype.handleResponse.call(this,e);return n.headers&&(n.headers["x-page"]&&(n.page=Number(n.headers["x-page"])),n.headers["x-per-page"]&&(n.size=Number(n.headers["x-per-page"])),n.headers["x-total"]&&(n.total=Number(n.headers["x-total"]))),n.ok&&(isArray(n.data)?n.data=n.data.map((function(t){return r.toUIData(t)})):n.data=this.toUIData(n.data)),n},e}(ControlService)),GridService=exports("GridService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initUIDataMap=function(){var e,r=this;t.prototype.initUIDataMap.call(this),null===(e=this.model.source.getPSDEGridDataItems())||void 0===e||e.forEach((function(t){var e,n=t.name.toLowerCase(),i=t.getPSAppDEField();if(i){var o=i.codeName.toLowerCase();e=new UIMapField(n,o,{isOriginField:!0})}else e=new UIMapField(n,n,{isRequestNeed:!1});r.dataUIMap.set(n,e)})),this.model.fieldColumns.forEach((function(t){if(t.source.dataItemName!==t.codeName){var e=r.dataUIMap.get(t.source.dataItemName);e&&r.dataUIMap.set(t.codeName,e)}}))},e.prototype.updateGridEditItem=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.entityService.exec(t,e,r)];case 1:return n=i.sent(),[2,n=this.handleResponse(n)]}}))}))},e}(MDControlService)),ListService=exports("ListService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initUIDataMap=function(){var e,r=this;t.prototype.initUIDataMap.call(this),null===(e=this.model.source.getPSDEListDataItems())||void 0===e||e.forEach((function(t){var e,n=t.name.toLowerCase(),i=t.getPSAppDEField();if(i){var o=i.codeName.toLowerCase();e=new UIMapField(n,o,{isOriginField:!0})}else e=new UIMapField(n,n,{isRequestNeed:!1});r.dataUIMap.set(n,e)}))},e}(MDControlService)),TreeNodeData=function(t,e,r){this.parent=e,this.nodeId=t.nodeId,this.leaf=0===t.tree.getChildNodes(t.nodeId,r.hasQuery).length},TreeDataSetNodeData=exports("TreeDataSetNodeData",function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this,o=n.data;return i.deData=o,i.text=o.srfmajortext,i.value=o.srfkey,i.id=r?"".concat(r.id,":").concat(o.srfkey):o.srfkey,i.id=i.id.toLowerCase(),i}return __extends(e,t),e}(TreeNodeData)),TreeStaticNodeData=exports("TreeStaticNodeData",function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.value=e.nodeValue||r.value,i.id=r?"".concat(r.id,":").concat(e.nodeId):e.nodeId,i.id=i.id.toLowerCase(),i.text=e.text,i}return __extends(e,t),e}(TreeNodeData)),TreeService=exports("TreeService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initUIDataMap=function(){t.prototype.initUIDataMap.call(this)},e.prototype.fetchChildNodes=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o=this;return __generator(this,(function(s){switch(s.label){case 0:return 0===(r=this.model.getChildNodeRSs((null==t?void 0:t.nodeId)||this.model.rootNode.id,e.hasQuery)).length?[2]:[4,Promise.allSettled(r.map((function(r){return __awaiter(o,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return"STATIC"!==(n=r.childNode).treeNodeType?[3,2]:[4,this.getStaticNodeData(r,t,e)];case 1:return[2,[i.sent()]];case 2:return"DE"===n.treeNodeType?[2,this.getDENodeDatas(r,t,e)]:"CODELIST"===n.treeNodeType?[2,this.getCodeListNodeDatas(r,t,e)]:[2,void 0]}}))}))})))];case 1:return n=s.sent(),i=[],n.forEach((function(t){"fulfilled"===t.status&&t.value&&i.push.apply(i,__spreadArray([],__read(t.value),!1))})),[2,i]}}))}))},e.prototype.getStaticNodeData=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return n=t.childNode,i=new TreeStaticNodeData(n,e,r),n.expanded?(o=i,[4,this.fetchChildNodes(i,r)]):[3,2];case 1:o.children=s.sent(),s.label=2;case 2:return[2,i]}}))}))},e.prototype.getParentFilterParams=function(t,e){var r,n=t.parentFilter,i=t.parentValueLevel;if(e&&n){for(var o=e,s=1;s<i;s++)o=null==o?void 0:o.parent;if(null==o?void 0:o.value)return(r={})["n_".concat(n,"_eq")]=o.value,r}},e.prototype.getDENodeDatas=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,s,a,c;return __generator(this,(function(u){switch(u.label){case 0:return n=t.childNode,i=n.methodName,o=n.appEntity,[4,this.app.es.getService(o.codeName)];case 1:return s=u.sent(),a=__assign(__assign({},r.params),this.getParentFilterParams(t,e)||{}),[4,s.exec(i,r.context,a)];case 2:return(c=u.sent()).data.length?[2,c.data.map((function(t){return new TreeDataSetNodeData(n,e,__assign(__assign({},r),{data:t}))}))]:[2,[]]}}))}))},e.prototype.getCodeListNodeDatas=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},e}(MDControlService)),EditFormService=exports("EditFormService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.getAction,t,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.getDraft=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.getDraftAction,t,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.remove=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,this.exec(this.model.removeAction,t,e)];case 1:return[2,r.sent()]}}))}))},e.prototype.create=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.createAction,t,e.getRequestData())];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.update=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.updateAction,t,e.getRequestData())];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.updateFormItem=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.entityService.exec(t,e,r)];case 1:return n=i.sent(),[2,n=this.handleResponse(n)]}}))}))},e.prototype.wfStart=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!this.model.wfStartAction)throw new DefectModelError(this.model.source,"不存在工作流启动行为");return[2,this.entityService.wf.exec(this.model.wfStartAction,t,e,r.getRequestData())]}))}))},e.prototype.wfSubmit=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!this.model.wfSubmitAction)throw new DefectModelError(this.model.source,"不存在工作流提交行为");return[2,this.entityService.wf.exec(this.model.wfSubmitAction,t,e,r.getRequestData())]}))}))},e.prototype.initUIDataMap=function(){var e=this;t.prototype.initUIDataMap.call(this);var r=["srfwfmemo","srfnextform","srfactionparam","srffrontuf"];this.model.source.getPSDEFormItems().forEach((function(t){var n,i=t.id.toLowerCase(),o=t.getPSAppDEField();if(o){var s=o.codeName.toLowerCase();n=new UIMapField(i,s,{isOriginField:!0})}else n=new UIMapField(i,i,{isRequestNeed:r.includes(i),isOriginField:r.includes(i)});e.dataUIMap.set(i,n)}))},e.prototype.handleResponse=function(e){var r=t.prototype.handleResponse.call(this,e);return r.ok&&r.data&&(r.data=this.toUIData(r.data)),r},e}(ControlService)),SearchFormService=exports("SearchFormService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.getDraft=function(t,e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return t={ok:!0,status:200,data:{}},[2,t=this.handleResponse(t)]}))}))},e.prototype.initUIDataMap=function(){var t,e=this;null===(t=this.model.source.getPSDEFormItems())||void 0===t||t.forEach((function(t){var r=t.id.toLowerCase();e.dataUIMap.set(r,new UIMapField(r,r))}))},e.prototype.handleResponse=function(e){var r=t.prototype.handleResponse.call(this,e);return r.ok&&r.data&&(r.data=this.toUIData(r.data)),r},e}(ControlService)),AuthService=exports("AuthService",function(){function t(){}return t.prototype.v7login=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,ibiz.net.post("/v7/login",{loginname:t,password:e},{},{})];case 1:return[2,r.sent()]}}))}))},t.prototype.v7logout=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,ibiz.net.get("/v7/logout",{})];case 1:return[2,t.sent()]}}))}))},t}()),AuthorityService=exports("AuthorityService",function(){function t(t){this.modelService=t,this.isInit=!1,this.resCodes=[],this.enableResValidate=!0,this.rtMenuCodes=[],this.opPrivs=[]}return t.prototype.init=function(t){return void 0===t&&(t=ibiz.appData),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!t)throw new RuntimeError("没有appData数据");return t.unires&&(this.resCodes=t.unires),!1===t.enablepermissionvalid&&(this.enableResValidate=!1),[4,this.calcOPPrivs(this.resCodes)];case 1:return e.sent(),t.appmenu&&(this.rtMenuCodes=t.appmenu),[2]}}))}))},t.prototype.calcOPPrivs=function(t){var e;return __awaiter(this,void 0,void 0,(function(){var r,n=this;return __generator(this,(function(i){return r=this.modelService.app,this.opPrivs=[],(null===(e=r.getAllPSDEOPPrivs())||void 0===e?void 0:e.length)&&r.getAllPSDEOPPrivs().forEach((function(e){e.mapSysUniRes&&!t.includes(e.mapSysUniResCode)||n.opPrivs.push(e.name)})),[2]}))}))},t.prototype.hasMenuPermitted=function(t){if(!ibiz.env.enablePermission)return!0;switch(ibiz.env.menuPermissionMode){case MenuPermissionMode.RT:return this.calcMenuPermissionByRT(t);case MenuPermissionMode.RESOURCE:return this.calcMenuPermissionByResource(t);case MenuPermissionMode.MIXIN:return this.calcMenuPermissionByResource(t)||this.calcMenuPermissionByRT(t);default:return!0}},t.prototype.calcMenuPermissionByRT=function(t){return this.rtMenuCodes.includes(t.rtMenuCode)},t.prototype.calcMenuPermissionByResource=function(t){return!this.enableResValidate||!t.source.accessKey||this.resCodes.includes(t.source.accessKey)},t.prototype.hasUIActionPermitted=function(t,e,r){var n=t.dataAccessAction,i=t.uIActionTag,o=t.actionTarget;if(n){if(this.enableResValidate&&!this.opPrivs.includes(n))return!1;if(e){if(e.srfopprivs&&!e.srfopprivs.includes(n))return!1;if(!this.calcDeMainStatePermission(n,e,r))return!1}}return"SYS"!==t.uIActionMode||o||(o=["SAVE","SaveAndExit","Edit","Remove","RemoveAndExit"].includes(i)?"SINGLEKEY":"NONE"),!("NONE"!==o&&!e)},t.prototype.calcDeMainStatePermission=function(t,e,r){var n=r.source.getMainStatePSAppDEFields()||[];if(!r.source.enableDEMainState||0===n.length)return!0;var i=n.map((function(t){return e[t.codeName.toLowerCase()]})),o=r.findMainState(i[0],i[1],i[2]);return!o||o.opPrivs.includes(t)},t}()),ServiceUtil=exports("ServiceUtil",function(){function t(t){this.modelService=t,this.cache=new Map,this.allEntities=new Map}return t.prototype.initAllEntities=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){return 0!==this.allEntities.size||(this.modelService.app.getAllPSAppDataEntities()||[]).forEach((function(e){var r=e.isFill?e.codeName:e.refM.codeName;t.allEntities.set(r,e)})),[2]}))}))},t.prototype.getService=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return this.cache.has(t)?[3,5]:[4,this.initAllEntities()];case 1:if(s.sent(),!(e=this.allEntities.get(t)))throw new Error("找不到实体[".concat(t,"]模型"));return[4,e.fill(!0)];case 2:return s.sent(),[4,(r=new AppEntityModel(e)).init()];case 3:return s.sent(),n=ibiz.hub.getApp(this.modelService.app),i=n.resourcePathUtil.calcPaths(t),[4,new EntityService(r,i)];case 4:o=s.sent(),this.cache.set(t,o),s.label=5;case 5:return[2,this.cache.get(t)]}}))}))},t.prototype.clearTempCache=function(t){this.cache.forEach((function(e){e.local.clear(t)}))},t}());function generateRules(itemVRs,name,valueItemName){var rules=[];return itemVRs.forEach((function(item){var valueRuleType=item.valueRuleType,sysRule=item.getPSSysValueRule(),deRule=item.getPSDEFValueRule();if("SYSVALUERULE"===valueRuleType&&sysRule)"REG"===sysRule.ruleType?rules.push({pattern:new RegExp(sysRule.regExCode),message:sysRule.ruleInfo,trigger:"change blur"}):"SCRIPT"===sysRule.ruleType&&rules.push({validator:function(rule,value,callback,source){if(!value)return!0;try{eval(sysRule.scriptCode)}catch(t){console.error(t)}return!0},trigger:"change blur"});else if("DEFVALUERULE"===valueRuleType&&deRule){var valueName_1=valueItemName||name;rules.push({validator:function(t,e,r,n){if(isNilOrEmpty(n[valueName_1]))return!0;var i=IBizVerify.verifyDeRules(valueName_1,n,deRule.getPSDEFVRGroupCondition()),o=i.isPast,s=i.infoMessage;return o||r(new Error(s||deRule.ruleInfo)),!0},trigger:"change blur"})}})),rules}var ButtonState=exports("ButtonState",function(){function t(t,e,r){this.disabled=!1,this.visible=!0,this.loading=!1,this.permitted=!0,this.noPermissionMode="HIDDEN",this.app=ibiz.hub.getApp(r.modelService.app),this.name=t,Object.defineProperty(this,"uiAction",{enumerable:!1,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"entity",{enumerable:!1,configurable:!0,writable:!0,value:r}),1===this.uiAction.noPrivDisplayMode&&(this.noPermissionMode="DISABLED")}return t.prototype.update=function(t){var e=this.app.authority.hasUIActionPermitted(this.uiAction,t,this.entity);!this.permitted===e&&(this.permitted=e,this.disabled=!this.permitted,this.visible=this.permitted||"HIDDEN"!==this.noPermissionMode)},t}()),ButtonContainerState=exports("ButtonContainerState",function(){function t(){var t=this;Object.defineProperty(this,"children",{enumerable:!1,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:function(){return 0!==t.children.length&&!!t.children.find((function(t){return t.visible}))}})}return t.prototype.addState=function(t,e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e}),this.children.push(e)},t.prototype.setLoading=function(t){this.children.forEach((function(e){e.setLoading?e.setLoading(t):e.loading=!!t&&e.name===t}))},t.prototype.update=function(t){this.children.forEach((function(e){e.update(t)}))},t}()),DEACModeUtil=exports("DEACModeUtil",function(){function t(){}return t.calcFillDataItems=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return(r=e.dataItems).length?[4,Promise.all(r.map((function(e){var r=t[e.getPSAppDEField().codeName.toLowerCase()];return e.format||e.convertToCodeItemText&&e.getPSCodeList()||e.customCode,{name:e.name,value:r}})))]:[2,[]];case 1:return[2,n.sent()]}}))}))},t}()),ViewMode;function formatToCodeListText(t,e){return("string"==typeof t?t.split(","):[t]).map((function(t){var r=e.find((function(e){return e.value===t}));return(null==r?void 0:r.text)||t})).join(",")}function convertNavData(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return"[object Array]"===Object.prototype.toString.call(t)?convertNavDataByArray.apply(void 0,__spreadArray([t],__read(e),!1)):"[object Object]"===Object.prototype.toString.call(t)?convertNavDataByObject.apply(void 0,__spreadArray([t],__read(e),!1)):{}}function convertNavDataByArray(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o={},s=function(t){if(notNilEmpty(t.value)&&!t.rawValue){var e=n.find((function(e){return!isNilOrEmpty(e)&&(e[t.value]||Object.prototype.hasOwnProperty.call(e,t.value))}));e&&(o[t.key.toLowerCase()]=e[t.value])}else o[t.key.toLowerCase()]=t.value};try{for(var a=__values(t),c=a.next();!c.done;c=a.next()){var u=c.value;s(u)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}return o}function convertNavDataByObject(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n={},i=/^%(.+)%$/,o=function(r){if(notNilEmpty(t[r])&&i.test(t[r])){var o=t[r].substring(1,t[r].length-1),s=e.find((function(t){return Object.prototype.hasOwnProperty.call(t,o)}));s&&(n[r.toLowerCase()]=s[o])}else n[r.toLowerCase()]=t[r]};for(var s in t)o(s);return n}exports("ViewMode",ViewMode),function(t){t.ROUTE="ROUTE",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t.POPOVER="POPOVER"}(ViewMode||exports("ViewMode",ViewMode={}));var AppDEUIActionUtil=exports("AppDEUIActionUtil",function(){function t(){}return t.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,ibiz.register.uiAction.get(t)];case 1:return[4,o.sent().getHandler()];case 2:return[2,o.sent().exec(t,e,r,n,i)]}}))}))},t}()),UIActionHandler=exports("UIActionHandler",function(){function t(){}return t.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,s,a;return __generator(this,(function(c){switch(c.label){case 0:return[4,this.isConfirm(t)];case 1:return c.sent()?(o=i.neuron,s={refresh:t.reloadData,closeView:t.closeEditView},[4,this.execAction(t,e,r,n,i)]):[2,{}];case 2:return a=c.sent(),Object.assign(s,a),[4,this.doNextAction(t,e,r,n,i)];case 3:return c.sent(),[4,this.handleResult(s,o)];case 4:return c.sent(),[2,s]}}))}))},t.prototype.isConfirm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.enableConfirm&&t.confirmMsg?[2,ibiz.modal.confirm({title:t.confirmMsg})]:[2,!0]}))}))},t.prototype.doNextAction=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(s){switch(s.label){case 0:return(o=t.getNextPSUIAction())?[4,AppDEUIActionUtil.exec(o,e,r,n,i)]:[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}}))}))},t.prototype.handleResult=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:if(!t.closeView)return[3,2];if(!e.call.closeView)throw new RuntimeError("该视图不存在关闭视图能力");return[4,e.call.closeView()];case 1:return r.sent(),[2];case 2:if(!t.refresh)return[3,4];if(!e.call.refresh)throw new RuntimeError("该视图不存在刷新能力");return[4,e.call.refresh()];case 3:r.sent(),r.label=4;case 4:return[2]}}))}))},t.prototype.handleParams=function(t,e,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,s,a,c,u,l,h,p,d;return __generator(this,(function(f){switch(f.label){case 0:if(i=r||[],-1!==["SINGLEDATA","MULTIDATA","MULTIKEY"].indexOf(t.actionTarget))throw new Error("数据类型".concat(t.actionTarget,"暂未支持,请配置无数据或单项数据主键"));return"NONE"===t.actionTarget&&(i=[]),o={},s=t.getPSNavigateContexts()||[],a=t.getPSAppDataEntity(),c=t.valueItem,u=t.paramItem,a&&"SINGLEKEY"===t.actionTarget?[4,null==a?void 0:a.fill(!0)]:[3,2];case 1:f.sent(),l=a.codeName.toLowerCase(),s.unshift({key:u||l,value:c||"srfkey",rawValue:!1}),f.label=2;case 2:return notNilEmpty(s)&&(o=convertNavData(s,e,n,(null==r?void 0:r[0])||{})),h=new IBizContext(o,e),p={},d=t.getPSNavigateParams(),notNilEmpty(d)&&(p=convertNavData(d,e,n,(null==r?void 0:r[0])||{})),[2,{resultContext:h,resultData:i,resultParams:p}]}}))}))},t}()),CommonSysUIActionHandler=exports("CommonSysUIActionHandler",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.execAction=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var e,n,o,s,a;return __generator(this,(function(c){switch(c.label){case 0:if(n=(e=i).neuron,o=e.event,s=t.uIActionTag,a={},"New"!==s)return[3,2];if(!n.call.newData)throw new Error("该视图不存在newData能力");return[4,n.call.newData(o)];case 1:c.sent(),c.label=2;case 2:if("Edit"!==s)return[3,4];if(!n.call.openData)throw new Error("该视图不存在openData能力");return[4,n.call.openData(null==r?void 0:r[0],o)];case 3:c.sent(),c.label=4;case 4:if(-1===["SaveAndExit","Save","SaveRow"].indexOf(s))return[3,6];if(!n.call.save)throw new Error("该视图不存在save能力");return[4,n.call.save()];case 5:c.sent(),c.label=6;case 6:if("SaveAndNew"!==s)return[3,8];if(!n.call.saveAndNew)throw new Error("该视图不存在saveAndNew能力");return[4,n.call.saveAndNew()];case 7:c.sent(),c.label=8;case 8:if("Remove"!==s&&"RemoveAndExit"!==s)return[3,10];if(!n.call.remove)throw new Error("该视图不存在remove能力");return[4,n.call.remove()];case 9:c.sent(),c.label=10;case 10:if("NewRow"!==s)return[3,12];if(!n.call.newRow)throw new Error("该视图不存在newRow能力");return[4,n.call.newRow()];case 11:c.sent(),c.label=12;case 12:if("ToggleFilter"===s){if(!n.call.toggleFilter)throw new Error("该视图不存在ToggleFilter能力");n.call.toggleFilter()}if("Import"===s){if(!n.call.importData)throw new Error("该视图不存在Import能力");n.call.importData()}if("ExportExcel"===s){if(!n.call.exportData)throw new Error("该视图不存在ExportExcel能力");n.call.exportData(o)}if("SaveAndStart"!==s)return[3,14];if(!n.call.wfStart)throw new Error("该视图不存在SaveAndStart能力");return[4,n.call.wfStart()];case 13:c.sent(),c.label=14;case 14:if("ViewWFStep"!==s)return[3,16];if(!n.call.wfSubmit)throw new Error("该视图不存在ViewWFStep能力");return[4,n.call.wfSubmit()];case 15:c.sent(),c.label=16;case 16:return-1!==["SaveAndExit","Exit","RemoveAndExit"].indexOf(s)&&(a.closeView=!0),-1!==["Refresh"].indexOf(s)&&(a.refresh=!0),[2,a]}}))}))},e}(UIActionHandler)),BackendUIActionHandler=exports("BackendUIActionHandler",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.execAction=function(t,e,r,n,i){var o,s,a;return __awaiter(this,void 0,void 0,(function(){var i,c,u,l,h,p,d,f;return __generator(this,(function(v){switch(v.label){case 0:if(i=null===(o=t.getPSAppDataEntity())||void 0===o?void 0:o.codeName,c=null===(s=t.getPSAppDEMethod())||void 0===s?void 0:s.codeName,!i||!c)throw new Error("找不到实体或实体行为");return[4,this.handleParams(t,e,r,n)];case 1:return u=v.sent(),l=u.resultContext,h=u.resultParams,p=u.resultData,[4,ibiz.hub.getApp(t.getPSModelService().app).es.getService(i)];case 2:return d=v.sent(),f=p.length>0?(null===(a=p[0])||void 0===a?void 0:a.getRequestData())||p[0]:{},[4,d.exec(c,l,f,h)];case 3:return v.sent(),[2,{}]}}))}))},e}(UIActionHandler)),OpenAppViewCommand=exports("OpenAppViewCommand",function(){function t(){ibiz.commands.register(t.TAG,this.exec.bind(this))}return t.prototype.exec=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),__awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(o){switch(o.label){case 0:return[4,t.fill(!0)];case 1:if(o.sent(),t.redirectView)return[2,openRedirectView(t,e,r,n.data)];switch(i=t.openMode,void 0===i?"INDEXVIEWTAB":i){case"INDEXVIEWTAB":default:return[2,this.openIndexViewTab(t,e,r)];case"POPUP":throw new Error("未支持的视图打开模式: POPUP");case"POPUPMODAL":return[2,this.openModal(t,e,r)];case"POPUPAPP":throw new Error("未支持的视图打开模式: POPUPAPP");case"POPOVER":return[2,this.openPopover(t,n.event,e,r)];case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return[2,this.openDrawer(t,e,r)];case"USER":return[2,this.openUserCustom(t,e,r)]}return[2]}}))}))},t.prototype.openIndexViewTab=function(t,e,r){return void 0===r&&(r={}),ibiz.openView.root(t,e,r)},t.prototype.openModal=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,ibiz.openView.modal(t,e,r)]}))}))},t.prototype.openPopover=function(t,e,r,n){return void 0===n&&(n={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,ibiz.openView.popover(t,e,r,n)]}))}))},t.prototype.openDrawer=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,ibiz.openView.drawer(t,e,r)]}))}))},t.prototype.openUserCustom=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,ibiz.openView.custom(t,e,r)]}))}))},t.TAG="ibiz.app-view.open",t}()),AppFuncCommand=exports("AppFuncCommand",function(){function t(){ibiz.commands.register(t.TAG,this.exec.bind(this))}return t.prototype.exec=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),__awaiter(this,void 0,void 0,(function(){var i,o;return __generator(this,(function(s){switch((i=t.getPSNavigateContexts())&&(e?Object.assign(e,i):e=new IBizContext(i)),(o=t.getPSNavigateParams())&&Object.assign(r,o),t.appFuncType){case"APPVIEW":return[2,this.openAppView(t,e,r,n)];case"OPENHTMLPAGE":return[2,this.openHtmlPage(t)];case"PDTAPPFUNC":return[2,this.openPdAppFunc(t,e,r)];case"JAVASCRIPT":return[2,this.executeJavaScript(t,e,r)];case"CUSTOM":return[2,this.custom(t,e,r)];default:throw new Error("未知的应用功能类型: ".concat(t.appFuncType))}}))}))},t.prototype.openAppView=function(t,e,r,n){var i=t.getPSAppView();if(!i)throw new Error("应用视图不存在");return ibiz.commands.execute(OpenAppViewCommand.TAG,i,e,r,n)},t.prototype.openHtmlPage=function(t){var e=t.htmlPageUrl;window.open(e,"_blank")},t.prototype.openPdAppFunc=function(t,e,r){throw ibiz.log.warn("openPdAppFunc",t,e,r),new Error("未实现")},t.prototype.executeJavaScript=function(t,e,r){throw ibiz.log.warn("executeJavaScript",t,e,r),new Error("未实现")},t.prototype.custom=function(t,e,r){throw ibiz.log.warn("custom",t,e,r),new Error("未实现")},t.TAG="ibiz.app-func.exec",t}());function installCommand(){new AppFuncCommand,new OpenAppViewCommand}var FrontUIActionHandler=exports("FrontUIActionHandler",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.execAction=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,s,a,c;return __generator(this,(function(u){switch(u.label){case 0:switch(t.frontProcessType){case"OPENHTMLPAGE":return[3,1];case"TOP":case"WIZARD":return[3,2]}return[3,6];case 1:return window.open(t.htmlPageUrl,"_blank"),[3,7];case 2:if(!(o=t.getFrontPSAppView()))throw new Error("未配置打开视图");return[4,o.fill(!0)];case 3:return u.sent(),[4,this.handleParams(t,e,r,n)];case 4:return s=u.sent(),a=s.resultContext,c=s.resultParams,[4,ibiz.commands.execute(OpenAppViewCommand.TAG,o,a,c,i)];case 5:return u.sent(),[3,7];case 6:throw new UnsupportedModelError(t,"未支持的前台处理模式[".concat(t.frontProcessType,"]"));case 7:return[2,{}]}}))}))},e}(UIActionHandler)),WFWithdrawUIActionHandler=exports("WFWithdrawUIActionHandler",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.execAction=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var t,o;return __generator(this,(function(s){switch(s.label){case 0:return[4,ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})];case 1:return t=s.sent(),o=!1,t&&(null==i?void 0:i.neuron)?[4,i.neuron.call.wfWithdraw(e,n,(null==r?void 0:r[0])||[])]:[3,3];case 2:s.sent(),o=!0,s.label=3;case 3:return[2,{refresh:!1,closeView:o}]}}))}))},e}(UIActionHandler));function openRedirectView(t,e,r,n){return void 0===e&&(e=new IBizContext),void 0===r&&(r={}),void 0===n&&(n=[]),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){if(t.instanceof("app.view.IPSAppDERedirectView"))return[2,openDERedirectView(t,e,r,n)];throw new UnsupportedModelError(t,"未支持的重定向视图类型: ".concat(t.viewType))}))}))}function openDERedirectView(t,e,r,n){return void 0===e&&(e=new IBizContext),void 0===r&&(r={}),void 0===n&&(n=[]),__awaiter(this,void 0,void 0,(function(){var i,o,s,a,c,u,l,h,p,d,f,v,y,m,w,_,g;return __generator(this,(function(b){switch(b.label){case 0:return i=t.getPSAppViewNavContexts()||[],o=convertNavData(i,e,r),e=new IBizContext(o,e),s=t.getPSAppViewNavParams()||[],a=convertNavData(s,e,r),Object.assign(r,a),[4,(c=t.getPSAppDataEntity()).fill(!0)];case 1:return b.sent(),u=c.codeName.toLowerCase(),l=n[0]||{},e[u]=l[u]||e[u]||r[u],h=t.getGetDataPSAppDEAction(),[4,ibiz.hub.getApp(null==h?void 0:h.getPSModelService().app).es.getService(c.codeName)];case 2:return p=b.sent(),ibiz.loading.showRedirect(),[4,p.exec(h?h.codeName:"Get",e,r)];case 3:return d=b.sent(),ibiz.loading.hideRedirect(),d.ok&&(l=d.data,f=l.linkurl)?f.startsWith("http://")||f.startsWith("https://")?(window.open(f,"_blank"),[2,{ok:!0,data:[]}]):[2,{ok:!1,data:[]}]:[4,calcDERdTag(c,t,r.srfwf,l)];case 4:return v=b.sent(),y="".concat(c.name.toUpperCase(),":").concat(v),m=t.getRedirectPSAppViewRefs(),w=null==m?void 0:m.find((function(t){return t.name===y||t.name===v})),w?(_=w.getRefPSAppView())?[4,ibiz.commands.execute(OpenAppViewCommand.TAG,_,e,r,{data:[l]})]:[3,6]:[3,7];case 5:return(g=b.sent())?[2,g]:[3,7];case 6:throw new DefectModelError(w,"未配置实际引用视图");case 7:return[2,{ok:!0,data:[]}]}}))}))}function calcDERdTag(t,e,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,s,a,c;return __generator(this,(function(u){return"",(i=e.getTypePSAppDEField())&&(o=n[i.codeName.toLowerCase()],notNilEmpty(o))?[2,o]:notNilEmpty(r)?[2,"EDITVIEW:".concat(r.toUpperCase())]:(s="",(a=t.getIndexTypePSAppDEField())&&(s=n[a.codeName.toLowerCase()]),isNilOrEmpty(s)&&(c=t.getFormTypePSAppDEField())&&(s=n[c.codeName.toLowerCase()]),[2,notNilEmpty(s)?"EDITVIEW:".concat(s):"EDITVIEW"])}))}))}function executeViewLogic(t,e,r,n,i){return void 0===i&&(i={}),__awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(s){switch(s.label){case 0:return"opendata"===t.name&&t.getPSAppUILogic()?[2,executeOpenDataAppUILogic(t.getPSAppUILogic(),e,r,n,i)]:"newdata"===t.name&&t.getPSAppUILogic()?[2,executeNewDataAppUILogic(t.getPSAppUILogic(),e,r,n,i)]:[4,getPSUIActionByModelObject(t.getPSAppViewUIAction())];case 1:if(!(o=s.sent()))throw new Error("找不到界面行为");return[2,AppDEUIActionUtil.exec(o,e,r,n,i)]}}))}))}function executeOpenDataAppUILogic(t,e,r,n,i){return void 0===i&&(i={}),__awaiter(this,void 0,void 0,(function(){var o,s,a,c,u,l,h,p;return __generator(this,(function(d){switch(d.label){case 0:if(!(null==r?void 0:r[0]))throw Error("没有选中数据!");if(!(o=t.getOpenDataPSAppView()))throw new Error("getOpenDataPSAppView为空");if(!(s=o.getRefPSAppView()))throw new Error("openView为空");return[4,s.fill(!0)];case 1:return d.sent(),[4,(a=new AppEntityModel(s.getPSAppDataEntity())).init()];case 2:return d.sent(),c=o.getPSNavigateContexts()||[],u=a.deName.toLowerCase(),-1===c.findIndex((function(t){return t.key===u}))&&c.push({key:u,value:u,rawValue:!1}),l=new IBizContext(convertNavData(c,e,n,r[0]),e),h={},p=o.getPSNavigateParams(),notNilEmpty(p)&&(h=convertNavData(p,n,e,r[0])),[4,ibiz.commands.execute(OpenAppViewCommand.TAG,s,l,h,i)];case 3:return d.sent(),i.neuron.call.refresh(),[2,{}]}}))}))}function executeNewDataAppUILogic(t,e,r,n,i){return void 0===i&&(i={}),__awaiter(this,void 0,void 0,(function(){var o,s,a,c,u,l,h,p;return __generator(this,(function(d){switch(d.label){case 0:if(!(o=t.getNewDataPSAppView()))throw new Error("getNewDataPSAppView为空");if(!(s=o.getRefPSAppView()))throw new Error("newView为空");return[4,s.fill(!0)];case 1:return d.sent(),[4,(a=new AppEntityModel(s.getPSAppDataEntity())).init()];case 2:return d.sent(),c={},u={},l=(null==r?void 0:r[0])||{},h=o.getPSNavigateContexts(),notNilEmpty(h)&&(c=convertNavData(h,e,n,l)),(c=new IBizContext(c,e))[a.deName.toLowerCase()]=void 0,p=o.getPSNavigateParams(),notNilEmpty(p)&&(u=convertNavData(p,n,e,l)),t.enableWizardAdd||t.enableBatchAdd||t.batchAddOnly,[4,ibiz.commands.execute(OpenAppViewCommand.TAG,s,c,u,i)];case 3:return d.sent(),i.neuron.call.refresh(),[2,{}]}}))}))}var ViewState=exports("ViewState",(function(){this.complete=!1,this.toolbarState=null,this.isLoading=!1})),EditViewState=exports("EditViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(ViewState)),MDViewState=exports("MDViewState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.showSearchForm=!1,e.query="",e.selectedData=[],e}return __extends(e,t),e}(ViewState)),GridViewState=exports("GridViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(MDViewState)),EditView3State=exports("EditView3State",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(EditViewState)),PickupViewState=exports("PickupViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(ViewState)),MPickupViewState=exports("MPickupViewState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.embedSelection=[],e.selfSelection=[],e}return __extends(e,t),e}(PickupViewState)),GridExpViewState=exports("GridExpViewState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.navItem={},e}return __extends(e,t),e}(MDViewState)),TreeExpViewState=exports("TreeExpViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(MDViewState)),ControlState=exports("ControlState",(function(){this.complete=!1})),FormState=exports("FormState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isLoaded=!1,e.data=new ControlVO,e}return __extends(e,t),e}(ControlState)),EditFormState=exports("EditFormState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(FormState)),SearchFormState=exports("SearchFormState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(FormState)),FormDetailState=exports("FormDetailState",function(){function t(t){this.parent=t,this.$visible=!0,this.required=!1,this.$disabled=!1,this.layoutController={width:"100%",height:"100%",extraStyle:{},extraClass:""}}return Object.defineProperty(t.prototype,"visible",{get:function(){var t;return!!(null===(t=this.parent)||void 0===t?void 0:t.visible)&&this.$visible},set:function(t){this.$visible=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.$disabled},set:function(t){this.$disabled=t},enumerable:!1,configurable:!0}),t}()),FormContainerState=exports("FormContainerState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),FormGroupPanelState=exports("FormGroupPanelState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(FormContainerState)),FormPageState=exports("FormPageState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"visible",{get:function(){return this.$visible},enumerable:!1,configurable:!0}),e}(FormContainerState)),FormButtonState=exports("FormButtonState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),FormDruipartState=exports("FormDruipartState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),FormItemState=exports("FormItemState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r.error=null,r.enableCondDisabled=!1,r}return __extends(e,t),Object.defineProperty(e.prototype,"disabled",{get:function(){return!!this.enableCondDisabled||this.$disabled},set:function(t){this.$disabled=t},enumerable:!1,configurable:!0}),e}(FormDetailState)),FormRawItemState=exports("FormRawItemState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),FormTabPageState=exports("FormTabPageState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormContainerState)),FormTabPanelState=exports("FormTabPanelState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),AppMenuState=exports("AppMenuState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.menuItemsState={},e}return __extends(e,t),e}(ControlState)),MDState=exports("MDState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.items=[],e.selectedData=[],e.singleSelect=!0,e.curPage=1,e.size=20,e.total=0,e.hasLoaded=!1,e}return __extends(e,t),e}(ControlState)),GridState=exports("GridState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rows=[],e}return __extends(e,t),e}(MDState)),TreeState=exports("TreeState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rootNode=null,e}return __extends(e,t),Object.defineProperty(e.prototype,"treeNodes",{get:function(){var t;return(null===(t=this.rootNode)||void 0===t?void 0:t.children)||[]},enumerable:!1,configurable:!0}),e}(MDState)),ViewController=exports("ViewController",function(){function t(t,e,r){void 0===r&&(r={}),this.modelPath=t,this.state=new ViewState,this.modal={mode:ViewMode.ROUTE},this.complete=!1,this.toolbarState=null,this.viewLoading=new LoadingState,this.providers={},this.context=new IBizContext(e),this.params=r,this.nerve=this.createNerve()}return t.prototype.createNerve=function(){return new ViewNerve(this)},t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.onInit()];case 1:return e.sent(),this.state.complete=!0,this.nerve.created(),this.setCaption(this.model.caption),this.force((function(){t.nerve.mounted()})),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return this.emit("neuronInit",this.nerve.self),t=this,[4,ibiz.model.getView(this.modelPath)];case 1:return t.model=e.sent(),this.app=ibiz.hub.getApp(this.model.modelService.app),this.handleViewParams(),this.initToolbarState(),[2]}}))}))},t.prototype.initToolbarState=function(){var t=this;if(this.model.toolbar){var e=new ButtonContainerState;__spreadArray([],__read(this.model.toolbar.actionItems.values()),!1).forEach((function(r){var n=new ButtonState(r.id,r.getPSUIAction(),t.model.appEntity);["Edit","Remove"].includes(r.getPSUIAction().uIActionTag)&&(n.noPermissionMode="DISABLED"),e.addState(r.id,n)})),e.update(),this.state.toolbarState=e}},t.prototype.handleViewParams=function(){this.modal.mode===ViewMode.ROUTE&&(this.context.srfsessionid=createUUID());var t=this.model.source.getPSAppViewNavContexts(),e={};notNilEmpty(t)&&(e=convertNavData(t,this.context,this.params)),Object.assign(this.context,e);var r=this.model.source.getPSAppViewNavParams(),n={};notNilEmpty(r)&&(n=convertNavData(r,this.context,this.params)),Object.assign(this.params,n)},t.prototype.destroy=function(){this.nerve.destroy()},t.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},t.prototype.getData=function(){return[]},t.prototype.closeView=function(t){return void 0===t&&(t={ok:!0,data:this.getData()}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.nerve.self.evt.emit("closeView",t),[2]}))}))},t.prototype.beforeClose=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,!0]}))}))},t.prototype.force=function(t){},t.prototype.emit=function(t){},t.prototype.onToolbarClick=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){if(!t.getPSAppViewUIAction())throw new DefectModelError(t,"没有配置界面行为!");if(r="".concat(t.getPSAppViewUIAction().name,"_click"),!(n=this.model.source.findPSAppViewLogic(r)))throw new DefectModelError(t.getPSAppViewUIAction(),"没有找到对应的视图逻辑");return[2,this.executeViewLogic(n,this.getData(),e)]}))}))},t.prototype.executeViewLogic=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,executeViewLogic(t,this.context,e,this.params,{event:r,neuron:this.nerve.self})];case 1:return n.sent(),[2]}}))}))},t.prototype.setCaption=function(t){this.state.caption=t,this.nerve.self&&this.nerve.self.evt.asyncEmit("setTitle",t),this.force()},t.prototype.beginViewLoading=function(){this.viewLoading.begin(),this.state.isLoading=this.viewLoading.isLoading},t.prototype.endViewLoading=function(){this.viewLoading.end(),this.state.isLoading=this.viewLoading.isLoading},t}()),MainViewController=exports("MainViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return this.entityService?[3,2]:(t=this,[4,this.app.es.getService(this.model.appEntity.codeName)]);case 1:t.entityService=r.sent(),r.label=2;case 2:return[4,this.entityService.exec("Get",this.context,this.params)];case 3:return e=r.sent(),this.mainData=e.data,this.calcCaption(e.data),this.state.toolbarState&&this.state.toolbarState.update(e.data),[2,e.data]}}))}))},e.prototype.calcCaption=function(t){if(ibiz.config.enableDataInfoBar&&this.model.showDataInfoBar){var e=t[this.model.appEntity.textName];e?this.setCaption("".concat(this.model.caption," - ").concat(e)):this.context[this.model.appEntity.deName]||this.setCaption("".concat(this.model.caption," - 新建"))}},e}(ViewController)),IndexViewState=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isCollapse=!1,e}return __extends(e,t),e}(ViewState),IndexViewController=exports("IndexViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new IndexViewState,e.isCollapse=!1,e}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.appMenu)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e}(ViewController)),EditViewController=exports("EditViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new EditViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new EditViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o=this;return __generator(this,(function(s){switch(s.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return s.sent(),e=this,[4,this.app.es.getService(this.model.appEntity.codeName)];case 2:return e.entityService=s.sent(),this.nerve.self.evt.on("mounted",(function(){o.model.source.loadDefault&&o.load()})),(r=this.model.form)?(n=this.providers,i=r.name,[4,ibiz.register.control.get(r)]):[3,4];case 3:n[i]=s.sent(),s.label=4;case 4:return[2]}}))}))},e.prototype.handleViewParams=function(){return this.context.srfkey&&(this.context[this.model.appEntity.deName]=this.context.srfkey,this.context.srfkey=void 0,delete this.context.srfkey),t.prototype.handleViewParams.call(this)},e.prototype.getData=function(){return this.nerve.form.call.getData()},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.nerve.form.call.load()];case 1:return t=e.sent(),this.calcCaption(t),this.state.toolbarState&&this.state.toolbarState.update(t.getOrigin()),[2,t]}}))}))},e.prototype.save=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.form.call.save()];case 1:return[2,t.sent()]}}))}))},e.prototype.onAfterFormSave=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){return t&&(r=this.model.appEntity.deName,this.context[r]=e[r]),this.calcCaption(e),this.nerve.self.evt.asyncEmit("viewDataChange",{type:t?"CREATE":"UPDATE",data:[e],control:"form"}),[2]}))}))},e.prototype.onAfterFormRemove=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.nerve.self.evt.asyncEmit("viewDataChange",{type:"REMOVE",data:[t],control:"form"}),[2]}))}))},e.prototype.saveAndNew=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.save()];case 1:return t.sent(),this.context[this.model.appEntity.deName]=void 0,[4,this.load()];case 2:return t.sent(),[2]}}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.form.call.remove()];case 1:return t.sent(),[2]}}))}))},e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.load()];case 1:return t=e.sent(),this.nerve.self.evt.asyncEmit("refreshed",[t]),[2]}}))}))},e.prototype.wfStart=function(){var t;return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,s;return __generator(this,(function(a){switch(a.label){case 0:return[4,this.save()];case 1:return a.sent(),[4,this.entityService.wf.getWFVersion()];case 2:if(0===(e=a.sent()).data.length)throw new RuntimeError("当前工作流版本不存在");return r=e.data[0],n="WFSTART@".concat(r.wfversion),i=new IBizContext({activeForm:r["process-form"]},this.context),o={processDefinitionKey:r.definitionkey},(s=null===(t=this.model.source.findPSAppViewRef(n))||void 0===t?void 0:t.getRefPSAppView())?[3,5]:[4,this.nerve.form.call.wfStart(o)];case 3:return a.sent(),[4,this.closeView()];case 4:return a.sent(),[2];case 5:return[4,ibiz.commands.execute(OpenAppViewCommand.TAG,s,i,o)];case 6:return a.sent().ok?[4,this.closeView()]:[3,8];case 7:a.sent(),a.label=8;case 8:return[2]}}))}))},e.prototype.wfSubmit=function(){return this.nerve.form.call.wfSubmit()},e.prototype.wfWithdraw=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,this.entityService.wf.wfWithdraw(t,__assign(__assign({},e),{taskId:e.taskId||e.srftaskid}),__assign({},r.getRequestData()))];case 1:return n.sent(),[2]}}))}))},e}(MainViewController)),OptViewController=exports("OptViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new OptViewNerve(this)},e.prototype.onOkButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.save()];case 1:return t=e.sent(),[2,this.closeView({ok:!0,data:[t]})]}}))}))},e.prototype.onCancelButtonClick=function(){return this.closeView()},e}(EditViewController)),EditView3Controller=exports("EditView3Controller",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new EditView3State,e.isNewData=!0,e.drPages={},e}return __extends(e,t),e.prototype.createNerve=function(){return new EditView3Nerve(this)},e.prototype.onInit=function(){var e;return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(null===(e=this.model.drTab)||void 0===e?void 0:e.pages.length)&&this.model.drTab.pages.forEach((function(t){r.drPages[t.source.name]={context:r.context,params:r.params,key:createUUID()}})),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.isNewData=e.srfuf===Srfuf.CREATE,this.calcViewParams(e),[2,e]}}))}))},e.prototype.calcViewParams=function(t){var e,r,n,i=this.model.drTab.pages;try{for(var o=__values(i),s=o.next();!s.done;s=o.next()){var a=s.value,c=a.source.name,u=new IBizContext({},this.context),l=a.source.getPSNavigateContexts();notNilEmpty(l)&&(u=Object.assign(u,convertNavData(l,this.context,this.params,t)));var h=a.source.getPSNavigateParams(),p={};notNilEmpty(h)&&(p=convertNavData(h,this.params,this.context,t)),this.nerve.drViews.has(c)&&JSON.stringify(this.drPages[c].context)===JSON.stringify(u)&&JSON.stringify(this.drPages[c].params)===JSON.stringify(p)?null===(n=this.nerve.drViews.get(c))||void 0===n||n.call.refresh():(this.drPages[c].context=u,this.drPages[c].params=p,this.drPages[c].key=createUUID())}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}this.force()},e}(EditViewController)),MDViewController=exports("MDViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new MDViewState,e.showSearchForm=!1,e.query="",e.selectedData=[],e}return __extends(e,t),e.prototype.createNerve=function(){return new MDViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return o.sent(),this.state.showSearchForm=this.model.source.expandSearchForm,this.nerve.self.evt.on("mounted",(function(){i.model.source.loadDefault&&i.load()})),(e=this.model.searchForm)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=o.sent(),o.label=3;case 3:return[2]}}))}))},e.prototype.getData=function(){return this.state.selectedData},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,[]]}))}))},e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.load()];case 1:return t=e.sent(),this.nerve.self.evt.asyncEmit("refreshed",t),[2]}}))}))},e.prototype.openData=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return(r=this.model.source.findPSAppViewLogic("opendata"))?[4,this.executeViewLogic(r,[t],e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype.newData=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return(e=this.model.source.findPSAppViewLogic("newdata"))?[4,this.executeViewLogic(e,[{}],t)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.prototype.toggleFilter=function(){this.state.showSearchForm=!this.state.showSearchForm},e.prototype.importData=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},e.prototype.exportData=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},e.prototype.onSearch=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.load()];case 1:return t.sent(),[2]}}))}))},e.prototype.onSelectionChange=function(t){var e;this.state.selectedData=t,this.state.toolbarState&&this.state.toolbarState.update(null===(e=t[0])||void 0===e?void 0:e.getOrigin())},e.prototype.onDataActive=function(t,e){return this.openData(t,e)},e.prototype.onBeforeLoad=function(){var t={query:this.state.query};if(this.nerve.searchForm){var e=this.nerve.searchForm.call.getParams();Object.assign(t,e)}return t},e.prototype.onAfterSave=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return this.nerve.self.evt.asyncEmit("viewDataChange",{type:e?"CREATE":"UPDATE",data:t,control:r}),[2]}))}))},e.prototype.onAfterRemove=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.nerve.self.evt.asyncEmit("viewDataChange",{type:"REMOVE",data:t,control:e}),[2]}))}))},e}(ViewController)),GridViewController=exports("GridViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new GridViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new GridViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.grid)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.grid.call.load()]}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.remove()];case 1:return t.sent(),[2]}}))}))},e.prototype.newRow=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.newRow()];case 1:return t.sent(),[2]}}))}))},e.prototype.importData=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.importData()];case 1:return t.sent(),[2]}}))}))},e.prototype.exportData=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.nerve.grid.call.exportData(t)];case 1:return e.sent(),[2]}}))}))},e}(MDViewController)),PickupGridViewController=exports("PickupGridViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new PickupGridViewNerve(this)},e.prototype.onSelectionChange=function(e){t.prototype.onSelectionChange.call(this,e),this.nerve.self.evt.asyncEmit("selectionChange",this.selectedData)},e.prototype.selectAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.grid.call.selectAll()]}))}))},e}(GridViewController)),PickupViewController=exports("PickupViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new PickupViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new PickupViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.pickupViewPanel)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.onSelectionChange=function(t){this.nerve.self.evt.asyncEmit("closeView",{ok:!0,data:t})},e}(ViewController)),MPickupViewController=exports("MPickupViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new MPickupViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new MPickupViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),this.params.selectedData&&(this.state.selfSelection=JSON.parse(this.params.selectedData)),[2]}}))}))},e.prototype.onSelectionChange=function(t){this.state.embedSelection=t},e.prototype.selectAll=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.nerve.viewPanel.call.selectAll()];case 1:return(t=e.sent()).length>0&&this.addSelections(t),[2]}}))}))},e.prototype.addSelections=function(t){var e,r=this;if(t.length>0){var n=t.filter((function(t){return!r.state.selfSelection.find((function(e){return e.srfkey===t.srfkey}))}));(e=this.state.selfSelection).push.apply(e,__spreadArray([],__read(n),!1))}},e.prototype.removeSelections=function(t){var e=this;t.length>0&&t.forEach((function(t){var r=e.state.selfSelection.findIndex((function(e){return e.srfkey===t.srfkey}));-1!==r&&e.state.selfSelection.splice(r,1)}))},e.prototype.onOkButtonClick=function(){this.closeView({ok:!0,data:this.state.selfSelection})},e.prototype.onCancelButtonClick=function(){this.closeView({ok:!1,data:[]})},e}(PickupViewController)),WFEditViewController=exports("WFEditViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isEditable=!1,e.isFirstLoaded=!1,e}return __extends(e,t),e.prototype.createNerve=function(){return new WFEditViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[4,this.calcActiveForm()];case 2:return e.sent(),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.isFirstLoaded=!0,[2,e]}}))}))},e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return e=this.activeForm,[4,this.calcActiveForm()];case 1:return r.sent(),e!==this.activeForm?[3,3]:[4,t.prototype.refresh.call(this)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.calcActiveForm=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,this.entityService.wf.getWFStep(this.params)];case 1:if(t=o.sent(),this.isEditable="true"===t.data.isEditable,e=t.data["process-form"]?"wfform_".concat(t.data["process-form"]):"form",!(r=this.model.forms.get(e.toLowerCase())))throw new RuntimeError("找不到表单".concat(e,"的模型"));return this.activeForm=r,n=this.providers,i=r.name,[4,ibiz.register.control.get(r)];case 2:return n[i]=o.sent(),[2]}}))}))},e.prototype.onFormMounted=function(){this.isFirstLoaded&&this.load()},e}(EditViewController)),WFDynaEditViewController=exports("WFDynaEditViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.wfLinks=[],e}return __extends(e,t),e.prototype.createNerve=function(){return new WFDynaEditViewNerve(this)},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.calcWfToolbar(),[2,e]}}))}))},e.prototype.calcWfToolbar=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.entityService.wf.getWFLink(new IBizContext({taskDefinitionKey:this.params.taskDefinitionKey},this.context),this.getData())];case 1:return t=e.sent(),this.wfLinks=t.data,[2]}}))}))},e.prototype.onLinkClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.type?[2]:[2,this.wfSubmitByLink(t)]}))}))},e.prototype.wfSubmitByLink=function(t){var e;return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return this.isEditable?[4,this.save()]:[3,2];case 1:s.sent(),s.label=2;case 2:return r=new IBizContext({isEditable:this.isEditable,activeForm:t.sequenceFlowForm},this.context),n=__assign({},t),i=t.sequenceFlowView,(o=null===(e=this.model.source.findPSAppViewRef("WFACTION@".concat(i)))||void 0===e?void 0:e.getRefPSAppView())?[3,5]:[4,this.nerve.form.call.wfSubmit(n)];case 3:return s.sent(),[4,this.closeView()];case 4:return s.sent(),[2];case 5:return[4,ibiz.commands.execute(OpenAppViewCommand.TAG,o,r,n)];case 6:return s.sent().ok?[4,this.closeView()]:[3,8];case 7:s.sent(),s.label=8;case 8:return[2]}}))}))},e}(WFEditViewController)),WFDynaEditView3Controller=exports("WFDynaEditView3Controller",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isNewData=!0,e.drPages={},e}return __extends(e,t),e.prototype.createNerve=function(){return new WFDynaEditView3Nerve(this)},e.prototype.onInit=function(){var e;return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(null===(e=this.model.drTab)||void 0===e?void 0:e.pages.length)&&this.model.drTab.pages.forEach((function(t){r.drPages[t.source.name]={context:r.context,params:r.params,key:createUUID()}})),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.isNewData=e.srfuf===Srfuf.CREATE,this.calcViewParams(e),[2,e]}}))}))},e.prototype.calcViewParams=function(t){var e,r,n,i=this.model.drTab.pages;try{for(var o=__values(i),s=o.next();!s.done;s=o.next()){var a=s.value,c=a.source.name,u=new IBizContext({},this.context),l=a.source.getPSNavigateContexts();notNilEmpty(l)&&(u=Object.assign(u,convertNavData(l,this.context,this.params,t)));var h=a.source.getPSNavigateParams(),p={};notNilEmpty(h)&&(p=convertNavData(h,this.params,this.context,t)),this.nerve.drViews.has(c)&&JSON.stringify(this.drPages[c].context)===JSON.stringify(u)&&JSON.stringify(this.drPages[c].params)===JSON.stringify(p)?null===(n=this.nerve.drViews.get(c))||void 0===n||n.call.refresh():(this.drPages[c].context=u,this.drPages[c].params=p,this.drPages[c].key=createUUID())}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}this.force()},e}(WFDynaEditViewController)),WFDynaStartViewController=exports("WFDynaStartViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new WFDynaStartViewNerve(this)},e.prototype.calcActiveForm=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(t=this.context.activeForm?"wfform_".concat(this.context.activeForm):"form",!(e=this.model.forms.get(t.toLowerCase())))throw new RuntimeError("找不到表单".concat(t,"的模型"));return this.activeForm=e,r=this.providers,n=e.name,[4,ibiz.register.control.get(e)];case 1:return r[n]=i.sent(),[2]}}))}))},e.prototype.onOkButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.save()];case 1:return t.sent(),[4,this.nerve.form.call.wfStart()];case 2:return t.sent(),[4,this.closeView({ok:!0,data:this.getData()})];case 3:return t.sent(),[2]}}))}))},e.prototype.onCancelButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.closeView({ok:!1,data:[]})];case 1:return t.sent(),[2]}}))}))},e}(WFEditViewController)),WFDynaActionViewController=exports("WFDynaActionViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new WFDynaActionViewNerve(this)},e.prototype.calcActiveForm=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(t=this.context.activeForm?"wfform_".concat(this.context.activeForm):"form",!(e=this.model.forms.get(t.toLowerCase())))throw new RuntimeError("找不到表单".concat(t,"的模型"));return this.activeForm=e,r=this.providers,n=e.name,[4,ibiz.register.control.get(e)];case 1:return r[n]=i.sent(),[2]}}))}))},e.prototype.onOkButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return this.context.isEditable?[4,this.save()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[4,this.nerve.form.call.wfSubmit()];case 3:return t.sent(),[4,this.closeView({ok:!0,data:this.getData()})];case 4:return t.sent(),[2]}}))}))},e.prototype.onCancelButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.closeView({ok:!1,data:[]})];case 1:return t.sent(),[2]}}))}))},e}(WFEditViewController)),WFStepTraceViewController=exports("WFStepTraceViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:if(r.sent(),!this.deName)throw new RuntimeError("没有接收到deName");return e=this,[4,this.app.es.getService(this.deName)];case 2:return e.entityService=r.sent(),[4,this.getUIData()];case 3:return r.sent(),[2]}}))}))},e.prototype.setDeName=function(t){this.deName=t},e.prototype.getUIData=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return t=new IBizContext(this.params,this.context),[4,this.entityService.wf.getWFHistory(t)];case 1:return(e=r.sent()).data&&(this.data=e.data),[2]}}))}))},e}(ViewController)),AppPortalViewController=exports("AppPortalViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new AppPortalViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.dashboard)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e}(ViewController)),TreeExpViewController=exports("TreeExpViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new TreeExpViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new TreeExpViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.tree)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.tree.call.load()]}))}))},e.prototype.onDataActive=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,s,a;return __generator(this,(function(c){switch(c.label){case 0:return e=new IBizContext({},this.context),r=__assign({},this.params),n=this.model.tree.getNodeById(t.nodeId),(i=n.navView)?i.initialized?[3,2]:[4,i.init()]:[2];case 1:c.sent(),c.label=2;case 2:return i.appEntity&&(o=i.appEntity.deName),n.navFilter&&(o=n.navFilter),o&&(e[o]=t.value),s=n.source.getPSNavigateContexts(),notNilEmpty(s)&&Object.assign(e,convertNavData(s,this.context,this.params,t.deData||t)),a=n.source.getPSNavigateParams(),notNilEmpty(a)&&Object.assign(r,convertNavData(a,this.params,this.context,t.deData||t)),this.context.isRouter&&(Object.assign(e,{toRouteLevel:this.modal.level+1,currentRouteContext:t.id}),ibiz.openView.root(i.source,e,r)),[2]}}))}))},e}(MDViewController)),TabExpViewController=exports("TabExpViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tabExpPages={},e}return __extends(e,t),e.prototype.createNerve=function(){return new TabExpViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(e=this.model.tabExpPanel.tabExpPages).length&&e.forEach((function(t){r.tabExpPages[t.name]={key:createUUID()}})),this.nerve.self.evt.on("mounted",(function(){r.model.source.loadDefault&&r.load()})),[2]}}))}))},e}(MainViewController)),GridExpViewController=exports("GridExpViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new GridExpViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new GridExpViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o=this;return __generator(this,(function(s){switch(s.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return s.sent(),(e=this.model.gridExpBar)?(r=e.grid)?(n=this.providers,i=r.name,[4,ibiz.register.control.get(r)]):[3,3]:[3,3];case 2:n[i]=s.sent(),s.label=3;case 3:return this.nerve.self.evt.on("mounted",(function(){o.model.source.loadDefault&&o.load()})),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.grid.call.load()]}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.remove()];case 1:return t.sent(),[2]}}))}))},e.prototype.newRow=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.newRow()];case 1:return t.sent(),[2]}}))}))},e.prototype.onDataActive=function(t){var e,r,n,i,o;return __awaiter(this,void 0,void 0,(function(){var s,a,c,u,l,h,p,d,f,v,y,m,w,_,g,b,S,N,C;return __generator(this,(function(x){return this.activeData=t,this.state.toolbarState&&this.state.toolbarState.update(null==t?void 0:t.getOrigin()),(s=this.model.gridExpBar)&&(a=s.grid)&&a.navPSAppView&&(c={},u=__assign({},this.params),l=this.activeData,(h=a.navPSAppView.source.getPSAppDataEntity())&&l&&(Object.assign(c,((b={})["".concat(null===(e=h.codeName)||void 0===e?void 0:e.toLowerCase())]=l[null===(r=h.codeName)||void 0===r?void 0:r.toLowerCase()],b)),(p=null===(n=h.getKeyPSAppDEField())||void 0===n?void 0:n.codeName.toLowerCase())&&(Object.assign(c,((S={})[p]=l[p],S)),this.state.navItem.key=l[p]),(d=a.source.navFilter)&&Object.assign(u,((N={})[d]=l[null===(i=h.codeName)||void 0===i?void 0:i.toLowerCase()],N)),(f=a.source.getNavPSDER())&&(v="n_".concat((f.codeName&&f.minorCodeName).toLowerCase(),"_eq"),Object.assign(u,((C={})[v]=l[null===(o=h.codeName)||void 0===o?void 0:o.toLowerCase()],C)))),y=a.source.getPSNavigateContexts(),m={},notNilEmpty(y)&&(m=convertNavData(y,c,this.params)),Object.assign(c,m),w=a.source.getPSNavigateParams(),_={},notNilEmpty(w)&&(_=convertNavData(w,u,this.params)),Object.assign(u,_),this.context.isRouter?(Object.assign(c,{toRouteLevel:this.modal.level+1}),g=new IBizContext(c,this.context),ibiz.openView.root(a.navPSAppView.source,g,u)):(g=new IBizContext(c,this.context),this.state.navItem.context=g,this.state.navItem.params=u)),[2]}))}))},e.prototype.onToolbarClick=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){if(!(r=t.getPSAppViewUIAction()))throw new DefectModelError(t,"没有配置界面行为!");if(n="".concat(r.name,"_click"),!(i=this.model.gridExpBar.source.findPSAppViewLogic(n)))throw new DefectModelError(r,"没有找到对应的视图逻辑");return[2,this.executeViewLogic(i,this.getData(),e)]}))}))},e}(MDViewController)),DashboardViewController=exports("DashboardViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new DashboardViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.dashboard)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e}(MainViewController)),ControlController=exports("ControlController",function(){function t(t,e,r){void 0===r&&(r={}),this.state=new ControlState,this.complete=!1,this.model=t,this.context=e,this.params=r,this.nerve=this.createNerve()}return t.prototype.createNerve=function(){return new ControlNerve(this)},t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.onInit()];case 1:return e.sent(),this.state.complete=!0,this.nerve.created(),this.force((function(){t.nerve.mounted()})),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.emit("neuronInit",this.nerve.self),[2]}))}))},t.prototype.force=function(t){},t.prototype.emit=function(t){},t.prototype.destroy=function(){this.nerve.destroy()},t.prototype.startLoading=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.nerve.self.evt.emit("beginViewLoading"),[2]}))}))},t.prototype.endLoading=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.nerve.self.evt.emit("endViewLoading"),[2]}))}))},t}()),AppMenuController=exports("AppMenuController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new AppMenuState,e.menuItemsState={},e}return __extends(e,t),e.prototype.createNerve=function(){return new AppMenuNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){return t.prototype.onInit.call(this),this.model.items.forEach((function(t){e.initMenuItemState(t)})),[2]}))}))},e.prototype.onClickMenuItem=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return e=this.model.findMenuItemModelById(t),[4,ibiz.model.getAppFunc(e)];case 1:if(!(r=n.sent()))throw new DefectModelError(e.source,"未配置界面行为");return[4,ibiz.commands.execute(AppFuncCommand.TAG,r)];case 2:return n.sent(),[2]}}))}))},e.prototype.initMenuItemState=function(t){var e,r=this,n=ibiz.hub.getApp(t).authority.hasMenuPermitted(t),i=n;if(null===(e=t.children)||void 0===e?void 0:e.length){var o=t.children.map((function(t){return r.initMenuItemState(t).visible}));i=i&&o.includes(!0)}var s={permitted:n,visible:i};return this.state.menuItemsState[t.source.id]=s,s},e}(ControlController)),MainController=exports("MainController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(ControlController)),FormController=exports("FormController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new FormState,e.details={},e.providers={},e.formItems=[],e}return __extends(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.state.data},enumerable:!1,configurable:!0}),e.prototype.dataChangeNotify=function(t){Object.values(this.details).forEach((function(e){e.dataChangeNotify(t)}))},e.prototype.formStateNotify=function(t){Object.values(this.details).forEach((function(e){e.formStateNotify(t)}))},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[4,this.initDetailControllers()];case 2:return e.sent(),this.details=__assign({},this.details),this.providers=__assign({},this.providers),this.dataChangeNotify=debounceAndMerge(this.dataChangeNotify.bind(this),(function(t,e){return[Array.from(new Set(__spreadArray(__spreadArray([],__read(t[0]),!1),__read(e[0]),!1)))]}),200),[2]}}))}))},e.prototype.initDetailControllers=function(t,e,r){return void 0===t&&(t=this.model.children),void 0===e&&(e=this),void 0===r&&(r=void 0),__awaiter(this,void 0,void 0,(function(){var n=this;return __generator(this,(function(i){switch(i.label){case 0:if(!ibiz.register.formDetail)throw new RuntimeError("formDetail注册器不存在");return[4,Promise.all(t.map((function(t){return __awaiter(n,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return[4,ibiz.register.formDetail.get(t)];case 1:if(!(n=s.sent()))throw new RuntimeError("找不到对应的适配器");return e.providers[t.source.name]=n,[4,n.createController(t,e,r)];case 2:return i=s.sent(),e.details[t.source.name]=i,"FORMITEM"===t.source.detailType&&e.formItems.push(i),(null===(o=t.children)||void 0===o?void 0:o.length)?[4,this.initDetailControllers(t.children,e,i)]:[3,4];case 3:s.sent(),s.label=4;case 4:return[2]}}))}))})))];case 1:return i.sent(),[2]}}))}))},e.prototype.getData=function(){return[this.state.data]},e.prototype.setDataValue=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e,this.dataChangeNotify([t]),this.force()),[2]}))}))},e.prototype.validate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,Promise.all(this.formItems.map((function(t){return t.validate()})))];case 1:return[2,-1===t.sent().findIndex((function(t){return!t}))]}}))}))},e}(MainController)),EditFormController=exports("EditFormController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new EditFormState,e.isNewData=!1,e}return __extends(e,t),e.prototype.createNerve=function(){return new EditFormNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),this.service=new EditFormService(this.model),[4,this.service.init(this.context)];case 2:return e.sent(),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return this.isNewData=!this.context[this.model.appEntity.deName],[4,this.startLoading()];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,,7,9]),this.isNewData?[4,this.service.getDraft(this.context,this.params)]:[3,4];case 3:return e=r.sent(),[3,6];case 4:return[4,this.service.get(this.context,this.params)];case 5:e=r.sent(),r.label=6;case 6:return t=e,[3,9];case 7:return[4,this.endLoading()];case 8:return r.sent(),[7];case 9:return t.data.reactiveInit(),this.state.data=t.data,this.formStateNotify(this.isNewData?FormNotifyState.DRAFT:FormNotifyState.LOAD),this.state.isLoaded=!0,this.force(),[2,this.data]}}))}))},e.prototype.save=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.validate()];case 1:if(!r.sent())throw new RuntimeError("请检查表单填写!");return[4,this.startLoading()];case 2:r.sent(),r.label=3;case 3:return r.trys.push([3,,8,10]),this.isNewData?[4,this.service.create(this.context,this.data)]:[3,5];case 4:return e=r.sent(),[3,7];case 5:return[4,this.service.update(this.context,this.data)];case 6:e=r.sent(),r.label=7;case 7:return t=e,[3,10];case 8:return[4,this.endLoading()];case 9:return r.sent(),[7];case 10:return t.data&&this.data.mergeOrigin(t.data),[4,this.nerve.self.evt.asyncEmit("afterSave",this.isNewData,this.data)];case 11:return r.sent(),this.isNewData=!1,this.formStateNotify(FormNotifyState.SAVE),ibiz.message.success("".concat(this.data.srfmajortext||"","保存成功")),this.force(),[2,this.data]}}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return this.isNewData?[3,6]:[4,this.startLoading()];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,,4,6]),[4,this.service.remove(this.context,this.params)];case 3:return t.sent(),[3,6];case 4:return[4,this.endLoading()];case 5:return t.sent(),[7];case 6:return[4,this.nerve.self.evt.asyncEmit("afterRemove",this.data)];case 7:return t.sent(),this.state.data=new ControlVO,this.force(),[2]}}))}))},e.prototype.updateFormItem=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,s,a,c,u;return __generator(this,(function(l){switch(l.label){case 0:return r=__assign(__assign({},this.params),this.data.getRequestData()),[4,this.service.updateFormItem(t,this.context,r)];case 1:if(n=l.sent(),(i=n.data)&&(null==e?void 0:e.length))try{for(o=__values(e),s=o.next();!s.done;s=o.next())a=s.value,this.setDataValue(a,i[a])}catch(t){c={error:t}}finally{try{s&&!s.done&&(u=o.return)&&u.call(o)}finally{if(c)throw c.error}}return[2]}}))}))},e.prototype.wfStart=function(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.validate()];case 1:if(!e.sent())throw new RuntimeError("请检查表单填写!");return[4,this.startLoading()];case 2:e.sent(),e.label=3;case 3:return e.trys.push([3,,5,7]),[4,this.service.wfStart(this.context,__assign(__assign({},this.params),t),this.data)];case 4:return e.sent(),[3,7];case 5:return[4,this.endLoading()];case 6:return e.sent(),[7];case 7:return ibiz.message.success("流程启动成功"),[2]}}))}))},e.prototype.wfSubmit=function(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.validate()];case 1:if(!e.sent())throw new RuntimeError("请检查表单填写!");return[4,this.startLoading()];case 2:e.sent(),e.label=3;case 3:return e.trys.push([3,,5,7]),[4,this.service.wfSubmit(this.context,__assign(__assign({},this.params),t),this.data)];case 4:return e.sent(),[3,7];case 5:return[4,this.endLoading()];case 6:return e.sent(),[7];case 7:return ibiz.message.success("流程提交成功"),[2]}}))}))},e}(FormController)),SearchFormController=exports("SearchFormController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new SearchFormState,e}return __extends(e,t),e.prototype.createNerve=function(){return new SearchFormNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),this.service=new SearchFormService(this.model),[4,this.service.init(this.context)];case 2:return e.sent(),[4,this.load()];case 3:return e.sent(),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.service.getDraft(this.context,this.params)];case 1:return t=e.sent(),this.state.data=t.data,this.state.isLoaded=!0,this.formStateNotify(FormNotifyState.DRAFT),this.force(),[2,this.data]}}))}))},e.prototype.getParams=function(){return __assign({},this.data.getRequestData())},e.prototype.onSearchButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.self.evt.asyncEmit("search")];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.load()];case 1:return t.sent(),[4,this.nerve.self.evt.asyncEmit("search")];case 2:return t.sent(),[2]}}))}))},e.prototype.dataChangeNotify=function(e){t.prototype.dataChangeNotify.call(this,e),this.model.source.enableAutoSearch&&this.nerve.self.evt.asyncEmit("search")},e.prototype.onKeyUp=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return(e=t||window.event)&&"Enter"===e.code?[4,this.onSearchButtonClick()]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e}(FormController)),FormDetailController=exports("FormDetailController",function(){function t(t,e,r){this.model=t,this.form=e,this.parent=r,this.state=this.createState()}return t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){return this.model.width&&(this.state.layoutController.width=this.model.width),this.model.height&&(this.state.layoutController.height=this.model.height),this.state.layoutController.extraClass="ibiz-form-col__".concat(this.model.source.detailType.toLowerCase()," "),this.model.source.getPSSysCss()&&(this.state.layoutController.extraClass+=this.model.source.getPSSysCss().cssName),Object.defineProperty(this.state.layoutController,"visible",{configurable:!0,enumerable:!0,get:function(){return t.state.visible}}),[2]}))}))},t.prototype.createState=function(){var t;return new FormDetailState(null===(t=this.parent)||void 0===t?void 0:t.state)},t.prototype.dataChangeNotify=function(t){this.calcDynamicLogic(t)},t.prototype.formStateNotify=function(t){this.calcDynamicLogic([],t)},t.prototype.calcDynamicLogic=function(t,e){var r,n=this;this.parent&&!this.parent.state.visible||null===(r=this.model.source.getPSDEFDGroupLogics())||void 0===r||r.forEach((function(r){var i=r.getRelatedDetailNames()||[];if(e||isOverlap(i,t)){var o=IBizVerify.verifyGroupLogic(n.form.data,r);switch(r.logicCat){case"ITEMBLANK":n.state.required=!o;break;case"ITEMENABLE":n.state.disabled=!o;break;case"PANELVISIBLE":n.state.visible=o}}}))},t.prototype.force=function(t){},t}()),FormContainerController=exports("FormContainerController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormContainerState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormDetailController)),FormGroupPanelController=exports("FormGroupPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormGroupPanelState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormContainerController)),FormPageController=exports("FormPageController",function(t){function e(e,r){return t.call(this,e,r)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormPageState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormContainerController)),FormTabPageController=exports("FormTabPageController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormTabPageState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormContainerController)),FormTabPanelController=exports("FormTabPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormTabPanelState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormDetailController)),FormItemController=exports("FormItemController",function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.editor=null,i.rules=[],i.context=r.context,i.params=r.params,i}return __extends(e,t),e.prototype.createState=function(){var t;return new FormItemState(null===(t=this.parent)||void 0===t?void 0:t.state)},Object.defineProperty(e.prototype,"name",{get:function(){return this.model.source.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.form.data[this.name]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.form.data},enumerable:!1,configurable:!0}),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),this.state.required=!this.model.source.allowEmpty,this.model.editor&&"HIDDEN"!==this.model.editor.editorType?(e=this,[4,ibiz.register.editor.get(this.model.editor)]):[3,6];case 2:return e.editorProvider=n.sent(),this.editorProvider?(r=this,[4,this.editorProvider.createController(this.model.editor,this)]):[3,6];case 3:return r.editor=n.sent(),[4,this.editor.init()];case 4:return n.sent(),[4,this.initRules()];case 5:n.sent(),n.label=6;case 6:return[2]}}))}))},e.prototype.initRules=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){return(t=this.form.model.formItemVRs.get(this.name))?(this.rules=generateRules(t,this.name,this.model.source.valueItemName),this.validator=new Schema(((e={})[this.name]=this.rules,e)),[2]):[2]}))}))},e.prototype.calcEnableCond=function(){var t=this.model.source.enableCond,e=this.data.srfuf===Srfuf.CREATE;(0===t||e&&2===t||!e&&1===t)&&(this.state.enableCondDisabled=!0)},e.prototype.dataChangeNotify=function(e){t.prototype.dataChangeNotify.call(this,e);var r=this.model.resetItemName,n=this.model.source.valueItemName;if(e.includes(r)&&this.setDataValue(null,this.name),(e.includes(this.name)||e.includes(n))&&this.validate(),e.includes(this.name)&&this.model.formItemUpdate){var i=this.model.formItemUpdate,o=i.methodName,s=i.itemNames;this.form.updateFormItem(o,s)}},e.prototype.formStateNotify=function(e){t.prototype.formStateNotify.call(this,e),this.calcEnableCond(),e!==FormNotifyState.DRAFT&&e!==FormNotifyState.LOAD||this.setDefaultValue(e===FormNotifyState.DRAFT)},e.prototype.calcDynamicLogic=function(e,r){this.model.source.hidden||t.prototype.calcDynamicLogic.call(this,e,r)},e.prototype.validate=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:if(!this.state.visible)return this.state.error=null,[2,!0];if(this.state.required&&isNilOrEmpty(this.data[this.name]))return this.state.error="请填写".concat(this.model.source.caption),[2,!1];if(!this.validator)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.validator.validate(this.data)];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),e=t.errors,t._fields,this.state.error=e[0].message,[2,!1];case 4:return this.state.error=null,[2,!0]}}))}))},e.prototype.setDataValue=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return e=e||this.name,[4,this.form.setDataValue(e,t)];case 1:return r.sent(),[2]}}))}))},e.prototype.setDefaultValue=function(t){var e=this.model.source,r=e.createDVT,n=e.createDV,i=e.updateDVT,o=e.updateDV,s=t?r:i,a=t?n:o;if("RESET"!==s){if(!(this.value||isNilOrEmpty(s)&&isNilOrEmpty(a)))if(s||!a)switch(s){case"APPDATA":Object.prototype.hasOwnProperty.call(this.context,a)&&(this.data[this.name]=this.context[a]),Object.prototype.hasOwnProperty.call(this.params,a)&&(this.data[this.name]=this.params[a]);break;case"OPERATORNAME":this.data[this.name]=this.context.srfusername;break;case"OPERATOR":this.data[this.name]=this.context.srfuserid;break;case"CURTIME":this.data[this.name]=dayjs().format(this.model.valueFormat);break;case"PARAM":this.data[this.name]=this.data[a];break;default:ibiz.message.error("[".concat(s,"]类型默认值未支持"))}else this.data[this.name]=a}else this.data[this.name]=null},e}(FormDetailController)),FormButtonController=exports("FormButtonController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormButtonState(null===(t=this.parent)||void 0===t?void 0:t.state)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),e=this.form.model.source.name.toLowerCase(),r=this.model.source.codeName.toLowerCase(),n="".concat(e,"_").concat(r,"_click"),this.viewLogic=this.form.model.source.findPSAppViewLogic(n)||void 0,[2]}}))}))},e.prototype.onClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return"UIACTION"===this.model.source.actionType?[2,this.doUIAction(t)]:[2,this.doFormItemUpdate()]}))}))},e.prototype.doUIAction=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!this.viewLogic)throw new RuntimeError("没有找到按钮对应的视图逻辑");return[4,this.form.nerve.self.evt.asyncEmit("actionClick",this.viewLogic,[this.form.data],t)];case 1:return e.sent(),[2]}}))}))},e.prototype.doFormItemUpdate=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r;return __generator(this,(function(n){if(!this.model.formItemUpdate)throw new RuntimeError("不存在表单项更新");return t=this.model.formItemUpdate,e=t.methodName,r=t.itemNames,this.form.updateFormItem(e,r),[2]}))}))},e}(FormDetailController)),FormRawItemController=exports("FormRawItemController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormRawItemState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormDetailController)),FormDRUIPartController=exports("FormDRUIPartController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormDruipartState(null===(t=this.parent)||void 0===t?void 0:t.state)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),Object.assign(this.state.layoutController.extraStyle,{overflow:"auto"}),[2]}}))}))},e.prototype.dataChangeNotify=function(e){t.prototype.dataChangeNotify.call(this,e),isOverlap(this.model.refreshItems,e)&&this.calcViewParams()},e.prototype.formStateNotify=function(e){t.prototype.formStateNotify.call(this,e),this.calcViewParams()},e.prototype.calcViewParams=function(){var t=new IBizContext({},this.form.context),e=this.model.source.getPSNavigateContexts();notNilEmpty(e)&&(t=Object.assign(t,convertNavData(e,this.form.context,this.form.params,this.form.data)));var r=this.model.source.getPSNavigateParams(),n={};notNilEmpty(r)&&(n=convertNavData(r,this.form.params,this.form.context,this.form.data)),this.neuron&&this.state.context&&JSON.stringify(this.state.context)===JSON.stringify(t)&&JSON.stringify(this.state.params)===JSON.stringify(n)?this.refresh():this.refresh(!0),this.state.context=t,this.state.params=n,this.force()},e.prototype.refresh=function(t){void 0===t&&(t=!1),t?this.state.viewComponentKey=createUUID():this.neuron.call.refresh()},e.prototype.setViewNeuron=function(t){var e=this;this.neuron=t,this.neuron.evt.on("refreshed",(function(t){if(ibiz.log.debug("接收到关系界面的刷新变更事件",t),e.model.formItemUpdate){var r=e.model.formItemUpdate,n=r.methodName,i=r.itemNames;e.form.updateFormItem(n,i)}}))},e}(FormDetailController)),MDController=exports("MDController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new MDState,e.items=[],e.selectedData=[],e.singleSelect=!1,e.isSelectFirstDefault=!1,e.defaultSelectKeys=[],e.isExpView=!1,e.curPage=1,e.size=20,e.total=0,e}return __extends(e,t),e.prototype.createNerve=function(){return new MDControlNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[2]}}))}))},e.prototype.setIsSelectFirstDefault=function(t){"boolean"==typeof t&&(this.isSelectFirstDefault=t)},e.prototype.setDefaultSelectKeys=function(t){t&&(this.defaultSelectKeys=t)},e.prototype.getParams=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.nerve.self.evt.asyncEmit("beforeLoad")];case 1:return t=r.sent(),e=t.length>0?t.reduce((function(t,e){return Object.assign(t,e)})):{},[2,__assign(__assign(__assign({},this.params),e),{page:this.state.curPage-1,size:this.state.size})]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n,i,o,s,a,c;return __generator(this,(function(u){switch(u.label){case 0:return[4,this.getParams()];case 1:return t=u.sent(),[4,this.startLoading()];case 2:u.sent(),u.label=3;case 3:return u.trys.push([3,,5,7]),[4,this.service.fetch(this.context,t)];case 4:return e=u.sent(),[3,7];case 5:return[4,this.endLoading()];case 6:return u.sent(),[7];case 7:return e.total&&(this.state.total=e.total),e.data.forEach((function(t){t.reactiveInit()})),this.state.items=e.data,!this.state.hasLoaded&&this.isSelectFirstDefault&&this.state.items[0]?0!==this.defaultSelectKeys.length?[3,9]:[4,this.nerve.self.evt.asyncEmit("dataActive",this.state.items[0])]:[3,11];case 8:return u.sent(),[3,11];case 9:if(!(this.defaultSelectKeys.length>0))return[3,11];r=this.state.items.map((function(t){return t.srfkey})),n=!1;try{for(i=__values(this.defaultSelectKeys),o=i.next();!o.done;o=i.next())if(s=o.value,r.includes(s)){n=!0;break}}catch(t){a={error:t}}finally{try{o&&!o.done&&(c=i.return)&&c.call(i)}finally{if(a)throw a.error}}return n?[3,11]:[4,this.nerve.self.evt.asyncEmit("dataActive",this.state.items[0])];case 10:u.sent(),u.label=11;case 11:return[4,this.afterLoad(this.state.items)];case 12:return u.sent(),this.state.hasLoaded=!0,this.force(),[2,this.state.items]}}))}))},e.prototype.afterLoad=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,t]}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:if(0===this.state.selectedData.length)throw new RuntimeError("未选中数据");return[4,this.startLoading()];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,,4,6]),[4,Promise.allSettled(this.state.selectedData.map((function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return e.srfuf===Srfuf.CREATE?[3,2]:[4,this.service.remove(__assign((t={},t[this.model.appEntity.deName]=e.srfkey,t),this.context),this.params)];case 1:r.sent(),r.label=2;case 2:return this.afterRemove(e),[2]}}))}))})))];case 3:return e.sent(),[3,6];case 4:return[4,this.endLoading()];case 5:return e.sent(),[7];case 6:return[4,this.nerve.self.evt.asyncEmit("afterRemove",this.state.selectedData)];case 7:return e.sent(),this.state.selectedData=[],this.isExpView?[4,this.nerve.self.evt.asyncEmit("dataActive",this.state.items[0])]:[3,9];case 8:e.sent(),e.label=9;case 9:return this.force(),[2]}}))}))},e.prototype.afterRemove=function(t){var e=this.state.items.findIndex((function(e){return e.srfkey===t.srfkey}));this.state.items.splice(e,1)},e.prototype.getData=function(){return this.state.selectedData||[]},e.prototype.selectAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.state.selectedData=__spreadArray([],__read(this.state.items),!1),this.nerve.self.evt.emit("selectionChange",this.state.selectedData),[2,this.state.selectedData]}))}))},e.prototype.onSelectionChange=function(t){this.state.selectedData=t,this.nerve.self.evt.emit("selectionChange",t)},e.prototype.importData=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return t=this.model,e=t.appEntity,r=t.dataImport,n="".concat(e.deNamePlural,"/importtemplate"),i="".concat(e.deNamePlural,"/importdata2"),r&&(n+="?srfimporttag=".concat(r.codeName),i+="?srfimporttag=".concat(r.codeName)),(o=ibiz.overlay.createModal("DataImport",{dismiss:function(){return o.dismiss()},templateUrl:n,importUrl:i},{width:"auto",placement:"center"})).present(),[4,o.onWillDismiss()];case 1:return s.sent(),[2]}}))}))},e.prototype.exportData=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,s,a,c;return __generator(this,(function(u){switch(u.label){case 0:if(e=this.model,r=e.dataExport,n=e.appEntity,!r)throw new DefectModelError(this.model.source,"没有配置实体导出模型!");if(!r.enableBackend)throw new UnsupportedModelError(r,"前台导出暂未支持!");return(i=ibiz.overlay.createPopover("DataExport",{dismiss:function(t){return i.dismiss(t)},maxRowCount:r.maxRowCount||1e3,pageSize:this.state.size},{autoClose:!0,placement:"bottom-end"})).present(t.target),[4,i.onWillDismiss()];case 1:return(o=u.sent())?[4,this.getParams()]:[2];case 2:return s=u.sent(),Object.assign(s,o),[4,this.service.exportData(r,this.context,s)];case 3:return a=u.sent().data,c="".concat(n.source.logicName,"表.xlsx"),downloadFileFromBlob(a,c),[2]}}))}))},e}(MainController)),GridController=exports("GridController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new GridState,e.columns={},e.fieldColumns={},e.uaColumns={},e.editItems={},e.providers={},e.rows=[],e.gridRowActiveMode=2,e.hasWidthFlexGrow=!1,e}return __extends(e,t),Object.defineProperty(e.prototype,"noSort",{get:function(){return this.model.source.noSort},enumerable:!1,configurable:!0}),e.prototype.createNerve=function(){return new GridNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return o.sent(),this.state.size=this.model.size,this.state.singleSelect=this.model.source.singleSelect,this.service=new GridService(this.model),[4,this.service.init(this.context)];case 2:return o.sent(),this.hasWidthFlexGrow=!!this.model.columns.find((function(t){return t.widthFlexGrow})),[4,this.initGridColumns()];case 3:return o.sent(),this.dataChangeNotify=debounceAndAsyncMerge(this.dataChangeNotify.bind(this),(function(t,e){return[t[0],Array.from(new Set(__spreadArray(__spreadArray([],__read(t[1]),!1),__read(e[1]),!1)))]}),200),this.nerve.self.evt.on("beforeLoad",(function(){return i.sortQuery?{sort:i.sortQuery}:{}})),e=this.model,r=e.defaultSortField,n=e.defaultSortDir,r&&n&&this.setSort(r,n),[2]}}))}))},e.prototype.afterLoad=function(t){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,Promise.allSettled(Object.values(this.fieldColumns).map((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.loadCodeList()];case 1:return e.sent(),[2]}}))}))})))];case 1:return r.sent(),this.state.rows=t.map((function(t){var r=new GridRowController(t,e);return e.gridStateNotify(r,GridNotifyState.LOAD),r})),[2,t]}}))}))},e.prototype.afterRemove=function(e){t.prototype.afterRemove.call(this,e);var r=this.state.rows.findIndex((function(t){return t.data.srfkey===e.srfkey}));this.state.rows[r].destroy(),this.state.rows.splice(r,1)},e.prototype.newRow=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.service.getDraft(this.context,this.params)];case 1:return t=r.sent(),this.state.items.unshift(t.data),e=new GridRowController(t.data,this),this.state.rows.unshift(e),this.gridStateNotify(e,GridNotifyState.DRAFT),[2]}}))}))},e.prototype.save=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,s,a;return __generator(this,(function(c){switch(c.label){case 0:if(!(e=this.state.rows.find((function(e){return e.data.srfkey===t.srfkey}))))throw new RuntimeError("行数据不存在");return e.modified?[4,this.validate(e)]:(ibiz.log.debug("值没有发生改变"),[2]);case 1:if(!c.sent())throw new RuntimeError("行数据校验不通过,保存取消");return[4,this.startLoading()];case 2:c.sent(),n=t.srfuf===Srfuf.CREATE,c.label=3;case 3:return c.trys.push([3,,8,10]),n?[4,this.service.create(__assign((s={},s[this.model.appEntity.deName]=t.srfkey,s),this.context),t)]:[3,5];case 4:return i=c.sent(),[3,7];case 5:return[4,this.service.update(__assign((a={},a[this.model.appEntity.deName]=t.srfkey,a),this.context),t)];case 6:i=c.sent(),c.label=7;case 7:return r=i,[3,10];case 8:return[4,this.endLoading()];case 9:return c.sent(),[7];case 10:return o=this.state.items.findIndex((function(e){return e.srfkey===t.srfkey})),this.state.items.splice(o,1,r.data),e.data=r.data,e.modified=!1,ibiz.message.success("".concat(r.data.srfmajortext||"","保存成功")),this.gridStateNotify(e,GridNotifyState.SAVE),[4,this.nerve.self.evt.asyncEmit("afterSave",[r.data],n)];case 11:return c.sent(),[2]}}))}))},e.prototype.onRowClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 1!==this.gridRowActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.onDbRowClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 2!==this.gridRowActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.setGridRowActiveMode=function(t){this.gridRowActiveMode=void 0===t?2:t},e.prototype.setGridIsExpView=function(t){"boolean"==typeof t&&(this.isExpView=t)},e.prototype.initGridColumns=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,Promise.all(this.model.columns.map((function(e){return __awaiter(t,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,ibiz.register.gridColumn.get(e)];case 1:return t=n.sent(),this.providers[e.codeName]=t,[4,t.createController(e,this)];case 2:return r=n.sent(),this.columns[e.codeName]=r,"DEFGRIDCOLUMN"===e.source.columnType?this.fieldColumns[e.codeName]=r:"UAGRIDCOLUMN"===e.source.columnType&&(this.uaColumns[e.codeName]=r),[2]}}))}))})))];case 1:return e.sent(),[4,Promise.all(this.model.editItems.map((function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){return this.editItems[e.codeName]?[2]:(t=new GridEditItemController(e,this),this.editItems[e.codeName]=t,[2,t.init()])}))}))})))];case 2:return e.sent(),[2]}}))}))},e.prototype.setRowValue=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return Object.prototype.hasOwnProperty.call(t.data,e)&&t.data[e]===r?[2]:(t.data[e]=r,t.modified=!0,[4,this.dataChangeNotify(t,[e])]);case 1:return n.sent(),this.force(),[2]}}))}))},e.prototype.dataChangeNotify=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return[4,Promise.allSettled(Object.values(this.editItems).map((function(r){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r.dataChangeNotify(t,e)]}))}))})))];case 1:if((r=i.sent()).find((function(t){return"rejected"===t.status})))throw ibiz.log.error("dataChangeNotify报错",r),new RuntimeError("数据变更后有错误");return[2]}}))}))},e.prototype.gridStateNotify=function(t,e){Object.values(this.editItems).forEach((function(r){r.gridStateNotify(t,e)}))},e.prototype.validate=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,Promise.all(Object.values(this.editItems).map((function(e){return e.validate(t)})))];case 1:return[2,-1===e.sent().findIndex((function(t){return!t}))]}}))}))},e.prototype.toggleRowEdit=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return!0!==t.showRowEdit?[3,2]:[4,this.save(t.data)];case 1:e.sent(),e.label=2;case 2:return t.showRowEdit=!t.showRowEdit,[2]}}))}))},e.prototype.setSort=function(t,e){this.sortQuery="".concat(t,",").concat(e)},e.prototype.updateGridEditItem=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,s=this;return __generator(this,(function(a){switch(a.label){case 0:return n=__assign(__assign({},this.params),t.data.getRequestData()),[4,this.service.updateGridEditItem(e,this.context,n)];case 1:return i=a.sent(),(o=i.data)&&(null==r?void 0:r.length)?[4,Promise.all(r.map((function(e){return s.setRowValue(t,e,o[e])})))]:[3,3];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))},e}(MDController)),GridColumnController=exports("GridColumnController",function(){function t(t,e){this.model=t,this.grid=e,this.app=ibiz.hub.getApp(t.modelService.app)}return Object.defineProperty(t.prototype,"context",{get:function(){return this.grid.context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"params",{get:function(){return this.grid.params},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableRowEdit",{get:function(){return this.grid.model.source.enableRowEdit&&this.model.source.enableRowEdit},enumerable:!1,configurable:!0}),t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},t}()),GridFieldColumnController=exports("GridFieldColumnController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"isLinkColumn",{get:function(){return this.model.source.enableLinkView&&!!this.model.linkView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasAction",{get:function(){return!!this.model.source.getPSDEUIAction()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clickable",{get:function(){return this.isLinkColumn||this.hasAction},enumerable:!1,configurable:!0}),e.prototype.openLinkView=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,s,a,c;return __generator(this,(function(u){switch(u.label){case 0:if(r=this.model.source.linkValueItem||"srfkey",!(n=t.data[r]))throw new RuntimeError("链接值项取不到值");return(i=this.model.linkView)?i.initialized?[3,2]:[4,i.init()]:[2];case 1:u.sent(),u.label=2;case 2:return o=i.appEntity.deName,s=new IBizContext(((c={})[o]=n,c),this.context),a=clone(this.params),[4,ibiz.commands.execute(OpenAppViewCommand.TAG,i.source,s,a,{event:e})];case 3:return u.sent(),[2]}}))}))},e.prototype.triggerAction=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return this.model.viewLogic?[4,this.grid.nerve.self.evt.asyncEmit("actionClick",this.model.viewLogic,[t.data],e)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.prototype.loadCodeList=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return(t=this.model.source.getPSAppCodeList())?[4,this.app.codeList.get(t.codeName,this.context,this.params)]:[2];case 1:return e=r.sent(),this.codeListItems=e,[2,e]}}))}))},e}(GridColumnController)),GridEditItemController=exports("GridEditItemController",function(){function t(t,e){this.title="",this.rules=[],this.model=t,this.grid=e}return Object.defineProperty(t.prototype,"context",{get:function(){return this.grid.context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"params",{get:function(){return this.grid.params},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return!this.model.source.allowEmpty},enumerable:!1,configurable:!0}),t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){var t;return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return this.title=(null===(t=this.model.gridFieldColumn)||void 0===t?void 0:t.title)||"",this.model.editor&&"HIDDEN"!==this.model.editor.editorType?(e=this,[4,ibiz.register.editor.get(this.model.editor)]):[3,5];case 1:return e.editorProvider=n.sent(),this.editorProvider?(r=this,[4,this.editorProvider.createController(this.model.editor,this)]):[3,5];case 2:return r.editor=n.sent(),[4,this.editor.init()];case 3:return n.sent(),[4,this.initRules()];case 4:n.sent(),n.label=5;case 5:return[2]}}))}))},t.prototype.initRules=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){return(t=this.model.editItemVRs)?(this.rules=generateRules(t,this.model.codeName,this.model.source.valueItemName),this.validator=new Schema(((e={})[this.model.codeName]=this.rules,e)),[2]):[2]}))}))},t.prototype.setRowValue=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return r=r||this.model.codeName,[4,this.grid.setRowValue(t,r,e)];case 1:return n.sent(),[2]}}))}))},t.prototype.dataChangeNotify=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return e.includes(this.model.codeName)||e.includes(this.model.source.valueItemName)?[4,this.validate(t)]:[3,2];case 1:if(!o.sent())throw new RuntimeError("".concat(this.model.codeName,"校验报错"));o.label=2;case 2:return e.includes(this.model.codeName)&&this.model.gridItemUpdate?(r=this.model.gridItemUpdate,n=r.methodName,i=r.itemNames,[4,this.grid.updateGridEditItem(t,n,i)]):[3,4];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t.prototype.gridStateNotify=function(t,e){this.calcEnableCond(t)},t.prototype.calcEnableCond=function(t){var e=this.model.source.enableCond,r=t.data.srfuf===Srfuf.CREATE;(0===e||r&&2===e||!r&&1===e)&&(t.columnState[this.model.codeName].disabled=!0)},t.prototype.validate=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(e=this.model.codeName,!this.validator)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.validator.validate(t.data)];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),n=r.errors,r._fields,t.errors[e]=n[0].message,[2,!1];case 4:return t.errors[e]=null,[2,!0]}}))}))},t}()),GridFieldEditColumnController=exports("GridFieldEditColumnController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(e=this.model.editItem)?(r=this,[4,this.createEditItemController(e)]):[3,3];case 2:r.editItem=n.sent(),this.grid.editItems[e.codeName]=this.editItem,n.label=3;case 3:return[2]}}))}))},e.prototype.createEditItemController=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,(e=new GridEditItemController(t,this.grid)).init()];case 1:return r.sent(),[2,e]}}))}))},e}(GridFieldColumnController)),GridUAColumnController=exports("GridUAColumnController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initActionStates=function(t){var e,r=this,n=this.model.source.getPSDEUIActionGroup();if(!n)throw new DefectModelError(this.model.source,"操作列没有配置界面行为");var i=new ButtonContainerState;null===(e=n.getPSUIActionGroupDetails())||void 0===e||e.forEach((function(t){var e=t.getPSUIAction();if(e){var n=new ButtonState(t.name,e,r.grid.model.appEntity);i.addState(t.name,n)}})),i.update(t.data.getOrigin()),t.uaColumnStates[this.model.codeName]=i},e.prototype.onActionClick=function(t,e,r){var n;return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(o){switch(o.label){case 0:return"ToggleRowEdit"!==(null===(n=t.getPSUIAction())||void 0===n?void 0:n.uIActionTag)?[3,2]:[4,this.grid.toggleRowEdit(e)];case 1:case 3:return o.sent(),[2];case 2:return i=this.model.findAppViewLogic(t.name),[4,this.grid.nerve.self.evt.asyncEmit("actionClick",i,[e.data],r)]}}))}))},e}(GridColumnController)),GridRowController=exports("GridRowController",function(){function t(t,e){var r=this;this.errors={},this.uaColumnStates={},this.columnState={},this.showRowEdit=!1,this.modified=!1,this.data=t,Object.keys(this.data).forEach((function(t){void 0===r.errors[t]&&(r.errors[t]=null)})),t.srfuf===Srfuf.CREATE&&(this.showRowEdit=!0),Object.values(e.uaColumns).forEach((function(t){t.initActionStates(r)})),Object.values(e.editItems).forEach((function(t){r.columnState[t.model.codeName]={disabled:!1,editable:!1}}))}return t.prototype.destroy=function(){this.data=void 0,clearAll(this.errors)},t}()),ListController=exports("ListController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new ListNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),this.service=new ListService(this.model),[4,this.service.init(this.context)];case 2:return e.sent(),[2]}}))}))},e}(MDController)),TreeController=exports("TreeController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new TreeState,e}return __extends(e,t),e.prototype.createNerve=function(){return new TreeNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),this.service=new TreeService(this.model),[4,this.service.init(this.context)];case 2:return e.sent(),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.loadNodes(void 0)];case 1:return t=e.sent()||[],this.isSelectFirstDefault&&0===this.defaultSelectKeys.length&&this.onTreeNodeClick(t[0]),[2,t]}}))}))},e.prototype.loadNodes=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.getParams()];case 1:return e=i.sent(),r=!!e.query,t||(this.state.rootNode=new TreeStaticNodeData(this.model.rootNode,void 0,{hasQuery:r}),t=this.state.rootNode),[4,this.startLoading()];case 2:i.sent(),i.label=3;case 3:return i.trys.push([3,,5,7]),[4,this.service.fetchChildNodes(t,{context:new IBizContext({},this.context),params:e,hasQuery:r})];case 4:return n=i.sent()||[],[3,7];case 5:return[4,this.endLoading()];case 6:return i.sent(),[7];case 7:return t.children=n,[2,n]}}))}))},e.prototype.onTreeNodeClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:return e.sent(),[2]}}))}))},e}(MDController)),ViewPanelController=exports("ViewPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new ViewPanelNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[2]}}))}))},e}(ControlController)),PickupViewPanelController=exports("PickupViewPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new PickupViewPanelNerve(this)},e.prototype.selectAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.embedView.call.selectAll()]}))}))},e}(ViewPanelController)),PortletPartController=exports("PortletPartController",function(){function t(t,e,r){this.layoutController={width:"100%",height:"100%",extraStyle:{},extraClass:"",visible:!0},this.model=t,this.dashboard=e,this.parent=r}return Object.defineProperty(t.prototype,"context",{get:function(){return this.dashboard.context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"params",{get:function(){return this.dashboard.params},enumerable:!1,configurable:!0}),t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.model.width&&(this.layoutController.width=this.model.width),this.model.height&&(this.layoutController.height=this.model.height),this.model.source.getPSSysCss()&&(this.layoutController.extraClass=this.model.source.getPSSysCss().cssName),[2]}))}))},t}()),ActionBarPortletController=exports("ActionBarPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),AppMenuPortletController=exports("AppMenuPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),ChartPortletController=exports("ChartPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),CustomPortletController=exports("CustomPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),HtmlPortletController=exports("HtmlPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),ListPortletController=exports("ListPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(e=this.model.list)?(r=this,[4,ibiz.register.control.get(e)]):[3,3];case 2:r.listProvider=n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.setListNeuron=function(t){var e=this;this.list=t,this.list.evt.on("mounted",(function(){e.list.call.load()})),this.list.evt.on("destroyed",(function(){e.list=void 0}))},e}(PortletPartController)),RawItemPortletController=exports("RawItemPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),ToolbarPortletController=exports("ToolbarPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),ViewPortletController=exports("ViewPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),ContainerPortletController=exports("ContainerPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),DashboardController=exports("DashboardController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.providers={},e.portlets={},e}return __extends(e,t),e.prototype.createNerve=function(){return new DashboardNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[4,this.initPortlets(this.model.children)];case 2:return e.sent(),[2]}}))}))},e.prototype.initPortlets=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){return __awaiter(r,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,ibiz.register.portletPart.get(t)];case 1:return(r=o.sent())?(this.providers[t.name]=r,[4,r.createController(t,this,e)]):[3,4];case 2:return n=o.sent(),this.portlets[t.name]=n,(null===(i=t.children)||void 0===i?void 0:i.length)?[4,this.initPortlets(t.children,n)]:[3,4];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))})))];case 1:return n.sent(),[2]}}))}))},e}(ControlController)),EditorController=exports("EditorController",function(){function t(t,e){this.placeHolder="",this.editorParams={},this.model=t,this.parent=e,this.context=e.context,this.params=e.params,this.app=ibiz.hub.getApp(t.modelService.app.appId)}return Object.defineProperty(t.prototype,"readonly",{get:function(){return this.model.readonly},enumerable:!1,configurable:!0}),t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.model.placeHolder&&(this.placeHolder=this.model.placeHolder),this.model.editorParams&&(this.editorParams=this.model.editorParams),[2]}))}))},t.prototype.handlePublicParams=function(t){var e=this.model,r=e.navigateContexts,n=e.navigateParams,i={};r&&t&&(i=convertNavData(r,this.context,this.params,t));var o=new IBizContext(i,this.context),s={};return n&&t&&(s=convertNavData(n,this.context,this.params,t)),{context:o,params:__assign(__assign({},this.params),s)}},t}()),TextBoxEditorController=exports("TextBoxEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.placeHolder="请输入",e}return __extends(e,t),e}(EditorController)),CodeListEditorController=exports("CodeListEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.loadCodeList=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return e=this.handlePublicParams(t),r=e.context,n=e.params,this.model.codeList?([],i=this.model.codeList.codeName,[4,this.app.codeList.get(i,r,n)]):[3,2];case 1:return[2,o.sent()];case 2:throw new DefectModelError(this.model.source,"请配置代码表")}}))}))},e}(EditorController)),CheckBoxListEditorController=exports("CheckBoxListEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(CodeListEditorController)),RadioButtonListEditorController=exports("RadioButtonListEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(CodeListEditorController)),DatePickerEditorController=exports("DatePickerEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.placeHolder="请选择日期",e}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.prototype.onInit.call(this),this.valueFormat=this.model.valueFormat,[2]}))}))},e}(EditorController)),SpanEditorController=exports("SpanEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.prototype.onInit.call(this),this.unitName=this.model.unitName,this.valueFormat=this.model.valueFormat,[2]}))}))},e}(CodeListEditorController)),DropDownListEditorController=exports("DropDownListEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.placeHolder="请选择",e.multiple=!1,e}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.prototype.onInit.call(this),"MDROPDOWNLIST"===this.model.editorType&&(this.multiple=!0),[2]}))}))},e}(CodeListEditorController)),PickerEditorController=exports("PickerEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.multiple=!1,e.placeHolder="请选择数据",e.pickupView=null,e.linkView=null,e.valueItem="",e.keyName="",e.textName="",e.serviceName="",e.interfaceName="",e.sort="",e.noAC=!1,e}return __extends(e,t),e.prototype.onInit=function(){var e,r,n;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:return t.prototype.onInit.call(this),this.initNOAC(),this.valueItem=(null===(e=this.model.valueItemName)||void 0===e?void 0:e.toLowerCase())||"",this.keyName=(null===(r=this.model.appDataEntity)||void 0===r?void 0:r.keyName)||"",this.textName=(null===(n=this.model.appDataEntity)||void 0===n?void 0:n.textName)||"",[4,this.initPickupViewParams()];case 1:return i.sent(),[4,this.initLinkViewParams()];case 2:return i.sent(),this.getAcParams(),this.sort=this.getAcSort(),[2]}}))}))},e.prototype.initNOAC=function(){if("PICKEREX_NOAC"===this.model.editorType)this.noAC=!0;else this.noAC=!1},e.prototype.initPickupViewParams=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.model.pickupAppView&&(this.pickupView=this.model.pickupAppView),[2]}))}))},e.prototype.initLinkViewParams=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.model.linkAppView&&(this.linkView=this.model.linkAppView),[2]}))}))},e.prototype.getAcParams=function(){var t=this.model.source.getPSAppDataEntity(),e=this.model.source.getPSAppDEDataSet();t&&e&&(this.serviceName=t.codeName,this.interfaceName=e.codeName),this.model.deACMode&&(this.textName=this.model.deACMode.textFieldName||this.textName,this.keyName=this.model.deACMode.valueFieldName||this.keyName)},e.prototype.getAcSort=function(){if(this.model.deACMode){var t=this.model.deACMode,e=t.sortField,r=t.sortDir;if(e&&r)return"".concat(e,",").concat(r)}},e.prototype.getServiceData=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return r=this.handlePublicParams(e),n=r.context,i=r.params,this.sort&&!Object.is(this.sort,"")&&Object.assign(i,{sort:this.sort}),Object.assign(i,{query:t,size:1e3}),this.serviceName&&this.interfaceName?[4,this.app.es.getService(this.serviceName)]:[3,3];case 1:return[4,o.sent().exec(this.interfaceName,n,i)];case 2:return[2,o.sent()];case 3:throw new DefectModelError(this.model.source,"请配置实体和实体数据集")}}))}))},e.prototype.openPickUpView=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:if(r=this.handlePublicParams(t),n=r.context,i=r.params,e&&(i.selectedData=e),!this.pickupView)throw new DefectModelError(this.model.source,"请配置数据选择视图");return[4,ibiz.openView.modal(this.pickupView,n,i)];case 1:return(o=s.sent())&&o.ok&&o.data?[2,o.data]:(ibiz.log.debug("模态取消或关闭异常",o),[2])}}))}))},e.prototype.openLinkView=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){if(e=this.handlePublicParams(t),r=e.context,n=e.params,r.srfkey=t[this.valueItem],!this.linkView)throw new DefectModelError(this.model.source,"请配置数据链接视图");return[2,ibiz.commands.execute(OpenAppViewCommand.TAG,this.linkView,r,n)]}))}))},e.prototype.calcFillDataItems=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.model.deACMode?[2,DEACModeUtil.calcFillDataItems(t,this.model.deACMode)]:[2,[]]}))}))},e}(EditorController)),UploadEditorController=exports("UploadEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.calcBaseUrl=function(t){var e="".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId).concat(ibiz.env.uploadFileUrl),r="".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl,"/%fileId%"),n={},i={};return this.model.uploadParams&&(n=convertNavData(this.model.uploadParams,this.context,this.params,t)),this.model.exportParams&&(i=convertNavData(this.model.exportParams,this.context,this.params,t)),{uploadUrl:e+=qs.stringify(n,{addQueryPrefix:!0}),downloadUrl:r+=qs.stringify(i,{addQueryPrefix:!0})}},e.prototype.fileDownload=function(t){this.app.net.request(t.url,{method:"get",responseType:"blob",baseURL:""}).then((function(e){if(200!==e.status)throw new RuntimeError("下载文件失败");if(!e.data)throw new RuntimeError("文件流数据不存在");var r=t.name;downloadFileFromBlob(e.data,r)}))},e}(EditorController)),RegisterBase=exports("RegisterBase",function(){function t(){this.providers=new Map}return t.prototype.register=function(t,e){this.providers.set(t,e)},t.prototype.unRegister=function(t){this.providers.delete(t)},t.prototype.getByKey=function(t){return this.providers.get(t)},t}()),UIActionRegister=exports("UIActionRegister",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,s;return __generator(this,(function(a){switch(a.label){case 0:return t.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.getPSSysPFPlugin())]:[3,2];case 1:if(a.sent(),e=t.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,s="".concat(r,"_").concat(n),this.providers.has(s))return[2,this.providers.get(s)];throw new RuntimeError("找不到插件标识".concat(s,"对应的适配器"));case 2:if(i=t.uIActionMode,o=t.uIActionTag,"SYS"===i){if(s="".concat(i,"_").concat(o),this.providers.has(s))return[2,this.providers.get(s)];throw new RuntimeError("找不到系统预置界面行为".concat(o,"对应的适配器"))}if(this.providers.has(i))return[2,this.providers.get(i)];throw new RuntimeError("找不界面行为模式".concat(i,"对应的适配器"))}}))}))},e}(RegisterBase)),EditorRegister=exports("EditorRegister",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,s,a;return __generator(this,(function(c){switch(c.label){case 0:return t.source.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,2];case 1:if(c.sent(),e=t.source.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,a="".concat(r,"_").concat(n),this.providers.has(a))return[2,this.providers.get(a)];ibiz.log.error("找不到插件标识".concat(a,"对应的适配器"),t),c.label=2;case 2:if(i=t.source,o=i.editorType,s=i.editorStyle,t.source.editorStyle){if(a="".concat(o,"_").concat(s),this.providers.has(a))return[2,this.providers.get(a)];ibiz.log.error("找不到编辑器类型:".concat(o,"的编辑器样式:").concat(s,"对应的适配器"),t)}if(this.providers.has(o))return[2,this.providers.get(o)];throw new RuntimeError("找不到编辑器类型".concat(o,"对应的适配器"))}}))}))},e}(RegisterBase)),FormDetailRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return t.source.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,2];case 1:if(s.sent(),e=t.source.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,i="".concat(r,"_").concat(n),this.providers.has(i))return[2,this.providers.get(i)];ibiz.log.error("找不到插件标识".concat(i,"对应的适配器"),t),s.label=2;case 2:if(o=t.source.detailType,this.providers.has(o))return[2,this.providers.get(o)];throw new RuntimeError("找不到表单成员类型".concat(o,"对应的适配器"))}}))}))},e}(RegisterBase),ControlRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,s,a;return __generator(this,(function(c){switch(c.label){case 0:return t.source.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,2];case 1:if(c.sent(),e=t.source.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,a="".concat(r,"_").concat(n),this.providers.has(a))return[2,this.providers.get(a)];ibiz.log.error("找不到插件标识".concat(a,"对应的适配器"),t),c.label=2;case 2:if(i=t.source,o=i.controlType,s=i.controlStyle){if(a="".concat(o,"_").concat(s),this.providers.has(a))return[2,this.providers.get(a)];ibiz.log.error("找不到部件类型:".concat(o,"的部件样式:").concat(s,"对应的适配器"),t)}if(this.providers.has(o))return[2,this.providers.get(o)];throw new RuntimeError("找不到部件类型".concat(o,"对应的适配器"))}}))}))},e}(RegisterBase),ViewRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,s;return __generator(this,(function(a){switch(a.label){case 0:return t.isFill?[3,2]:[4,t.fill(!0)];case 1:a.sent(),a.label=2;case 2:return t.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.getPSSysPFPlugin())]:[3,4];case 3:if(a.sent(),e=t.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,s="".concat(r,"_").concat(n),this.providers.has(s))return[2,this.providers.get(s)];ibiz.log.error("找不到插件标识[".concat(s,"]对应的适配器"),t),a.label=4;case 4:if(i=t.viewType,(o=t.viewStyle)&&"DEFAULT"!==o){if(s="".concat(i,"_").concat(o),this.providers.has(s))return[2,this.providers.get(s)];ibiz.log.error("找不到视图类型:[".concat(i,"]的视图样式:[").concat(o,"]对应的适配器"),t)}if(this.providers.has(i))return[2,this.providers.get(i)];throw ibiz.log.error("找不到视图类型[".concat(i,"]对应的适配器"),t),new UnsupportedModelError(t,"暂未实现")}}))}))},e}(RegisterBase),PortletPartRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o;return __generator(this,(function(s){switch(s.label){case 0:return e=t.source.portletType,t.source.getPSSysPFPlugin()&&"CONTAINER"!==e?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,2];case 1:if(s.sent(),r=t.source.getPSSysPFPlugin(),n=r.pluginType,i=r.pluginCode,o="".concat(n,"_").concat(i),this.providers.has(o))return[2,this.providers.get(o)];ibiz.log.error("找不到插件标识".concat(o,"对应的适配器"),t),s.label=2;case 2:if(this.providers.has(e))return[2,this.providers.get(e)];throw new RuntimeError("找不到门户部件类型".concat(e,"对应的适配器"))}}))}))},e}(RegisterBase),GridColumnRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,s,a,c;return __generator(this,(function(u){switch(u.label){case 0:return t.source.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,2];case 1:if(u.sent(),e=t.source.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,i="".concat(r,"_").concat(n),this.providers.has(i))return[2,this.providers.get(i)];ibiz.log.error("找不到插件标识".concat(i,"对应的适配器"),t),u.label=2;case 2:if(o=t.source,s=o.columnType,a=o.enableRowEdit,c=a?"".concat(s,"_EDIT"):s,this.providers.has(c))return[2,this.providers.get(c)];throw new RuntimeError("找不到表格列类型".concat(c,"对应的适配器"))}}))}))},e}(RegisterBase),RegisterCenter=exports("RegisterCenter",(function(){this.uiAction=new UIActionRegister,this.editor=new EditorRegister,this.formDetail=new FormDetailRegister,this.gridColumn=new GridColumnRegister,this.portletPart=new PortletPartRegister,this.control=new ControlRegister,this.view=new ViewRegister})),BackendUIActionProvider=exports("BackendUIActionProvider",function(){function t(){}return t.prototype.getHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.handler||(this.handler=new BackendUIActionHandler),[2,this.handler]}))}))},t}()),CommonSysUIActionProvider=exports("CommonSysUIActionProvider",function(){function t(){}return t.prototype.getHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.handler||(this.handler=new CommonSysUIActionHandler),[2,this.handler]}))}))},t}()),FrontUIActionProvider=exports("FrontUIActionProvider",function(){function t(){}return t.prototype.getHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.handler||(this.handler=new FrontUIActionHandler),[2,this.handler]}))}))},t}()),WFWithdrawUIActionProvider=exports("WFWithdrawUIActionProvider",function(){function t(){}return t.prototype.getHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.handler||(this.handler=new WFWithdrawUIActionHandler),[2,this.handler]}))}))},t}());function presetUIActionProvider(){var t=ibiz.register.uiAction;t&&(t.register("FRONT",new FrontUIActionProvider),t.register("BACKEND",new BackendUIActionProvider),t.register("SYS_New",new CommonSysUIActionProvider),t.register("SYS_Edit",new CommonSysUIActionProvider),t.register("SYS_Save",new CommonSysUIActionProvider),t.register("SYS_SaveAndExit",new CommonSysUIActionProvider),t.register("SYS_SaveRow",new CommonSysUIActionProvider),t.register("SYS_SaveAndNew",new CommonSysUIActionProvider),t.register("SYS_Remove",new CommonSysUIActionProvider),t.register("SYS_RemoveAndExit",new CommonSysUIActionProvider),t.register("SYS_NewRow",new CommonSysUIActionProvider),t.register("SYS_SaveAndStart",new CommonSysUIActionProvider),t.register("SYS_ViewWFStep",new CommonSysUIActionProvider),t.register("SYS_ToggleFilter",new CommonSysUIActionProvider),t.register("SYS_Exit",new CommonSysUIActionProvider),t.register("SYS_Refresh",new CommonSysUIActionProvider),t.register("SYS_Import",new CommonSysUIActionProvider),t.register("SYS_ExportExcel",new CommonSysUIActionProvider),t.register("DEUIACTION_WFWithdraw",new WFWithdrawUIActionProvider))}var GlobalModel=function(){function t(){this.util=new ModelUtil,this.views=new Map}return t.prototype.init=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o=this;return __generator(this,(function(s){switch(s.label){case 0:return[4,this.util.create((function(e){return __awaiter(o,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return r="".concat(ibiz.env.remoteModelUrl).concat(e,"?dynamodeltag=").concat(t),[4,ibiz.net.get(r)];case 1:return(n=i.sent()).ok?(e.endsWith("PSSYSAPP.json")&&(n.data.id=ibiz.env.appId),[2,n.data]):[2,{}]}}))}))}),ibiz.env.hub)];case 1:return[4,s.sent().getModelService()];case 2:return e=s.sent(),this.setViews(ModelConst.DEFAULT_SANDBOX,e.app.getAllPSAppViews()||[]),[4,ibiz.hub.createApp(ModelConst.DEFAULT_SANDBOX,e)];case 3:if(s.sent(),r=e.app.getAllPSSubAppRefs())for(n=0;n<r.length;n++)i=r[n],this.setViews(i.M.id,i.getAllPSAppViews()||[]);return[2]}}))}))},t.prototype.initSubApp=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return e=t.M.id,[4,this.util.createSub((function(r){return __awaiter(n,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:return n="".concat(ibiz.env.remoteModelUrl,"/subapps/").concat(e).concat(r,"?dynamodeltag=").concat(t.M.dynamodeltag),[4,ibiz.net.get(n)];case 1:return(i=o.sent()).ok?(r.endsWith("PSSYSAPP.json")&&(i.data.id=e),[2,i.data]):[2,{}]}}))}))}),e)];case 1:return[4,i.sent().getModelService()];case 2:return r=i.sent(),[4,ibiz.hub.createApp(e,r)];case 3:return i.sent(),[2,r]}}))}))},t.prototype.setViews=function(t,e){var r=this;e.forEach((function(e){r.views.set(e.modelPath,t)}))},t.prototype.getAppModelService=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,4]),[4,this.util.getModelService(t)];case 1:return[2,n.sent()];case 2:return n.sent(),[4,this.util.getModelService()];case 3:if(e=n.sent(),!(r=e.app.findPSSubAppRef(t)))throw new DefectModelError(e.app,"子应用[".concat(t,"]不存在"));return[2,this.initSubApp(r)];case 4:return[2]}}))}))},t.prototype.getView=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(!this.views.has(t))throw new Error("未找到视图模型: ".concat(t));return e=this.views.get(t),[4,this.getAppModelService(e)];case 1:return[4,(r=i.sent()).factory.getView(t)];case 2:if(n=i.sent())return[2,n];throw new DefectModelError(r.app,"未找到视图[".concat(t,"]"))}}))}))},t.prototype.getAppFunc=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return(e=t.appId)===ModelConst.DEFAULT_SANDBOX?[2,t.appFunc]:[4,this.getAppModelService(e)];case 1:return[2,r.sent().app.findPSAppFunc(t.source.M.getPSAppFunc)]}}))}))},t.prototype.getModelService=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.util.getModelService(null==t?void 0:t.srfsandbox)]}))}))},t}(),Application=function(){function t(t){this.modelService=t,this.modelService=t,this.net=new Net({baseURL:"".concat(ibiz.env.baseUrl,"/").concat(t.app.appId===ModelConst.DEFAULT_SANDBOX?ibiz.env.appId:t.app.appId)}),this.resourcePathUtil=new ServicePathUtil(t),this.es=new ServiceUtil(t),this.codeList=new CodeListService(t),this.authority=new AuthorityService(t)}return t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.resourcePathUtil.init()];case 1:return t.sent(),[4,this.authority.init()];case 2:return t.sent(),[2]}}))}))},t}(),RuntimeHub=function(){function t(){this.appMap=new Map}return t.prototype.createApp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=new Application(e),this.appMap.set(t,r),[4,r.init()];case 1:return n.sent(),[2,r]}}))}))},t.prototype.getApp=function(t){var e=null;return t&&(e=t instanceof Object?t instanceof ModelObject?t.modelService.app.appId:t.appId:t),e||(e=ModelConst.DEFAULT_SANDBOX),this.appMap.get(e)},t}();function install(){var t=window.ibiz;t.hub=new RuntimeHub,t.model=new GlobalModel,t.register=new RegisterCenter,t.config=new GlobalConfig,t.auth=new AuthService,installCommand(),presetUIActionProvider()}var PluginStaticResource=exports("PluginStaticResource",function(){function t(t){this.baseDir=t.substring(0,t.lastIndexOf("/"))}return t.prototype.dir=function(t){return this.baseDir+t},t}()),RemotePluginItem=exports("RemotePluginItem",(function(t,e){this.tag=t,this.config=e}))}}}));
1
+ System.register(["@ibiz-template/core","@ibiz-template/model","qx-util","lodash-es","qs","ramda","async-validator","dayjs"],(function(exports){"use strict";var RuntimeError,NOOP,IBizContext,StringUtil,pluralLower,HttpError,HttpResponse,MenuPermissionMode,debounceAndAsyncMerge,awaitTimeout,isOverlap,downloadFileFromBlob,Logger,setRemoteStyle,Net,UnsupportedModelError,DefectModelError,getPSUIActionByModelObject,UILogicModel,AppEntityModel,ViewType,DELogicModel,ModelUtil,ModelConst,ModelObject,clearAll,QXEvent,notNilEmpty,isNilOrEmpty,createUUID,ascSort,descSort,isArray$1,isEmpty,isArray,qs,isNil,isEmpty$1,clone,equals,where,Schema,dayjs;return{setters:[function(t){RuntimeError=t.RuntimeError,NOOP=t.NOOP,IBizContext=t.IBizContext,StringUtil=t.StringUtil,pluralLower=t.pluralLower,HttpError=t.HttpError,HttpResponse=t.HttpResponse,MenuPermissionMode=t.MenuPermissionMode,debounceAndAsyncMerge=t.debounceAndAsyncMerge,awaitTimeout=t.awaitTimeout,isOverlap=t.isOverlap,downloadFileFromBlob=t.downloadFileFromBlob,Logger=t.Logger,setRemoteStyle=t.setRemoteStyle,Net=t.Net},function(t){UnsupportedModelError=t.UnsupportedModelError,DefectModelError=t.DefectModelError,getPSUIActionByModelObject=t.getPSUIActionByModelObject,UILogicModel=t.UILogicModel,AppEntityModel=t.AppEntityModel,ViewType=t.ViewType,DELogicModel=t.DELogicModel,ModelUtil=t.ModelUtil,ModelConst=t.ModelConst,ModelObject=t.ModelObject},function(t){clearAll=t.clearAll,QXEvent=t.QXEvent,notNilEmpty=t.notNilEmpty,isNilOrEmpty=t.isNilOrEmpty,createUUID=t.createUUID,ascSort=t.ascSort,descSort=t.descSort,isArray$1=t.isArray},function(t){isEmpty=t.isEmpty,isArray=t.isArray},function(t){qs=t.default},function(t){isNil=t.isNil,isEmpty$1=t.isEmpty,clone=t.clone,equals=t.equals,where=t.where},function(t){Schema=t.default},function(t){dayjs=t.default}],execute:function(){exports({calcLayoutContentStyle:calcLayoutContentStyle,calcLayoutHeightWidth:calcLayoutHeightWidth,calcResPath:calcResPath,calcRouteContext:calcRouteContext,compare:compare,compareNumber:compareNumber,contains:contains,convertNavData:convertNavData,convertNavDataByArray:convertNavDataByArray,convertNavDataByObject:convertNavDataByObject,executeNewDataAppUILogic:executeNewDataAppUILogic,executeOpenDataAppUILogic:executeOpenDataAppUILogic,executeViewLogic:executeViewLogic,formatToCodeListText:formatToCodeListText,generateRules:generateRules,install:install,installCommand:installCommand,openRedirectView:openRedirectView,presetUIActionProvider:presetUIActionProvider,strContain:strContain,testCond:testCond,verifyDeRules:verifyDeRules,verifyFormGroupLogic:verifyFormGroupLogic,verifyPanelGroupLogic:verifyPanelGroupLogic});var GlobalConfig=function(){this.enableDataInfoBar=!0,this.defaultCodeListCacheTimeout=36e5,this.gridEditShowMode="cell",this.gridEditSaveMode="cell-blur"},FormNotifyState,GridNotifyState,PanelNotifyState;exports("FormNotifyState",FormNotifyState),function(t){t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE"}(FormNotifyState||exports("FormNotifyState",FormNotifyState={})),exports("GridNotifyState",GridNotifyState),function(t){t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE"}(GridNotifyState||exports("GridNotifyState",GridNotifyState={})),exports("PanelNotifyState",PanelNotifyState),function(t){t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE"}(PanelNotifyState||exports("PanelNotifyState",PanelNotifyState={}));var extendStatics=function(t,e){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},extendStatics(t,e)};function __extends(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var __assign=function(){return __assign=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},__assign.apply(this,arguments)};function __awaiter(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))}function __generator(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function __values(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function __spreadArray(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}var Counter=exports("Counter",function(){function t(t){this.callback=t,this.count=0,this.state="Unused",this.reusable=!0}return t.prototype.increment=function(){return"Used"===this.state||(this.count+=1),this.count},t.prototype.decrement=function(t){if("Used"!==this.state){if(0===this.count)throw new RuntimeError("错误的调用!decrement不能对count为0调用");this.count-=1,0===this.count&&(t?t():this.callback&&this.callback(),this.reusable||(this.state="Used"))}},t.prototype.destroy=function(){this.callback=void 0},t}()),LoadingState=exports("LoadingState",function(){function t(){this.isLoading=!1,this.counter=new Counter(NOOP)}return t.prototype.begin=function(){this.isLoading=!0,this.counter.increment()},t.prototype.end=function(){var t=this;this.counter.decrement((function(){t.isLoading=!1}))},t}()),NerveCounter=exports("NerveCounter",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.reusable=!1,e.neuronNames=new Map,e}return __extends(e,t),e.prototype.enroll=function(t){this.neuronNames.has(t)||(this.neuronNames.set(t,!1),this.increment())},e.prototype.attend=function(t){this.neuronNames.has(t)&&!1===this.neuronNames.get(t)&&(this.neuronNames.set(t,!0),this.decrement())},e}(Counter)),Neuron=exports("Neuron",function(){function t(t){this.evt=new QXEvent,this.call=t}return t.prototype.destroy=function(){clearAll(this.call),this.evt.reset()},t}()),ControlNeuron=exports("ControlNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),AppMenuNeuron=exports("AppMenuNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ToolbarNeuron=exports("ToolbarNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),FormNeuron=exports("FormNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),EditFormNeuron=exports("EditFormNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),SearchFormNeuron=exports("SearchFormNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),MDControlNeuron=exports("MDControlNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),GridNeuron=exports("GridNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ListNeuron=exports("ListNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),TreeNeuron=exports("TreeNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ViewPanelNeuron=exports("ViewPanelNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),PickupViewPanelNeuron=exports("PickupViewPanelNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),DashboardNeuron=exports("DashboardNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),DataViewNeuron=exports("DataViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),LayoutPanelNeuron=exports("LayoutPanelNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ViewLayoutPanelNeuron=exports("ViewLayoutPanelNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WizardPanelNeuron=exports("WizardPanelNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),KanbanNeuron=exports("KanbanNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ViewNeuron=exports("ViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),EditViewNeuron=exports("EditViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),EditView3Neuron=exports("EditView3Neuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),OptViewNeuron=exports("OptViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),MDViewNeuron=exports("MDViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),GridViewNeuron=exports("GridViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),DataViewViewNeuron=exports("DataViewViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ListViewNeuron=exports("ListViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),PickupGridViewNeuron=exports("PickupGridViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),PickupViewNeuron=exports("PickupViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),MPickupViewNeuron=exports("MPickupViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFViewNeuron=exports("WFViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFEditViewNeuron=exports("WFEditViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFDynaEditViewNeuron=exports("WFDynaEditViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFDynaEditView3Neuron=exports("WFDynaEditView3Neuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFDynaStartViewNeuron=exports("WFDynaStartViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WFDynaActionViewNeuron=exports("WFDynaActionViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),AppPortalViewNeuron=exports("AppPortalViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),TreeExpViewNeuron=exports("TreeExpViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),TabExpViewNeuron=exports("TabExpViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),GridExpViewNeuron=exports("GridExpViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),DashboardViewNeuron=exports("DashboardViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),WizardViewNeuron=exports("WizardViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),ListExpViewNeuron=exports("ListExpViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),KanbanViewNeuron=exports("KanbanViewNeuron",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(Neuron)),Nerve=exports("Nerve",function(){function t(t){this.counter=new NerveCounter(this.counterCallBack.bind(this)),this.controller=t,this.self=this.createNeuron(),this.counter.enroll("self")}return t.prototype.counterCallBack=function(){this.self.evt.emit("mounted")},t.prototype.bindAbility=function(){return{}},t.prototype.inclusive=function(t){return!1},t.prototype.connect=function(t,e){},t.prototype.onNeuronInit=function(t){var e=this;return this.inclusive(t)?(this.counter.enroll(t),function(r){e.connect(t,r)}):function(t){}},t.prototype.created=function(){this.self.evt.emit("created")},t.prototype.mounted=function(){this.counter.attend("self")},t.prototype.destroy=function(){this.self.evt.emit("destroyed"),this.self.destroy(),this.controller=void 0,this.self=void 0},t}()),ControlNerve=exports("ControlNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ControlNeuron(this.bindAbility())},e.prototype.listenCommonEvent=function(t,e){var r=this;e.evt.on("mounted",(function(){r.counter.attend(t)}))},e.prototype.connect=function(t,e){this.listenCommonEvent(t,e)},e}(Nerve)),AppMenuNerve=exports("AppMenuNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new AppMenuNeuron(this.bindAbility())},e}(ControlNerve)),MDControlNerve=exports("MDControlNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new MDControlNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{load:this.controller.load.bind(this.controller),remove:this.controller.remove.bind(this.controller),getData:this.controller.getData.bind(this.controller),selectAll:this.controller.selectAll.bind(this.controller),importData:this.controller.importData.bind(this.controller),exportData:this.controller.exportData.bind(this.controller)})},e}(ControlNerve)),GridNerve=exports("GridNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new GridNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{save:this.controller.save.bind(this.controller),newRow:this.controller.newRow.bind(this.controller)})},e}(MDControlNerve)),ListNerve=exports("ListNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ListNeuron(this.bindAbility())},e}(MDControlNerve)),TreeNerve=exports("TreeNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new TreeNeuron(this.bindAbility())},e}(MDControlNerve)),FormNerve=exports("FormNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new FormNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{load:this.controller.load.bind(this.controller),getData:this.controller.getData.bind(this.controller)})},e}(ControlNerve)),EditFormNerve=exports("EditFormNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new EditFormNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{save:this.controller.save.bind(this.controller),remove:this.controller.remove.bind(this.controller),wfStart:this.controller.wfStart.bind(this.controller),wfSubmit:this.controller.wfSubmit.bind(this.controller),goBack:this.controller.goBack.bind(this.controller)})},e}(FormNerve)),SearchFormNerve=exports("SearchFormNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new SearchFormNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{getParams:this.controller.getParams.bind(this.controller)})},e}(FormNerve)),ViewPanelNerve=exports("ViewPanelNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ViewPanelNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"embedView"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"embedView"===e&&(this.embedView=r,this.embedView.evt.on("viewDataChange",(function(t){n.self.evt.asyncEmit("viewDataChange",t)})),this.embedView.evt.on("destroyed",(function(){n.embedView=void 0})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.embedView=void 0},e}(ControlNerve)),PickupViewPanelNerve=exports("PickupViewPanelNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new PickupViewPanelNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{selectAll:this.controller.selectAll.bind(this.controller)})},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"embedView"===e&&(this.embedView=r,this.embedView.evt.on("selectionChange",(function(t){n.self.evt.asyncEmit("selectionChange",t)})))},e}(ViewPanelNerve)),DashboardNerve=exports("DashboardNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new DashboardNeuron(this.bindAbility())},e}(ControlNerve)),DataViewNerve=exports("DataViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new DataViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{save:this.controller.save.bind(this.controller)})},e}(MDControlNerve)),LayoutPanelNerve=exports("LayoutPanelNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new LayoutPanelNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign({},t.prototype.bindAbility.call(this))},e}(ControlNerve)),ViewLayoutPanelNerve=exports("ViewLayoutPanelNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ViewLayoutPanelNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign({},t.prototype.bindAbility.call(this))},e}(ControlNerve)),WizardPanelNerve=exports("WizardPanelNerve",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.forms=new Map,e}return __extends(e,t),e.prototype.createNeuron=function(){return new WizardPanelNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{initialize:this.controller.initialize.bind(this.controller)})},e.prototype.inclusive=function(t){return!0},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),this.forms.set(e,r),r.evt.on("mounted",(function(){n.controller.onFormMounted(e)})),r.evt.on("destroyed",(function(){n.forms&&n.forms.delete(e)}))},e}(ControlNerve)),KanbanNerve=exports("KanbanNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new KanbanNeuron(this.bindAbility())},e}(MDControlNerve)),ViewNerve=exports("ViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{refresh:this.controller.refresh.bind(this.controller),closeView:this.controller.closeView.bind(this.controller)})},e.prototype.inclusive=function(e){return"toolbar"===e||t.prototype.inclusive.call(this,e)},e.prototype.listenCommonEvent=function(t,e){var r=this;e.evt.on("beginViewLoading",(function(){r.controller.beginViewLoading()})),e.evt.on("endViewLoading",(function(){r.controller.endViewLoading()})),e.evt.on("mounted",(function(){r.counter.attend(t)}))},e.prototype.connect=function(t,e){var r=this;this.listenCommonEvent(t,e),"toolbar"===t&&(this.toolbar=e,this.toolbar.evt.on("destroyed",(function(){r.toolbar=void 0})),this.toolbar.evt.on("itemClick",this.controller.onToolbarClick.bind(this.controller)))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.toolbar=void 0},e}(Nerve)),MDViewNerve=exports("MDViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new MDViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{openData:this.controller.openData.bind(this.controller),newData:this.controller.newData.bind(this.controller),toggleFilter:this.controller.toggleFilter.bind(this.controller),importData:this.controller.importData.bind(this.controller),exportData:this.controller.exportData.bind(this.controller)})},e.prototype.inclusive=function(e){return"searchform"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"searchform"===e&&(this.searchForm=r,this.searchForm.evt.on("destroyed",(function(){n.searchForm=void 0})),this.searchForm.evt.on("search",(function(){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.controller.onSearch()]}))}))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.searchForm=void 0},e}(ViewNerve)),GridViewNerve=exports("GridViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new GridViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{remove:this.controller.remove.bind(this.controller),newRow:this.controller.newRow.bind(this.controller)})},e.prototype.inclusive=function(e){return"grid"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"grid"===e&&(this.grid=r,this.grid.evt.on("destroyed",(function(){n.grid=void 0})),this.grid.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.grid.evt.on("dataActive",this.controller.onDataActive.bind(this.controller)),this.grid.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)),this.grid.evt.on("actionClick",this.controller.executeViewLogic.bind(this.controller)),this.grid.evt.on("afterSave",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterSave.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})),this.grid.evt.on("afterRemove",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterRemove.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.grid=void 0},e}(MDViewNerve)),PickupGridViewNerve=exports("PickupGridViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new PickupGridViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{selectAll:this.controller.selectAll.bind(this.controller)})},e}(GridViewNerve)),PickupViewNerve=exports("PickupViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new PickupViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"pickupviewpanel"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"pickupviewpanel"===e&&(this.viewPanel=r,this.viewPanel.evt.on("destroyed",(function(){n.viewPanel=void 0})),this.viewPanel.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.viewPanel=void 0},e}(ViewNerve)),MPickupViewNerve=exports("MPickupViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new MPickupViewNeuron(this.bindAbility())},e}(PickupViewNerve)),EditViewNerve=exports("EditViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new EditViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{save:this.controller.save.bind(this.controller),remove:this.controller.remove.bind(this.controller),saveAndNew:this.controller.saveAndNew.bind(this.controller),wfStart:this.controller.wfStart.bind(this.controller),wfSubmit:this.controller.wfSubmit.bind(this.controller),wfWithdraw:this.controller.wfWithdraw.bind(this.controller)})},e.prototype.inclusive=function(e){return"form"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"form"===e&&(this.form=r,this.form.evt.on("actionClick",this.controller.executeViewLogic.bind(this.controller)),this.form.evt.on("afterSave",this.controller.onAfterFormSave.bind(this.controller)),this.form.evt.on("afterRemove",this.controller.onAfterFormRemove.bind(this.controller)),this.form.evt.on("destroyed",(function(){n.form=void 0})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.form=void 0},e}(ViewNerve)),EditView3Nerve=exports("EditView3Nerve",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.drViews=new Map,e}return __extends(e,t),e.prototype.createNeuron=function(){return new EditView3Neuron(this.bindAbility())},e.prototype.inclusive=function(e){return 0===e.indexOf("dritem")||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),0===e.indexOf("dritem")&&(this.drViews.set(e,r),r.evt.on("destroyed",(function(){n.drViews&&n.drViews.delete(e)})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.drViews.clear(),this.drViews=void 0},e}(EditViewNerve)),OptViewNerve=exports("OptViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new OptViewNeuron(this.bindAbility())},e}(EditViewNerve)),WFEditViewNerve=exports("WFEditViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new WFEditViewNeuron(this.bindAbility())},e.prototype.connect=function(e,r){t.prototype.connect.call(this,e,r),"form"===e&&this.form.evt.on("mounted",this.controller.onFormMounted.bind(this.controller))},e}(EditViewNerve)),WFDynaEditViewNerve=exports("WFDynaEditViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new WFEditViewNeuron(this.bindAbility())},e}(WFEditViewNerve)),WFDynaEditView3Nerve=exports("WFDynaEditView3Nerve",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.drViews=new Map,e}return __extends(e,t),e.prototype.createNeuron=function(){return new WFEditViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return 0===e.indexOf("dritem")||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),0===e.indexOf("dritem")&&(this.drViews.set(e,r),r.evt.on("destroyed",(function(){n.drViews&&n.drViews.delete(e)})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.drViews.clear(),this.drViews=void 0},e}(WFDynaEditViewNerve)),WFDynaStartViewNerve=exports("WFDynaStartViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new WFEditViewNeuron(this.bindAbility())},e}(WFEditViewNerve)),WFDynaActionViewNerve=exports("WFDynaActionViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new WFDynaActionViewNeuron(this.bindAbility())},e}(WFEditViewNerve)),AppPortalViewNerve=exports("AppPortalViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new AppPortalViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"dashboard"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){t.prototype.connect.call(this,e,r),"dashboard"===e&&(this.dashboard=r)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.dashboard=void 0},e}(ViewNerve)),TreeExpViewNerve=exports("TreeExpViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new TreeExpViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"tree"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"tree"===e&&(this.tree=r,this.tree.evt.on("destroyed",(function(){n.tree=void 0})),this.tree.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.tree.evt.on("dataActive",(function(t){return n.controller.onDataActive(t)})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tree=void 0},e}(MDViewNerve)),TabExpViewNerve=exports("TabExpViewNerve",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tabViews=new Map,e}return __extends(e,t),e.prototype.createNeuron=function(){return new TabExpViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return 0===e.indexOf("tabviewpanel")||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),0===e.indexOf("tabviewpanel")&&(this.tabViews.set(e,r),r.evt.on("destroyed",(function(){n.tabViews&&n.tabViews.delete(e)})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tabViews.clear(),this.tabViews=void 0},e}(ViewNerve)),GridExpViewNerve=exports("GridExpViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new GridExpViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{remove:this.controller.remove.bind(this.controller),newRow:this.controller.newRow.bind(this.controller)})},e.prototype.inclusive=function(e){return"gridexpbar_grid"===e||"gridexpbar_toolbar"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"gridexpbar_toolbar"===e&&(this.toolbar=r,this.toolbar.evt.on("destroyed",(function(){n.toolbar=void 0})),this.toolbar.evt.on("itemClick",this.controller.onToolbarClick.bind(this.controller))),"gridexpbar_grid"===e&&(this.grid=r,this.grid.evt.on("destroyed",(function(){n.grid=void 0})),this.grid.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.grid.evt.on("dataActive",this.controller.onDataActive.bind(this.controller)),this.grid.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)),this.grid.evt.on("actionClick",this.controller.executeViewLogic.bind(this.controller)),this.grid.evt.on("afterSave",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterSave.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})),this.grid.evt.on("afterRemove",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterRemove.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.grid=void 0},e}(MDViewNerve)),DashboardViewNerve=exports("DashboardViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new DashboardViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"dashboard"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){t.prototype.connect.call(this,e,r),"dashboard"===e&&(this.dashboard=r)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.dashboard=void 0},e}(ViewNerve)),DataViewViewNerve=exports("DataViewViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new DataViewViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{remove:this.controller.remove.bind(this.controller)})},e.prototype.inclusive=function(e){return"dataview"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"dataview"===e&&(this.dataView=r,this.dataView.evt.on("destroyed",(function(){n.dataView=void 0})),this.dataView.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.dataView.evt.on("dataActive",this.controller.onDataActive.bind(this.controller)),this.dataView.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)),this.dataView.evt.on("afterSave",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterSave.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})),this.dataView.evt.on("afterRemove",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterRemove.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.dataView=void 0},e}(MDViewNerve)),ListViewNerve=exports("ListViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ListViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{remove:this.controller.remove.bind(this.controller)})},e.prototype.inclusive=function(e){return"list"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"list"===e&&(this.list=r,this.list.evt.on("destroyed",(function(){n.list=void 0})),this.list.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.list.evt.on("dataActive",this.controller.onDataActive.bind(this.controller)),this.list.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)),this.list.evt.on("afterSave",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterSave.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})),this.list.evt.on("afterRemove",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterRemove.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.list=void 0},e}(MDViewNerve)),WizardViewNerve=exports("WizardViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new WizardViewNeuron(this.bindAbility())},e.prototype.inclusive=function(e){return"wizardpanel"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){t.prototype.connect.call(this,e,r),"wizardpanel"===e&&(this.wizardPanel=r,this.wizardPanel.evt.on("afterFinish",this.controller.onAfterFinish.bind(this.controller)))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.wizardPanel=void 0},e}(ViewNerve)),ListExpViewNerve=exports("ListExpViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new ListExpViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{remove:this.controller.remove.bind(this.controller)})},e.prototype.inclusive=function(e){return"listexpbar_list"===e||"listexpbar_toolbar"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"listexpbar_toolbar"===e&&(this.toolbar=r,this.toolbar.evt.on("destroyed",(function(){n.toolbar=void 0})),this.toolbar.evt.on("itemClick",this.controller.onToolbarClick.bind(this.controller))),"listexpbar_list"===e&&(this.list=r,this.list.evt.on("destroyed",(function(){n.list=void 0})),this.list.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.list.evt.on("dataActive",this.controller.onDataActive.bind(this.controller)),this.list.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)),this.list.evt.on("afterSave",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterSave.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})),this.list.evt.on("afterRemove",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterRemove.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.list=void 0},e}(MDViewNerve)),KanbanViewNerve=exports("KanbanViewNerve",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNeuron=function(){return new KanbanViewNeuron(this.bindAbility())},e.prototype.bindAbility=function(){return __assign(__assign({},t.prototype.bindAbility.call(this)),{remove:this.controller.remove.bind(this.controller)})},e.prototype.inclusive=function(e){return"kanban"===e||t.prototype.inclusive.call(this,e)},e.prototype.connect=function(e,r){var n=this;t.prototype.connect.call(this,e,r),"kanban"===e&&(this.kanban=r,this.kanban.evt.on("destroyed",(function(){n.kanban=void 0})),this.kanban.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.kanban.evt.on("beforeLoad",this.controller.onBeforeLoad.bind(this.controller)),this.kanban.evt.on("dataActive",this.controller.onDataActive.bind(this.controller)),this.kanban.evt.on("selectionChange",this.controller.onSelectionChange.bind(this.controller)),this.kanban.evt.on("afterSave",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterSave.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})),this.kanban.evt.on("afterRemove",(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return(t=n.controller).onAfterRemove.apply(t,__spreadArray(__spreadArray([],__read(r),!1),[e],!1))})))},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.kanban=void 0},e}(MDViewNerve));function convertNavData(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return!t||isEmpty(t)?{}:"[object Array]"===Object.prototype.toString.call(t)?convertNavDataByArray.apply(void 0,__spreadArray([t],__read(e),!1)):"[object Object]"===Object.prototype.toString.call(t)?convertNavDataByObject.apply(void 0,__spreadArray([t],__read(e),!1)):{}}function convertNavDataByArray(t){for(var e,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o={},a=function(t){if(notNilEmpty(t.value)&&!t.rawValue){var e=n.find((function(e){return!isNilOrEmpty(e)&&(e[t.value]||Object.prototype.hasOwnProperty.call(e,t.value))}));e&&(o[t.key.toLowerCase()]=e[t.value])}else o[t.key.toLowerCase()]=t.value};try{for(var s=__values(t),c=s.next();!c.done;c=s.next()){var u=c.value;a(u)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}return o}function convertNavDataByObject(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n={},i=/^%(.+)%$/,o=function(r){if(notNilEmpty(t[r])&&i.test(t[r])){var o=t[r].substring(1,t[r].length-1),a=e.find((function(t){return Object.prototype.hasOwnProperty.call(t,o)}));a&&(n[r.toLowerCase()]=a[o])}else n[r.toLowerCase()]=t[r]};for(var a in t)o(a);return n}var UILogicContext=function(){this.params={},this.result=null},UILogicLinkCond=function(){},UILogicLinkSingleCond=function(t){function e(e){var r=t.call(this)||this;r.model=e;var n=e.getSrcLogicParam();n&&(r.srcParam=n.codeName);var i=e.getDstLogicParam();return r.dstParam=i.codeName,r}return __extends(e,t),Object.defineProperty(e.prototype,"dstField",{get:function(){return this.model.dstFieldName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"op",{get:function(){return this.model.condOP},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.model.paramType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.model.value},enumerable:!1,configurable:!0}),e.prototype.test=function(t,e,r){var n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":var i=null!=r[this.value]?r[this.value]:e[this.value];return testCond(n[this.dstField],this.op,i);case"SRCENTITYFIELD":var o=t.params[this.srcParam];return testCond(n[this.dstField],this.op,o[this.value]);case"CURTIME":throw new UnsupportedModelError(this.model,"暂未支持条件值类型为[当前时间]");default:return testCond(n[this.dstField],this.op,this.value)}},e}(UILogicLinkCond),UILogicLinkGroupCond=function(t){function e(r){var n=t.call(this)||this;n.model=r;var i=r.getPSDEUILogicLinkConds()||[];return n.conds=i.map((function(t){return"SINGLE"===t.logicType?new UILogicLinkSingleCond(t):new e(t)})),n}return __extends(e,t),Object.defineProperty(e.prototype,"op",{get:function(){return this.model.groupOP},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reverse",{get:function(){return this.model.notMode},enumerable:!1,configurable:!0}),e.prototype.test=function(t,e,r){var n=!0;if(0===this.conds.length)throw new DefectModelError(this.model,"界面连接条件逻辑组未配置逻辑项");for(var i=0;i<this.conds.length;i++){var o=this.conds[i].test(t,e,r);if("AND"===this.op&&!1===o){n=!1;break}if("OR"===this.op&&!0===o){n=!0;break}}return this.reverse?!n:n},e}(UILogicLinkCond),UILogicLink=function(){function t(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;var e=this.model,r=e.linkMode,n=e.source;if(0===r){var i=n.getPSDEUILogicLinkGroupCond();i&&(this.groupCond=new UILogicLinkGroupCond(i))}}return t.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(this.model.linkMode){case 0:return this.groupCond?[2,this.groupCond.test(t,e,r&&r.length>0?r[0]:{})]:[2,!0];case 1:return[2,!0];case 2:throw new UnsupportedModelError(this.model.source,"未支持的逻辑连接类型: 异步结束");case 3:throw new UnsupportedModelError(this.model.source,"未支持的逻辑连接类型: 异步拒绝");case 9:throw new UnsupportedModelError(this.model.source,"未支持的逻辑连接类型: 异常处理");default:return[2,!1]}}))}))},t}(),UILogicNode=function(t){this.model=t,this.links=t.links.map((function(t){return new UILogicLink(t)}))},DEActionNode$1=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,c,u,l,h;return __generator(this,(function(d){switch(d.label){case 0:if(i=this.model.source,!(o=i.getDstPSAppDataEntity()))throw new DefectModelError(this.model.source,"未指定应用实体");if(!(a=i.getDstPSAppDEAction()))throw new DefectModelError(this.model.source,"未指定实体行为");return[4,ibiz.hub.getApp(this.model.modelService.app).es.getService(o.codeName)];case 1:return s=d.sent(),c=r&&r.length>0?r[0]:void 0,u=i.getDstPSDEUILogicParam(),l=i.getRetPSDEUILogicParam(),u&&(c=t.params[u.codeName]),[4,s.exec(a.codeName,e,c,n)];case 2:return(h=d.sent()).ok&&l&&(t.params[l.codeName]=h.data),[2]}}))}))},e}(UILogicNode),DEUIActionNode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a,s,c,u;return __generator(this,(function(l){switch(l.label){case 0:return o=this.model.source,[4,getPSUIActionByModelObject(o)];case 1:if(!(a=l.sent()))throw new DefectModelError(this.model.source,"未配置界面行为");return s=r,(c=o.getDstPSDEUILogicParam())&&(u=t.params[c.codeName],s=u instanceof Array?u:[u]),[4,AppDEUIActionUtil.exec(a,e,s,n,i)];case 2:return l.sent(),[2]}}))}))},e}(UILogicNode),StartNode$1=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},e}(UILogicNode),EndNode$1=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(e=this.model.source,r=e.returnType,n=e.rawValue,r){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=n;break;case"LOGICPARAM":case"LOGICPARAMFIELD":case"BREAK":throw new UnsupportedModelError(this.model.source,"暂未支持的结束节点返回值类型: ".concat(r))}return[2]}))}))},e}(UILogicNode),PrepareJSParamNode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){throw new Error("Method not implemented.")},e}(UILogicNode),UILogicParam=function(){function t(t){this.model=t}return t.prototype.calc=function(t,e,r,n,i){var o=this.model,a=o.source,s=o.codeName,c=ibiz.hub.getApp(this.model.modelService.app);if(a.default)t.params[s]=r&&r.length>0?r[0]:{};else if(a.activeContainerParam)t.params[s]=null==i?void 0:i.container;else if(a.activeCtrlParam||a.ctrlParam)t.params[s]=null==i?void 0:i.control;else if(a.activeViewParam)t.params[s]=null==i?void 0:i.view;else if(a.appGlobalParam)t.params[s]=ibiz.env;else if(a.applicationParam)t.params[s]=c;else if(a.entityListParam)t.params[s]=[];else{if(a.entityPageParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[s]=[];else{if(a.lastReturnParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 上次调用返回");if(a.navContextParam)t.params[s]=e;else{if(a.navViewParamParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 视图路由参数");if(a.routeViewSessionParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 路由视图会话");if(a.simpleListParam)t.params[s]=[];else{if(a.simpleParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 简单数据");if(a.viewNavDataParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 视图导航数据");if(a.viewSessionParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 当前视图会话")}}}}},t}(),UILogic=function(){function t(t){var e=this;this.model=t,this.nodes=new Map,this.params=new Map,t.nodes.forEach((function(t){var r,n=t.source.logicNodeType;switch(n){case"BEGIN":r=new StartNode$1(t);break;case"END":r=new EndNode$1(t);break;case"DEACTION":r=new DEActionNode$1(t);break;case"DEUIACTION":r=new DEUIActionNode(t);break;case"PREPAREJSPARAM":r=new PrepareJSParamNode(t);break;default:throw new UnsupportedModelError(t.source,"未支持的逻辑节点类型: ".concat(n))}e.nodes.set(t.codeName,r)})),t.params.forEach((function(t){e.params.set(t.codeName,new UILogicParam(t))})),this.nodes.forEach((function(t){t.links.forEach((function(t){var r=t.model,n=r.srcNode,i=r.dstNode;e.nodes.has(n.codeName)&&(t.srcNode=e.nodes.get(n.codeName)),e.nodes.has(i.codeName)&&(t.dstNode=e.nodes.get(i.codeName))}))}))}return t.prototype.initLogicParams=function(t,e,r,n,i){this.params.forEach((function(o){o.calc(t,e,r,n,i)}))},t.prototype.exec=function(t,e,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o;return __generator(this,(function(a){switch(a.label){case 0:return i=new UILogicContext,this.initLogicParams(i,t,e,r,n),this.model.startNode&&this.nodes.has(this.model.startNode.codeName)?(o=this.nodes.get(this.model.startNode.codeName),[4,this.deepExec(o,i,t,e,r,n)]):[3,2];case 1:return a.sent(),[3,3];case 2:throw new UnsupportedModelError(this.model.source,"未设置起始节点");case 3:return[2,i.result||i.params.default||null]}}))}))},t.prototype.deepExec=function(t,e,r,n,i,o){return __awaiter(this,void 0,void 0,(function(){var a,s,c;return __generator(this,(function(u){switch(u.label){case 0:return[4,t.exec(e,r,n,i,o)];case 1:u.sent(),a=t.links,s=0,u.label=2;case 2:return s<a.length?[4,(c=a[s]).exec(e,r,n,i,o)]:[3,6];case 3:return u.sent()&&c.dstNode?[4,this.deepExec(c.dstNode,e,r,n,i,o)]:[3,5];case 4:if(u.sent(),!1===t.model.parallel)return[3,6];u.label=5;case 5:return s++,[3,2];case 6:return[2]}}))}))},t}(),uiLogicMap=new Map;function execUILogic(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(a){switch(a.label){case 0:return uiLogicMap.has(t)?[3,2]:[4,(o=new UILogicModel(t)).init()];case 1:a.sent(),uiLogicMap.set(t,new UILogic(o)),a.label=2;case 2:return[4,uiLogicMap.get(t).exec(e,r,n,i)];case 3:return a.sent(),[2,null]}}))}))}var AppDEUIActionUtil=exports("AppDEUIActionUtil",function(){function t(){}return t.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,ibiz.register.uiAction.get(t)];case 1:return[4,o.sent().getHandler()];case 2:return[2,o.sent().exec(t,e,r,n,i)]}}))}))},t}()),UIActionHandler=exports("UIActionHandler",function(){function t(){}return t.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a,s;return __generator(this,(function(c){switch(c.label){case 0:return(o=t.getPSAppDEUILogic())&&"REPLACE"===t.uILogicAttachMode?[4,execUILogic(o,e,r,n,i)]:[3,2];case 1:return c.sent(),[2,{refresh:!1,closeView:!1}];case 2:return[4,this.isConfirm(t)];case 3:return c.sent()?(a={refresh:t.reloadData,closeView:t.closeEditView},[4,this.execAction(t,e,r,n,i)]):[2,{refresh:!1,closeView:!1}];case 4:return s=c.sent(),Object.assign(a,s),!0===a.cancel?[2,a]:[4,this.doNextAction(t,e,s.data||r,n,i)];case 5:return c.sent(),o&&"AFTER"===t.uILogicAttachMode?[4,execUILogic(o,e,r,n,i)]:[3,7];case 6:c.sent(),c.label=7;case 7:return[2,a]}}))}))},t.prototype.isConfirm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.enableConfirm&&t.confirmMsg?[2,ibiz.modal.confirm({title:t.confirmMsg})]:[2,!0]}))}))},t.prototype.doNextAction=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(a){switch(a.label){case 0:return[4,getPSUIActionByModelObject(t,"getNextPSUIAction")];case 1:return(o=a.sent())?[4,AppDEUIActionUtil.exec(o,e,r,n,i)]:[3,3];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))},t.prototype.handleParams=function(t,e,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,c,u,l,h,d,p;return __generator(this,(function(f){switch(f.label){case 0:if(i=r||[],-1!==["SINGLEDATA","MULTIDATA","MULTIKEY"].indexOf(t.actionTarget))throw new Error("数据类型".concat(t.actionTarget,"暂未支持,请配置无数据或单项数据主键"));return"NONE"===t.actionTarget&&(i=[]),o={},a=t.getPSNavigateContexts()||[],s=t.getPSAppDataEntity(),c=t.valueItem,u=t.paramItem,s&&"SINGLEKEY"===t.actionTarget?[4,null==s?void 0:s.fill(!0)]:[3,2];case 1:f.sent(),l=s.codeName.toLowerCase(),a.unshift({key:u||l,value:c||"srfkey",rawValue:!1}),f.label=2;case 2:return notNilEmpty(a)&&(o=convertNavData(a,e,n,(null==r?void 0:r[0])||{})),h=new IBizContext(o,e),d={},p=t.getPSNavigateParams(),notNilEmpty(p)&&(d=convertNavData(p,e,n,(null==r?void 0:r[0])||{})),[2,{resultContext:h,resultData:i,resultParams:d}]}}))}))},t}()),CommonSysUIActionHandler=exports("CommonSysUIActionHandler",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.execAction=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var e,n,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(n=(e=i).neuron,o=e.event,a=t.uIActionTag,s={},"New"!==a)return[3,2];if(!n.call.newData)throw new Error("该视图不存在newData能力");return[4,n.call.newData(o)];case 1:c.sent(),c.label=2;case 2:if("Edit"!==a)return[3,4];if(!n.call.openData)throw new Error("该视图不存在openData能力");return[4,n.call.openData(null==r?void 0:r[0],o)];case 3:c.sent(),c.label=4;case 4:if(-1===["SaveAndExit","Save","SaveRow"].indexOf(a))return[3,6];if(!n.call.save)throw new Error("该视图不存在save能力");return[4,n.call.save()];case 5:c.sent(),c.label=6;case 6:if("SaveAndNew"!==a)return[3,8];if(!n.call.saveAndNew)throw new Error("该视图不存在saveAndNew能力");return[4,n.call.saveAndNew()];case 7:c.sent(),c.label=8;case 8:if("Remove"!==a&&"RemoveAndExit"!==a)return[3,10];if(!n.call.remove)throw new Error("该视图不存在remove能力");return[4,n.call.remove()];case 9:c.sent(),c.label=10;case 10:if("NewRow"!==a)return[3,12];if(!n.call.newRow)throw new Error("该视图不存在newRow能力");return[4,n.call.newRow()];case 11:c.sent(),c.label=12;case 12:if("ToggleFilter"===a){if(!n.call.toggleFilter)throw new Error("该视图不存在ToggleFilter能力");n.call.toggleFilter()}if("Import"===a){if(!n.call.importData)throw new Error("该视图不存在Import能力");n.call.importData()}if("ExportExcel"===a){if(!n.call.exportData)throw new Error("该视图不存在ExportExcel能力");n.call.exportData(o)}if("SaveAndStart"!==a)return[3,14];if(!n.call.wfStart)throw new Error("该视图不存在SaveAndStart能力");return[4,n.call.wfStart()];case 13:c.sent(),c.label=14;case 14:if("ViewWFStep"!==a)return[3,16];if(!n.call.wfSubmit)throw new Error("该视图不存在ViewWFStep能力");return[4,n.call.wfSubmit()];case 15:c.sent(),c.label=16;case 16:return-1!==["SaveAndExit","Exit","RemoveAndExit"].indexOf(a)&&(s.closeView=!0),-1!==["Refresh"].indexOf(a)&&(s.refresh=!0),[2,s]}}))}))},e}(UIActionHandler)),BackendUIActionHandler=exports("BackendUIActionHandler",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.execAction=function(t,e,r,n,i){var o,a,s;return __awaiter(this,void 0,void 0,(function(){var i,c,u,l,h,d,p,f,v;return __generator(this,(function(m){switch(m.label){case 0:if(i=null===(o=t.getPSAppDataEntity())||void 0===o?void 0:o.codeName,c=null===(a=t.getPSAppDEMethod())||void 0===a?void 0:a.codeName,!i||!c)throw new Error("找不到实体或实体行为");return[4,this.handleParams(t,e,r,n)];case 1:return u=m.sent(),l=u.resultContext,h=u.resultParams,d=u.resultData,[4,ibiz.hub.getApp(t.getPSModelService().app).es.getService(i)];case 2:return p=m.sent(),f=d.length>0?(null===(s=d[0])||void 0===s?void 0:s.getRequestData())||d[0]:{},[4,p.exec(c,l,f,h)];case 3:return(v=m.sent()).ok&&t.successMsg&&ibiz.message.success(t.successMsg),[2,{data:isArray(v.data)?v.data:[v.data]}]}}))}))},e}(UIActionHandler)),OpenAppViewCommand=exports("OpenAppViewCommand",function(){function t(){ibiz.commands.register(t.TAG,this.exec.bind(this))}return t.prototype.exec=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),__awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(o){switch(o.label){case 0:return[4,t.fill(!0)];case 1:if(o.sent(),t.redirectView)return[2,openRedirectView(t,e,r,n.data)];switch(i=t.openMode,void 0===i?"INDEXVIEWTAB":i){case"INDEXVIEWTAB":default:return[2,this.openIndexViewTab(t,e,r)];case"POPUP":throw new Error("未支持的视图打开模式: POPUP");case"POPUPMODAL":return[2,this.openModal(t,e,r)];case"POPUPAPP":throw new Error("未支持的视图打开模式: POPUPAPP");case"POPOVER":return[2,this.openPopover(t,n.event,e,r)];case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return[2,this.openDrawer(t,e,r)];case"USER":return[2,this.openUserCustom(t,e,r)]}return[2]}}))}))},t.prototype.openIndexViewTab=function(t,e,r){return void 0===r&&(r={}),ibiz.openView.root(t,e,r)},t.prototype.openModal=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,ibiz.openView.modal(t,e,r)]}))}))},t.prototype.openPopover=function(t,e,r,n){return void 0===n&&(n={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,ibiz.openView.popover(t,e,r,n)]}))}))},t.prototype.openDrawer=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,ibiz.openView.drawer(t,e,r)]}))}))},t.prototype.openUserCustom=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,ibiz.openView.custom(t,e,r)]}))}))},t.TAG="ibiz.app-view.open",t}()),AppFuncCommand=exports("AppFuncCommand",function(){function t(){ibiz.commands.register(t.TAG,this.exec.bind(this))}return t.prototype.exec=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),__awaiter(this,void 0,void 0,(function(){var i,o;return __generator(this,(function(a){switch((i=t.getPSNavigateContexts())&&(e?Object.assign(e,i):e=new IBizContext(i)),(o=t.getPSNavigateParams())&&Object.assign(r,o),t.appFuncType){case"APPVIEW":return[2,this.openAppView(t,e,r,n)];case"OPENHTMLPAGE":return[2,this.openHtmlPage(t)];case"PDTAPPFUNC":return[2,this.openPdAppFunc(t,e,r)];case"JAVASCRIPT":return[2,this.executeJavaScript(t,e,r)];case"CUSTOM":return[2,this.custom(t,e,r)];default:throw new Error("未知的应用功能类型: ".concat(t.appFuncType))}}))}))},t.prototype.openAppView=function(t,e,r,n){var i=t.getPSAppView();if(!i)throw new Error("应用视图不存在");return ibiz.commands.execute(OpenAppViewCommand.TAG,i,e,r,n)},t.prototype.openHtmlPage=function(t){var e=t.htmlPageUrl;window.open(e,"_blank")},t.prototype.openPdAppFunc=function(t,e,r){throw ibiz.log.warn("openPdAppFunc",t,e,r),new Error("未实现")},t.prototype.executeJavaScript=function(t,e,r){throw ibiz.log.warn("executeJavaScript",t,e,r),new Error("未实现")},t.prototype.custom=function(t,e,r){throw ibiz.log.warn("custom",t,e,r),new Error("未实现")},t.TAG="ibiz.app-func.exec",t}());function installCommand(){new AppFuncCommand,new OpenAppViewCommand}var FrontUIActionHandler=exports("FrontUIActionHandler",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.execAction=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a,s,c,u,l,h;return __generator(this,(function(d){switch(d.label){case 0:switch(o={},t.frontProcessType){case"OPENHTMLPAGE":return[3,1];case"TOP":case"WIZARD":return[3,2]}return[3,6];case 1:return a=StringUtil.fill(t.htmlPageUrl,e,null==r?void 0:r[0]),window.open(a,"_blank"),[3,7];case 2:if(!(s=t.getFrontPSAppView()))throw new DefectModelError(t,"未配置打开视图");return[4,s.fill(!0)];case 3:return d.sent(),[4,this.handleParams(t,e,r,n)];case 4:return c=d.sent(),u=c.resultContext,l=c.resultParams,[4,ibiz.commands.execute(OpenAppViewCommand.TAG,s,u,l,i)];case 5:return!1===(null==(h=d.sent())?void 0:h.ok)&&(o.closeView=!1,o.refresh=!1,o.cancel=!0),(null==h?void 0:h.ok)&&h.data&&(o.data=h.data),[3,7];case 6:throw new UnsupportedModelError(t,"未支持的前台处理模式[".concat(t.frontProcessType,"]"));case 7:return[2,o]}}))}))},e}(UIActionHandler)),WFWithdrawUIActionHandler=exports("WFWithdrawUIActionHandler",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.execAction=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var t,o;return __generator(this,(function(a){switch(a.label){case 0:return[4,ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})];case 1:return t=a.sent(),o=!1,t&&(null==i?void 0:i.neuron)?[4,i.neuron.call.wfWithdraw(e,n,(null==r?void 0:r[0])||[])]:[3,3];case 2:a.sent(),o=!0,a.label=3;case 3:return[2,{refresh:!1,closeView:o}]}}))}))},e}(UIActionHandler));function openRedirectView(t,e,r,n){return void 0===e&&(e=new IBizContext),void 0===r&&(r={}),void 0===n&&(n=[]),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){if(t.instanceof("app.view.IPSAppDERedirectView"))return[2,openDERedirectView(t,e,r,n)];throw new UnsupportedModelError(t,"未支持的重定向视图类型: ".concat(t.viewType))}))}))}function toLocalOpenWFRedirectView(t,e,r){var n;return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,c,u,l,h,d,p,f,v,m;return __generator(this,(function(y){switch(y.label){case 0:if(i=r.lastIndexOf("?"),o=decodeURIComponent(r.substring(i+1,r.length)),a=qs.parse(o,{delimiter:";"}),!(s=a.srfdename||""))throw new RuntimeError("重定向参数缺少实体名称");if(c=s.toUpperCase(),u=t.app,!(l=u.getAllPSAppDataEntities().find((function(t){return(t.name||t.refM.name)===c}))))throw new RuntimeError("未找到指定实体: ".concat(s));if(h=l.codeName||l.refM.codeName,a[h.toLowerCase()]=a[s.toLowerCase()],!(d=null===(n=u.getAllPSAppViews())||void 0===n?void 0:n.find((function(t){var e=t.refM;return e.resource===h&&"RedirectView"===e.view?t:null}))))throw new Error("未找到实体[".concat(s,"]默认重定向视图[RedirectView]"));return delete a.srfdename,"undo"!==a.srfwf&&(p=a.processDefinitionKey.split("-"),f=p[3],v=f.substring(0,f.lastIndexOf("v")),m=f.substring(f.lastIndexOf("v")),a.wf=v,a.wfVersion=m),a.srfprocessinstanceid&&(e.srfprocessinstanceid=a.srfprocessinstanceid,delete a.srfprocessinstanceid),[4,ibiz.commands.execute(OpenAppViewCommand.TAG,d,e,a)];case 1:return y.sent(),[2]}}))}))}function openDERedirectView(t,e,r,n){return void 0===e&&(e=new IBizContext),void 0===r&&(r={}),void 0===n&&(n=[]),__awaiter(this,void 0,void 0,(function(){var i,o,a,s,c,u,l,h,d,p,f,v,m,y,_,w,g;return __generator(this,(function(b){switch(b.label){case 0:return i=t.getPSAppViewNavContexts()||[],o=convertNavData(i,e,r),e=new IBizContext(o,e),a=t.getPSAppViewNavParams()||[],s=convertNavData(a,e,r),Object.assign(r,s),[4,(c=t.getPSAppDataEntity()).fill(!0)];case 1:return b.sent(),u=c.codeName.toLowerCase(),l=n[0]||{},e[u]=l[u]||e[u]||r[u],h=t.getGetDataPSAppDEAction(),[4,ibiz.hub.getApp(null==h?void 0:h.getPSModelService().app).es.getService(c.codeName)];case 2:return d=b.sent(),ibiz.loading.showRedirect(),[4,d.exec(h?h.codeName:"Get",e,r)];case 3:return p=b.sent(),ibiz.loading.hideRedirect(),p.ok?(l=p.data,(f=l.linkurl)?(e.srfprocessinstanceid&&(f+=";srfprocessinstanceid=".concat(e.srfprocessinstanceid)),f.startsWith("http://")||f.startsWith("https://")?(window.open(f,"_blank"),[2,{ok:!0,data:[]}]):f.startsWith("appredirectview?")?[4,toLocalOpenWFRedirectView(t.getPSModelService(),e,f)]:[3,5]):[3,6]):[3,6];case 4:return b.sent(),[2,{ok:!0,data:[]}];case 5:return[2,{ok:!1,data:[]}];case 6:return[4,calcDERdTag(c,t,r.srfwf,l)];case 7:return v=b.sent(),m="".concat(c.name.toUpperCase(),":").concat(v),y=t.getRedirectPSAppViewRefs(),_=null==y?void 0:y.find((function(t){return t.name===m||t.name===v})),_?(w=_.getRefPSAppView())?[4,ibiz.commands.execute(OpenAppViewCommand.TAG,w,e,r,{data:[l]})]:[3,9]:[3,11];case 8:return(g=b.sent())?[2,g]:[3,10];case 9:throw new DefectModelError(_,"未配置实际引用视图");case 10:return[3,12];case 11:throw new DefectModelError(t,"未找到重定向标识[".concat(v,"]或[").concat(m,"]对应视图"));case 12:return[2,{ok:!0,data:[]}]}}))}))}function calcDERdTag(t,e,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,c;return __generator(this,(function(u){return"",(i=e.getTypePSAppDEField())&&(o=n[i.codeName.toLowerCase()],notNilEmpty(o))?[2,o]:notNilEmpty(r)?[2,"EDITVIEW:".concat(r.toUpperCase())]:(a="",(s=t.getIndexTypePSAppDEField())&&(a=n[s.codeName.toLowerCase()]),isNilOrEmpty(a)&&(c=t.getFormTypePSAppDEField())&&(a=n[c.codeName.toLowerCase()]),[2,notNilEmpty(a)?"EDITVIEW:".concat(a):"EDITVIEW"])}))}))}function testCond(t,e,r){if(Object.is(e,"IN"))return contains(t,r);if(Object.is(e,"NOTIN"))return!contains(t,r);switch(e){case"EQ":return"".concat(t)==="".concat(r);case"NOTEQ":return"".concat(t)!=="".concat(r);case"LT":return compare(t,r)<0;case"LTANDEQ":return compare(t,r)<=0;case"GT":return compare(t,r)>0;case"GTANDEQ":return compare(t,r)>=0;case"ISNULL":return isNilOrEmpty(t);case"ISNOTNULL":return notNilEmpty(t);case"TESTNULL":return isNil(t);case"IN":return contains(t,r);case"NOTIN":return!contains(t,r);case"LIKE":return strContain(t,r);case"LEFTLIKE":return strContain(t,r,"start");case"RIGHTLIKE":return strContain(t,r,"end");default:throw new RuntimeError("值操作:".concat(e,",暂未支持"))}}function compare(t,e){var r=Number(t),n=Number(e);if(!Number.isNaN(r)&&!Number.isNaN(n))return compareNumber(r,n);var i=new Date(t).getTime(),o=new Date(e).getTime();if(!Number.isNaN(i)&&!Number.isNaN(o))return compareNumber(i,o);throw new RuntimeError("".concat(t," 和 ").concat(e," 无法比较大小"))}function compareNumber(t,e){return Number.isNaN(t)&&(t=0),Number.isNaN(e)&&(e=0),t>e?1:t<e?-1:0}function contains(t,e){if(!e||"string"!=typeof e)throw new RuntimeError("范围比较的条件值不存或者不是字符串");return!!t&&e.split(",").includes("".concat(t))}function strContain(t,e,r){if(!t||!e)return!1;var n="".concat(t).toUpperCase(),i="".concat(e).toUpperCase(),o=n.indexOf(i);switch(r){case"start":return 0===o;case"end":return o+i.length===n.length;default:return-1!==o}}function isGroupCondition(t){return"GROUP"===t.condType}function isSimpleCondition(t){return"SIMPLE"===t.condType}function isValueRange2Condition(t){return"VALUERANGE2"===t.condType}function isRegExCondition(t){return"REGEX"===t.condType}function isStringLengthCondition(t){return"STRINGLENGTH"===t.condType}function isSysValueRuleCondition(t){return"SYSVALUERULE"===t.condType}function verifyDeRules(t,e,r){var n,i={isPast:!0,infoMessage:r.ruleInfo};if(isGroupCondition(r)){var o=r.getPSDEFVRConditions();o&&o.length>0&&(i.isPast=logicForEach(o,(function(r){var n=verifyDeRules(t,e,r),o=n.isPast,a=n.infoMessage;return i.infoMessage=a,o}),r.condOp,!!r.notMode),!i.isPast&&("AND"===r.condOp&&r.notMode||"OR"===r.condOp&&!r.notMode)&&(i.infoMessage=r.ruleInfo))}else{t=null==r?void 0:r.dEFName.toLowerCase();try{if(isSimpleCondition(r))i.isPast=!checkFieldSimpleRule(e[t],r.condOp,r.paramValue,r.ruleInfo,r.paramType,e,r.keyCond);else if(isValueRange2Condition(r))i.isPast=!checkFieldValueRangeRule(e[t],r.minValue,r.includeMinValue,r.maxValue,r.includeMaxValue,r.ruleInfo,r.keyCond);else if(isRegExCondition(r))i.isPast=!checkFieldRegExRule(e[t],r.regExCode,r.ruleInfo,r.keyCond);else if(isStringLengthCondition(r))i.isPast=!checkFieldStringLengthRule(e[t],r.minValue,r.includeMinValue,r.maxValue,r.includeMaxValue,r.ruleInfo,r.keyCond);else if(isSysValueRuleCondition(r)&&(null===(n=null==r?void 0:r.getPSSysValueRule)||void 0===n?void 0:n.call(r))){var a=r.getPSSysValueRule(),s=a.ruleType,c=a.regExCode,u=a.scriptCode,l=a.ruleInfo;if(i.infoMessage=r.ruleInfo||l,"REG"===s)i.isPast=!checkFieldRegExRule(e[t],c,i.infoMessage,r.keyCond);else if("SCRIPT"===s){var h=checkFieldScriptRule(e[t],e,u,i.infoMessage,r.keyCond),d=h.isPast,p=h.infoMessage;i.isPast=d,i.infoMessage=p||i.infoMessage}}}catch(t){i.isPast=!1}i.isPast=r.notMode?!i.isPast:i.isPast}return i}function logicForEach(t,e,r,n){if(void 0===r&&(r="AND"),void 0===n&&(n=!1),!((null==t?void 0:t.length)>0))return!1;for(var i="AND"===r,o=0,a=t.length;o<a;o++){var s=e(t[o],o);if("AND"===r){if(!s){i=!1;break}}else if("OR"===r&&s){i=!0;break}}return n?!i:i}function checkFieldSimpleRule(t,e,r,n,i,o,a){(Object.is(i,"CURTIME")&&(r="".concat(new Date)),Object.is(i,"ENTITYFIELD"))&&(r=o[r=r?r.toLowerCase():""]?o[r]:r);(isNil(n)||isEmpty$1(n))&&(n="内容必须符合值规则");var s=testCond(t,e,r);if(!s&&a)throw new Error(n);return!s}function checkFieldStringLengthRule(t,e,r,n,i,o,a){if(isNilOrEmpty(o)&&(o="内容长度必须符合范围规则"),isNilOrEmpty(t)){if(a)throw new Error("值为空");return o="值为空",!0}var s=t.length;if(null!==e)if(r){if(s<e){if(a)throw new Error(o);return!0}}else if(s<=e){if(a)throw new Error(o);return!0}if(null!==n)if(i){if(s>n){if(a)throw new Error(o);return!0}}else if(s>=n){if(a)throw new Error(o);return!0}return o="",!1}function checkFieldRegExRule(t,e,r,n){if(isNilOrEmpty(r)&&(r="值必须符合正则规则"),isNilOrEmpty(t)){if(n)throw new Error("值为空");return r="值为空",!0}if(!new RegExp(e).test(t)){if(n)throw new Error(r);return!0}return r="",!1}function checkFieldValueRangeRule(t,e,r,n,i,o,a){if(isNilOrEmpty(o)&&(o="值必须符合值范围规则"),isNilOrEmpty(t)){if(a)throw new Error("值为空");return o="值为空",!0}if(checkFieldRegExRule(t,/^-?\d*\.?\d+$/,"",a))return!0;var s=Number.parseFloat(t);if(null!==e)if(r){if(s<e){if(a)throw new Error(o);return!0}}else if(s<=e){if(a)throw new Error(o);return!0}if(null!=n)if(i){if(s>n){if(a)throw new Error(o);return!0}}else if(s>=n){if(a)throw new Error(o);return!0}return o="",!1}function checkFieldScriptRule(t,e,r,n,i){isNilOrEmpty(n)&&(n="值必须符合脚本规则");var o=e,a="",s=!0;try{var c=new Function("value","data",r)(t,o);"boolean"==typeof c&&(s=c)}catch(t){ibiz.log.error(t),function(t){s=!1,(null==t?void 0:t.length)>0?t.forEach((function(t){(null==t?void 0:t.message)&&(a+=t.message)})):(null==t?void 0:t.message)&&(a=t.message)}(t)}if(n="",!s&&i)throw new Error(n);return{isPast:s,infoMessage:a||n}}function isGroupLogic$1(t){return"GROUP"===t.logicType}function isSingleLogic$1(t){return"SINGLE"===t.logicType}function verifyFormGroupLogic(t,e){if(isGroupLogic$1(e)){var r=e.getPSDEFDLogics();if(!r||0===r.length)throw new DefectModelError(e,"发现空逻辑组,逻辑无法正常执行!");var n=!0;if("AND"===e.groupOP)n=void 0===r.find((function(e){return!verifyFormGroupLogic(t,e)}));else if("OR"===e.groupOP){n=void 0!==e.getPSDEFDLogics().find((function(e){return verifyFormGroupLogic(t,e)}))}return e.notMode?!n:n}if(isSingleLogic$1(e))return testCond(t[e.dEFDName.toLowerCase()],e.condOP,e.value);throw new UnsupportedModelError(e,"未支持的逻辑类型".concat(e.logicType))}function isGroupLogic(t){return"GROUP"===t.logicType}function isSingleLogic(t){return"SINGLE"===t.logicType}function verifyPanelGroupLogic(t,e){if(isGroupLogic(e)){var r=e.getPSPanelItemLogics();if(!r||0===r.length)throw new DefectModelError(e,"发现空逻辑组,逻辑无法正常执行!");var n=!0;if("AND"===e.groupOP)n=void 0===r.find((function(e){return!verifyPanelGroupLogic(t,e)}));else if("OR"===e.groupOP){n=void 0!==e.getPSPanelItemLogics().find((function(e){return verifyPanelGroupLogic(t,e)}))}return e.notMode?!n:n}if(isSingleLogic(e))return testCond(t[e.dstModelField.toLowerCase()],e.condOp,e.value);throw new UnsupportedModelError(e,"未支持的逻辑类型".concat(e.logicType))}function generateRules(itemVRs,name,valueItemName){var rules=[];return itemVRs.forEach((function(item){var valueRuleType=item.valueRuleType,sysRule=item.getPSSysValueRule(),deRule=item.getPSDEFValueRule();if("SYSVALUERULE"===valueRuleType&&sysRule)"REG"===sysRule.ruleType?rules.push({pattern:new RegExp(sysRule.regExCode),message:sysRule.ruleInfo,trigger:"change blur"}):"SCRIPT"===sysRule.ruleType&&rules.push({validator:function(rule,value,callback,source){if(!value)return!0;try{eval(sysRule.scriptCode)}catch(t){console.error(t)}return!0},trigger:"change blur"});else if("DEFVALUERULE"===valueRuleType&&deRule){var valueName_1=valueItemName||name;rules.push({validator:function(t,e,r,n){if(isNilOrEmpty(n[valueName_1]))return!0;var i=verifyDeRules(valueName_1,n,deRule.getPSDEFVRGroupCondition()),o=i.isPast,a=i.infoMessage;return o||r(new Error(a||deRule.ruleInfo)),!0},trigger:"change blur"})}})),rules}var ButtonState=exports("ButtonState",function(){function t(t,e,r){this.disabled=!1,this.visible=!0,this.loading=!1,this.permitted=!0,this.noPermissionMode="HIDDEN";var n=e.getPSModelService();n.getRealPSModelService&&(n=n.getRealPSModelService()),this.app=ibiz.hub.getApp(n.app),this.name=t,Object.defineProperty(this,"uiAction",{enumerable:!1,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"entity",{enumerable:!1,configurable:!0,writable:!0,value:r}),1===this.uiAction.noPrivDisplayMode&&(this.noPermissionMode="DISABLED")}return t.prototype.update=function(t){var e=this.app.authority.hasUIActionPermitted(this.uiAction,t,this.entity);!this.permitted===e&&(this.permitted=e,this.disabled=!this.permitted,this.visible=this.permitted||"HIDDEN"!==this.noPermissionMode)},t}()),ButtonContainerState=exports("ButtonContainerState",function(){function t(){var t=this;Object.defineProperty(this,"children",{enumerable:!1,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:function(){return 0!==t.children.length&&!!t.children.find((function(t){return t.visible}))}})}return t.prototype.addState=function(t,e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e}),this.children.push(e)},t.prototype.setLoading=function(t){this.children.forEach((function(e){e.setLoading?e.setLoading(t):e.loading=!!t&&e.name===t}))},t.prototype.update=function(t){this.children.forEach((function(e){e.update(t)}))},t}()),DEACModeUtil=exports("DEACModeUtil",function(){function t(){}return t.calcFillDataItems=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return(r=e.dataItems).length?[4,Promise.all(r.map((function(e){var r=t[e.getPSAppDEField().codeName.toLowerCase()];return e.format||e.convertToCodeItemText&&e.getPSCodeList()||e.customCode,{name:e.name,value:r}})))]:[2,[]];case 1:return[2,n.sent()]}}))}))},t}()),ViewMode;function formatToCodeListText(t,e){return("string"==typeof t?t.split(","):[t]).map((function(t){var r=e.find((function(e){return e.value===t}));return(null==r?void 0:r.text)||t})).join(",")}function calcLayoutHeightWidth(t){var e=t.width,r=t.height,n=t.widthMode,i=t.heightMode,o={width:"auto",height:"auto"};return"FULL"===n?o.width="100%":e>0&&(o.width="".concat(e,"PERCENTAGE"===n?"%":"px")),"FULL"===i?o.height="100%":r>0&&(o.height="".concat(r,"PERCENTAGE"===i?"%":"px")),o}function calcLayoutContentStyle(t){var e=t.vAlignSelf,r=t.hAlignSelf,n={};if(e||r){switch(Object.assign(n,{display:"flex"}),t.vAlignSelf){case"TOP":Object.assign(n,{"align-items":"flex-start"});break;case"MIDDLE":Object.assign(n,{"align-items":"center"});break;case"BOTTOM":Object.assign(n,{"align-items":"flex-end"})}switch(t.hAlignSelf){case"LEFT":Object.assign(n,{"justify-content":"flex-start"});break;case"CENTER":Object.assign(n,{"justify-content":"center"});break;case"RIGHT":Object.assign(n,{"justify-content":"flex-end"});break;case"JUSTIFY":Object.assign(n,{"justify-content":"space-between"})}}return n}function executeViewLogic(t,e,r,n,i){return void 0===i&&(i={}),__awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(a){switch(a.label){case 0:return"opendata"===t.name&&t.getPSAppUILogic()?[2,executeOpenDataAppUILogic(t.getPSAppUILogic(),e,r,n,i)]:"newdata"===t.name&&t.getPSAppUILogic()?[2,executeNewDataAppUILogic(t.getPSAppUILogic(),e,r,n,i)]:[4,getPSUIActionByModelObject(t.getPSAppViewUIAction())];case 1:if(!(o=a.sent()))throw new Error("找不到界面行为");return[2,AppDEUIActionUtil.exec(o,e,r,n,i)]}}))}))}function executeOpenDataAppUILogic(t,e,r,n,i){return void 0===i&&(i={}),__awaiter(this,void 0,void 0,(function(){var o,a,s,c,u,l,h,d;return __generator(this,(function(p){switch(p.label){case 0:if(!(null==r?void 0:r[0]))throw Error("没有选中数据!");if(!(o=t.getOpenDataPSAppView()))throw new Error("getOpenDataPSAppView为空");if(!(a=o.getRefPSAppView()))throw new Error("openView为空");return[4,a.fill(!0)];case 1:return p.sent(),[4,(s=new AppEntityModel(a.getPSAppDataEntity())).init()];case 2:return p.sent(),c=o.getPSNavigateContexts()||[],u=s.deName.toLowerCase(),-1===c.findIndex((function(t){return t.key===u}))&&c.push({key:u,value:u,rawValue:!1}),l=new IBizContext(convertNavData(c,e,n,r[0]),e),h={},d=o.getPSNavigateParams(),notNilEmpty(d)&&(h=convertNavData(d,n,e,r[0])),[4,ibiz.commands.execute(OpenAppViewCommand.TAG,a,l,h,i)];case 3:return p.sent(),i.neuron.call.refresh(),[2,{}]}}))}))}function executeNewDataAppUILogic(t,e,r,n,i){return void 0===i&&(i={}),__awaiter(this,void 0,void 0,(function(){var o,a,s,c,u,l,h,d;return __generator(this,(function(p){switch(p.label){case 0:if(!(o=t.getNewDataPSAppView()))throw new Error("getNewDataPSAppView为空");if(!(a=o.getRefPSAppView()))throw new Error("newView为空");return[4,a.fill(!0)];case 1:return p.sent(),[4,(s=new AppEntityModel(a.getPSAppDataEntity())).init()];case 2:return p.sent(),c={},u={},l=(null==r?void 0:r[0])||{},h=o.getPSNavigateContexts(),notNilEmpty(h)&&(c=convertNavData(h,e,n,l)),(c=new IBizContext(c,e))[s.deName.toLowerCase()]=void 0,d=o.getPSNavigateParams(),notNilEmpty(d)&&(u=convertNavData(d,n,e,l)),t.enableWizardAdd||t.enableBatchAdd||t.batchAddOnly,[4,ibiz.commands.execute(OpenAppViewCommand.TAG,a,c,u,i)];case 3:return p.sent(),i.neuron.call.refresh(),[2,{}]}}))}))}exports("ViewMode",ViewMode),function(t){t.ROUTE="ROUTE",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t.POPOVER="POPOVER"}(ViewMode||exports("ViewMode",ViewMode={}));var ViewState=exports("ViewState",(function(){this.complete=!1,this.toolbarState=null,this.isLoading=!1})),EditViewState=exports("EditViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(ViewState)),MDViewState=exports("MDViewState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.showSearchForm=!1,e.query="",e.selectedData=[],e}return __extends(e,t),e}(ViewState)),GridViewState=exports("GridViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(MDViewState)),EditView3State=exports("EditView3State",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(EditViewState)),PickupViewState=exports("PickupViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(ViewState)),MPickupViewState=exports("MPickupViewState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.embedSelection=[],e.selfSelection=[],e}return __extends(e,t),e}(PickupViewState)),GridExpViewState=exports("GridExpViewState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.navItem={key:""},e}return __extends(e,t),e}(MDViewState)),TreeExpViewState=exports("TreeExpViewState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.navViewParams={},e.currentNavKey="",e}return __extends(e,t),e}(MDViewState)),DataViewViewState=exports("DataViewViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(MDViewState)),ListViewState=exports("ListViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(MDViewState)),ListExpViewState=exports("ListExpViewState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.navItem={key:""},e}return __extends(e,t),e}(MDViewState)),KanbanViewState=exports("KanbanViewState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(MDViewState)),AppCounter=exports("AppCounter",function(){function t(t){this.model=t,this.destroyed=!1,this.context={},this.params={},this.evt=new QXEvent,this.data={},this.app=ibiz.hub.getApp(t.getPSModelService().app)}return Object.defineProperty(t.prototype,"isDestroyed",{get:function(){return this.destroyed},enumerable:!1,configurable:!0}),t.prototype.init=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return this.setParams(t,e),this.entity=this.model.getPSAppDataEntity(),[4,this.entity.fill(!0)];case 1:return i.sent(),r=this,[4,this.app.es.getService(this.entity.codeName)];case 2:if(r.service=i.sent(),!(n=this.model.getGetPSAppDEAction()))throw new DefectModelError(this.model,"未找到获取计数器行为!");return this.action=n.codeName,this.interval(),[4,this.load()];case 3:return i.sent(),[2]}}))}))},t.prototype.setParams=function(t,e){t&&(this.context=clone(t)),e&&(this.params=clone(e))},t.prototype.interval=function(){var t=this;this.destroyInterval(),this.intervalTimer=setInterval((function(){t.evt.getSize("change")>0&&t.load()}),this.model.timer||6e3)},t.prototype.destroyInterval=function(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)},t.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.service.exec(this.action,this.context,this.params)];case 1:return(t=e.sent()).ok&&(this.data=t.data,this.evt.emit("change",this.data)),[2,this.data]}}))}))},t.prototype.refresh=function(t,e){return this.setParams(t,e),this.load()},t.prototype.onChange=function(t,e){void 0===e&&(e=!0),this.evt.on("change",t),e&&notNilEmpty(this.data)&&t(this.data)},t.prototype.offChange=function(t){this.evt.off("change",t)},t.prototype.getCounter=function(t){return this.data[t.toLowerCase()]||0},t.prototype.destroy=function(){this.destroyed=!0,this.destroyInterval(),this.evt.reset()},t}()),PSModelCondEngineBase=function(){function t(){this.psModelGroupCondBase=null}return t.prototype.parse=function(t){if(t instanceof Array){var e=this.createPSModelGroupCond();e.parse(t),this.psModelGroupCondBase=e}},t.prototype.testSingleCond=function(t,e,r){try{if("ISNULL"===t)return null==e;if("ISNOTNULL"===t)return null!=e;if("EQ"===t||"ABSEQ"===t||"GT"===t||"GTANDEQ"===t||"LT"===t||"LTANDEQ"===t||"NOTEQ"===t){var n=-1;if(e==r?n=0:e>r&&(n=1),"EQ"===t||"ABSEQ"===t)return 0===n;if("GT"===t)return n>0;if("GTANDEQ"===t)return n>=0;if("LT"===t)return n<0;if("LTANDEQ"===t)return n<=0;if("NOTEQ"===t)return 0!==n}if("LIKE"===t)return null!=e&&null!=r&&-1!==e.toString().toUpperCase().indexOf(r.toString().toUpperCase());if("LEFTLIKE"===t)return null!=e&&null!=r&&0===e.toString().toUpperCase().indexOf(r.toString().toUpperCase())}catch(t){ibiz.log.error(t)}return!1},t.prototype.getPSModelGroupCondBase=function(){return this.psModelGroupCondBase},t}(),PSModelCondBase=function(){function t(){this.strCondOp=null}return t.prototype.getCondOp=function(){return this.strCondOp},t.prototype.setCondOp=function(t){this.strCondOp=t},t}(),PSModelSingleCondBase=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.parse=function(t){for(var e=t.length,r=!0,n=!1,i=!1,o=0;o<e;o++)if(r){var a=t[o];this.setCondOp(a),r=!1,n=!0}else if(n){a=t[o];this.setParam(a),n=!1,i=!0}else if(i){var s=t[o];if(s instanceof Object&&!(s instanceof Array)){var c=s;null!=c.type&&this.setValueType(c.type.toString()),null!=c.value&&this.setValue(c.value.toString())}else this.setValue(s);break}},e.prototype.getValueType=function(){return this.strValueType},e.prototype.setValueType=function(t){this.strValueType=t},e.prototype.getValue=function(){return this.strValue},e.prototype.setValue=function(t){this.strValue=t},e.prototype.getParamType=function(){return this.strParamType},e.prototype.setParamType=function(t){this.strParamType=t},e.prototype.getParam=function(){return this.strParam},e.prototype.setParam=function(t){this.strParam=t},e}(PSModelCondBase),PSModelGroupCondBase=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.childCondList=[],e.bNotMode=!1,e}return __extends(e,t),e.prototype.parse=function(t){for(var r=this,n=t.length,i=!0,o=!0,a=!1,s=0;s<n;s++){if(i&&o)if("!"===(c=t[s])){this.setNotMode(!0),i=!1;continue}if(o){var c=t[s];this.setCondOp(c),o=!1,i=!1,a=!0}else if(a){var u=t[s];if(!(u instanceof Array))throw new Error("值必须为数组");u.forEach((function(t){if(t.length>0){var n,i=t[0].toString();if("!"===i||"OR"===i||"AND"===i)(n=new e).parse(t),r.childCondList.push(n);else(n=new PSModelSingleCondBase).parse(t),r.childCondList.push(n)}}))}}},e.prototype.setNotMode=function(t){this.bNotMode=t},e.prototype.isNotMode=function(){return this.bNotMode},e.prototype.getChildPSModelCondBases=function(){return this.childCondList},e}(PSModelCondBase),PSDEDQGroupCond=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PSModelGroupCondBase),PSDEDQSingleCond=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PSModelSingleCondBase),PSDEDQCondEngine=exports("PSDEDQCondEngine",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.test=function(t,e){return this.testCond(this.getPSModelGroupCondBase(),t,e)},e.prototype.testCond=function(t,r,n){if(t instanceof PSModelGroupCondBase){var i=t.getChildPSModelCondBases();if(null==i||isEmpty$1(i))return!t.isNotMode();for(var o="AND"===t.getCondOp(),a=o,s=0;s<i.length;s++){var c=i[s];if(this.testCond(c,r,n)){if(!o){a=!0;break}}else if(o){a=!1;break}}return t.isNotMode()?!a:a}if(t instanceof PSModelSingleCondBase){isEmpty$1(t.getParam())&&ibiz.log.warn("没有指定属性名称",t);var u=r[t.getParam().toLowerCase()],l=null,h=t.getValueType(),d=t.getValue();return null==h||isEmpty$1(h)?l=t.getValue():(isEmpty$1(d)&&ibiz.log.warn("没有指定上下文参数名称"),e.PARAMTYPE_WEBCONTEXT===h?l=n.data[d.toLowerCase()]:e.PARAMTYPE_DATACONTEXT===h&&(l=n.getValue(d.toLowerCase()))),this.testSingleCond(t.getCondOp(),u,l)}return ibiz.log.warn("无法识别的条件对象",t),!1},e.prototype.createPSModelSingleCond=function(){return new PSDEDQSingleCond},e.prototype.createPSModelGroupCond=function(){return new PSDEDQGroupCond},e.PARAMTYPE_DATACONTEXT="DATACONTEXT",e.PARAMTYPE_WEBCONTEXT="WEBCONTEXT",e}(PSModelCondEngineBase)),DEDQCondUtil=exports("DEDQCondUtil",function(){function t(){}return t.getCond=function(t){if(this.map.has(t))return this.map.get(t);var e=t.getPSDEDQGroupConditions();if(e){var r=new PSDEDQCondEngine;return r.parse(["OR",this.calcCond(e)]),this.map.set(t,r),r}return null},t.calcCond=function(t){var e=this,r=[];return t.forEach((function(t){var n=[];if("GROUP"===t.condType){(a=t).notMode&&n.push("!"),n.push(t.condOp);var i=a.getPSDEDQConditions();if(i){var o=e.calcCond(i);n.push(o)}}else{if("SINGLE"!==t.condType)throw new Error("暂未支持的查询条件类型: ".concat(t.condType));var a=t;n.push(a.fieldName),a.condValue?a.getPSVARTypeId()?n.push({type:a.getPSVARTypeId(),value:a.getPSVARTypeId()}):n.push(a.condValue):n.push("")}r.push(n)})),r},t.map=new WeakMap,t}()),DynamicCodeListCache=exports("DynamicCodeListCache",function(){function t(t){this.cache=new Map,this.isPredefined=!1,this.codeList=t,this.app=ibiz.hub.getApp(t.getPSModelService().app)}return t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var t,e=this;return __generator(this,(function(r){return t=function(){return __awaiter(e,void 0,void 0,(function(){var t,e,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:if(t=this.codeList.predefinedType){if(this.isPredefined=!0,!["OPERATOR","RUNTIME"].includes(t))throw new UnsupportedModelError(this.codeList,"预定义类型".concat(t,"暂不支持"));return[2]}if(!(e=this.codeList.getPSAppDataEntity()))throw new DefectModelError(this.codeList,"未配置应用实体");return[4,e.fill(!0)];case 1:if(o.sent(),!(r=null===(i=this.codeList.getPSAppDEDataSet())||void 0===i?void 0:i.codeName))throw new DefectModelError(this.codeList,"未配置数据集");return[4,(n=new AppEntityModel(e)).init()];case 2:return o.sent(),this.entity=n,this.methodName=r,this.initPromise=void 0,[2]}}))}))},this.initPromise=t(),[2,this.initPromise]}))}))},t.prototype.convertData=function(t){var e={};if(this.codeList.getValuePSAppDEField()){var r=this.codeList.getValuePSAppDEField().codeName.toLowerCase();e.id=t[r],e.value=t[r]}else e.id=t[this.entity.keyName],e.value=t[this.entity.keyName];return this.codeList.getTextPSAppDEField()?e.text=t[this.codeList.getTextPSAppDEField().codeName.toLowerCase()]:e.text=t[this.entity.textName],Object.freeze(e)},t.prototype.load=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return this.isPredefined?[4,this.app.net.get("/dictionaries/codelist/".concat(this.codeList.codeName),e)]:[3,2];case 1:return r=a.sent(),[2,Object.freeze(r.data.items)];case 2:return!this.entity||this.methodName,[4,this.app.es.getService(this.entity.source.codeName)];case 3:return[4,a.sent().exec(this.methodName,t,e)];case 4:return n=a.sent(),i=[],n.data.length&&(i=n.data.map((function(t){return o.convertData(t)}))),[2,i]}}))}))},t.prototype.get=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:return this.initPromise?[4,this.initPromise]:[3,2];case 1:c.sent(),c.label=2;case 2:if(!this.codeList.enableCache)return[2,this.load(t,e)];if(r=JSON.stringify(t)+JSON.stringify(e),this.cache.has(r)){if((n=this.cache.get(r)).expirationTime>(new Date).getTime())return[2,n.promise?n.promise:n.items];this.cache.delete(r)}return i=this.load(t,e),o=-1===this.codeList.cacheTimeout?ibiz.config.defaultCodeListCacheTimeout:this.codeList.cacheTimeout,a={expirationTime:(new Date).getTime()+o,promise:i},this.cache.set(r,a),[4,i];case 3:return s=c.sent(),a.items=s,delete a.promise,[2,s]}}))}))},t}());function isExistSrfKey(t,e){if(null!=e){var r=e.srfkey;if(!isNil(r)&&!isEmpty$1(r))return!0}throw new RuntimeError("执行「".concat(t,"」不存在「srfkey」无法处理"))}function isExistSessionId(t,e){var r=e.srfsessionid;if(!isNil(r)&&!isEmpty$1(r))return!0;throw new RuntimeError("执行「".concat(t,"」不存在「srfsessionid」无法处理"))}var EntityCache=exports("EntityCache",function(){function t(){this.cacheMap=new Map}return t.prototype.forceAdd=function(t,e){var r=this.getCacheByTag(t).get(e.srfkey);r&&(r.assign(e),ibiz.log.warn("forceAdd",e.srfkey,e))},t.prototype.forceUpdate=function(t,e){this.getCacheByTag(t).set(e.srfkey,clone(e)),ibiz.log.warn("forceUpdate",e.srfkey,e)},t.prototype.forceDelete=function(t,e){this.getCacheByTag(t).delete(e),ibiz.log.warn("forceDelete",e)},t.prototype.add=function(t,e){try{return isExistSessionId("add",t),(isNil(e.srfkey)||isEmpty$1(e.srfkey))&&(e.srfkey=createUUID()),e.srftempdate=(new Date).getTime(),this.getCacheByTag(t).set(e.srfkey,clone(e)),ibiz.log.warn("add",e.srfkey,e),e}catch(t){return ibiz.log.error(t),null}},t.prototype.get=function(t,e){try{isExistSessionId("get",t);var r=this.getCacheByTag(t).get(e);return ibiz.log.warn("get",e,r),clone(r)}catch(t){return ibiz.log.error(t),null}},t.prototype.update=function(t,e){try{isExistSessionId("update",t),isExistSrfKey("update",e),e.srftempdate=(new Date).getTime();var r=this.getCacheByTag(t),n=r.get(e.srfkey);if(n)return n.assign(e),r.set(e.srfkey,n),ibiz.log.warn("update",e.srfkey,e),clone(n);throw new Error("数据不存在,无法更新!")}catch(t){return ibiz.log.error(t),null}},t.prototype.delete=function(t,e){try{isExistSessionId("delete",t);var r=this.getCacheByTag(t),n=e;if(r.has(n)){var i=r.get(n);return i.srftempdate=(new Date).getTime(),r.delete(n),ibiz.log.warn("delete",n),i}return null}catch(t){return ibiz.log.error(t),null}},t.prototype.createBatch=function(t,e){try{isExistSessionId("add",t);for(var r=this.getCacheByTag(t),n=0;n<e.length;n++){var i=e[n];(isNil(i.srfkey)||isEmpty$1(i.srfkey))&&(i.srfkey=createUUID()),i.srftempdate=(new Date).getTime();var o=clone(i);r.set(i.srfkey,o),e[n]=o,ibiz.log.warn("add",i.srfkey,i)}return e}catch(t){ibiz.log.error(t)}return[]},t.prototype.updateBatch=function(t,e){try{isExistSessionId("update",t);for(var r=this.getCacheByTag(t),n=0;n<e.length;n++){var i=e[n];isExistSrfKey("update",i),i.srftempdate=(new Date).getTime();var o=r.get(i.srfkey);if(!o)throw new Error("数据[".concat(i.srfdename,"-").concat(i.srfmajortext,"(").concat(i.srfkey,")]不存在,无法更新!"));o.assign(i),r.set(i.srfkey,o),ibiz.log.warn("update",i.srfkey,i),e[n]=clone(o)}return e}catch(t){return ibiz.log.error(t),null}},t.prototype.deleteBatch=function(t,e){try{isExistSessionId("delete",t)}catch(t){return ibiz.log.error(t),e}for(var r=this.getCacheByTag(t),n=[],i=0;i<e.length;i++){var o=e[i];r.has(o)||n.push(o)}if(n.length>0)throw new Error("未找到以下数据「".concat(n.join("、"),"」,无法删除!"));for(i=0;i<e.length;i++){o=e[i];r.delete(o),ibiz.log.warn("delete",o)}return[]},t.prototype.checkData=function(t,e){return-1!==this.getList(t).findIndex((function(t){return t.srfkey===e}))},t.prototype.getList=function(t){try{isExistSessionId("getList",t);var e=this.getCacheByTag(t);if(!e)return[];var r=e.values();return Array.from(r)}catch(t){return ibiz.log.error(t),[]}},t.prototype.generatePred=function(t){void 0===t&&(t={});var e={};for(var r in t.srfkey&&(e.srfkey=equals(t.srfkey)),delete t.srfkey,t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=t[r];e[r]=equals(n)}return where(e)},t.prototype.clear=function(t){var e=t.srfsessionid;this.cacheMap.size>0&&this.cacheMap.delete(e)},t.prototype.getCacheByTag=function(t){var e=t.srfsessionid;return this.cacheMap.has(e)||this.cacheMap.set(e,new Map),this.cacheMap.get(e)},t}());function calcResPath(t,e){var r=[];e.forEach((function(e){for(var n=[],i=0;i<e.length-1;i++){var o=e[i],a=t[o.name];a?(n.push(o.plural),n.push(a)):n=[]}r.push(n)}));var n=__read(r=r.sort((function(t,e){return e.length-t.length})),1)[0];return n?"".concat(n.length>1?"/":"").concat(n.join("/")):""}var excludeViewTypes=[ViewType.DE_GRID_VIEW,ViewType.DE_GRID_EXP_VIEW,ViewType.DE_LIST_VIEW,ViewType.DE_LIST_EXP_VIEW,ViewType.DE_DATA_VIEW,ViewType.DE_DATAVIEW_EXP_VIEW,ViewType.DE_CALENDAR_VIEW,ViewType.DE_CALENDAR_EXP_VIEW,ViewType.DE_CHART_VIEW,ViewType.DE_CHART_EXP_VIEW,ViewType.DE_KANBAN_VIEW];function calcRouteContext(t,e,r){var n=[];e.forEach((function(e){for(var i,o=[],a=0;a<e.length;a++){var s=[],c=e[a];if(r&&r.viewType&&excludeViewTypes.includes(r.viewType))if((null===(i=r.getPSAppDataEntity())||void 0===i?void 0:i.codeName.toLowerCase())===c.name)return;var u=t[c.name];u&&(s.push(c.name),s.push(u),o.push(s))}n.push(o)}));var i=__read(n=n.sort((function(t,e){return e.length-t.length})),1)[0];if(i){var o={};return i.forEach((function(t){var e=__read(t,2),r=e[0],n=e[1];o[r]=n})),o}return{}}var SearchFilter=exports("SearchFilter",function(){function t(t,e){var r;if(this.page=0,this.size=1e3,this.data={},this.sortField="srfordervalue",this.sortMode="ASC",this.context=t,e){if(isNil(e.page)||isEmpty$1(e.page)||(this.page=e.page),isNil(e.size)||isEmpty$1(e.size)||(this.size=e.size),isNil(e.query)||isEmpty$1(e.query)||(this.query=e.query),!isNil(e.sort)&&!isEmpty$1(e.sort)){var n=e.sort.split(",");n.length>=1&&(r=__read(n,1),this.sortField=r[0]),n.length>=2&&(this.sortMode=n[1].toUpperCase())}isNil(e.srfparentkey)||isEmpty$1(e.srfparentkey)||(this.srfparentkey=e.srfparentkey),isNil(e.srfparentdename)||isEmpty$1(e.srfparentdename)||(this.srfparentdename=e.srfparentdename),this.data=__assign({},e),delete this.data.page,delete this.data.size,delete this.data.query,delete this.data.sort,delete this.data.srfparentkey,delete this.data.srfparentdename}}return t.prototype.getValue=function(t){return this.data[t]?this.data[t]:this.context[t]},t}()),ServicePathUtil=exports("ServicePathUtil",function(){function t(t){this.modelService=t,this.allDERss=[],this.entityRsMap=new Map,this.entityRsPathMap=new Map}return t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r=this;return __generator(this,(function(n){return this.allDERss.length>0||(t=this.modelService.app,e=t.getAllPSAppDataEntities()||[],this.allDERss=t.getAllPSAppDERSs()||[],e.forEach((function(t){var e=t.isFill?t.codeName:t.refM.codeName,n=r.allDERss.filter((function(t){return t.minorDECodeName===e?t:null}));n.length>0&&r.entityRsMap.set(e,n)}))),[2]}))}))},t.prototype.calcPaths=function(t){if(this.entityRsPathMap.has(t))return this.entityRsPathMap.get(t);var e=this.entityRsMap.get(t);if(e){var r=this.calcDeepPath(e);this.deepFillPath(t,[t],r);var n=this.entityRsPathMap.get(t);if(n){var i=this.sortPath(n);return this.entityRsPathMap.set(t,i),i}}return[[{deName:t,name:t.toLowerCase(),plural:pluralLower(t)}]]},t.prototype.calcDeepPath=function(t,e){var r=this;if(void 0===e&&(e=0),e>10)throw new Error("服务路径计算超过最大层级 10");e+=1;var n=[];return t.forEach((function(t){var i=r.entityRsMap.get(t.majorDECodeName)||[];n.push([t,r.calcDeepPath(i,e)])})),n},t.prototype.deepFillPath=function(t,e,r){var n=this;r.forEach((function(r){var i=__read(r,2),o=i[0],a=i[1];a.length>0?n.deepFillPath(t,__spreadArray(__spreadArray([],__read(e),!1),[o.majorDECodeName],!1),a):(n.entityRsPathMap.has(t)||n.entityRsPathMap.set(t,[]),n.entityRsPathMap.get(t).push(__spreadArray(__spreadArray([],__read(e.map((function(t){return{deName:t,name:t.toLowerCase(),plural:pluralLower(t)}}))),!1),[{deName:o.majorDECodeName,name:o.majorDECodeName.toLowerCase(),plural:pluralLower(o.majorDECodeName)}],!1).reverse()))}))},t.prototype.sortPath=function(t){return t.sort((function(t,e){return e.length-t.length}))},t}()),CodeListService=exports("CodeListService",function(){function t(t){this.modelService=t,this.allCodeLists=new Map,this.cache=new Map}return t.prototype.initAllCodeList=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){return 0!==this.allCodeLists.size||(this.modelService.app.getAllPSAppCodeLists()||[]).forEach((function(e){var r=e.isFill?e.codeName:e.refM.codeName;t.allCodeLists.set(r,e)})),[2]}))}))},t.prototype.getStatic=function(t){if(this.cache.has(t.codeName))return this.cache.get(t.codeName);var e=t.getPSCodeItems(),r=[];return(null==e?void 0:e.length)&&(r=this.formatStaticItems(e,t.codeItemValueNumber)),this.cache.set(t.codeName,Object.freeze(r)),r},t.prototype.formatStaticItems=function(t,e){var r=this;return t.map((function(t){var n,i={text:t.text,value:e?Number(t.value):t.value,color:t.color,id:t.codeName};return(null===(n=t.getPSCodeItems())||void 0===n?void 0:n.length)&&(i.children=r.formatStaticItems(t.getPSCodeItems(),e)),Object.freeze(i)}))},t.prototype.getDynamicCodeList=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return this.cache.has(t.codeName)?(n=this.cache.get(t.codeName),[3,3]):[3,1];case 1:return n=new DynamicCodeListCache(t),this.cache.set(t.codeName,n),[4,n.init()];case 2:i.sent(),i.label=3;case 3:return[2,n.get(e,r)]}}))}))},t.prototype.get=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return 0!==this.allCodeLists.size?[3,2]:[4,this.initAllCodeList()];case 1:i.sent(),i.label=2;case 2:if(!(n=this.allCodeLists.get(t)))throw new Error("找不到".concat(t,"代码表"));return[4,n.fill(!0)];case 3:return i.sent(),"STATIC"===n.codeListType?[2,this.getStatic(n)]:"DYNAMIC"===n.codeListType?[2,this.getDynamicCodeList(n,e,r)]:[2,[]]}}))}))},t}()),CounterService=exports("CounterService",function(){function t(){}return t.getCounter=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:if(this.counterMap.has(t.id)){if(!1===(n=this.counterMap.get(t.id)).isDestroyed)return[2,n];this.counterMap.delete(t.id)}return[4,(i=new AppCounter(t)).init(e,r)];case 1:return o.sent(),this.counterMap.set(t.id,i),[2,i]}}))}))},t.getCounterByRef=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){if(!(n=t.getPSAppCounter()))throw new DefectModelError(t,"未配置应用计数器!");return[2,this.getCounter(n,e,r)]}))}))},t.counterMap=new Map,t}()),WorkFlowService=exports("WorkFlowService",function(){function t(t){this.model=t,this.app=ibiz.hub.getApp(t.modelService.app);var e=ibiz.appData.context;this.commonBaseUrl="/wfcore/".concat(e.srfsystemid,"-app-").concat(t.modelService.app.codeName.toLowerCase(),"/").concat(this.model.source.name.toLowerCase())}return t.prototype.getBaseUrl=function(){return this.commonBaseUrl},t.prototype.getWFStep=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){return e=t.processDefinitionKey,r=t.taskDefinitionKey,[2,this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions/").concat(e,"/usertasks/").concat(r))]}))}))},t.prototype.getWFLink=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){return r=t[this.model.deName],n=t.taskDefinitionKey,[2,this.app.net.post("".concat(this.getBaseUrl(),"/").concat(r,"/usertasks/").concat(n,"/ways"),{activedata:e})]}))}))},t.prototype.getWFHistory=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){return e=t[this.model.deName],[2,this.app.net.get("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/history"))]}))}))},t.prototype.getWFProcessDiagram=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){return e=t[this.model.deName],[2,this.app.net.request("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/processdiagram"),{method:"post",data:{},responseType:"blob"})]}))}))},t.prototype.getWFVersion=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions2"))]}))}))},t.prototype.wfStart=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.deName],"/process-instances"),__assign(__assign({},e),{activedata:r}))]}))}))},t.prototype.wfSubmit=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.deName],"/tasks/").concat(e.taskId),__assign(__assign({},e),{activedata:r}))]}))}))},t.prototype.wfWithdraw=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.deName],"/tasks/").concat(e.taskId,"/withdraw"),__assign(__assign({},e),{activedata:r}))]}))}))},t.prototype.exec=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(t){case"WFSTART":return[2,this.wfStart(e,r,n)];case"WFSUBMIT":return[2,this.wfSubmit(e,r,n)];default:throw new RuntimeError("「".concat(t,"」未实现"))}}))}))},t}()),DELogicContext=function(){this.params={},this.result=null},DELogicLinkCond=function(){},DELogicLinkSingleCond=function(t){function e(e){var r=t.call(this)||this;r.model=e;var n=e.getSrcLogicParam();n&&(r.srcParam=n.codeName);var i=e.getDstLogicParam();return r.dstParam=i.codeName,r}return __extends(e,t),Object.defineProperty(e.prototype,"dstField",{get:function(){return this.model.dstFieldName.toLocaleLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"op",{get:function(){return this.model.condOP},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.model.paramType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.model.value},enumerable:!1,configurable:!0}),e.prototype.test=function(t,e,r){var n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":var i=null!=r[this.value]?r[this.value]:e[this.value];return testCond(n[this.dstField],this.op,i);case"SRCENTITYFIELD":var o=t.params[this.srcParam];return testCond(n[this.dstField],this.op,o[this.value]);case"CURTIME":throw new UnsupportedModelError(this.model,"暂未支持条件值类型为[当前时间]");default:return testCond(n[this.dstField],this.op,this.value)}},e}(DELogicLinkCond),DELogicLinkGroupCond=function(t){function e(r){var n=t.call(this)||this;n.model=r;var i=r.getPSDELogicLinkConds()||[];return n.conds=i.map((function(t){return"SINGLE"===t.logicType?new DELogicLinkSingleCond(t):new e(t)})),n}return __extends(e,t),Object.defineProperty(e.prototype,"op",{get:function(){return this.model.groupOP},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"reverse",{get:function(){return this.model.notMode},enumerable:!1,configurable:!0}),e.prototype.test=function(t,e,r){var n=!0;if(0===this.conds.length)throw new DefectModelError(this.model,"界面连接条件逻辑组未配置逻辑项");for(var i=0;i<this.conds.length;i++){var o=this.conds[i].test(t,e,r);if("AND"===this.op&&!1===o){n=!1;break}if("OR"===this.op&&!0===o){n=!0;break}}return this.reverse?!n:n},e}(DELogicLinkCond),DELogicLink=function(){function t(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;var e=this.model.source.getPSDELogicLinkGroupCond();e&&(this.groupCond=new DELogicLinkGroupCond(e))}return t.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return this.model.defaultLink||!this.groupCond?[2,!0]:[2,this.groupCond.test(t,e,r||{})]}))}))},t}(),DELogicNode=function(t){this.model=t,this.links=t.links.map((function(t){return new DELogicLink(t)}))},DEActionNode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var i,o,a,s,c,u,l,h;return __generator(this,(function(d){switch(d.label){case 0:if(i=this.model.source,!(o=i.getDstPSAppDataEntity()))throw new DefectModelError(this.model.source,"未指定应用实体");if(!(a=i.getDstPSAppDEAction()))throw new DefectModelError(this.model.source,"未指定实体行为");return[4,ibiz.hub.getApp(this.model.modelService.app).es.getService(o.codeName)];case 1:return s=d.sent(),c=r&&r.length>0?r[0]:void 0,u=i.getDstPSDELogicParam(),l=i.getRetPSDELogicParam(),u&&(c=t.params[u.codeName]),[4,s.exec(a.codeName,e,c,n)];case 2:return(h=d.sent()).ok&&l&&(t.params[l.codeName]=h.data),[2]}}))}))},e}(DELogicNode),StartNode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},e}(DELogicNode),EndNode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(e=this.model.source,r=e.returnType,n=e.rawValue,r){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=n;break;case"LOGICPARAM":e.getReturnParam()&&(t.result=t.params[e.getReturnParam().codeName]);break;case"LOGICPARAMFIELD":case"BREAK":throw new UnsupportedModelError(this.model.source,"暂未支持的结束节点返回值类型: ".concat(r))}return[2]}))}))},e}(DELogicNode),PrepareParamNode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){throw new Error("Method not implemented.")},e}(DELogicNode),DataSetNode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){var o,a;return __awaiter(this,void 0,void 0,(function(){var r,i,s,c,u,l,h;return __generator(this,(function(d){switch(d.label){case 0:return r=this.model.source,i=null===(o=r.getDstPSAppDEDataSet())||void 0===o?void 0:o.codeName,s=null===(a=r.getDstPSAppDataEntity())||void 0===a?void 0:a.codeName,c=r.getDstPSDELogicParam(),u=r.getRetPSDELogicParam(),i&&s&&c?(l=t.params[c.codeName],[4,ibiz.hub.getApp(this.model.modelService.app).es.getService(s)]):[3,3];case 1:return[4,d.sent().exec(i,e,l,n)];case 2:h=d.sent(),u&&t.params[u.codeName]&&(t.params[u.codeName]=h.data),d.label=3;case 3:return[2]}}))}))},e}(DELogicNode),BindParamNode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i;return __generator(this,(function(o){if(e=this.model.source,r=e.getDstPSDELogicParam(),n=e.getSrcPSDELogicParam(),!r||!n)throw new DefectModelError(e,"缺少目标参数对象或者源参数对象配置");return i=t.params[n.codeName],t.params[r.codeName]=i[e.srcFieldName],[2]}))}))},e}(DELogicNode),ThrowExceptionNode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return(t=this.model.source).errorCode,t.errorInfo,t.exceptionObj,[2]}))}))},e}(DELogicNode),DELogicParam=function(){function t(t){this.model=t}return t.prototype.calc=function(t,e,r,n,i){var o=this.model,a=o.source,s=o.codeName;if(a.default)t.params[s]=r||{};else if(a.appGlobalParam)t.params[s]=ibiz.env;else if(a.entityListParam)t.params[s]=[];else{if(a.entityPageParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[s]=[];else{if(a.lastReturnParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 上次调用返回");if(a.appContextParam)t.params[s]=e;else if(a.simpleListParam)t.params[s]=[];else if(a.simpleParam)t.params[s]={};else if(a.cloneParam)t.params[s]=clone(r||{});else{if(a.envParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 系统环境变量");if(a.fileListParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 文件对象列表变量");if(a.fileParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 文件对象变量");if(a.filterParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 过滤器对象变量");if(a.lastParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 最后数据变量");if(a.originEntity)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 原始数据对象");if(a.sessionParam)throw new UnsupportedModelError(a,"未支持的逻辑参数类型: 操作会话变量")}}}},t}(),DELogic=function(){function t(t){var e=this;this.model=t,this.nodes=new Map,this.params=new Map,t.nodes.forEach((function(t){var r,n=t.source.logicNodeType;switch(n){case"BEGIN":r=new StartNode(t);break;case"END":r=new EndNode(t);break;case"DEACTION":r=new DEActionNode(t);break;case"PREPAREPARAM":r=new PrepareParamNode(t);break;case"DEDATASET":r=new DataSetNode(t);break;case"THROWEXCEPTION":r=new ThrowExceptionNode(t);break;case"BINDPARAM":r=new BindParamNode(t);break;default:throw new UnsupportedModelError(t.source,"未支持的逻辑节点类型: ".concat(n))}e.nodes.set(t.codeName,r)})),t.params.forEach((function(t){e.params.set(t.codeName,new DELogicParam(t))})),this.nodes.forEach((function(t){t.links.forEach((function(t){var r=t.model,n=r.srcNode,i=r.dstNode;e.nodes.has(n.codeName)&&(t.srcNode=e.nodes.get(n.codeName)),e.nodes.has(i.codeName)&&(t.dstNode=e.nodes.get(i.codeName))}))}))}return t.prototype.initLogicParams=function(t,e,r,n,i){this.params.forEach((function(o){o.calc(t,e,r,n,i)}))},t.prototype.exec=function(t,e,r,n){return __awaiter(this,void 0,void 0,(function(){var i,o;return __generator(this,(function(a){switch(a.label){case 0:return i=new DELogicContext,this.initLogicParams(i,t,e,r,n),this.model.startNode&&this.nodes.has(this.model.startNode.codeName)?(o=this.nodes.get(this.model.startNode.codeName),[4,this.deepExec(o,i,t,e,r,n)]):[3,2];case 1:return a.sent(),[3,3];case 2:throw new UnsupportedModelError(this.model.source,"未设置起始节点");case 3:return[2,i.result||i.params.default||null]}}))}))},t.prototype.deepExec=function(t,e,r,n,i,o){return __awaiter(this,void 0,void 0,(function(){var a,s,c;return __generator(this,(function(u){switch(u.label){case 0:return[4,t.exec(e,r,n,i,o)];case 1:u.sent(),a=t.links,s=0,u.label=2;case 2:return s<a.length?[4,(c=a[s]).exec(e,r,n,i,o)]:[3,6];case 3:return u.sent()&&c.dstNode?[4,this.deepExec(c.dstNode,e,r,n,i,o)]:[3,5];case 4:if(u.sent(),!1===t.model.parallel)return[3,6];u.label=5;case 5:return s++,[3,2];case 6:return[2]}}))}))},t}(),deLogicMap=new Map,Srfuf;function execDELogic(t,e,r,n,i){return __awaiter(this,void 0,void 0,(function(){var o,a,s,c;return __generator(this,(function(u){switch(u.label){case 0:return deLogicMap.has(t)?[3,2]:[4,(o=new DELogicModel(t)).init()];case 1:u.sent(),deLogicMap.set(t,new DELogic(o)),u.label=2;case 2:a=deLogicMap.get(t),u.label=3;case 3:return u.trys.push([3,5,,6]),[4,a.exec(e,r,n,i)];case 4:return s=u.sent(),[2,new HttpResponse(s)];case 5:if((c=u.sent())instanceof HttpError)return[2,new HttpResponse(c,500)];throw c;case 6:return[2]}}))}))}exports("Srfuf",Srfuf),function(t){t[t.CREATE=0]="CREATE",t[t.UPDATE=1]="UPDATE"}(Srfuf||exports("Srfuf",Srfuf={}));var Entity=function(){function t(e,r){this._srfkey="",Object.defineProperty(this,"entity",{enumerable:!1,configurable:!0,value:e}),Object.defineProperty(this,"data",{enumerable:!1,configurable:!0,value:clone(r instanceof t?r.data:r)});var n=e.getKeyPSAppDEField().codeName.toLowerCase(),i=e.getMajorPSAppDEField().codeName.toLowerCase();Object.defineProperty(this,"srfdename",{get:function(){return e.codeName}}),Object.defineProperty(this,"srfkey",{set:function(t){this._srfkey=t},get:function(){return this.data[n]||this._srfkey}}),Object.defineProperty(this,"srfmajortext",{set:function(t){this.data[i]=t},get:function(){return this.data[i]}}),this.defineProperties()}return Object.defineProperty(t.prototype,"srfuf",{get:function(){return this.srfkey?Srfuf.UPDATE:Srfuf.CREATE},enumerable:!1,configurable:!0}),t.prototype.defineProperties=function(){var t=this.data,e={};(this.entity.getAllPSAppDEFields()||[]).forEach((function(r){var n=r.codeName.toLowerCase();e[n]={enumerable:!0,set:function(e){t[n]=e},get:function(){return t[n]}}})),Object.defineProperties(this,e)},t.prototype.clone=function(){return new t(this.entity,this.data)},t.prototype.assign=function(e){return e instanceof t?Object.assign(this.data,e.data):Object.assign(this.data,e),this},t}(),MethodDto=function(){function t(t){this.dto=t,this.dtoMap=new Map,t?(this.app=ibiz.hub.getApp(t.getPSModelService().app),this.fields=t.getPSAppDEMethodDTOFields()||[]):this.fields=[]}return Object.defineProperty(t.prototype,"entity",{get:function(){var t;return this._entity||(this._entity=new AppEntityModel(null===(t=this.dto)||void 0===t?void 0:t.getParentPSModelObject("app.dataentity.IPSAppDataEntity"))),this._entity},enumerable:!1,configurable:!0}),t.prototype.get=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,l,h,d,p,f;return __generator(this,(function(v){switch(v.label){case 0:r={},n=0,v.label=1;case 1:if(!(n<this.fields.length))return[3,13];switch(i=this.fields[n],o=i.codeName.toLowerCase(),i.type){case"SIMPLE":return[3,2];case"DTOS":return[3,3]}return[3,11];case 2:return a=e[o],isNilOrEmpty(a)?r[o]=null:r[o]=a,[3,12];case 3:return[4,this.getFieldDto(i)];case 4:return s=v.sent(),c=i.getRefPSAppDataEntity(),[4,this.app.es.getService(c.codeName)];case 5:if(u=v.sent(),!(l=u.local.getList(t)))return[3,10];h=[],d=0,v.label=6;case 6:return d<l.length?(f=(p=h).push,[4,s.get(t,l[d])]):[3,9];case 7:f.apply(p,[v.sent()]),v.label=8;case 8:return d++,[3,6];case 9:r[o]=h,v.label=10;case 10:return[3,12];case 11:throw new UnsupportedModelError(i,"未支持的应用实体方法输入属性类型: ".concat(i.type));case 12:return n++,[3,1];case 13:return[2,r]}}))}))},t.prototype.sets=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.app.es.getService(this.entity.codeName)];case 1:return(r=i.sent()).local.clear(t),[2,Promise.all(e.map((function(e){return __awaiter(n,void 0,void 0,(function(){var n,i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:n=this.fields.filter((function(t){return"DTOS"===t.type})).map((function(r){return __awaiter(a,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return n=r.codeName.toLowerCase(),[4,this.getFieldDto(r)];case 1:return i=a.sent(),(o=e[n])?[4,i.sets(t,o)]:[3,3];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))})),i=0,s.label=1;case 1:return i<n.length?[4,n[i]]:[3,4];case 2:s.sent(),s.label=3;case 3:return i++,[3,1];case 4:return o=new Entity(this.entity.source,e),this.entity.isLocalMode?[4,r.local.add(t,o)]:[3,6];case 5:s.sent(),s.label=6;case 6:return[2,o]}}))}))})))]}}))}))},t.prototype.getFieldDto=function(e){var r;return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return this.dtoMap.has(e.codeName)?[2,this.dtoMap.get(e.codeName)]:[4,null===(r=e.getRefPSAppDataEntity())||void 0===r?void 0:r.fill(!0)];case 1:return i.sent(),n=new t(e.getRefPSAppDEMethodDTO()),this.dtoMap.set(e.codeName,n),[2,n]}}))}))},t}(),MethodInput=function(){function t(t,e){this.entity=t,this.input=e;var r=null==e?void 0:e.getPSAppDEMethodDTO();r&&(this.dto=new MethodDto(r))}return t.prototype.handle=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.dto?[2,this.dto.get(t,e)]:[2,e]}))}))},t}(),MethodReturn=function(){function t(t,e){this.entity=t,this.output=e,this.app=ibiz.hub.getApp(t.modelService.app);var r=null==e?void 0:e.getPSAppDEMethodDTO();r&&(this.dto=new MethodDto(r))}return t.prototype.handle=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return this.dto?[4,this.dto.sets(t,[e])]:[3,2];case 1:return[2,r.sent()[0]];case 2:return[2,new Entity(this.entity.source,e)]}}))}))},t}(),Method=function(){function t(t,e,r){this.entity=t,this.method=e,this.paths=r,this.app=ibiz.hub.getApp(t.modelService.app),this.input=new MethodInput(t,e.getPSAppDEMethodInput()),this.result=new MethodReturn(t,e.getPSAppDEMethodReturn())}return t.prototype.request=function(t,e,r,n){return __awaiter(this,void 0,void 0,(function(){var e,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(e=this.method,i=e.actionType,o=e.requestMethod,"REMOTE"!==i)return[3,11];switch(a=this.method.codeName.toLowerCase(),s=null,o){case"POST":return[3,1];case"GET":return[3,3];case"PUT":return[3,5];case"DELETE":return[3,7]}return[3,9];case 1:return[4,this.app.net.post("".concat(t,"/").concat(a),r,n)];case 2:case 4:case 6:case 8:return s=c.sent(),[3,10];case 3:return[4,this.app.net.get("".concat(t,"/").concat(a),r,n)];case 5:return[4,this.app.net.put("".concat(t,"/").concat(a),r,n)];case 7:return[4,this.app.net.delete("".concat(t,"/").concat(a),r,n)];case 9:throw new DefectModelError(this.method,o?"未支持的请求方式: ".concat(o):"未配置请求方式");case 10:return[2,s];case 11:throw new DefectModelError(this.method,"未支持的行为类型[".concat(i,"]"))}}))}))},t.prototype.calcPath=function(t){var e="/".concat(this.entity.deNamePlural);return calcResPath(t,this.paths)+e},t.prototype.getService=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return this.service?[3,2]:(t=this,[4,this.app.es.getService(this.entity.codeName)]);case 1:t.service=e.sent(),e.label=2;case 2:return[2,this.service]}}))}))},t.prototype.createEntity=function(t){return new Entity(this.entity.source,t)},t}(),DEActionMethod=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return"DELOGIC"===this.method.actionType&&(null==(n=this.method.getPSAppDELogic())?void 0:n.enableFront)?[2,execDELogic(n,t,e,r)]:this.entity.isLocalMode?[3,2]:[4,this.input.handle(t,e)];case 1:e=s.sent(),s.label=2;case 2:switch(i=this.calcPath(t),this.method.needResourceKey&&(i="".concat(i,"/").concat(t[this.entity.deName]||e[this.entity.keyName])),this.method.codeName){case"Create":return[3,3];case"Get":return[3,4];case"GetDraft":return[3,5];case"Remove":return[3,6];case"Update":return[3,7];case"CreateTemp":return[3,8];case"GetTemp":return[3,9];case"GetDraftTemp":return[3,10];case"RemoveTemp":return[3,11];case"UpdateTemp":return[3,12]}return[3,13];case 3:return[2,this.create(t,e,r)];case 4:return[2,this.get(t,r)];case 5:return[2,this.getDraft(t,r)];case 6:return[2,this.remove(t,r)];case 7:return[2,this.update(t,e,r)];case 8:return[2,this.createTemp(t,e)];case 9:return[2,this.getTemp(t,e)];case 10:return[2,this.getDraftTemp(t,r)];case 11:return[2,this.removeTemp(t,e)];case 12:return[2,this.updateTemp(t,e)];case 13:return[4,this.request(i,t,e,r)];case 14:return o=s.sent(),a=o,[4,this.result.handle(t,o.data)];case 15:return a.data=s.sent(),[2,o]}}))}))},e.prototype.create=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return this.entity.isLocalMode?[2,this.createTemp(t,this.createEntity(e))]:(n=this.calcPath(t),[4,this.app.net.post(n,e,r)]);case 1:return i=a.sent(),o=i,[4,this.result.handle(t,i.data)];case 2:return o.data=a.sent(),[2,i]}}))}))},e.prototype.remove=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return this.entity.isLocalMode?[2,this.removeTemp(t,e)]:(r=this.calcPath(t),[4,this.app.net.delete("".concat(r,"/").concat(t[this.entity.deName]),e)]);case 1:return[2,n.sent()]}}))}))},e.prototype.update=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return this.entity.isLocalMode?[2,this.updateTemp(t,this.createEntity(e))]:(n=this.calcPath(t),[4,this.app.net.put("".concat(n,"/").concat(t[this.entity.deName]),e,r)]);case 1:return i=a.sent(),o=i,[4,this.result.handle(t,i.data)];case 2:return o.data=a.sent(),[2,i]}}))}))},e.prototype.get=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return this.entity.isLocalMode?[2,this.getTemp(t,e)]:(r=this.calcPath(t),[4,this.app.net.get("".concat(r,"/").concat(t[this.entity.deName]),e)]);case 1:return n=o.sent(),i=n,[4,this.result.handle(t,n.data)];case 2:return i.data=o.sent(),[2,n]}}))}))},e.prototype.getDraft=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return this.entity.isLocalMode?[2,this.getDraftTemp(t,e)]:(r=this.calcPath(t),[4,this.app.net.get("".concat(r,"/getdraft"),e)]);case 1:return n=o.sent(),i=n,[4,this.result.handle(t,n.data)];case 2:return i.data=o.sent(),[2,n]}}))}))},e.prototype.createTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getService()];case 1:return[4,i.sent().local.add(t,this.createEntity(e))];case 2:return r=i.sent(),[2,new HttpResponse(r)];case 3:return n=i.sent(),[2,new HttpResponse(n,500)];case 4:return[2]}}))}))},e.prototype.getDraftTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){try{return(t=this.createEntity({}))?[2,new HttpResponse(t)]:[2,new HttpResponse(t,500)]}catch(t){return[2,new HttpResponse(t,500)]}return[2]}))}))},e.prototype.removeTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),r=null,e&&(r=e[this.entity.keyName]),!r&&t&&(r=t[this.entity.deName]),[4,this.getService()];case 1:return n=a.sent(),(i=n.local.delete(t,r))?[2,new HttpResponse(i)]:[2,new HttpResponse(i,500)];case 2:return o=a.sent(),[2,new HttpResponse(o,500)];case 3:return[2]}}))}))},e.prototype.updateTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getService()];case 1:return r=o.sent(),(n=r.local.update(t,this.createEntity(e)))?[2,new HttpResponse(n)]:[2,new HttpResponse(n,500)];case 2:return i=o.sent(),[2,new HttpResponse(i,500)];case 3:return[2]}}))}))},e.prototype.getTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),r=null,e&&(r=e[this.entity.keyName]),!r&&t&&(r=t[this.entity.deName]),[4,this.getService()];case 1:return n=a.sent(),(i=n.local.get(t,r))?[2,new HttpResponse(i)]:[2,new HttpResponse(i,500)];case 2:return o=a.sent(),[2,new HttpResponse(o,500)];case 3:return[2]}}))}))},e.prototype.removeBatchTemp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:if(!e)return[3,5];if(!(r=e[this.entity.keyName]))return[3,5];i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.getService()];case 2:return[4,i.sent().local.deleteBatch(t,r)];case 3:return i.sent(),[3,5];case 4:return n=i.sent(),[2,new HttpResponse(n,500)];case 5:return[2,new HttpResponse(!0)]}}))}))},e}(Method),FetchMethod=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.exec=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s=this;return __generator(this,(function(c){switch(c.label){case 0:return this.entity.isLocalMode?[4,this.searchLocal(null,new SearchFilter(t,e))]:[3,2];case 1:return n=c.sent(),[2,new HttpResponse(n,200)];case 2:return i=this.calcPath(t),[4,this.request(i,t,e,r)];case 3:return o=c.sent(),a=o.data||[],o.data=a.map((function(t){return s.createEntity(t)})),[2,o]}}))}))},e.prototype.selectLocal=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u,l,h,d,p,f;return __generator(this,(function(v){switch(v.label){case 0:return[4,this.getService()];case 1:if(r=v.sent(),n=r.local.getList(t),n=ascSort(n,"srfordervalue"),i={},notNilEmpty(t)&&(o=this.entity.majorKeyMap))for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&(l=o[u],notNilEmpty(t[u])&&(i[l]=equals(t[u])));for(u in a={},s={},c={},e.srfkey&&(i.srfkey=equals(e.srfkey),delete e.srfkey),e)Object.prototype.hasOwnProperty.call(e,u)&&(null==(l=e[u])?(a[u]=equals(null),s[u]=equals(void 0),c[u]=equals("")):i[u]=equals(l));return isEmpty$1(i)||(h=where(i),d=where(a),p=where(s),f=where(c),n=n.filter((function(t){if(isEmpty$1(a)){if(h(t))return!0}else if(h(t)&&(d(t)||p(t)||f(t)))return!0;return!1}))),[2,n.map((function(t){return t.clone()}))]}}))}))},e.prototype.searchLocal=function(t,e,r){return void 0===r&&(r=this.entity.quickSearchKeys),__awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,c;return __generator(this,(function(u){switch(u.label){case 0:return[4,this.getService()];case 1:return n=u.sent(),i=[],t?((i=n.local.getList(e.context)).length>0&&(i=i.filter((function(r){return t.test(r,e)}))),[3,4]):[3,2];case 2:return[4,this.selectLocal(e.context)];case 3:(i=u.sent()).length>0&&e.query&&""!==e.query&&r&&(i=i.filter((function(t){for(var n=new RegExp(e.query),i=0;i<r.length;i+=1){var o=t[r[i]];if(n.test(o))return!0}return!1}))),u.label=4;case 4:return isNil(e.sortField)||isEmpty$1(e.sortField)||(i="DESC"===e.sortMode?descSort(i,e.sortField):ascSort(i,e.sortField)),o=e.page,a=e.size,s=o*a,c=(o+1)*a-1,[2,i.slice(s,c).map((function(t){return clone(t)}))]}}))}))},e}(Method),FileService=function(){function t(t,e){this.model=t,this.paths=e}return t.prototype.exportData=function(t,e,r,n){var i=calcResPath(r,this.paths),o="".concat(i,"/").concat(this.model.deNamePlural,"/exportdata/").concat(e.toLowerCase(),"/?srfexporttag=").concat(t.codeName);return ibiz.net.request(o,{method:"post",data:n,responseType:"blob"})},t}(),EntityService=exports("EntityService",function(){function t(t,e){this.model=t,this.paths=e,this.methodMap=new Map,this.local=new EntityCache,this.wf=new WorkFlowService(t),this.file=new FileService(t,e)}return t.prototype.getMethod=function(t){if(this.methodMap.has(t))return this.methodMap.get(t);var e=this.model.findPSAppDeMethod(t),r=null;switch(e.methodType){case"DEACTION":r=new DEActionMethod(this.model,e,this.paths);break;case"FETCH":case"FETCHTEMP":r=new FetchMethod(this.model,e,this.paths);break;default:throw new UnsupportedModelError(e,"未支持的服务方法类型: ".concat(e.methodType))}return this.methodMap.set(t,r),r},t.prototype.exec=function(t,e,r,n){void 0===r&&(r={}),void 0===n&&(n={});var i=this.getMethod(t);if(i)return i.exec(e,r,n);throw new RuntimeError("".concat(this.model.deName,"未支持「").concat(t,"」方法"))},t.prototype.getPath=function(t,e,r,n){void 0===r&&(r={}),void 0===n&&(n={});var i=this.getMethod(t);if(i)return i.exec(e,r,n);throw new RuntimeError("".concat(this.model.deName,"未支持「").concat(t,"」方法"))},t}()),ControlVO=exports("ControlVO",function(){function t(t,e){var r=this;t&&e&&(Object.defineProperty(this,"$origin",{enumerable:!1,configurable:!0,value:t||{}}),Object.defineProperty(this,"$dataUIMap",{enumerable:!1,configurable:!0,value:e||new Map}),this.$dataUIMap.forEach((function(t,e){var n=t.dataKey;r.linkProperty(e,n,t.isOriginField)})),Object.keys(t).forEach((function(t){Object.prototype.hasOwnProperty.call(r,t)||r.linkProperty(t,t)})))}return Object.defineProperty(t.prototype,"srfuf",{get:function(){return isNil(this.$origin.srfuf)?this.srfkey?Srfuf.UPDATE:Srfuf.CREATE:this.$origin.srfuf},enumerable:!1,configurable:!0}),t.prototype.linkProperty=function(t,e,r){void 0===r&&(r=!0),"srfuf"!==t&&(r||Object.prototype.hasOwnProperty.call(this.$origin,t)?Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:function(){return this.$origin[e]},set:function(t){this.$origin[e]=t}}):Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:null}))},t.prototype.getOrigin=function(){return this.$origin},t.prototype.getRequestData=function(){var t=this,e=__assign({},this.$origin);return this.$dataUIMap.forEach((function(r){r.isRequestNeed!==r.isOriginField&&(e[r.dataKey]=t[r.uiKey])})),e},t.prototype.setOrigin=function(e){this.$origin=e instanceof t?e.getOrigin():e},t.prototype.mergeOrigin=function(e){Object.assign(this.$origin,e instanceof t?e.getOrigin():e)},t.prototype.reactiveInit=function(){var t=this;this.$dataUIMap.forEach((function(e,r){void 0===t.$origin[r]&&(t.$origin[r]=null)}))},t}()),UIMapField=function(t,e,r){void 0===r&&(r={}),this.isOriginField=!1,this.isRequestNeed=!0,this.uiKey=t,this.dataKey=e,isNil(r.isOriginField)||(this.isOriginField=r.isOriginField),isNil(r.isRequestNeed)||(this.isRequestNeed=r.isRequestNeed)},ControlService=exports("ControlService",function(){function t(t){this.dataUIMap=new Map,this.app=ibiz.hub.getApp(t.modelService.app),this.model=t}return Object.defineProperty(t.prototype,"appEntity",{get:function(){return this.model.appEntity},enumerable:!1,configurable:!0}),t.prototype.init=function(t){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return t=this,[4,this.app.es.getService(this.appEntity.source.codeName)];case 1:return t.entityService=e.sent(),this.initUIDataMap(),[2]}}))}))},t.prototype.initUIDataMap=function(){var t,e=this.model.appEntity.deName.toLowerCase(),r=null===(t=this.model.source.getPSAppDataEntity().getKeyPSAppDEField())||void 0===t?void 0:t.codeName;if(r){var n=new UIMapField(e,r.toLowerCase(),{isOriginField:!0});this.dataUIMap.set(e,n),this.dataUIMap.set("srfkey",n)}},t.prototype.exec=function(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:return[4,this.entityService.exec(t,e,r,n)];case 1:return[2,i.sent()]}}))}))},t.prototype.handleResponse=function(t){return t},t.prototype.toUIData=function(t){return new ControlVO(t,this.dataUIMap)},t}()),MDControlService=exports("MDControlService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.fetch=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.fetchAction,t,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.get=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.getAction,t,void 0,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.getDraft=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.getDraftAction,t,void 0,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.remove=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,this.exec(this.model.removeAction,t,void 0,e)];case 1:return[2,r.sent()]}}))}))},e.prototype.create=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.createAction,t,e.getRequestData())];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.update=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.updateAction,t,e.getRequestData())];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.exportData=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,this.entityService.file.exportData(t,this.model.fetchAction,e,r)]}))}))},e.prototype.handleResponse=function(e){var r=this,n=t.prototype.handleResponse.call(this,e);return n.headers&&(n.headers["x-page"]&&(n.page=Number(n.headers["x-page"])),n.headers["x-per-page"]&&(n.size=Number(n.headers["x-per-page"])),n.headers["x-total"]&&(n.total=Number(n.headers["x-total"]))),n.ok&&(isArray$1(n.data)?n.data=n.data.map((function(t){return r.toUIData(t)})):n.data=this.toUIData(n.data)),n},e}(ControlService)),GridService=exports("GridService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initUIDataMap=function(){var e,r=this;t.prototype.initUIDataMap.call(this),null===(e=this.model.source.getPSDEGridDataItems())||void 0===e||e.forEach((function(t){var e,n=t.name.toLowerCase(),i=t.getPSAppDEField();if(i){var o=i.codeName.toLowerCase();e=new UIMapField(n,o,{isOriginField:!0})}else e=new UIMapField(n,n,{isRequestNeed:!1});r.dataUIMap.set(n,e)})),this.model.fieldColumns.forEach((function(t){if(t.source.dataItemName!==t.codeName){var e=r.dataUIMap.get(t.source.dataItemName);e&&r.dataUIMap.set(t.codeName,e)}}))},e.prototype.updateGridEditItem=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.entityService.exec(t,e,r)];case 1:return n=i.sent(),[2,n=this.handleResponse(n)]}}))}))},e}(MDControlService)),ListService=exports("ListService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initUIDataMap=function(){var e,r=this;t.prototype.initUIDataMap.call(this),null===(e=this.model.source.getPSDEListDataItems())||void 0===e||e.forEach((function(t){var e,n=t.name.toLowerCase(),i=t.getPSAppDEField();if(i){var o=i.codeName.toLowerCase();e=new UIMapField(n,o,{isOriginField:!0})}else e=new UIMapField(n,n,{isRequestNeed:!1});r.dataUIMap.set(n,e)}))},e}(MDControlService)),TreeNodeData=function(t,e,r,n){this.parent=n,this.parent?this.context=__assign({},this.parent.context):this.context={},this.nodeId=t.nodeId,this.leaf=0===t.tree.getChildNodes(t.nodeId,e.hasQuery).length},TreeDataSetNodeData=exports("TreeDataSetNodeData",function(t){function e(e,r,n,i){var o,a=t.call(this,e,r,n,i)||this,s=r.data;return a.deData=s,a.text=s.srfmajortext,a.value=s.srfkey,a.id=i?"".concat(i.id,":").concat(e.nodeId).concat(s.srfkey):e.nodeId+s.srfkey,a.id=a.id.toLowerCase(),Object.assign(a.context,((o={})[e.appEntity.deName]=s.srfkey,o)),a}return __extends(e,t),e}(TreeNodeData)),TreeStaticNodeData=exports("TreeStaticNodeData",function(t){function e(e,r,n,i){var o,a=this;if((a=t.call(this,e,r,n,i)||this).id=i?"".concat(i.id,":").concat(e.nodeId):e.nodeId,a.id=a.id.toLowerCase(),a.text=e.text,i&&n){for(var s=i,c=1;c<n.parentValueLevel;c++)s=null==s?void 0:s.parent;(null==s?void 0:s.deData)&&(a.deData=s.deData)}return a.value=e.nodeValue||(null===(o=a.deData)||void 0===o?void 0:o.value),a}return __extends(e,t),e}(TreeNodeData)),TreeService=exports("TreeService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initUIDataMap=function(){t.prototype.initUIDataMap.call(this)},e.prototype.fetchChildNodes=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return 0===(r=this.model.getChildNodeRSs((null==t?void 0:t.nodeId)||this.model.rootNode.id,e.hasQuery)).length?[2]:[4,Promise.allSettled(r.map((function(r){return __awaiter(o,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return"STATIC"!==(n=r.childNode).treeNodeType?[3,2]:[4,this.getStaticNodeData(r,t,e)];case 1:return[2,[i.sent()]];case 2:return"DE"===n.treeNodeType?[2,this.getDENodeDatas(r,t,e)]:"CODELIST"===n.treeNodeType?[2,this.getCodeListNodeDatas(r,t,e)]:[2,void 0]}}))}))})))];case 1:return n=a.sent(),i=[],n.forEach((function(t){"fulfilled"===t.status&&t.value&&i.push.apply(i,__spreadArray([],__read(t.value),!1))})),[2,i]}}))}))},e.prototype.getStaticNodeData=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return n=t.childNode,i=new TreeStaticNodeData(n,r,t,e),n.expanded?(o=i,[4,this.fetchChildNodes(i,r)]):[3,2];case 1:o.children=a.sent(),a.label=2;case 2:return[2,i]}}))}))},e.prototype.getNodeRSFilterParams=function(t,e,r){var n,i=t.parentValueLevel,o=t.navContexts,a=t.navParams,s=t.pickupDEFName,c=__assign({},r.params),u=__assign(__assign({},r.context),(null==e?void 0:e.context)||{}),l={};if(e){n=e;for(var h=1;h<i;h++)n=null==n?void 0:n.parent;(null==n?void 0:n.deData)&&(l=n.deData)}n&&s&&(c["n_".concat(s,"_eq")]=n.value);var d=convertNavData(o,u,c,l),p=convertNavData(a,u,c,l);return Object.assign(u,d),Object.assign(c,p),{context:u,params:c}},e.prototype.getDENodeDatas=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a,s,c,u,l;return __generator(this,(function(h){switch(h.label){case 0:return n=t.childNode,i=n.methodName,o=n.appEntity,[4,this.app.es.getService(o.codeName)];case 1:return a=h.sent(),s=this.getNodeRSFilterParams(t,e,r),c=s.context,u=s.params,[4,a.exec(i,c,u)];case 2:return(l=h.sent()).data.length?[2,l.data.map((function(i){return new TreeDataSetNodeData(n,__assign(__assign({},r),{data:i}),t,e)}))]:[2,[]]}}))}))},e.prototype.getCodeListNodeDatas=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},e}(MDControlService)),EditFormService=exports("EditFormService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.getAction,t,void 0,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.getDraft=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.getDraftAction,t,void 0,e)];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.remove=function(t,e){return void 0===e&&(e={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,this.exec(this.model.removeAction,t,void 0,e)];case 1:return[2,r.sent()]}}))}))},e.prototype.create=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.createAction,t,e.getRequestData())];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.update=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.exec(this.model.updateAction,t,e.getRequestData())];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.goBack=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:if(!this.model.goBackAction)throw new DefectModelError(this.model.source,"缺少返回操作实体行为");return[4,this.exec(this.model.goBackAction,t,e.getRequestData())];case 1:return r=n.sent(),[2,r=this.handleResponse(r)]}}))}))},e.prototype.updateFormItem=function(t,e,r){return void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.entityService.exec(t,e,r)];case 1:return n=i.sent(),[2,n=this.handleResponse(n)]}}))}))},e.prototype.wfStart=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!this.model.wfStartAction)throw new DefectModelError(this.model.source,"不存在工作流启动行为");return[2,this.entityService.wf.exec(this.model.wfStartAction,t,e,r.getRequestData())]}))}))},e.prototype.wfSubmit=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!this.model.wfSubmitAction)throw new DefectModelError(this.model.source,"不存在工作流提交行为");return[2,this.entityService.wf.exec(this.model.wfSubmitAction,t,e,r.getRequestData())]}))}))},e.prototype.initUIDataMap=function(){var e=this;t.prototype.initUIDataMap.call(this);var r=["srfwfmemo","srfnextform","srfactionparam","srffrontuf","srfnextform"];this.model.source.getPSDEFormItems().forEach((function(t){var n,i=t.id.toLowerCase(),o=t.getPSAppDEField();if(o){var a=o.codeName.toLowerCase();n=new UIMapField(i,a,{isOriginField:!0})}else n=new UIMapField(i,i,{isRequestNeed:r.includes(i),isOriginField:r.includes(i)});e.dataUIMap.set(i,n)}))},e.prototype.handleResponse=function(e){var r=t.prototype.handleResponse.call(this,e);return r.ok&&r.data&&(r.data=this.toUIData(r.data)),r},e}(ControlService)),SearchFormService=exports("SearchFormService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.getDraft=function(t,e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return t={ok:!0,status:200,data:{}},[2,t=this.handleResponse(t)]}))}))},e.prototype.initUIDataMap=function(){var t,e=this;null===(t=this.model.source.getPSDEFormItems())||void 0===t||t.forEach((function(t){var r=t.id.toLowerCase();e.dataUIMap.set(r,new UIMapField(r,r))}))},e.prototype.handleResponse=function(e){var r=t.prototype.handleResponse.call(this,e);return r.ok&&r.data&&(r.data=this.toUIData(r.data)),r},e}(ControlService)),DataViewService=exports("DataViewService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initUIDataMap=function(){var e,r=this;t.prototype.initUIDataMap.call(this),null===(e=this.model.source.getPSDEDataViewDataItems())||void 0===e||e.forEach((function(t){var e,n=t.name.toLowerCase(),i=t.getPSAppDEField();if(i){var o=i.codeName.toLowerCase();e=new UIMapField(n,o,{isOriginField:!0})}else e=new UIMapField(n,n,{isRequestNeed:!1});r.dataUIMap.set(n,e)}))},e}(MDControlService)),WizardPanelService=exports("WizardPanelService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initialize=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.exec(this.model.initAction,t,e,r)];case 1:return n=i.sent(),[2,n=this.handleResponse(n)]}}))}))},e.prototype.finish=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),__awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.exec(this.model.finishAction,t,e,r)];case 1:return n=i.sent(),[2,n=this.handleResponse(n)]}}))}))},e}(ControlService)),KanbanService=exports("KanbanService",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initUIDataMap=function(){var e,r=this;t.prototype.initUIDataMap.call(this),null===(e=this.model.source.getPSDEDataViewDataItems())||void 0===e||e.forEach((function(t){var e,n=t.name.toLowerCase(),i=t.getPSAppDEField();if(i){var o=i.codeName.toLowerCase();e=new UIMapField(n,o,{isOriginField:!0})}else e=new UIMapField(n,n,{isRequestNeed:!1});r.dataUIMap.set(n,e)}))},e}(MDControlService)),AuthService=exports("AuthService",function(){function t(){}return t.prototype.v7login=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,ibiz.net.post("/v7/login",{loginname:t,password:e},{},{})];case 1:return[2,r.sent()]}}))}))},t.prototype.v7logout=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,ibiz.net.get("/v7/logout",{})];case 1:return[2,t.sent()]}}))}))},t}()),AuthorityService=exports("AuthorityService",function(){function t(t){this.modelService=t,this.isInit=!1,this.resCodes=[],this.enableResValidate=!0,this.rtMenuCodes=[]}return t.prototype.init=function(t){return void 0===t&&(t=ibiz.appData),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!t)throw new RuntimeError("没有appData数据");return t.unires&&(this.resCodes=t.unires),!1===t.enablepermissionvalid&&(this.enableResValidate=!1),t.appmenu&&(this.rtMenuCodes=t.appmenu),[2]}))}))},t.prototype.hasOwnOPPrivs=function(t,e){var r,n;return __awaiter(this,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){return i=this.modelService.app,o=[],(null===(r=i.getAllPSDEOPPrivs())||void 0===r?void 0:r.length)&&o.push.apply(o,__spreadArray([],__read(i.getAllPSDEOPPrivs()),!1)),(null===(n=null==e?void 0:e.source.getAllPSDEOPPrivs())||void 0===n?void 0:n.length)&&o.push.apply(o,__spreadArray([],__read(e.source.getAllPSDEOPPrivs()),!1)),(a=o.find((function(e){return e.name===t})))?[2,!a.mapSysUniRes||this.resCodes.includes(a.mapSysUniResCode)]:[2,!1]}))}))},t.prototype.hasMenuPermitted=function(t){if(!ibiz.env.enablePermission)return!0;switch(ibiz.env.menuPermissionMode){case MenuPermissionMode.RT:return this.calcMenuPermissionByRT(t);case MenuPermissionMode.RESOURCE:return this.calcMenuPermissionByResource(t);case MenuPermissionMode.MIXIN:return this.calcMenuPermissionByResource(t)||this.calcMenuPermissionByRT(t);default:return!0}},t.prototype.calcMenuPermissionByRT=function(t){return this.rtMenuCodes.includes(t.rtMenuCode)},t.prototype.calcMenuPermissionByResource=function(t){return!this.enableResValidate||!t.source.accessKey||this.resCodes.includes(t.source.accessKey)},t.prototype.hasUIActionPermitted=function(t,e,r){var n=t.dataAccessAction,i=t.uIActionTag,o=t.actionTarget;if(n){if(this.enableResValidate&&!this.hasOwnOPPrivs(n,r))return!1;if(e){if(e.srfopprivs&&!e.srfopprivs.includes(n))return!1;if(!this.calcDeMainStatePermission(n,e,r))return!1}}return"SYS"!==t.uIActionMode||o||(o=["SAVE","SaveAndExit","Edit","Remove","RemoveAndExit"].includes(i)?"SINGLEKEY":"NONE"),!("NONE"!==o&&!e)},t.prototype.calcDeMainStatePermission=function(t,e,r){var n=r.source.getMainStatePSAppDEFields()||[];if(!r.source.enableDEMainState||0===n.length)return!0;var i=n.map((function(t){return e[t.codeName.toLowerCase()]})),o=r.findMainState(i[0],i[1],i[2]);return!o||o.opPrivs.includes(t)},t}()),ServiceUtil=exports("ServiceUtil",function(){function t(t){this.modelService=t,this.cache=new Map,this.allEntities=new Map}return t.prototype.initAllEntities=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){return 0!==this.allEntities.size||(this.modelService.app.getAllPSAppDataEntities()||[]).forEach((function(e){var r=e.isFill?e.codeName:e.refM.codeName;t.allEntities.set(r,e)})),[2]}))}))},t.prototype.getService=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return this.cache.has(t)?[3,5]:[4,this.initAllEntities()];case 1:if(a.sent(),!(e=this.allEntities.get(t)))throw new Error("找不到实体[".concat(t,"]模型"));return[4,e.fill(!0)];case 2:return a.sent(),[4,(r=new AppEntityModel(e)).init()];case 3:return a.sent(),n=ibiz.hub.getApp(this.modelService.app),i=n.resourcePathUtil.calcPaths(t),[4,new EntityService(r,i)];case 4:o=a.sent(),this.cache.set(t,o),a.label=5;case 5:return[2,this.cache.get(t)]}}))}))},t.prototype.clearTempCache=function(t){this.cache.forEach((function(e){e.local.clear(t)}))},t}()),ControlState=exports("ControlState",(function(){this.complete=!1})),FormState=exports("FormState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isLoaded=!1,e.data=new ControlVO,e.processing=!1,e}return __extends(e,t),e}(ControlState)),EditFormState=exports("EditFormState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(FormState)),SearchFormState=exports("SearchFormState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(FormState)),FormDetailState=exports("FormDetailState",(function(t){this.parent=t,this.required=!1,this.disabled=!1,this.layoutController={width:"auto",height:"auto",extraStyle:{},extraClass:"",contentStyle:{}};var e=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:function(){var t;return!1!==(null===(t=this.parent)||void 0===t?void 0:t.visible)&&e},set:function(t){return e=t,!0}})})),FormContainerState=exports("FormContainerState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),FormGroupPanelState=exports("FormGroupPanelState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(FormContainerState)),FormPageState=exports("FormPageState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(FormContainerState)),FormButtonState=exports("FormButtonState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),FormDruipartState=exports("FormDruipartState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),FormItemState=exports("FormItemState",function(t){function e(e){var r=t.call(this,e)||this;r.parent=e,r.error=null,r.enableCondDisabled=!1;var n=!1;return Object.defineProperty(r,"disabled",{enumerable:!0,configurable:!0,get:function(){return!!this.enableCondDisabled||n},set:function(t){return n=t,!0}}),r}return __extends(e,t),e}(FormDetailState)),FormRawItemState=exports("FormRawItemState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),FormTabPageState=exports("FormTabPageState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormContainerState)),FormTabPanelState=exports("FormTabPanelState",function(t){function e(e){var r=t.call(this,e)||this;return r.parent=e,r}return __extends(e,t),e}(FormDetailState)),PanelItemState=exports("PanelItemState",(function(t){this.parent=t,this.required=!1,this.disabled=!1,this.layoutController={width:"auto",height:"auto",extraStyle:{},extraClass:"",contentStyle:{}};var e=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:function(){var t;return!1!==(null===(t=this.parent)||void 0===t?void 0:t.visible)&&e},set:function(t){return e=t,!0}})})),PanelContainerState=exports("PanelContainerState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PanelItemState)),PanelFieldState=exports("PanelFieldState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.error=null,e}return __extends(e,t),e}(PanelItemState)),PanelRawItemState=exports("PanelRawItemState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PanelItemState)),PanelButtonState=exports("PanelButtonState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PanelItemState)),PanelTabPageState=exports("PanelTabPageState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PanelItemState)),PanelTabPanelState=exports("PanelTabPanelState",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PanelItemState)),PortletPartState=exports("PortletPartState",(function(){this.layoutController={width:"auto",height:"auto",extraStyle:{},extraClass:"",contentStyle:{},visible:!0},this.actionGroupState=null})),AppMenuState=exports("AppMenuState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.menuItemsState={},e}return __extends(e,t),e}(ControlState)),MDState=exports("MDState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.items=[],e.selectedData=[],e.singleSelect=!0,e.curPage=1,e.size=20,e.total=0,e.hasLoaded=!1,e}return __extends(e,t),e}(ControlState)),GridState=exports("GridState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rows=[],e}return __extends(e,t),e}(MDState)),TreeState=exports("TreeState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rootNode=null,e}return __extends(e,t),Object.defineProperty(e.prototype,"treeNodes",{get:function(){var t;return(null===(t=this.rootNode)||void 0===t?void 0:t.children)||[]},enumerable:!1,configurable:!0}),e}(MDState)),DataViewState=exports("DataViewState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rows=[],e.groupData=[],e}return __extends(e,t),e}(MDState)),WizardPanelState=exports("WizardPanelState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.activeFormTag="",e}return __extends(e,t),e}(ControlState)),ListState=exports("ListState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rows=[],e.groupData=[],e}return __extends(e,t),e}(MDState)),KanbanState=exports("KanbanState",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rows=[],e.groupData=[],e}return __extends(e,t),e}(MDState)),ViewController=exports("ViewController",function(){function t(t,e,r){void 0===r&&(r={}),this.modelPath=t,this.state=new ViewState,this.modal={mode:ViewMode.ROUTE},this.complete=!1,this.toolbarState=null,this.viewLoading=new LoadingState,this.providers={},this.context=new IBizContext(e),this.params=r,this.nerve=this.createNerve()}return t.prototype.createNerve=function(){return new ViewNerve(this)},t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.onInit()];case 1:return e.sent(),this.state.complete=!0,this.nerve.created(),this.setCaption(this.model.caption),this.force((function(){t.nerve.mounted()})),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return this.emit("neuronInit",this.nerve.self),t=this,[4,ibiz.model.getView(this.modelPath)];case 1:return t.model=e.sent(),this.app=ibiz.hub.getApp(this.model.modelService.app),this.handleViewParams(),this.initToolbarState(),[2]}}))}))},t.prototype.initToolbarState=function(){var t=this;if(this.model.toolbar){var e=new ButtonContainerState;__spreadArray([],__read(this.model.toolbar.actionItems.values()),!1).forEach((function(r){var n=new ButtonState(r.id,r.getPSUIAction(),t.model.appEntity);["Edit","Remove"].includes(r.getPSUIAction().uIActionTag)&&(n.noPermissionMode="DISABLED"),e.addState(r.id,n)})),e.update(),this.state.toolbarState=e}},t.prototype.handleViewParams=function(){this.context.srfkey&&this.model.appEntity&&(this.context[this.model.appEntity.deName]=this.context.srfkey,this.context.srfkey=void 0,delete this.context.srfkey),this.modal.mode===ViewMode.ROUTE&&(this.context.srfsessionid=createUUID());var t=this.model.source.getPSAppViewNavContexts(),e={};notNilEmpty(t)&&(e=convertNavData(t,this.context,this.params)),Object.assign(this.context,e);var r=this.model.source.getPSAppViewNavParams(),n={};notNilEmpty(r)&&(n=convertNavData(r,this.context,this.params)),Object.assign(this.params,n)},t.prototype.destroy=function(){this.nerve.destroy()},t.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},t.prototype.getData=function(){return[]},t.prototype.closeView=function(t){return void 0===t&&(t={ok:!0,data:this.getData()}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.nerve.self.evt.emit("closeView",t),[2]}))}))},t.prototype.beforeClose=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,!0]}))}))},t.prototype.force=function(t){},t.prototype.emit=function(t){},t.prototype.onToolbarClick=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){if(!t.getPSAppViewUIAction())throw new DefectModelError(t,"没有配置界面行为!");if(r="".concat(t.getPSAppViewUIAction().name,"_click"),!(n=this.model.source.findPSAppViewLogic(r)))throw new DefectModelError(t.getPSAppViewUIAction(),"没有找到对应的视图逻辑");return[2,this.executeViewLogic(n,this.getData(),e)]}))}))},t.prototype.executeViewLogic=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return[4,executeViewLogic(t,this.context,e,this.params,{event:r,neuron:this.nerve.self})];case 1:return(n=i.sent()).refresh?[4,this.refresh()]:[3,3];case 2:i.sent(),i.label=3;case 3:return n.closeView?[4,this.closeView()]:[3,5];case 4:i.sent(),i.label=5;case 5:return[2]}}))}))},t.prototype.setCaption=function(t){this.state.caption=t,this.nerve.self.evt.asyncEmit("setTitle",t),this.force()},t.prototype.beginViewLoading=function(){this.viewLoading.begin(),this.state.isLoading=this.viewLoading.isLoading},t.prototype.endViewLoading=function(){this.viewLoading.end(),this.state.isLoading=this.viewLoading.isLoading},t}()),MainViewController=exports("MainViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return this.entityService?[3,2]:(t=this,[4,this.app.es.getService(this.model.appEntity.codeName)]);case 1:t.entityService=r.sent(),r.label=2;case 2:return[4,this.entityService.exec("Get",this.context,this.params)];case 3:return e=r.sent(),this.mainData=e.data,this.calcCaption(e.data),this.state.toolbarState&&this.state.toolbarState.update(e.data),[2,e.data]}}))}))},e.prototype.calcCaption=function(t){if(ibiz.config.enableDataInfoBar&&this.model.showDataInfoBar){var e=t[this.model.appEntity.textName];e?this.setCaption("".concat(this.model.caption," - ").concat(e)):this.context[this.model.appEntity.deName]||this.setCaption("".concat(this.model.caption," - 新建"))}},e}(ViewController)),IndexViewState=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isCollapse=!1,e}return __extends(e,t),e}(ViewState),IndexViewController=exports("IndexViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new IndexViewState,e.isCollapse=!1,e}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.appMenu)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e}(ViewController)),EditViewController=exports("EditViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new EditViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new EditViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return a.sent(),e=this,[4,this.app.es.getService(this.model.appEntity.codeName)];case 2:return e.entityService=a.sent(),this.nerve.self.evt.on("mounted",(function(){o.model.source.loadDefault&&o.load()})),(r=this.model.form)?(n=this.providers,i=r.name,[4,ibiz.register.control.get(r)]):[3,4];case 3:n[i]=a.sent(),a.label=4;case 4:return[2]}}))}))},e.prototype.getData=function(){return this.nerve.form.call.getData()},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.nerve.form.call.load()];case 1:return t=e.sent(),this.calcCaption(t),this.state.toolbarState&&this.state.toolbarState.update(t.getOrigin()),[2,t]}}))}))},e.prototype.save=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.form.call.save()];case 1:return[2,t.sent()]}}))}))},e.prototype.onAfterFormSave=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){return t&&(r=this.model.appEntity.deName,this.context[r]=e[r]),this.calcCaption(e),this.nerve.self.evt.asyncEmit("viewDataChange",{type:t?"CREATE":"UPDATE",data:[e],control:"form"}),[2]}))}))},e.prototype.onAfterFormRemove=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.nerve.self.evt.asyncEmit("viewDataChange",{type:"REMOVE",data:[t],control:"form"}),[2]}))}))},e.prototype.saveAndNew=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.save()];case 1:return t.sent(),this.context[this.model.appEntity.deName]=void 0,[4,this.load()];case 2:return t.sent(),[2]}}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.form.call.remove()];case 1:return t.sent(),[2]}}))}))},e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.load()];case 1:return t=e.sent(),this.nerve.self.evt.asyncEmit("refreshed",[t]),[2]}}))}))},e.prototype.wfStart=function(){var t;return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return[4,this.save()];case 1:return s.sent(),[4,this.entityService.wf.getWFVersion()];case 2:if(0===(e=s.sent()).data.length)throw new RuntimeError("当前工作流版本不存在");return r=e.data[0],n="WFSTART@".concat(r.wfversion),i=new IBizContext({activeForm:r["process-form"]},this.context),o={processDefinitionKey:r.definitionkey},(a=null===(t=this.model.source.findPSAppViewRef(n))||void 0===t?void 0:t.getRefPSAppView())?[3,5]:[4,this.nerve.form.call.wfStart(o)];case 3:return s.sent(),[4,this.closeView()];case 4:return s.sent(),[2];case 5:return[4,ibiz.commands.execute(OpenAppViewCommand.TAG,a,i,o)];case 6:return s.sent().ok?[4,this.closeView()]:[3,8];case 7:s.sent(),s.label=8;case 8:return[2]}}))}))},e.prototype.wfSubmit=function(){return this.nerve.form.call.wfSubmit()},e.prototype.wfWithdraw=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,this.entityService.wf.wfWithdraw(t,__assign(__assign({},e),{taskId:e.taskId||e.srftaskid}),__assign({},r.getRequestData()))];case 1:return n.sent(),[2]}}))}))},e}(MainViewController)),OptViewController=exports("OptViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new OptViewNerve(this)},e.prototype.onOkButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.save()];case 1:return t=e.sent(),[2,this.closeView({ok:!0,data:[t]})]}}))}))},e.prototype.onCancelButtonClick=function(){return this.closeView({ok:!1})},e}(EditViewController)),EditView3Controller=exports("EditView3Controller",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new EditView3State,e.isNewData=!0,e.drPages={},e}return __extends(e,t),e.prototype.createNerve=function(){return new EditView3Nerve(this)},e.prototype.onInit=function(){var e;return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(null===(e=this.model.drTab)||void 0===e?void 0:e.pages.length)&&this.model.drTab.pages.forEach((function(t){r.drPages[t.source.name]={context:r.context,params:r.params,key:createUUID()}})),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.isNewData=e.srfuf===Srfuf.CREATE,this.calcViewParams(e),[2,e]}}))}))},e.prototype.calcViewParams=function(t){var e,r,n,i=this.model.drTab.pages;try{for(var o=__values(i),a=o.next();!a.done;a=o.next()){var s=a.value,c=s.source.name,u=new IBizContext({},this.context),l=s.source.getPSNavigateContexts();notNilEmpty(l)&&(u=Object.assign(u,convertNavData(l,this.context,this.params,t)));var h=s.source.getPSNavigateParams(),d={};notNilEmpty(h)&&(d=convertNavData(h,this.params,this.context,t)),this.nerve.drViews.has(c)&&JSON.stringify(this.drPages[c].context)===JSON.stringify(u)&&JSON.stringify(this.drPages[c].params)===JSON.stringify(d)?null===(n=this.nerve.drViews.get(c))||void 0===n||n.call.refresh():(this.drPages[c].context=u,this.drPages[c].params=d,this.drPages[c].key=createUUID())}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}this.force()},e}(EditViewController)),MDViewController=exports("MDViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new MDViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new MDViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return o.sent(),this.state.showSearchForm=this.model.source.expandSearchForm,this.nerve.self.evt.on("mounted",(function(){i.model.source.loadDefault&&i.load()})),(e=this.model.searchForm)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=o.sent(),o.label=3;case 3:return[2]}}))}))},e.prototype.getData=function(){return this.state.selectedData},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,[]]}))}))},e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.load()];case 1:return t=e.sent(),this.nerve.self.evt.asyncEmit("refreshed",t),[2]}}))}))},e.prototype.openData=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return(r=this.model.source.findPSAppViewLogic("opendata"))?[4,this.executeViewLogic(r,[t],e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},e.prototype.newData=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return(e=this.model.source.findPSAppViewLogic("newdata"))?[4,this.executeViewLogic(e,[{}],t)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.prototype.toggleFilter=function(){this.state.showSearchForm=!this.state.showSearchForm},e.prototype.importData=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},e.prototype.exportData=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},e.prototype.onSearch=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.load()];case 1:return t.sent(),[2]}}))}))},e.prototype.onSelectionChange=function(t){var e;this.state.selectedData=t,this.state.toolbarState&&this.state.toolbarState.update(null===(e=t[0])||void 0===e?void 0:e.getOrigin())},e.prototype.onDataActive=function(t,e){return this.openData(t,e)},e.prototype.onBeforeLoad=function(){var t={query:this.state.query.trim()};if(this.nerve.searchForm){var e=this.nerve.searchForm.call.getParams();Object.assign(t,e)}return t},e.prototype.onAfterSave=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return this.nerve.self.evt.asyncEmit("viewDataChange",{type:e?"CREATE":"UPDATE",data:t,control:r}),[2]}))}))},e.prototype.onAfterRemove=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.nerve.self.evt.asyncEmit("viewDataChange",{type:"REMOVE",data:t,control:e}),[2]}))}))},e}(ViewController)),GridViewController=exports("GridViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new GridViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new GridViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.grid)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.grid.call.load()]}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.remove()];case 1:return t.sent(),[2]}}))}))},e.prototype.newRow=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.newRow()];case 1:return t.sent(),[2]}}))}))},e.prototype.importData=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.importData()];case 1:return t.sent(),[2]}}))}))},e.prototype.exportData=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.nerve.grid.call.exportData(t)];case 1:return e.sent(),[2]}}))}))},e}(MDViewController)),DataViewViewController=exports("DataViewViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new DataViewViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new DataViewViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.dataView)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.dataView.call.load()]}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.dataView.call.remove()];case 1:return t.sent(),[2]}}))}))},e}(MDViewController)),ListViewController=exports("ListViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new ListViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new ListViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.list)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.list.call.load()]}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.list.call.remove()];case 1:return t.sent(),[2]}}))}))},e}(MDViewController)),PickupGridViewController=exports("PickupGridViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new PickupGridViewNerve(this)},e.prototype.onSelectionChange=function(e){t.prototype.onSelectionChange.call(this,e),this.nerve.self.evt.asyncEmit("selectionChange",this.state.selectedData)},e.prototype.selectAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.grid.call.selectAll()]}))}))},e}(GridViewController)),PickupViewController=exports("PickupViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new PickupViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new PickupViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.pickupViewPanel)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.onSelectionChange=function(t){this.nerve.self.evt.asyncEmit("closeView",{ok:!0,data:t})},e}(ViewController)),MPickupViewController=exports("MPickupViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new MPickupViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new MPickupViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),this.params.selectedData&&(this.state.selfSelection=JSON.parse(this.params.selectedData)),[2]}}))}))},e.prototype.onSelectionChange=function(t){this.state.embedSelection=t},e.prototype.selectAll=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.nerve.viewPanel.call.selectAll()];case 1:return(t=e.sent()).length>0&&this.addSelections(t),[2]}}))}))},e.prototype.addSelections=function(t){var e,r=this;if(t.length>0){var n=t.filter((function(t){return!r.state.selfSelection.find((function(e){return e.srfkey===t.srfkey}))}));(e=this.state.selfSelection).push.apply(e,__spreadArray([],__read(n),!1))}},e.prototype.removeSelections=function(t){var e=this;t.length>0&&t.forEach((function(t){var r=e.state.selfSelection.findIndex((function(e){return e.srfkey===t.srfkey}));-1!==r&&e.state.selfSelection.splice(r,1)}))},e.prototype.onOkButtonClick=function(){this.closeView({ok:!0,data:this.state.selfSelection})},e.prototype.onCancelButtonClick=function(){this.closeView({ok:!1,data:[]})},e}(PickupViewController)),WFEditViewController=exports("WFEditViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isEditable=!1,e.isFirstLoaded=!1,e}return __extends(e,t),e.prototype.createNerve=function(){return new WFEditViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[4,this.calcActiveForm()];case 2:return e.sent(),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.isFirstLoaded=!0,[2,e]}}))}))},e.prototype.refresh=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return e=this.activeForm,[4,this.calcActiveForm()];case 1:return r.sent(),e!==this.activeForm?[3,3]:[4,t.prototype.refresh.call(this)];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.calcActiveForm=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,this.entityService.wf.getWFStep(this.params)];case 1:if(t=o.sent(),this.isEditable="true"===t.data.isEditable,e=t.data["process-form"]?"wfform_".concat(t.data["process-form"]):"form",!(r=this.model.forms.get(e.toLowerCase())))throw new RuntimeError("找不到表单".concat(e,"的模型"));return this.activeForm=r,n=this.providers,i=r.name,[4,ibiz.register.control.get(r)];case 2:return n[i]=o.sent(),[2]}}))}))},e.prototype.onFormMounted=function(){this.isFirstLoaded&&this.load()},e}(EditViewController)),WFDynaEditViewController=exports("WFDynaEditViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.wfLinks=[],e}return __extends(e,t),e.prototype.createNerve=function(){return new WFDynaEditViewNerve(this)},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.calcWfToolbar(),[2,e]}}))}))},e.prototype.calcWfToolbar=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.entityService.wf.getWFLink(new IBizContext({taskDefinitionKey:this.params.taskDefinitionKey},this.context),this.getData())];case 1:return t=e.sent(),this.wfLinks=t.data,[2]}}))}))},e.prototype.onLinkClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.type?[2]:[2,this.wfSubmitByLink(t)]}))}))},e.prototype.wfSubmitByLink=function(t){var e;return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return this.isEditable?[4,this.save()]:[3,2];case 1:a.sent(),a.label=2;case 2:return r=new IBizContext({isEditable:this.isEditable,activeForm:t.sequenceFlowForm},this.context),n=__assign({},t),i=t.sequenceFlowView,(o=null===(e=this.model.source.findPSAppViewRef("WFACTION@".concat(i)))||void 0===e?void 0:e.getRefPSAppView())?[3,5]:[4,this.nerve.form.call.wfSubmit(n)];case 3:return a.sent(),[4,this.closeView()];case 4:return a.sent(),[2];case 5:return[4,ibiz.commands.execute(OpenAppViewCommand.TAG,o,r,n)];case 6:return a.sent().ok?[4,this.closeView()]:[3,8];case 7:a.sent(),a.label=8;case 8:return[2]}}))}))},e}(WFEditViewController)),WFDynaEditView3Controller=exports("WFDynaEditView3Controller",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isNewData=!0,e.drPages={},e}return __extends(e,t),e.prototype.createNerve=function(){return new WFDynaEditView3Nerve(this)},e.prototype.onInit=function(){var e;return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(null===(e=this.model.drTab)||void 0===e?void 0:e.pages.length)&&this.model.drTab.pages.forEach((function(t){r.drPages[t.source.name]={context:r.context,params:r.params,key:createUUID()}})),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.isNewData=e.srfuf===Srfuf.CREATE,this.calcViewParams(e),[2,e]}}))}))},e.prototype.calcViewParams=function(t){var e,r,n,i=this.model.drTab.pages;try{for(var o=__values(i),a=o.next();!a.done;a=o.next()){var s=a.value,c=s.source.name,u=new IBizContext({},this.context),l=s.source.getPSNavigateContexts();notNilEmpty(l)&&(u=Object.assign(u,convertNavData(l,this.context,this.params,t)));var h=s.source.getPSNavigateParams(),d={};notNilEmpty(h)&&(d=convertNavData(h,this.params,this.context,t)),this.nerve.drViews.has(c)&&JSON.stringify(this.drPages[c].context)===JSON.stringify(u)&&JSON.stringify(this.drPages[c].params)===JSON.stringify(d)?null===(n=this.nerve.drViews.get(c))||void 0===n||n.call.refresh():(this.drPages[c].context=u,this.drPages[c].params=d,this.drPages[c].key=createUUID())}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}this.force()},e}(WFDynaEditViewController)),WFDynaStartViewController=exports("WFDynaStartViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new WFDynaStartViewNerve(this)},e.prototype.calcActiveForm=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(t=this.context.activeForm?"wfform_".concat(this.context.activeForm):"form",!(e=this.model.forms.get(t.toLowerCase())))throw new RuntimeError("找不到表单".concat(t,"的模型"));return this.activeForm=e,r=this.providers,n=e.name,[4,ibiz.register.control.get(e)];case 1:return r[n]=i.sent(),[2]}}))}))},e.prototype.onOkButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.save()];case 1:return t.sent(),[4,this.nerve.form.call.wfStart()];case 2:return t.sent(),[4,this.closeView({ok:!0,data:this.getData()})];case 3:return t.sent(),[2]}}))}))},e.prototype.onCancelButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.closeView({ok:!1,data:[]})];case 1:return t.sent(),[2]}}))}))},e}(WFEditViewController)),WFDynaActionViewController=exports("WFDynaActionViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new WFDynaActionViewNerve(this)},e.prototype.calcActiveForm=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(t=this.context.activeForm?"wfform_".concat(this.context.activeForm):"form",!(e=this.model.forms.get(t.toLowerCase())))throw new RuntimeError("找不到表单".concat(t,"的模型"));return this.activeForm=e,r=this.providers,n=e.name,[4,ibiz.register.control.get(e)];case 1:return r[n]=i.sent(),[2]}}))}))},e.prototype.onOkButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return this.context.isEditable?[4,this.save()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[4,this.nerve.form.call.wfSubmit()];case 3:return t.sent(),[4,this.closeView({ok:!0,data:this.getData()})];case 4:return t.sent(),[2]}}))}))},e.prototype.onCancelButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.closeView({ok:!1,data:[]})];case 1:return t.sent(),[2]}}))}))},e}(WFEditViewController)),WFStepTraceViewController=exports("WFStepTraceViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:if(r.sent(),!this.deName)throw new RuntimeError("没有接收到deName");return e=this,[4,this.app.es.getService(this.deName)];case 2:return e.entityService=r.sent(),[4,this.getUIData()];case 3:return r.sent(),[2]}}))}))},e.prototype.setDeName=function(t){this.deName=t},e.prototype.getUIData=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return t=new IBizContext(this.params,this.context),[4,this.entityService.wf.getWFHistory(t)];case 1:return(e=r.sent()).data&&(this.data=e.data),[2]}}))}))},e}(ViewController)),AppPortalViewController=exports("AppPortalViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new AppPortalViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.dashboard)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e}(ViewController)),TreeExpViewController=exports("TreeExpViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new TreeExpViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new TreeExpViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.tree)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.tree.call.load()]}))}))},e.prototype.onDataActive=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s,c;return __generator(this,(function(u){switch(u.label){case 0:return e=new IBizContext({},this.context),r=__assign({},this.params),n=this.model.tree.getNodeById(t.nodeId),i=n.navView,o=n.navFilter,a=n.navContexts,s=n.navParams,i?i.initialized?[3,2]:[4,i.init()]:[2];case 1:u.sent(),u.label=2;case 2:return o&&(e[o]=t.value),c=t.deData||{},Object.assign(e,convertNavData(a,this.context,this.params,c)),Object.assign(r,convertNavData(s,this.params,this.context,c)),this.state.navViewParams[t.id]||(this.state.navViewParams[t.id]={modelPath:i.source.modelPath,context:{},params:{}}),this.state.navViewParams[t.id].context=e,this.state.navViewParams[t.id].params=r,this.state.currentNavKey=t.id,this.context.isRouter&&(Object.assign(e,{toRouteLevel:this.modal.level+1,currentRouteContext:t.id}),ibiz.openView.root(i.source,e,r)),[2]}}))}))},e}(MDViewController)),TabExpViewController=exports("TabExpViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tabExpPages={},e}return __extends(e,t),e.prototype.createNerve=function(){return new TabExpViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(e=this.model.tabExpPanel.tabExpPages).length&&e.forEach((function(t){r.tabExpPages[t.name]={key:createUUID()}})),this.nerve.self.evt.on("mounted",(function(){r.model.source.loadDefault&&r.load()})),[2]}}))}))},e}(MainViewController)),GridExpViewController=exports("GridExpViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new GridExpViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new GridExpViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return o.sent(),(e=this.model.gridExpBar)?(r=e.grid)?(n=this.providers,i=r.name,[4,ibiz.register.control.get(r)]):[3,3]:[3,3];case 2:n[i]=o.sent(),o.label=3;case 3:return[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.grid.call.load()]}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.remove()];case 1:return t.sent(),[2]}}))}))},e.prototype.newRow=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.grid.call.newRow()];case 1:return t.sent(),[2]}}))}))},e.prototype.onDataActive=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s,c,u,l,h,d,p,f,v,m;return __generator(this,(function(y){switch(y.label){case 0:return this.state.toolbarState&&this.state.toolbarState.update(null==t?void 0:t.getOrigin()),(e=this.model.gridExpBar.grid)&&e.navView?e.navView.initialized?[3,2]:[4,e.navView.init()]:[3,3];case 1:y.sent(),y.label=2;case 2:r={},n=__assign({},this.params),this.state.navItem.key=t.srfkey,(i=e.navView.appEntity)&&t&&(o=i.deName,Object.assign(r,((f={})["".concat(o)]=t[o],f)),(a=e.source.navFilter)&&Object.assign(n,((v={})[a]=t[o],v)),(s=e.source.getNavPSDER())&&(c="n_".concat((s.codeName&&s.minorCodeName).toLowerCase(),"_eq"),Object.assign(n,((m={})[c]=t[o],m)))),u=e.source.getPSNavigateContexts(),l={},notNilEmpty(u)&&(l=convertNavData(u,r,this.params)),Object.assign(r,l),h=e.source.getPSNavigateParams(),d={},notNilEmpty(h)&&(d=convertNavData(h,n,this.params)),Object.assign(n,d),this.context.isRouter?(Object.assign(r,{toRouteLevel:this.modal.level+1}),p=new IBizContext(r,this.context),this.state.navItem.context=p,this.state.navItem.params=n,ibiz.openView.root(e.navView.source,p,n)):(p=new IBizContext(r,this.context),this.state.navItem.context=p,this.state.navItem.params=n),y.label=3;case 3:return[2]}}))}))},e.prototype.onToolbarClick=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){if(!(r=t.getPSAppViewUIAction()))throw new DefectModelError(t,"没有配置界面行为!");if(n="".concat(r.name,"_click"),!(i=this.model.gridExpBar.source.findPSAppViewLogic(n)))throw new DefectModelError(r,"没有找到对应的视图逻辑");return[2,this.executeViewLogic(i,this.getData(),e)]}))}))},e}(MDViewController)),DashboardViewController=exports("DashboardViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new DashboardViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.dashboard)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e}(MainViewController)),WizardViewController=exports("WizardViewController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new WizardViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return o.sent(),(e=this.model.wizardPanel)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=o.sent(),o.label=3;case 3:return this.nerve.self.evt.on("mounted",(function(){i.initialize()})),[2]}}))}))},e.prototype.initialize=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.wizardPanel.call.initialize()];case 1:return t.sent(),[2]}}))}))},e.prototype.onAfterFinish=function(){this.closeView()},e}(ViewController)),ListExpViewController=exports("ListExpViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new ListExpViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new ListExpViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return o.sent(),(e=this.model.listExpBar)?(r=e.list)?(n=this.providers,i=r.name,[4,ibiz.register.control.get(r)]):[3,3]:[3,3];case 2:n[i]=o.sent(),o.label=3;case 3:return[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.list.call.load()]}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.list.call.remove()];case 1:return t.sent(),[2]}}))}))},e.prototype.onDataActive=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s,c,u,l,h,d,p,f,v,m;return __generator(this,(function(y){switch(y.label){case 0:return this.state.toolbarState&&this.state.toolbarState.update(null==t?void 0:t.getOrigin()),(e=this.model.listExpBar.list)&&e.navView?e.navView.initialized?[3,2]:[4,e.navView.init()]:[3,3];case 1:y.sent(),y.label=2;case 2:r={},n=__assign({},this.params),this.state.navItem.key=t.srfkey,(i=e.navView.appEntity)&&t&&(o=i.deName,Object.assign(r,((f={})["".concat(o)]=t[o],f)),(a=e.source.navFilter)&&Object.assign(n,((v={})[a]=t[o],v)),(s=e.source.getNavPSDER())&&(c="n_".concat((s.codeName&&s.minorCodeName).toLowerCase(),"_eq"),Object.assign(n,((m={})[c]=t[o],m)))),u=e.source.getPSNavigateContexts(),l={},notNilEmpty(u)&&(l=convertNavData(u,r,this.params)),Object.assign(r,l),h=e.source.getPSNavigateParams(),d={},notNilEmpty(h)&&(d=convertNavData(h,n,this.params)),Object.assign(n,d),this.context.isRouter?(Object.assign(r,{toRouteLevel:this.modal.level+1}),p=new IBizContext(r,this.context),this.state.navItem.context=p,this.state.navItem.params=n,ibiz.openView.root(e.navView.source,p,n)):(p=new IBizContext(r,this.context),this.state.navItem.context=p,this.state.navItem.params=n),y.label=3;case 3:return[2]}}))}))},e.prototype.onToolbarClick=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){if(!(r=t.getPSAppViewUIAction()))throw new DefectModelError(t,"没有配置界面行为!");if(n="".concat(r.name,"_click"),!(i=this.model.listExpBar.source.findPSAppViewLogic(n)))throw new DefectModelError(r,"没有找到对应的视图逻辑");return[2,this.executeViewLogic(i,this.getData(),e)]}))}))},e}(MDViewController)),KanbanViewController=exports("KanbanViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new KanbanViewState,e}return __extends(e,t),e.prototype.createNerve=function(){return new KanbanViewNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),(e=this.model.kanban)?(r=this.providers,n=e.name,[4,ibiz.register.control.get(e)]):[3,3];case 2:r[n]=i.sent(),i.label=3;case 3:return[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.kanban.call.load()]}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.kanban.call.remove()];case 1:return t.sent(),[2]}}))}))},e}(MDViewController)),ControlController=exports("ControlController",function(){function t(t,e,r){void 0===r&&(r={}),this.state=new ControlState,this.complete=!1,this.model=t,this.context=e,this.params=r,this.nerve=this.createNerve(),this.app=ibiz.hub.getApp(t.modelService.app)}return t.prototype.createNerve=function(){return new ControlNerve(this)},t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.onInit()];case 1:return e.sent(),this.state.complete=!0,this.nerve.created(),this.force((function(){t.nerve.mounted()})),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.emit("neuronInit",this.nerve.self),[2]}))}))},t.prototype.force=function(t){},t.prototype.emit=function(t){},t.prototype.destroy=function(){this.nerve.destroy()},t.prototype.startLoading=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.nerve.self.evt.emit("beginViewLoading"),[2]}))}))},t.prototype.endLoading=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.nerve.self.evt.emit("endViewLoading"),[2]}))}))},t}()),AppMenuController=exports("AppMenuController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new AppMenuState,e.menuItemsState={},e}return __extends(e,t),e.prototype.createNerve=function(){return new AppMenuNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){return t.prototype.onInit.call(this),this.model.items.forEach((function(t){e.initMenuItemState(t)})),[2]}))}))},e.prototype.onClickMenuItem=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return e=this.model.findMenuItemModelById(t),[4,ibiz.model.getAppFunc(e)];case 1:if(!(r=n.sent()))throw new DefectModelError(e.source,"未配置界面行为");return[4,ibiz.commands.execute(AppFuncCommand.TAG,r)];case 2:return n.sent(),[2]}}))}))},e.prototype.initMenuItemState=function(t){var e,r=this,n=ibiz.hub.getApp(t).authority.hasMenuPermitted(t),i=n;if(null===(e=t.children)||void 0===e?void 0:e.length){var o=t.children.map((function(t){return r.initMenuItemState(t).visible}));i=i&&o.includes(!0)}var a={permitted:n,visible:i};return this.state.menuItemsState[t.source.id]=a,a},e}(ControlController)),MainController=exports("MainController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(ControlController)),FormController=exports("FormController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new FormState,e.details={},e.providers={},e.formItems=[],e}return __extends(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.state.data},enumerable:!1,configurable:!0}),e.prototype.dataChangeNotify=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,Promise.allSettled(Object.values(this.details).map((function(e){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(r){return[2,e.dataChangeNotify(t)]}))}))})))];case 1:if((e=n.sent()).find((function(t){return"rejected"===t.status})))throw ibiz.log.error("dataChangeNotify报错",e),new RuntimeError("数据变更后有错误");return[2]}}))}))},e.prototype.formStateNotify=function(t){Object.values(this.details).forEach((function(e){e.formStateNotify(t)}))},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[4,this.initDetailControllers()];case 2:return e.sent(),this.details=__assign({},this.details),this.providers=__assign({},this.providers),this.dataChangeNotify=debounceAndAsyncMerge(this.dataChangeNotify.bind(this),(function(t,e){return[Array.from(new Set(__spreadArray(__spreadArray([],__read(t[0]),!1),__read(e[0]),!1)))]}),200),[2]}}))}))},e.prototype.initDetailControllers=function(t,e,r){return void 0===t&&(t=this.model.children),void 0===e&&(e=this),void 0===r&&(r=void 0),__awaiter(this,void 0,void 0,(function(){var n,i=this;return __generator(this,(function(o){switch(o.label){case 0:if(!(n=ibiz.register.formDetail))throw new RuntimeError("formDetail注册器不存在");return[4,Promise.all(t.map((function(t){return __awaiter(i,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return[4,n.get(t)];case 1:if(!(i=s.sent()))throw new RuntimeError("找不到对应的适配器");return e.providers[t.source.name]=i,[4,i.createController(t,e,r)];case 2:return o=s.sent(),e.details[t.source.name]=o,"FORMITEM"===t.detailType&&e.formItems.push(o),(null===(a=t.children)||void 0===a?void 0:a.length)?[4,this.initDetailControllers(t.children,e,o)]:[3,4];case 3:s.sent(),s.label=4;case 4:return[2]}}))}))})))];case 1:return o.sent(),[2]}}))}))},e.prototype.getData=function(){return[this.state.data]},e.prototype.setDataValue=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:if(Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e)return[2];this.state.data[t]=e,this.state.processing=!0,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.dataChangeNotify([t])];case 2:return r.sent(),[3,4];case 3:return this.state.processing=!1,[7];case 4:return this.force(),[2]}}))}))},e.prototype.validate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,Promise.all(this.formItems.map((function(t){return t.validate()})))];case 1:return[2,-1===t.sent().findIndex((function(t){return!t}))]}}))}))},e}(MainController)),EditFormController=exports("EditFormController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new EditFormState,e.isNewData=!1,e}return __extends(e,t),e.prototype.createNerve=function(){return new EditFormNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),this.service=new EditFormService(this.model),[4,this.service.init(this.context)];case 2:return e.sent(),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return this.isNewData=!this.context[this.model.appEntity.deName],[4,this.startLoading()];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,,7,9]),this.isNewData?[4,this.service.getDraft(this.context,this.params)]:[3,4];case 3:return e=r.sent(),[3,6];case 4:return[4,this.service.get(this.context,this.params)];case 5:e=r.sent(),r.label=6;case 6:return t=e,[3,9];case 7:return[4,this.endLoading()];case 8:return r.sent(),[7];case 9:return t.data.reactiveInit(),this.state.data=t.data,this.formStateNotify(this.isNewData?FormNotifyState.DRAFT:FormNotifyState.LOAD),this.state.isLoaded=!0,this.force(),[2,this.data]}}))}))},e.prototype.save=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return this.state.processing?[4,awaitTimeout(500,this.save.bind(this))]:[3,2];case 1:return[2,r.sent()];case 2:return[4,this.validate()];case 3:if(!r.sent())throw new RuntimeError("请检查表单填写!");return[4,this.startLoading()];case 4:r.sent(),r.label=5;case 5:return r.trys.push([5,,10,12]),this.isNewData?[4,this.service.create(this.context,this.data)]:[3,7];case 6:return e=r.sent(),[3,9];case 7:return[4,this.service.update(this.context,this.data)];case 8:e=r.sent(),r.label=9;case 9:return t=e,[3,12];case 10:return[4,this.endLoading()];case 11:return r.sent(),[7];case 12:return t.data&&this.data.mergeOrigin(t.data),[4,this.nerve.self.evt.asyncEmit("afterSave",this.isNewData,this.data)];case 13:return r.sent(),this.isNewData=!1,this.formStateNotify(FormNotifyState.SAVE),ibiz.message.success("".concat(this.data.srfmajortext||"","保存成功")),this.force(),[2,this.data]}}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return this.isNewData?[3,6]:[4,this.startLoading()];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,,4,6]),[4,this.service.remove(this.context,this.params)];case 3:return t.sent(),[3,6];case 4:return[4,this.endLoading()];case 5:return t.sent(),[7];case 6:return[4,this.nerve.self.evt.asyncEmit("afterRemove",this.data)];case 7:return t.sent(),this.state.data=new ControlVO,this.force(),[2]}}))}))},e.prototype.goBack=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.startLoading()];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,,4,6]),[4,this.service.goBack(this.context,this.data)];case 3:return t=e.sent(),[3,6];case 4:return[4,this.endLoading()];case 5:return e.sent(),[7];case 6:return t.data&&this.data.mergeOrigin(t.data),this.force(),[2]}}))}))},e.prototype.updateFormItem=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,c,u;return __generator(this,(function(l){switch(l.label){case 0:return r=__assign(__assign({},this.params),this.data.getRequestData()),[4,this.service.updateFormItem(t,this.context,r)];case 1:if(n=l.sent(),(i=n.data)&&(null==e?void 0:e.length))try{for(o=__values(e),a=o.next();!a.done;a=o.next())s=a.value,this.setDataValue(s,i[s])}catch(t){c={error:t}}finally{try{a&&!a.done&&(u=o.return)&&u.call(o)}finally{if(c)throw c.error}}return[2]}}))}))},e.prototype.wfStart=function(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.validate()];case 1:if(!e.sent())throw new RuntimeError("请检查表单填写!");return[4,this.startLoading()];case 2:e.sent(),e.label=3;case 3:return e.trys.push([3,,5,7]),[4,this.service.wfStart(this.context,__assign(__assign({},this.params),t),this.data)];case 4:return e.sent(),[3,7];case 5:return[4,this.endLoading()];case 6:return e.sent(),[7];case 7:return ibiz.message.success("流程启动成功"),[2]}}))}))},e.prototype.wfSubmit=function(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.validate()];case 1:if(!e.sent())throw new RuntimeError("请检查表单填写!");return[4,this.startLoading()];case 2:e.sent(),e.label=3;case 3:return e.trys.push([3,,5,7]),[4,this.service.wfSubmit(this.context,__assign(__assign({},this.params),t),this.data)];case 4:return e.sent(),[3,7];case 5:return[4,this.endLoading()];case 6:return e.sent(),[7];case 7:return ibiz.message.success("流程提交成功"),[2]}}))}))},e}(FormController)),SearchFormController=exports("SearchFormController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new SearchFormState,e}return __extends(e,t),e.prototype.createNerve=function(){return new SearchFormNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),this.service=new SearchFormService(this.model),[4,this.service.init(this.context)];case 2:return e.sent(),[4,this.load()];case 3:return e.sent(),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.service.getDraft(this.context,this.params)];case 1:return t=e.sent(),this.state.data=t.data,this.state.isLoaded=!0,this.formStateNotify(FormNotifyState.DRAFT),this.force(),[2,this.data]}}))}))},e.prototype.getParams=function(){return __assign({},this.data.getRequestData())},e.prototype.onSearchButtonClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.nerve.self.evt.asyncEmit("search")];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.load()];case 1:return t.sent(),[4,this.nerve.self.evt.asyncEmit("search")];case 2:return t.sent(),[2]}}))}))},e.prototype.dataChangeNotify=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.dataChangeNotify.call(this,e)];case 1:return r.sent(),this.model.source.enableAutoSearch&&this.nerve.self.evt.asyncEmit("search"),[2]}}))}))},e.prototype.onKeyUp=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return(e=t||window.event)&&"Enter"===e.code?[4,this.onSearchButtonClick()]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e}(FormController)),FormDetailController=exports("FormDetailController",function(){function t(t,e,r){this.model=t,this.form=e,this.parent=r,this.state=this.createState()}return t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n,i,o=this;return __generator(this,(function(a){return t=this.model,e=t.width,r=t.height,n=t.sysCssName,i=t.detailType,e&&(this.state.layoutController.width=e),r&&(this.state.layoutController.height=r),this.state.layoutController.extraClass="ibiz-form-col__".concat(i.toLowerCase()," "),n&&(this.state.layoutController.extraClass=n),Object.defineProperty(this.state.layoutController,"visible",{configurable:!0,enumerable:!0,get:function(){return o.state.visible}}),this.model.source.getPSLayoutPos()&&(this.state.layoutController.contentStyle=calcLayoutContentStyle(this.model.source.getPSLayoutPos())),[2]}))}))},t.prototype.createState=function(){var t;return new FormDetailState(null===(t=this.parent)||void 0===t?void 0:t.state)},t.prototype.dataChangeNotify=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.calcDynamicLogic(t),[2]}))}))},t.prototype.formStateNotify=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.calcDynamicLogic([],t),[2]}))}))},t.prototype.calcDynamicLogic=function(t,e){var r,n=this;this.parent&&!this.parent.state.visible||null===(r=this.model.source.getPSDEFDGroupLogics())||void 0===r||r.forEach((function(r){var i=r.getRelatedDetailNames()||[];if(e||isOverlap(i,t))try{var o=verifyFormGroupLogic(n.form.data,r);switch(r.logicCat){case"ITEMBLANK":n.state.required=!o;break;case"ITEMENABLE":n.state.disabled=!o;break;case"PANELVISIBLE":n.state.visible=o}}catch(t){ibiz.log.error(t)}}))},t.prototype.force=function(t){},t}()),FormContainerController=exports("FormContainerController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormContainerState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormDetailController)),FormGroupPanelController=exports("FormGroupPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormGroupPanelState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormContainerController)),FormPageController=exports("FormPageController",function(t){function e(e,r){return t.call(this,e,r)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormPageState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormContainerController)),FormTabPageController=exports("FormTabPageController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormTabPageState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormContainerController)),FormTabPanelController=exports("FormTabPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormTabPanelState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormDetailController)),FormItemController=exports("FormItemController",function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.editor=null,i.rules=[],i.context=r.context,i.params=r.params,i}return __extends(e,t),e.prototype.createState=function(){var t;return new FormItemState(null===(t=this.parent)||void 0===t?void 0:t.state)},Object.defineProperty(e.prototype,"name",{get:function(){return this.model.source.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.form.data[this.name]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.form.data},enumerable:!1,configurable:!0}),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),this.state.required=!this.model.source.allowEmpty,this.model.editor&&"HIDDEN"!==this.model.editor.editorType?(e=this,[4,ibiz.register.editor.get(this.model.editor)]):[3,6];case 2:return e.editorProvider=n.sent(),this.editorProvider?(r=this,[4,this.editorProvider.createController(this.model.editor,this)]):[3,6];case 3:return r.editor=n.sent(),[4,this.editor.init()];case 4:return n.sent(),[4,this.initRules()];case 5:n.sent(),n.label=6;case 6:return[2]}}))}))},e.prototype.initRules=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){return(t=this.form.model.formItemVRs.get(this.name))?(this.rules=generateRules(t,this.name,this.model.source.valueItemName),this.validator=new Schema(((e={})[this.name]=this.rules,e)),[2]):[2]}))}))},e.prototype.calcEnableCond=function(){var t=this.model.source.enableCond,e=this.data.srfuf===Srfuf.CREATE;(0===t||e&&2===t||!e&&1===t)&&(this.state.enableCondDisabled=!0)},e.prototype.dataChangeNotify=function(e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return[4,t.prototype.dataChangeNotify.call(this,e)];case 1:return s.sent(),r=this.model.resetItemName,n=this.model.source.valueItemName,e.includes(r)&&this.setDataValue(null,this.name),(e.includes(this.name)||e.includes(n))&&this.validate(),e.includes(this.name)&&this.model.formItemUpdate?(i=this.model.formItemUpdate,o=i.methodName,a=i.itemNames,[4,this.form.updateFormItem(o,a)]):[3,3];case 2:s.sent(),s.label=3;case 3:return[2]}}))}))},e.prototype.formStateNotify=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return t.prototype.formStateNotify.call(this,e),this.calcEnableCond(),e!==FormNotifyState.DRAFT&&e!==FormNotifyState.LOAD||this.setDefaultValue(e===FormNotifyState.DRAFT),[2]}))}))},e.prototype.calcDynamicLogic=function(e,r){this.model.source.hidden||t.prototype.calcDynamicLogic.call(this,e,r)},e.prototype.validate=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:if(!this.state.visible)return this.state.error=null,[2,!0];if(this.state.required&&isNilOrEmpty(this.data[this.name]))return this.state.error="请填写".concat(this.model.source.caption),[2,!1];if(!this.validator)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.validator.validate(this.data)];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),e=t.errors,t._fields,this.state.error=e[0].message,[2,!1];case 4:return this.state.error=null,[2,!0]}}))}))},e.prototype.setDataValue=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return e=e||this.name,[4,this.form.setDataValue(e,t)];case 1:return r.sent(),[2]}}))}))},e.prototype.setDefaultValue=function(t){var e=this.model.source,r=e.createDVT,n=e.createDV,i=e.updateDVT,o=e.updateDV,a=t?r:i,s=t?n:o;if("RESET"!==a){if(!(this.value||isNilOrEmpty(a)&&isNilOrEmpty(s)))if(a||!s)switch(a){case"APPDATA":Object.prototype.hasOwnProperty.call(this.context,s)&&(this.data[this.name]=this.context[s]),Object.prototype.hasOwnProperty.call(this.params,s)&&(this.data[this.name]=this.params[s]);break;case"OPERATORNAME":this.data[this.name]=this.context.srfusername;break;case"OPERATOR":this.data[this.name]=this.context.srfuserid;break;case"CURTIME":this.data[this.name]=dayjs().format(this.model.valueFormat);break;case"PARAM":this.data[this.name]=this.data[s];break;default:ibiz.message.error("[".concat(a,"]类型默认值未支持"))}else this.data[this.name]=s}else this.data[this.name]=null},e}(FormDetailController)),FormButtonController=exports("FormButtonController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormButtonState(null===(t=this.parent)||void 0===t?void 0:t.state)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),e=this.form.model.source.name.toLowerCase(),r=this.model.source.codeName.toLowerCase(),n="".concat(e,"_").concat(r,"_click"),this.viewLogic=this.form.model.source.findPSAppViewLogic(n)||void 0,[2]}}))}))},e.prototype.onClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return"UIACTION"===this.model.source.actionType?[2,this.doUIAction(t)]:[2,this.doFormItemUpdate()]}))}))},e.prototype.doUIAction=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!this.viewLogic)throw new RuntimeError("没有找到按钮对应的视图逻辑");return[4,this.form.nerve.self.evt.asyncEmit("actionClick",this.viewLogic,[this.form.data],t)];case 1:return e.sent(),[2]}}))}))},e.prototype.doFormItemUpdate=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r;return __generator(this,(function(n){switch(n.label){case 0:if(!this.model.formItemUpdate)throw new RuntimeError("不存在表单项更新");return t=this.model.formItemUpdate,e=t.methodName,r=t.itemNames,[4,this.form.updateFormItem(e,r)];case 1:return n.sent(),[2]}}))}))},e}(FormDetailController)),FormRawItemController=exports("FormRawItemController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormRawItemState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(FormDetailController)),FormDRUIPartController=exports("FormDRUIPartController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new FormDruipartState(null===(t=this.parent)||void 0===t?void 0:t.state)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),Object.assign(this.state.layoutController.extraStyle,{overflow:"auto"}),[2]}}))}))},e.prototype.dataChangeNotify=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.dataChangeNotify.call(this,e)];case 1:return r.sent(),isOverlap(this.model.refreshItems,e)&&this.calcViewParams(),[2]}}))}))},e.prototype.formStateNotify=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.formStateNotify.call(this,e)];case 1:return r.sent(),this.calcViewParams(),[2]}}))}))},e.prototype.calcViewParams=function(){var t=new IBizContext({},this.form.context),e=this.model.source.getPSNavigateContexts();notNilEmpty(e)&&(t=Object.assign(t,convertNavData(e,this.form.context,this.form.params,this.form.data)));var r=this.model.source.getPSNavigateParams(),n={};notNilEmpty(r)&&(n=convertNavData(r,this.form.params,this.form.context,this.form.data)),this.neuron&&this.state.context&&JSON.stringify(this.state.context)===JSON.stringify(t)&&JSON.stringify(this.state.params)===JSON.stringify(n)?this.refresh():this.refresh(!0),this.state.context=t,this.state.params=n,this.force()},e.prototype.refresh=function(t){void 0===t&&(t=!1),t?this.state.viewComponentKey=createUUID():this.neuron.call.refresh()},e.prototype.setViewNeuron=function(t){var e=this;this.neuron=t,this.neuron.evt.on("refreshed",(function(t){if(ibiz.log.debug("接收到关系界面的刷新变更事件",t),e.model.formItemUpdate){var r=e.model.formItemUpdate,n=r.methodName,i=r.itemNames;e.form.updateFormItem(n,i)}}))},e}(FormDetailController)),MDItemController=function(){function t(t,e){this.data=t}return t.prototype.destroy=function(){this.data=void 0},t}(),MDController=exports("MDController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new MDState,e.singleSelect=!1,e.isSelectFirstDefault=!1,e.defaultSelectKeys=[],e.isExpView=!1,e.mdCtrlActiveMode=2,e}return __extends(e,t),e.prototype.createNerve=function(){return new MDControlNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[2]}}))}))},e.prototype.setIsSelectFirstDefault=function(t){"boolean"==typeof t&&(this.isSelectFirstDefault=t)},e.prototype.setDefaultSelectKeys=function(t){t&&(this.defaultSelectKeys=t)},e.prototype.setMdCtrlActiveMode=function(t){this.mdCtrlActiveMode=void 0===t?2:t},e.prototype.setIsExpView=function(t){"boolean"==typeof t&&(this.isExpView=t)},e.prototype.getParams=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.nerve.self.evt.asyncEmit("beforeLoad")];case 1:return t=r.sent(),e=t.length>0?t.reduce((function(t,e){return Object.assign(t,e)})):{},[2,__assign(__assign(__assign({},this.params),e),{page:this.state.curPage-1,size:this.state.size})]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.getParams()];case 1:return t=n.sent(),[4,this.startLoading()];case 2:n.sent(),n.label=3;case 3:return n.trys.push([3,,5,7]),[4,this.service.fetch(this.context,t)];case 4:return e=n.sent(),[3,7];case 5:return[4,this.endLoading()];case 6:return n.sent(),[7];case 7:return e.total&&(this.state.total=e.total),e.data.forEach((function(t){t.reactiveInit()})),[4,this.afterLoad(e.data)];case 8:return n.sent(),r=!1===this.state.hasLoaded,this.state.hasLoaded=!0,[4,this.nerve.self.evt.asyncEmit("afterLoad",this.state.items,r)];case 9:return n.sent(),this.force(),[2,this.state.items]}}))}))},e.prototype.afterLoad=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r=this;return __generator(this,(function(n){switch(n.label){case 0:return this.state.items=t,!this.state.hasLoaded&&this.isSelectFirstDefault&&this.state.items[0]?0!==this.defaultSelectKeys.length?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",this.state.items[0])]:[3,4];case 1:return n.sent(),[3,4];case 2:return this.defaultSelectKeys.length>0?(e=0,this.state.items.forEach((function(t,n){for(var i=0;i<r.defaultSelectKeys.length;i++){if(r.defaultSelectKeys[i]===t.srfkey){e=n;break}}})),[4,this.nerve.self.evt.asyncEmit("dataActive",this.state.items[e])]):[3,4];case 3:n.sent(),n.label=4;case 4:return[2,this.state.items]}}))}))},e.prototype.remove=function(){return __awaiter(this,void 0,void 0,(function(){var t,e=this;return __generator(this,(function(r){switch(r.label){case 0:if(0===(t=this.state.selectedData).length)throw new RuntimeError("未选中数据");return[4,this.startLoading()];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,,4,6]),[4,Promise.allSettled(t.map((function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return t.srfuf===Srfuf.CREATE?[3,2]:[4,this.service.remove(__assign((e={},e[this.model.appEntity.deName]=t.srfkey,e),this.context),this.params)];case 1:r.sent(),r.label=2;case 2:return this.afterRemove(t),[2]}}))}))})))];case 3:return r.sent(),[3,6];case 4:return[4,this.endLoading()];case 5:return r.sent(),[7];case 6:return this.state.selectedData=[],this.isExpView?[4,this.nerve.self.evt.asyncEmit("dataActive",this.state.items[0])]:[3,8];case 7:r.sent(),r.label=8;case 8:return[4,this.nerve.self.evt.asyncEmit("afterRemove",t)];case 9:return r.sent(),this.force(),[2]}}))}))},e.prototype.afterRemove=function(t){var e=this.state.items.findIndex((function(e){return e.srfkey===t.srfkey}));this.state.items.splice(e,1)},e.prototype.getData=function(){return this.state.selectedData||[]},e.prototype.selectAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.state.selectedData=__spreadArray([],__read(this.state.items),!1),this.nerve.self.evt.emit("selectionChange",this.state.selectedData),[2,this.state.selectedData]}))}))},e.prototype.onSelectionChange=function(t){this.state.selectedData=t,this.nerve.self.evt.emit("selectionChange",t)},e.prototype.importData=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t=this.model,e=t.appEntity,r=t.dataImport,n="".concat(e.deNamePlural,"/importtemplate"),i="".concat(e.deNamePlural,"/importdata2"),r&&(n+="?srfimporttag=".concat(r.codeName),i+="?srfimporttag=".concat(r.codeName)),(o=ibiz.overlay.createModal("DataImport",{dismiss:function(){return o.dismiss()},templateUrl:n,importUrl:i},{width:"auto",placement:"center"})).present(),[4,o.onWillDismiss()];case 1:return a.sent(),[2]}}))}))},e.prototype.exportData=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s,c;return __generator(this,(function(u){switch(u.label){case 0:if(e=this.model,r=e.dataExport,n=e.appEntity,!r)throw new DefectModelError(this.model.source,"没有配置实体导出模型!");if(!r.enableBackend)throw new UnsupportedModelError(r,"前台导出暂未支持!");return(i=ibiz.overlay.createPopover("DataExport",{dismiss:function(t){return i.dismiss(t)},maxRowCount:r.maxRowCount||1e3,pageSize:this.state.size},{autoClose:!0,placement:"bottom-end"})).present(t.target),[4,i.onWillDismiss()];case 1:return(o=u.sent())?[4,this.getParams()]:[2];case 2:return a=u.sent(),Object.assign(a,o),[4,this.service.exportData(r,this.context,a)];case 3:return s=u.sent().data,c="".concat(n.source.logicName,"表.xlsx"),downloadFileFromBlob(s,c),[2]}}))}))},e}(MainController)),GridController=exports("GridController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new GridState,e.columns={},e.fieldColumns={},e.uaColumns={},e.editItems={},e.providers={},e.rows=[],e.hasWidthFlexGrow=!1,e}return __extends(e,t),Object.defineProperty(e.prototype,"noSort",{get:function(){return this.model.source.noSort},enumerable:!1,configurable:!0}),e.prototype.createNerve=function(){return new GridNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return r.sent(),this.state.size=this.model.size,this.state.singleSelect=this.model.source.singleSelect,this.service=new GridService(this.model),[4,this.service.init(this.context)];case 2:return r.sent(),this.hasWidthFlexGrow=!!this.model.columns.find((function(t){return t.widthFlexGrow})),[4,this.initGridColumns()];case 3:return r.sent(),this.dataChangeNotify=debounceAndAsyncMerge(this.dataChangeNotify.bind(this),(function(t,e){return[t[0],Array.from(new Set(__spreadArray(__spreadArray([],__read(t[1]),!1),__read(e[1]),!1)))]}),200),this.nerve.self.evt.on("beforeLoad",(function(){return e.sortQuery?{sort:e.sortQuery}:{}})),this.setSort(),[2]}}))}))},e.prototype.afterLoad=function(e){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.afterLoad.call(this,e)];case 1:return n.sent(),[4,Promise.allSettled(Object.values(this.fieldColumns).map((function(t){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.loadCodeList()];case 1:return e.sent(),[2]}}))}))})))];case 2:return n.sent(),this.state.rows=e.map((function(t){var e=new GridRowController(t,r);return r.gridStateNotify(e,GridNotifyState.LOAD),e})),[2,e]}}))}))},e.prototype.afterRemove=function(e){t.prototype.afterRemove.call(this,e);var r=this.state.rows.findIndex((function(t){return t.data.srfkey===e.srfkey}));this.state.rows[r].destroy(),this.state.rows.splice(r,1)},e.prototype.newRow=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.service.getDraft(this.context,this.params)];case 1:return t=r.sent(),this.state.items.unshift(t.data),e=new GridRowController(t.data,this),this.state.rows.unshift(e),this.gridStateNotify(e,GridNotifyState.DRAFT),[2]}}))}))},e.prototype.save=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(!(e=this.state.rows.find((function(e){return e.data.srfkey===t.srfkey}))))throw new RuntimeError("行数据不存在");return e.modified?e.processing?[4,awaitTimeout(500,this.save.bind(this),[t])]:[3,2]:(ibiz.log.debug("值没有发生改变"),[2]);case 1:c.sent(),c.label=2;case 2:return[4,this.validate(e)];case 3:if(!c.sent())throw new RuntimeError("行数据校验不通过,保存取消");return[4,this.startLoading()];case 4:c.sent(),n=t.srfuf===Srfuf.CREATE,c.label=5;case 5:return c.trys.push([5,,10,12]),n?[4,this.service.create(__assign((a={},a[this.model.appEntity.deName]=t.srfkey,a),this.context),t)]:[3,7];case 6:return i=c.sent(),[3,9];case 7:return[4,this.service.update(__assign((s={},s[this.model.appEntity.deName]=t.srfkey,s),this.context),t)];case 8:i=c.sent(),c.label=9;case 9:return r=i,[3,12];case 10:return[4,this.endLoading()];case 11:return c.sent(),[7];case 12:return o=this.state.items.findIndex((function(e){return e.srfkey===t.srfkey})),this.state.items.splice(o,1,r.data),e.data=r.data,e.modified=!1,ibiz.message.success("".concat(r.data.srfmajortext||"","保存成功")),this.gridStateNotify(e,GridNotifyState.SAVE),[4,this.nerve.self.evt.asyncEmit("afterSave",[r.data],n)];case 13:return c.sent(),[2]}}))}))},e.prototype.onRowClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 1!==this.mdCtrlActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.onDbRowClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 2!==this.mdCtrlActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.initGridColumns=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){switch(e.label){case 0:return[4,Promise.all(this.model.columns.map((function(e){return __awaiter(t,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,ibiz.register.gridColumn.get(e)];case 1:return t=n.sent(),this.providers[e.codeName]=t,[4,t.createController(e,this)];case 2:return r=n.sent(),this.columns[e.codeName]=r,"DEFGRIDCOLUMN"===e.source.columnType?this.fieldColumns[e.codeName]=r:"UAGRIDCOLUMN"===e.source.columnType&&(this.uaColumns[e.codeName]=r),[2]}}))}))})))];case 1:return e.sent(),[4,Promise.all(this.model.editItems.map((function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){return this.editItems[e.codeName]?[2]:(t=new GridEditItemController(e,this),this.editItems[e.codeName]=t,[2,t.init()])}))}))})))];case 2:return e.sent(),[2]}}))}))},e.prototype.setRowValue=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:if(Object.prototype.hasOwnProperty.call(t.data,e)&&t.data[e]===r)return[2];t.data[e]=r,t.modified=!0,t.processing=!0,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.dataChangeNotify(t,[e])];case 2:return n.sent(),[3,4];case 3:return t.processing=!1,[7];case 4:return this.force(),[2]}}))}))},e.prototype.dataChangeNotify=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return[4,Promise.allSettled(Object.values(this.editItems).map((function(r){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r.dataChangeNotify(t,e)]}))}))})))];case 1:if((r=i.sent()).find((function(t){return"rejected"===t.status})))throw ibiz.log.error("dataChangeNotify报错",r),new RuntimeError("数据变更后有错误");return[2]}}))}))},e.prototype.gridStateNotify=function(t,e){Object.values(this.editItems).forEach((function(r){r.gridStateNotify(t,e)}))},e.prototype.validate=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,Promise.all(Object.values(this.editItems).map((function(e){return e.validate(t)})))];case 1:return[2,-1===e.sent().findIndex((function(t){return!t}))]}}))}))},e.prototype.toggleRowEdit=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return!0!==t.showRowEdit?[3,2]:[4,this.save(t.data)];case 1:e.sent(),e.label=2;case 2:return t.showRowEdit=!t.showRowEdit,[2]}}))}))},e.prototype.setSort=function(t,e){if(t&&e)this.sortQuery="".concat(t,",").concat(e);else{var r=this.model,n=r.defaultSortField,i=r.defaultSortDir;this.sortQuery=n&&i?"".concat(n,",").concat(i):void 0}},e.prototype.updateGridEditItem=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n,i,o,a=this;return __generator(this,(function(s){switch(s.label){case 0:return n=__assign(__assign({},this.params),t.data.getRequestData()),[4,this.service.updateGridEditItem(e,this.context,n)];case 1:return i=s.sent(),(o=i.data)&&(null==r?void 0:r.length)?[4,Promise.all(r.map((function(e){return a.setRowValue(t,e,o[e])})))]:[3,3];case 2:s.sent(),s.label=3;case 3:return[2]}}))}))},e}(MDController)),GridColumnController=exports("GridColumnController",function(){function t(t,e){this.model=t,this.grid=e,this.app=ibiz.hub.getApp(t.modelService.app)}return Object.defineProperty(t.prototype,"context",{get:function(){return this.grid.context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"params",{get:function(){return this.grid.params},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableRowEdit",{get:function(){return this.grid.model.source.enableRowEdit&&this.model.source.enableRowEdit},enumerable:!1,configurable:!0}),t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2]}))}))},t}()),GridFieldColumnController=exports("GridFieldColumnController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"isLinkColumn",{get:function(){return this.model.source.enableLinkView&&!!this.model.linkView},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasAction",{get:function(){return!!this.model.source.getPSDEUIAction()},enumerable:!1,configurable:!0}),e.prototype.clickable=function(t){var e=t.data[this.model.codeName];return(this.isLinkColumn||this.hasAction)&&e},e.prototype.openLinkView=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o,a,s,c;return __generator(this,(function(u){switch(u.label){case 0:if(!t.data[this.model.codeName])return[2];if(r=this.model.source.linkValueItem||"srfkey",!(n=t.data[r]))throw new RuntimeError("链接值项取不到值");return(i=this.model.linkView)?i.initialized?[3,2]:[4,i.init()]:[2];case 1:u.sent(),u.label=2;case 2:return o=i.appEntity.deName,a=new IBizContext(((c={})[o]=n,c),this.context),s=clone(this.params),[4,ibiz.commands.execute(OpenAppViewCommand.TAG,i.source,a,s,{event:e})];case 3:return u.sent(),[2]}}))}))},e.prototype.triggerAction=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return this.model.viewLogic?[4,this.grid.nerve.self.evt.asyncEmit("actionClick",this.model.viewLogic,[t.data],e)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}}))}))},e.prototype.loadCodeList=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return(t=this.model.source.getPSAppCodeList())?[4,this.app.codeList.get(t.codeName,this.context,this.params)]:[2];case 1:return e=r.sent(),this.codeListItems=e,[2,e]}}))}))},e}(GridColumnController)),GridEditItemController=exports("GridEditItemController",function(){function t(t,e){this.title="",this.rules=[],this.model=t,this.grid=e}return Object.defineProperty(t.prototype,"context",{get:function(){return this.grid.context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"params",{get:function(){return this.grid.params},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"required",{get:function(){return!this.model.source.allowEmpty},enumerable:!1,configurable:!0}),t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){var t;return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return this.title=(null===(t=this.model.gridFieldColumn)||void 0===t?void 0:t.title)||"",this.model.editor&&"HIDDEN"!==this.model.editor.editorType?(e=this,[4,ibiz.register.editor.get(this.model.editor)]):[3,5];case 1:return e.editorProvider=n.sent(),this.editorProvider?(r=this,[4,this.editorProvider.createController(this.model.editor,this)]):[3,5];case 2:return r.editor=n.sent(),[4,this.editor.init()];case 3:return n.sent(),[4,this.initRules()];case 4:n.sent(),n.label=5;case 5:return[2]}}))}))},t.prototype.initRules=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){return(t=this.model.editItemVRs)?(this.rules=generateRules(t,this.model.codeName,this.model.source.valueItemName),this.validator=new Schema(((e={})[this.model.codeName]=this.rules,e)),[2]):[2]}))}))},t.prototype.setRowValue=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return r=r||this.model.codeName,[4,this.grid.setRowValue(t,r,e)];case 1:return n.sent(),[2]}}))}))},t.prototype.dataChangeNotify=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return e.includes(this.model.codeName)||e.includes(this.model.source.valueItemName)?[4,this.validate(t)]:[3,2];case 1:if(!o.sent())throw new RuntimeError("".concat(this.model.codeName,"校验报错"));o.label=2;case 2:return e.includes(this.model.codeName)&&this.model.gridItemUpdate?(r=this.model.gridItemUpdate,n=r.methodName,i=r.itemNames,[4,this.grid.updateGridEditItem(t,n,i)]):[3,4];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t.prototype.gridStateNotify=function(t,e){this.calcEnableCond(t)},t.prototype.calcEnableCond=function(t){var e=this.model.source.enableCond,r=t.data.srfuf===Srfuf.CREATE;(0===e||r&&2===e||!r&&1===e)&&(t.columnState[this.model.codeName].disabled=!0)},t.prototype.validate=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(e=this.model.codeName,!this.validator)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.validator.validate(t.data)];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),n=r.errors,r._fields,t.errors[e]=n[0].message,[2,!1];case 4:return t.errors[e]=null,[2,!0]}}))}))},t}()),GridFieldEditColumnController=exports("GridFieldEditColumnController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(e=this.model.editItem)?(r=this,[4,this.createEditItemController(e)]):[3,3];case 2:r.editItem=n.sent(),this.grid.editItems[e.codeName]=this.editItem,n.label=3;case 3:return[2]}}))}))},e.prototype.createEditItemController=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,(e=new GridEditItemController(t,this.grid)).init()];case 1:return r.sent(),[2,e]}}))}))},e}(GridFieldColumnController)),GridUAColumnController=exports("GridUAColumnController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.initActionStates=function(t){var e=this;if(0===this.model.uiActionGroupDetails.length)throw new DefectModelError(this.model.source,"操作列没有配置界面行为");var r=new ButtonContainerState;this.model.uiActionGroupDetails.forEach((function(t){var n=t.getPSUIAction();if(n){var i=new ButtonState(t.name,n,e.grid.model.appEntity);r.addState(t.name,i)}})),r.update(t.data.getOrigin()),t.uaColumnStates[this.model.codeName]=r},e.prototype.onActionClick=function(t,e,r){var n;return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(o){switch(o.label){case 0:return"ToggleRowEdit"!==(null===(n=t.getPSUIAction())||void 0===n?void 0:n.uIActionTag)?[3,2]:[4,this.grid.toggleRowEdit(e)];case 1:return o.sent(),[2];case 2:return(i=this.model.findAppViewLogic(t.name))?[4,this.grid.nerve.self.evt.asyncEmit("actionClick",i,[e.data],r)]:[3,4];case 3:return o.sent(),[3,5];case 4:AppDEUIActionUtil.exec(t.getPSUIAction(),this.context,[e.data],this.params,{event:r,neuron:this.grid.nerve.self}),o.label=5;case 5:return[2]}}))}))},e}(GridColumnController)),GridRowController=exports("GridRowController",function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.errors={},n.uaColumnStates={},n.columnState={},n.showRowEdit=!1,n.modified=!1,n.processing=!1,Object.keys(n.data).forEach((function(t){void 0===n.errors[t]&&(n.errors[t]=null)})),e.srfuf===Srfuf.CREATE&&(n.showRowEdit=!0),Object.values(r.uaColumns).forEach((function(t){t.initActionStates(n)})),Object.values(r.editItems).forEach((function(t){n.columnState[t.model.codeName]={disabled:!1,editable:!1}})),n}return __extends(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),clearAll(this.errors)},e}(MDItemController)),ListController=exports("ListController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new ListState,e.isAddBehind=!1,e}return __extends(e,t),e.prototype.createNerve=function(){return new ListNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return a.sent(),this.service=new ListService(this.model),[4,this.service.init(this.context)];case 2:return a.sent(),this.nerve.self.evt.on("beforeLoad",(function(){return o.sortQuery?{sort:o.sortQuery}:{}})),e=this.model,r=e.defaultSortField,n=e.defaultSortDir,r&&n&&this.setSort(r,n),this.model.layoutPanel?(i=this,[4,ibiz.register.control.get(this.model.layoutPanel)]):[3,4];case 3:i.layoutPanelProvider=a.sent(),a.label=4;case 4:return[2]}}))}))},e.prototype.setSort=function(t,e){this.sortQuery="".concat(t,",").concat(e)},e.prototype.loadMore=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.stopPropagation(),this.state.total>this.state.items.length&&(this.state.curPage+=1,this.isAddBehind=!0,this.load()),[2]}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.isAddBehind=!1,[2,e]}}))}))},e.prototype.afterLoad=function(e){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=[],this.isAddBehind?((n=this.state.items).push.apply(n,__spreadArray([],__read(e),!1)),r=this.state.items):r=e,[4,t.prototype.afterLoad.call(this,r)];case 1:return o.sent(),this.model.enableGroup?[4,this.handleGroup(this.state.items)]:[3,3];case 2:o.sent(),o.label=3;case 3:return this.state.rows=this.state.items.map((function(t){return new MDItemController(t,i)})),[2,this.state.items]}}))}))},e.prototype.handleGroup=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return Object.is(this.model.groupMode,"AUTO")?[4,this.drawGroup(t)]:[3,2];case 1:return e.sent(),[3,4];case 2:return Object.is(this.model.groupMode,"CODELIST")?[4,this.drawCodeListGroup(t)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}}))}))},e.prototype.drawGroup=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i=this;return __generator(this,(function(o){return this.model.groupAppField?(e=__spreadArray([],__read(t),!1),r=[],e.forEach((function(t){Object.prototype.hasOwnProperty.call(t,i.model.groupAppField)&&r.push(t[i.model.groupAppField])})),0===(r=__spreadArray([],__read(new Set(r)),!1)).length&&ibiz.log.warn("分组数据无效"),n=[],r.forEach((function(t){var r=[];e.forEach((function(e){Object.is(t,e[i.model.groupAppField])&&r.push(e)}));var o={group:t=t||"其他",children:r};n.push(o)})),this.state.groupData=n,[2]):(ibiz.log.warn("未配置分组属性"),[2])}))}))},e.prototype.drawCodeListGroup=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s=this;return __generator(this,(function(c){switch(c.label){case 0:return this.model.groupAppField?(e=[],r=__spreadArray([],__read(t),!1),this.model.groupCodeList?[4,this.app.codeList.get(this.model.groupCodeList.codeName,this.context,this.params)]:[3,2]):(ibiz.log.warn("未配置分组属性"),[2]);case 1:n=c.sent(),e=clone(n),c.label=2;case 2:return 0===e.length&&ibiz.log.warn("分组数据无效"),i=[],e.forEach((function(t){var e=[];r.forEach((function(r){Object.is(t.value,r[s.model.groupAppField])&&e.push(r)}));var n={group:t.text,codeListItem:t,children:e};i.push(n)})),o=[],r.forEach((function(t){e.findIndex((function(e){return Object.is(e.value,t[s.model.groupAppField])}))<0&&o.push(t)})),a={group:"其他",children:o},o&&o.length>0&&i.push(a),this.state.groupData=i,[2]}}))}))},e.prototype.handleClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 1!==this.mdCtrlActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.handleDblClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 2!==this.mdCtrlActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e}(MDController)),TreeController=exports("TreeController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new TreeState,e}return __extends(e,t),e.prototype.createNerve=function(){return new TreeNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),this.service=new TreeService(this.model),[4,this.service.init(this.context)];case 2:return e.sent(),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.loadNodes(void 0)];case 1:return t=r.sent()||[],e=!1===this.state.hasLoaded,this.state.hasLoaded=!0,[4,this.nerve.self.evt.asyncEmit("afterLoad",this.state.treeNodes,e)];case 2:return r.sent(),[2,t]}}))}))},e.prototype.loadNodes=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.getParams()];case 1:return e=i.sent(),r=!!e.query,t||(this.state.rootNode=new TreeStaticNodeData(this.model.rootNode,{hasQuery:r}),t=this.state.rootNode),[4,this.startLoading()];case 2:i.sent(),i.label=3;case 3:return i.trys.push([3,,5,7]),[4,this.service.fetchChildNodes(t,{context:new IBizContext({},this.context),params:e,hasQuery:r})];case 4:return n=i.sent()||[],[3,7];case 5:return[4,this.endLoading()];case 6:return i.sent(),[7];case 7:return t.children=n,[2,n]}}))}))},e.prototype.onTreeNodeClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:return e.sent(),[2]}}))}))},e}(MDController)),ViewPanelController=exports("ViewPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new ViewPanelNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[2]}}))}))},e}(ControlController)),PickupViewPanelController=exports("PickupViewPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new PickupViewPanelNerve(this)},e.prototype.selectAll=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.nerve.embedView.call.selectAll()]}))}))},e}(ViewPanelController)),PortletPartController=exports("PortletPartController",function(){function t(t,e,r){this.model=t,this.dashboard=e,this.parent=r,this.state=this.createState()}return Object.defineProperty(t.prototype,"context",{get:function(){return this.dashboard.context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"params",{get:function(){return this.dashboard.params},enumerable:!1,configurable:!0}),t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n,i;return __generator(this,(function(o){return t=this.model,e=t.width,r=t.height,n=t.sysCssName,i=t.portletType,e&&(this.state.layoutController.width=e),r&&(this.state.layoutController.height=r),this.state.layoutController.extraClass="ibiz-portlet-col__".concat(i.toLowerCase()," "),n&&(this.state.layoutController.extraClass=n),this.initActionStates(),[2]}))}))},t.prototype.createState=function(){return new PortletPartState},t.prototype.initActionStates=function(){var t=this.model.uiActionGroupDetails;if(t){var e=new ButtonContainerState;t.forEach((function(t){var r=t.getPSUIAction();if(r){var n=new ButtonState(t.name,r);e.addState(t.name,n)}})),e.update(),this.state.actionGroupState=e}},t.prototype.onActionClick=function(t,e,r){return void 0===r&&(r=null),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,executeViewLogic(this.model.findAppViewLogic(t.name),this.context,r,this.params,{event:e,neuron:{}})];case 1:return n.sent(),[2]}}))}))},t}()),ActionBarPortletController=exports("ActionBarPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),AppMenuPortletController=exports("AppMenuPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),ChartPortletController=exports("ChartPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),CustomPortletController=exports("CustomPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),HtmlPortletController=exports("HtmlPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),ListPortletController=exports("ListPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),(e=this.model.list)?(r=this,[4,ibiz.register.control.get(e)]):[3,3];case 2:r.listProvider=n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.setListNeuron=function(t){var e=this;this.list=t,this.list.evt.on("mounted",(function(){e.list.call.load()})),this.list.evt.on("destroyed",(function(){e.list=void 0}))},e}(PortletPartController)),RawItemPortletController=exports("RawItemPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),ToolbarPortletController=exports("ToolbarPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),ViewPortletController=exports("ViewPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.setViewNeuron=function(t){this.neuron=t},e}(PortletPartController)),ContainerPortletController=exports("ContainerPortletController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(PortletPartController)),LayoutPanelState=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.data={},e}return __extends(e,t),e}(ControlState),LayoutPanelController=exports("LayoutPanelController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new LayoutPanelState,e.panelItems={},e.providers={},e}return __extends(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.state.data},enumerable:!1,configurable:!0}),e.prototype.setInputData=function(t){this.inputData=t},e.prototype.createNerve=function(){return new LayoutPanelNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return r.sent(),[4,this.initPanelItemControllers()];case 2:return r.sent(),this.nerve.self.evt.on("mounted",(function(){e.load()})),[2]}}))}))},e.prototype.initPanelItemControllers=function(t,e,r){return void 0===t&&(t=this.model.children),void 0===e&&(e=this),void 0===r&&(r=void 0),__awaiter(this,void 0,void 0,(function(){var n,i=this;return __generator(this,(function(o){switch(o.label){case 0:if(!(n=ibiz.register.panelItem))throw new RuntimeError("panelItem注册器不存在");return[4,Promise.all(t.map((function(t){return __awaiter(i,void 0,void 0,(function(){var i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return[4,n.get(t)];case 1:if(!(i=s.sent()))throw new RuntimeError("找不到对应的适配器");return e.providers[t.name]=i,[4,i.createController(t,e,r)];case 2:return o=s.sent(),e.panelItems[t.name]=o,(null===(a=t.children)||void 0===a?void 0:a.length)?[4,this.initPanelItemControllers(t.children,e,o)]:[3,4];case 3:s.sent(),s.label=4;case 4:return[2]}}))}))})))];case 1:return o.sent(),[2]}}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.prepareData()];case 1:if(!(t=r.sent()))throw new RuntimeError("未获取到面板数据");return e=this.convertData(t),this.state.data=e,this.panelStateNotify(PanelNotifyState.LOAD),[2]}}))}))},e.prototype.prepareData=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){if(0===this.model.dataMode&&(t=this.inputData),1===this.model.dataMode)this.inputData&&(t=this.inputData);else t=this.inputData;return[2,t]}))}))},e.prototype.convertData=function(t){var e={};return this.model.panelFields.forEach((function(t){t.name!==t.dataFieldName&&(e[t.name]=t.dataFieldName)})),new Proxy(t,{get:function(t,r,n){return Reflect.ownKeys(e).includes(r)?Reflect.get(t,e[r],n):Reflect.get(t,r,n)},set:function(t,e,r,n){return Reflect.set(t,e,r,n),!0}})},e.prototype.dataChangeNotify=function(t){Object.values(this.panelItems).forEach((function(e){e.dataChangeNotify(t)}))},e.prototype.panelStateNotify=function(t){Object.values(this.panelItems).forEach((function(e){e.panelStateNotify(t)}))},e.prototype.setDataValue=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e,this.dataChangeNotify([t])),[2]}))}))},e}(ControlController)),ViewLayoutPanelController=exports("ViewLayoutPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createNerve=function(){return new ViewLayoutPanelNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[2]}}))}))},e}(ControlController)),PanelItemController=exports("PanelItemController",function(){function t(t,e,r){this.model=t,this.panel=e,this.parent=r,this.state=this.createState()}return t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n,i,o=this;return __generator(this,(function(a){return t=this.model,e=t.width,r=t.height,n=t.sysCssName,i=t.itemType,e&&(this.state.layoutController.width=e),r&&(this.state.layoutController.height=r),this.state.layoutController.extraClass="ibiz-panel-col__".concat(i.toLowerCase()," "),n&&(this.state.layoutController.extraClass=n),Object.defineProperty(this.state.layoutController,"visible",{configurable:!0,enumerable:!0,get:function(){return o.state.visible}}),this.model.source.getPSLayoutPos()&&(this.state.layoutController.contentStyle=calcLayoutContentStyle(this.model.source.getPSLayoutPos())),[2]}))}))},t.prototype.createState=function(){var t;return new PanelItemState(null===(t=this.parent)||void 0===t?void 0:t.state)},t.prototype.dataChangeNotify=function(t){this.calcDynamicLogic(t)},t.prototype.panelStateNotify=function(t){this.calcDynamicLogic([],!0)},t.prototype.calcDynamicLogic=function(t,e){var r,n=this;void 0===e&&(e=!1),this.parent&&!this.parent.state.visible||null===(r=this.model.source.getPSPanelItemGroupLogics())||void 0===r||r.forEach((function(r){var i=r.getRelatedItemNames()||[];if(e||isOverlap(i,t))try{var o=verifyPanelGroupLogic(n.panel.data,r);switch(r.logicCat){case"ITEMBLANK":n.state.required=!o;break;case"ITEMENABLE":n.state.disabled=!o;break;case"PANELVISIBLE":n.state.visible=o}}catch(t){ibiz.log.error(t)}}))},t}()),PanelContainerController=exports("PanelContainerController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new PanelContainerState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(PanelItemController)),PanelFieldController=exports("PanelFieldController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.editor=null,e}return __extends(e,t),e.prototype.createState=function(){var t;return new PanelFieldState(null===(t=this.parent)||void 0===t?void 0:t.state)},Object.defineProperty(e.prototype,"name",{get:function(){return this.model.source.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.panel.state.data},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t;return null===(t=this.data)||void 0===t?void 0:t[this.model.name]},enumerable:!1,configurable:!0}),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),this.model.editor&&"HIDDEN"!==this.model.editor.editorType?(e=this,[4,ibiz.register.editor.get(this.model.editor)]):[3,5];case 2:return e.editorProvider=n.sent(),this.editorProvider?(r=this,[4,this.editorProvider.createController(this.model.editor,this)]):[3,5];case 3:return r.editor=n.sent(),[4,this.editor.init()];case 4:n.sent(),n.label=5;case 5:return[2]}}))}))},e.prototype.setDataValue=function(t,e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return e=e||this.name,[4,this.panel.setDataValue(e,t)];case 1:return r.sent(),[2]}}))}))},e}(PanelItemController)),PanelRawItemController=exports("PanelRawItemController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new PanelRawItemState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(PanelItemController)),PanelButtonController=exports("PanelButtonController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new PanelButtonState(null===(t=this.parent)||void 0===t?void 0:t.state)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return i.sent(),e=this.panel.model.name.toLowerCase(),r=this.model.name.toLowerCase(),n="".concat(e,"_").concat(r,"_click"),this.viewLogic=this.panel.model.source.findPSAppViewLogic(n)||void 0,[2]}}))}))},e.prototype.onClick=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){if("UIACTION"===(e=this.model.actionType))return[2,this.doUIAction(t)];throw new UnsupportedModelError(this.model.source,"行为类型".concat(e,"暂未支持"))}))}))},e.prototype.doUIAction=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!this.viewLogic)throw new RuntimeError("没有找到按钮对应的视图逻辑");return[4,executeViewLogic(this.viewLogic,this.panel.context,[this.panel.data],this.panel.params,{event:t,neuron:{}})];case 1:return e.sent(),[2]}}))}))},e}(PanelItemController)),PanelTabPageController=exports("PanelTabPageController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new PanelTabPageState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(PanelItemController)),PanelTabPanelController=exports("PanelTabPanelController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.createState=function(){var t;return new PanelTabPanelState(null===(t=this.parent)||void 0===t?void 0:t.state)},e}(PanelItemController)),DashboardController=exports("DashboardController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.providers={},e.portlets={},e}return __extends(e,t),e.prototype.createNerve=function(){return new DashboardNerve(this)},e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return e.sent(),[4,this.initPortlets(this.model.children)];case 2:return e.sent(),[2]}}))}))},e.prototype.initPortlets=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){return __awaiter(r,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return[4,ibiz.register.portletPart.get(t)];case 1:return(r=o.sent())?(this.providers[t.name]=r,[4,r.createController(t,this,e)]):[3,4];case 2:return n=o.sent(),this.portlets[t.name]=n,(null===(i=t.children)||void 0===i?void 0:i.length)?[4,this.initPortlets(t.children,n)]:[3,4];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))})))];case 1:return n.sent(),[2]}}))}))},e}(ControlController)),DataViewController=exports("DataViewController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new DataViewState,e.isAddBehind=!1,e}return __extends(e,t),e.prototype.createNerve=function(){return new DataViewNerve(this)},Object.defineProperty(e.prototype,"noSort",{get:function(){return this.model.source.noSort},enumerable:!1,configurable:!0}),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return t.prototype.onInit.call(this),this.state.size=this.model.size,this.state.singleSelect=this.model.source.singleSelect,this.service=new DataViewService(this.model),[4,this.service.init(this.context)];case 1:return a.sent(),this.nerve.self.evt.on("beforeLoad",(function(){return o.sortQuery?{sort:o.sortQuery}:{}})),e=this.model,r=e.defaultSortField,n=e.defaultSortDir,r&&n&&this.setSort(r,n),this.model.layoutPanel?(i=this,[4,ibiz.register.control.get(this.model.layoutPanel)]):[3,3];case 2:i.layoutPanelProvider=a.sent(),a.label=3;case 3:return[2]}}))}))},e.prototype.setSort=function(t,e){this.sortQuery="".concat(t,",").concat(e)},e.prototype.loadMore=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.stopPropagation(),this.state.total>this.state.items.length&&(this.state.curPage+=1,this.isAddBehind=!0,this.load()),[2]}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.isAddBehind=!1,[2,e]}}))}))},e.prototype.afterLoad=function(e){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=[],this.isAddBehind?((n=this.state.items).push.apply(n,__spreadArray([],__read(e),!1)),r=this.state.items):r=e,[4,t.prototype.afterLoad.call(this,r)];case 1:return o.sent(),this.model.enableGroup?[4,this.handleGroup(this.state.items)]:[3,3];case 2:o.sent(),o.label=3;case 3:return this.state.rows=this.state.items.map((function(t){return new MDItemController(t,i)})),[2,this.state.items]}}))}))},e.prototype.handleGroup=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return Object.is(this.model.groupMode,"AUTO")?[4,this.drawGroup(t)]:[3,2];case 1:return e.sent(),[3,4];case 2:return Object.is(this.model.groupMode,"CODELIST")?[4,this.drawCodeListGroup(t)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}}))}))},e.prototype.drawGroup=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i=this;return __generator(this,(function(o){return this.model.groupAppField?(e=__spreadArray([],__read(t),!1),r=[],e.forEach((function(t){Object.prototype.hasOwnProperty.call(t,i.model.groupAppField)&&r.push(t[i.model.groupAppField])})),0===(r=__spreadArray([],__read(new Set(r)),!1)).length&&ibiz.log.warn("分组数据无效"),n=[],r.forEach((function(t){var r=[];e.forEach((function(e){Object.is(t,e[i.model.groupAppField])&&r.push(e)}));var o={group:t=t||"其他",children:r};n.push(o)})),this.state.groupData=n,[2]):(ibiz.log.warn("未配置分组属性"),[2])}))}))},e.prototype.drawCodeListGroup=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s=this;return __generator(this,(function(c){switch(c.label){case 0:return this.model.groupAppField?(e=[],r=__spreadArray([],__read(t),!1),this.model.groupCodeList?[4,this.app.codeList.get(this.model.groupCodeList.codeName,this.context,this.params)]:[3,2]):(ibiz.log.warn("未配置分组属性"),[2]);case 1:n=c.sent(),e=clone(n),c.label=2;case 2:return 0===e.length&&ibiz.log.warn("分组数据无效"),i=[],e.forEach((function(t){var e=[];r.forEach((function(r){Object.is(t.value,r[s.model.groupAppField])&&e.push(r)}));var n={group:t.text,codeListItem:t,children:e};i.push(n)})),o=[],r.forEach((function(t){e.findIndex((function(e){return Object.is(e.value,t[s.model.groupAppField])}))<0&&o.push(t)})),a={group:"其他",children:o},o&&o.length>0&&i.push(a),this.state.groupData=i,[2]}}))}))},e.prototype.afterRemove=function(e){t.prototype.afterRemove.call(this,e);var r=this.state.rows.findIndex((function(t){return t.data.srfkey===e.srfkey}));this.state.rows[r].destroy(),this.state.rows.splice(r,1)},e.prototype.save=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(!(e=this.state.rows.find((function(e){return e.data.srfkey===t.srfkey}))))throw new RuntimeError("行数据不存在");return[4,this.startLoading()];case 1:c.sent(),n=t.srfuf===Srfuf.CREATE,c.label=2;case 2:return c.trys.push([2,,7,9]),n?[4,this.service.create(__assign((a={},a[this.model.appEntity.deName]=t.srfkey,a),this.context),t)]:[3,4];case 3:return i=c.sent(),[3,6];case 4:return[4,this.service.update(__assign((s={},s[this.model.appEntity.deName]=t.srfkey,s),this.context),t)];case 5:i=c.sent(),c.label=6;case 6:return r=i,[3,9];case 7:return[4,this.endLoading()];case 8:return c.sent(),[7];case 9:return o=this.state.items.findIndex((function(e){return e.srfkey===t.srfkey})),this.state.items.splice(o,1,r.data),e.data=r.data,ibiz.message.success("".concat(r.data.srfmajortext||"","保存成功")),[4,this.nerve.self.evt.asyncEmit("afterSave",[r.data],n)];case 10:return c.sent(),[2]}}))}))},e.prototype.handleClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 1!==this.mdCtrlActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.handleDblClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 2!==this.mdCtrlActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e}(MDController)),WizardPanelController=exports("WizardPanelController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new WizardPanelState,e.tagHistory=[],e.providers={},e}return __extends(e,t),e.prototype.createNerve=function(){return new WizardPanelNerve(this)},Object.defineProperty(e.prototype,"activeWizardForm",{get:function(){var t=this.state.activeFormTag,e=this.model.wizard.wizardFormMap.get(t);return e||Logger.debug("找不到".concat(t,"的向导表单")),e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeFormNeuron",{get:function(){var t=this.state.activeFormTag,e=this.nerve.forms.get(t);if(!e)throw new RuntimeError("找不到".concat(t,"的表单神经元"));return e},enumerable:!1,configurable:!0}),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r=this;return __generator(this,(function(n){switch(n.label){case 0:return[4,t.prototype.onInit.call(this)];case 1:return n.sent(),this.service=new WizardPanelService(this.model),[4,this.service.init(this.context)];case 2:return n.sent(),(e=this.model.editFormMap).size>0?[4,Promise.all(__spreadArray([],__read(e.keys()),!1).map((function(t){return __awaiter(r,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return r=e.get(t),n=this.providers,i=t,[4,ibiz.register.control.get(r)];case 1:return n[i]=o.sent(),[2]}}))}))})))]:[3,4];case 3:n.sent(),n.label=4;case 4:return[2]}}))}))},e.prototype.initialize=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return t=this.model,e=t.initAction,r=t.wizard,e?[4,this.service.initialize(this.context,this.params)]:[3,2];case 1:n=s.sent(),i=this.model.appEntity,o=i.deName,a=i.keyName,n.data&&n.data[a]&&(this.context[o]=n.data[a]),s.label=2;case 2:return this.state.activeFormTag=r.firstForm.formTag,this.tagHistory.push(r.firstForm.formTag),[2]}}))}))},e.prototype.finish=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.service.finish(this.context,this.params)];case 1:return t.sent(),this.nerve.self.evt.emit("afterFinish"),[2]}}))}))},e.prototype.onFormMounted=function(t){var e=this.nerve.forms.get(t);if(!e)throw new RuntimeError("找不到".concat(t,"对应的表单神经元"));e.call.load()},e.prototype.onPrevClick=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:return[4,this.activeFormNeuron.call.goBack()];case 1:if(e.sent(),this.tagHistory.pop(),!(t=this.tagHistory[this.tagHistory.length-1]))throw new RuntimeError("没有上一个表单");return this.state.activeFormTag=t,[2]}}))}))},e.prototype.onNextClick=function(){var t,e;return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return[4,this.activeFormNeuron.call.save()];case 1:if((r=a.sent()).srfnextform){if(!this.model.wizard.wizardFormMap.get(r.srfnextform))throw new RuntimeError("找不到标识为".concat(r.srfnextform,"的向导表单"));n=r.srfnextform}else i=this.activeWizardForm.step,o=this.model.wizard.wizardSteps,i&&(n=null===(e=null===(t=o[i.index+1])||void 0===t?void 0:t.forms[0])||void 0===e?void 0:e.formTag);if(!n)throw new RuntimeError("找不到下一个向导表单");return this.state.activeFormTag=n,this.tagHistory.push(n),[2]}}))}))},e.prototype.onFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.activeFormNeuron.call.save()];case 1:return t.sent(),[4,this.finish()];case 2:return t.sent(),[2]}}))}))},e}(ControlController)),KanbanController=exports("KanbanController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state=new KanbanState,e.isAddBehind=!1,e}return __extends(e,t),e.prototype.createNerve=function(){return new KanbanNerve(this)},Object.defineProperty(e.prototype,"noSort",{get:function(){return this.model.source.noSort},enumerable:!1,configurable:!0}),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return t.prototype.onInit.call(this),this.state.size=this.model.size,this.state.singleSelect=this.model.source.singleSelect,this.service=new KanbanService(this.model),[4,this.service.init(this.context)];case 1:return a.sent(),this.nerve.self.evt.on("beforeLoad",(function(){return o.sortQuery?{sort:o.sortQuery}:{}})),e=this.model,r=e.defaultSortField,n=e.defaultSortDir,r&&n&&this.setSort(r,n),this.model.layoutPanel?(i=this,[4,ibiz.register.control.get(this.model.layoutPanel)]):[3,3];case 2:i.layoutPanelProvider=a.sent(),a.label=3;case 3:return[2]}}))}))},e.prototype.setSort=function(t,e){this.sortQuery="".concat(t,",").concat(e)},e.prototype.loadMore=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.stopPropagation(),this.state.total>this.state.items.length&&(this.state.curPage+=1,this.isAddBehind=!0,this.load()),[2]}))}))},e.prototype.load=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,t.prototype.load.call(this)];case 1:return e=r.sent(),this.isAddBehind=!1,[2,e]}}))}))},e.prototype.afterLoad=function(e){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return r=[],this.isAddBehind?((n=this.state.items).push.apply(n,__spreadArray([],__read(e),!1)),r=this.state.items):r=e,[4,t.prototype.afterLoad.call(this,r)];case 1:return o.sent(),this.model.enableGroup?[4,this.handleGroup(this.state.items)]:[3,3];case 2:o.sent(),o.label=3;case 3:return this.state.rows=this.state.items.map((function(t){return new MDItemController(t,i)})),[2,this.state.items]}}))}))},e.prototype.handleGroup=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return Object.is(this.model.groupMode,"AUTO")?[4,this.drawGroup(t)]:[3,2];case 1:return e.sent(),[3,4];case 2:return Object.is(this.model.groupMode,"CODELIST")?[4,this.drawCodeListGroup(t)]:[3,4];case 3:e.sent(),e.label=4;case 4:return this.state.groupData.length>0&&this.state.groupData.forEach((function(t){t.folding=!1})),[2]}}))}))},e.prototype.drawGroup=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i=this;return __generator(this,(function(o){return this.model.groupAppField?(e=__spreadArray([],__read(t),!1),r=[],e.forEach((function(t){Object.prototype.hasOwnProperty.call(t,i.model.groupAppField)&&r.push(t[i.model.groupAppField])})),0===(r=__spreadArray([],__read(new Set(r)),!1)).length&&ibiz.log.warn("分组数据无效"),n=[],r.forEach((function(t){var r=[];e.forEach((function(e){Object.is(t,e[i.model.groupAppField])&&r.push(e)}));var o={group:t=t||"其他",children:r};n.push(o)})),this.state.groupData=n,[2]):(ibiz.log.warn("未配置分组属性"),[2])}))}))},e.prototype.drawCodeListGroup=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s=this;return __generator(this,(function(c){switch(c.label){case 0:return this.model.groupAppField?(e=[],r=__spreadArray([],__read(t),!1),this.model.groupCodeList?[4,this.app.codeList.get(this.model.groupCodeList.codeName,this.context,this.params)]:[3,2]):(ibiz.log.warn("未配置分组属性"),[2]);case 1:n=c.sent(),e=clone(n),c.label=2;case 2:return 0===e.length&&ibiz.log.warn("分组数据无效"),i=[],e.forEach((function(t){var e=[];r.forEach((function(r){Object.is(t.value,r[s.model.groupAppField])&&e.push(r)}));var n={group:t.text,codeListItem:t,children:e};i.push(n)})),o=[],r.forEach((function(t){e.findIndex((function(e){return Object.is(e.value,t[s.model.groupAppField])}))<0&&o.push(t)})),a={group:"其他",children:o},o&&o.length>0&&i.push(a),this.state.groupData=i,[2]}}))}))},e.prototype.afterRemove=function(e){t.prototype.afterRemove.call(this,e);var r=this.state.rows.findIndex((function(t){return t.data.srfkey===e.srfkey}));this.state.rows[r].destroy(),this.state.rows.splice(r,1)},e.prototype.save=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:if(!(e=this.state.rows.find((function(e){return e.data.srfkey===t.srfkey}))))throw new RuntimeError("行数据不存在");return[4,this.startLoading()];case 1:c.sent(),n=t.srfuf===Srfuf.CREATE,c.label=2;case 2:return c.trys.push([2,,7,9]),n?[4,this.service.create(__assign((a={},a[this.model.appEntity.deName]=t.srfkey,a),this.context),t)]:[3,4];case 3:return i=c.sent(),[3,6];case 4:return[4,this.service.update(__assign((s={},s[this.model.appEntity.deName]=t.srfkey,s),this.context),t)];case 5:i=c.sent(),c.label=6;case 6:return r=i,[3,9];case 7:return[4,this.endLoading()];case 8:return c.sent(),[7];case 9:return o=this.state.items.findIndex((function(e){return e.srfkey===t.srfkey})),this.state.items.splice(o,1,r.data),e.data=r.data,ibiz.message.success("".concat(r.data.srfmajortext||"","保存成功")),[4,this.nerve.self.evt.asyncEmit("afterSave",[r.data],n)];case 10:return c.sent(),[2]}}))}))},e.prototype.handleClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 1!==this.mdCtrlActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.handleDblClick=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return 2!==this.mdCtrlActiveMode?[3,2]:[4,this.nerve.self.evt.asyncEmit("dataActive",t)];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e.prototype.onActionClick=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){switch(i.label){case 0:return n=this.state.selectedData.length>0&&r.children.includes(this.state.selectedData[0])?[this.state.selectedData[0]]:[],[4,executeViewLogic(this.model.findAppViewLogic(t.name),this.context,n,this.params,{event:e,neuron:this.nerve.self})];case 1:return i.sent(),[2]}}))}))},e}(MDController)),EditorController=exports("EditorController",function(){function t(t,e){this.placeHolder="",this.editorParams={},this.model=t,this.parent=e,this.context=e.context,this.params=e.params,this.app=ibiz.hub.getApp(t.modelService.app.appId)}return Object.defineProperty(t.prototype,"readonly",{get:function(){return this.model.readonly},enumerable:!1,configurable:!0}),t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.onInit()];case 1:return t.sent(),[2]}}))}))},t.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.model.placeHolder&&(this.placeHolder=this.model.placeHolder),this.model.editorParams&&(this.editorParams=this.model.editorParams),[2]}))}))},t.prototype.handlePublicParams=function(t,e,r){var n=this.model,i=n.navigateContexts,o=n.navigateParams,a={};i&&t&&(a=convertNavData(i,e,r,t));var s=new IBizContext(a,e),c={};return o&&t&&(c=convertNavData(o,e,r,t)),{context:s,params:__assign(__assign({},r),c)}},t.prototype.handleStringToNumber=function(t){return+t},t.prototype.handleStringToObj=function(t){if("string"==typeof t)return new Function("return (".concat(t,");"))()},t.prototype.handleStringToBoolean=function(t){return!!Object.is("true",t)},t}()),TextBoxEditorController=exports("TextBoxEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.placeHolder="请输入",e}return __extends(e,t),e}(EditorController)),CodeListEditorController=exports("CodeListEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.loadCodeList=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return e=this.handlePublicParams(t,this.context,this.params),r=e.context,n=e.params,this.model.codeList?([],i=this.model.codeList.codeName,[4,this.app.codeList.get(i,r,n)]):[3,2];case 1:return[2,o.sent()];case 2:throw new DefectModelError(this.model.source,"请配置代码表")}}))}))},e}(EditorController)),CheckBoxListEditorController=exports("CheckBoxListEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(CodeListEditorController)),RadioButtonListEditorController=exports("RadioButtonListEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(CodeListEditorController)),DatePickerEditorController=exports("DatePickerEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.placeHolder="请选择日期",e}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.prototype.onInit.call(this),this.valueFormat=this.model.valueFormat,[2]}))}))},e}(EditorController)),SpanEditorController=exports("SpanEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.prototype.onInit.call(this),this.unitName=this.model.unitName,this.valueFormat=this.model.valueFormat,[2]}))}))},e}(CodeListEditorController)),DropDownListEditorController=exports("DropDownListEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.placeHolder="请选择",e.multiple=!1,e}return __extends(e,t),e.prototype.onInit=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return t.prototype.onInit.call(this),"MDROPDOWNLIST"===this.model.editorType&&(this.multiple=!0),[2]}))}))},e}(CodeListEditorController)),PickerEditorController=exports("PickerEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.multiple=!1,e.placeHolder="请选择数据",e.pickupView=null,e.linkView=null,e.valueItem="",e.keyName="",e.textName="",e.serviceName="",e.interfaceName="",e.sort="",e.noAC=!1,e.noButton=!1,e}return __extends(e,t),e.prototype.onInit=function(){var e,r,n;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:return t.prototype.onInit.call(this),this.initParams(),this.valueItem=(null===(e=this.model.valueItemName)||void 0===e?void 0:e.toLowerCase())||"",this.keyName=(null===(r=this.model.appDataEntity)||void 0===r?void 0:r.keyName)||"",this.textName=(null===(n=this.model.appDataEntity)||void 0===n?void 0:n.textName)||"",[4,this.initPickupViewParams()];case 1:return i.sent(),[4,this.initLinkViewParams()];case 2:return i.sent(),this.getAcParams(),this.sort=this.getAcSort(),[2]}}))}))},e.prototype.initParams=function(){switch(this.model.editorType){case"PICKEREX_NOAC":this.noAC=!0;break;case"PICKEREX_NOBUTTON":this.noButton=!0;break;default:this.noButton=!1,this.noAC=!1}},e.prototype.initPickupViewParams=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.model.pickupAppView&&(this.pickupView=this.model.pickupAppView),[2]}))}))},e.prototype.initLinkViewParams=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.model.linkAppView&&(this.linkView=this.model.linkAppView),[2]}))}))},e.prototype.getAcParams=function(){var t,e,r,n,i=null===(e=(t=this.model.source).getPSAppDataEntity)||void 0===e?void 0:e.call(t),o=null===(n=(r=this.model.source).getPSAppDEDataSet)||void 0===n?void 0:n.call(r);i&&o&&(this.serviceName=i.codeName,this.interfaceName=o.codeName),this.model.deACMode&&(this.textName=this.model.deACMode.textFieldName||this.textName,this.keyName=this.model.deACMode.valueFieldName||this.keyName)},e.prototype.getAcSort=function(){if(this.model.deACMode){var t=this.model.deACMode,e=t.sortField,r=t.sortDir;if(e&&r)return"".concat(e,",").concat(r)}},e.prototype.getServiceData=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return r=__assign(__assign({},this.params),{query:t,size:1e3}),this.sort&&!Object.is(this.sort,"")&&Object.assign(r,{sort:this.sort}),n=this.handlePublicParams(e,this.context,r),i=n.context,o=n.params,this.serviceName&&this.interfaceName?[4,this.app.es.getService(this.serviceName)]:[3,3];case 1:return[4,a.sent().exec(this.interfaceName,i,o)];case 2:return[2,a.sent()];case 3:throw new DefectModelError(this.model.source,"请配置实体和实体数据集")}}))}))},e.prototype.openPickUpView=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:if(r=this.handlePublicParams(t,this.context,this.params),n=r.context,i=r.params,e&&(i.selectedData=e),!this.pickupView)throw new DefectModelError(this.model.source,"请配置数据选择视图");return[4,ibiz.openView.modal(this.pickupView,n,i)];case 1:return(o=a.sent())&&o.ok&&o.data?[2,o.data]:(ibiz.log.debug("模态取消或关闭异常",o),[2])}}))}))},e.prototype.openLinkView=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i;return __generator(this,(function(o){if(e=this.handlePublicParams(t,this.context,this.params),r=e.context,n=e.params,r.srfkey=t[this.valueItem],!this.linkView)throw new DefectModelError(this.model.source,"请配置数据链接视图");return this.linkView.getPSAppDataEntity()&&(i=this.linkView.getPSAppDataEntity().codeName)&&(r[i.toLowerCase()]=t[this.valueItem]),[2,ibiz.commands.execute(OpenAppViewCommand.TAG,this.linkView,r,n)]}))}))},e.prototype.calcFillDataItems=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.model.deACMode?[2,DEACModeUtil.calcFillDataItems(t,this.model.deACMode)]:[2,[]]}))}))},e}(EditorController)),UploadEditorController=exports("UploadEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.calcBaseUrl=function(t){var e="".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId).concat(ibiz.env.uploadFileUrl),r="".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl,"/%fileId%"),n={},i={};return this.model.uploadParams&&(n=convertNavData(this.model.uploadParams,this.context,this.params,t)),this.model.exportParams&&(i=convertNavData(this.model.exportParams,this.context,this.params,t)),{uploadUrl:e+=qs.stringify(n,{addQueryPrefix:!0}),downloadUrl:r+=qs.stringify(i,{addQueryPrefix:!0})}},e.prototype.fileDownload=function(t){this.app.net.request(t.url,{method:"get",responseType:"blob",baseURL:""}).then((function(e){if(200!==e.status)throw new RuntimeError("下载文件失败");if(!e.data)throw new RuntimeError("文件流数据不存在");var r=t.name;downloadFileFromBlob(e.data,r)}))},e}(EditorController)),RawEditorController=exports("RawEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(EditorController)),StepperEditorController=exports("StepperEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(EditorController)),RateEditorController=exports("RateEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(EditorController)),SliderEditorController=exports("SliderEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(EditorController)),SwitchEditorController=exports("SwitchEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(EditorController)),ListBoxEditorController=exports("ListBoxEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(CodeListEditorController)),ListBoxPickerEditorController=exports("ListBoxPickerEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.keyName="",e.textName="",e.serviceName="",e.interfaceName="",e}return __extends(e,t),e.prototype.onInit=function(){var e,r;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return t.prototype.onInit.call(this),"LISTBOXPICKUP"===this.model.source.editorType&&(this.keyName=(null===(e=this.model.appDataEntity)||void 0===e?void 0:e.keyName)||"",this.textName=(null===(r=this.model.appDataEntity)||void 0===r?void 0:r.textName)||"",this.getAcParams()),[2]}))}))},e.prototype.getAcParams=function(){var t=this.model.source.getPSAppDataEntity(),e=this.model.source.getPSAppDEDataSet();t&&e&&(this.serviceName=t.codeName,this.interfaceName=e.codeName)},e.prototype.getServiceData=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:return e=this.handlePublicParams(t,this.context,this.params),r=e.context,n=e.params,Object.assign(n,{size:1e3}),this.serviceName&&this.interfaceName?[4,this.app.es.getService(this.serviceName)]:[3,3];case 1:return[4,i.sent().exec(this.interfaceName,r,n)];case 2:return[2,i.sent()];case 3:throw new DefectModelError(this.model.source,"请配置实体和实体数据集")}}))}))},e}(EditorController)),AutoCompleteEditorController=exports("AutoCompleteEditorController",function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.placeHolder="请选择数据",e.valueItem="",e.keyName="",e.textName="",e.serviceName="",e.interfaceName="",e.sort="",e}return __extends(e,t),e.prototype.onInit=function(){var e,r,n;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return t.prototype.onInit.call(this),this.valueItem=(null===(e=this.model.valueItemName)||void 0===e?void 0:e.toLowerCase())||"",this.keyName=(null===(r=this.model.appDataEntity)||void 0===r?void 0:r.keyName)||"",this.textName=(null===(n=this.model.appDataEntity)||void 0===n?void 0:n.textName)||"",this.getAcParams(),this.sort=this.getAcSort(),[2]}))}))},e.prototype.getAcParams=function(){var t,e,r,n,i=null===(e=(t=this.model.source).getPSAppDataEntity)||void 0===e?void 0:e.call(t),o=null===(n=(r=this.model.source).getPSAppDEDataSet)||void 0===n?void 0:n.call(r);i&&o&&(this.serviceName=i.codeName,this.interfaceName=o.codeName),this.model.deACMode&&(this.textName=this.model.deACMode.textFieldName||this.textName,this.keyName=this.model.deACMode.valueFieldName||this.keyName)},e.prototype.getAcSort=function(){if(this.model.deACMode){var t=this.model.deACMode,e=t.sortField,r=t.sortDir;if(e&&r)return"".concat(e,",").concat(r)}},e.prototype.getServiceData=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(o){switch(o.label){case 0:return r=this.handlePublicParams(e,this.context,this.params),n=r.context,i=r.params,this.sort&&!Object.is(this.sort,"")&&Object.assign(i,{sort:this.sort}),Object.assign(i,{query:t,size:1e3}),this.serviceName&&this.interfaceName?[4,this.app.es.getService(this.serviceName)]:[3,3];case 1:return[4,o.sent().exec(this.interfaceName,n,i)];case 2:return[2,o.sent()];case 3:throw new DefectModelError(this.model.source,"请配置实体和实体数据集")}}))}))},e.prototype.calcFillDataItems=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.model.deACMode?[2,DEACModeUtil.calcFillDataItems(t,this.model.deACMode)]:[2,[]]}))}))},e}(EditorController)),CheckBoxEditorController=exports("CheckBoxEditorController",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(EditorController)),RegisterBase=exports("RegisterBase",function(){function t(){this.providers=new Map}return t.prototype.register=function(t,e){this.providers.set(t,e)},t.prototype.unRegister=function(t){this.providers.delete(t)},t.prototype.getByKey=function(t){return this.providers.get(t)},t}()),UIActionRegister=exports("UIActionRegister",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a;return __generator(this,(function(s){switch(s.label){case 0:return t.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.getPSSysPFPlugin())]:[3,2];case 1:if(s.sent(),e=t.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,a="".concat(r,"_").concat(n),this.providers.has(a))return[2,this.providers.get(a)];throw new RuntimeError("找不到插件标识".concat(a,"对应的适配器"));case 2:if(i=t.uIActionMode,o=t.uIActionTag,"SYS"===i){if(a="".concat(i,"_").concat(o),this.providers.has(a))return[2,this.providers.get(a)];throw new RuntimeError("找不到系统预置界面行为".concat(o,"对应的适配器"))}if(this.providers.has(i))return[2,this.providers.get(i)];throw new RuntimeError("找不界面行为模式".concat(i,"对应的适配器"))}}))}))},e}(RegisterBase)),EditorRegister=exports("EditorRegister",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:return[4,ibiz.plugin.loadPredefinedPlugin("EDITOR_".concat(t.source.editorType,"_").concat(t.source.editorStyle||"DEFAULT"))];case 1:return c.sent(),t.source.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,3];case 2:if(c.sent(),e=t.source.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,s="".concat(r,"_").concat(n),this.providers.has(s))return[2,this.providers.get(s)];ibiz.log.error("找不到插件标识".concat(s,"对应的适配器"),t),c.label=3;case 3:if(i=t.source,o=i.editorType,a=i.editorStyle,t.source.editorStyle){if(s="".concat(o,"_").concat(a),this.providers.has(s))return[2,this.providers.get(s)];ibiz.log.error("找不到编辑器类型:".concat(o,"的编辑器样式:").concat(a,"对应的适配器"),t)}if(this.providers.has(o))return[2,this.providers.get(o)];throw new RuntimeError("找不到编辑器类型".concat(o,"对应的适配器"))}}))}))},e}(RegisterBase)),FormDetailRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t.source.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,2];case 1:if(a.sent(),e=t.source.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,i="".concat(r,"_").concat(n),this.providers.has(i))return[2,this.providers.get(i)];ibiz.log.error("找不到插件标识".concat(i,"对应的适配器"),t),a.label=2;case 2:if(o=t.source.detailType,this.providers.has(o))return[2,this.providers.get(o)];throw new RuntimeError("找不到表单成员类型".concat(o,"对应的适配器"))}}))}))},e}(RegisterBase),ControlRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:return[4,ibiz.plugin.loadPredefinedPlugin("CONTROL_".concat(t.source.controlType,"_").concat(t.source.controlStyle||"DEFAULT"))];case 1:return c.sent(),t.source.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,3];case 2:if(c.sent(),e=t.source.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,s="".concat(r,"_").concat(n),this.providers.has(s))return[2,this.providers.get(s)];ibiz.log.error("找不到插件标识".concat(s,"对应的适配器"),t),c.label=3;case 3:if(i=t.source,o=i.controlType,a=i.controlStyle){if(s="".concat(o,"_").concat(a),this.providers.has(s))return[2,this.providers.get(s)];ibiz.log.error("找不到部件类型:".concat(o,"的部件样式:").concat(a,"对应的适配器"),t)}if(this.providers.has(o))return[2,this.providers.get(o)];throw new RuntimeError("找不到部件类型".concat(o,"对应的适配器"))}}))}))},e}(RegisterBase),ViewRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s;return __generator(this,(function(c){switch(c.label){case 0:return[4,ibiz.plugin.loadPredefinedPlugin("VIEW_".concat(t.source.viewType,"_").concat(t.source.viewStyle||"DEFAULT"))];case 1:return c.sent(),(e=t.source).getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(e.getPSSysPFPlugin())]:[3,3];case 2:if(c.sent(),r=e.getPSSysPFPlugin(),n=r.pluginType,i=r.pluginCode,s="".concat(n,"_").concat(i),this.providers.has(s))return[2,this.providers.get(s)];ibiz.log.error("找不到插件标识[".concat(s,"]对应的适配器"),e),c.label=3;case 3:if(o=e.viewType,(a=e.viewStyle)&&"DEFAULT"!==a){if(s="".concat(o,"_").concat(a),this.providers.has(s))return[2,this.providers.get(s)];ibiz.log.error("找不到视图类型:[".concat(o,"]的视图样式:[").concat(a,"]对应的适配器"),e)}if(this.providers.has(o))return[2,this.providers.get(o)];throw ibiz.log.error("找不到视图类型[".concat(o,"]对应的适配器"),e),new UnsupportedModelError(e,"暂未实现")}}))}))},e}(RegisterBase),PortletPartRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return e=t.source.portletType,t.source.getPSSysPFPlugin()&&"CONTAINER"!==e?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,2];case 1:if(a.sent(),r=t.source.getPSSysPFPlugin(),n=r.pluginType,i=r.pluginCode,o="".concat(n,"_").concat(i),this.providers.has(o))return[2,this.providers.get(o)];ibiz.log.error("找不到插件标识".concat(o,"对应的适配器"),t),a.label=2;case 2:if(this.providers.has(e))return[2,this.providers.get(e)];throw new RuntimeError("找不到门户部件类型".concat(e,"对应的适配器"))}}))}))},e}(RegisterBase),GridColumnRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o,a,s,c;return __generator(this,(function(u){switch(u.label){case 0:return t.source.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,2];case 1:if(u.sent(),e=t.source.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,i="".concat(r,"_").concat(n),this.providers.has(i))return[2,this.providers.get(i)];ibiz.log.error("找不到插件标识".concat(i,"对应的适配器"),t),u.label=2;case 2:if(o=t.source,a=o.columnType,s=o.enableRowEdit,c=s?"".concat(a,"_EDIT"):a,this.providers.has(c))return[2,this.providers.get(c)];throw new RuntimeError("找不到表格列类型".concat(c,"对应的适配器"))}}))}))},e}(RegisterBase),PanelItemRegister=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.get=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o;return __generator(this,(function(a){switch(a.label){case 0:return t.source.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(t.source.getPSSysPFPlugin())]:[3,2];case 1:if(a.sent(),e=t.source.getPSSysPFPlugin(),r=e.pluginType,n=e.pluginCode,i="".concat(r,"_").concat(n),this.providers.has(i))return[2,this.providers.get(i)];ibiz.log.error("找不到插件标识".concat(i,"对应的适配器"),t),a.label=2;case 2:if(o=t.source.itemType,this.providers.has(o))return[2,this.providers.get(o)];throw new RuntimeError("找不到面板成员类型".concat(o,"对应的适配器"))}}))}))},e}(RegisterBase),RegisterCenter=exports("RegisterCenter",(function(){this.uiAction=new UIActionRegister,this.editor=new EditorRegister,this.formDetail=new FormDetailRegister,this.panelItem=new PanelItemRegister,this.gridColumn=new GridColumnRegister,this.portletPart=new PortletPartRegister,this.control=new ControlRegister,this.view=new ViewRegister})),BackendUIActionProvider=exports("BackendUIActionProvider",function(){function t(){}return t.prototype.getHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.handler||(this.handler=new BackendUIActionHandler),[2,this.handler]}))}))},t}()),CommonSysUIActionProvider=exports("CommonSysUIActionProvider",function(){function t(){}return t.prototype.getHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.handler||(this.handler=new CommonSysUIActionHandler),[2,this.handler]}))}))},t}()),FrontUIActionProvider=exports("FrontUIActionProvider",function(){function t(){}return t.prototype.getHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.handler||(this.handler=new FrontUIActionHandler),[2,this.handler]}))}))},t}()),WFWithdrawUIActionProvider=exports("WFWithdrawUIActionProvider",function(){function t(){}return t.prototype.getHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.handler||(this.handler=new WFWithdrawUIActionHandler),[2,this.handler]}))}))},t}());function presetUIActionProvider(){var t=ibiz.register.uiAction;t&&(t.register("FRONT",new FrontUIActionProvider),t.register("BACKEND",new BackendUIActionProvider),t.register("SYS_New",new CommonSysUIActionProvider),t.register("SYS_Edit",new CommonSysUIActionProvider),t.register("SYS_Save",new CommonSysUIActionProvider),t.register("SYS_SaveAndExit",new CommonSysUIActionProvider),t.register("SYS_SaveRow",new CommonSysUIActionProvider),t.register("SYS_SaveAndNew",new CommonSysUIActionProvider),t.register("SYS_Remove",new CommonSysUIActionProvider),t.register("SYS_RemoveAndExit",new CommonSysUIActionProvider),t.register("SYS_NewRow",new CommonSysUIActionProvider),t.register("SYS_SaveAndStart",new CommonSysUIActionProvider),t.register("SYS_ViewWFStep",new CommonSysUIActionProvider),t.register("SYS_ToggleFilter",new CommonSysUIActionProvider),t.register("SYS_Exit",new CommonSysUIActionProvider),t.register("SYS_Refresh",new CommonSysUIActionProvider),t.register("SYS_Import",new CommonSysUIActionProvider),t.register("SYS_ExportExcel",new CommonSysUIActionProvider),t.register("DEUIACTION_WFWithdraw",new WFWithdrawUIActionProvider))}var GlobalModel=function(){function t(){this.util=new ModelUtil,this.views=new Map}return t.prototype.init=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i,o=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,this.util.create((function(e){return __awaiter(o,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:return r="".concat(ibiz.env.remoteModelUrl).concat(e).concat(t?"?dynamodeltag=".concat(t):""),[4,ibiz.net.get(r)];case 1:return(n=i.sent()).ok?(e.endsWith("PSSYSAPP.json")&&(n.data.id=ibiz.env.appId),[2,n.data]):[2,{}]}}))}))}),ibiz.env.hub)];case 1:return[4,a.sent().getModelService()];case 2:return e=a.sent(),[4,setRemoteStyle("".concat(ibiz.env.remoteModelUrl,"/PSSYSAPP.json.css").concat(t?"?dynamodeltag=".concat(t):""))];case 3:return a.sent(),this.setViews(ModelConst.DEFAULT_SANDBOX,e.app.getAllPSAppViews()||[]),[4,ibiz.hub.createApp(ModelConst.DEFAULT_SANDBOX,e)];case 4:if(a.sent(),r=e.app.getAllPSSubAppRefs())for(n=0;n<r.length;n++)i=r[n],this.setViews(i.M.id,i.getAllPSAppViews()||[]);return[2]}}))}))},t.prototype.initSubApp=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n,i=this;return __generator(this,(function(o){switch(o.label){case 0:return e=t.M.id,[4,this.util.createSub((function(r){return __awaiter(i,void 0,void 0,(function(){var n,i;return __generator(this,(function(o){switch(o.label){case 0:return n="".concat(ibiz.env.remoteModelUrl,"/subapps/").concat(e).concat(r,"?dynamodeltag=").concat(t.M.dynamodeltag),[4,ibiz.net.get(n)];case 1:return(i=o.sent()).ok?(r.endsWith("PSSYSAPP.json")&&(i.data.id=e),[2,i.data]):[2,{}]}}))}))}),e)];case 1:return r=o.sent(),[4,setRemoteStyle("".concat(ibiz.env.remoteModelUrl,"/subapps/").concat(e,"/PSSYSAPP.json.css?dynamodeltag=").concat(t.M.dynamodeltag))];case 2:return o.sent(),[4,r.getModelService()];case 3:return n=o.sent(),[4,ibiz.hub.createApp(e,n)];case 4:return o.sent(),[2,n]}}))}))},t.prototype.setViews=function(t,e){var r=this;e.forEach((function(e){r.views.set(e.modelPath,t)}))},t.prototype.getAppModelService=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,4]),[4,this.util.getModelService(t)];case 1:return[2,n.sent()];case 2:return n.sent(),[4,this.util.getModelService()];case 3:if(e=n.sent(),!(r=e.app.findPSSubAppRef(t)))throw new DefectModelError(e.app,"子应用[".concat(t,"]不存在"));return[2,this.initSubApp(r)];case 4:return[2]}}))}))},t.prototype.getView=function(t){return __awaiter(this,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(!this.views.has(t))throw new Error("未找到视图模型: ".concat(t));return e=this.views.get(t),[4,this.getAppModelService(e)];case 1:return[4,(r=i.sent()).factory.getView(t)];case 2:if(n=i.sent())return[2,n];throw new DefectModelError(r.app,"未找到视图[".concat(t,"]"))}}))}))},t.prototype.getAppFunc=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return(e=t.appId)===ModelConst.DEFAULT_SANDBOX?[2,t.appFunc]:[4,this.getAppModelService(e)];case 1:return[2,r.sent().app.findPSAppFunc(t.source.M.getPSAppFunc)]}}))}))},t.prototype.getModelService=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.util.getModelService(null==t?void 0:t.srfsandbox)]}))}))},t}(),Application=function(){function t(t){this.modelService=t,this.modelService=t,this.net=new Net({baseURL:"".concat(ibiz.env.baseUrl,"/").concat(t.app.appId===ModelConst.DEFAULT_SANDBOX?ibiz.env.appId:t.app.appId)}),this.resourcePathUtil=new ServicePathUtil(t),this.es=new ServiceUtil(t),this.codeList=new CodeListService(t),this.authority=new AuthorityService(t)}return t.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.resourcePathUtil.init()];case 1:return t.sent(),[4,this.authority.init()];case 2:return t.sent(),[2]}}))}))},t}(),RuntimeHub=function(){function t(){this.appMap=new Map}return t.prototype.createApp=function(t,e){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return r=new Application(e),this.appMap.set(t,r),[4,r.init()];case 1:return n.sent(),[2,r]}}))}))},t.prototype.getApp=function(t){var e=null;return t&&(e=t instanceof Object?t instanceof ModelObject?t.modelService.app.appId:t.appId:t),e||(e=ModelConst.DEFAULT_SANDBOX),this.appMap.get(e)},t}();function install(){var t=window.ibiz;t.hub=new RuntimeHub,t.model=new GlobalModel,t.register=new RegisterCenter,t.config=new GlobalConfig,t.auth=new AuthService,installCommand(),presetUIActionProvider()}var PluginStaticResource=exports("PluginStaticResource",function(){function t(t){this.baseDir=t.substring(0,t.lastIndexOf("/"))}return t.prototype.dir=function(t){return this.baseDir+t},t}()),RemotePluginItem=exports("RemotePluginItem",(function(t,e,r){this.tag=t,this.repo=e,this.config=r}))}}}));