@ibiz-template/runtime 0.1.7 → 0.1.9

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 (210) hide show
  1. package/dist/index.esm.js +4262 -3993
  2. package/dist/index.system.min.js +1 -1
  3. package/dist/index.system.min.js.map +1 -1
  4. package/out/app-hub.d.ts +8 -0
  5. package/out/app-hub.d.ts.map +1 -1
  6. package/out/app-hub.js +8 -0
  7. package/out/command/app/open-app-view/open-app-view.js +5 -5
  8. package/out/constant/sys-uiaction-tag.d.ts +8 -0
  9. package/out/constant/sys-uiaction-tag.d.ts.map +1 -1
  10. package/out/constant/sys-uiaction-tag.js +8 -0
  11. package/out/controller/common/control/control.controller.d.ts +9 -1
  12. package/out/controller/common/control/control.controller.d.ts.map +1 -1
  13. package/out/controller/common/control/control.controller.js +17 -7
  14. package/out/controller/common/control/md-control.controller.d.ts +3 -1
  15. package/out/controller/common/control/md-control.controller.d.ts.map +1 -1
  16. package/out/controller/common/control/md-control.controller.js +31 -13
  17. package/out/controller/common/view/view.controller.d.ts +1 -0
  18. package/out/controller/common/view/view.controller.d.ts.map +1 -1
  19. package/out/controller/common/view/view.controller.js +6 -3
  20. package/out/controller/hub.controller.d.ts +16 -0
  21. package/out/controller/hub.controller.d.ts.map +1 -0
  22. package/out/controller/hub.controller.js +20 -0
  23. package/out/controller/index.d.ts +1 -0
  24. package/out/controller/index.d.ts.map +1 -1
  25. package/out/controller/index.js +1 -0
  26. package/out/controller/utils/value-rule/value-rule.d.ts.map +1 -1
  27. package/out/controller/utils/value-rule/value-rule.js +1 -1
  28. package/out/engine/md-view.engine.d.ts.map +1 -1
  29. package/out/engine/md-view.engine.js +10 -4
  30. package/out/install.js +2 -2
  31. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts +9 -0
  32. package/out/interface/common/i-app-hub-service/i-app-hub-service.d.ts.map +1 -1
  33. package/out/interface/controller/app.d.ts +37 -0
  34. package/out/interface/controller/app.d.ts.map +1 -0
  35. package/out/interface/controller/app.js +1 -0
  36. package/out/interface/controller/common/i-icon/i-icon.d.ts +7 -0
  37. package/out/interface/controller/common/i-icon/i-icon.d.ts.map +1 -1
  38. package/out/interface/controller/controller/control/i-context-menu.controller.d.ts +15 -0
  39. package/out/interface/controller/controller/control/i-context-menu.controller.d.ts.map +1 -0
  40. package/out/interface/controller/controller/control/i-context-menu.controller.js +1 -0
  41. package/out/interface/controller/controller/control/i-grid.controller.d.ts +11 -4
  42. package/out/interface/controller/controller/control/i-grid.controller.d.ts.map +1 -1
  43. package/out/interface/controller/controller/control/i-md-control.controller.d.ts +7 -0
  44. package/out/interface/controller/controller/control/i-md-control.controller.d.ts.map +1 -1
  45. package/out/interface/controller/controller/control/i-toolbar.controller.d.ts +2 -2
  46. package/out/interface/controller/controller/control/i-toolbar.controller.d.ts.map +1 -1
  47. package/out/interface/controller/controller/control/i-tree.controller.d.ts +7 -0
  48. package/out/interface/controller/controller/control/i-tree.controller.d.ts.map +1 -1
  49. package/out/interface/controller/controller/control/index.d.ts +1 -0
  50. package/out/interface/controller/controller/control/index.d.ts.map +1 -1
  51. package/out/interface/controller/controller/control/index.js +1 -0
  52. package/out/interface/controller/controller/view/i-view.controller.d.ts +8 -0
  53. package/out/interface/controller/controller/view/i-view.controller.d.ts.map +1 -1
  54. package/out/interface/controller/event/argument/index.d.ts +1 -0
  55. package/out/interface/controller/event/argument/index.d.ts.map +1 -1
  56. package/out/interface/controller/event/argument/row-edit-change.event.d.ts +20 -0
  57. package/out/interface/controller/event/argument/row-edit-change.event.d.ts.map +1 -0
  58. package/out/interface/controller/event/argument/row-edit-change.event.js +1 -0
  59. package/out/interface/controller/event/control/i-context-menu.event.d.ts +11 -0
  60. package/out/interface/controller/event/control/i-context-menu.event.d.ts.map +1 -0
  61. package/out/interface/controller/event/control/i-context-menu.event.js +1 -0
  62. package/out/interface/controller/event/control/i-grid.event.d.ts +13 -1
  63. package/out/interface/controller/event/control/i-grid.event.d.ts.map +1 -1
  64. package/out/interface/controller/event/control/i-tree.event.d.ts +19 -0
  65. package/out/interface/controller/event/control/i-tree.event.d.ts.map +1 -1
  66. package/out/interface/controller/event/control/index.d.ts +1 -0
  67. package/out/interface/controller/event/control/index.d.ts.map +1 -1
  68. package/out/interface/controller/event/control/index.js +1 -0
  69. package/out/interface/controller/event/view/i-pickup-md-view.event.d.ts +31 -0
  70. package/out/interface/controller/event/view/i-pickup-md-view.event.d.ts.map +1 -0
  71. package/out/interface/controller/event/view/i-pickup-md-view.event.js +1 -0
  72. package/out/interface/controller/event/view/index.d.ts +1 -0
  73. package/out/interface/controller/event/view/index.d.ts.map +1 -1
  74. package/out/interface/controller/event/view/index.js +1 -0
  75. package/out/interface/controller/index.d.ts +1 -0
  76. package/out/interface/controller/index.d.ts.map +1 -1
  77. package/out/interface/controller/state/control/i-context-menu.state.d.ts +11 -0
  78. package/out/interface/controller/state/control/i-context-menu.state.d.ts.map +1 -0
  79. package/out/interface/controller/state/control/i-context-menu.state.js +1 -0
  80. package/out/interface/controller/state/control/i-grid.state.d.ts +8 -0
  81. package/out/interface/controller/state/control/i-grid.state.d.ts.map +1 -1
  82. package/out/interface/controller/state/control/i-tree.state.d.ts +16 -10
  83. package/out/interface/controller/state/control/i-tree.state.d.ts.map +1 -1
  84. package/out/interface/controller/state/control/index.d.ts +1 -0
  85. package/out/interface/controller/state/control/index.d.ts.map +1 -1
  86. package/out/interface/controller/state/control/index.js +1 -0
  87. package/out/interface/controller/state/view/i-pickup-md-view.state.d.ts +22 -0
  88. package/out/interface/controller/state/view/i-pickup-md-view.state.d.ts.map +1 -0
  89. package/out/interface/controller/state/view/i-pickup-md-view.state.js +1 -0
  90. package/out/interface/controller/state/view/index.d.ts +1 -0
  91. package/out/interface/controller/state/view/index.d.ts.map +1 -1
  92. package/out/interface/controller/state/view/index.js +1 -0
  93. package/out/interface/controller/work-flow/wf-link.d.ts +9 -0
  94. package/out/interface/controller/work-flow/wf-link.d.ts.map +1 -1
  95. package/out/interface/service/service/i-auth.service.d.ts +29 -0
  96. package/out/interface/service/service/i-auth.service.d.ts.map +1 -0
  97. package/out/interface/service/service/i-auth.service.js +1 -0
  98. package/out/interface/service/service/index.d.ts +5 -4
  99. package/out/interface/service/service/index.d.ts.map +1 -1
  100. package/out/interface/service/service/index.js +1 -4
  101. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts +20 -11
  102. package/out/interface/util/i-open-view-util/i-open-view-util.d.ts.map +1 -1
  103. package/out/interface/util/script/i-script-function.d.ts +8 -1
  104. package/out/interface/util/script/i-script-function.d.ts.map +1 -1
  105. package/out/logic-scheduler/executor/script-executor.d.ts +6 -6
  106. package/out/logic-scheduler/executor/script-executor.d.ts.map +1 -1
  107. package/out/logic-scheduler/executor/script-executor.js +10 -14
  108. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts +1 -0
  109. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.d.ts.map +1 -1
  110. package/out/logic-scheduler/trigger/item-dyna-logic-trigger.js +6 -2
  111. package/out/logic-scheduler/trigger/logic-trigger.d.ts +8 -0
  112. package/out/logic-scheduler/trigger/logic-trigger.d.ts.map +1 -1
  113. package/out/logic-scheduler/trigger/logic-trigger.js +17 -0
  114. package/out/model/layout/layout.d.ts.map +1 -1
  115. package/out/model/layout/layout.js +1 -0
  116. package/out/register/helper/editor-register.d.ts.map +1 -1
  117. package/out/register/helper/editor-register.js +12 -1
  118. package/out/service/dto/method.dto.d.ts.map +1 -1
  119. package/out/service/dto/method.dto.js +8 -0
  120. package/out/service/service/auth/v7-auth.service.d.ts +14 -0
  121. package/out/service/service/auth/v7-auth.service.d.ts.map +1 -0
  122. package/out/service/service/auth/v7-auth.service.js +47 -0
  123. package/out/service/service/index.d.ts +1 -1
  124. package/out/service/service/index.d.ts.map +1 -1
  125. package/out/service/service/index.js +1 -1
  126. package/out/service/vo/control.vo.d.ts +8 -0
  127. package/out/service/vo/control.vo.d.ts.map +1 -1
  128. package/out/service/vo/control.vo.js +16 -1
  129. package/out/service/vo/tree-node-data/tree-code-list-node-data.d.ts.map +1 -1
  130. package/out/service/vo/tree-node-data/tree-code-list-node-data.js +1 -0
  131. package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts +21 -2
  132. package/out/service/vo/tree-node-data/tree-data-set-node-data.d.ts.map +1 -1
  133. package/out/service/vo/tree-node-data/tree-data-set-node-data.js +50 -0
  134. package/out/service/vo/tree-node-data/tree-node-data.d.ts +12 -1
  135. package/out/service/vo/tree-node-data/tree-node-data.d.ts.map +1 -1
  136. package/out/service/vo/tree-node-data/tree-node-data.js +21 -2
  137. package/out/service/vo/tree-node-data/tree-static-node-data.d.ts.map +1 -1
  138. package/out/service/vo/tree-node-data/tree-static-node-data.js +1 -0
  139. package/out/types.d.ts +3 -4
  140. package/out/types.d.ts.map +1 -1
  141. package/out/utils/open-redirect-view/open-redirect-view.d.ts.map +1 -1
  142. package/out/utils/open-redirect-view/open-redirect-view.js +17 -17
  143. package/out/utils/script/script-function.d.ts +9 -0
  144. package/out/utils/script/script-function.d.ts.map +1 -1
  145. package/out/utils/script/script-function.js +79 -2
  146. package/out/utils/verify/de-rule-verify.js +1 -1
  147. package/package.json +3 -3
  148. package/src/app-hub.ts +9 -0
  149. package/src/command/app/open-app-view/open-app-view.ts +5 -5
  150. package/src/constant/sys-uiaction-tag.ts +8 -0
  151. package/src/controller/common/control/control.controller.ts +19 -9
  152. package/src/controller/common/control/md-control.controller.ts +37 -14
  153. package/src/controller/common/view/view.controller.ts +9 -3
  154. package/src/controller/hub.controller.ts +22 -0
  155. package/src/controller/index.ts +1 -0
  156. package/src/controller/utils/value-rule/value-rule.ts +1 -0
  157. package/src/engine/md-view.engine.ts +13 -4
  158. package/src/install.ts +2 -2
  159. package/src/interface/common/i-app-hub-service/i-app-hub-service.ts +10 -0
  160. package/src/interface/controller/app.ts +38 -0
  161. package/src/interface/controller/common/i-icon/i-icon.ts +8 -0
  162. package/src/interface/controller/controller/control/i-context-menu.controller.ts +19 -0
  163. package/src/interface/controller/controller/control/i-grid.controller.ts +12 -4
  164. package/src/interface/controller/controller/control/i-md-control.controller.ts +9 -1
  165. package/src/interface/controller/controller/control/i-toolbar.controller.ts +6 -3
  166. package/src/interface/controller/controller/control/i-tree.controller.ts +8 -0
  167. package/src/interface/controller/controller/control/index.ts +1 -0
  168. package/src/interface/controller/controller/view/i-view.controller.ts +9 -0
  169. package/src/interface/controller/event/argument/index.ts +1 -0
  170. package/src/interface/controller/event/argument/row-edit-change.event.ts +20 -0
  171. package/src/interface/controller/event/control/i-context-menu.event.ts +10 -0
  172. package/src/interface/controller/event/control/i-grid.event.ts +14 -1
  173. package/src/interface/controller/event/control/i-tree.event.ts +14 -0
  174. package/src/interface/controller/event/control/index.ts +1 -0
  175. package/src/interface/controller/event/view/i-pickup-md-view.event.ts +29 -0
  176. package/src/interface/controller/event/view/index.ts +1 -0
  177. package/src/interface/controller/index.ts +1 -0
  178. package/src/interface/controller/state/control/i-context-menu.state.ts +10 -0
  179. package/src/interface/controller/state/control/i-grid.state.ts +9 -0
  180. package/src/interface/controller/state/control/i-tree.state.ts +19 -9
  181. package/src/interface/controller/state/control/index.ts +1 -0
  182. package/src/interface/controller/state/view/i-pickup-md-view.state.ts +22 -0
  183. package/src/interface/controller/state/view/index.ts +1 -0
  184. package/src/interface/controller/work-flow/wf-link.ts +10 -0
  185. package/src/interface/service/service/i-auth.service.ts +29 -0
  186. package/src/interface/service/service/index.ts +5 -4
  187. package/src/interface/util/i-open-view-util/i-open-view-util.ts +21 -11
  188. package/src/interface/util/script/i-script-function.ts +9 -1
  189. package/src/logic-scheduler/executor/script-executor.ts +11 -14
  190. package/src/logic-scheduler/trigger/item-dyna-logic-trigger.ts +8 -2
  191. package/src/logic-scheduler/trigger/logic-trigger.ts +19 -0
  192. package/src/model/layout/layout.ts +1 -0
  193. package/src/register/helper/editor-register.ts +17 -1
  194. package/src/service/dto/method.dto.ts +8 -0
  195. package/src/service/service/auth/v7-auth.service.ts +49 -0
  196. package/src/service/service/index.ts +1 -1
  197. package/src/service/vo/control.vo.ts +17 -1
  198. package/src/service/vo/tree-node-data/tree-code-list-node-data.ts +2 -0
  199. package/src/service/vo/tree-node-data/tree-data-set-node-data.ts +63 -2
  200. package/src/service/vo/tree-node-data/tree-node-data.ts +27 -3
  201. package/src/service/vo/tree-node-data/tree-static-node-data.ts +2 -0
  202. package/src/types.ts +3 -3
  203. package/src/ui-action/provider/front-ui-action-provider.ts +1 -1
  204. package/src/utils/open-redirect-view/open-redirect-view.ts +20 -19
  205. package/src/utils/script/script-function.ts +81 -3
  206. package/src/utils/verify/de-rule-verify.ts +1 -0
  207. package/out/service/service/auth/auth.service.d.ts +0 -30
  208. package/out/service/service/auth/auth.service.d.ts.map +0 -1
  209. package/out/service/service/auth/auth.service.js +0 -37
  210. package/src/service/service/auth/auth.service.ts +0 -44
@@ -1,2 +1,2 @@
1
- System.register(["@ibiz-template/core","lodash-es","qx-util","qs","ramda"],(function(t){"use strict";var e,s,i,a,n,r,o,c,l,d,h,u,p,E,g,m,w,f,I,D,A,P,y,v,T,C,_,b,V,L;return{setters:[function(t){e=t.RuntimeError,s=t.RuntimeModelError,i=t.ModelError,a=t.IBizContext,n=t.HttpResponse,r=t.HttpError,o=t.Net,c=t.StringUtil,l=t.NOOP,d=t.isElementSame},function(t){h=t.isEmpty,u=t.isFunction},function(t){p=t.notNilEmpty,E=t.isNilOrEmpty,g=t.AsyncSeriesHook,m=t.QXEvent,w=t.createUUID,f=t.isArray,I=t.clearAll,D=t.ascSort,A=t.descSort},function(t){P=t.default},function(t){y=t.isNotNil,v=t.isNil,T=t.mergeRight,C=t.isEmpty,_=t.clone,b=t.equals,V=t.where,L=t.mergeLeft}],execute:function(){t({calcContentAlignStyle:function(t){const{valignSelf:e,halignSelf:s}=t,i={};if(e||s){switch(Object.assign(i,{display:"flex"}),e){case"TOP":Object.assign(i,{"align-items":"flex-start"});break;case"MIDDLE":Object.assign(i,{"align-items":"center"});break;case"BOTTOM":Object.assign(i,{"align-items":"flex-end"})}switch(s){case"LEFT":Object.assign(i,{"justify-content":"flex-start"});break;case"CENTER":Object.assign(i,{"justify-content":"center"});break;case"RIGHT":Object.assign(i,{"justify-content":"flex-end"});break;case"JUSTIFY":Object.assign(i,{"justify-content":"space-between"})}}return i},calcDeCodeNameById:$,calcDynaClass:function(t,e){return Et.execScriptFn({data:e},t,{singleRowReturn:!0})},calcGridLayoutPos:function(t){const{layout:e,colXS:s,colXSOffset:i,colSM:a,colSMOffset:n,colMD:r,colMDOffset:o,colLG:c,colLGOffset:l}=t,d=(t,s)=>({span:(t&&-1!==t?t:"TABLE_24COL"===e?24:12)*("TABLE_24COL"===e?1:2),offset:s&&-1!==s?s:void 0});return{xs:d(s,i),sm:d(a,n),md:d(r,o),lg:d(c,l)}},calcLayoutHeightWidth:function(t){const{width:e,height:s,widthMode:i,heightMode:a}=t,n={width:"",height:""};"FULL"===i?n.width="100%":e&&e>0&&(n.width=e>0&&e<=1?"".concat(100*e,"%"):"".concat(e,"PERCENTAGE"===i?"%":"px"));"FULL"===a?n.height="100%":s&&s>0&&(n.height=s>0&&s<=1?"".concat(100*s,"%"):"".concat(s,"PERCENTAGE"===a?"%":"px"));return n},calcMainStateOPPrivsStrs:q,calcNavParams:function(t,e){const{deName:s,navFilter:i,pickupDEFName:a,navContexts:n,navParams:r}=t,{context:o,params:c,data:l,derValue:d}=e,h={},u={},p=d||l.srfkey;p&&(s&&(h[s]=p),i&&(u[i]=p),a&&(u["n_".concat(a.toLowerCase(),"_eq")]=p));const E=z(n,o,c,l),g=z(r,o,c,l);return Object.assign(h,E),Object.assign(u,g),{resultContext:h,resultParams:u}},calcResPath:Kt,calcRouteContext:function(t){let e=[];e=e.sort(((t,e)=>e.length-t.length));const[s]=e;if(s){const t={};return s.forEach((([e,s])=>{t[e]=s})),t}return{}},compare:ct,compareNumber:lt,contains:dt,convertNavData:z,convertNavDataByArray:G,convertNavDataByObject:j,convertObjectToNavParams:X,execDELogic:De,execDELogicAction:Ae,execDELogicById:async function(t,s,i,a,n){const r=await async function(t,e,s){const i=await ibiz.hub.getAppDataEntity(e,s);return Q(t,i)}(t,s,i.srfappid);if(!r)throw new e("".concat(s,"找不到实体逻辑").concat(t));return De(r,i,a,n)},execFieldLogics:Pe,execUILogic:ps,filterFieldLogics:J,filterValueRules:function(t,e){return t.filter((t=>{const{checkMode:s}=t,i=t.deformItemName||t.degridEditItemName;return 2!==s&&i===e}))},findChildFormDetails:function(t){let e;switch(t.detailType){case"TABPANEL":e=t.deformTabPages;break;case"FORMPAGE":case"TABPAGE":case"GROUPPANEL":e=t.deformDetails}return e||[]},findDELogic:Q,findEditItem:function(t,e){var s;return null==(s=t.degridEditItems)?void 0:s.find((t=>t.codeName===e))},findFieldById:Z,findModelChild:H,formatMultiData:K,generateRules:function(t,s,i){const a=[];return t.forEach((t=>{const{valueRuleType:n}=t,r=t.sysValueRule,o=t.defvalueRule;if("SYSVALUERULE"===n&&r)"REG"===r.ruleType?a.push({pattern:new RegExp(r.regExCode),message:r.ruleInfo,trigger:"change blur"}):"SCRIPT"===r.ruleType&&a.push({validator:(t,e,s,i)=>{if(!e)return!0;try{Et.execScriptFn({rule:t,value:e,callback:s,source:i},r.scriptCode)}catch(t){return console.error(t),!1}return!0},trigger:"change blur"});else if("DEFVALUERULE"===n&&o){const t=i||s;a.push({validator:(s,i,a,n)=>{if(E(n[t]))return!0;const{isPast:r,infoMessage:c}=gt(t,n,o.groupCond);return r||a(new e(c||o.ruleInfo)),!0},trigger:"change blur"})}})),a},getAppViewRef:function(t,e){var s,i;let a=t.appViewRefs||[];(null==(i=null==(s=t.viewLayoutPanel)?void 0:s.appViewRefs)?void 0:i.length)&&(a=a.concat(t.viewLayoutPanel.appViewRefs));return a.find((t=>t.name===e||t.id===e))},getChildNodeRSs:function(t,e){const s=e.parentId||et(t).id;return t.detreeNodeRSs.filter((t=>{return t.parentDETreeNodeId===s&&(i=t.searchMode,a=e.hasQuery,3===i||(a?1===i:2===i));var i,a}))},getControl:function(t,e){var s,i;let a=t.controls||[];(null==(i=null==(s=t.viewLayoutPanel)?void 0:s.controls)?void 0:i.length)&&(a=a.concat(t.viewLayoutPanel.controls));return a.find((t=>t.name===e||t.codeName===e||t.id===e))},getControlProvider:ke,getControlsByView:st,getDeACMode:async function(t,e,s){var i;const a=await ibiz.hub.getAppDataEntity(e,s);return null==(i=a.appDEACModes)?void 0:i.find((e=>e.id===t))},getEditorProvider:async function(t){let e;const{editorType:s,editorStyle:i}=t;if(i&&"DEFAULT"!==i){e=ze("".concat(s,"_").concat(i)),e||ibiz.log.error("找不到编辑器类型:[".concat(s,"]的编辑器样式:[").concat(i,"]对应的适配器"),t)}e||(e=ze(s));e||ibiz.log.error("找不到编辑器类型".concat(s,"对应的适配器"));return e},getFormDetailProvider:async function(t){let e;const{detailType:s}=t;e||(i=s,e=ibiz.register.get("".concat(Ge,"_").concat(i)));var i;e||ibiz.log.error("找不到表单成员类型".concat(s,"对应的适配器"));return e},getGridColumnProvider:async function(t){let e;const{columnType:s,enableRowEdit:i}=t,a=i?"".concat(s,"_EDIT"):s;e||(e=function(t){return ibiz.register.get("".concat(je,"_").concat(t))}(a));e||ibiz.log.error("找不到表格列类型".concat(a,"对应的适配器"));return e},getMatchResPath:Xt,getOriginData:function(t){let e=Array.isArray(t)?t[0]:t;e&&e instanceof Ce&&(e=e.getOrigin());return e},getPanelItemProvider:async function(t){var e;let s;const{itemType:i}=t;if("CONTAINER"===i){const e=t.predefinedType||"DEFAULT";s=Ke("CONTAINER_".concat(e)),s||ibiz.log.error("找不到面板容器预置类型为".concat(e,"的适配器"))}if("RAWITEM"===i){const i=(null==(e=t.rawItem)?void 0:e.predefinedType)||"DEFAULT";s=Ke("RAWITEM_".concat(i)),s||ibiz.log.error("找不到面板成员直接内容预置类型为".concat(i,"的适配器"))}s||(s=Ke(i));s||ibiz.log.error("找不到面板成员类型".concat(i,"对应的适配器"));return s},getPortletProvider:async function(t){let e;const{portletType:s}=t;e||(i=s,e=ibiz.register.get("".concat(Je,"_").concat(i)));var i;e||ibiz.log.error("找不到门户部件成员类型".concat(s,"对应的适配器"));return e},getRootNode:et,getTreeNode:function(t,e){return t.detreeNodes.find((t=>t.id===e))},getUIActionById:tt,getUIActionProvider:qe,getViewEngines:at,getViewLogics:it,getViewProvider:async function(t){let e;const{viewType:s,viewStyle:i}=t;if(i&&"DEFAULT"!==i){e=Qe("".concat(s,"_").concat(i)),e||ibiz.log.error("找不到视图类型:[".concat(s,"]的视图样式:[").concat(i,"]对应的适配器"),t)}e||(e=Qe(s));e||(e=Qe("DEFAULT"));return e},getWFContext:function(t){const e={};t.param09&&(e.srfprocessinstanceid=t.param09);return e},getWFSubmitViewId:function(t,e){var s;const{type:i,sequenceflowview:a,sequenceflowmobview:n}=e,r=(null==(s=t.viewLayoutPanel)?void 0:s.appViewRefs)||t.appViewRefs,o=i?"WFUTILACTION@".concat(i.toUpperCase()):"WFACTION@".concat(ibiz.env.isMob?n:a),c=r.find((t=>t.name===o));return null==c?void 0:c.refAppViewId},hasDeCodeName:function(t,e){const s=$(e);return y(t[s])},install:function(){const{ibiz:t}=window;t.util=new Se,t.hub=new Ne,t.register=new U,t.config=new k,t.auth=new Le,t.engine=new We,Lt(),Ds(),ibiz.scheduler=new _s,ibiz.scheduler.triggerFactory.register("ITEMVISIBLE",((t,e)=>new Ls(t,e))),ibiz.scheduler.triggerFactory.register("ITEMENABLE",((t,e)=>new Ls(t,e))),ibiz.scheduler.triggerFactory.register("ITEMBLANK",((t,e)=>new Ls(t,e))),ibiz.scheduler.triggerFactory.register("TIMER",((t,e)=>new Rs(t,e))),ibiz.scheduler.triggerFactory.register("CUSTOM",((t,e)=>new Vs(t,e))),ibiz.scheduler.triggerFactory.register("VIEWEVENT",((t,e)=>new Os(t,e))),ibiz.scheduler.triggerFactory.register("CTRLEVENT",((t,e)=>new Ns(t,e))),ibiz.scheduler.executorFactory.register("SCRIPT",((t,e)=>new Ps(t,e))),ibiz.scheduler.executorFactory.register("APPDEUILOGIC",((t,e)=>new ys(t,e))),ibiz.scheduler.executorFactory.register("DEUILOGIC",((t,e)=>new ys(t,e))),ibiz.scheduler.executorFactory.register("APPUILOGIC",((t,e)=>new Ms(t,e)))},installCommand:Lt,isValueChange:function(t,e){if((v(t)||""===t)&&(v(e)||""===e))return!1;return t!==e},matchMainState:Y,openRedirectView:nt,parseUserParams:function(t){const e={},s={},i={};for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const n=t[a];if(-1!==a.indexOf(".")){const t=a.split(".");switch(t[0]){case"SRFNAVPARAM":Object.assign(e,{[t[1]]:n});break;case"SRFNAVCTX":Object.assign(s,{[t[1]]:n});break;default:Object.assign(i,{key:n})}}}return{navigateContexts:e,navigateParams:s,other:i}},presetUIActionProvider:Ds,registerControlProvider:function(t,e){ibiz.register.register("".concat(Fe,"_").concat(t),e)},registerEditorProvider:function(t,e){ibiz.register.register("".concat(Ue,"_").concat(t),e)},registerFormDetailProvider:function(t,e){ibiz.register.register("".concat(Ge,"_").concat(t),e)},registerGridColumnProvider:function(t,e){ibiz.register.register("".concat(je,"_").concat(t),e)},registerPanelItemProvider:function(t,e){ibiz.register.register("".concat(Xe,"_").concat(t.toUpperCase()),e)},registerPortletProvider:function(t,e){ibiz.register.register("".concat(Je,"_").concat(t),e)},registerUIActionProvider:Ye,registerViewProvider:function(t,e){ibiz.register.register("".concat($e,"_").concat(t),e)},strContain:ht,testCond:ot,toLocalOpenWFRedirectView:rt,verifyDeRules:gt,verifyFormGroupLogic:function t(e,a){if(function(t){return"GROUP"===t.logicType}(a)){const i=a.defdlogics;if(!i||0===i.length)throw new s(a,"发现空逻辑组,逻辑无法正常执行!");let n=!0;if("AND"===a.groupOP){n=void 0===i.find((s=>!t(e,s)))}else if("OR"===a.groupOP){n=void 0!==a.defdlogics.find((s=>t(e,s)))}return a.notMode?!n:n}if(function(t){return"SINGLE"===t.logicType}(a))return ot(e[a.defdname.toLowerCase()],a.condOP,a.value);throw new i(a,"未支持的逻辑类型".concat(a.logicType))},verifyPanelGroupLogic:function t(e,a){if(function(t){return"GROUP"===t.logicType}(a)){const i=a.panelItemLogics;if(!i||0===i.length)throw new s(a,"发现空逻辑组,逻辑无法正常执行!");let n=!0;if("AND"===a.groupOP){n=void 0===i.find((s=>!t(e,s)))}else if("OR"===a.groupOP){n=void 0!==a.panelItemLogics.find((s=>t(e,s)))}return a.notMode?!n:n}if(function(t){return"SINGLE"===t.logicType}(a))return ot(e[a.dstModelField.toLowerCase()],a.condOp,a.value);throw new i(a,"未支持的逻辑类型".concat(a.logicType))}});var R,M,O=Object.create,N=Object.defineProperty,W=Object.getOwnPropertyDescriptor,x=Object.getOwnPropertyNames,S=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty,B=(R={"../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(t,e){function s(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function i(t,e){for(var s,i="",a=0,n=-1,r=0,o=0;o<=t.length;++o){if(o<t.length)s=t.charCodeAt(o);else{if(47===s)break;s=47}if(47===s){if(n===o-1||1===r);else if(n!==o-1&&2===r){if(i.length<2||2!==a||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var c=i.lastIndexOf("/");if(c!==i.length-1){-1===c?(i="",a=0):a=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),n=o,r=0;continue}}else if(2===i.length||1===i.length){i="",a=0,n=o,r=0;continue}e&&(i.length>0?i+="/..":i="..",a=2)}else i.length>0?i+="/"+t.slice(n+1,o):i=t.slice(n+1,o),a=o-n-1;n=o,r=0}else 46===s&&-1!==r?++r:r=-1}return i}var a={resolve:function(){for(var t,e="",a=!1,n=arguments.length-1;n>=-1&&!a;n--){var r;n>=0?r=arguments[n]:(void 0===t&&(t=process.cwd()),r=t),s(r),0!==r.length&&(e=r+"/"+e,a=47===r.charCodeAt(0))}return e=i(e,!a),a?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(s(t),0===t.length)return".";var e=47===t.charCodeAt(0),a=47===t.charCodeAt(t.length-1);return 0!==(t=i(t,!e)).length||e||(t="."),t.length>0&&a&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return s(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var i=arguments[e];s(i),i.length>0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":a.normalize(t)},relative:function(t,e){if(s(t),s(e),t===e)return"";if((t=a.resolve(t))===(e=a.resolve(e)))return"";for(var i=1;i<t.length&&47===t.charCodeAt(i);++i);for(var n=t.length,r=n-i,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var c=e.length-o,l=r<c?r:c,d=-1,h=0;h<=l;++h){if(h===l){if(c>l){if(47===e.charCodeAt(o+h))return e.slice(o+h+1);if(0===h)return e.slice(o+h)}else r>l&&(47===t.charCodeAt(i+h)?d=h:0===h&&(d=0));break}var u=t.charCodeAt(i+h);if(u!==e.charCodeAt(o+h))break;47===u&&(d=h)}var p="";for(h=i+d+1;h<=n;++h)h!==n&&47!==t.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(o+d):(o+=d,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(s(t),0===t.length)return".";for(var e=t.charCodeAt(0),i=47===e,a=-1,n=!0,r=t.length-1;r>=1;--r)if(47===(e=t.charCodeAt(r))){if(!n){a=r;break}}else n=!1;return-1===a?i?"/":".":i&&1===a?"//":t.slice(0,a)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');s(t);var i,a=0,n=-1,r=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var o=e.length-1,c=-1;for(i=t.length-1;i>=0;--i){var l=t.charCodeAt(i);if(47===l){if(!r){a=i+1;break}}else-1===c&&(r=!1,c=i+1),o>=0&&(l===e.charCodeAt(o)?-1==--o&&(n=i):(o=-1,n=c))}return a===n?n=c:-1===n&&(n=t.length),t.slice(a,n)}for(i=t.length-1;i>=0;--i)if(47===t.charCodeAt(i)){if(!r){a=i+1;break}}else-1===n&&(r=!1,n=i+1);return-1===n?"":t.slice(a,n)},extname:function(t){s(t);for(var e=-1,i=0,a=-1,n=!0,r=0,o=t.length-1;o>=0;--o){var c=t.charCodeAt(o);if(47!==c)-1===a&&(n=!1,a=o+1),46===c?-1===e?e=o:1!==r&&(r=1):-1!==e&&(r=-1);else if(!n){i=o+1;break}}return-1===e||-1===a||0===r||1===r&&e===a-1&&e===i+1?"":t.slice(e,a)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var s=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return s?s===e.root?s+i:s+t+i:i}("/",t)},parse:function(t){s(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var i,a=t.charCodeAt(0),n=47===a;n?(e.root="/",i=1):i=0;for(var r=-1,o=0,c=-1,l=!0,d=t.length-1,h=0;d>=i;--d)if(47!==(a=t.charCodeAt(d)))-1===c&&(l=!1,c=d+1),46===a?-1===r?r=d:1!==h&&(h=1):-1!==r&&(h=-1);else if(!l){o=d+1;break}return-1===r||-1===c||0===h||1===h&&r===c-1&&r===o+1?-1!==c&&(e.base=e.name=0===o&&n?t.slice(1,c):t.slice(o,c)):(0===o&&n?(e.name=t.slice(1,r),e.base=t.slice(1,c)):(e.name=t.slice(o,r),e.base=t.slice(o,c)),e.ext=t.slice(r,c)),o>0?e.dir=t.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,e.exports=a}},function(){return M||(0,R[x(R)[0]])((M={exports:{}}).exports,M),M.exports}),k=class{constructor(){this.view={enableDataInfoBar:!0},this.grid={editShowMode:"cell",editSaveMode:"cell-blur"},this.appMenu={enableEcho:!1},this.codeList={timeout:36e5}}},U=t("RegisterCenter",class{constructor(){this.providers=new Map}register(t,e){this.providers.set(t,e)}unRegister(t){this.providers.delete(t)}get(t,...e){const s=this.providers.get(t);if(s)return s(...e)}});function z(t,...e){return!t||h(t)?{}:"[object Array]"===Object.prototype.toString.call(t)?G(t,...e):"[object Object]"===Object.prototype.toString.call(t)?j(t,...e):{}}function G(t,...e){const s={};for(const i of t)if(p(i.value)&&!i.rawValue){const t=e.find((t=>!E(t)&&(t[i.value]||Object.prototype.hasOwnProperty.call(t,i.value))));t&&(s[i.key.toLowerCase()]=t[i.value])}else s[i.key.toLowerCase()]=i.value||null;return s}function j(t,...e){const s={},i=/^%(.+)%$/;for(const a in t)if(p(t[a])&&i.test(t[a])){const i=t[a].substring(1,t[a].length-1),n=e.find((t=>Object.prototype.hasOwnProperty.call(t,i)));n&&(s[a.toLowerCase()]=n[i])}else s[a.toLowerCase()]=t[a]||null;return s}function X(t){const e=[],s=/^%(.+)%$/;for(const i in t){let a=!0,n=t[i];p(t[i])&&s.test(t[i])&&(a=!1,n=t[i].substring(1,t[i].length-1)),e.push({key:i.toLowerCase(),rawValue:a,value:n})}return e}function K(t,e){const s={};if(!t)return s;const i=Array.isArray(t)?t:X(t),a=e[0];return i.forEach((t=>{const{rawValue:i,value:n}=t;!i&&n&&Object.prototype.hasOwnProperty.call(a,n)&&(s[n]=e.map((t=>t[n])).join(";"))})),s}function H(t,e){if(t){const s=t.find((t=>t.id===e));if(s)return s}return null}function Y(t,e){const{mainStateAppDEFieldIds:s,demainStates:i}=t;if(s&&i){const t=[];return s.forEach((s=>{t.push(e[s])})),i.find((e=>{const{stateValue:s,state2Value:i,state3Value:a}=e;let n=!0;const r=[s,i,a];for(let e=0;e<t.length;e++)if("".concat(t[e])!=="".concat(r[e])){n=!1;break}return n}))}}function q(t,e){const s=ibiz.hub.getApp().model,{demainStateOPPrivs:i,opprivAllowMode:a}=t,n=(null==i?void 0:i.map((t=>t.name)))||[];let r=[];if(a)r=n;else{r=[...s.deopprivs,...e.deopprivs].filter((t=>!n.includes(t.name))).map((t=>t.name))}return r}function $(t){return t.split(".").pop()}function Q(t,e){var s;return null==(s=e.appDELogics)?void 0:s.find((e=>e.id===t))}function J(t,e){var s,i;const a=[];return null==(s=t.appDEFields)||s.forEach((t=>{"compute"===e&&t.computeAppDEFLogicId?a.push(t.computeAppDEFLogicId):"change"===e&&t.onChangeAppDEFLogicId?a.push(t.onChangeAppDEFLogicId):"default"===e&&t.defaultValueAppDEFLogicId&&a.push(t.defaultValueAppDEFLogicId)})),(null==(i=t.appDELogics)?void 0:i.filter((t=>a.includes(t.id))))||[]}function Z(t,e){var s;return null==(s=t.appDEFields)?void 0:s.find((t=>t.id===e))}async function tt(t){const[,,e]=t.split("@");return ibiz.hub.getApp(e).getUIAction(t)}function et(t){return t.detreeNodes.find((t=>t.rootNode))}function st(t){const{viewLayoutPanel:e}=t,s=t.controls||[];return e&&s.push(...e.controls||[]),s}function it(t){const{viewLayoutPanel:e}=t,s=t.appViewLogics||[];return e&&s.push(...e.appViewLogics||[]),s}function at(t){const{viewLayoutPanel:e}=t,s=t.appViewEngines||[];return e&&s.push(...e.appViewEngines||[]),s}async function nt(t,e,i={},a={}){return async function(t,e,i={},a={}){var n;const r=t.appViewNavContexts||[],o=z(r,e,i);e=Object.assign(e.clone(),o);const c=t.appViewNavParams||[],l=z(c,e,i);Object.assign(i,l);const d=t.appDataEntityId,h=$(d);let u=(null==(n=a.data)?void 0:n[0])||{};e[h]=u[h]||e[h]||i[h];const g=t.getDataAppDEActionId,m=ibiz.hub.getApp(t.appId),w=await m.deService.getService(d);ibiz.loading.showRedirect();try{const t=await w.exec(g||"get",e,i);if(t.ok){u=t.data;let s=u.linkurl;if(s)return e.srfprocessinstanceid&&(s+=";srfprocessinstanceid=".concat(e.srfprocessinstanceid)),ibiz.env.dev&&-1!==s.indexOf("appredirectview?")&&(s=s.slice(s.indexOf("appredirectview?"))),s.startsWith("http://")||s.startsWith("https://")?new Promise((t=>{const e=window.open(s,"_blank");e&&(e.callback=()=>{t({ok:!0,data:[]})})})):s.startsWith("appredirectview?")?(await rt(e,s,a),{ok:!0,data:[]}):{ok:!1,data:[]}}}finally{ibiz.loading.hideRedirect()}const f=await ibiz.hub.getAppDataEntity(d,t.appId),I=await async function(t,e,s,i){let a="";const n="".concat(ibiz.env.isMob?"MOB":"","EDITVIEW"),r=s.srfwf;if(p(r))return p(s.wf)?"".concat(n,":").concat(r.toUpperCase(),":").concat(s.wf.toUpperCase()):"".concat(n,":").concat(r.toUpperCase());let o="";const c=e.typeAppDEFieldId;if(c){const{codeName:e}=Z(t,c),s=i[e.toLowerCase()];p(s)&&(o=s)}if(E(o)&&t.indexTypeAppDEFieldId){const{codeName:e}=Z(t,t.indexTypeAppDEFieldId);o=i[e.toLowerCase()]}if(E(o)&&t.formTypeAppDEFieldId){const{codeName:e}=Z(t,t.formTypeAppDEFieldId);o=i[e.toLowerCase()]}a=p(o)?"".concat(n,":").concat(o.toString().toUpperCase()):"".concat(n);return a}(f,t,i,u),D=I.split(":"),A=2===D.length?I:D.slice(0,2).join(":"),P="".concat(f.name.toUpperCase(),":").concat(I),y=t.redirectAppViewRefs,v=null==y?void 0:y.find((t=>t.name===P||t.name===I||t.name===A));if(!v)throw ibiz.log.error("重定向视图引用有:",null==y?void 0:y.map((({refAppViewId:t,name:e,realTitle:s})=>({viewId:t,tag:e,title:s})))),new s(t,"未找到重定向标识[".concat(I,"]或[").concat(P,"]或工作流[").concat(A,"]对应视图"));{const t=v.refAppViewId;if(!t)throw new s(v,"未配置实际引用视图");{const s=await ibiz.commands.execute(_t.TAG,t,e,i,{...a,data:[u]});if(s)return s}}return{ok:!0,data:[]}}(t,e,i,a)}async function rt(t,s,i={}){const a=s.lastIndexOf("?"),n=decodeURIComponent(s.substring(a+1,s.length)),r=P.parse(n,{delimiter:";"}),o=r.srfdename||"";if(!o)throw new e("重定向参数缺少实体名称");const c=ibiz.hub.getApp(t.srfappid).deName2DeCodeName.get(o.toUpperCase());if(!c)throw new e("未找到指定实体的codeName: ".concat(o));r[c.toLowerCase()]=r[o.toLowerCase()];const l="".concat(c).concat(ibiz.env.isMob?"Mob":"","RedirectView"),d=await ibiz.hub.getAppView(l);if(delete r.srfdename,"undo"!==r.srfwf){const t=r.processDefinitionKey.split("-")[3],e=t.substring(0,t.lastIndexOf("v")),s=t.substring(t.lastIndexOf("v"));r.wf=e,r.wfVersion=s}r.srfprocessinstanceid&&(t.srfprocessinstanceid=r.srfprocessinstanceid,delete r.srfprocessinstanceid),await ibiz.commands.execute(_t.TAG,d.id,t,r,i)}function ot(t,s,i){if(Object.is(s,"IN"))return dt(t,i);if(Object.is(s,"NOTIN"))return!dt(t,i);switch(s){case"EQ":return"".concat(t)==="".concat(i);case"NOTEQ":return"".concat(t)!=="".concat(i);case"LT":return ct(t,i)<0;case"LTANDEQ":return ct(t,i)<=0;case"GT":return ct(t,i)>0;case"GTANDEQ":return ct(t,i)>=0;case"ISNULL":return E(t);case"ISNOTNULL":return p(t);case"TESTNULL":return v(t);case"IN":return dt(t,i);case"NOTIN":return!dt(t,i);case"LIKE":return ht(t,i);case"LEFTLIKE":return ht(t,i,"start");case"RIGHTLIKE":return ht(t,i,"end");default:throw new e("值操作:".concat(s,",暂未支持"))}}function ct(t,s){const i=Number(t),a=Number(s);if(!Number.isNaN(i)&&!Number.isNaN(a))return lt(i,a);const n=new Date(t).getTime(),r=new Date(s).getTime();if(!Number.isNaN(n)&&!Number.isNaN(r))return lt(n,r);throw new e("".concat(t," 和 ").concat(s," 无法比较大小"))}function lt(t,e){return Number.isNaN(t)&&(t=0),Number.isNaN(e)&&(e=0),t>e?1:t<e?-1:0}function dt(t,s){if(!s||"string"!=typeof s)throw new e("范围比较的条件值不存或者不是字符串");if(t){return s.split(",").includes("".concat(t))}return!1}function ht(t,e,s){if(!t||!e)return!1;const i="".concat(t).toUpperCase(),a="".concat(e).toUpperCase(),n=i.indexOf(a);switch(s){case"start":return 0===n;case"end":return n+a.length===i.length;default:return-1!==n}}var ut={singleRowReturn:!1},pt=t("ScriptFunction",class{constructor(t,e,s=ut){this.argKeys=[],this.options=s;const i=this.formatCode(e,s);this.calcArgKeys(t,s),this.scriptFn=new Function(...this.argKeys,i)}formatCode(t,e){let s=t;return e.singleRowReturn&&(s="return (".concat(s,")")),s}calcArgKeys(t,e){const s=e.presetParams?Object.keys(e.presetParams):[];s.push(...t),s.push("document","el","selector"),this.argKeys=Array.from(new Set(s))}convertArgs(t){const{presetParams:e}=this.options,s=e?T(e,t):t;s.document=document,s.selector=t=>document.getElementsByClassName(t);const i=[];return this.argKeys.forEach((t=>{i.push(s[t])})),i}exec(t){const e=this.convertArgs(t);return this.scriptFn(...e)}}),Et=t("ScriptFactory",class{static createScriptFn(t,e,s){return new pt(t,e,s)}static execScriptFn(t,e,s){return this.createScriptFn(Object.keys(t),e,s).exec(t)}});function gt(t,s,i){const a={isPast:!0,infoMessage:i.ruleInfo};if(function(t){return"GROUP"===t.condType}(i)){const e=i.conds;e&&e.length>0&&(a.isPast=function(t,e,s="AND",i=!1){if(!((null==t?void 0:t.length)>0))return!1;let a="AND"===s;for(let i=0,n=t.length;i<n;i++){const n=e(t[i],i);if("AND"===s){if(!n){a=!1;break}}else if("OR"===s&&n){a=!0;break}}return i?!a:a}(e,(e=>{const{isPast:i,infoMessage:n}=gt(t,s,e);return a.infoMessage=n,i}),i.condOp,!!i.notMode),!a.isPast&&("AND"===i.condOp&&i.notMode||"OR"===i.condOp&&!i.notMode)&&(a.infoMessage=i.ruleInfo))}else{t=null==i?void 0:i.defname.toLowerCase();try{if(function(t){return"SIMPLE"===t.condType}(i))a.isPast=!function(t,s,i,a,n,r,o){Object.is(n,"CURTIME")&&(i="".concat(new Date));if(Object.is(n,"ENTITYFIELD")){i=r[i=i?i.toLowerCase():""]?r[i]:i}(v(a)||C(a))&&(a="内容必须符合值规则");const c=ot(t,s,i);if(!c&&o)throw new e(a);return!c}(s[t],i.condOp,i.paramValue,i.ruleInfo,i.paramType,s,i.keyCond);else if(function(t){return"VALUERANGE2"===t.condType}(i))a.isPast=!function(t,s,i,a,n,r,o){E(r)&&(r="值必须符合值范围规则");if(E(t)){if(o)throw new e("值为空");return r="值为空",!0}if(mt(t,/^-?\d*\.?\d+$/,"",o))return!0;const c=Number.parseFloat(t);if(null!==s)if(i){if(c<s){if(o)throw new e(r);return!0}}else if(c<=s){if(o)throw new e(r);return!0}if(null!=a)if(n){if(c>a){if(o)throw new e(r);return!0}}else if(c>=a){if(o)throw new e(r);return!0}return r="",!1}(s[t],i.minValue,i.includeMinValue,i.maxValue,i.includeMaxValue,i.ruleInfo,i.keyCond);else if(function(t){return"REGEX"===t.condType}(i))a.isPast=!mt(s[t],i.regExCode,i.ruleInfo,i.keyCond);else if(function(t){return"STRINGLENGTH"===t.condType}(i))a.isPast=!function(t,s,i,a,n,r,o){E(r)&&(r="内容长度必须符合范围规则");if(E(t)){if(o)throw new e("值为空");return r="值为空",!0}const c=t.length;if(null!==s)if(i){if(c<s){if(o)throw new e(r);return!0}}else if(c<=s){if(o)throw new e(r);return!0}if(null!==a)if(n){if(c>a){if(o)throw new e(r);return!0}}else if(c>=a){if(o)throw new e(r);return!0}return r="",!1}(s[t],i.minValue,i.includeMinValue,i.maxValue,i.includeMaxValue,i.ruleInfo,i.keyCond);else if(function(t){return"SYSVALUERULE"===t.condType}(i)&&(null==i?void 0:i.sysValueRule)){const{ruleType:n,regExCode:r,scriptCode:o,ruleInfo:c}=i.sysValueRule;if(a.infoMessage=i.ruleInfo||c,"REG"===n)a.isPast=!mt(s[t],r,a.infoMessage,i.keyCond);else if("SCRIPT"===n){const{isPast:n,infoMessage:r}=function(t,s,i,a,n){E(a)&&(a="值必须符合脚本规则");const r=s;let o="",c=!0;const l=t=>{c=!1,(null==t?void 0:t.length)>0?t.forEach((t=>{(null==t?void 0:t.message)&&(o+=t.message)})):(null==t?void 0:t.message)&&(o=t.message)};try{const e=Et.execScriptFn({value:t,data:r},i);"boolean"==typeof e&&(c=e)}catch(t){ibiz.log.error(t),l(t)}if(a="",!c&&n)throw new e(a);return{isPast:c,infoMessage:o||a}}(s[t],s,o,a.infoMessage,i.keyCond);a.isPast=n,a.infoMessage=r||a.infoMessage}}}catch(t){a.isPast=!1}a.isPast=i.notMode?!a.isPast:a.isPast}return a}function mt(t,s,i,a){E(i)&&(i="值必须符合正则规则");if(E(t)){if(a)throw new e("值为空");return i="值为空",!0}if(!new RegExp(s).test(t)){if(a)throw new e(i);return!0}return i="",!1}var wt=t("LayoutPanelUtil",class{constructor(){this.cache=new Map}register(t,e){this.cache.set(t,e)}get(t){return this.cache.get(t)}fill(t){const{viewLayoutPanel:e}=t;if(!e||!0===e.useDefaultLayout){const e=this.calcLayoutTag(t);if(this.cache.has(e)){const s=_(this.cache.get(e));t.viewLayoutPanel=s,t.appCounterRefs&&(s.appCounterRefs=t.appCounterRefs,delete t.appCounterRefs),t.appViewEngines&&(s.appViewEngines=t.appViewEngines,delete t.appViewEngines),t.appViewLogics&&(s.appViewLogics=t.appViewLogics,delete t.appViewLogics),t.appViewRefs&&(s.appViewRefs=t.appViewRefs,delete t.appViewRefs),t.controls&&(s.controls=t.controls,delete t.controls)}}return t}calcLayoutTag(t){const{viewType:e,viewStyle:s}=t;return"APPINDEXVIEW"===e?this.calcIndexViewLayoutTag(t):"".concat(e,"_").concat(s)}calcIndexViewLayoutTag(t){const{viewType:e,viewStyle:s,blankMode:i,mainMenuAlign:a}=t;let n="";return i?n="BLANK_MODE":a&&(n=a.toUpperCase()),""!==n?"".concat(e,"_").concat(s,"_").concat(n):"".concat(e,"_").concat(s)}});var ft=t("ControlType",(t=>(t.APP_MENU="APPMENU",t.GRID="GRID",t.FORM="FORM",t.SEARCHFORM="SEARCHFORM",t.TOOLBAR="TOOLBAR",t.DRBAR="DRBAR",t.VIEWPANEL="VIEWPANEL",t.PICKUP_VIEW_PANEL="PICKUPVIEWPANEL",t.DATAVIEW="DATAVIEW",t.TREEGRID="TREEGRID",t.WF_EXPBAR="WFEXPBAR",t.TREEVIEW="TREEVIEW",t.TREE_EXP_BAR="TREEEXPBAR",t.TAB_VIEWPANEL="TABVIEWPANEL",t.DRTAB="DRTAB",t.CHART="CHART",t.REPORT_PANEL="REPORTPANEL",t.LIST="LIST",t.MOB_MDCTRL="MOBMDCTRL",t.MULTI_EDIT_VIEWPANEL="MULTIEDITVIEWPANEL",t.WIZARD_PANEL="WIZARDPANEL",t.UPDATE_PANEL="UPDATEPANEL",t.SEARCHBAR="SEARCHBAR",t.DASHBOARD="DASHBOARD",t.CALENDAR="CALENDAR",t.PANEL="PANEL",t.VIEW_LAYOUT_PANEL="VIEWLAYOUTPANEL",t.MAP="MAP",t.GANTT="GANTT",t.TREE_GRIDEX="TREEGRIDEX",t.KANBAN="KANBAN",t.CALENDAR_EXPBAR="CALENDAREXPBAR",t.CHART_EXPBAR="CHARTEXPBAR",t.DATA_VIEW_EXPBAR="DATAVIEWEXPBAR",t.GANTT_EXPBAR="GANTTEXPBAR",t.GRID_EXPBAR="GRIDEXPBAR",t.LIST_EXPBAR="LISTEXPBAR",t.MAP_EXPBAR="MAPEXPBAR",t.STATE_WIZARD_PANEL="STATEWIZARDPANEL",t.TAB_EXP_PANEL="TABEXPPANEL",t.CUSTOM="CUSTOM",t.CAPTIONBAR="CAPTIONBAR",t))(ft||{})),It=t("ViewType",(t=>(t.APP_INDEX_VIEW="APPINDEXVIEW",t.DE_GRID_VIEW="DEGRIDVIEW",t.DE_EDIT_VIEW="DEEDITVIEW",t.APP_DATA_UPLOAD_VIEW="APPDATAUPLOADVIEW",t.APP_ERROR_VIEW="APPERRORVIEW",t.APP_FILE_UPLOAD_VIEW="APPFILEUPLOADVIEW",t.APP_FUN_PICKUP_VIEW="APPFUNCPICKUPVIEW",t.APP_LOGIN_VIEW="APPLOGINVIEW",t.APP_LOGOUT_VIEW="APPLOGOUTVIEW",t.APP_PANEL_VIEW="APPPANELVIEW",t.APP_PIC_UPLOAD_VIEW="APPPICUPLOADVIEW",t.APP_PORTAL_VIEW="APPPORTALVIEW",t.APP_REDIRECT_VIEW="APPREDIRECTVIEW",t.APP_START_VIEW="APPSTARTVIEW",t.APP_WELCOME_VIEW="APPWELCOMEVIEW",t.APP_WF_ADD_STEP_AFTER_VIEW="APPWFADDSTEPAFTERVIEW",t.APP_WF_ADD_STEP_BEFORE_VIEW="APPWFADDSTEPBEFOREVIEW",t.APP_WF_REDIRECT_VIEW="APPWFREDIRECTVIEW",t.APP_WF_SENDBAC_VIEW="APPWFSENDBACKVIEW",t.APP_WF_STEP_ACTOR_VIEW="APPWFSTEPACTORVIEW",t.APP_WF_STEP_DATA_VIEW="APPWFSTEPDATAVIEW",t.APP_WF_STEP_TRACE_VIEW="APPWFSTEPTRACEVIEW",t.APP_WF_SUPPLY_INFO_VIEW="APPWFSUPPLYINFOVIEW",t.APP_WF_TAKE_ADVICE_VIEW="APPWFTAKEADVICEVIEW",t.DE_CALENDAR_EXP_VIEW="DECALENDAREXPVIEW",t.DE_CALENDAR_VIEW="DECALENDARVIEW",t.DE_CHART_EXP_VIEW="DECHARTEXPVIEW",t.DE_CHART_VIEW="DECHARTVIEW",t.DE_CHART_VIEW9="DECHARTVIEW9",t.DE_CUSTOM_VIEW="DECUSTOMVIEW",t.DE_DATA_VIEW="DEDATAVIEW",t.DE_DATA_VIEW9="DEDATAVIEW9",t.DE_DATAVIEW_EXP_VIEW="DEDATAVIEWEXPVIEW",t.DE_EDIT_VIEW2="DEEDITVIEW2",t.DE_EDIT_VIEW3="DEEDITVIEW3",t.DE_EDIT_VIEW4="DEEDITVIEW4",t.DE_EDIT_VIEW9="DEEDITVIEW9",t.DE_FORM_PICKUP_DATA_VIEW="DEFORMPICKUPDATAVIEW",t.DE_GANTT_EXP_VIEW="DEGANTTEXPVIEW",t.DE_GANTT_VIEW="DEGANTTVIEW",t.DE_GANTT_VIEW9="DEGANTTVIEW9",t.DE_GRID_EXP_VIEW="DEGRIDEXPVIEW",t.DE_GRID_VIEW2="DEGRIDVIEW2",t.DE_GRID_VIEW4="DEGRIDVIEW4",t.DE_GRID_VIEW8="DEGRIDVIEW8",t.DE_GRID_VIEW9="DEGRIDVIEW9",t.DE_HTML_VIEW="DEHTMLVIEW",t.DE_INDEX_PICKUP_DATA_VIEW="DEINDEXPICKUPDATAVIEW",t.DE_INDEX_VIEW="DEINDEXVIEW",t.DE_KANBAN_VIEW="DEKANBANVIEW",t.DE_KANBAN_VIEW9="DEKANBANVIEW9",t.DE_LIST_EXP_VIEW="DELISTEXPVIEW",t.DE_LIST_VIEW="DELISTVIEW",t.DE_LIST_VIEW9="DELISTVIEW9",t.DE_MAP_EXP_VIEW="DEMAPEXPVIEW",t.DE_MAP_VIEW="DEMAPVIEW",t.DE_MAP_VIEW9="DEMAPVIEW9",t.DE_MD_CUSTOM_VIEW="DEMDCUSTOMVIEW",t.DE_MEDITVIEW9="DEMEDITVIEW9",t.DE_MOB_CALENDAR_EXP_VIEW="DEMOBCALENDAREXPVIEW",t.DE_MOB_CALENDAR_VIEW="DEMOBCALENDARVIEW",t.DE_MOB_CALENDAR_VIEW9="DEMOBCALENDARVIEW9",t.DE_MOB_CHART_EXP_VIEW="DEMOBCHARTEXPVIEW",t.DE_MO_BCHART_VIEW="DEMOBCHARTVIEW",t.D_EMOB_CHART_VIEW9="DEMOBCHARTVIEW9",t.DE_MOB_CUSTOM_VIEW="DEMOBCUSTOMVIEW",t.DE_MOB_DATA_VIEW="DEMOBDATAVIEW",t.DE_MOB_DATA_VIEW_EXP_VIEW="DEMOBDATAVIEWEXPVIEW",t.DE_MOB_EDIT_VIEW="DEMOBEDITVIEW",t.DE_MOB_EDIT_VIEW3="DEMOBEDITVIEW3",t.DE_MOB_EDITVIEW9="DEMOBEDITVIEW9",t.DE_MOB_FORM_PICKUP_MDVIEW="DEMOBFORMPICKUPMDVIEW",t.DE_MOB_GANTT_EXP_VIEW="DEMOBGANTTEXPVIEW",t.DE_MOB_GANTT_VIEW="DEMOBGANTTVIEW",t.DE_MOB_GANTT_VIEW9="DEMOBGANTTVIEW9",t.DE_MOB_HTML_VIEW="DEMOBHTMLVIEW",t.DE_MOB_INDEX_PICKUP_MDVIEW="DEMOBINDEXPICKUPMDVIEW",t.DE_MOB_LIST_EXP_VIEW="DEMOBLISTEXPVIEW",t.DE_MOB_LIST_VIEW="DEMOBLISTVIEW",t.DE_MOB_MAP_VIEW="DEMOBMAPVIEW",t.DE_MOB_MAP_VIEW9="DEMOBMAPVIEW9",t.DE_MOB_MDVIEW="DEMOBMDVIEW",t.DE_MOB_MDVIEW9="DEMOBMDVIEW9",t.DE_MOB_MEDIT_VIEW9="DEMOBMEDITVIEW9",t.DE_MOB_MPICKUP_VIEW="DEMOBMPICKUPVIEW",t.DE_MOB_OPT_VIEW="DEMOBOPTVIEW",t.DE_MOB_PANEL_VIEW="DEMOBPANELVIEW",t.DE_MOB_PANEL_VIEW9="DEMOBPANELVIEW9",t.DE_MOB_PICKUP_LIST_VIEW="DEMOBPICKUPLISTVIEW",t.DE_MOB_PICKUP_MDVIEW="DEMOBPICKUPMDVIEW",t.DE_MOB_PICKUP_TREE_VIEW="DEMOBPICKUPTREEVIEW",t.DE_MOB_PICKUP_VIEW="DEMOBPICKUPVIEW",t.DE_MOB_PORTAL_VIEW="DEMOBPORTALVIEW",t.DE_MOB_PORTAL_VIEW9="DEMOBPORTALVIEW9",t.DE_MOB_REDIRECT_VIEW="DEMOBREDIRECTVIEW",t.DE_MOB_REPORT_VIEW="DEMOBREPORTVIEW",t.DE_MOB_TAB_EXP_VIEW="DEMOBTABEXPVIEW",t.DE_MOB_TAB_EXP_VIEW9="DEMOBTABEXPVIEW9",t.DE_MOB_TAB_SEARCH_VIEW="DEMOBTABSEARCHVIEW",t.DE_MOB_TAB_SEARCH_VIEW9="DEMOBTABSEARCHVIEW9",t.DE_MOB_TREE_EXP_VIEW="DEMOBTREEEXPVIEW",t.DEMOBTREEEXPVIEW9="DEMOBTREEEXPVIEW9",t.DE_MOB_TREE_VIEW="DEMOBTREEVIEW",t.DE_MOB_WFACTION_VIEW="DEMOBWFACTIONVIEW",t.DE_MOB_WF_DATA_REDIRECT_VIEW="DEMOBWFDATAREDIRECTVIEW",t.DE_MOB_WF_DYNAACTIO_NVIEW="DEMOBWFDYNAACTIONVIEW",t.DE_MOB_WFDYNA_EDIT_VIEW="DEMOBWFDYNAEDITVIEW",t.DE_MOB_WF_DYNA_EDIT_VIEW3="DEMOBWFDYNAEDITVIEW3",t.DE_MOB_WF_DYNA_EXP_MDVIEW="DEMOBWFDYNAEXPMDVIEW",t.DE_MO_BWF_DYNA_START_VIEW="DEMOBWFDYNASTARTVIEW",t.DE_MOB_WF_EDIT_VIEW="DEMOBWFEDITVIEW",t.DE_MOB_WF_EDIT_VIEW3="DEMOBWFEDITVIEW3",t.DE_MOB_WF_MDVIEW="DEMOBWFMDVIEW",t.DE_MOB_WF_PROXY_RESULT_VIEW="DEMOBWFPROXYRESULTVIEW",t.DE_MOB_WF_PROXY_START_VIEW="DEMOBWFPROXYSTARTVIEW",t.DE_MOB_WF_START_VIEW="DEMOBWFSTARTVIEW",t.DE_MOB_WIZARD_VIEW="DEMOBWIZARDVIEW",t.DE_MPICKUP_VIEW="DEMPICKUPVIEW",t.DE_MPICKUP_VIEW2="DEMPICKUPVIEW2",t.DE_OPT_VIEW="DEOPTVIEW",t.DE_PANEL_VIEW="DEPANELVIEW",t.DE_PANEL_VIEW9="DEPANELVIEW9",t.DE_PICKUP_DATA_VIEW="DEPICKUPDATAVIEW",t.DE_PICKUP_GRID_VIEW="DEPICKUPGRIDVIEW",t.DE_PICKUP_TREE_VIEW="DEPICKUPTREEVIEW",t.DE_PICKUP_VIEW="DEPICKUPVIEW",t.DE_PICKUP_VIEW2="DEPICKUPVIEW2",t.DE_PICK_UP_VIEW3="DEPICKUPVIEW3",t.DE_PORTAL_VIEW="DEPORTALVIEW",t.DE_PORTAL_VIEW9="DEPORTALVIEW9",t.DE_REDIRECT_VIEW="DEREDIRECTVIEW",t.DE_REPORT_VIEW="DEREPORTVIEW",t.DE_TAB_EXP_VIEW="DETABEXPVIEW",t.DE_TAB_EXP_VIEW9="DETABEXPVIEW9",t.DE_TAB_SEARCH_VIEW="DETABSEARCHVIEW",t.DE_TAB_SEARCH_VIEW9="DETABSEARCHVIEW9",t.DE_TREE_EXP_VIEW="DETREEEXPVIEW",t.DE_TREE_EXP_VIEW2="DETREEEXPVIEW2",t.DE_TREE_EXP_VIEW3="DETREEEXPVIEW3",t.DE_TREE_GRID_EXVIEW="DETREEGRIDEXVIEW",t.DE_TREE_GRID_EXVIEW9="DETREEGRIDEXVIEW9",t.DE_TREE_GRID_VIEW="DETREEGRIDVIEW",t.DE_TREE_GRID_VIEW9="DETREEGRIDVIEW9",t.DE_TREE_VIEW="DETREEVIEW",t.DE_TREE_VIEW9="DETREEVIEW9",t.DE_WF_ACTION_VIEW="DEWFACTIONVIEW",t.DE_WF_DATA_REDIRECT_VIEW="DEWFDATAREDIRECTVIEW",t.DE_WF_DYNA_ACTION_VIEW="DEWFDYNAACTIONVIEW",t.DE_WF_DYNA_EDIT_VIEW="DEWFDYNAEDITVIEW",t.DE_WF_DYNA_EDIT_VIEW3="DEWFDYNAEDITVIEW3",t.DE_WF_DYNA_EXP_GRID_VIEW="DEWFDYNAEXPGRIDVIEW",t.DE_WF_DYNA_START_VIEW="DEWFDYNASTARTVIEW",t.DE_WF_EDIT_PROXY_DATA_VIEW="DEWFEDITPROXYDATAVIEW",t.DE_WF_EDIT_VIEW="DEWFEDITVIEW",t.DE_WF_EDIT_VIEW2="DEWFEDITVIEW2",t.DE_WF_EDIT_VIEW3="DEWFEDITVIEW3",t.DE_WF_EDIT_VIEW9="DEWFEDITVIEW9",t.DE_WF_EXP_VIEW="DEWFEXPVIEW",t.DE_WF_GRID_VIEW="DEWFGRIDVIEW",t.DE_WF_PROXY_DATA_VIEW="DEWFPROXYDATAVIEW",t.DE_WF_PROXY_RESULT_VIEW="DEWFPROXYRESULTVIEW",t.DE_WF_PROXY_START_VIEW="DEWFPROXYSTARTVIEW",t.DE_WF_START_VIEW="DEWFSTARTVIEW",t.DE_WIZARD_VIEW="DEWIZARDVIEW",t))(It||{})),Dt=t("ViewMode",(t=>(t.ROUTE="ROUTE",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t.POPOVER="POPOVER",t))(Dt||{})),At=t("SysUIActionTag",(t=>(t.NEW="New",t.EDIT="Edit",t.REFRESH="Refresh",t.EXIT="Exit",t.SAVE_AND_EXIT="SaveAndExit",t.SAVE_AND_NEW="SaveAndNew",t.SAVE="Save",t.SAVE_ROW="SaveRow",t.REMOVE="Remove",t.REMOVE_AND_EXIT="RemoveAndExit",t.NEW_ROW="NewRow",t.TOGGLE_FILTER="ToggleFilter",t.IMPORT="Import",t.EXPORT_EXCEL="ExportExcel",t.SAVE_AND_START="SaveAndStart",t.VIEW_WF_STEP="ViewWFStep",t.NO="No",t.YES="Yes",t.CANCEL="Cancel",t.OK="Ok",t.SEARCH="Search",t.FINISH="Finish",t.NEXT_STEP="NextStep",t.PREV_STEP="PrevStep",t.ADD_SELECTION="AddSelection",t.REMOVE_SELECTION="RemoveSelection",t.REMOVE_ALL="RemoveAll",t.ADD_ALL="AddAll",t.LOGOUT="Logout",t.LOGIN="Login",t.CANCEL_CHANGES="CancelChanges",t.COPY="Copy",t.VIEW="View",t.TOGGLE_ROW_EDIT="ToggleRowEdit",t.LOAD_MORE="LoadMore",t))(At||{})),Pt=t("StudioViewEvents",class{});Pt.onViewMounted="onMounted",Pt.onViewDestroyed="onDestroyed";var yt=t("StudioPanelEvents",class{});yt.onClick="onClick",yt.onChange="onChange",yt.onEnter="onEnter",yt.onLeave="onLeave";var vt=t("StudioControlEvents",class{});vt.onBeforeLoad="onBeforeLoad",vt.onLoadSuccess="onLoadSuccess",vt.onLoadError="onLoadError",vt.onBeforeLoadDraft="onBeforeLoadDraft",vt.onLoadDraftSuccess="onLoadDraftSuccess",vt.onLoadDraftError="onLoadDraftError",vt.onBeforeSave="onBeforeSave",vt.onSaveSuccess="onSaveSuccess",vt.onSaveError="onSaveError",vt.onBeforeRemove="onBeforeRemove",vt.onRemoveSuccess="onRemoveSuccess",vt.onRemoveError="onRemoveError",vt.CLICK="onClick";var Tt=t("Modal",class{constructor(t){this.mode="EMBED",this.viewUsage=4,this.hooks={shouldDismiss:new g,beforeDismiss:new g},this._dismiss=t=>{ibiz.log.error("外部关闭能力未注册",t)},t.mode&&(this.mode=t.mode),t.routeDepth&&(this.routeDepth=t.routeDepth),t.viewUsage&&(this.viewUsage=t.viewUsage),t.dismiss&&(this._dismiss=t.dismiss)}injectDismiss(t){this._dismiss=t}async dismiss(t={ok:!1,data:[]}){const e={allowClose:!0};return await this.hooks.shouldDismiss.call(e),e.allowClose?(await this.hooks.beforeDismiss.call(t),this._dismiss(t),this.destroy(),!0):(ibiz.log.debug("shouldDismiss结果为false,关闭中断。"),!1)}destroy(){this.hooks.shouldDismiss.clear(),this.hooks.beforeDismiss.clear()}});var Ct=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,s,a={},n={}){const r=await ibiz.hub.config.view.get(t);if(!r)throw new e("应用视图[".concat(t,"]不存在"));if(s.srfkey&&r.appDataEntityId){s[$(r.appDataEntityId)]=s.srfkey,s.srfkey=void 0}if(r.redirectView){return nt(await ibiz.hub.getAppView(t),s,a,n)}const{openMode:o="INDEXVIEWTAB"}=r;switch(n.openMode||o){case"INDEXVIEWTAB":return n.noWaitRoute?void this.openIndexViewTab(r,s,a):this.openIndexViewTab(r,s,a);case"POPUP":throw new i(r,"未支持的视图打开模式: POPUP");case"POPUPMODAL":return this.openModal(r,s,a);case"POPUPAPP":throw new i(r,"未支持的视图打开模式: POPUPAPP");case"POPOVER":return this.openPopover(r,n.event,s,a);case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return this.openDrawer(r,s,a);case"USER":return this.openUserCustom(r,s,a);default:return this.openIndexViewTab(r,s,a)}}openIndexViewTab(t,e,s={}){return ibiz.openView.root(t,e,s)}async openModal(t,e,s={}){return ibiz.openView.modal(t,e,s)}async openPopover(t,s,i,a={}){if(!s)throw new e("气泡打开缺少event");return ibiz.openView.popover(t,s,i,a)}async openDrawer(t,e,s={}){return ibiz.openView.drawer(t,e,s)}async openUserCustom(t,e,s={}){return ibiz.openView.custom(t,e,s)}};Ct.TAG="ibiz.app-view.open";var _t=t("OpenAppViewCommand",Ct),bt=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,s,a={},n={}){const r=ibiz.hub.getApp(s.srfappid).getAppFunc(t);if(!r)throw new e("找不到叫".concat(t,"的应用功能"));const{navigateContexts:o,navigateParams:c,appFuncType:l}=r,d=s.clone();Object.assign(d,z(o,s,a));const h=z(c,s,a);switch(l){case"APPVIEW":return this.openAppView(r,d,h,n);case"OPENHTMLPAGE":return this.openHtmlPage(r);case"PDTAPPFUNC":return this.openPdAppFunc(r,d,h);case"JAVASCRIPT":return this.executeJavaScript(r,d,h);case"CUSTOM":return this.custom(r,d,h);default:throw new i(r,"未支持的应用功能类型: ".concat(l))}}async openAppView(t,s,i,a){if(!t.appViewId)throw new e("应用视图[".concat(t.appViewId,"]不存在"));return ibiz.commands.execute(_t.TAG,t.appViewId,s,i,a)}openHtmlPage(t){const e=t.htmlPageUrl;window.open(e,"_blank")}openPdAppFunc(t,s,i){throw ibiz.log.warn("openPdAppFunc",t,s,i),new e("未实现")}executeJavaScript(t,s,i){throw ibiz.log.warn("executeJavaScript",t,s,i),new e("未实现")}custom(t,s,i){throw ibiz.log.warn("custom",t,s,i),new e("未实现")}};bt.TAG="ibiz.app-func.exec";var Vt=t("AppFuncCommand",bt);function Lt(){new Vt,new _t}var Rt=t("AppCounter",class{constructor(t){this.model=t,this.destroyed=!1,this.context=a.create(),this.params={},this.evt=new m,this.data={}}get isDestroyed(){return this.destroyed}async init(t,e){this.setParams(t,e),this.appDataEntityId=this.model.appDataEntityId;const i=this.model.getAppDEActionId;if(!i)throw new s(this.model,"未找到获取计数器行为!");this.action=i,this.interval(),await this.load()}setParams(t,e){t&&(this.context=_(t)),e&&(this.params=_(e))}interval(){this.destroyInterval(),this.intervalTimer=setInterval((()=>{this.evt.getSize("change")>0&&this.load()}),this.model.timer||6e3)}destroyInterval(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)}async load(){const t=ibiz.hub.getApp(this.context.srfappid),e=await t.deService.exec(this.appDataEntityId,this.action,this.context,this.params);return e.ok&&(this.data=e.data,this.evt.emit("change",this.data)),this.data}refresh(t,e){return this.setParams(t,e),this.load()}onChange(t,e=!0){this.evt.on("change",t),e&&p(this.data)&&t(this.data)}offChange(t){this.evt.off("change",t)}getCounter(t){return this.data[t.toLowerCase()]||0}destroy(){this.destroyed=!0,this.context.destroy(),this.destroyInterval(),this.evt.reset()}}),Mt=class{constructor(){this.psModelGroupCondBase=null}parse(t){if(t instanceof Array){const e=this.createPSModelGroupCond();e.parse(t),this.psModelGroupCondBase=e}}testSingleCond(t,e,s){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){let i=-1;if(e==s?i=0:e>s&&(i=1),"EQ"===t||"ABSEQ"===t)return 0===i;if("GT"===t)return i>0;if("GTANDEQ"===t)return i>=0;if("LT"===t)return i<0;if("LTANDEQ"===t)return i<=0;if("NOTEQ"===t)return 0!==i}if("LIKE"===t)return null!=e&&null!=s&&-1!==e.toString().toUpperCase().indexOf(s.toString().toUpperCase());if("LEFTLIKE"===t)return null!=e&&null!=s&&0===e.toString().toUpperCase().indexOf(s.toString().toUpperCase())}catch(t){ibiz.log.error(t)}return!1}getPSModelGroupCondBase(){return this.psModelGroupCondBase}},Ot=class{constructor(){this.strCondOp=null}getCondOp(){return this.strCondOp}setCondOp(t){this.strCondOp=t}},Nt=class extends Ot{parse(t){const e=t.length;let s=!0,i=!1,a=!1;for(let n=0;n<e;n++)if(s){const e=t[n];this.setCondOp(e),s=!1,i=!0}else if(i){const e=t[n];this.setParam(e),i=!1,a=!0}else if(a){const e=t[n];if(e instanceof Object&&!(e instanceof Array)){const t=e;null!=t.type&&this.setValueType(t.type.toString()),null!=t.value&&this.setValue(t.value.toString())}else this.setValue(e);break}}getValueType(){return this.strValueType}setValueType(t){this.strValueType=t}getValue(){return this.strValue}setValue(t){this.strValue=t}getParamType(){return this.strParamType}setParamType(t){this.strParamType=t}getParam(){return this.strParam}setParam(t){this.strParam=t}},Wt=class t extends Ot{constructor(){super(...arguments),this.childCondList=[],this.bNotMode=!1}parse(s){const i=s.length;let a=!0,n=!0,r=!1;for(let o=0;o<i;o++){if(a&&n){if("!"===s[o]){this.setNotMode(!0),a=!1;continue}}if(n){const t=s[o];this.setCondOp(t),n=!1,a=!1,r=!0}else if(r){const i=s[o];if(!(i instanceof Array))throw new e("值必须为数组");i.forEach((e=>{if(e.length>0){const s=e[0].toString();if("!"===s||"OR"===s||"AND"===s){const s=new t;s.parse(e),this.childCondList.push(s)}else{const t=new Nt;t.parse(e),this.childCondList.push(t)}}}))}}}setNotMode(t){this.bNotMode=t}isNotMode(){return this.bNotMode}getChildPSModelCondBases(){return this.childCondList}},xt=class extends Wt{},St=class extends Nt{},Ft=class t extends Mt{test(t,e){return this.testCond(this.getPSModelGroupCondBase(),t,e)}testCond(e,s,i){if(e instanceof Wt){const t=e.getChildPSModelCondBases();if(null==t||C(t))return!e.isNotMode();const a="AND"===e.getCondOp();let n=a;for(let e=0;e<t.length;e++){const r=t[e];if(this.testCond(r,s,i)){if(!a){n=!0;break}}else if(a){n=!1;break}}return e.isNotMode()?!n:n}if(e instanceof Nt){C(e.getParam())&&ibiz.log.warn("没有指定属性名称",e);const a=s[e.getParam().toLowerCase()];let n=null;const r=e.getValueType(),o=e.getValue();return null==r||C(r)?n=e.getValue():(C(o)&&ibiz.log.warn("没有指定上下文参数名称"),t.PARAMTYPE_WEBCONTEXT===r?n=i.data[o.toLowerCase()]:t.PARAMTYPE_DATACONTEXT===r&&(n=i.getValue(o.toLowerCase()))),this.testSingleCond(e.getCondOp(),a,n)}return ibiz.log.warn("无法识别的条件对象",e),!1}createPSModelSingleCond(){return new St}createPSModelGroupCond(){return new xt}};Ft.PARAMTYPE_DATACONTEXT="DATACONTEXT",Ft.PARAMTYPE_WEBCONTEXT="WEBCONTEXT";var Bt=t("PSDEDQCondEngine",Ft);t("DEDQCondUtil",class{static getCond(t){if(this.map.has(t))return this.map.get(t);const e=t.dedqgroupConditions;if(e){const s=new Bt;return s.parse(["OR",this.calcCond(e)]),this.map.set(t,s),s}return null}static calcCond(t){const e=[];return t.forEach((t=>{const s=[];if("GROUP"===t.condType){const e=t;e.notMode&&s.push("!"),s.push(t.condOp);const i=e.dedqconditions;if(i){const t=this.calcCond(i);s.push(t)}}else{if("SINGLE"!==t.condType)throw new i(t,"暂未支持的查询条件类型: ".concat(t.condType));{const e=t;s.push(e.fieldName),e.condValue||s.push("")}}e.push(s)})),e}}).map=new WeakMap;var kt=t("DynamicCodeListCache",class{constructor(t){this.cache=new Map,this.isPredefined=!1,this.codeList=t}async init(){return this.initPromise=(async()=>{const{predefinedType:t}=this.codeList;if(t){if(this.isPredefined=!0,!["OPERATOR","RUNTIME"].includes(t))throw new i(this.codeList,"预定义类型".concat(t,"暂不支持"))}else this.initPromise=void 0})(),this.initPromise}convertData(t){const e={},{valueAppDEFieldId:s,textAppDEFieldId:i}=this.codeList,a=s?t[s]:t.srfkey;return e.id=a,e.value=a,e.text=i?t[i]:t.srfmajortext,Object.freeze(e)}async load(t={},e={}){const i=ibiz.hub.getApp(t.srfappid);if(this.isPredefined){e.size||(e.size=1e4);const t=await i.net.get("/dictionaries/codelist/".concat(this.codeList.codeName),e);return Object.freeze(t.data.items)}const{appDataEntityId:a,appDEDataSetId:n}=this.codeList;if(!a)throw new s(this.codeList,"未配置应用实体");if(!n)throw new s(this.codeList,"未配置数据集");const r=await i.deService.exec(a,n,t,{},e);let o=[];return r.data.length&&(o=r.data.map((t=>this.convertData(t)))),o}async get(t={},e={}){if(this.initPromise&&await this.initPromise,!this.codeList.enableCache)return this.load(t,e);const s=JSON.stringify(t)+JSON.stringify(e);if(this.cache.has(s)){const t=this.cache.get(s);if(t.expirationTime>(new Date).getTime())return t.promise?t.promise:t.items;this.cache.delete(s)}const i=this.load(t,e),{cacheTimeout:a}=this.codeList,n=-1===a||v(a)?ibiz.config.codeList.timeout:this.codeList.cacheTimeout,r={expirationTime:(new Date).getTime()+n,promise:i};this.cache.set(s,r);const o=await i;return r.items=o,delete r.promise,o}});function Ut(t,s){if(null!=s){const{srfkey:t}=s;if(!v(t)&&!C(t))return!0}throw new e("执行「".concat(t,"」不存在「srfkey」无法处理"))}function zt(t,s){const{srfsessionid:i}=s;if(!v(i)&&!C(i))return!0;throw new e("执行「".concat(t,"」不存在「srfsessionid」无法处理"))}var Gt=t("DECache",class{constructor(){this.cacheMap=new Map}forceAdd(t,e){const s=this.getCacheByTag(t).get(e.srfkey);s&&(s.assign(e),ibiz.log.warn("forceAdd",e.srfkey,e))}forceUpdate(t,e){this.getCacheByTag(t).set(e.srfkey,_(e)),ibiz.log.warn("forceUpdate",e.srfkey,e)}forceDelete(t,e){this.getCacheByTag(t).delete(e),ibiz.log.warn("forceDelete",e)}add(t,e){try{zt("add",t),(v(e.srfkey)||C(e.srfkey))&&(e.srfkey=w()),e.srftempdate=(new Date).getTime();return this.getCacheByTag(t).set(e.srfkey,_(e)),ibiz.log.warn("add",e.srfkey,e),e}catch(t){return ibiz.log.error(t),null}}get(t,e){try{zt("get",t);const s=this.getCacheByTag(t).get(e);return ibiz.log.warn("get",e,s),_(s)}catch(t){return ibiz.log.error(t),null}}update(t,e){try{zt("update",t),Ut("update",e),e.srftempdate=(new Date).getTime();const s=this.getCacheByTag(t),i=s.get(e.srfkey);if(i)return i.assign(e),s.set(e.srfkey,i),ibiz.log.warn("update",e.srfkey,e),_(i);throw new Error("数据不存在,无法更新!")}catch(t){return ibiz.log.error(t),null}}delete(t,e){try{zt("delete",t);const s=this.getCacheByTag(t),i=e;if(s.has(i)){const t=s.get(i);return t.srftempdate=(new Date).getTime(),s.delete(i),ibiz.log.warn("delete",i),t}return null}catch(t){return ibiz.log.error(t),null}}createBatch(t,e){try{zt("add",t);const s=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const i=e[t];(v(i.srfkey)||C(i.srfkey))&&(i.srfkey=w()),i.srftempdate=(new Date).getTime();const a=_(i);s.set(i.srfkey,a),e[t]=a,ibiz.log.warn("add",i.srfkey,i)}return e}catch(t){ibiz.log.error(t)}return[]}updateBatch(t,e){try{zt("update",t);const s=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const i=e[t];Ut("update",i),i.srftempdate=(new Date).getTime();const a=s.get(i.srfkey);if(!a)throw new Error("数据[".concat(i.srfdename,"-").concat(i.srfmajortext,"(").concat(i.srfkey,")]不存在,无法更新!"));a.assign(i),s.set(i.srfkey,a),ibiz.log.warn("update",i.srfkey,i),e[t]=_(a)}return e}catch(t){return ibiz.log.error(t),null}}deleteBatch(t,e){try{zt("delete",t)}catch(t){return ibiz.log.error(t),e}const s=this.getCacheByTag(t),i=[];for(let t=0;t<e.length;t++){const a=e[t];s.has(a)||i.push(a)}if(i.length>0)throw new Error("未找到以下数据「".concat(i.join("、"),"」,无法删除!"));for(let t=0;t<e.length;t++){const i=e[t];s.delete(i),ibiz.log.warn("delete",i)}return[]}checkData(t,e){return-1!==this.getList(t).findIndex((t=>t.srfkey===e))}getList(t){try{zt("getList",t);const e=this.getCacheByTag(t);if(!e)return[];const s=e.values();return Array.from(s)}catch(t){return ibiz.log.error(t),[]}}generatePred(t={}){const e={};t.srfkey&&(e.srfkey=b(t.srfkey)),delete t.srfkey;for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const i=t[s];e[s]=b(i)}return V(e)}clear(t){const e=t.srfsessionid;this.cacheMap.size>0&&this.cacheMap.delete(e)}getCacheByTag(t){const e=t.srfsessionid;return this.cacheMap.has(e)||this.cacheMap.set(e,new Map),this.cacheMap.get(e)}}),jt=new RegExp("(?<=\\$\\{)(.*?)(?=\\})","g");function Xt(t,e){const s=(e.requestPaths||[]).map((t=>({path:t,keys:t.match(jt)||[]}))).filter((e=>{const{keys:s}=e;return 0===s.length||s.every(((e,i)=>i===s.length-1||null!=t[e]))})).sort(((t,e)=>e.keys.length-t.keys.length));if(s.length>0)return s[0]}function Kt(t,e){const s=Xt(t,e);if(s){if(s.keys.length>0){let{path:e}=s;return s.keys.forEach(((i,a)=>{e=a===s.keys.length-1?e.replace(new RegExp("/[^/]+/\\$\\{".concat(i,"\\}")),""):e.replace("${".concat(i,"}"),t[i])})),e}return s.path}return""}var Ht=t("SearchFilter",class{constructor(t,e){if(this.page=0,this.size=1e3,this.data={},this.sortField="srfordervalue",this.sortMode="ASC",this.context=t,e){if(v(e.page)||C(e.page)||(this.page=e.page),v(e.size)||C(e.size)||(this.size=e.size),v(e.query)||C(e.query)||(this.query=e.query),!v(e.sort)&&!C(e.sort)){const t=e.sort.split(",");t.length>=1&&([this.sortField]=t),t.length>=2&&(this.sortMode=t[1].toUpperCase())}v(e.srfparentkey)||C(e.srfparentkey)||(this.srfparentkey=e.srfparentkey),v(e.srfparentdename)||C(e.srfparentdename)||(this.srfparentdename=e.srfparentdename),this.data={...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}}getValue(t){return this.data[t]?this.data[t]:this.context[t]}}),Yt=t("CodeListService",class{constructor(t){this.appModel=t,this.allCodeLists=new Map,this.cache=new Map}getStatic(t){const e=t.codeName;if(this.cache.has(e))return this.cache.get(e);const s=t.codeItems;let i=[];return(null==s?void 0:s.length)&&(i=this.formatStaticItems(s,t.codeItemValueNumber)),this.cache.set(e,Object.freeze(i)),i}setCodeList(t){const{id:e,codeName:s}=t;this.allCodeLists.set(e,t),this.allCodeLists.set(s,t)}getCodeList(t){return this.allCodeLists.get(t)}formatStaticItems(t,e){return t.map((t=>{var s;let i=t.text;t.textLanguageRes&&(i=ibiz.i18n.t(t.textLanguageRes.lanResTag,t.textLanguageRes.defaultContent));const a={text:i,value:e?Number(t.value):t.value,color:t.color,id:t.codeName};return(null==(s=t.codeItems)?void 0:s.length)&&(a.children=this.formatStaticItems(t.codeItems,e)),Object.freeze(a)}))}async getDynamicCodeList(t,e={},s={}){let i;const a=t.codeName;return this.cache.has(a)?i=this.cache.get(a):(i=new kt(t),this.cache.set(a,i),await i.init()),i.get(e,s)}async get(t,s,i){const a=this.allCodeLists.get(t);if(!a)throw new e("找不到".concat(t,"代码表"));return"STATIC"===a.codeListType?this.getStatic(a):"DYNAMIC"===a.codeListType?this.getDynamicCodeList(a,s,i):[]}}),qt=t("CounterService",class{static async getCounter(t,e,s){const i=t.id;if(this.counterMap.has(i)){const t=this.counterMap.get(i);if(!1===t.isDestroyed)return t;this.counterMap.delete(i)}const a=new Rt(t);return await a.init(e,s),this.counterMap.set(i,a),a}static async getCounterByRef(t,e,i){const{appCounter:a}=t;if(!a)throw new s(t,"未配置应用计数器!");return this.getCounter(a,e,i)}});qt.counterMap=new Map;var $t=t("WorkFlowService",class{constructor(t){this.model=t,this.commonBaseUrl="",this.app=ibiz.hub.getApp(t.appId);const e=ibiz.appData.context;this.commonBaseUrl="/wfcore/".concat(e.srfsystemid,"-app-").concat(this.app.model.codeName.toLowerCase(),"/").concat(this.model.name.toLowerCase())}getBaseUrl(){return this.commonBaseUrl}getActiveData(t,e){return e.srfprocessinstanceid&&(t.srfprocessinstanceid=e.srfprocessinstanceid),t}async getWFStep(t){const{processDefinitionKey:e,taskDefinitionKey:s}=t;return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions/").concat(e,"/usertasks/").concat(s))}async getWFLink(t,e){const s=t[this.model.codeName.toLowerCase()],{taskDefinitionKey:i}=t;return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(s,"/usertasks/").concat(i,"/ways"),{activedata:this.getActiveData(e,t)})}async getWFHistory(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.get("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/history"))}async getWFProcessDiagram(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.request("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/processdiagram"),{method:"post",data:{},responseType:"blob"})}async getWFVersion(){return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions2"))}async wfStart(t,e,s){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/process-instances"),{...e,activedata:this.getActiveData(s,t)})}async wfSubmit(t,e,s){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId),{...e,activedata:this.getActiveData(s,t)})}async wfWithdraw(t,e,s){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/withdraw"),{...e,activedata:this.getActiveData(s,t)})}async wfReassign(t,e,s){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/transfer"),{...e,activedata:this.getActiveData(s,t)})}async wfAddStepBefore(t,e,s){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/beforesign"),{...e,activedata:this.getActiveData(s,t)})}async wfSendBack(t,e,s){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendback"),{...e,activedata:this.getActiveData(s,t)})}async wfSendCopy(t,e,s){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendcopy"),{...e,activedata:this.getActiveData(s,t)})}async exec(t,s,i={},a={}){switch(t){case"wfstart":return this.wfStart(s,i,a);case"wfsubmit":return this.wfSubmit(s,i,a);case"reassign":return this.wfReassign(s,i,a);case"addstepbefore":return this.wfAddStepBefore(s,i,a);case"sendback":return this.wfSendBack(s,i,a);case"sendcopy":return this.wfSendCopy(s,i,a);default:throw new e("「".concat(t,"」未实现"))}}}),Qt=t("Srfuf",(t=>(t[t.CREATE=0]="CREATE",t[t.UPDATE=1]="UPDATE",t))(Qt||{})),Jt=t("AppDataEntity",class t{get srfuf(){return this.srfkey?1:0}constructor(e,s){let i;Object.defineProperty(this,"_entity",{enumerable:!1,configurable:!0,value:e}),Object.defineProperty(this,"_data",{enumerable:!1,configurable:!0,value:_(s instanceof t?s._data:s)}),Object.defineProperty(this,"srfdeid",{get:()=>e.id}),Object.defineProperty(this,"srfdecodename",{get:()=>e.codeName});const a=H(e.appDEFields||[],e.keyAppDEFieldId);if(a){const t=a.codeName.toLowerCase();Object.defineProperty(this,"srfkeyfile",{get:()=>t}),Object.defineProperty(this,"srfkey",{set(e){i=e,this._data[t]=e},get(){return this._data[t]||i}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主键字段"));const n=H(e.appDEFields||[],e.majorAppDEFieldId);if(n){const t=n.codeName.toLowerCase();Object.defineProperty(this,"srfmajorfile",{get:()=>t}),Object.defineProperty(this,"srfmajortext",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主文本字段"));this.defineProperties()}defineProperties(){var t;const{_data:e}=this,s={},i=Object.keys(e);i.forEach((t=>{s[t]={enumerable:!0,set(s){e[t]=s},get:()=>e[t]}})),null==(t=this._entity.appDEFields)||t.forEach((t=>{const a=t.codeName.toLowerCase();i.includes(a)||(s[a]={enumerable:!0,set(t){e[a]=t},get:()=>e[a]})})),Object.defineProperties(this,s)}clone(){return new t(this._entity,this._data)}assign(e){return e instanceof t?Object.assign(this._data,e._data):Object.assign(this._data,e),this}}),Zt=t("MethodDto",class t{constructor(t,e){this.entity=t,this.dto=e,this.dtoMap=new Map,e?(this.app=ibiz.hub.getApp(t.appId),this.fields=e.appDEMethodDTOFields||[]):this.fields=[]}get isLocalMode(){return 1===this.entity.storageMode||4===this.entity.storageMode}async get(t,e){const s={};for(let e=0;e<this.fields.length;e++){const a=this.fields[e],n=a.codeName.toLowerCase();switch(a.type){case"SIMPLE":break;case"DTOS":{const e=await this.getFieldDto(a),i=(await this.app.deService.getService(a.refAppDataEntityId)).local.getList(t);if(i){const a=[];for(let s=0;s<i.length;s++)a.push(await e.get(t,i[s]));s[n]=a}break}default:throw new i(a,"未支持的应用实体方法输入属性类型: ".concat(a.type))}}return{...e,...s}}async sets(t,e){const s=await this.app.deService.getService(this.entity.id);return s.local.clear(t),Promise.all(e.map((async e=>{const i=this.fields.filter((t=>"DTOS"===t.type)).map((async s=>{const i=s.codeName.toLowerCase(),a=await this.getFieldDto(s),n=e[i];n&&await a.sets(t,n)}));for(let t=0;t<i.length;t++)await i[t];const a=new Jt(this.entity,e);return this.isLocalMode&&await s.local.add(t,a),a})))}async getFieldDto(e){if(this.dtoMap.has(e.codeName))return this.dtoMap.get(e.codeName);const s=await ibiz.hub.getAppDataEntity(e.refAppDataEntityId,this.entity.appId),i=H(s.appDEMethodDTOs||[],e.refAppDEMethodDTOId),a=new t(s,i);return this.dtoMap.set(e.codeName,a),a}}),te=class{constructor(t,e){this.entity=t,this.method=e,this.app=ibiz.hub.getApp(t.appId),this.input=new class{constructor(t,e){if(this.entity=t,this.input=e,e){const s=H(t.appDEMethodDTOs||[],e.appDEMethodDTOId);s&&(this.dto=new Zt(t,s))}}async handle(t,e){return this.dto?this.dto.get(t,e):e}}(t,e.appDEMethodInput),this.result=new class{constructor(t,e){if(this.entity=t,this.output=e,e){const s=H(t.appDEMethodDTOs||[],e.appDEMethodDTOId);s&&(this.dto=new Zt(t,s))}}async handle(t,e){return this.dto?(await this.dto.sets(t,[e]))[0]:new Jt(this.entity,e)}}(t,e.appDEMethodReturn)}get isLocalMode(){return 1===this.entity.storageMode||4===this.entity.storageMode}async request(t,e,i,a){const{actionType:n,requestMethod:r}=this.method;if("REMOTE"===n){const e=this.method.codeName.toLowerCase();let n=null;switch(r){case"POST":n=await this.app.net.post("".concat(t,"/").concat(e),i,a);break;case"GET":n=await this.app.net.get("".concat(t,"/").concat(e),i,a);break;case"PUT":n=await this.app.net.put("".concat(t,"/").concat(e),i,a);break;case"DELETE":n=await this.app.net.delete("".concat(t,"/").concat(e),i,a);break;default:throw new s(this.method,r?"未支持的请求方式: ".concat(r):"未配置请求方式")}return n}throw new s(this.method,"未支持的行为类型[".concat(n,"]"))}calcPath(t){const e="/".concat(this.entity.codeName2.toLowerCase());return Kt(t,this.entity)+e}async getService(){return this.service||(this.service=await this.app.deService.getService(this.entity.id)),this.service}createEntity(t){return new Jt(this.entity,t)}},ee=class{},se=class extends ee{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName.toLowerCase()}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,a){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new s(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=a[this.value]?a[this.value]:e[this.value];return ot(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new s(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return ot(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new i(this.model,"暂未支持条件值类型为[当前时间]");default:return ot(n[this.dstField],this.op,this.value)}}},ie=class t extends ee{constructor(e){super(),this.model=e;const s=e.conds||[];this.conds=s.map((e=>"SINGLE"===e.logicType?new se(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,i){let a=!0;if(0===this.conds.length)throw new s(this.model,"界面连接条件逻辑组未配置逻辑项");for(let s=0;s<this.conds.length;s++){const n=this.conds[s].test(t,e,i);if("AND"===this.op&&!1===n){a=!1;break}if("OR"===this.op&&!0===n){a=!0;break}}return this.notMode?!a:a}},ae=class{constructor(t){var e;this.model=t,this.links=null==(e=t.links||[])?void 0:e.map((t=>new class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const e=this.model.delogicLinkGroupCond;e&&(this.groupCond=new ie(e))}async exec(t){const{defaultLink:e}=this.model;return!(!e&&this.groupCond)||this.groupCond.test(t,t.context,t.data||{})}}(t)))}},ne=class extends ae{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:i,dstDELogicParamId:a,retDELogicParamId:n}=this.model;if(!e)throw new s(this.model,"未指定应用实体");if(!i)throw new s(this.model,"未指定实体行为");const r=t.params[a],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,i,t.context,r,t.viewParams);c.ok&&(t.params[n]=c.data)}},re=class extends ae{async exec(t){}},oe=class extends ae{async exec(t){t.isEndNode=!0;const{returnParamId:e,returnType:s,rawValue:a}=this.model;switch(s){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=a;break;case"LOGICPARAM":t.result=t.params[e];break;default:throw new i(this.model,"暂未支持的结束节点返回值类型: ".concat(s))}}};function ce(t,e){const{srcDELogicParamId:s,srcValueType:a,srcFieldName:n,srcValue:r}=e;let o;switch(e.srcValueType||(e.srcValueType="SRCDLPARAM"),a){case"SRCDLPARAM":o=t.params[s];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return r;case"VIEWPARAM":o=t.viewParams;break;case"APPDATA":o=t.context;break;case"ENVPARAM":o=_(ibiz.env);break;default:throw new i(e,"暂未支持源值类型".concat(a))}const c=null==n?void 0:n.toLowerCase();return o&&c&&(o=o[c]),o}var le=class extends ae{async exec(t){const e=this.model.delogicNodeParams;(null==e?void 0:e.length)&&await Promise.all(e.map((e=>{switch(e.paramAction){case"SETPARAMVALUE":return this.setParamValue(e,t);case"RESETPARAM":return this.resetParam(e,t);case"COPYPARAM":return this.copyParam(e,t);case"BINDPARAM":return this.bindParam(e,t);case"RENEWPARAM":return this.renewParam(e,t);case"APPENDPARAM":return this.appendParam(e,t);case"SORTPARAM":return this.sortParam(e,t);default:throw new i(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))}})))}copyParam(t,e){const{dstDELogicParamId:s}=t,i=ce(e,t);e.params[s]=_(i)}bindParam(t,e){const s=ce(e,t);e.params[t.dstDELogicParamId]=s}setParamValue(t,e){const{dstFieldName:s,dstDELogicParamId:i}=t,a=null==s?void 0:s.toLowerCase(),n=ce(e,t);a?e.params[i][a]=n:e.params[i]=n}resetParam(t,e){const{dstDELogicParamId:s}=t;e.resetParam(s)}renewParam(t,e){const{dstDELogicParamId:s}=t;e.renewParam(s)}appendParam(t,e){const{dstDELogicParamId:s,dstIndex:i,srcIndex:a,srcSize:n}=t,r=ce(e,t),o=i||0,c=a||0,l=n||r.length;e.params[s].splice(o,0,...r.slice(c,l))}sortParam(t,e){const{dstDELogicParamId:s,dstFieldName:i,dstSortDir:a}=t,n=i.toLowerCase();e.params[s].sort(((t,e)=>"ASC"===a?t[n]-e[n]:e[n]-t[n]))}},de=class extends ae{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:s,dstDELogicParamId:i,retDELogicParamId:a}=this.model,n=t.params[i],r=ibiz.hub.getApp(t.context.srfappid),o=await r.deService.exec(s,e,t.context,n,t.viewParams);o.ok&&(t.params[a]=o.data)}},he=class extends ae{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:i}=this.model;if(!e||!i)throw new s(this.model,"缺少目标参数对象或者源参数对象配置");const a=ce(t,this.model);t.params[e]=a}},ue=class extends ae{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new s(this.model,"缺少目标参数对象配置");t.resetParam(e)}},pe=class extends ae{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new s(this.model,"缺少目标参数对象配置");t.renewParam(e)}},Ee=class extends ae{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:i}=this.model;if(!e||!i)throw new s(this.model,"缺少目标参数对象或者源参数对象配置");const a=ce(t,this.model);t.params[e]=_(a)}},ge=class extends ae{async exec(t){const{dstDELogicParamId:e,dstSortDir:i,dstFieldName:a}=this.model;if(!e||!a)throw new s(this.model,"缺少目标参数对象或目标属性配置");const n=a.toLowerCase();t.params[e].sort(((t,e)=>"ASC"===i?t[n]-e[n]:e[n]-t[n]))}},me=class extends ae{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:i,dstIndex:a,srcIndex:n,srcSize:r}=this.model;if(!e||!i)throw new s(this.model,"缺少目标参数对象或者源参数对象配置");const o=ce(t,this.model),c=a||0,l=n||0,d=r||o.length;t.params[e].splice(c,0,...o.slice(l,d))}},we=class extends ae{async exec(t){const{errorCode:e,errorInfo:s}=this.model;throw new r({response:{status:e,statusText:s}})}},fe=class{constructor(t){var e,a;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.delogicNodes)?void 0:e.length))throw new s(t,"实体逻辑没有配置逻辑节点");t.delogicNodes.forEach((t=>{const{logicNodeType:e}=t;let s;switch(e){case"BEGIN":s=new re(t);break;case"END":s=new oe(t);break;case"DEACTION":s=new ne(t);break;case"PREPAREPARAM":s=new le(t);break;case"DEDATASET":s=new de(t);break;case"THROWEXCEPTION":s=new we(t);break;case"BINDPARAM":s=new he(t);break;case"RESETPARAM":s=new ue(t);break;case"COPYPARAM":s=new Ee(t);break;case"RENEWPARAM":s=new pe(t);break;case"APPENDPARAM":s=new me(t);break;case"SORTPARAM":s=new ge(t);break;default:throw new i(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,s)})),null==(a=t.delogicParams)||a.forEach((t=>{this.params.set(t.id,new class{constructor(t){this.model=t}calc(t){const e=this.model.id,s=this.model;if(s.default)t.params[e]=t.data||{};else if(s.appGlobalParam)t.params[e]=_(ibiz.env);else if(s.entityListParam)t.params[e]=[];else{if(s.entityPageParam)throw new i(s,"未支持的逻辑参数类型: 分页查询结果");if(s.entityParam)t.params[e]={};else{if(s.lastReturnParam)throw new i(s,"未支持的逻辑参数类型: 上次调用返回");if(s.appContextParam)t.params[e]=t.context;else if(s.simpleListParam)t.params[e]=[];else if(s.simpleParam)t.params[e]={};else if(s.cloneParam)t.params[e]=_(t.data||{});else{if(s.envParam)throw new i(s,"未支持的逻辑参数类型: 系统环境变量");if(s.fileListParam)throw new i(s,"未支持的逻辑参数类型: 文件对象列表变量");if(s.fileParam)throw new i(s,"未支持的逻辑参数类型: 文件对象变量");if(s.filterParam)throw new i(s,"未支持的逻辑参数类型: 过滤器对象变量");if(s.lastParam)throw new i(s,"未支持的逻辑参数类型: 最后数据变量");if(s.originEntity)throw new i(s,"未支持的逻辑参数类型: 原始数据对象");if(s.sessionParam)throw new i(s,"未支持的逻辑参数类型: 操作会话变量")}}}}renew(t){const e=this.model.id,s=this.model;if(s.entityListParam||s.simpleListParam||s.entityPageParam)t.params[e]=[];else{if(!s.simpleParam&&!s.entityParam)throw new i(s,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}}(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.thenId)&&(e.dstNode=this.nodes.get(e.model.thenId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t,e,i){const a=new class{constructor(t,e,s,i){this.deLogicParams=t,this.context=e,this.data=s,this.viewParams=i,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}}(this.params,t,e,i);this.initLogicParams(a);const{startDELogicNodeId:n}=this.model;if(!n||!this.nodes.has(n))throw new s(this.model,"未设置起始节点");{const t=this.nodes.get(n);await this.deepExec(t,a)}return a.isEndNode?a.result:a.params[a.defaultParamName]?a.params[a.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:s}=t;for(let i=0;i<s.length;i++){const a=s[i];if(await a.exec(e)&&a.dstNode&&(await this.deepExec(a.dstNode,e),!1===t.model.parallelOutput))break}}},Ie=new Map;async function De(t,e,s,i){Ie.has(t)||Ie.set(t,new fe(t));return Ie.get(t).exec(e,s,i)}async function Ae(t,e,s,i){try{const a=await De(t,e,s,i);return new n(a)}catch(t){if(t instanceof r)return new n(t,500);throw t}}async function Pe(t,e,s,i,a){const n=J(t,e);if(n.length){(await Promise.all(n.map((t=>De(t,s,i,a))))).forEach((t=>{Object.assign(i,t)}))}}var ye=class extends te{async exec(t,e,i){if("DELOGIC"===this.method.actionType){const a=Q(this.method.appDELogicId,this.entity);if(!a)throw new s(this.method,"缺少实体处理逻辑");return Ae(a,t,e,i)}let a;switch(this.isLocalMode||(e=await this.input.handle(t,e)),["READ","GETDRAFT"].includes(this.method.actionMode)||await Pe(this.entity,"change",t,e,i),this.method.codeName){case"Create":a=await this.create(t,e,i);break;case"Get":a=await this.get(t,i);break;case"GetDraft":a=await this.getDraft(t,i);break;case"Remove":a=await this.remove(t,i);break;case"Update":a=await this.update(t,e,i);break;case"CreateTemp":a=await this.createTemp(t,e);break;case"GetTemp":a=await this.getTemp(t,e);break;case"GetDraftTemp":a=await this.getDraftTemp(t,i);break;case"RemoveTemp":a=await this.removeTemp(t,e);break;case"UpdateTemp":a=await this.updateTemp(t,e);break;default:{let s=this.calcPath(t);this.method.needResourceKey&&(s="".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]||e[this.entity.keyAppDEFieldId]));const n=await this.request(s,t,e,i);n.data=await this.result.handle(t,n.data),a=n}}return await Pe(this.entity,"compute",t,a.data,i),a}async create(t,e,s){if(this.isLocalMode)return this.createTemp(t,this.createEntity(e));const i=this.calcPath(t),a=await this.app.net.post(i,e,s);return a.data=await this.result.handle(t,a.data),a}async remove(t,e){if(this.isLocalMode)return this.removeTemp(t,e);const s=this.calcPath(t);return await this.app.net.delete("".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]),e)}async update(t,e,s={}){if(this.isLocalMode)return this.updateTemp(t,this.createEntity(e));const i=this.calcPath(t),a=await this.app.net.put("".concat(i,"/").concat(t[this.entity.codeName.toLowerCase()]),e,s);return a.data=await this.result.handle(t,a.data),a}async get(t,e={}){if(this.isLocalMode)return this.getTemp(t,e);const s=this.calcPath(t),i=await this.app.net.get("".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]),e);return i.data=await this.result.handle(t,i.data),i}async getDraft(t,e){if(this.isLocalMode)return this.getDraftTemp(t,e);const s=this.calcPath(t),i=await this.app.net.get("".concat(s,"/getdraft"),e);return i.data=await this.result.handle(t,i.data),i}async createTemp(t,e){try{const s=await this.getService(),i=await s.local.add(t,this.createEntity(e));return new n(i)}catch(t){return new n(t,500)}}async getDraftTemp(t,e){try{const t=this.createEntity({});return t?new n(t):new n(t,500)}catch(t){return new n(t,500)}}async removeTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const s=(await this.getService()).local.delete(t,e);return s?new n(s):new n(s,500)}catch(t){return new n(t,500)}}async updateTemp(t,e){try{const s=(await this.getService()).local.update(t,this.createEntity(e));return s?new n(s):new n(s,500)}catch(t){return new n(t,500)}}async getTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const s=(await this.getService()).local.get(t,e);return s?new n(s):new n(s,500)}catch(t){return new n(t,500)}}async removeBatchTemp(t,e){return new n(!0)}},ve=class extends te{async exec(t,e,s){if(this.isLocalMode){const s=await this.searchLocal(null,new Ht(t,e));return new n(s,200)}let a;switch(this.method.dataSetType){case"INDEXDE":case"CODELIST":a=await this.fetchCodeListSet(t,s);break;case"REMOTE":{const i=this.calcPath(t);a=await this.request(i,t,e,s)}break;default:throw new i(this.method,"数据来源类型".concat(this.method.dataSetType,"暂未支持"))}const r=a.data||[];return a.data=r.map((t=>this.createEntity(t))),a.data.length&&await Promise.all(a.data.map((e=>Pe(this.entity,"compute",t,e,s)))),a}async selectLocal(t,e={}){let s=(await this.getService()).local.getList(t);s=D(s,"srfordervalue");const i={},a={},n={},r={};e.srfkey&&(i.srfkey=b(e.srfkey),delete e.srfkey);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const s=e[t];null==s?(a[t]=b(null),n[t]=b(void 0),r[t]=b("")):i[t]=b(s)}if(!C(i)){const t=V(i),e=V(a),o=V(n),c=V(r);s=s.filter((s=>{if(C(a)){if(t(s))return!0}else if(t(s)&&(e(s)||o(s)||c(s)))return!0;return!1}))}return s.map((t=>t.clone()))}async searchLocal(t,e,s=this.entity.quickSearchAppDEFieldIds){const i=await this.getService();let a=[];t?(a=i.local.getList(e.context),a.length>0&&(a=a.filter((s=>t.test(s,e))))):(a=await this.selectLocal(e.context),a.length>0&&e.query&&""!==e.query&&s&&(a=a.filter((t=>{const i=new RegExp(e.query);for(let e=0;e<s.length;e+=1){const a=t[s[e]];if(i.test(a))return!0}return!1})))),v(e.sortField)||C(e.sortField)||(a="DESC"===e.sortMode?A(a,e.sortField):D(a,e.sortField));const{page:n,size:r}=e,o=n*r,c=(n+1)*r-1;return a.slice(o,c).map((t=>_(t)))}async fetchCodeListSet(t,e){const{appCodeListId:i}=this.method;if(!i)throw new s(this.method,"没有指定数据来源代码表");const a=await this.app.codeList.get(i,t,e),{keyAppDEFieldId:r,majorAppDEFieldId:o}=this.entity,c=a.map((t=>({[r]:t.value,[o]:t.text})));return new n(c,200)}},Te=t("DEService",class{constructor(t){this.model=t,this.methodMap=new Map,this.local=new Gt,this.wf=new $t(t),this.file=new class{constructor(t){this.model=t}exportData(t,e,s,i){const a=Kt(s,this.model),n="".concat(a,"/").concat(this.model.codeName2.toLowerCase(),"/exportdata/").concat(e.toLowerCase(),"/?srfexporttag=").concat(t.codeName);return ibiz.net.request(n,{method:"post",data:i,responseType:"blob"})}}(t)}getMethod(t){if(this.methodMap.has(t))return this.methodMap.get(t);const e=H(this.model.appDEMethods,t);let s=null;switch(e.methodType){case"DEACTION":s=new ye(this.model,e);break;case"FETCH":case"FETCHTEMP":s=new ve(this.model,e);break;default:throw new i(e,"未支持的服务方法类型: ".concat(e.methodType))}return this.methodMap.set(t,s),s}exec(t,s,i={},a={}){const n=this.getMethod(t);if(n)return n.exec(s,i,a);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}}),Ce=t("ControlVO",class t{get srfuf(){return v(this.$origin.srfuf)?this.srfkey?1:0:this.$origin.srfuf}get srfkey(){return this.$origin.srfkey}get srfmajortext(){return this.$origin.srfmajortext}get srfdeid(){return this.$origin.srfdeid}get srfdecodename(){return this.$origin.srfdecodename}get srfkeyfile(){return this.$origin.srfkeyfile}get srfmajorfile(){return this.$origin.srfmajorfile}constructor(t={},e=new Map){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(((t,e)=>{const s=t.dataKey;this.linkProperty(e,s,t.isOriginField)})),Object.keys(t).forEach((t=>{Object.prototype.hasOwnProperty.call(this,t)||this.linkProperty(t,t)}))}linkProperty(t,e,s=!0){"srfuf"!==t&&(s||Object.prototype.hasOwnProperty.call(this.$origin,t)?Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return this.$origin[e]},set(t){this.$origin[e]=t}}):Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:null}))}getOrigin(){return this.$origin}setOrigin(e){this.$origin=e instanceof t?e.getOrigin():e}}),_e=t("ControlService",class{constructor(t){this.dataUIMap=new Map,this.model=t}async init(t){this.app=ibiz.hub.getApp(null==t?void 0:t.srfappid),this.initUIDataMap()}initUIDataMap(){}async exec(t,e,s={},i={}){return await this.app.deService.exec(this.model.appDataEntityId,t,e,s,i)}handleResponse(t){return t}toUIData(t){return new Ce(t,this.dataUIMap)}}),be=(t("MDControlService",class extends _e{async fetch(t,e={}){var s;const i=(null==(s=this.model.fetchControlAction)?void 0:s.appDEMethodId)||"fetchdefault";let a=await this.exec(i,t,e);return a=this.handleResponse(a),a}async get(t,e={}){var s;const i=(null==(s=this.model.getControlAction)?void 0:s.appDEMethodId)||"get";let a=await this.exec(i,t,void 0,e);return a=this.handleResponse(a),a}async getDraft(t,e={}){var s;const i=(null==(s=this.model.getDraftControlAction)?void 0:s.appDEMethodId)||"getdraft";let a=await this.exec(i,t,void 0,e);return a=this.handleResponse(a),a}async remove(t,e={}){var s;const i=(null==(s=this.model.removeControlAction)?void 0:s.appDEMethodId)||"remove";return await this.exec(i,t,void 0,e)}async create(t,e){var s;const i=(null==(s=this.model.createControlAction)?void 0:s.appDEMethodId)||"create";let a=await this.exec(i,t,e.getOrigin());return a=this.handleResponse(a),a}async update(t,e){var s;const i=(null==(s=this.model.updateControlAction)?void 0:s.appDEMethodId)||"update";let a=await this.exec(i,t,e.getOrigin());return a=this.handleResponse(a),a}async exportData(t,s,i={}){throw new e("未实现")}handleResponse(t){const e=super.handleResponse(t);return e.headers&&(e.headers["x-page"]&&(e.page=Number(e.headers["x-page"])),e.headers["x-per-page"]&&(e.size=Number(e.headers["x-per-page"])),e.headers["x-total"]&&(e.total=Number(e.headers["x-total"]))),e.ok&&(f(e.data)?e.data=e.data.map((t=>this.toUIData(t))):e.data=this.toUIData(e.data)),e}}),t("DeAuthorityService",class{constructor(t){this.entityModel=t}async calcByDataAccessAction(t,e){if(e.srfopprivs&&!e.srfopprivs.includes(t))return!1;return!!await this.calcByDeMainState(t,e)}async calcByDeMainState(t,e){let s=!0;const i=this.entityModel;if(!i.enableDEMainState)return ibiz.log.debug("".concat(i.codeName,"实体不存在或者为启用主状态,返回true")),s;ibiz.log.debug("操作标识".concat(t,"主状态计算开始"),e,i);const a=Y(i,e);if(a){ibiz.log.debug("匹配主状态",a);const e=q(a,i);ibiz.log.debug("允许的主状态权限集合",e),s=e.includes(t)}else ibiz.log.debug("没匹配主状态,返回false"),s=!1;return ibiz.log.debug("操作标识".concat(t,"权限计算结束:").concat(s)),s}})),Ve=t("AuthorityService",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map,this.resCodes=[],this.enablePermission=!1}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const s=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!s)throw new e("未找到应用实体[".concat(t,"]"));const i=this.constructorCache.get(t);let a;a=i?await i(s):new be(s),this.cache.set(t,a)}return this.cache.get(t)}async init(t=ibiz.appData){if(!t)throw new e("没有appData数据");t.unires&&(this.resCodes=t.unires),!0===t.enablepermissionvalid&&ibiz.env.enablePermission&&(this.enablePermission=!0)}calcByResCode(t){return!this.enablePermission||this.resCodes.includes(t)}async calcByDataAccessAction(t,e,s){if(this.enablePermission){const e=await ibiz.hub.getApp(this.appModel.appId),i=await e.getOPPriv(t,s);if(this.enablePermission&&(null==i?void 0:i.mapSysUniResCode)&&!this.calcByResCode(i.mapSysUniResCode))return!1}if(e&&s){return(await this.getService(s)).calcByDataAccessAction(t,e)}return!0}}),Le=t("AuthService",class{async v7login(t,e){return await ibiz.net.post("/v7/login",{loginname:t,password:e},{},{})}async v7logout(){return await ibiz.net.get("/v7/logout",{})}}),Re=t("TreeNodeData",class{constructor(t,e,s){this.leaf=!1,this.leaf=!0===s.leaf,this.parent=e,this.parent&&(this.context={...this.parent.context}),s.navContext&&(this.context=Object.assign(this.context||{},s.navContext)),s.navParams&&(this.params={...s.navParams}),this.nodeId=t.id}}),Me=(t("TreeCodeListNodeData",class extends Re{constructor(t,e,s){super(t,e,s);const{data:i}=s;if(this.deData=i,this.text=i.text,this.value=i.value,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(this.value):t.id+this.value,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=$(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:this.value})}this.srfkey=this.value,this.srfmajortext=this.text}}),t("TreeDataSetNodeData",class extends Re{constructor(t,e,s){super(t,e,s);const{data:i}=s;if(this.deData=i,this.text=i.srfmajortext,this.value=i.srfkey,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(i.srfkey):t.id+i.srfkey,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=$(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:i.srfkey})}this.srfkey=this.deData.srfkey,this.srfmajortext=this.deData.srfmajortext}}),t("TreeStaticNodeData",class extends Re{constructor(t,e,s){var i,a;super(t,e,s);const n="root"===t.nodeValue?void 0:t.nodeValue;if(this.id=e?"".concat(e.id,":").concat(t.id):t.id,this.id=this.id.toLowerCase(),this.text=t.text,this.value=n,e&&s.parentValueLevel){let t=e;for(let e=1;e<s.parentValueLevel;e++)t=null==t?void 0:t.parent;(null==t?void 0:t.deData)&&(this.deData=t.deData),this.value=n||(null==t?void 0:t.value)}this.srfkey=(null==(i=this.deData)?void 0:i.srfkey)||this.value,this.srfmajortext=(null==(a=this.deData)?void 0:a.srfmajortext)||this.text}}),t("UIMapField",class{constructor(t,e,s={}){this.isOriginField=!1,this.isRequestNeed=!0,this.uiKey=t,this.dataKey=e,v(s.isOriginField)||(this.isOriginField=s.isOriginField)}}),t("CalendarItemData",class{constructor(t,e){this.model=t,this.data=e}get deData(){return this.data}get navId(){return"".concat(this.itemType,"@").concat(this.id)}get itemType(){return this.model.itemType}get bkColor(){const t=this.model.bkcolorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.bkcolor}get beginTime(){const t=this.model.beginTimeAppDEFieldId;return t?this.data[t]:void 0}get color(){const t=this.model.colorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.color}get content(){const t=this.model.contentAppDEFieldId;return t?this.data[t]:void 0}get endTime(){const t=this.model.endTimeAppDEFieldId;return t?this.data[t]:void 0}get icon(){const t=this.model.iconAppDEFieldId;return t?this.data[t]:void 0}get id(){const t=this.model.idAppDEFieldId;return t&&this.data[t]?this.data[t]:this.data.srfkey}get level(){const t=this.model.levelAppDEFieldId;return t?this.data[t]:void 0}get tag2(){const t=this.model.tag2AppDEFieldId;return t?this.data[t]:void 0}get tag(){const t=this.model.tagAppDEFieldId;return t?this.data[t]:void 0}get text(){const t=this.model.textAppDEFieldId;return t?this.data[t]:void 0}get tips(){const t=this.model.tipsAppDEFieldId;return t?this.data[t]:void 0}}),t("DEServiceUtil",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const s=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!s)throw new e("未找到应用实体[".concat(t,"]"));const i=this.constructorCache.get(t);let a;a=i?await i(s):new Te(s),this.cache.set(t,a)}return this.cache.get(t)}clearTempCache(t){this.cache.forEach((e=>{e.local.clear(t)}))}async exec(t,e,s,i,a){return(await this.getService(t)).exec(e,s,i,a)}})),Oe=t("Application",class{constructor(t){this.model=t,this.deName2DeCodeName=new Map,this.net=new o({baseURL:"".concat(ibiz.env.baseUrl,"/").concat(t.appId)}),this.deService=new Me(t),this.codeList=new Yt(t),this.authority=new Ve(t)}get appId(){return this.model.appId}async init(){await this.authority.init(),await this.loadAppModelStyle()}async loadAppModelStyle(){await this.net.get("".concat(ibiz.env.remoteModelUrl,"/PSSYSAPP.json.css")).then((t=>{const e=document.createElement("style");if(e.setAttribute("type","text/css"),t.request&&t.request.responseURL){const s=new URL(t.request.responseURL);e.id=s.pathname}e.innerHTML=t.data,document.head.appendChild(e)})).catch((t=>{ibiz.log.error("应用[".concat(this.appId,"]模型全局样式加载失败:").concat(t.message))}))}getAppFunc(t){return(this.model.appFuncs||[]).find((e=>e.id===t))||null}async getUIAction(t){const[,e]=t.split("@");if(e){const s=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUIActions.find((e=>e.id===t));if(s)return s}return this.model.appDEUIActions.find((e=>e.id===t))}async getOPPriv(t,e){var s,i;let a=null==(s=this.model.deopprivs)?void 0:s.find((e=>e.name===t));if(!a&&e){a=null==(i=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).deopprivs)?void 0:i.find((e=>e.name===t))}return a}async getDEUILogic(t,e){return(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUILogics.find((e=>e.id===t))}}),Ne=class{constructor(){this.convert=new class{constructor(){this.appMenu=new class{parse(t){return t}}}},this.appMap=new Map,this.apps=new Map,this.view2appMap=new Map,this.views=new Map,this.dataEntities=new Map,this.config=new class{constructor(){this.view=new class{constructor(){this.viewConfigs=new Map}set(t,e){this.viewConfigs.set(t,e)}async get(t){if(!this.viewConfigs.has(t)){const s=await ibiz.hub.getAppView(t);if(!s)throw new e("视图[".concat(t,"]不存在"));this.set(s.id,{id:s.id,codeName:s.codeName,openMode:s.openMode,width:s.width,height:s.height,appDataEntityId:s.appDataEntityId,redirectView:s.redirectView})}return this.viewConfigs.get(t)}}}},this.defaultAppIndexViewName="Index"}calcAppViewId(t){let e="";if(-1!==t.indexOf(".")){const s=t.split(".");e=s[s.length-1]}else e=t.toLowerCase();return e}registerModelLoaderProvider(t){this.modelLoaderProvider=t}registerApp(t){this.apps.set(t.codeName,t)}registerAppView(t){this.views.set(t.codeName,t)}registerAppDataEntity(t,e=ibiz.env.appId){this.dataEntities.has(e)||this.dataEntities.set(e,new Map);this.dataEntities.get(e).set(t.id,t)}setAppView(t,e=ibiz.env.appId){const s=this.calcAppViewId(t);this.view2appMap.set(s,e)}hasAppView(t){const e=this.calcAppViewId(t);return this.view2appMap.has(e)}async getAppView(t){const s=this.calcAppViewId(t),i=this.view2appMap.get(s)||ibiz.env.appId;if(this.appMap.has(i)||await this.createApp(i),this.views.has(s))return this.views.get(s);if(this.modelLoaderProvider){const t=await this.modelLoaderProvider.getAppView(i,s);return this.registerAppView(t),t}throw new e("视图[".concat(s,"]不存在"))}async getAppDataEntity(t,s=ibiz.env.appId){if(this.dataEntities.has(s)){const e=this.dataEntities.get(s);if(e.has(t))return e.get(t)}if(this.modelLoaderProvider){let e;return e=-1!==t.indexOf(".")?await this.modelLoaderProvider.getAppDataEntity(s,t):await this.modelLoaderProvider.getAppDataEntityByCodeName(s,t),this.registerAppDataEntity(e,s),e}throw new e("未找到应用实体[".concat(t,"]"))}async createApp(t){if(this.appMap.has(t))return this.appMap.get(t);let s;if(this.apps.has(t))s=this.apps.get(t);else{if(!this.modelLoaderProvider)throw new e("未找到应用[".concat(t,"]模型"));s=await this.modelLoaderProvider.getApp(t),this.registerApp(s)}const i=new Oe(s);return this.appMap.set(t,i),await i.init(),i}async getAppAsync(t=ibiz.env.appId){return this.createApp(t)}getApp(t){let e=null;return e=t?t instanceof Object?t.id:t:ibiz.env.appId,this.appMap.get(e)}},We=t("EngineFactory",class{constructor(){this.viewEngines=new Map}register(t,e){this.viewEngines.set(t,e)}unRegister(t){this.viewEngines.delete(t)}getEngine(t,...e){const{engineType:s,engineCat:i}=t,a="".concat(i,"_").concat(s),n=this.viewEngines.get(a);if(n)return n(...e);ibiz.log.error("没有".concat(a,"对应的引擎"),t)}}),xe=t("ViewEngineBase",class{constructor(t){this.view=t,this.initViewState()}get toolbar(){return this.view.getController("toolbar")}get leftToolbar(){return this.view.getController("lefttoolbar")}get rightToolbar(){return this.view.getController("righttoolbar")}get footerToolbar(){return this.view.getController("footertoolbar")}get viewLayoutPanel(){return this.view.layoutPanel}async onCreated(){const{childNames:t}=this.view;t.push("captionbar","toolbar")}async onMounted(){var t,e;const{model:s,childNames:i}=this.view;ibiz.log.debug("".concat(s.id,"的子组件:").concat(i.join(";"),"都已mounted"));if(!this.calcViewHeaderVisible()){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_header;e&&(e.state.visible=!1)}if(ibiz.env.isMob){if(!this.calcViewFooterVisible()){const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.view_footer;t&&(t.state.visible=!1)}}}async onDestroyed(){}async call(t,e){if("GetData"===t)return this.getData()}initViewState(){}getData(){return[]}calcViewHeaderVisible(){var t,e,s,i;let a=!1;const{model:n}=this.view;if(!1===n.showCaptionBar){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_captionbar;e&&(e.state.visible=!1)}else a=!0;if(ibiz.env.isMob){if(this.leftToolbar)a=!0;else{const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.lefttoolbar;t&&(t.state.visible=!1)}if(this.rightToolbar)a=!0;else{const t=null==(s=this.viewLayoutPanel)?void 0:s.panelItems.righttoolbar;t&&(t.state.visible=!1)}}else if(this.toolbar)a=!0;else{const t=null==(i=this.viewLayoutPanel)?void 0:i.panelItems.view_toolbar;t&&(t.state.visible=!1)}return a}calcViewFooterVisible(){let t=!1;return this.footerToolbar&&(t=!0),t}async loadEntityData(){const{appDataEntityId:t}=this.view.model,{evt:s,context:i,params:a}=this.view;if(!t)throw new e("该视图没有实体,无法加载实体数据");const n=ibiz.hub.getApp(i.srfappid),r=await n.deService.exec(t,"get",i,a),{data:o}=r;o&&(this.view.state.srfactiveviewdata=o,s.emit("onDataChange",{actionType:"LOAD",data:[o]}),o.srfkey&&s.emit("onViewInfoChange",{dataInfo:o.srfmajortext||""}))}}),Se=(t("MDViewEngine",class extends xe{get xdataControlName(){return this.view.model.xdataControlName}get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get xdataControl(){return this.view.getController(this.xdataControlName)}async onCreated(){await super.onCreated();const{childNames:t}=this.view;t.push(this.xdataControlName,"searchform","searchbar")}async onMounted(){await super.onMounted();const{model:t}=this.view;this.xdataControl.evt.on("onActive",(async t=>{await this.openData(t)})),this.xdataControl.evt.on("onSelectionChange",(async t=>{var e;null==(e=this.toolbar)||e.calcButtonState(t.data[0],this.xdataControl.model.appDataEntityId)})),this.xdataControl.evt.on("onBeforeLoad",(()=>{this.xdataControl.state.searchParams=this.getSearchParams()})),this.xdataControl.evt.on("onLoadSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"LOAD"})})),this.xdataControl.evt.on("onRemoveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"REMOVE"})})),this.xdataControl.evt.on("onSaveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"SAVE"})}));const e=this.viewLayoutPanel.panelItems.view_searchform;if(e){const s=!!this.searchForm;e.state.keepAlive=s,e.state.visible=s&&!!t.expandSearchForm}this.searchForm&&this.searchForm.evt.on("onSearch",(()=>{this.refresh()})),this.searchBar&&this.searchBar.evt.on("onSearch",(()=>{this.refresh()})),!this.view.state.noLoadDefault&&t.loadDefault&&this.load()}async call(t,e){return"ToggleFilter"===t?(this.toggleFilter(),null):"Edit"===t||"View"===t?(this.openData(e),null):"New"===t?(this.newData(e),null):"Remove"===t?(await this.remove(e),null):"Import"===t?(await this.importData(),null):"Refresh"===t?(await this.refresh(),null):"ExportExcel"===t?(await this.exportData(e),null):"Copy"===t?(this.copy(e),null):"load"===t?(this.load(e),null):super.call(t,e)}getData(){return this.xdataControl.getData()}async openData(t){var e,s;const{data:i,event:a}=t,n=(t.context||this.view.context).clone(),r=t.params||this.view.params;n[((null==(e=i[0].srfdecodename)?void 0:e.toLowerCase())||$(this.xdataControl.model.appDataEntityId)).toLowerCase()]=i[0].srfkey;-1===await(null==(s=this.view.scheduler)?void 0:s.triggerCustom("opendata",{context:n,params:r,data:i,event:a,view:this.view}))&&ibiz.log.warn("视图[".concat(this.view.model.codeName,"],未配置编辑打开视图"))}async newData(t){var e,i,a;const{data:n,event:r,copyMode:o}=t;if(!(null==(i=null==(e=this.view.model.viewLayoutPanel)?void 0:e.appViewLogics)?void 0:i.find((t=>"newdata"===t.id))))throw new s(this.view.model,"缺少newdata的视图逻辑");const c=this.view.context.clone();o&&(c.srfcopymode=!0);if(-1===await(null==(a=this.view.scheduler)?void 0:a.triggerCustom("newdata",{context:c,params:this.view.params,data:n,event:r,view:this.view})))throw new s(this.view.model,"缺少newdata的视图逻辑")}async remove(t){await this.xdataControl.remove(t)}async load(t={}){await this.xdataControl.load({isInitialLoad:!0,...t})}async refresh(){await this.xdataControl.refresh()}getSearchParams(){const t={};if(this.searchForm){const e=this.searchForm.getData()[0];Object.assign(t,e)}if(this.searchBar){const e={query:this.searchBar.state.query};Object.assign(t,e)}return t}async importData(){await this.xdataControl.importData()}async exportData(t){await this.xdataControl.exportData(t)}async copy(t){this.newData(Object.assign(t,{copyMode:!0}))}calcViewHeaderVisible(){let t=super.calcViewHeaderVisible();if(this.searchBar)t=!0;else{const t=this.viewLayoutPanel.panelItems.view_searchbar;t&&(t.state.visible=!1)}return t}toggleFilter(){if(this.searchForm){const t=this.viewLayoutPanel.panelItems.view_searchform;t&&(t.state.visible=!t.state.visible)}}}),class{constructor(){this.layoutPanel=new wt}}),Fe=t("CONTROL_PROVIDER_PREFIX","CONTROL");function Be(t){return ibiz.register.get("".concat(Fe,"_").concat(t))}async function ke(t){let e;const{controlType:s,controlStyle:i}=t;if(i&&"DEFAULT"!==i){e=Be("".concat(s,"_").concat(i)),e||ibiz.log.error("找不到部件类型:[".concat(s,"]的部件样式:[").concat(i,"]对应的适配器"),t)}return e||(e=Be(s)),e||ibiz.log.error("找不到部件类型".concat(s,"对应的适配器")),e}var Ue=t("EDITOR_PROVIDER_PREFIX","EDITOR");function ze(t){return ibiz.register.get("".concat(Ue,"_").concat(t))}var Ge=t("FORMDETAIL_PROVIDER_PREFIX","FORMDETAIL");var je=t("GRIDCOLUMN_PROVIDER_PREFIX","GRIDCOLUMN");var Xe=t("PANELITEM_PROVIDER_PREFIX","PANELITEM");function Ke(t){return ibiz.register.get("".concat(Xe,"_").concat(t.toUpperCase()))}var He=t("UIACTION_PROVIDER_PREFIX","UIACTION");function Ye(t,e){ibiz.register.register("".concat(He,"_").concat(t),e)}async function qe(t){let s;const{uiactionMode:i}=t;var a;if(s||(a=i,s=ibiz.register.get("".concat(He,"_").concat(a))),!s)throw new e("找不界面行为模式".concat(i,"对应的适配器"));return s}var $e=t("VIEW_PROVIDER_PREFIX","VIEW");function Qe(t){return ibiz.register.get("".concat($e,"_").concat(t))}var Je=t("PORTLET_PROVIDER_PREFIX","PORTLET");var Ze=class{},ts=class extends Ze{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName.toLowerCase()}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,a){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new s(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=a[this.value]?a[this.value]:e[this.value];return ot(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new s(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return ot(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new i(this.model,"暂未支持条件值类型为[当前时间]");default:return ot(n[this.dstField],this.op,this.value)}}},es=class t extends Ze{constructor(e){super(),this.model=e;const s=e.deuilogicLinkConds||[];this.conds=s.map((e=>"SINGLE"===e.logicType?new ts(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,i){let a=!0;if(0===this.conds.length)throw new s(this.model,"界面连接条件逻辑组未配置逻辑项");for(let s=0;s<this.conds.length;s++){const n=this.conds[s].test(t,e,i);if("AND"===this.op&&!1===n){a=!1;break}if("OR"===this.op&&!0===n){a=!0;break}}return this.notMode?!a:a}},ss=class{constructor(t){this.model=t,this.links=(t.deuilogicLinks||[]).map((t=>new class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const{linkMode:e,deuilogicLinkGroupCond:s}=this.model;0===e&&s&&(this.groupCond=new es(s))}async exec(t){const{linkMode:e}=this.model,{context:s,data:a}=t;switch(e||0){case 0:return!this.groupCond||this.groupCond.test(t,s,a&&a.length>0?a[0]:{});case 1:return!0;case 2:throw new i(this.model,"未支持的逻辑连接类型: 异步结束");case 3:throw new i(this.model,"未支持的逻辑连接类型: 异步拒绝");case 9:throw new i(this.model,"未支持的逻辑连接类型: 异常处理");default:throw new i(this.model,"未支持的逻辑连接类型:".concat(e))}}}(t)))}},is=class extends ss{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:i,dstDEUILogicParamId:a,retDEUILogicParamId:n}=this.model;if(!e)throw new s(this.model,"未指定应用实体");if(!i)throw new s(this.model,"未指定实体行为");const r=t.params[a],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,i,t.context,r,t.viewParams);c.ok&&(t.params[n]=c.data)}},as=class extends ss{async exec(t){const{dstAppDEUIActionId:e,dstDEUILogicParamId:i}=this.model,{data:a,parameters:n}=t;if(!e)throw new s(this.model,"未配置界面行为");let r=[a];if(i){const e=t.params[i];r=e instanceof Array?e:[e]}await Es.execAndResolved(e,{...n,data:r})}},ns=class extends ss{async exec(t){}},rs=class extends ss{async exec(t){t.isEndNode=!0;const{returnType:e,rawValue:s,returnParamId:a}=this.model;switch(e){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=s;break;case"LOGICPARAM":t.result=t.params[a];break;default:throw new i(this.model,"暂未支持的结束节点返回值类型: ".concat(e))}}};function os(t,e){const{srcDEUILogicParamId:s,srcFieldName:a,srcValue:n}=e,r=e.srcValueType||"SRCDLPARAM";let o;switch(r){case"SRCDLPARAM":o=t.params[s];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return n;case"VIEWPARAM":o=t.viewParams;break;case"APPDATA":o=t.context;break;case"ENVPARAM":o=_(ibiz.env);break;default:throw new i(e,"暂未支持源值类型".concat(r))}const c=null==a?void 0:a.toLowerCase();return o&&c&&(o=o[c]),o}var cs=class extends ss{async exec(t){const e=this.model.deuilogicNodeParams;(null==e?void 0:e.length)&&await Promise.all(e.map((e=>{if("SETPARAMVALUE"===e.paramAction)return this.setParamValue(e,t);throw new i(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))})))}setParamValue(t,e){const{dstFieldName:s,dstDEUILogicParamId:i}=t,a=null==s?void 0:s.toLowerCase(),n=os(e,t);a?e.params[i][a]=n:e.params[i]=n}},ls=class extends ss{async exec(t){t.isEndNode=!0;const{invokeMethod:i,invokeCtrlId:a,invokeParamId:n}=this.model;if(!a)throw new s(this.model,"没有配置界面对象");if(!n)throw new s(this.model,"没有配置操作参数");if(!i)throw new s(this.model,"没有配置调用方法");const r=t.params[n];if(!r)throw new e("没有找到操作参数".concat(n));const o=t.params[a];if(!o)throw new e("没有找到界面对象".concat(a));if(!o[i]||!u(o[i]))throw new e("没有找到调用方法".concat(i));await o[i](r)}},ds=class extends ss{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:i}=this.model;if(!e||!i)throw new s(this.model,"缺少目标参数对象或者源参数对象配置");const a=os(t,this.model);t.params[e]=a}},hs=class{constructor(t){var e;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.deuilogicNodes)?void 0:e.length))throw new s(t,"界面逻辑没有配置逻辑节点");t.deuilogicNodes.forEach((t=>{const{logicNodeType:e}=t;let s;switch(e){case"BEGIN":s=new ns(t);break;case"END":s=new rs(t);break;case"DEACTION":s=new is(t);break;case"DEUIACTION":s=new as(t);break;case"PREPAREJSPARAM":s=new cs(t);break;case"BINDPARAM":s=new ds(t);break;case"VIEWCTRLINVOKE":s=new ls(t);break;default:throw new i(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,s)})),t.deuilogicParams.forEach((t=>{this.params.set(t.id,new class{constructor(t){this.model=t}calc(t){const e=this.model.id,a=this.model,{context:n,viewParams:r,data:o,parameters:c}=t,l=ibiz.hub.getApp(n.srfappid);if(a.default)t.params[e]=o&&o.length>0?o[0]:{};else if(a.activeContainerParam)t.params[e]=c.ctrl||c.view;else if(a.activeCtrlParam)t.params[e]=c.ctrl;else if(a.ctrlParam){const i=c.view.getController(a.codeName.toLowerCase());if(!i)throw new s(this.model,"视图逻辑初始化参数,未找到".concat(a.codeName,"指定部件对象"));t.params[e]=i}else if(a.activeViewParam)t.params[e]=c.view;else if(a.appGlobalParam)t.params[e]=ibiz.env;else if(a.applicationParam)t.params[e]=l;else if(a.entityListParam)t.params[e]=[];else{if(a.entityPageParam)throw new i(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[e]={};else{if(a.lastReturnParam)throw new i(a,"未支持的逻辑参数类型: 上次调用返回");if(a.navContextParam)t.params[e]=n;else{if(a.navViewParamParam)throw new i(a,"未支持的逻辑参数类型: 视图路由参数");if(a.routeViewSessionParam)throw new i(a,"未支持的逻辑参数类型: 路由视图会话");if(a.simpleListParam)t.params[e]=[];else if(a.simpleParam)t.params[e]={};else if(a.viewNavDataParam)t.params[e]=r;else if(a.viewSessionParam)throw new i(a,"未支持的逻辑参数类型: 当前视图会话")}}}}renew(t){const e=this.model.id,s=this.model;if(s.entityListParam||s.simpleListParam||s.entityPageParam)t.params[e]=[];else{if(!s.simpleParam&&!s.entityParam)throw new i(s,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}}(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.dstDEUILogicNodeId)&&(e.dstNode=this.nodes.get(e.model.dstDEUILogicNodeId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t){const e=new class{constructor(t,e){this.deLogicParams=t,this.parameters=e,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}get context(){return this.parameters.context}get data(){return this.parameters.data}get viewParams(){return this.parameters.params}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}}(this.params,t);this.initLogicParams(e);const{startDEUILogicNodeId:i}=this.model;if(!i||!this.nodes.has(i))throw new s(this.model,"未设置起始节点");{const t=this.nodes.get(i);await this.deepExec(t,e)}return e.isEndNode?e.result:e.params[e.defaultParamName]?e.params[e.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:s}=t;for(let i=0;i<s.length;i++){const a=s[i];if(await a.exec(e)&&a.dstNode&&(await this.deepExec(a.dstNode,e),!1===t.model.parallelOutput))break}}},us=new Map;async function ps(t,s,i){const a=ibiz.hub.getApp(i.context.srfappid),n=await a.getDEUILogic(t,s);if(!n)throw new e("找不到实体".concat(s,"的界面逻辑").concat(t));us.has(n)||us.set(n,new hs(n));const r=us.get(n);return await r.exec(i),null}var Es=t("UIActionUtil",class{static async exec(t,s){const i=await tt(t);if(!i)throw new e("没找到".concat(t,"的界面行为模型"));return(await qe(i)).exec(i,s)}static async execAndResolved(t,e){const s=await this.exec(t,e);s.closeView?e.view.closeView():s.refresh&&await e.view.callUIAction("Refresh")}}),gs=class{async exec(t,e){const{context:i,params:a,data:n}=e,r={refresh:t.reloadData,closeView:t.closeEditView},{appDEUILogicId:o,appDataEntityId:c,uilogicAttachMode:l}=t;if("REPLACE"===l){if(!o)throw new s(t,"没有配置实体界面逻辑");return await ps(o,c,e),r}if(!await this.isConfirm(t))return this.returnError(r);const d=await this.execAction(t,e);if(Object.assign(r,d),!0===r.cancel)return this.returnError(r);const h=await this.doNextAction(t,{...e,context:r.nextContext||i,data:r.data||n,params:r.nextParams||a});if(h&&(Object.assign(r,h),!0===h.cancel))return this.returnError(r);if("AFTER"===t.uilogicAttachMode){if(!o)throw new s(t,"没有配置实体界面逻辑");await ps(o,c,e)}return r}returnError(t){return Object.assign(t,{refresh:!1,closeView:!1})}async isConfirm(t){return!t.enableConfirm||!t.confirmMsg||ibiz.modal.confirm({title:t.confirmMsg})}async doNextAction(t,e){const s=t.nextId;if(s)return Es.exec(s,e)}async handleParams(t,e,s,i){let a=[];const n=$(t.appDataEntityId);switch(t.actionTarget){case"NONE":a=[];break;case"SINGLEDATA":a=[s[0]];break;case"MULTIDATA":a=s;break;case"MULTIKEY":a=n&&s.length>0?s.map((t=>({[n]:t.srfkey||t[n]}))):[{}];break;case"SINGLEKEY":{const t=s[0]||{};a=n?[{[n]:t.srfkey||t[n]}]:[{}]}}const r=e.clone(),o=[...t.navigateContexts||[]];if(n&&"NONE"!==t.actionTarget){const{valueItem:e,paramItem:s}=t,i=s||n,a=e||"srfkey";o.unshift({key:i,value:a,rawValue:!1})}const c=["MULTIKEY","MULTIDATA"].includes(t.actionTarget)&&s.length>0,l=z(o,e,i,c?K(o,s):s[0]||{});Object.assign(r,l);const d=t.navigateParams;return{resultContext:r,resultData:a,resultParams:z(d,r,i,c?K(d,s):s[0]||{})}}},ms=t("BackendUIActionProvider",class extends gs{async execAction(t,e){const{context:i,params:a,data:n,event:r}=e,o={},c=t.appDataEntityId,l=t.appDEMethodId;if(!c||!l)throw new s(t,"未配置实体或实体行为");const{resultContext:d,resultParams:h,resultData:u}=await this.handleParams(t,i,n,a),p={...a,...h},E=t.frontAppViewId;if(E){const t=await ibiz.commands.execute(_t.TAG,E,d,h,{event:r});if(!(null==t?void 0:t.ok))return o.cancel=!0,o;(null==t?void 0:t.ok)&&t.data&&(0===u.length&&u.push({}),u.forEach((e=>{e.srfactionparam=t.data})))}const g=ibiz.hub.getApp(null==i?void 0:i.srfappid),m=u.map((t=>{var e;return(null==(e=t.getOrigin)?void 0:e.call(t))||t||{}})),w=["MULTIKEY","MULTIDATA"].includes(t.actionTarget),I=await g.deService.exec(c,l,d,w?m:m[0],p);return I.ok&&t.successMsg&&ibiz.message.success(t.successMsg),Object.assign(o,{data:f(I.data)?I.data:[I.data],nextContext:d,nextParams:p}),o}}),ws=t("SysUIActionProvider",class extends gs{async execAction(t,e){const{view:s}=e,i=t.uiactionTag;if("Exit"===i)return{closeView:!0};return await s.callUIAction(i,e)||{}}}),fs=t("FrontUIActionProvider",class extends gs{async execAction(t,e){const{context:a,params:n,data:r,event:o,noWaitRoute:l}=e;let d={};switch(t.frontProcessType){case"OPENHTMLPAGE":{const e=c.fill(t.htmlPageUrl,a,null==r?void 0:r[0]);window.open(e,"_blank");break}case"TOP":case"WIZARD":{const e=t.frontAppViewId;if(!e)throw new s(t,"未配置打开视图");const{resultContext:i,resultParams:c}=await this.handleParams(t,a,r,n),h=await ibiz.commands.execute(_t.TAG,e,i,c,{event:o,noWaitRoute:l});(null==h?void 0:h.ok)||(d.cancel=!0),(null==h?void 0:h.ok)&&h.data&&(d.data=h.data,d.nextContext=i,d.nextParams={...n,...c});break}case"OTHER":d=this.doOther(t,e);break;default:throw new i(t,"未支持的前台处理模式[".concat(t.frontProcessType,"]"))}return d}doOther(t,e){const{scriptCode:i}=t,{context:a,params:n,data:r,event:o}=e;if(i){return Et.execScriptFn({context:a,params:n,data:r,el:null==o?void 0:o.target},i)||{}}throw new s(t,"自定义类型缺少配置脚本代码")}}),Is=t("WFWithdrawUIActionProvider",class extends gs{async execAction(t,e){const{view:s}=e;let i=!1;return await ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})&&s&&(await s.call("WFWithdraw",e),i=!0),{refresh:!1,closeView:i}}});function Ds(){const t=new fs;Ye("FRONT",(()=>t));const e=new ms;Ye("BACKEND",(()=>e));const s=new ws;Ye("SYS",(()=>s));const i=new Is;Ye("DEUIACTION_WFWithdraw",(()=>i))}var As=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.logicType}execute(t){throw new e("Method not implemented.")}destroy(){}},Ps=class extends As{constructor(){super(...arguments),this.isRowReturn=!1}convertScriptArgs(t){throw new e("未设置脚本执行参数转换方法")}init(t,e){this.convertScriptArgs=e;let s=this.logic.scriptCode;this.isRowReturn&&(s="return (".concat(s,")")),this.scriptFn=Et.createScriptFn(t,s,{singleRowReturn:this.isRowReturn})}execute(t){const e=this.convertScriptArgs(t);return this.scriptFn.exec(e)}},ys=class extends As{execute(t){const{appDEUILogicId:e,appDataEntityId:i}=this.logic;if(!e)throw new s(this.logic,"没有配置实体界面逻辑");ps(e,i,t)}},vs=class{constructor(t){this.triggers=new Map,this.executors=new Map,this.hasViewEventTrigger=!1,this.hasControlEventTrigger=!1,this.logics=t,t.forEach((t=>{try{const e=this.createExecutor(t);this.executors.set(t.id,e);const s=this.createTrigger(t);this.triggers.set(t.id,s),s.bindExecutor(e)}catch(t){ibiz.log.error(t.message)}}))}destroy(){this.triggers.forEach((t=>t.destroy())),this.executors.forEach((t=>t.destroy()))}getExecuteParams(t){let e={};return this.defaultParamsCb&&(e=this.defaultParamsCb()),L(t,e)}createTrigger(t){switch(t.triggerType){case"VIEWEVENT":this.hasViewEventTrigger=!0;break;case"CTRLEVENT":this.hasControlEventTrigger=!0}return ibiz.scheduler.triggerFactory.createTrigger(t,this)}createExecutor(t){return ibiz.scheduler.executorFactory.createExecutor(t,this)}getMatchTriggers(t){const e=[];return this.triggers.forEach((s=>{s.match(t)&&e.push(s)})),e}triggerAndExecute(t,e={}){const s=this.getMatchTriggers(t);if(s.length>0){const t=this.getExecuteParams(e);return s.map((e=>e.execute(t)))}}triggerItemDynaLogic(t,e,s){const i={itemName:t,triggerType:e},a=this.triggerAndExecute(i,s);if(null==a?void 0:a.length)return a.pop()}triggerItemVisible(t,e){return this.triggerItemDynaLogic(t,"ITEMVISIBLE",e)}triggerItemEnable(t,e){return this.triggerItemDynaLogic(t,"ITEMENABLE",e)}triggerItemBlank(t,e){return this.triggerItemDynaLogic(t,"ITEMBLANK",e)}startTimerTrigger(){this.getMatchTriggers({triggerType:"TIMER"}).forEach((t=>t.start()))}triggerCustom(t,e){const s=this.triggers.get(t);if(!s)return-1;const i=this.getExecuteParams(e);return s.execute(i)}triggerControlEvent(t,e){const s={ctrlName:t,eventName:e.eventName,triggerType:"CTRLEVENT"};this.triggerAndExecute(s,e)}},Ts=class extends vs{constructor(t){super(t.filter((t=>"APPVIEWENGINE"!==t.triggerType)))}},Cs=class extends vs{constructor(t){t.forEach((t=>{t.triggerType=t.logicTrigger})),super(t)}triggerViewEvent(t){const e={eventName:t.eventName,triggerType:"VIEWEVENT"};this.triggerAndExecute(e,t)}},_s=class{constructor(){this.executorFactory=new class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createExecutor(t,e){const s=this.constructorMap.get(t.logicType);if(!s)throw new i(t,"逻辑类型 ".concat(t.logicType," 暂未支持!"));return s(t,e)}},this.triggerFactory=new class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createTrigger(t,e){const s=this.constructorMap.get(t.triggerType);if(!s)throw new i(t,"触发器类型 ".concat(t.triggerType," 暂未支持!"));return s(t,e)}}}createViewScheduler(t){return new Cs(t)}createControlScheduler(t){return new Ts(t)}},bs=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.triggerType}bindExecutor(t){this.executor=t}match(t){return t.triggerType===this.type}execute(t){if(this.executor)return this.executor.execute(t);throw new e("".concat(this.logic.id,"没有绑定executor"))}destroy(){this.executor=void 0}},Vs=class extends bs{},Ls=class extends bs{bindExecutor(t){if(super.bindExecutor(t),"SCRIPT"!==this.executor.type)throw new e("预定义逻辑类型".concat(this.type,"的触发器类型只能是脚本"));this.executor.isRowReturn=!0,this.executor.init(["context","viewparams","data","env"],(t=>{const{context:e,params:s,data:i}=t;return{context:e,params:s,data:(null==i?void 0:i[0])||{},env:ibiz.env}}))}match(t){return super.match(t)&&t.itemName===this.logic.itemName}execute(t){const s=this.executor.execute(t);if("boolean"==typeof s)return s;throw new e("".concat(this.logic.id,"逻辑返回值不是布尔值"))}},Rs=class extends bs{constructor(){super(...arguments),this.timer=null}start(){this.timer=setInterval((()=>{if(!this.scheduler.defaultParamsCb)throw new e("定时器缺少默认参数回调");const t=this.scheduler.defaultParamsCb();this.executor.execute(t)}),this.logic.timer)}destroy(){super.destroy(),this.timer&&clearInterval(this.timer)}},Ms=class extends As{execute(t){return"opendata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeOpenDataAppUILogic(this.logic.builtinAppUILogic,t):"newdata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeNewDataAppUILogic(this.logic.builtinAppUILogic,t):void 0}async executeOpenDataAppUILogic(t,i){const{context:a,params:n,...r}=i,{data:o}=i;if(!(null==o?void 0:o[0]))throw new e("opendata没有可操作数据!");const c=t.openDataAppView;if(!c)throw new s(t,"opendata视图逻辑没有配置默认打开视图");const l=c.refAppViewId;if(!l)throw new s(t,"opendata视图逻辑的默认打开视图没有实际引用视图");const d=c.navigateContexts||[],h=Object.assign(a,z(d,a,n,o[0]));let u={};const E=c.navigateParams;p(E)&&(u=z(E,n,a,o[0])),await ibiz.commands.execute(_t.TAG,l,h,u,r)}async executeNewDataAppUILogic(t,e){const{context:a,params:n,...r}=e,{data:o}=e,{enableWizardAdd:c,enableBatchAdd:l,batchAddOnly:d,newDataAppView:h}=t;let u;if(c){if(u=await this.getWizardNewViewRef(t,e),!u)return}else{if(l)throw new i(t,"enableBatchAdd暂未支持");if(d)throw new i(t,"batchAddOnly暂未支持");if(u=h,!u||!u.refAppViewId)throw new s(t,"newdata视图逻辑没有配置默认新建数据视图")}let E={},g={};const m=(null==o?void 0:o[0])||{},w=u.navigateContexts;p(w)&&(E=z(w,a,n,m)),E=Object.assign(a,E);const f=u.navigateParams;p(f)&&(g=z(f,n,a,m)),a.srfcopymode&&(m.srfkey=void 0,g=Object.assign(g,m.$origin)),await ibiz.commands.execute(_t.TAG,u.refAppViewId,E,g,r)}async getWizardNewViewRef(t,i){var a;const{wizardAppView:n,newDataAppViews:r}=t,{context:o,params:c,...l}=i;if(!n||!n.refAppViewId)throw new s(t,"缺少默认索引实体选择视图");const d=await ibiz.commands.execute(_t.TAG,n.refAppViewId,o,c,{...l,openMode:"POPUPMODAL"});if(!d.ok)return;const h=null==(a=d.data)?void 0:a[0];if(!h)throw new e("请选中一条数据");const u=h.srfkey,p=null==r?void 0:r.find((t=>t.refMode===u));if(!p)throw new e("没有找到与索引类型".concat(u,"相关的实体的编辑视图"));return p}},Os=class extends bs{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const s=t.eventNames.split(",");this.listenEventNames=s.map((t=>Pt[t]||t))}match(t){return super.match(t)&&this.listenEventNames.includes(t.eventName)}},Ns=class extends bs{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const s=t.eventNames.split(",");this.listenEventNames=s.map((t=>vt[t]||t))}match(t){return super.match(t)&&t.ctrlName===this.logic.ctrlName&&this.listenEventNames.includes(t.eventName)}};var Ws=((t,e,s)=>(s=null!=t?O(S(t)):{},((t,e,s,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let a of x(e))F.call(t,a)||a===s||N(t,a,{get:()=>e[a],enumerable:!(i=W(e,a))||i.enumerable});return t})(!e&&t&&t.__esModule?s:N(s,"default",{value:t,enumerable:!0}),t)))(B(),1),xs=(t("PluginStaticResource",class{constructor(t){this.styleElementMap=new Map,this.url=new URL(t);const e=Ws.default.dirname(this.url.pathname);this.baseDir=e}dir(t){return Ws.default.resolve(this.baseDir,t)}async loadStyle(t){const e=t.map((t=>{const e=this.dir(t);return!this.styleElementMap.has(e)&&(this.styleElementMap.set(e,null),new Promise(((t,s)=>{const i=document.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",e),i.onload=t,i.onerror=s,document.head.appendChild(i)})))}));try{await Promise.all(e)}catch(t){ibiz.log.error(t)}}}),t("RemotePluginItem",class{constructor(t,e,s){this.tag=t,this.repo=e,this.config=s}}),t("FormNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(xs||{}))),Ss=t("GridNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Ss||{})),Fs=t("PanelNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Fs||{})),Bs=t("Counter",class{constructor(t){this.callback=t,this.count=0,this.state="Unused",this.reusable=!0}increment(){return"Used"===this.state||(this.count+=1),this.count}decrement(t){if("Used"!==this.state){if(0===this.count)throw new e("错误的调用!decrement不能对count为0调用");this.count-=1,0===this.count&&(t?t():this.callback&&this.callback(),this.reusable||(this.state="Used"))}}destroy(){this.callback=void 0}}),ks=t("LoadingState",class{constructor(){this.isLoading=!1,this.counter=new Bs(l)}begin(){this.isLoading=!0,this.counter.increment()}end(){this.counter.decrement((()=>{this.isLoading=!1}))}}),Us=t("CTXState",class{}),zs=t("CTX",class{constructor(t){this.parent=t,this.evt=new m(3e3),this.controllersMap=new Map,this.state=new Us}async init(t){this.view=t,this.registerController(t.model.name,t)}destroy(){this.controllersMap.clear(),this.view=null,this.state=null}async setState(t){Object.assign(this.state,t)}startLoading(){this.view.startLoading()}endLoading(){this.view.endLoading()}registerController(t,e){this.controllersMap.set(t,e),this.evt.emit("onRegister",t,e)}getController(t,e=!1){return this.controllersMap.has(t)?this.controllersMap.get(t):this.parent&&e?this.parent.getController(t):void 0}getTopView(){return this.parent?2===this.view.modal.routeDepth?this.view:this.parent.getTopView():this.view}}),Gs=t("ActivityCounter",class extends Bs{constructor(){super(...arguments),this.reusable=!1,this.registration=new Map}enroll(t){"Unused"!==this.state||this.registration.has(t)||(this.registration.set(t,!1),this.increment())}attend(t){this.registration.has(t)&&!1===this.registration.get(t)&&(this.registration.set(t,!0),this.decrement())}}),js=(t("UIActionButtonState",class{constructor(t,e,s){this.disabled=!1,this.visible=!0,this.loading=!1,this.permitted=!0,this.noPermissionHidden=!0,this.noDataDisabled=!1,this.isInit=!1,this.name=t,this.uiActionId=s,this.appId=e}async init(){if(!this.uiActionId)return void(this.isInit=!0);const t=await tt(this.uiActionId);if([,this.appDeName]=this.uiActionId.split("@"),!t)return;const{dataAccessAction:e,noPrivDisplayMode:s,actionTarget:i,uiactionMode:a,uiactionTag:n}=t;this.dataAccessAction=e,1===s?this.noPermissionHidden=!1:6===s&&(this.visible=!1),(i&&"NONE"!==i||"SYS"===a&&["Save","SaveAndExit","SaveAndNew","Edit","Remove","RemoveAndExit"].includes(n))&&(this.noDataDisabled=!0),this.isInit=!0}async calcPermission(t,e){if(!this.dataAccessAction)return;const s=await ibiz.hub.getApp(this.appId);this.appDeName&&e&&!e.includes(this.appDeName)&&ibiz.log.warn("".concat(this.uiActionId,"界面行为的实体").concat(this.appDeName,"和数据的实体").concat(e,"不一致")),this.permitted=await s.authority.calcByDataAccessAction(this.dataAccessAction,t,e)}async update(t,e){this.isInit||await this.init(),await this.calcPermission(t,e),this.permitted?(this.visible=!0,this.disabled=this.noDataDisabled&&!t):(this.disabled=!0,this.visible=!this.noPermissionHidden)}}),t("ButtonContainerState",class{constructor(){Object.defineProperty(this,"children",{enumerable:!1,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:()=>0!==this.children.length&&!!this.children.find((t=>t.visible))})}addState(t,e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e}),this.children.push(e)}setLoading(t){this.children.forEach((e=>{e.setLoading?e.setLoading(t):e.loading=!!t&&e.name===t}))}async update(t,e){await Promise.all(this.children.map((s=>s.update(t,e))))}}),t("QXEventEx",class extends m{constructor(){super(...arguments),this.anyEventFns=[]}onAll(t){this.anyEventFns.includes(t)||this.anyEventFns.push(t)}emit(t,...e){super.emit(t,...e),this.anyEventFns.forEach((s=>{s(t,...e)}))}async asyncEmit(t,...e){const s=super.asyncEmit(t,...e),i=this.anyEventFns.map((s=>s(t,...e))),a=Promise.all(i),n=await s,r=await a;return n.concat(...r)}reset(){super.reset(),I(this.anyEventFns)}})),Xs=t("ControllerEvent",class{constructor(t){this.getBaseArgs=t,this.evt=new js}async emit(t,e){await this.evt.asyncEmit(t,{...this.getBaseArgs(),eventName:t,...e||{}})}on(t,e){this.evt.on(t,e)}onAll(t){this.evt.onAll(t)}destroy(){this.getBaseArgs=void 0,this.evt.reset()}});var Ks="__self",Hs=t("BaseController",class{constructor(t,e,s,i){this.model=t,this.context=e,this.params=s,this.ctx=i,this.state={},this.name="",this.evt=new Xs(this.getEventArgs.bind(this)),this.mountCounter=new Gs(this.mounted.bind(this)),this.childNames=[],this.name=t.name||t.id,this.initState()}get _evt(){return this.evt}initState(){this.state.isCreated=!1,this.state.isMounted=!1}getEventArgs(){return{context:this.context,params:this.params,data:[],targetName:this.model.name,view:this.ctx.view}}async created(){this.mountCounter.enroll(Ks),await this.onCreated(),this.state.isCreated=!0,this.force((()=>{this.mountSelf()})),ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onCreated")),this._evt.emit("onCreated",void 0)}async onCreated(){this.ctx.evt.on("onForecast",(t=>{this.childNames.includes(t)&&this.mountCounter.enroll(t)})),this.ctx.evt.on("onRegister",((t,e)=>{this.childNames.includes(t)&&e.evt.on("onMounted",(()=>{this.mountCounter.attend(t)}))}))}async mountSelf(){this.mountCounter.registration.get(Ks)||this.mountCounter.attend(Ks)}async mounted(){await this.onMounted(),this.state.isMounted=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onMounted")),this._evt.emit("onMounted",void 0)}async onMounted(){}async destroyed(){await this.onDestroyed(),ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onDestroyed")),await this._evt.emit("onDestroyed",void 0),this.evt.destroy()}async onDestroyed(){}force(t){}getController(t,e=!1){return this.ctx.getController(t,e)}getTopView(){return this.ctx.getTopView()}listenNewController(t){this.ctx.evt.on("onRegister",t)}}),Ys=t("ViewController",class extends Hs{constructor(t,e,s,i){super(ibiz.util.layoutPanel.fill(t),a.create({},e),s||{},new zs(i)),this.modal=new Tt({}),this.providers={},this.engines=[],this.slotProps={},this.counters={},this.viewLoading=new ks,this.isCloseView=!1,this._isActive=!0,i&&i.registerController(this.model.name,this),this.ctx.init(this),this.initEngines()}get _evt(){return this.evt}get parentView(){var t;return null==(t=this.ctx.parent)?void 0:t.view}get isActive(){return this._isActive}onActivated(){this._isActive=!0,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")激活"))}onDeactivated(){this._isActive=!1,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")暂停"))}initEngines(){const t=at(this.model);if(t.length)t.forEach((t=>{const e=ibiz.engine.getEngine(t,this);e&&this.engines.push(e)}));else{const t=ibiz.engine.getEngine({engineCat:"VIEW",engineType:this.model.viewType},this);t&&this.engines.push(t)}}async initCounters(){const t=this.model.viewLayoutPanel,{appCounterRefs:e}=t;if(e&&e.length>0)try{await Promise.all(e.map((async t=>{const e=await qt.getCounterByRef(t,this.context);this.counters[t.id]=e})))}catch(t){console.error(t)}}initState(){super.initState(),this.state.isLoading=!1,this.state.caption=this.model.caption,this.state.srfactiveviewdata=null}async onCreated(){await super.onCreated(),this.modal.hooks.beforeDismiss.tapPromise((async t=>{await this._evt.emit("onCloseView",{...t})})),this._evt.emit("onViewInfoChange",{caption:this.model.caption,title:this.model.title}),this.handleContextParams();const t=this.model.viewLayoutPanel;this.childNames.push(t.name);const e=await ke(t);this.providers[t.name]=e;const s=st(this.model);s&&await Promise.all(s.map((async t=>{const e=await ke(t);this.providers[t.name||t.id]=e}))),await this.initCounters();const i=it(this.model);i.length&&(this.scheduler=ibiz.scheduler.createViewScheduler(i),this.scheduler.defaultParamsCb=()=>this.getEventArgs(),this.scheduler.hasViewEventTrigger&&this.evt.onAll(((t,e)=>{this.scheduler.triggerViewEvent(e)}))),this.engines.length&&await Promise.all(this.engines.map((t=>t.onCreated())))}async onMounted(){var t;await super.onMounted(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onMounted()))),null==(t=this.scheduler)||t.startTimerTrigger()}async onDestroyed(){await super.onDestroyed(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onDestroyed()))),this.ctx.destroy(),this.context.destroy(),this.engines=[],this.scheduler&&this.scheduler.destroy(),ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")销毁"))}handleContextParams(){this.context.srfappid=this.model.appId,"ROUTE"===this.modal.mode&&(this.context.srfsessionid=w());const t=this.model.appViewNavContexts;let e={};p(t)&&(e=z(t,this.context,this.params)),Object.assign(this.context,e);const s=this.model.appViewNavParams;let i={};p(s)&&(i=z(s,this.context,this.params)),Object.assign(this.params,i),this.state.isMounted&&this.callUIAction("Refresh")}async call(t,e){let s;for(const i of this.engines)if(s=await i.call(t,e),void 0!==s)break;return s}async callUIAction(t,s){const i=this.call(t,s);if(void 0===i)throw new e("没有引擎支持预置界面行为".concat(t));return i}async closeView(t={ok:!1,data:[]}){await this.modal.dismiss(t)}startLoading(){this.viewLoading.begin(),this.state.isLoading=this.viewLoading.isLoading}endLoading(){this.viewLoading.end(),this.state.isLoading=this.viewLoading.isLoading}setLayoutPanel(t){var e;this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)})),(null==(e=this.scheduler)?void 0:e.hasControlEventTrigger)&&t.evt.on("onControlEvent",(t=>{this.scheduler.triggerControlEvent(t.triggerControlName,t.triggerEvent)}))}}),qs=(t("MobViewController",class extends Ys{}),t("EditorController",class{constructor(t,e){this.placeHolder="",this.editorParams={},this.model=t,this.parent=e,this.context=e.context,this.params=e.params}get readonly(){return!!this.model.readOnly}async init(){await this.onInit()}async onInit(){this.model.placeHolder&&(this.placeHolder=this.model.placeHolder),this.model.editorParams&&Object.keys(this.model.editorParams).forEach((t=>{this.editorParams[t.toLowerCase()]=this.model.editorParams[t]}))}handlePublicParams(t,e,s){const{navigateContexts:i,navigateParams:a}=this.model;let n={};i&&t&&(n=z(i,e,s,t));const r=Object.assign(e.clone(),n);let o={};a&&t&&(o=z(a,e,s,t));return{context:r,params:{...s,...o}}}toObj(t){if(!t)return;return new Function("return (".concat(t,");"))()}toBoolean(t){return Object.is("true",t)}})),$s=(t("CodeListEditorController",class extends qs{async loadCodeList(t){const{context:e,params:i}=this.handlePublicParams(t,this.context,this.params);if(this.model.appCodeListId){const t=await ibiz.hub.getApp(this.context.srfappid);let s=[];return s=await t.codeList.get(this.model.appCodeListId,e,i),s}throw new s(this.model,"请配置代码表")}}),t("ControlController",class extends Hs{constructor(t,e,s,i){super(t,e,s,i),this.providers={},this.registerToCtx();const a=ibiz.util.layoutPanel.get("".concat(t.controlType,"_DEFAULT"));a&&(this.controlPanel=a)}get _evt(){return this.evt}get view(){return this.ctx.view}registerToCtx(){this.ctx.registerController(this.model.name||this.model.id,this)}getEventArgs(){return{...super.getEventArgs(),data:this.getData()||[],ctrl:this}}initState(){super.initState(),this.state.isLoading=!1}async onCreated(){var t;if(await super.onCreated(),this.controlPanel){this.childNames.push(this.controlPanel.name);const t=await ke(this.controlPanel);this.providers[this.controlPanel.name]=t}(null==(t=this.model.controlLogics)?void 0:t.length)&&(this.scheduler=ibiz.scheduler.createControlScheduler(this.model.controlLogics),this.scheduler.defaultParamsCb=()=>this.getEventArgs())}async onDestroyed(){await super.onDestroyed(),this.scheduler&&this.scheduler.destroy()}getControlType(){return this.model.controlType}getData(){return null}async startLoading(){this.state.isLoading=!0,this.ctx.startLoading()}async endLoading(){this.state.isLoading=!1,this.ctx.endLoading()}handlerAbilityParams(t){return{context:this.context.clone(),params:{...this.params},data:(null==t?void 0:t.data)||this.getData()||[]}}setLayoutPanel(t){this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)}))}}));t("MDControlController",class extends $s{get _evt(){return this.evt}initState(){super.initState(),this.state.items=[],this.state.selectedData=[],this.state.searchParams={},this.state.noSort=!1,this.state.sortQuery="",this.state.curPage=1,this.state.size=20,this.state.total=0,this.state.isLoaded=!1,this.state.singleSelect=!0,this.state.mdctrlActiveMode=0,this.state.groups=[]}setSort(t,e){this.state.sortQuery="".concat(t,",").concat(e)}async getFetchParams(t){const{curPage:e,size:s,sortQuery:i,noSort:a}=this.state,n={...this.params};return s&&(n.page=e-1,n.size=s),!a&&i&&(n.sort=i),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),t&&Object.assign(n,t),n}async load(t={}){await this.startLoading();try{const e=!0===t.isInitialLoad,s=!0===t.isLoadMore;e?this.state.curPage=1:s&&(this.state.curPage+=1);const{context:i}=this.handlerAbilityParams(t),a=await this.getFetchParams(null==t?void 0:t.params),n=await this.service.fetch(i,a);"number"==typeof n.total&&(this.state.total=n.total),s?this.state.items.push(...n.data):this.state.items=n.data,await this.afterLoad(t,n.data),this.state.isLoaded=!0,await this._evt.emit("onLoadSuccess",{isInitialLoad:e})}finally{await this.endLoading()}return this.state.items}async afterLoad(t,e){return e}async refresh(){await this.load({isInitialLoad:!1})}async remove(t){const{context:s,params:i,data:a}=this.handlerAbilityParams(t);if(!(null==a?void 0:a.length))throw new e("未选中数据");if(await ibiz.confirm.error({title:"数据删除",desc:"确认删除数据?"})){await this.startLoading();try{const t=$(this.model.appDataEntityId);await Promise.allSettled(a.map((async e=>{if(0!==e.srfuf){const a=s.clone();a[t]=e.srfkey,await this.service.remove(a,i)}this.afterRemove(a)}))),ibiz.notification.success({desc:"数据[".concat(a.map((t=>t.srfmajortext)).join("、"),"]删除成功!")}),this.refresh()}finally{await this.endLoading()}this.state.selectedData=[],await this._evt.emit("onRemoveSuccess",void 0)}}afterRemove(t){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(e,1)}getData(){return this.state.selectedData||[]}setActive(t){return this._evt.emit("onActive",{data:[t]})}setSelection(t){const{selectedData:e}=this.state;d(e,t)||(this.state.selectedData=t,this._evt.emit("onSelectionChange",{data:t}))}async onRowClick(t){const{selectedData:e}=this.state,s=e.filter((e=>e.srfkey!==t.srfkey));s.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(s),1===this.state.mdctrlActiveMode&&await this.setActive(t)}async onDbRowClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}async importData(){}async exportData(t){}})}}}));
1
+ System.register(["@ibiz-template/core","lodash-es","qx-util","qs","ramda"],(function(t){"use strict";var e,s,i,a,n,r,o,c,l,d,h,u,p,E,g,m,f,w,I,D,A,P,y,v,T,b,C,_,V,L,R,M,O;return{setters:[function(t){e=t.RuntimeError,s=t.RuntimeModelError,i=t.ModelError,a=t.IBizContext,n=t.HttpResponse,r=t.HttpError,o=t.CoreConst,c=t.Net,l=t.NOOP,d=t.isElementSame,h=t.StringUtil},function(t){u=t.isEmpty,p=t.isFunction},function(t){E=t.notNilEmpty,g=t.isNilOrEmpty,m=t.AsyncSeriesHook,f=t.QXEvent,w=t.createUUID,I=t.isArray,D=t.setCookie,A=t.clearCookie,P=t.clearAll,y=t.ascSort,v=t.descSort},function(t){T=t.default},function(t){b=t.isNotNil,C=t.isNil,_=t.mergeRight,V=t.isEmpty,L=t.clone,R=t.equals,M=t.where,O=t.mergeLeft}],execute:function(){t({calcContentAlignStyle:function(t){const{valignSelf:e,halignSelf:s}=t,i={};if(e||s){switch(Object.assign(i,{display:"flex"}),e){case"TOP":Object.assign(i,{"align-items":"flex-start"});break;case"MIDDLE":Object.assign(i,{"align-items":"center"});break;case"BOTTOM":Object.assign(i,{"align-items":"flex-end"})}switch(s){case"LEFT":Object.assign(i,{"justify-content":"flex-start"});break;case"CENTER":Object.assign(i,{"justify-content":"center"});break;case"RIGHT":Object.assign(i,{"justify-content":"flex-end"});break;case"JUSTIFY":Object.assign(i,{"justify-content":"space-between"})}}return i},calcDeCodeNameById:Z,calcDynaClass:function(t,e){return ft.execScriptFn({data:e},t,{singleRowReturn:!0,isAsync:!1})},calcGridLayoutPos:function(t){const{layout:e,colXS:s,colXSOffset:i,colSM:a,colSMOffset:n,colMD:r,colMDOffset:o,colLG:c,colLGOffset:l}=t,d=(t,s)=>({span:(t&&-1!==t?t:"TABLE_24COL"===e?24:12)*("TABLE_24COL"===e?1:2),offset:s&&-1!==s?s:void 0});return{xs:d(s,i),sm:d(a,n),md:d(r,o),lg:d(c,l)}},calcLayoutHeightWidth:function(t){const{width:e,height:s,widthMode:i,heightMode:a}=t,n={width:"",height:""};"FULL"===i?n.width="100%":e&&e>0&&(n.width=e>0&&e<=1?"".concat(100*e,"%"):"".concat(e,"PERCENTAGE"===i?"%":"px"));"FULL"===a?n.height="100%":s&&s>0&&(n.height=s>0&&s<=1?"".concat(100*s,"%"):"".concat(s,"PERCENTAGE"===a?"%":"px"));return n},calcMainStateOPPrivsStrs:J,calcNavParams:function(t,e){const{deName:s,navFilter:i,pickupDEFName:a,navContexts:n,navParams:r}=t,{context:o,params:c,data:l,derValue:d}=e,h={},u={},p=d||l.srfkey;p&&(s&&(h[s]=p),i&&(u[i]=p),a&&(u["n_".concat(a.toLowerCase(),"_eq")]=p));const E=X(n,o,c,l),g=X(r,o,c,l);return Object.assign(h,E),Object.assign(u,g),{resultContext:h,resultParams:u}},calcResPath:qt,calcRouteContext:function(t){let e=[];e=e.sort(((t,e)=>e.length-t.length));const[s]=e;if(s){const t={};return s.forEach((([e,s])=>{t[e]=s})),t}return{}},compare:ht,compareNumber:ut,contains:pt,convertNavData:X,convertNavDataByArray:K,convertNavDataByObject:H,convertObjectToNavParams:Y,execDELogic:ye,execDELogicAction:ve,execDELogicById:async function(t,s,i,a,n){const r=await async function(t,e,s){const i=await ibiz.hub.getAppDataEntity(e,s);return tt(t,i)}(t,s,i.srfappid);if(!r)throw new e("".concat(s,"找不到实体逻辑").concat(t));return ye(r,i,a,n)},execFieldLogics:Te,execUILogic:Ms,filterFieldLogics:et,filterValueRules:function(t,e){return t.filter((t=>{const{checkMode:s}=t,i=t.deformItemName||t.degridEditItemName;return 2!==s&&i===e}))},findChildFormDetails:function(t){let e;switch(t.detailType){case"TABPANEL":e=t.deformTabPages;break;case"FORMPAGE":case"TABPAGE":case"GROUPPANEL":e=t.deformDetails}return e||[]},findDELogic:tt,findEditItem:function(t,e){var s;return null==(s=t.degridEditItems)?void 0:s.find((t=>t.codeName===e))},findFieldById:st,findModelChild:$,formatMultiData:q,generateRules:function(t,s,i){const a=[];return t.forEach((t=>{const{valueRuleType:n}=t,r=t.sysValueRule,o=t.defvalueRule;if("SYSVALUERULE"===n&&r)"REG"===r.ruleType?a.push({pattern:new RegExp(r.regExCode),message:r.ruleInfo,trigger:"change blur"}):"SCRIPT"===r.ruleType&&a.push({validator:(t,e,s,i)=>{if(!e)return!0;try{ft.execScriptFn({rule:t,value:e,callback:s,source:i},r.scriptCode,{isAsync:!1})}catch(t){return console.error(t),!1}return!0},trigger:"change blur"});else if("DEFVALUERULE"===n&&o){const t=i||s;a.push({validator:(s,i,a,n)=>{if(g(n[t]))return!0;const{isPast:r,infoMessage:c}=wt(t,n,o.groupCond);return r||a(new e(c||o.ruleInfo)),!0},trigger:"change blur"})}})),a},getAppViewRef:function(t,e){var s,i;let a=t.appViewRefs||[];(null==(i=null==(s=t.viewLayoutPanel)?void 0:s.appViewRefs)?void 0:i.length)&&(a=a.concat(t.viewLayoutPanel.appViewRefs));return a.find((t=>t.name===e||t.id===e))},getChildNodeRSs:function(t,e){const s=e.parentId||at(t).id;return t.detreeNodeRSs.filter((t=>{return t.parentDETreeNodeId===s&&(i=t.searchMode,a=e.hasQuery,3===i||(a?1===i:2===i));var i,a}))},getControl:function(t,e){var s,i;let a=t.controls||[];(null==(i=null==(s=t.viewLayoutPanel)?void 0:s.controls)?void 0:i.length)&&(a=a.concat(t.viewLayoutPanel.controls));return a.find((t=>t.name===e||t.codeName===e||t.id===e))},getControlProvider:Qe,getControlsByView:nt,getDeACMode:async function(t,e,s){var i;const a=await ibiz.hub.getAppDataEntity(e,s);return null==(i=a.appDEACModes)?void 0:i.find((e=>e.id===t))},getEditorProvider:async function(t){let e;const{editorType:s,editorStyle:i,predefinedType:a}=t;if(i&&"DEFAULT"!==i){e=Ze("".concat(s,"_").concat(i)),e||ibiz.log.error("找不到编辑器类型:[".concat(s,"]的编辑器样式:[").concat(i,"]对应的适配器"),t)}if(a){let n="".concat(a,"_").concat(s);i&&"DEFAULT"!==i&&(n+="_".concat(i)),e=Ze(n),e||ibiz.log.error("找不到编辑器类型:[".concat(s,"]的预置类型:[").concat(a,"]对应的适配器"),t)}e||(e=Ze(s));e||ibiz.log.error("找不到编辑器类型".concat(s,"对应的适配器"));return e},getFormDetailProvider:async function(t){let e;const{detailType:s}=t;e||(i=s,e=ibiz.register.get("".concat(ts,"_").concat(i)));var i;e||ibiz.log.error("找不到表单成员类型".concat(s,"对应的适配器"));return e},getGridColumnProvider:async function(t){let e;const{columnType:s,enableRowEdit:i}=t,a=i?"".concat(s,"_EDIT"):s;e||(e=function(t){return ibiz.register.get("".concat(es,"_").concat(t))}(a));e||ibiz.log.error("找不到表格列类型".concat(a,"对应的适配器"));return e},getMatchResPath:Yt,getOriginData:function(t){let e=Array.isArray(t)?t[0]:t;e&&e instanceof Ve&&(e=e.getOrigin());return e},getPanelItemProvider:async function(t){var e;let s;const{itemType:i}=t;if("CONTAINER"===i){const e=t.predefinedType||"DEFAULT";s=is("CONTAINER_".concat(e)),s||ibiz.log.error("找不到面板容器预置类型为".concat(e,"的适配器"))}if("RAWITEM"===i){const i=(null==(e=t.rawItem)?void 0:e.predefinedType)||"DEFAULT";s=is("RAWITEM_".concat(i)),s||ibiz.log.error("找不到面板成员直接内容预置类型为".concat(i,"的适配器"))}s||(s=is(i));s||ibiz.log.error("找不到面板成员类型".concat(i,"对应的适配器"));return s},getPortletProvider:async function(t){let e;const{portletType:s}=t;e||(i=s,e=ibiz.register.get("".concat(ls,"_").concat(i)));var i;e||ibiz.log.error("找不到门户部件成员类型".concat(s,"对应的适配器"));return e},getRootNode:at,getTreeNode:function(t,e){return t.detreeNodes.find((t=>t.id===e))},getUIActionById:it,getUIActionProvider:rs,getViewEngines:ot,getViewLogics:rt,getViewProvider:async function(t){let e;const{viewType:s,viewStyle:i}=t;if(i&&"DEFAULT"!==i){e=cs("".concat(s,"_").concat(i)),e||ibiz.log.error("找不到视图类型:[".concat(s,"]的视图样式:[").concat(i,"]对应的适配器"),t)}e||(e=cs(s));e||(e=cs("DEFAULT"));return e},getWFContext:function(t){const e={};t.param09&&(e.srfprocessinstanceid=t.param09);return e},getWFSubmitViewId:function(t,e){var s;const{type:i,sequenceflowview:a,sequenceflowmobview:n}=e,r=(null==(s=t.viewLayoutPanel)?void 0:s.appViewRefs)||t.appViewRefs,o=i?"WFUTILACTION@".concat(i.toUpperCase()):"WFACTION@".concat(ibiz.env.isMob?n:a),c=r.find((t=>t.name===o));return null==c?void 0:c.refAppViewId},hasDeCodeName:function(t,e){const s=Z(e);return b(t[s])},install:function(){const{ibiz:t}=window;t.util=new fs,t.hub=new Es,t.register=new j,t.config=new G,t.auth=new Oe,t.engine=new gs,Ot(),Bs(),ibiz.scheduler=new Ks,ibiz.scheduler.triggerFactory.register("ITEMVISIBLE",((t,e)=>new qs(t,e))),ibiz.scheduler.triggerFactory.register("ITEMENABLE",((t,e)=>new qs(t,e))),ibiz.scheduler.triggerFactory.register("ITEMBLANK",((t,e)=>new qs(t,e))),ibiz.scheduler.triggerFactory.register("TIMER",((t,e)=>new $s(t,e))),ibiz.scheduler.triggerFactory.register("CUSTOM",((t,e)=>new Ys(t,e))),ibiz.scheduler.triggerFactory.register("VIEWEVENT",((t,e)=>new Js(t,e))),ibiz.scheduler.triggerFactory.register("CTRLEVENT",((t,e)=>new Zs(t,e))),ibiz.scheduler.executorFactory.register("SCRIPT",((t,e)=>new Us(t,e))),ibiz.scheduler.executorFactory.register("APPDEUILOGIC",((t,e)=>new zs(t,e))),ibiz.scheduler.executorFactory.register("DEUILOGIC",((t,e)=>new zs(t,e))),ibiz.scheduler.executorFactory.register("APPUILOGIC",((t,e)=>new Qs(t,e)))},installCommand:Ot,isValueChange:function(t,e){if((C(t)||""===t)&&(C(e)||""===e))return!1;return t!==e},matchMainState:Q,openRedirectView:ct,parseUserParams:function(t){const e={},s={},i={};for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const n=t[a];if(-1!==a.indexOf(".")){const t=a.split(".");switch(t[0]){case"SRFNAVPARAM":Object.assign(e,{[t[1]]:n});break;case"SRFNAVCTX":Object.assign(s,{[t[1]]:n});break;default:Object.assign(i,{key:n})}}}return{navigateContexts:e,navigateParams:s,other:i}},presetUIActionProvider:Bs,registerControlProvider:function(t,e){ibiz.register.register("".concat(qe,"_").concat(t),e)},registerEditorProvider:function(t,e){ibiz.register.register("".concat(Je,"_").concat(t),e)},registerFormDetailProvider:function(t,e){ibiz.register.register("".concat(ts,"_").concat(t),e)},registerGridColumnProvider:function(t,e){ibiz.register.register("".concat(es,"_").concat(t),e)},registerPanelItemProvider:function(t,e){ibiz.register.register("".concat(ss,"_").concat(t.toUpperCase()),e)},registerPortletProvider:function(t,e){ibiz.register.register("".concat(ls,"_").concat(t),e)},registerUIActionProvider:ns,registerViewProvider:function(t,e){ibiz.register.register("".concat(os,"_").concat(t),e)},strContain:Et,testCond:dt,toLocalOpenWFRedirectView:lt,verifyDeRules:wt,verifyFormGroupLogic:function t(e,a){if(function(t){return"GROUP"===t.logicType}(a)){const i=a.defdlogics;if(!i||0===i.length)throw new s(a,"发现空逻辑组,逻辑无法正常执行!");let n=!0;if("AND"===a.groupOP){n=void 0===i.find((s=>!t(e,s)))}else if("OR"===a.groupOP){n=void 0!==a.defdlogics.find((s=>t(e,s)))}return a.notMode?!n:n}if(function(t){return"SINGLE"===t.logicType}(a))return dt(e[a.defdname.toLowerCase()],a.condOP,a.value);throw new i(a,"未支持的逻辑类型".concat(a.logicType))},verifyPanelGroupLogic:function t(e,a){if(function(t){return"GROUP"===t.logicType}(a)){const i=a.panelItemLogics;if(!i||0===i.length)throw new s(a,"发现空逻辑组,逻辑无法正常执行!");let n=!0;if("AND"===a.groupOP){n=void 0===i.find((s=>!t(e,s)))}else if("OR"===a.groupOP){n=void 0!==a.panelItemLogics.find((s=>t(e,s)))}return a.notMode?!n:n}if(function(t){return"SINGLE"===t.logicType}(a))return dt(e[a.dstModelField.toLowerCase()],a.condOp,a.value);throw new i(a,"未支持的逻辑类型".concat(a.logicType))}});var N,W,x=Object.create,S=Object.defineProperty,F=Object.getOwnPropertyDescriptor,B=Object.getOwnPropertyNames,k=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty,z=(N={"../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(t,e){function s(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function i(t,e){for(var s,i="",a=0,n=-1,r=0,o=0;o<=t.length;++o){if(o<t.length)s=t.charCodeAt(o);else{if(47===s)break;s=47}if(47===s){if(n===o-1||1===r);else if(n!==o-1&&2===r){if(i.length<2||2!==a||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var c=i.lastIndexOf("/");if(c!==i.length-1){-1===c?(i="",a=0):a=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),n=o,r=0;continue}}else if(2===i.length||1===i.length){i="",a=0,n=o,r=0;continue}e&&(i.length>0?i+="/..":i="..",a=2)}else i.length>0?i+="/"+t.slice(n+1,o):i=t.slice(n+1,o),a=o-n-1;n=o,r=0}else 46===s&&-1!==r?++r:r=-1}return i}var a={resolve:function(){for(var t,e="",a=!1,n=arguments.length-1;n>=-1&&!a;n--){var r;n>=0?r=arguments[n]:(void 0===t&&(t=process.cwd()),r=t),s(r),0!==r.length&&(e=r+"/"+e,a=47===r.charCodeAt(0))}return e=i(e,!a),a?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(s(t),0===t.length)return".";var e=47===t.charCodeAt(0),a=47===t.charCodeAt(t.length-1);return 0!==(t=i(t,!e)).length||e||(t="."),t.length>0&&a&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return s(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var i=arguments[e];s(i),i.length>0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":a.normalize(t)},relative:function(t,e){if(s(t),s(e),t===e)return"";if((t=a.resolve(t))===(e=a.resolve(e)))return"";for(var i=1;i<t.length&&47===t.charCodeAt(i);++i);for(var n=t.length,r=n-i,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var c=e.length-o,l=r<c?r:c,d=-1,h=0;h<=l;++h){if(h===l){if(c>l){if(47===e.charCodeAt(o+h))return e.slice(o+h+1);if(0===h)return e.slice(o+h)}else r>l&&(47===t.charCodeAt(i+h)?d=h:0===h&&(d=0));break}var u=t.charCodeAt(i+h);if(u!==e.charCodeAt(o+h))break;47===u&&(d=h)}var p="";for(h=i+d+1;h<=n;++h)h!==n&&47!==t.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(o+d):(o+=d,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(s(t),0===t.length)return".";for(var e=t.charCodeAt(0),i=47===e,a=-1,n=!0,r=t.length-1;r>=1;--r)if(47===(e=t.charCodeAt(r))){if(!n){a=r;break}}else n=!1;return-1===a?i?"/":".":i&&1===a?"//":t.slice(0,a)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');s(t);var i,a=0,n=-1,r=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var o=e.length-1,c=-1;for(i=t.length-1;i>=0;--i){var l=t.charCodeAt(i);if(47===l){if(!r){a=i+1;break}}else-1===c&&(r=!1,c=i+1),o>=0&&(l===e.charCodeAt(o)?-1==--o&&(n=i):(o=-1,n=c))}return a===n?n=c:-1===n&&(n=t.length),t.slice(a,n)}for(i=t.length-1;i>=0;--i)if(47===t.charCodeAt(i)){if(!r){a=i+1;break}}else-1===n&&(r=!1,n=i+1);return-1===n?"":t.slice(a,n)},extname:function(t){s(t);for(var e=-1,i=0,a=-1,n=!0,r=0,o=t.length-1;o>=0;--o){var c=t.charCodeAt(o);if(47!==c)-1===a&&(n=!1,a=o+1),46===c?-1===e?e=o:1!==r&&(r=1):-1!==e&&(r=-1);else if(!n){i=o+1;break}}return-1===e||-1===a||0===r||1===r&&e===a-1&&e===i+1?"":t.slice(e,a)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var s=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return s?s===e.root?s+i:s+t+i:i}("/",t)},parse:function(t){s(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var i,a=t.charCodeAt(0),n=47===a;n?(e.root="/",i=1):i=0;for(var r=-1,o=0,c=-1,l=!0,d=t.length-1,h=0;d>=i;--d)if(47!==(a=t.charCodeAt(d)))-1===c&&(l=!1,c=d+1),46===a?-1===r?r=d:1!==h&&(h=1):-1!==r&&(h=-1);else if(!l){o=d+1;break}return-1===r||-1===c||0===h||1===h&&r===c-1&&r===o+1?-1!==c&&(e.base=e.name=0===o&&n?t.slice(1,c):t.slice(o,c)):(0===o&&n?(e.name=t.slice(1,r),e.base=t.slice(1,c)):(e.name=t.slice(o,r),e.base=t.slice(o,c)),e.ext=t.slice(r,c)),o>0?e.dir=t.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,e.exports=a}},function(){return W||(0,N[B(N)[0]])((W={exports:{}}).exports,W),W.exports}),G=class{constructor(){this.view={enableDataInfoBar:!0},this.grid={editShowMode:"cell",editSaveMode:"cell-blur"},this.appMenu={enableEcho:!1},this.codeList={timeout:36e5}}},j=t("RegisterCenter",class{constructor(){this.providers=new Map}register(t,e){this.providers.set(t,e)}unRegister(t){this.providers.delete(t)}get(t,...e){const s=this.providers.get(t);if(s)return s(...e)}});function X(t,...e){return!t||u(t)?{}:"[object Array]"===Object.prototype.toString.call(t)?K(t,...e):"[object Object]"===Object.prototype.toString.call(t)?H(t,...e):{}}function K(t,...e){const s={};for(const i of t)if(E(i.value)&&!i.rawValue){const t=e.find((t=>!g(t)&&(t[i.value]||Object.prototype.hasOwnProperty.call(t,i.value))));t&&(s[i.key.toLowerCase()]=t[i.value])}else s[i.key.toLowerCase()]=i.value||null;return s}function H(t,...e){const s={},i=/^%(.+)%$/;for(const a in t)if(E(t[a])&&i.test(t[a])){const i=t[a].substring(1,t[a].length-1),n=e.find((t=>Object.prototype.hasOwnProperty.call(t,i)));n&&(s[a.toLowerCase()]=n[i])}else s[a.toLowerCase()]=t[a]||null;return s}function Y(t){const e=[],s=/^%(.+)%$/;for(const i in t){let a=!0,n=t[i];E(t[i])&&s.test(t[i])&&(a=!1,n=t[i].substring(1,t[i].length-1)),e.push({key:i.toLowerCase(),rawValue:a,value:n})}return e}function q(t,e){const s={};if(!t)return s;const i=Array.isArray(t)?t:Y(t),a=e[0];return i.forEach((t=>{const{rawValue:i,value:n}=t;!i&&n&&Object.prototype.hasOwnProperty.call(a,n)&&(s[n]=e.map((t=>t[n])).join(";"))})),s}function $(t,e){if(t){const s=t.find((t=>t.id===e));if(s)return s}return null}function Q(t,e){const{mainStateAppDEFieldIds:s,demainStates:i}=t;if(s&&i){const t=[];return s.forEach((s=>{t.push(e[s])})),i.find((e=>{const{stateValue:s,state2Value:i,state3Value:a}=e;let n=!0;const r=[s,i,a];for(let e=0;e<t.length;e++)if("".concat(t[e])!=="".concat(r[e])){n=!1;break}return n}))}}function J(t,e){const s=ibiz.hub.getApp().model,{demainStateOPPrivs:i,opprivAllowMode:a}=t,n=(null==i?void 0:i.map((t=>t.name)))||[];let r=[];if(a)r=n;else{r=[...s.deopprivs,...e.deopprivs].filter((t=>!n.includes(t.name))).map((t=>t.name))}return r}function Z(t){return t.split(".").pop()}function tt(t,e){var s;return null==(s=e.appDELogics)?void 0:s.find((e=>e.id===t))}function et(t,e){var s,i;const a=[];return null==(s=t.appDEFields)||s.forEach((t=>{"compute"===e&&t.computeAppDEFLogicId?a.push(t.computeAppDEFLogicId):"change"===e&&t.onChangeAppDEFLogicId?a.push(t.onChangeAppDEFLogicId):"default"===e&&t.defaultValueAppDEFLogicId&&a.push(t.defaultValueAppDEFLogicId)})),(null==(i=t.appDELogics)?void 0:i.filter((t=>a.includes(t.id))))||[]}function st(t,e){var s;return null==(s=t.appDEFields)?void 0:s.find((t=>t.id===e))}async function it(t){const[,,e]=t.split("@");return ibiz.hub.getApp(e).getUIAction(t)}function at(t){return t.detreeNodes.find((t=>t.rootNode))}function nt(t){const{viewLayoutPanel:e}=t,s=t.controls||[];return e&&s.push(...e.controls||[]),s}function rt(t){const{viewLayoutPanel:e}=t,s=t.appViewLogics||[];return e&&s.push(...e.appViewLogics||[]),s}function ot(t){const{viewLayoutPanel:e}=t,s=t.appViewEngines||[];return e&&s.push(...e.appViewEngines||[]),s}async function ct(t,e,i={},a={}){return async function(t,e,i={},a={}){var n;const r=t.appViewNavContexts||[],o=X(r,e,i);e=Object.assign(e.clone(),o);const c=t.appViewNavParams||[],l=X(c,e,i);Object.assign(i,l);const d=t.appDataEntityId,h=Z(d);let u=(null==(n=a.data)?void 0:n[0])||{};e[h]=u[h]||e[h]||i[h];const p=t.getDataAppDEActionId,m=ibiz.hub.getApp(t.appId),f=await m.deService.getService(d);ibiz.loading.showRedirect();try{const t=await f.exec(p||"get",e,i);if(t.ok){u=t.data;let s=u.linkurl;if(s)return e.srfprocessinstanceid&&(s+=";srfprocessinstanceid=".concat(e.srfprocessinstanceid)),ibiz.env.dev&&-1!==s.indexOf("appredirectview?")&&(s=s.slice(s.indexOf("appredirectview?"))),s.startsWith("http://")||s.startsWith("https://")?new Promise((t=>{const e=window.open(s,"_blank");e&&(e.callback=()=>{t({ok:!0,data:[]})})})):s.startsWith("appredirectview?")?(await lt(e,s,a),{ok:!0,data:[]}):{ok:!1,data:[]}}}finally{ibiz.loading.hideRedirect()}const w=await ibiz.hub.getAppDataEntity(d,t.appId),I=await async function(t,e,s,i){let a="";const n=e.typeAppDEFieldId;if(n){const{codeName:s}=st(t,n),a=i[s.toLowerCase()];if(E(a))return"".concat(a);ibiz.log.warn("重定向视图[".concat(e.name,"]自定义类别属性[").concat(n,"]值为空"),i)}const r="".concat(ibiz.env.isMob?"MOB":"","EDITVIEW"),o=s.srfwf;if(E(o))return E(s.wf)?"".concat(r,":").concat(o.toUpperCase(),":").concat(s.wf.toUpperCase()):"".concat(r,":").concat(o.toUpperCase());let c="";if(t.indexTypeAppDEFieldId){const{codeName:e}=st(t,t.indexTypeAppDEFieldId);c=i[e.toLowerCase()]}if(g(c)&&t.formTypeAppDEFieldId){const{codeName:e}=st(t,t.formTypeAppDEFieldId);c=i[e.toLowerCase()]}a=E(c)?"".concat(r,":").concat(c.toString().toUpperCase()):"".concat(r);return a}(w,t,i,u),D=I.split(":"),A=2===D.length?I:D.slice(0,2).join(":"),P="".concat(w.name.toUpperCase(),":").concat(I),y=t.redirectAppViewRefs,v=null==y?void 0:y.find((t=>{const e=t.name||t.id;return e===P||e===I||e===A}));if(!v)throw ibiz.log.error("重定向视图引用有:",null==y?void 0:y.map((({refAppViewId:t,name:e,realTitle:s})=>({viewId:t,tag:e,title:s})))),new s(t,"未找到重定向标识[".concat(I,"]或[").concat(P,"]或工作流[").concat(A,"]对应视图"));{const t=v.refAppViewId;if(!t)throw new s(v,"未配置实际引用视图");{const s=await ibiz.commands.execute(Lt.TAG,t,e,i,{...a,data:[u]});if(s)return s}}return{ok:!0,data:[]}}(t,e,i,a)}async function lt(t,s,i={}){const a=s.lastIndexOf("?"),n=decodeURIComponent(s.substring(a+1,s.length)),r=T.parse(n,{delimiter:";"}),o=r.srfdename||"";if(!o)throw new e("重定向参数缺少实体名称");const c=ibiz.hub.getApp(t.srfappid).deName2DeCodeName.get(o.toUpperCase());if(!c)throw new e("未找到指定实体的codeName: ".concat(o));r[c.toLowerCase()]=r[o.toLowerCase()];const l="".concat(c).concat(ibiz.env.isMob?"Mob":"","RedirectView"),d=await ibiz.hub.getAppView(l);if(delete r.srfdename,"undo"!==r.srfwf){const t=r.processDefinitionKey.split("-")[3],e=t.substring(0,t.lastIndexOf("v")),s=t.substring(t.lastIndexOf("v"));r.wf=e,r.wfVersion=s}r.srfprocessinstanceid&&(t.srfprocessinstanceid=r.srfprocessinstanceid,delete r.srfprocessinstanceid),await ibiz.commands.execute(Lt.TAG,d.id,t,r,i)}function dt(t,s,i){if(Object.is(s,"IN"))return pt(t,i);if(Object.is(s,"NOTIN"))return!pt(t,i);switch(s){case"EQ":return"".concat(t)==="".concat(i);case"NOTEQ":return"".concat(t)!=="".concat(i);case"LT":return ht(t,i)<0;case"LTANDEQ":return ht(t,i)<=0;case"GT":return ht(t,i)>0;case"GTANDEQ":return ht(t,i)>=0;case"ISNULL":return g(t);case"ISNOTNULL":return E(t);case"TESTNULL":return C(t);case"IN":return pt(t,i);case"NOTIN":return!pt(t,i);case"LIKE":return Et(t,i);case"LEFTLIKE":return Et(t,i,"start");case"RIGHTLIKE":return Et(t,i,"end");default:throw new e("值操作:".concat(s,",暂未支持"))}}function ht(t,s){const i=Number(t),a=Number(s);if(!Number.isNaN(i)&&!Number.isNaN(a))return ut(i,a);const n=new Date(t).getTime(),r=new Date(s).getTime();if(!Number.isNaN(n)&&!Number.isNaN(r))return ut(n,r);throw new e("".concat(t," 和 ").concat(s," 无法比较大小"))}function ut(t,e){return Number.isNaN(t)&&(t=0),Number.isNaN(e)&&(e=0),t>e?1:t<e?-1:0}function pt(t,s){if(!s||"string"!=typeof s)throw new e("范围比较的条件值不存或者不是字符串");if(t){return s.split(",").includes("".concat(t))}return!1}function Et(t,e,s){if(!t||!e)return!1;const i="".concat(t).toUpperCase(),a="".concat(e).toUpperCase(),n=i.indexOf(a);switch(s){case"start":return 0===n;case"end":return n+a.length===i.length;default:return-1!==n}}var gt={singleRowReturn:!1,isAsync:!0},mt=t("ScriptFunction",class{constructor(t,e,s=gt){this.argKeys=[],this.options=s;const i=this.formatCode(e,s);this.calcArgKeys(t,s);const a=new Function(...this.argKeys,i);this.scriptFn=function(...t){return a.apply({},t)}}formatCode(t,e){let s=t;return e.singleRowReturn&&(s="return (".concat(s,")")),e.isAsync&&(s="return (async function() { ".concat(s,"} )();")),s}calcArgKeys(t,e){const s=e.presetParams?Object.keys(e.presetParams):[];s.push(...t);s.push("document","el","selector","env","appSession","topViewSession","viewSession","context","viewParam","activeData","data","app","topView","parentView","view","parent","util"),this.argKeys=Array.from(new Set(s))}convertArgs(t){const{presetParams:e}=this.options,s=e?_(e,t):t;s.document=document,s.selector=t=>document.getElementsByClassName(t);const i=[];return this.argKeys.forEach((t=>{void 0===s[t]&&this.fillDefaultParams(t,s),i.push(s[t])})),i}fillDefaultParams(t,e){const s=e.view;switch(t){case"util":e.util={message:ibiz.message,notification:ibiz.notification,modal:ibiz.modal,confirm:ibiz.confirm,openView:ibiz.openView};break;case"env":e.env=ibiz.env;break;case"app":e.app=ibiz.hub.controller;break;case"parent":e.parent=null==s?void 0:s.parentView;break;case"topView":e.topView=null==s?void 0:s.getTopView();break;case"parentView":e.parentView=null==s?void 0:s.parentView;break;case"topViewSession":e.topViewSession=null==s?void 0:s.getTopView().session;break;case"viewSession":e.viewSession=null==s?void 0:s.session;break;case"appSession":e.appSession=ibiz.hub.controller.session}}exec(t){const e=this.convertArgs(t);return this.scriptFn(...e)}}),ft=t("ScriptFactory",class{static createScriptFn(t,e,s){return new mt(t,e,s)}static execScriptFn(t,e,s){return this.createScriptFn(Object.keys(t),e,s).exec(t)}});function wt(t,s,i){const a={isPast:!0,infoMessage:i.ruleInfo};if(function(t){return"GROUP"===t.condType}(i)){const e=i.conds;e&&e.length>0&&(a.isPast=function(t,e,s="AND",i=!1){if(!((null==t?void 0:t.length)>0))return!1;let a="AND"===s;for(let i=0,n=t.length;i<n;i++){const n=e(t[i],i);if("AND"===s){if(!n){a=!1;break}}else if("OR"===s&&n){a=!0;break}}return i?!a:a}(e,(e=>{const{isPast:i,infoMessage:n}=wt(t,s,e);return a.infoMessage=n,i}),i.condOp,!!i.notMode),!a.isPast&&("AND"===i.condOp&&i.notMode||"OR"===i.condOp&&!i.notMode)&&(a.infoMessage=i.ruleInfo))}else{t=null==i?void 0:i.defname.toLowerCase();try{if(function(t){return"SIMPLE"===t.condType}(i))a.isPast=!function(t,s,i,a,n,r,o){Object.is(n,"CURTIME")&&(i="".concat(new Date));if(Object.is(n,"ENTITYFIELD")){i=r[i=i?i.toLowerCase():""]?r[i]:i}(C(a)||V(a))&&(a="内容必须符合值规则");const c=dt(t,s,i);if(!c&&o)throw new e(a);return!c}(s[t],i.condOp,i.paramValue,i.ruleInfo,i.paramType,s,i.keyCond);else if(function(t){return"VALUERANGE2"===t.condType}(i))a.isPast=!function(t,s,i,a,n,r,o){g(r)&&(r="值必须符合值范围规则");if(g(t)){if(o)throw new e("值为空");return r="值为空",!0}if(It(t,/^-?\d*\.?\d+$/,"",o))return!0;const c=Number.parseFloat(t);if(null!==s)if(i){if(c<s){if(o)throw new e(r);return!0}}else if(c<=s){if(o)throw new e(r);return!0}if(null!=a)if(n){if(c>a){if(o)throw new e(r);return!0}}else if(c>=a){if(o)throw new e(r);return!0}return r="",!1}(s[t],i.minValue,i.includeMinValue,i.maxValue,i.includeMaxValue,i.ruleInfo,i.keyCond);else if(function(t){return"REGEX"===t.condType}(i))a.isPast=!It(s[t],i.regExCode,i.ruleInfo,i.keyCond);else if(function(t){return"STRINGLENGTH"===t.condType}(i))a.isPast=!function(t,s,i,a,n,r,o){g(r)&&(r="内容长度必须符合范围规则");if(g(t)){if(o)throw new e("值为空");return r="值为空",!0}const c=t.length;if(null!==s)if(i){if(c<s){if(o)throw new e(r);return!0}}else if(c<=s){if(o)throw new e(r);return!0}if(null!==a)if(n){if(c>a){if(o)throw new e(r);return!0}}else if(c>=a){if(o)throw new e(r);return!0}return r="",!1}(s[t],i.minValue,i.includeMinValue,i.maxValue,i.includeMaxValue,i.ruleInfo,i.keyCond);else if(function(t){return"SYSVALUERULE"===t.condType}(i)&&(null==i?void 0:i.sysValueRule)){const{ruleType:n,regExCode:r,scriptCode:o,ruleInfo:c}=i.sysValueRule;if(a.infoMessage=i.ruleInfo||c,"REG"===n)a.isPast=!It(s[t],r,a.infoMessage,i.keyCond);else if("SCRIPT"===n){const{isPast:n,infoMessage:r}=function(t,s,i,a,n){g(a)&&(a="值必须符合脚本规则");const r=s;let o="",c=!0;const l=t=>{c=!1,(null==t?void 0:t.length)>0?t.forEach((t=>{(null==t?void 0:t.message)&&(o+=t.message)})):(null==t?void 0:t.message)&&(o=t.message)};try{const e=ft.execScriptFn({value:t,data:r},i,{isAsync:!1});"boolean"==typeof e&&(c=e)}catch(t){ibiz.log.error(t),l(t)}if(a="",!c&&n)throw new e(a);return{isPast:c,infoMessage:o||a}}(s[t],s,o,a.infoMessage,i.keyCond);a.isPast=n,a.infoMessage=r||a.infoMessage}}}catch(t){a.isPast=!1}a.isPast=i.notMode?!a.isPast:a.isPast}return a}function It(t,s,i,a){g(i)&&(i="值必须符合正则规则");if(g(t)){if(a)throw new e("值为空");return i="值为空",!0}if(!new RegExp(s).test(t)){if(a)throw new e(i);return!0}return i="",!1}var Dt=t("LayoutPanelUtil",class{constructor(){this.cache=new Map}register(t,e){this.cache.set(t,e)}get(t){return this.cache.get(t)}fill(t){const{viewLayoutPanel:e}=t;if(!e||!0===e.useDefaultLayout){const e=this.calcLayoutTag(t);if(this.cache.has(e)){const s=L(this.cache.get(e));t.viewLayoutPanel=s,t.appCounterRefs&&(s.appCounterRefs=t.appCounterRefs,delete t.appCounterRefs),t.appViewEngines&&(s.appViewEngines=t.appViewEngines,delete t.appViewEngines),t.appViewLogics&&(s.appViewLogics=t.appViewLogics,delete t.appViewLogics),t.appViewRefs&&(s.appViewRefs=t.appViewRefs,delete t.appViewRefs),t.controls&&(s.controls=t.controls,delete t.controls)}}return t}calcLayoutTag(t){const{viewType:e,viewStyle:s}=t;return"APPINDEXVIEW"===e?this.calcIndexViewLayoutTag(t):"".concat(e,"_").concat(s)}calcIndexViewLayoutTag(t){const{viewType:e,viewStyle:s,blankMode:i,mainMenuAlign:a}=t;let n="";return i?n="BLANK_MODE":a&&(n=a.toUpperCase()),""!==n?"".concat(e,"_").concat(s,"_").concat(n):"".concat(e,"_").concat(s)}});var At=t("ControlType",(t=>(t.APP_MENU="APPMENU",t.GRID="GRID",t.FORM="FORM",t.SEARCHFORM="SEARCHFORM",t.TOOLBAR="TOOLBAR",t.DRBAR="DRBAR",t.VIEWPANEL="VIEWPANEL",t.PICKUP_VIEW_PANEL="PICKUPVIEWPANEL",t.DATAVIEW="DATAVIEW",t.TREEGRID="TREEGRID",t.WF_EXPBAR="WFEXPBAR",t.TREEVIEW="TREEVIEW",t.TREE_EXP_BAR="TREEEXPBAR",t.TAB_VIEWPANEL="TABVIEWPANEL",t.DRTAB="DRTAB",t.CHART="CHART",t.REPORT_PANEL="REPORTPANEL",t.LIST="LIST",t.MOB_MDCTRL="MOBMDCTRL",t.MULTI_EDIT_VIEWPANEL="MULTIEDITVIEWPANEL",t.WIZARD_PANEL="WIZARDPANEL",t.UPDATE_PANEL="UPDATEPANEL",t.SEARCHBAR="SEARCHBAR",t.DASHBOARD="DASHBOARD",t.CALENDAR="CALENDAR",t.PANEL="PANEL",t.VIEW_LAYOUT_PANEL="VIEWLAYOUTPANEL",t.MAP="MAP",t.GANTT="GANTT",t.TREE_GRIDEX="TREEGRIDEX",t.KANBAN="KANBAN",t.CALENDAR_EXPBAR="CALENDAREXPBAR",t.CHART_EXPBAR="CHARTEXPBAR",t.DATA_VIEW_EXPBAR="DATAVIEWEXPBAR",t.GANTT_EXPBAR="GANTTEXPBAR",t.GRID_EXPBAR="GRIDEXPBAR",t.LIST_EXPBAR="LISTEXPBAR",t.MAP_EXPBAR="MAPEXPBAR",t.STATE_WIZARD_PANEL="STATEWIZARDPANEL",t.TAB_EXP_PANEL="TABEXPPANEL",t.CUSTOM="CUSTOM",t.CAPTIONBAR="CAPTIONBAR",t))(At||{})),Pt=t("ViewType",(t=>(t.APP_INDEX_VIEW="APPINDEXVIEW",t.DE_GRID_VIEW="DEGRIDVIEW",t.DE_EDIT_VIEW="DEEDITVIEW",t.APP_DATA_UPLOAD_VIEW="APPDATAUPLOADVIEW",t.APP_ERROR_VIEW="APPERRORVIEW",t.APP_FILE_UPLOAD_VIEW="APPFILEUPLOADVIEW",t.APP_FUN_PICKUP_VIEW="APPFUNCPICKUPVIEW",t.APP_LOGIN_VIEW="APPLOGINVIEW",t.APP_LOGOUT_VIEW="APPLOGOUTVIEW",t.APP_PANEL_VIEW="APPPANELVIEW",t.APP_PIC_UPLOAD_VIEW="APPPICUPLOADVIEW",t.APP_PORTAL_VIEW="APPPORTALVIEW",t.APP_REDIRECT_VIEW="APPREDIRECTVIEW",t.APP_START_VIEW="APPSTARTVIEW",t.APP_WELCOME_VIEW="APPWELCOMEVIEW",t.APP_WF_ADD_STEP_AFTER_VIEW="APPWFADDSTEPAFTERVIEW",t.APP_WF_ADD_STEP_BEFORE_VIEW="APPWFADDSTEPBEFOREVIEW",t.APP_WF_REDIRECT_VIEW="APPWFREDIRECTVIEW",t.APP_WF_SENDBAC_VIEW="APPWFSENDBACKVIEW",t.APP_WF_STEP_ACTOR_VIEW="APPWFSTEPACTORVIEW",t.APP_WF_STEP_DATA_VIEW="APPWFSTEPDATAVIEW",t.APP_WF_STEP_TRACE_VIEW="APPWFSTEPTRACEVIEW",t.APP_WF_SUPPLY_INFO_VIEW="APPWFSUPPLYINFOVIEW",t.APP_WF_TAKE_ADVICE_VIEW="APPWFTAKEADVICEVIEW",t.DE_CALENDAR_EXP_VIEW="DECALENDAREXPVIEW",t.DE_CALENDAR_VIEW="DECALENDARVIEW",t.DE_CHART_EXP_VIEW="DECHARTEXPVIEW",t.DE_CHART_VIEW="DECHARTVIEW",t.DE_CHART_VIEW9="DECHARTVIEW9",t.DE_CUSTOM_VIEW="DECUSTOMVIEW",t.DE_DATA_VIEW="DEDATAVIEW",t.DE_DATA_VIEW9="DEDATAVIEW9",t.DE_DATAVIEW_EXP_VIEW="DEDATAVIEWEXPVIEW",t.DE_EDIT_VIEW2="DEEDITVIEW2",t.DE_EDIT_VIEW3="DEEDITVIEW3",t.DE_EDIT_VIEW4="DEEDITVIEW4",t.DE_EDIT_VIEW9="DEEDITVIEW9",t.DE_FORM_PICKUP_DATA_VIEW="DEFORMPICKUPDATAVIEW",t.DE_GANTT_EXP_VIEW="DEGANTTEXPVIEW",t.DE_GANTT_VIEW="DEGANTTVIEW",t.DE_GANTT_VIEW9="DEGANTTVIEW9",t.DE_GRID_EXP_VIEW="DEGRIDEXPVIEW",t.DE_GRID_VIEW2="DEGRIDVIEW2",t.DE_GRID_VIEW4="DEGRIDVIEW4",t.DE_GRID_VIEW8="DEGRIDVIEW8",t.DE_GRID_VIEW9="DEGRIDVIEW9",t.DE_HTML_VIEW="DEHTMLVIEW",t.DE_INDEX_PICKUP_DATA_VIEW="DEINDEXPICKUPDATAVIEW",t.DE_INDEX_VIEW="DEINDEXVIEW",t.DE_KANBAN_VIEW="DEKANBANVIEW",t.DE_KANBAN_VIEW9="DEKANBANVIEW9",t.DE_LIST_EXP_VIEW="DELISTEXPVIEW",t.DE_LIST_VIEW="DELISTVIEW",t.DE_LIST_VIEW9="DELISTVIEW9",t.DE_MAP_EXP_VIEW="DEMAPEXPVIEW",t.DE_MAP_VIEW="DEMAPVIEW",t.DE_MAP_VIEW9="DEMAPVIEW9",t.DE_MD_CUSTOM_VIEW="DEMDCUSTOMVIEW",t.DE_MEDITVIEW9="DEMEDITVIEW9",t.DE_MOB_CALENDAR_EXP_VIEW="DEMOBCALENDAREXPVIEW",t.DE_MOB_CALENDAR_VIEW="DEMOBCALENDARVIEW",t.DE_MOB_CALENDAR_VIEW9="DEMOBCALENDARVIEW9",t.DE_MOB_CHART_EXP_VIEW="DEMOBCHARTEXPVIEW",t.DE_MO_BCHART_VIEW="DEMOBCHARTVIEW",t.D_EMOB_CHART_VIEW9="DEMOBCHARTVIEW9",t.DE_MOB_CUSTOM_VIEW="DEMOBCUSTOMVIEW",t.DE_MOB_DATA_VIEW="DEMOBDATAVIEW",t.DE_MOB_DATA_VIEW_EXP_VIEW="DEMOBDATAVIEWEXPVIEW",t.DE_MOB_EDIT_VIEW="DEMOBEDITVIEW",t.DE_MOB_EDIT_VIEW3="DEMOBEDITVIEW3",t.DE_MOB_EDITVIEW9="DEMOBEDITVIEW9",t.DE_MOB_FORM_PICKUP_MDVIEW="DEMOBFORMPICKUPMDVIEW",t.DE_MOB_GANTT_EXP_VIEW="DEMOBGANTTEXPVIEW",t.DE_MOB_GANTT_VIEW="DEMOBGANTTVIEW",t.DE_MOB_GANTT_VIEW9="DEMOBGANTTVIEW9",t.DE_MOB_HTML_VIEW="DEMOBHTMLVIEW",t.DE_MOB_INDEX_PICKUP_MDVIEW="DEMOBINDEXPICKUPMDVIEW",t.DE_MOB_LIST_EXP_VIEW="DEMOBLISTEXPVIEW",t.DE_MOB_LIST_VIEW="DEMOBLISTVIEW",t.DE_MOB_MAP_VIEW="DEMOBMAPVIEW",t.DE_MOB_MAP_VIEW9="DEMOBMAPVIEW9",t.DE_MOB_MDVIEW="DEMOBMDVIEW",t.DE_MOB_MDVIEW9="DEMOBMDVIEW9",t.DE_MOB_MEDIT_VIEW9="DEMOBMEDITVIEW9",t.DE_MOB_MPICKUP_VIEW="DEMOBMPICKUPVIEW",t.DE_MOB_OPT_VIEW="DEMOBOPTVIEW",t.DE_MOB_PANEL_VIEW="DEMOBPANELVIEW",t.DE_MOB_PANEL_VIEW9="DEMOBPANELVIEW9",t.DE_MOB_PICKUP_LIST_VIEW="DEMOBPICKUPLISTVIEW",t.DE_MOB_PICKUP_MDVIEW="DEMOBPICKUPMDVIEW",t.DE_MOB_PICKUP_TREE_VIEW="DEMOBPICKUPTREEVIEW",t.DE_MOB_PICKUP_VIEW="DEMOBPICKUPVIEW",t.DE_MOB_PORTAL_VIEW="DEMOBPORTALVIEW",t.DE_MOB_PORTAL_VIEW9="DEMOBPORTALVIEW9",t.DE_MOB_REDIRECT_VIEW="DEMOBREDIRECTVIEW",t.DE_MOB_REPORT_VIEW="DEMOBREPORTVIEW",t.DE_MOB_TAB_EXP_VIEW="DEMOBTABEXPVIEW",t.DE_MOB_TAB_EXP_VIEW9="DEMOBTABEXPVIEW9",t.DE_MOB_TAB_SEARCH_VIEW="DEMOBTABSEARCHVIEW",t.DE_MOB_TAB_SEARCH_VIEW9="DEMOBTABSEARCHVIEW9",t.DE_MOB_TREE_EXP_VIEW="DEMOBTREEEXPVIEW",t.DEMOBTREEEXPVIEW9="DEMOBTREEEXPVIEW9",t.DE_MOB_TREE_VIEW="DEMOBTREEVIEW",t.DE_MOB_WFACTION_VIEW="DEMOBWFACTIONVIEW",t.DE_MOB_WF_DATA_REDIRECT_VIEW="DEMOBWFDATAREDIRECTVIEW",t.DE_MOB_WF_DYNAACTIO_NVIEW="DEMOBWFDYNAACTIONVIEW",t.DE_MOB_WFDYNA_EDIT_VIEW="DEMOBWFDYNAEDITVIEW",t.DE_MOB_WF_DYNA_EDIT_VIEW3="DEMOBWFDYNAEDITVIEW3",t.DE_MOB_WF_DYNA_EXP_MDVIEW="DEMOBWFDYNAEXPMDVIEW",t.DE_MO_BWF_DYNA_START_VIEW="DEMOBWFDYNASTARTVIEW",t.DE_MOB_WF_EDIT_VIEW="DEMOBWFEDITVIEW",t.DE_MOB_WF_EDIT_VIEW3="DEMOBWFEDITVIEW3",t.DE_MOB_WF_MDVIEW="DEMOBWFMDVIEW",t.DE_MOB_WF_PROXY_RESULT_VIEW="DEMOBWFPROXYRESULTVIEW",t.DE_MOB_WF_PROXY_START_VIEW="DEMOBWFPROXYSTARTVIEW",t.DE_MOB_WF_START_VIEW="DEMOBWFSTARTVIEW",t.DE_MOB_WIZARD_VIEW="DEMOBWIZARDVIEW",t.DE_MPICKUP_VIEW="DEMPICKUPVIEW",t.DE_MPICKUP_VIEW2="DEMPICKUPVIEW2",t.DE_OPT_VIEW="DEOPTVIEW",t.DE_PANEL_VIEW="DEPANELVIEW",t.DE_PANEL_VIEW9="DEPANELVIEW9",t.DE_PICKUP_DATA_VIEW="DEPICKUPDATAVIEW",t.DE_PICKUP_GRID_VIEW="DEPICKUPGRIDVIEW",t.DE_PICKUP_TREE_VIEW="DEPICKUPTREEVIEW",t.DE_PICKUP_VIEW="DEPICKUPVIEW",t.DE_PICKUP_VIEW2="DEPICKUPVIEW2",t.DE_PICK_UP_VIEW3="DEPICKUPVIEW3",t.DE_PORTAL_VIEW="DEPORTALVIEW",t.DE_PORTAL_VIEW9="DEPORTALVIEW9",t.DE_REDIRECT_VIEW="DEREDIRECTVIEW",t.DE_REPORT_VIEW="DEREPORTVIEW",t.DE_TAB_EXP_VIEW="DETABEXPVIEW",t.DE_TAB_EXP_VIEW9="DETABEXPVIEW9",t.DE_TAB_SEARCH_VIEW="DETABSEARCHVIEW",t.DE_TAB_SEARCH_VIEW9="DETABSEARCHVIEW9",t.DE_TREE_EXP_VIEW="DETREEEXPVIEW",t.DE_TREE_EXP_VIEW2="DETREEEXPVIEW2",t.DE_TREE_EXP_VIEW3="DETREEEXPVIEW3",t.DE_TREE_GRID_EXVIEW="DETREEGRIDEXVIEW",t.DE_TREE_GRID_EXVIEW9="DETREEGRIDEXVIEW9",t.DE_TREE_GRID_VIEW="DETREEGRIDVIEW",t.DE_TREE_GRID_VIEW9="DETREEGRIDVIEW9",t.DE_TREE_VIEW="DETREEVIEW",t.DE_TREE_VIEW9="DETREEVIEW9",t.DE_WF_ACTION_VIEW="DEWFACTIONVIEW",t.DE_WF_DATA_REDIRECT_VIEW="DEWFDATAREDIRECTVIEW",t.DE_WF_DYNA_ACTION_VIEW="DEWFDYNAACTIONVIEW",t.DE_WF_DYNA_EDIT_VIEW="DEWFDYNAEDITVIEW",t.DE_WF_DYNA_EDIT_VIEW3="DEWFDYNAEDITVIEW3",t.DE_WF_DYNA_EXP_GRID_VIEW="DEWFDYNAEXPGRIDVIEW",t.DE_WF_DYNA_START_VIEW="DEWFDYNASTARTVIEW",t.DE_WF_EDIT_PROXY_DATA_VIEW="DEWFEDITPROXYDATAVIEW",t.DE_WF_EDIT_VIEW="DEWFEDITVIEW",t.DE_WF_EDIT_VIEW2="DEWFEDITVIEW2",t.DE_WF_EDIT_VIEW3="DEWFEDITVIEW3",t.DE_WF_EDIT_VIEW9="DEWFEDITVIEW9",t.DE_WF_EXP_VIEW="DEWFEXPVIEW",t.DE_WF_GRID_VIEW="DEWFGRIDVIEW",t.DE_WF_PROXY_DATA_VIEW="DEWFPROXYDATAVIEW",t.DE_WF_PROXY_RESULT_VIEW="DEWFPROXYRESULTVIEW",t.DE_WF_PROXY_START_VIEW="DEWFPROXYSTARTVIEW",t.DE_WF_START_VIEW="DEWFSTARTVIEW",t.DE_WIZARD_VIEW="DEWIZARDVIEW",t))(Pt||{})),yt=t("ViewMode",(t=>(t.ROUTE="ROUTE",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t.POPOVER="POPOVER",t))(yt||{})),vt=t("SysUIActionTag",(t=>(t.NEW="New",t.EDIT="Edit",t.REFRESH="Refresh",t.EXIT="Exit",t.SAVE_AND_EXIT="SaveAndExit",t.SAVE_AND_NEW="SaveAndNew",t.SAVE="Save",t.SAVE_ROW="SaveRow",t.REMOVE="Remove",t.REMOVE_AND_EXIT="RemoveAndExit",t.NEW_ROW="NewRow",t.TOGGLE_FILTER="ToggleFilter",t.IMPORT="Import",t.EXPORT_EXCEL="ExportExcel",t.SAVE_AND_START="SaveAndStart",t.VIEW_WF_STEP="ViewWFStep",t.NO="No",t.YES="Yes",t.CANCEL="Cancel",t.OK="Ok",t.SEARCH="Search",t.FINISH="Finish",t.NEXT_STEP="NextStep",t.PREV_STEP="PrevStep",t.ADD_SELECTION="AddSelection",t.REMOVE_SELECTION="RemoveSelection",t.REMOVE_ALL="RemoveAll",t.ADD_ALL="AddAll",t.LOGOUT="Logout",t.LOGIN="Login",t.CANCEL_CHANGES="CancelChanges",t.COPY="Copy",t.VIEW="View",t.TOGGLE_ROW_EDIT="ToggleRowEdit",t.REFRESH_ALL="RefreshAll",t.REFRESH_PARENT="RefreshParent",t.LOAD_MORE="LoadMore",t))(vt||{})),Tt=t("StudioViewEvents",class{});Tt.onViewMounted="onMounted",Tt.onViewDestroyed="onDestroyed";var bt=t("StudioPanelEvents",class{});bt.onClick="onClick",bt.onChange="onChange",bt.onEnter="onEnter",bt.onLeave="onLeave";var Ct=t("StudioControlEvents",class{});Ct.onBeforeLoad="onBeforeLoad",Ct.onLoadSuccess="onLoadSuccess",Ct.onLoadError="onLoadError",Ct.onBeforeLoadDraft="onBeforeLoadDraft",Ct.onLoadDraftSuccess="onLoadDraftSuccess",Ct.onLoadDraftError="onLoadDraftError",Ct.onBeforeSave="onBeforeSave",Ct.onSaveSuccess="onSaveSuccess",Ct.onSaveError="onSaveError",Ct.onBeforeRemove="onBeforeRemove",Ct.onRemoveSuccess="onRemoveSuccess",Ct.onRemoveError="onRemoveError",Ct.CLICK="onClick";var _t=t("Modal",class{constructor(t){this.mode="EMBED",this.viewUsage=4,this.hooks={shouldDismiss:new m,beforeDismiss:new m},this._dismiss=t=>{ibiz.log.error("外部关闭能力未注册",t)},t.mode&&(this.mode=t.mode),t.routeDepth&&(this.routeDepth=t.routeDepth),t.viewUsage&&(this.viewUsage=t.viewUsage),t.dismiss&&(this._dismiss=t.dismiss)}injectDismiss(t){this._dismiss=t}async dismiss(t={ok:!1,data:[]}){const e={allowClose:!0};return await this.hooks.shouldDismiss.call(e),e.allowClose?(await this.hooks.beforeDismiss.call(t),this._dismiss(t),this.destroy(),!0):(ibiz.log.debug("shouldDismiss结果为false,关闭中断。"),!1)}destroy(){this.hooks.shouldDismiss.clear(),this.hooks.beforeDismiss.clear()}});var Vt=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,s,a={},n={}){const r=await ibiz.hub.config.view.get(t);if(!r)throw new e("应用视图[".concat(t,"]不存在"));if(s.srfkey&&r.appDataEntityId){s[Z(r.appDataEntityId)]=s.srfkey,s.srfkey=void 0}if(r.redirectView){return ct(await ibiz.hub.getAppView(t),s,a,n)}const{openMode:o="INDEXVIEWTAB"}=r;switch(n.openMode||o){case"INDEXVIEWTAB":return n.noWaitRoute?void this.openIndexViewTab(r,s,a):this.openIndexViewTab(r,s,a);case"POPUP":throw new i(r,"未支持的视图打开模式: POPUP");case"POPUPMODAL":return this.openModal(r,s,a);case"POPUPAPP":throw new i(r,"未支持的视图打开模式: POPUPAPP");case"POPOVER":return this.openPopover(r,n.event,s,a);case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return this.openDrawer(r,s,a);case"USER":return this.openUserCustom(r,s,a);default:return this.openIndexViewTab(r,s,a)}}openIndexViewTab(t,e,s={}){return ibiz.openView.root(t.id,e,s)}async openModal(t,e,s={}){return ibiz.openView.modal(t.id,e,s)}async openPopover(t,s,i,a={}){if(!s)throw new e("气泡打开缺少event");return ibiz.openView.popover(t.id,s,i,a)}async openDrawer(t,e,s={}){return ibiz.openView.drawer(t.id,e,s)}async openUserCustom(t,e,s={}){return ibiz.openView.custom(t.id,e,s)}};Vt.TAG="ibiz.app-view.open";var Lt=t("OpenAppViewCommand",Vt),Rt=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,s,a={},n={}){const r=ibiz.hub.getApp(s.srfappid).getAppFunc(t);if(!r)throw new e("找不到叫".concat(t,"的应用功能"));const{navigateContexts:o,navigateParams:c,appFuncType:l}=r,d=s.clone();Object.assign(d,X(o,s,a));const h=X(c,s,a);switch(l){case"APPVIEW":return this.openAppView(r,d,h,n);case"OPENHTMLPAGE":return this.openHtmlPage(r);case"PDTAPPFUNC":return this.openPdAppFunc(r,d,h);case"JAVASCRIPT":return this.executeJavaScript(r,d,h);case"CUSTOM":return this.custom(r,d,h);default:throw new i(r,"未支持的应用功能类型: ".concat(l))}}async openAppView(t,s,i,a){if(!t.appViewId)throw new e("应用视图[".concat(t.appViewId,"]不存在"));return ibiz.commands.execute(Lt.TAG,t.appViewId,s,i,a)}openHtmlPage(t){const e=t.htmlPageUrl;window.open(e,"_blank")}openPdAppFunc(t,s,i){throw ibiz.log.warn("openPdAppFunc",t,s,i),new e("未实现")}executeJavaScript(t,s,i){throw ibiz.log.warn("executeJavaScript",t,s,i),new e("未实现")}custom(t,s,i){throw ibiz.log.warn("custom",t,s,i),new e("未实现")}};Rt.TAG="ibiz.app-func.exec";var Mt=t("AppFuncCommand",Rt);function Ot(){new Mt,new Lt}var Nt=t("AppCounter",class{constructor(t){this.model=t,this.destroyed=!1,this.context=a.create(),this.params={},this.evt=new f,this.data={}}get isDestroyed(){return this.destroyed}async init(t,e){this.setParams(t,e),this.appDataEntityId=this.model.appDataEntityId;const i=this.model.getAppDEActionId;if(!i)throw new s(this.model,"未找到获取计数器行为!");this.action=i,this.interval(),await this.load()}setParams(t,e){t&&(this.context=L(t)),e&&(this.params=L(e))}interval(){this.destroyInterval(),this.intervalTimer=setInterval((()=>{this.evt.getSize("change")>0&&this.load()}),this.model.timer||6e3)}destroyInterval(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)}async load(){const t=ibiz.hub.getApp(this.context.srfappid),e=await t.deService.exec(this.appDataEntityId,this.action,this.context,this.params);return e.ok&&(this.data=e.data,this.evt.emit("change",this.data)),this.data}refresh(t,e){return this.setParams(t,e),this.load()}onChange(t,e=!0){this.evt.on("change",t),e&&E(this.data)&&t(this.data)}offChange(t){this.evt.off("change",t)}getCounter(t){return this.data[t.toLowerCase()]||0}destroy(){this.destroyed=!0,this.context.destroy(),this.destroyInterval(),this.evt.reset()}}),Wt=class{constructor(){this.psModelGroupCondBase=null}parse(t){if(t instanceof Array){const e=this.createPSModelGroupCond();e.parse(t),this.psModelGroupCondBase=e}}testSingleCond(t,e,s){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){let i=-1;if(e==s?i=0:e>s&&(i=1),"EQ"===t||"ABSEQ"===t)return 0===i;if("GT"===t)return i>0;if("GTANDEQ"===t)return i>=0;if("LT"===t)return i<0;if("LTANDEQ"===t)return i<=0;if("NOTEQ"===t)return 0!==i}if("LIKE"===t)return null!=e&&null!=s&&-1!==e.toString().toUpperCase().indexOf(s.toString().toUpperCase());if("LEFTLIKE"===t)return null!=e&&null!=s&&0===e.toString().toUpperCase().indexOf(s.toString().toUpperCase())}catch(t){ibiz.log.error(t)}return!1}getPSModelGroupCondBase(){return this.psModelGroupCondBase}},xt=class{constructor(){this.strCondOp=null}getCondOp(){return this.strCondOp}setCondOp(t){this.strCondOp=t}},St=class extends xt{parse(t){const e=t.length;let s=!0,i=!1,a=!1;for(let n=0;n<e;n++)if(s){const e=t[n];this.setCondOp(e),s=!1,i=!0}else if(i){const e=t[n];this.setParam(e),i=!1,a=!0}else if(a){const e=t[n];if(e instanceof Object&&!(e instanceof Array)){const t=e;null!=t.type&&this.setValueType(t.type.toString()),null!=t.value&&this.setValue(t.value.toString())}else this.setValue(e);break}}getValueType(){return this.strValueType}setValueType(t){this.strValueType=t}getValue(){return this.strValue}setValue(t){this.strValue=t}getParamType(){return this.strParamType}setParamType(t){this.strParamType=t}getParam(){return this.strParam}setParam(t){this.strParam=t}},Ft=class t extends xt{constructor(){super(...arguments),this.childCondList=[],this.bNotMode=!1}parse(s){const i=s.length;let a=!0,n=!0,r=!1;for(let o=0;o<i;o++){if(a&&n){if("!"===s[o]){this.setNotMode(!0),a=!1;continue}}if(n){const t=s[o];this.setCondOp(t),n=!1,a=!1,r=!0}else if(r){const i=s[o];if(!(i instanceof Array))throw new e("值必须为数组");i.forEach((e=>{if(e.length>0){const s=e[0].toString();if("!"===s||"OR"===s||"AND"===s){const s=new t;s.parse(e),this.childCondList.push(s)}else{const t=new St;t.parse(e),this.childCondList.push(t)}}}))}}}setNotMode(t){this.bNotMode=t}isNotMode(){return this.bNotMode}getChildPSModelCondBases(){return this.childCondList}},Bt=class extends Ft{},kt=class extends St{},Ut=class t extends Wt{test(t,e){return this.testCond(this.getPSModelGroupCondBase(),t,e)}testCond(e,s,i){if(e instanceof Ft){const t=e.getChildPSModelCondBases();if(null==t||V(t))return!e.isNotMode();const a="AND"===e.getCondOp();let n=a;for(let e=0;e<t.length;e++){const r=t[e];if(this.testCond(r,s,i)){if(!a){n=!0;break}}else if(a){n=!1;break}}return e.isNotMode()?!n:n}if(e instanceof St){V(e.getParam())&&ibiz.log.warn("没有指定属性名称",e);const a=s[e.getParam().toLowerCase()];let n=null;const r=e.getValueType(),o=e.getValue();return null==r||V(r)?n=e.getValue():(V(o)&&ibiz.log.warn("没有指定上下文参数名称"),t.PARAMTYPE_WEBCONTEXT===r?n=i.data[o.toLowerCase()]:t.PARAMTYPE_DATACONTEXT===r&&(n=i.getValue(o.toLowerCase()))),this.testSingleCond(e.getCondOp(),a,n)}return ibiz.log.warn("无法识别的条件对象",e),!1}createPSModelSingleCond(){return new kt}createPSModelGroupCond(){return new Bt}};Ut.PARAMTYPE_DATACONTEXT="DATACONTEXT",Ut.PARAMTYPE_WEBCONTEXT="WEBCONTEXT";var zt=t("PSDEDQCondEngine",Ut);t("DEDQCondUtil",class{static getCond(t){if(this.map.has(t))return this.map.get(t);const e=t.dedqgroupConditions;if(e){const s=new zt;return s.parse(["OR",this.calcCond(e)]),this.map.set(t,s),s}return null}static calcCond(t){const e=[];return t.forEach((t=>{const s=[];if("GROUP"===t.condType){const e=t;e.notMode&&s.push("!"),s.push(t.condOp);const i=e.dedqconditions;if(i){const t=this.calcCond(i);s.push(t)}}else{if("SINGLE"!==t.condType)throw new i(t,"暂未支持的查询条件类型: ".concat(t.condType));{const e=t;s.push(e.fieldName),e.condValue||s.push("")}}e.push(s)})),e}}).map=new WeakMap;var Gt=t("DynamicCodeListCache",class{constructor(t){this.cache=new Map,this.isPredefined=!1,this.codeList=t}async init(){return this.initPromise=(async()=>{const{predefinedType:t}=this.codeList;if(t){if(this.isPredefined=!0,!["OPERATOR","RUNTIME"].includes(t))throw new i(this.codeList,"预定义类型".concat(t,"暂不支持"))}else this.initPromise=void 0})(),this.initPromise}convertData(t){const e={},{valueAppDEFieldId:s,textAppDEFieldId:i}=this.codeList,a=s?t[s]:t.srfkey;return e.id=a,e.value=a,e.text=i?t[i]:t.srfmajortext,Object.freeze(e)}async load(t={},e={}){const i=ibiz.hub.getApp(t.srfappid);if(this.isPredefined){e.size||(e.size=1e4);const t=await i.net.get("/dictionaries/codelist/".concat(this.codeList.codeName),e);return Object.freeze(t.data.items)}const{appDataEntityId:a,appDEDataSetId:n}=this.codeList;if(!a)throw new s(this.codeList,"未配置应用实体");if(!n)throw new s(this.codeList,"未配置数据集");const r=await i.deService.exec(a,n,t,{},e);let o=[];return r.data.length&&(o=r.data.map((t=>this.convertData(t)))),o}async get(t={},e={}){if(this.initPromise&&await this.initPromise,!this.codeList.enableCache)return this.load(t,e);const s=JSON.stringify(t)+JSON.stringify(e);if(this.cache.has(s)){const t=this.cache.get(s);if(t.expirationTime>(new Date).getTime())return t.promise?t.promise:t.items;this.cache.delete(s)}const i=this.load(t,e),{cacheTimeout:a}=this.codeList,n=-1===a||C(a)?ibiz.config.codeList.timeout:this.codeList.cacheTimeout,r={expirationTime:(new Date).getTime()+n,promise:i};this.cache.set(s,r);const o=await i;return r.items=o,delete r.promise,o}});function jt(t,s){if(null!=s){const{srfkey:t}=s;if(!C(t)&&!V(t))return!0}throw new e("执行「".concat(t,"」不存在「srfkey」无法处理"))}function Xt(t,s){const{srfsessionid:i}=s;if(!C(i)&&!V(i))return!0;throw new e("执行「".concat(t,"」不存在「srfsessionid」无法处理"))}var Kt=t("DECache",class{constructor(){this.cacheMap=new Map}forceAdd(t,e){const s=this.getCacheByTag(t).get(e.srfkey);s&&(s.assign(e),ibiz.log.warn("forceAdd",e.srfkey,e))}forceUpdate(t,e){this.getCacheByTag(t).set(e.srfkey,L(e)),ibiz.log.warn("forceUpdate",e.srfkey,e)}forceDelete(t,e){this.getCacheByTag(t).delete(e),ibiz.log.warn("forceDelete",e)}add(t,e){try{Xt("add",t),(C(e.srfkey)||V(e.srfkey))&&(e.srfkey=w()),e.srftempdate=(new Date).getTime();return this.getCacheByTag(t).set(e.srfkey,L(e)),ibiz.log.warn("add",e.srfkey,e),e}catch(t){return ibiz.log.error(t),null}}get(t,e){try{Xt("get",t);const s=this.getCacheByTag(t).get(e);return ibiz.log.warn("get",e,s),L(s)}catch(t){return ibiz.log.error(t),null}}update(t,e){try{Xt("update",t),jt("update",e),e.srftempdate=(new Date).getTime();const s=this.getCacheByTag(t),i=s.get(e.srfkey);if(i)return i.assign(e),s.set(e.srfkey,i),ibiz.log.warn("update",e.srfkey,e),L(i);throw new Error("数据不存在,无法更新!")}catch(t){return ibiz.log.error(t),null}}delete(t,e){try{Xt("delete",t);const s=this.getCacheByTag(t),i=e;if(s.has(i)){const t=s.get(i);return t.srftempdate=(new Date).getTime(),s.delete(i),ibiz.log.warn("delete",i),t}return null}catch(t){return ibiz.log.error(t),null}}createBatch(t,e){try{Xt("add",t);const s=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const i=e[t];(C(i.srfkey)||V(i.srfkey))&&(i.srfkey=w()),i.srftempdate=(new Date).getTime();const a=L(i);s.set(i.srfkey,a),e[t]=a,ibiz.log.warn("add",i.srfkey,i)}return e}catch(t){ibiz.log.error(t)}return[]}updateBatch(t,e){try{Xt("update",t);const s=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const i=e[t];jt("update",i),i.srftempdate=(new Date).getTime();const a=s.get(i.srfkey);if(!a)throw new Error("数据[".concat(i.srfdename,"-").concat(i.srfmajortext,"(").concat(i.srfkey,")]不存在,无法更新!"));a.assign(i),s.set(i.srfkey,a),ibiz.log.warn("update",i.srfkey,i),e[t]=L(a)}return e}catch(t){return ibiz.log.error(t),null}}deleteBatch(t,e){try{Xt("delete",t)}catch(t){return ibiz.log.error(t),e}const s=this.getCacheByTag(t),i=[];for(let t=0;t<e.length;t++){const a=e[t];s.has(a)||i.push(a)}if(i.length>0)throw new Error("未找到以下数据「".concat(i.join("、"),"」,无法删除!"));for(let t=0;t<e.length;t++){const i=e[t];s.delete(i),ibiz.log.warn("delete",i)}return[]}checkData(t,e){return-1!==this.getList(t).findIndex((t=>t.srfkey===e))}getList(t){try{Xt("getList",t);const e=this.getCacheByTag(t);if(!e)return[];const s=e.values();return Array.from(s)}catch(t){return ibiz.log.error(t),[]}}generatePred(t={}){const e={};t.srfkey&&(e.srfkey=R(t.srfkey)),delete t.srfkey;for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const i=t[s];e[s]=R(i)}return M(e)}clear(t){const e=t.srfsessionid;this.cacheMap.size>0&&this.cacheMap.delete(e)}getCacheByTag(t){const e=t.srfsessionid;return this.cacheMap.has(e)||this.cacheMap.set(e,new Map),this.cacheMap.get(e)}}),Ht=new RegExp("(?<=\\$\\{)(.*?)(?=\\})","g");function Yt(t,e){const s=(e.requestPaths||[]).map((t=>({path:t,keys:t.match(Ht)||[]}))).filter((e=>{const{keys:s}=e;return 0===s.length||s.every(((e,i)=>i===s.length-1||null!=t[e]))})).sort(((t,e)=>e.keys.length-t.keys.length));if(s.length>0)return s[0]}function qt(t,e){const s=Yt(t,e);if(s){if(s.keys.length>0){let{path:e}=s;return s.keys.forEach(((i,a)=>{e=a===s.keys.length-1?e.replace(new RegExp("/[^/]+/\\$\\{".concat(i,"\\}")),""):e.replace("${".concat(i,"}"),t[i])})),e}return s.path}return""}var $t=t("SearchFilter",class{constructor(t,e){if(this.page=0,this.size=1e3,this.data={},this.sortField="srfordervalue",this.sortMode="ASC",this.context=t,e){if(C(e.page)||V(e.page)||(this.page=e.page),C(e.size)||V(e.size)||(this.size=e.size),C(e.query)||V(e.query)||(this.query=e.query),!C(e.sort)&&!V(e.sort)){const t=e.sort.split(",");t.length>=1&&([this.sortField]=t),t.length>=2&&(this.sortMode=t[1].toUpperCase())}C(e.srfparentkey)||V(e.srfparentkey)||(this.srfparentkey=e.srfparentkey),C(e.srfparentdename)||V(e.srfparentdename)||(this.srfparentdename=e.srfparentdename),this.data={...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}}getValue(t){return this.data[t]?this.data[t]:this.context[t]}}),Qt=t("CodeListService",class{constructor(t){this.appModel=t,this.allCodeLists=new Map,this.cache=new Map}getStatic(t){const e=t.codeName;if(this.cache.has(e))return this.cache.get(e);const s=t.codeItems;let i=[];return(null==s?void 0:s.length)&&(i=this.formatStaticItems(s,t.codeItemValueNumber)),this.cache.set(e,Object.freeze(i)),i}setCodeList(t){const{id:e,codeName:s}=t;this.allCodeLists.set(e,t),this.allCodeLists.set(s,t)}getCodeList(t){return this.allCodeLists.get(t)}formatStaticItems(t,e){return t.map((t=>{var s;let i=t.text;t.textLanguageRes&&(i=ibiz.i18n.t(t.textLanguageRes.lanResTag,t.textLanguageRes.defaultContent));const a={text:i,value:e?Number(t.value):t.value,color:t.color,id:t.codeName};return(null==(s=t.codeItems)?void 0:s.length)&&(a.children=this.formatStaticItems(t.codeItems,e)),Object.freeze(a)}))}async getDynamicCodeList(t,e={},s={}){let i;const a=t.codeName;return this.cache.has(a)?i=this.cache.get(a):(i=new Gt(t),this.cache.set(a,i),await i.init()),i.get(e,s)}async get(t,s,i){const a=this.allCodeLists.get(t);if(!a)throw new e("找不到".concat(t,"代码表"));return"STATIC"===a.codeListType?this.getStatic(a):"DYNAMIC"===a.codeListType?this.getDynamicCodeList(a,s,i):[]}}),Jt=t("CounterService",class{static async getCounter(t,e,s){const i=t.id;if(this.counterMap.has(i)){const t=this.counterMap.get(i);if(!1===t.isDestroyed)return t;this.counterMap.delete(i)}const a=new Nt(t);return await a.init(e,s),this.counterMap.set(i,a),a}static async getCounterByRef(t,e,i){const{appCounter:a}=t;if(!a)throw new s(t,"未配置应用计数器!");return this.getCounter(a,e,i)}});Jt.counterMap=new Map;var Zt=t("WorkFlowService",class{constructor(t){this.model=t,this.commonBaseUrl="",this.app=ibiz.hub.getApp(t.appId);const e=ibiz.appData.context;this.commonBaseUrl="/wfcore/".concat(e.srfsystemid,"-app-").concat(this.app.model.codeName.toLowerCase(),"/").concat(this.model.name.toLowerCase())}getBaseUrl(){return this.commonBaseUrl}getActiveData(t,e){return e.srfprocessinstanceid&&(t.srfprocessinstanceid=e.srfprocessinstanceid),t}async getWFStep(t){const{processDefinitionKey:e,taskDefinitionKey:s}=t;return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions/").concat(e,"/usertasks/").concat(s))}async getWFLink(t,e){const s=t[this.model.codeName.toLowerCase()],{taskDefinitionKey:i}=t;return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(s,"/usertasks/").concat(i,"/ways"),{activedata:this.getActiveData(e,t)})}async getWFHistory(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.get("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/history"))}async getWFProcessDiagram(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.request("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/processdiagram"),{method:"post",data:{},responseType:"blob"})}async getWFVersion(){return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions2"))}async wfStart(t,e,s){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/process-instances"),{...e,activedata:this.getActiveData(s,t)})}async wfSubmit(t,e,s){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId),{...e,activedata:this.getActiveData(s,t)})}async wfWithdraw(t,e,s){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/withdraw"),{...e,activedata:this.getActiveData(s,t)})}async wfReassign(t,e,s){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/transfer"),{...e,activedata:this.getActiveData(s,t)})}async wfAddStepBefore(t,e,s){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/beforesign"),{...e,activedata:this.getActiveData(s,t)})}async wfSendBack(t,e,s){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendback"),{...e,activedata:this.getActiveData(s,t)})}async wfSendCopy(t,e,s){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendcopy"),{...e,activedata:this.getActiveData(s,t)})}async exec(t,s,i={},a={}){switch(t){case"wfstart":return this.wfStart(s,i,a);case"wfsubmit":return this.wfSubmit(s,i,a);case"reassign":return this.wfReassign(s,i,a);case"addstepbefore":return this.wfAddStepBefore(s,i,a);case"sendback":return this.wfSendBack(s,i,a);case"sendcopy":return this.wfSendCopy(s,i,a);default:throw new e("「".concat(t,"」未实现"))}}}),te=t("Srfuf",(t=>(t[t.CREATE=0]="CREATE",t[t.UPDATE=1]="UPDATE",t))(te||{})),ee=t("AppDataEntity",class t{get srfuf(){return this.srfkey?1:0}constructor(e,s){let i;Object.defineProperty(this,"_entity",{enumerable:!1,configurable:!0,value:e}),Object.defineProperty(this,"_data",{enumerable:!1,configurable:!0,value:L(s instanceof t?s._data:s)}),Object.defineProperty(this,"srfdeid",{get:()=>e.id}),Object.defineProperty(this,"srfdecodename",{get:()=>e.codeName});const a=$(e.appDEFields||[],e.keyAppDEFieldId);if(a){const t=a.codeName.toLowerCase();Object.defineProperty(this,"srfkeyfile",{get:()=>t}),Object.defineProperty(this,"srfkey",{set(e){i=e,this._data[t]=e},get(){return this._data[t]||i}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主键字段"));const n=$(e.appDEFields||[],e.majorAppDEFieldId);if(n){const t=n.codeName.toLowerCase();Object.defineProperty(this,"srfmajorfile",{get:()=>t}),Object.defineProperty(this,"srfmajortext",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主文本字段"));this.defineProperties()}defineProperties(){var t;const{_data:e}=this,s={},i=Object.keys(e);i.forEach((t=>{s[t]={enumerable:!0,set(s){e[t]=s},get:()=>e[t]}})),null==(t=this._entity.appDEFields)||t.forEach((t=>{const a=t.codeName.toLowerCase();i.includes(a)||(s[a]={enumerable:!0,set(t){e[a]=t},get:()=>e[a]})})),Object.defineProperties(this,s)}clone(){return new t(this._entity,this._data)}assign(e){return e instanceof t?Object.assign(this._data,e._data):Object.assign(this._data,e),this}}),se=t("MethodDto",class t{constructor(t,e){this.entity=t,this.dto=e,this.dtoMap=new Map,e?(this.app=ibiz.hub.getApp(t.appId),this.fields=e.appDEMethodDTOFields||[]):this.fields=[]}get isLocalMode(){return 1===this.entity.storageMode||4===this.entity.storageMode}async get(t,e){const s={};for(let e=0;e<this.fields.length;e++){const a=this.fields[e],n=a.codeName.toLowerCase();switch(a.type){case"SIMPLE":break;case"DTOS":{if(!a.refAppDataEntityId)break;const e=await this.getFieldDto(a),i=(await this.app.deService.getService(a.refAppDataEntityId)).local.getList(t);if(i){const a=[];for(let s=0;s<i.length;s++)a.push(await e.get(t,i[s]));s[n]=a}break}default:throw new i(a,"未支持的应用实体方法输入属性类型: ".concat(a.type))}}return{...e,...s}}async sets(t,e){const s=await this.app.deService.getService(this.entity.id);return s.local.clear(t),Promise.all(e.map((async e=>{const i=this.fields.filter((t=>"DTOS"===t.type)).map((async s=>{if(!s.refAppDataEntityId)return;const i=s.codeName.toLowerCase(),a=await this.getFieldDto(s),n=e[i];n&&await a.sets(t,n)}));for(let t=0;t<i.length;t++)await i[t];const a=new ee(this.entity,e);return this.isLocalMode&&await s.local.add(t,a),a})))}async getFieldDto(e){if(this.dtoMap.has(e.codeName))return this.dtoMap.get(e.codeName);const s=await ibiz.hub.getAppDataEntity(e.refAppDataEntityId,this.entity.appId),i=$(s.appDEMethodDTOs||[],e.refAppDEMethodDTOId),a=new t(s,i);return this.dtoMap.set(e.codeName,a),a}}),ie=class{constructor(t,e){this.entity=t,this.method=e,this.app=ibiz.hub.getApp(t.appId),this.input=new class{constructor(t,e){if(this.entity=t,this.input=e,e){const s=$(t.appDEMethodDTOs||[],e.appDEMethodDTOId);s&&(this.dto=new se(t,s))}}async handle(t,e){return this.dto?this.dto.get(t,e):e}}(t,e.appDEMethodInput),this.result=new class{constructor(t,e){if(this.entity=t,this.output=e,e){const s=$(t.appDEMethodDTOs||[],e.appDEMethodDTOId);s&&(this.dto=new se(t,s))}}async handle(t,e){return this.dto?(await this.dto.sets(t,[e]))[0]:new ee(this.entity,e)}}(t,e.appDEMethodReturn)}get isLocalMode(){return 1===this.entity.storageMode||4===this.entity.storageMode}async request(t,e,i,a){const{actionType:n,requestMethod:r}=this.method;if("REMOTE"===n){const e=this.method.codeName.toLowerCase();let n=null;switch(r){case"POST":n=await this.app.net.post("".concat(t,"/").concat(e),i,a);break;case"GET":n=await this.app.net.get("".concat(t,"/").concat(e),i,a);break;case"PUT":n=await this.app.net.put("".concat(t,"/").concat(e),i,a);break;case"DELETE":n=await this.app.net.delete("".concat(t,"/").concat(e),i,a);break;default:throw new s(this.method,r?"未支持的请求方式: ".concat(r):"未配置请求方式")}return n}throw new s(this.method,"未支持的行为类型[".concat(n,"]"))}calcPath(t){const e="/".concat(this.entity.codeName2.toLowerCase());return qt(t,this.entity)+e}async getService(){return this.service||(this.service=await this.app.deService.getService(this.entity.id)),this.service}createEntity(t){return new ee(this.entity,t)}},ae=class{},ne=class extends ae{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName.toLowerCase()}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,a){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new s(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=a[this.value]?a[this.value]:e[this.value];return dt(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new s(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return dt(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new i(this.model,"暂未支持条件值类型为[当前时间]");default:return dt(n[this.dstField],this.op,this.value)}}},re=class t extends ae{constructor(e){super(),this.model=e;const s=e.conds||[];this.conds=s.map((e=>"SINGLE"===e.logicType?new ne(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,i){let a=!0;if(0===this.conds.length)throw new s(this.model,"界面连接条件逻辑组未配置逻辑项");for(let s=0;s<this.conds.length;s++){const n=this.conds[s].test(t,e,i);if("AND"===this.op&&!1===n){a=!1;break}if("OR"===this.op&&!0===n){a=!0;break}}return this.notMode?!a:a}},oe=class{constructor(t){var e;this.model=t,this.links=null==(e=t.links||[])?void 0:e.map((t=>new class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const e=this.model.delogicLinkGroupCond;e&&(this.groupCond=new re(e))}async exec(t){const{defaultLink:e}=this.model;return!(!e&&this.groupCond)||this.groupCond.test(t,t.context,t.data||{})}}(t)))}},ce=class extends oe{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:i,dstDELogicParamId:a,retDELogicParamId:n}=this.model;if(!e)throw new s(this.model,"未指定应用实体");if(!i)throw new s(this.model,"未指定实体行为");const r=t.params[a],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,i,t.context,r,t.viewParams);c.ok&&(t.params[n]=c.data)}},le=class extends oe{async exec(t){}},de=class extends oe{async exec(t){t.isEndNode=!0;const{returnParamId:e,returnType:s,rawValue:a}=this.model;switch(s){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=a;break;case"LOGICPARAM":t.result=t.params[e];break;default:throw new i(this.model,"暂未支持的结束节点返回值类型: ".concat(s))}}};function he(t,e){const{srcDELogicParamId:s,srcValueType:a,srcFieldName:n,srcValue:r}=e;let o;switch(e.srcValueType||(e.srcValueType="SRCDLPARAM"),a){case"SRCDLPARAM":o=t.params[s];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return r;case"VIEWPARAM":o=t.viewParams;break;case"APPDATA":o=t.context;break;case"ENVPARAM":o=L(ibiz.env);break;default:throw new i(e,"暂未支持源值类型".concat(a))}const c=null==n?void 0:n.toLowerCase();return o&&c&&(o=o[c]),o}var ue=class extends oe{async exec(t){const e=this.model.delogicNodeParams;(null==e?void 0:e.length)&&await Promise.all(e.map((e=>{switch(e.paramAction){case"SETPARAMVALUE":return this.setParamValue(e,t);case"RESETPARAM":return this.resetParam(e,t);case"COPYPARAM":return this.copyParam(e,t);case"BINDPARAM":return this.bindParam(e,t);case"RENEWPARAM":return this.renewParam(e,t);case"APPENDPARAM":return this.appendParam(e,t);case"SORTPARAM":return this.sortParam(e,t);default:throw new i(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))}})))}copyParam(t,e){const{dstDELogicParamId:s}=t,i=he(e,t);e.params[s]=L(i)}bindParam(t,e){const s=he(e,t);e.params[t.dstDELogicParamId]=s}setParamValue(t,e){const{dstFieldName:s,dstDELogicParamId:i}=t,a=null==s?void 0:s.toLowerCase(),n=he(e,t);a?e.params[i][a]=n:e.params[i]=n}resetParam(t,e){const{dstDELogicParamId:s}=t;e.resetParam(s)}renewParam(t,e){const{dstDELogicParamId:s}=t;e.renewParam(s)}appendParam(t,e){const{dstDELogicParamId:s,dstIndex:i,srcIndex:a,srcSize:n}=t,r=he(e,t),o=i||0,c=a||0,l=n||r.length;e.params[s].splice(o,0,...r.slice(c,l))}sortParam(t,e){const{dstDELogicParamId:s,dstFieldName:i,dstSortDir:a}=t,n=i.toLowerCase();e.params[s].sort(((t,e)=>"ASC"===a?t[n]-e[n]:e[n]-t[n]))}},pe=class extends oe{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:s,dstDELogicParamId:i,retDELogicParamId:a}=this.model,n=t.params[i],r=ibiz.hub.getApp(t.context.srfappid),o=await r.deService.exec(s,e,t.context,n,t.viewParams);o.ok&&(t.params[a]=o.data)}},Ee=class extends oe{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:i}=this.model;if(!e||!i)throw new s(this.model,"缺少目标参数对象或者源参数对象配置");const a=he(t,this.model);t.params[e]=a}},ge=class extends oe{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new s(this.model,"缺少目标参数对象配置");t.resetParam(e)}},me=class extends oe{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new s(this.model,"缺少目标参数对象配置");t.renewParam(e)}},fe=class extends oe{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:i}=this.model;if(!e||!i)throw new s(this.model,"缺少目标参数对象或者源参数对象配置");const a=he(t,this.model);t.params[e]=L(a)}},we=class extends oe{async exec(t){const{dstDELogicParamId:e,dstSortDir:i,dstFieldName:a}=this.model;if(!e||!a)throw new s(this.model,"缺少目标参数对象或目标属性配置");const n=a.toLowerCase();t.params[e].sort(((t,e)=>"ASC"===i?t[n]-e[n]:e[n]-t[n]))}},Ie=class extends oe{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:i,dstIndex:a,srcIndex:n,srcSize:r}=this.model;if(!e||!i)throw new s(this.model,"缺少目标参数对象或者源参数对象配置");const o=he(t,this.model),c=a||0,l=n||0,d=r||o.length;t.params[e].splice(c,0,...o.slice(l,d))}},De=class extends oe{async exec(t){const{errorCode:e,errorInfo:s}=this.model;throw new r({response:{status:e,statusText:s}})}},Ae=class{constructor(t){var e,a;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.delogicNodes)?void 0:e.length))throw new s(t,"实体逻辑没有配置逻辑节点");t.delogicNodes.forEach((t=>{const{logicNodeType:e}=t;let s;switch(e){case"BEGIN":s=new le(t);break;case"END":s=new de(t);break;case"DEACTION":s=new ce(t);break;case"PREPAREPARAM":s=new ue(t);break;case"DEDATASET":s=new pe(t);break;case"THROWEXCEPTION":s=new De(t);break;case"BINDPARAM":s=new Ee(t);break;case"RESETPARAM":s=new ge(t);break;case"COPYPARAM":s=new fe(t);break;case"RENEWPARAM":s=new me(t);break;case"APPENDPARAM":s=new Ie(t);break;case"SORTPARAM":s=new we(t);break;default:throw new i(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,s)})),null==(a=t.delogicParams)||a.forEach((t=>{this.params.set(t.id,new class{constructor(t){this.model=t}calc(t){const e=this.model.id,s=this.model;if(s.default)t.params[e]=t.data||{};else if(s.appGlobalParam)t.params[e]=L(ibiz.env);else if(s.entityListParam)t.params[e]=[];else{if(s.entityPageParam)throw new i(s,"未支持的逻辑参数类型: 分页查询结果");if(s.entityParam)t.params[e]={};else{if(s.lastReturnParam)throw new i(s,"未支持的逻辑参数类型: 上次调用返回");if(s.appContextParam)t.params[e]=t.context;else if(s.simpleListParam)t.params[e]=[];else if(s.simpleParam)t.params[e]={};else if(s.cloneParam)t.params[e]=L(t.data||{});else{if(s.envParam)throw new i(s,"未支持的逻辑参数类型: 系统环境变量");if(s.fileListParam)throw new i(s,"未支持的逻辑参数类型: 文件对象列表变量");if(s.fileParam)throw new i(s,"未支持的逻辑参数类型: 文件对象变量");if(s.filterParam)throw new i(s,"未支持的逻辑参数类型: 过滤器对象变量");if(s.lastParam)throw new i(s,"未支持的逻辑参数类型: 最后数据变量");if(s.originEntity)throw new i(s,"未支持的逻辑参数类型: 原始数据对象");if(s.sessionParam)throw new i(s,"未支持的逻辑参数类型: 操作会话变量")}}}}renew(t){const e=this.model.id,s=this.model;if(s.entityListParam||s.simpleListParam||s.entityPageParam)t.params[e]=[];else{if(!s.simpleParam&&!s.entityParam)throw new i(s,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}}(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.thenId)&&(e.dstNode=this.nodes.get(e.model.thenId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t,e,i){const a=new class{constructor(t,e,s,i){this.deLogicParams=t,this.context=e,this.data=s,this.viewParams=i,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}}(this.params,t,e,i);this.initLogicParams(a);const{startDELogicNodeId:n}=this.model;if(!n||!this.nodes.has(n))throw new s(this.model,"未设置起始节点");{const t=this.nodes.get(n);await this.deepExec(t,a)}return a.isEndNode?a.result:a.params[a.defaultParamName]?a.params[a.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:s}=t;for(let i=0;i<s.length;i++){const a=s[i];if(await a.exec(e)&&a.dstNode&&(await this.deepExec(a.dstNode,e),!1===t.model.parallelOutput))break}}},Pe=new Map;async function ye(t,e,s,i){Pe.has(t)||Pe.set(t,new Ae(t));return Pe.get(t).exec(e,s,i)}async function ve(t,e,s,i){try{const a=await ye(t,e,s,i);return new n(a)}catch(t){if(t instanceof r)return new n(t,500);throw t}}async function Te(t,e,s,i,a){const n=et(t,e);if(n.length){(await Promise.all(n.map((t=>ye(t,s,i,a))))).forEach((t=>{Object.assign(i,t)}))}}var be=class extends ie{async exec(t,e,i){if("DELOGIC"===this.method.actionType){const a=tt(this.method.appDELogicId,this.entity);if(!a)throw new s(this.method,"缺少实体处理逻辑");return ve(a,t,e,i)}let a;switch(this.isLocalMode||(e=await this.input.handle(t,e)),["READ","GETDRAFT"].includes(this.method.actionMode)||await Te(this.entity,"change",t,e,i),this.method.codeName){case"Create":a=await this.create(t,e,i);break;case"Get":a=await this.get(t,i);break;case"GetDraft":a=await this.getDraft(t,i);break;case"Remove":a=await this.remove(t,i);break;case"Update":a=await this.update(t,e,i);break;case"CreateTemp":a=await this.createTemp(t,e);break;case"GetTemp":a=await this.getTemp(t,e);break;case"GetDraftTemp":a=await this.getDraftTemp(t,i);break;case"RemoveTemp":a=await this.removeTemp(t,e);break;case"UpdateTemp":a=await this.updateTemp(t,e);break;default:{let s=this.calcPath(t);this.method.needResourceKey&&(s="".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]||e[this.entity.keyAppDEFieldId]));const n=await this.request(s,t,e,i);n.data=await this.result.handle(t,n.data),a=n}}return await Te(this.entity,"compute",t,a.data,i),a}async create(t,e,s){if(this.isLocalMode)return this.createTemp(t,this.createEntity(e));const i=this.calcPath(t),a=await this.app.net.post(i,e,s);return a.data=await this.result.handle(t,a.data),a}async remove(t,e){if(this.isLocalMode)return this.removeTemp(t,e);const s=this.calcPath(t);return await this.app.net.delete("".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]),e)}async update(t,e,s={}){if(this.isLocalMode)return this.updateTemp(t,this.createEntity(e));const i=this.calcPath(t),a=await this.app.net.put("".concat(i,"/").concat(t[this.entity.codeName.toLowerCase()]),e,s);return a.data=await this.result.handle(t,a.data),a}async get(t,e={}){if(this.isLocalMode)return this.getTemp(t,e);const s=this.calcPath(t),i=await this.app.net.get("".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]),e);return i.data=await this.result.handle(t,i.data),i}async getDraft(t,e){if(this.isLocalMode)return this.getDraftTemp(t,e);const s=this.calcPath(t),i=await this.app.net.get("".concat(s,"/getdraft"),e);return i.data=await this.result.handle(t,i.data),i}async createTemp(t,e){try{const s=await this.getService(),i=await s.local.add(t,this.createEntity(e));return new n(i)}catch(t){return new n(t,500)}}async getDraftTemp(t,e){try{const t=this.createEntity({});return t?new n(t):new n(t,500)}catch(t){return new n(t,500)}}async removeTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const s=(await this.getService()).local.delete(t,e);return s?new n(s):new n(s,500)}catch(t){return new n(t,500)}}async updateTemp(t,e){try{const s=(await this.getService()).local.update(t,this.createEntity(e));return s?new n(s):new n(s,500)}catch(t){return new n(t,500)}}async getTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const s=(await this.getService()).local.get(t,e);return s?new n(s):new n(s,500)}catch(t){return new n(t,500)}}async removeBatchTemp(t,e){return new n(!0)}},Ce=class extends ie{async exec(t,e,s){if(this.isLocalMode){const s=await this.searchLocal(null,new $t(t,e));return new n(s,200)}let a;switch(this.method.dataSetType){case"INDEXDE":case"CODELIST":a=await this.fetchCodeListSet(t,s);break;case"REMOTE":{const i=this.calcPath(t);a=await this.request(i,t,e,s)}break;default:throw new i(this.method,"数据来源类型".concat(this.method.dataSetType,"暂未支持"))}const r=a.data||[];return a.data=r.map((t=>this.createEntity(t))),a.data.length&&await Promise.all(a.data.map((e=>Te(this.entity,"compute",t,e,s)))),a}async selectLocal(t,e={}){let s=(await this.getService()).local.getList(t);s=y(s,"srfordervalue");const i={},a={},n={},r={};e.srfkey&&(i.srfkey=R(e.srfkey),delete e.srfkey);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const s=e[t];null==s?(a[t]=R(null),n[t]=R(void 0),r[t]=R("")):i[t]=R(s)}if(!V(i)){const t=M(i),e=M(a),o=M(n),c=M(r);s=s.filter((s=>{if(V(a)){if(t(s))return!0}else if(t(s)&&(e(s)||o(s)||c(s)))return!0;return!1}))}return s.map((t=>t.clone()))}async searchLocal(t,e,s=this.entity.quickSearchAppDEFieldIds){const i=await this.getService();let a=[];t?(a=i.local.getList(e.context),a.length>0&&(a=a.filter((s=>t.test(s,e))))):(a=await this.selectLocal(e.context),a.length>0&&e.query&&""!==e.query&&s&&(a=a.filter((t=>{const i=new RegExp(e.query);for(let e=0;e<s.length;e+=1){const a=t[s[e]];if(i.test(a))return!0}return!1})))),C(e.sortField)||V(e.sortField)||(a="DESC"===e.sortMode?v(a,e.sortField):y(a,e.sortField));const{page:n,size:r}=e,o=n*r,c=(n+1)*r-1;return a.slice(o,c).map((t=>L(t)))}async fetchCodeListSet(t,e){const{appCodeListId:i}=this.method;if(!i)throw new s(this.method,"没有指定数据来源代码表");const a=await this.app.codeList.get(i,t,e),{keyAppDEFieldId:r,majorAppDEFieldId:o}=this.entity,c=a.map((t=>({[r]:t.value,[o]:t.text})));return new n(c,200)}},_e=t("DEService",class{constructor(t){this.model=t,this.methodMap=new Map,this.local=new Kt,this.wf=new Zt(t),this.file=new class{constructor(t){this.model=t}exportData(t,e,s,i){const a=qt(s,this.model),n="".concat(a,"/").concat(this.model.codeName2.toLowerCase(),"/exportdata/").concat(e.toLowerCase(),"/?srfexporttag=").concat(t.codeName);return ibiz.net.request(n,{method:"post",data:i,responseType:"blob"})}}(t)}getMethod(t){if(this.methodMap.has(t))return this.methodMap.get(t);const e=$(this.model.appDEMethods,t);let s=null;switch(e.methodType){case"DEACTION":s=new be(this.model,e);break;case"FETCH":case"FETCHTEMP":s=new Ce(this.model,e);break;default:throw new i(e,"未支持的服务方法类型: ".concat(e.methodType))}return this.methodMap.set(t,s),s}exec(t,s,i={},a={}){const n=this.getMethod(t);if(n)return n.exec(s,i,a);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}}),Ve=t("ControlVO",class t{get srfuf(){return C(this.$origin.srfuf)?this.srfkey?1:0:this.$origin.srfuf}get srfkey(){return this.$origin.srfkey}get srfmajortext(){return this.$origin.srfmajortext}get srfdeid(){return this.$origin.srfdeid}get srfdecodename(){return this.$origin.srfdecodename}get srfkeyfile(){return this.$origin.srfkeyfile}get srfmajorfile(){return this.$origin.srfmajorfile}constructor(t={},e=new Map){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(((t,e)=>{const s=t.dataKey;this.linkProperty(e,s,t.isOriginField)})),Object.keys(t).forEach((t=>{Object.prototype.hasOwnProperty.call(this,t)||this.linkProperty(t,t)}))}linkProperty(t,e,s=!0){"srfuf"!==t&&(s||Object.prototype.hasOwnProperty.call(this.$origin,t)?Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return this.$origin[e]},set(t){this.$origin[e]=t}}):Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:null}))}getOrigin(){return this.$origin}setOrigin(e){this.$origin=e instanceof t?e.getOrigin():e}clone(){const e=L(this.$origin),s=new t(e,this.$dataUIMap);return Object.keys(this).forEach((t=>{s[t]=this[t]})),s}}),Le=t("ControlService",class{constructor(t){this.dataUIMap=new Map,this.model=t}async init(t){this.app=ibiz.hub.getApp(null==t?void 0:t.srfappid),this.initUIDataMap()}initUIDataMap(){}async exec(t,e,s={},i={}){return await this.app.deService.exec(this.model.appDataEntityId,t,e,s,i)}handleResponse(t){return t}toUIData(t){return new Ve(t,this.dataUIMap)}}),Re=(t("MDControlService",class extends Le{async fetch(t,e={}){var s;const i=(null==(s=this.model.fetchControlAction)?void 0:s.appDEMethodId)||"fetchdefault";let a=await this.exec(i,t,e);return a=this.handleResponse(a),a}async get(t,e={}){var s;const i=(null==(s=this.model.getControlAction)?void 0:s.appDEMethodId)||"get";let a=await this.exec(i,t,void 0,e);return a=this.handleResponse(a),a}async getDraft(t,e={}){var s;const i=(null==(s=this.model.getDraftControlAction)?void 0:s.appDEMethodId)||"getdraft";let a=await this.exec(i,t,void 0,e);return a=this.handleResponse(a),a}async remove(t,e={}){var s;const i=(null==(s=this.model.removeControlAction)?void 0:s.appDEMethodId)||"remove";return await this.exec(i,t,void 0,e)}async create(t,e){var s;const i=(null==(s=this.model.createControlAction)?void 0:s.appDEMethodId)||"create";let a=await this.exec(i,t,e.getOrigin());return a=this.handleResponse(a),a}async update(t,e){var s;const i=(null==(s=this.model.updateControlAction)?void 0:s.appDEMethodId)||"update";let a=await this.exec(i,t,e.getOrigin());return a=this.handleResponse(a),a}async exportData(t,s,i={}){throw new e("未实现")}handleResponse(t){const e=super.handleResponse(t);return e.headers&&(e.headers["x-page"]&&(e.page=Number(e.headers["x-page"])),e.headers["x-per-page"]&&(e.size=Number(e.headers["x-per-page"])),e.headers["x-total"]&&(e.total=Number(e.headers["x-total"]))),e.ok&&(I(e.data)?e.data=e.data.map((t=>this.toUIData(t))):e.data=this.toUIData(e.data)),e}}),t("DeAuthorityService",class{constructor(t){this.entityModel=t}async calcByDataAccessAction(t,e){if(e.srfopprivs&&!e.srfopprivs.includes(t))return!1;return!!await this.calcByDeMainState(t,e)}async calcByDeMainState(t,e){let s=!0;const i=this.entityModel;if(!i.enableDEMainState)return ibiz.log.debug("".concat(i.codeName,"实体不存在或者为启用主状态,返回true")),s;ibiz.log.debug("操作标识".concat(t,"主状态计算开始"),e,i);const a=Q(i,e);if(a){ibiz.log.debug("匹配主状态",a);const e=J(a,i);ibiz.log.debug("允许的主状态权限集合",e),s=e.includes(t)}else ibiz.log.debug("没匹配主状态,返回false"),s=!1;return ibiz.log.debug("操作标识".concat(t,"权限计算结束:").concat(s)),s}})),Me=t("AuthorityService",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map,this.resCodes=[],this.enablePermission=!1}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const s=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!s)throw new e("未找到应用实体[".concat(t,"]"));const i=this.constructorCache.get(t);let a;a=i?await i(s):new Re(s),this.cache.set(t,a)}return this.cache.get(t)}async init(t=ibiz.appData){if(!t)throw new e("没有appData数据");t.unires&&(this.resCodes=t.unires),!0===t.enablepermissionvalid&&ibiz.env.enablePermission&&(this.enablePermission=!0)}calcByResCode(t){return!this.enablePermission||this.resCodes.includes(t)}async calcByDataAccessAction(t,e,s){if(this.enablePermission){const e=await ibiz.hub.getApp(this.appModel.appId),i=await e.getOPPriv(t,s);if(this.enablePermission&&(null==i?void 0:i.mapSysUniResCode)&&!this.calcByResCode(i.mapSysUniResCode))return!1}if(e&&s){return(await this.getService(s)).calcByDataAccessAction(t,e)}return!0}}),Oe=t("V7AuthService",class{async login(t,e){try{const s=await ibiz.net.post("/v7/login",{loginname:t,password:e}),{data:i}=s;if(i&&i.token){D(o.TOKEN,i.token,0,!0);const t=(new Date).getTime()+1e3*(i.expirein||7199);D(o.TOKEN_EXPIRES,"".concat(t),0,!0)}return!0}catch(t){ibiz.notification.error({title:"登录失败",desc:t.message||""})}return!1}async logout(){try{return await ibiz.net.get("/v7/logout"),A(o.TOKEN),A(o.TOKEN_EXPIRES),!0}catch(t){ibiz.notification.error({title:"登出失败",desc:t.message||""})}return!1}}),Ne=t("TreeNodeData",class{constructor(t,e,s){this.leaf=!1,this.leaf=!0===s.leaf,this.parent=e,this.parent&&(this.context={...this.parent.context}),s.navContext&&(this.context=Object.assign(this.context||{},s.navContext)),s.navParams&&(this.params={...s.navParams}),this.nodeId=t.id}calcIcon(t){const{sysImage:e}=t,s={};return e&&(e.cssClass&&(s.cssClass=e.cssClass),e.imagePath&&(s.imagePath=e.imagePath)),Object.values(s).length>0?s:void 0}}),We=(t("TreeCodeListNodeData",class extends Ne{constructor(t,e,s){super(t,e,s);const{data:i}=s;if(this.deData=i,this.text=i.text,this.value=i.value,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(this.value):t.id+this.value,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=Z(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:this.value})}this.srfkey=this.value,this.srfmajortext=this.text,this.icon=this.calcIcon(t)}}),t("TreeDataSetNodeData",class extends Ne{constructor(t,e,s){super(t,e,s);const{data:i}=s;if(this.deData=i,this.text=i.srfmajortext,this.value=i.srfkey,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(i.srfkey):t.id+i.srfkey,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=Z(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:i.srfkey})}this.srfkey=this.deData.srfkey,this.srfmajortext=this.deData.srfmajortext,this.icon=this.calcIcon(t),this.textHtml=this.calcTextHtml(t)}calcIcon(t){const e=super.calcIcon(t)||{},{iconAppDEFieldId:s,detreeNodeDataItems:i}=t;s&&this.deData[s]&&(e.imagePath=this.deData[s]),e&&(this.icon=e);const a=null==i?void 0:i.find((t=>"icon"===t.id));return a&&(e.htmlStr=this.calcDataItemScript(a)),Object.values(e).length>0?e:void 0}calcDataItemScript(t){if(t.customCode&&t.scriptCode)return ft.execScriptFn({data:this.deData},t.scriptCode,{isAsync:!1})}calcTextHtml(t){let e;const{detreeNodeDataItems:s}=t,i=null==s?void 0:s.find((t=>"text"===t.id));return i&&(e=this.calcDataItemScript(i)),e}}),t("TreeStaticNodeData",class extends Ne{constructor(t,e,s){var i,a;super(t,e,s);const n="root"===t.nodeValue?void 0:t.nodeValue;if(this.id=e?"".concat(e.id,":").concat(t.id):t.id,this.id=this.id.toLowerCase(),this.text=t.text,this.value=n,e&&s.parentValueLevel){let t=e;for(let e=1;e<s.parentValueLevel;e++)t=null==t?void 0:t.parent;(null==t?void 0:t.deData)&&(this.deData=t.deData),this.value=n||(null==t?void 0:t.value)}this.srfkey=(null==(i=this.deData)?void 0:i.srfkey)||this.value,this.srfmajortext=(null==(a=this.deData)?void 0:a.srfmajortext)||this.text,this.icon=this.calcIcon(t)}}),t("UIMapField",class{constructor(t,e,s={}){this.isOriginField=!1,this.isRequestNeed=!0,this.uiKey=t,this.dataKey=e,C(s.isOriginField)||(this.isOriginField=s.isOriginField)}}),t("CalendarItemData",class{constructor(t,e){this.model=t,this.data=e}get deData(){return this.data}get navId(){return"".concat(this.itemType,"@").concat(this.id)}get itemType(){return this.model.itemType}get bkColor(){const t=this.model.bkcolorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.bkcolor}get beginTime(){const t=this.model.beginTimeAppDEFieldId;return t?this.data[t]:void 0}get color(){const t=this.model.colorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.color}get content(){const t=this.model.contentAppDEFieldId;return t?this.data[t]:void 0}get endTime(){const t=this.model.endTimeAppDEFieldId;return t?this.data[t]:void 0}get icon(){const t=this.model.iconAppDEFieldId;return t?this.data[t]:void 0}get id(){const t=this.model.idAppDEFieldId;return t&&this.data[t]?this.data[t]:this.data.srfkey}get level(){const t=this.model.levelAppDEFieldId;return t?this.data[t]:void 0}get tag2(){const t=this.model.tag2AppDEFieldId;return t?this.data[t]:void 0}get tag(){const t=this.model.tagAppDEFieldId;return t?this.data[t]:void 0}get text(){const t=this.model.textAppDEFieldId;return t?this.data[t]:void 0}get tips(){const t=this.model.tipsAppDEFieldId;return t?this.data[t]:void 0}}),t("DEServiceUtil",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const s=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!s)throw new e("未找到应用实体[".concat(t,"]"));const i=this.constructorCache.get(t);let a;a=i?await i(s):new _e(s),this.cache.set(t,a)}return this.cache.get(t)}clearTempCache(t){this.cache.forEach((e=>{e.local.clear(t)}))}async exec(t,e,s,i,a){return(await this.getService(t)).exec(e,s,i,a)}})),xe=t("Application",class{constructor(t){this.model=t,this.deName2DeCodeName=new Map,this.net=new c({baseURL:"".concat(ibiz.env.baseUrl,"/").concat(t.appId)}),this.deService=new We(t),this.codeList=new Qt(t),this.authority=new Me(t)}get appId(){return this.model.appId}async init(){await this.authority.init(),await this.loadAppModelStyle()}async loadAppModelStyle(){await this.net.get("".concat(ibiz.env.remoteModelUrl,"/PSSYSAPP.json.css")).then((t=>{const e=document.createElement("style");if(e.setAttribute("type","text/css"),t.request&&t.request.responseURL){const s=new URL(t.request.responseURL);e.id=s.pathname}e.innerHTML=t.data,document.head.appendChild(e)})).catch((t=>{ibiz.log.error("应用[".concat(this.appId,"]模型全局样式加载失败:").concat(t.message))}))}getAppFunc(t){return(this.model.appFuncs||[]).find((e=>e.id===t))||null}async getUIAction(t){const[,e]=t.split("@");if(e){const s=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUIActions.find((e=>e.id===t));if(s)return s}return this.model.appDEUIActions.find((e=>e.id===t))}async getOPPriv(t,e){var s,i;let a=null==(s=this.model.deopprivs)?void 0:s.find((e=>e.name===t));if(!a&&e){a=null==(i=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).deopprivs)?void 0:i.find((e=>e.name===t))}return a}async getDEUILogic(t,e){return(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUILogics.find((e=>e.id===t))}}),Se=t("FormNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Se||{})),Fe=t("GridNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Fe||{})),Be=t("PanelNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Be||{})),ke=t("Counter",class{constructor(t){this.callback=t,this.count=0,this.state="Unused",this.reusable=!0}increment(){return"Used"===this.state||(this.count+=1),this.count}decrement(t){if("Used"!==this.state){if(0===this.count)throw new e("错误的调用!decrement不能对count为0调用");this.count-=1,0===this.count&&(t?t():this.callback&&this.callback(),this.reusable||(this.state="Used"))}}destroy(){this.callback=void 0}}),Ue=t("LoadingState",class{constructor(){this.isLoading=!1,this.counter=new ke(l)}begin(){this.isLoading=!0,this.counter.increment()}end(){this.counter.decrement((()=>{this.isLoading=!1}))}}),ze=t("CTXState",class{}),Ge=t("CTX",class{constructor(t){this.parent=t,this.evt=new f(3e3),this.controllersMap=new Map,this.state=new ze}async init(t){this.view=t,this.registerController(t.model.name,t)}destroy(){this.controllersMap.clear(),this.view=null,this.state=null}async setState(t){Object.assign(this.state,t)}startLoading(){this.view.startLoading()}endLoading(){this.view.endLoading()}registerController(t,e){this.controllersMap.set(t,e),this.evt.emit("onRegister",t,e)}getController(t,e=!1){return this.controllersMap.has(t)?this.controllersMap.get(t):this.parent&&e?this.parent.getController(t):void 0}getTopView(){return this.parent?2===this.view.modal.routeDepth?this.view:this.parent.getTopView():this.view}}),je=t("ActivityCounter",class extends ke{constructor(){super(...arguments),this.reusable=!1,this.registration=new Map}enroll(t){"Unused"!==this.state||this.registration.has(t)||(this.registration.set(t,!1),this.increment())}attend(t){this.registration.has(t)&&!1===this.registration.get(t)&&(this.registration.set(t,!0),this.decrement())}}),Xe=(t("UIActionButtonState",class{constructor(t,e,s){this.disabled=!1,this.visible=!0,this.loading=!1,this.permitted=!0,this.noPermissionHidden=!0,this.noDataDisabled=!1,this.isInit=!1,this.name=t,this.uiActionId=s,this.appId=e}async init(){if(!this.uiActionId)return void(this.isInit=!0);const t=await it(this.uiActionId);if([,this.appDeName]=this.uiActionId.split("@"),!t)return;const{dataAccessAction:e,noPrivDisplayMode:s,actionTarget:i,uiactionMode:a,uiactionTag:n}=t;this.dataAccessAction=e,1===s?this.noPermissionHidden=!1:6===s&&(this.visible=!1),(i&&"NONE"!==i||"SYS"===a&&["Save","SaveAndExit","SaveAndNew","Edit","Remove","RemoveAndExit"].includes(n))&&(this.noDataDisabled=!0),this.isInit=!0}async calcPermission(t,e){if(!this.dataAccessAction)return;const s=await ibiz.hub.getApp(this.appId);this.appDeName&&e&&!e.includes(this.appDeName)&&ibiz.log.warn("".concat(this.uiActionId,"界面行为的实体").concat(this.appDeName,"和数据的实体").concat(e,"不一致")),this.permitted=await s.authority.calcByDataAccessAction(this.dataAccessAction,t,e)}async update(t,e){this.isInit||await this.init(),await this.calcPermission(t,e),this.permitted?(this.visible=!0,this.disabled=this.noDataDisabled&&!t):(this.disabled=!0,this.visible=!this.noPermissionHidden)}}),t("ButtonContainerState",class{constructor(){Object.defineProperty(this,"children",{enumerable:!1,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:()=>0!==this.children.length&&!!this.children.find((t=>t.visible))})}addState(t,e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e}),this.children.push(e)}setLoading(t){this.children.forEach((e=>{e.setLoading?e.setLoading(t):e.loading=!!t&&e.name===t}))}async update(t,e){await Promise.all(this.children.map((s=>s.update(t,e))))}}),t("QXEventEx",class extends f{constructor(){super(...arguments),this.anyEventFns=[]}onAll(t){this.anyEventFns.includes(t)||this.anyEventFns.push(t)}emit(t,...e){super.emit(t,...e),this.anyEventFns.forEach((s=>{s(t,...e)}))}async asyncEmit(t,...e){const s=super.asyncEmit(t,...e),i=this.anyEventFns.map((s=>s(t,...e))),a=Promise.all(i),n=await s,r=await a;return n.concat(...r)}reset(){super.reset(),P(this.anyEventFns)}})),Ke=t("ControllerEvent",class{constructor(t){this.getBaseArgs=t,this.evt=new Xe}async emit(t,e){await this.evt.asyncEmit(t,{...this.getBaseArgs(),eventName:t,...e||{}})}on(t,e){this.evt.on(t,e)}onAll(t){this.evt.onAll(t)}destroy(){this.getBaseArgs=void 0,this.evt.reset()}});var He="__self",Ye=t("BaseController",class{constructor(t,e,s,i){this.model=t,this.context=e,this.params=s,this.ctx=i,this.state={},this.name="",this.evt=new Ke(this.getEventArgs.bind(this)),this.mountCounter=new je(this.mounted.bind(this)),this.childNames=[],this.name=t.name||t.id,this.initState()}get _evt(){return this.evt}initState(){this.state.isCreated=!1,this.state.isMounted=!1}getEventArgs(){return{context:this.context,params:this.params,data:[],targetName:this.model.name,view:this.ctx.view}}async created(){this.mountCounter.enroll(He),await this.onCreated(),this.state.isCreated=!0,this.force((()=>{this.mountSelf()})),ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onCreated")),this._evt.emit("onCreated",void 0)}async onCreated(){this.ctx.evt.on("onForecast",(t=>{this.childNames.includes(t)&&this.mountCounter.enroll(t)})),this.ctx.evt.on("onRegister",((t,e)=>{this.childNames.includes(t)&&e.evt.on("onMounted",(()=>{this.mountCounter.attend(t)}))}))}async mountSelf(){this.mountCounter.registration.get(He)||this.mountCounter.attend(He)}async mounted(){await this.onMounted(),this.state.isMounted=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onMounted")),this._evt.emit("onMounted",void 0)}async onMounted(){}async destroyed(){await this.onDestroyed(),ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onDestroyed")),await this._evt.emit("onDestroyed",void 0),this.evt.destroy()}async onDestroyed(){}force(t){}getController(t,e=!1){return this.ctx.getController(t,e)}getTopView(){return this.ctx.getTopView()}listenNewController(t){this.ctx.evt.on("onRegister",t)}}),qe=t("CONTROL_PROVIDER_PREFIX","CONTROL");function $e(t){return ibiz.register.get("".concat(qe,"_").concat(t))}async function Qe(t){let e;const{controlType:s,controlStyle:i}=t;if(i&&"DEFAULT"!==i){e=$e("".concat(s,"_").concat(i)),e||ibiz.log.error("找不到部件类型:[".concat(s,"]的部件样式:[").concat(i,"]对应的适配器"),t)}return e||(e=$e(s)),e||ibiz.log.error("找不到部件类型".concat(s,"对应的适配器")),e}var Je=t("EDITOR_PROVIDER_PREFIX","EDITOR");function Ze(t){return ibiz.register.get("".concat(Je,"_").concat(t))}var ts=t("FORMDETAIL_PROVIDER_PREFIX","FORMDETAIL");var es=t("GRIDCOLUMN_PROVIDER_PREFIX","GRIDCOLUMN");var ss=t("PANELITEM_PROVIDER_PREFIX","PANELITEM");function is(t){return ibiz.register.get("".concat(ss,"_").concat(t.toUpperCase()))}var as=t("UIACTION_PROVIDER_PREFIX","UIACTION");function ns(t,e){ibiz.register.register("".concat(as,"_").concat(t),e)}async function rs(t){let s;const{uiactionMode:i}=t;var a;if(s||(a=i,s=ibiz.register.get("".concat(as,"_").concat(a))),!s)throw new e("找不界面行为模式".concat(i,"对应的适配器"));return s}var os=t("VIEW_PROVIDER_PREFIX","VIEW");function cs(t){return ibiz.register.get("".concat(os,"_").concat(t))}var ls=t("PORTLET_PROVIDER_PREFIX","PORTLET");var ds=t("ViewController",class extends Ye{constructor(t,e,s,i){super(ibiz.util.layoutPanel.fill(t),a.create({},e),s||{},new Ge(i)),this.session={},this.modal=new _t({}),this.providers={},this.engines=[],this.slotProps={},this.counters={},this.viewLoading=new Ue,this.isCloseView=!1,this._isActive=!0,i&&i.registerController(this.model.name,this),this.ctx.init(this),this.initEngines()}get _evt(){return this.evt}get parentView(){var t;return null==(t=this.ctx.parent)?void 0:t.view}get isActive(){return this._isActive}onActivated(){this._isActive=!0,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")激活"))}onDeactivated(){this._isActive=!1,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")暂停"))}initEngines(){const t=ot(this.model);if(t.length)t.forEach((t=>{const e=ibiz.engine.getEngine(t,this);e&&this.engines.push(e)}));else{const t=ibiz.engine.getEngine({engineCat:"VIEW",engineType:this.model.viewType},this);t&&this.engines.push(t)}}async initCounters(){const t=this.model.viewLayoutPanel,{appCounterRefs:e}=t;if(e&&e.length>0)try{await Promise.all(e.map((async t=>{const e=await Jt.getCounterByRef(t,this.context);this.counters[t.id]=e})))}catch(t){console.error(t)}}initState(){super.initState(),this.state.isLoading=!1,this.state.caption=this.model.caption,this.state.srfactiveviewdata=null}async onCreated(){await super.onCreated(),this.modal.hooks.beforeDismiss.tapPromise((async t=>{await this._evt.emit("onCloseView",{...t})})),this._evt.emit("onViewInfoChange",{caption:this.model.caption,title:this.model.title}),this.handleContextParams();const t=this.model.viewLayoutPanel;this.childNames.push(t.name);const e=await Qe(t);this.providers[t.name]=e;const s=nt(this.model);s&&await Promise.all(s.map((async t=>{const e=await Qe(t);this.providers[t.name||t.id]=e}))),await this.initCounters();const i=rt(this.model);i.length&&(this.scheduler=ibiz.scheduler.createViewScheduler(i),this.scheduler.defaultParamsCb=()=>this.getEventArgs(),this.scheduler.hasViewEventTrigger&&this.evt.onAll(((t,e)=>{this.scheduler.triggerViewEvent(e)}))),this.engines.length&&await Promise.all(this.engines.map((t=>t.onCreated())))}async onMounted(){var t;await super.onMounted(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onMounted()))),null==(t=this.scheduler)||t.startTimerTrigger()}async onDestroyed(){await super.onDestroyed(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onDestroyed()))),this.ctx.destroy(),this.context.destroy(),this.engines=[],this.scheduler&&this.scheduler.destroy(),ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")销毁"))}handleContextParams(){this.context.srfappid=this.model.appId,(C(this.context.srfsessionid)||V(this.context.srfsessionid))&&(this.context.srfsessionid=w());const t=this.model.appViewNavContexts;let e={};E(t)&&(e=X(t,this.context,this.params)),Object.assign(this.context,e);const s=this.model.appViewNavParams;let i={};E(s)&&(i=X(s,this.context,this.params)),Object.assign(this.params,i),this.state.isMounted&&this.callUIAction("Refresh")}async call(t,e){let s;for(const i of this.engines)if(s=await i.call(t,e),void 0!==s)break;return s}async callUIAction(t,s){const i=this.call(t,s);if(void 0===i)throw new e("没有引擎支持预置界面行为".concat(t));return i}async closeView(t={ok:!1,data:[]}){await this.modal.dismiss(t)}startLoading(){this.viewLoading.begin(),this.state.isLoading=this.viewLoading.isLoading}endLoading(){this.viewLoading.end(),this.state.isLoading=this.viewLoading.isLoading}setLayoutPanel(t){var e;this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)})),(null==(e=this.scheduler)?void 0:e.hasControlEventTrigger)&&t.evt.on("onControlEvent",(t=>{this.scheduler.triggerControlEvent(t.triggerControlName,t.triggerEvent)}))}}),hs=(t("MobViewController",class extends ds{}),t("EditorController",class{constructor(t,e){this.placeHolder="",this.editorParams={},this.model=t,this.parent=e,this.context=e.context,this.params=e.params}get readonly(){return!!this.model.readOnly}async init(){await this.onInit()}async onInit(){this.model.placeHolder&&(this.placeHolder=this.model.placeHolder),this.model.editorParams&&Object.keys(this.model.editorParams).forEach((t=>{this.editorParams[t.toLowerCase()]=this.model.editorParams[t]}))}handlePublicParams(t,e,s){const{navigateContexts:i,navigateParams:a}=this.model;let n={};i&&t&&(n=X(i,e,s,t));const r=Object.assign(e.clone(),n);let o={};a&&t&&(o=X(a,e,s,t));return{context:r,params:{...s,...o}}}toObj(t){if(!t)return;return new Function("return (".concat(t,");"))()}toBoolean(t){return Object.is("true",t)}})),us=(t("CodeListEditorController",class extends hs{async loadCodeList(t){const{context:e,params:i}=this.handlePublicParams(t,this.context,this.params);if(this.model.appCodeListId){const t=await ibiz.hub.getApp(this.context.srfappid);let s=[];return s=await t.codeList.get(this.model.appCodeListId,e,i),s}throw new s(this.model,"请配置代码表")}}),t("ControlController",class extends Ye{constructor(t,e,s,i){super(t,e,s,i),this.providers={},this.registerToCtx();const a=ibiz.util.layoutPanel.get("".concat(t.controlType,"_DEFAULT"));a&&(this.controlPanel=a)}get _evt(){return this.evt}get view(){return this.ctx.view}registerToCtx(){this.ctx.registerController(this.model.name||this.model.id,this)}getEventArgs(){return{...super.getEventArgs(),data:this.getData()||[],ctrl:this}}initState(){super.initState(),this.state.isLoading=!1}async onCreated(){if(await super.onCreated(),this.controlPanel){this.childNames.push(this.controlPanel.name);const t=await Qe(this.controlPanel);this.providers[this.controlPanel.name]=t}this.initControlScheduler(this.model.controlLogics)}async onDestroyed(){await super.onDestroyed(),this.scheduler&&this.scheduler.destroy()}getControlType(){return this.model.controlType}getData(){return null}async startLoading(){this.state.isLoading=!0,this.ctx.startLoading()}async endLoading(){this.state.isLoading=!1,this.ctx.endLoading()}handlerAbilityParams(t){return{context:this.context.clone(),params:{...this.params},data:(null==t?void 0:t.data)||this.getData()||[]}}setLayoutPanel(t){this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)}))}initControlScheduler(t=[]){0!==t.length&&(this.scheduler=ibiz.scheduler.createControlScheduler(t),this.scheduler.defaultParamsCb=()=>this.getEventArgs())}})),ps=(t("MDControlController",class extends us{get _evt(){return this.evt}initState(){super.initState(),this.state.items=[],this.state.selectedData=[],this.state.searchParams={},this.state.noSort=!1,this.state.sortQuery="",this.state.curPage=1,this.state.size=20,this.state.total=0,this.state.isLoaded=!1,this.state.singleSelect=!0,this.state.mdctrlActiveMode=0,this.state.groups=[]}async onCreated(){await super.onCreated(),this.setSort()}setSort(t,e){t&&e&&(this.state.sortQuery="".concat(t,",").concat(e))}async getFetchParams(t){const{curPage:e,size:s,sortQuery:i,noSort:a}=this.state,n={...this.params};return s&&(n.page=e-1,n.size=s),!a&&i&&(n.sort=i),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),t&&Object.assign(n,t),n}async load(t={}){await this.startLoading();try{const e=!0===t.isInitialLoad,s=!0===t.isLoadMore;e?this.state.curPage=1:s&&(this.state.curPage+=1);const{context:i}=this.handlerAbilityParams(t),a=await this.getFetchParams(null==t?void 0:t.params),n=await this.service.fetch(i,a);"number"==typeof n.total&&(this.state.total=n.total),s?this.state.items.push(...n.data):this.state.items=n.data,await this.afterLoad(t,n.data),this.state.isLoaded=!0,await this._evt.emit("onLoadSuccess",{isInitialLoad:e})}finally{await this.endLoading()}return this.state.items}async afterLoad(t,e){return e}async refresh(){await this.load({isInitialLoad:!1})}async remove(t){const{context:s,params:i,data:a}=this.handlerAbilityParams(t);if(!(null==a?void 0:a.length))throw new e("未选中数据");if(!0!==(null==t?void 0:t.silent)){if(!await ibiz.confirm.error({title:"数据删除",desc:"确认删除数据?"}))return}await this.startLoading();let n=!1;try{const e=Z(this.model.appDataEntityId);await Promise.allSettled(a.map((async t=>{if(0!==t.srfuf){const a=s.clone();a[e]=t.srfkey,await this.service.remove(a,i),n=!0}this.afterRemove(a)}))),!0!==(null==t?void 0:t.silent)&&ibiz.notification.success({desc:"数据[".concat(a.map((t=>t.srfmajortext)).join("、"),"]删除成功!")}),n&&this.refresh()}finally{await this.endLoading()}this.state.selectedData=[],await this._evt.emit("onRemoveSuccess",void 0)}afterRemove(t){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(e,1)}getData(){return this.state.selectedData||[]}setActive(t){return this._evt.emit("onActive",{data:[t]})}setSelection(t){const{selectedData:e}=this.state;d(e,t)||(this.state.selectedData=t,this._evt.emit("onSelectionChange",{data:t}))}async onRowClick(t){const{selectedData:e}=this.state,s=e.filter((e=>e.srfkey!==t.srfkey));s.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(s),1===this.state.mdctrlActiveMode&&await this.setActive(t)}async onDbRowClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}async importData(){}async exportData(t){}}),t("HubController",class{constructor(){this.session={}}login(t,e){return ibiz.auth.login(t,e)}logout(){return ibiz.auth.logout()}})),Es=class{constructor(){this.convert=new class{constructor(){this.appMenu=new class{parse(t){return t}}}},this.controller=new ps,this.appMap=new Map,this.apps=new Map,this.view2appMap=new Map,this.views=new Map,this.dataEntities=new Map,this.config=new class{constructor(){this.view=new class{constructor(){this.viewConfigs=new Map}set(t,e){this.viewConfigs.set(t,e)}async get(t){if(!this.viewConfigs.has(t)){const s=await ibiz.hub.getAppView(t);if(!s)throw new e("视图[".concat(t,"]不存在"));this.set(s.id,{id:s.id,codeName:s.codeName,openMode:s.openMode,width:s.width,height:s.height,appDataEntityId:s.appDataEntityId,redirectView:s.redirectView})}return this.viewConfigs.get(t)}}}},this.defaultAppIndexViewName="Index"}calcAppViewId(t){let e="";if(-1!==t.indexOf(".")){const s=t.split(".");e=s[s.length-1]}else e=t.toLowerCase();return e}registerModelLoaderProvider(t){this.modelLoaderProvider=t}registerApp(t){this.apps.set(t.codeName,t)}registerAppView(t){this.views.set(t.codeName,t)}registerAppDataEntity(t,e=ibiz.env.appId){this.dataEntities.has(e)||this.dataEntities.set(e,new Map);this.dataEntities.get(e).set(t.id,t)}setAppView(t,e=ibiz.env.appId){const s=this.calcAppViewId(t);this.view2appMap.set(s,e)}hasAppView(t){const e=this.calcAppViewId(t);return this.view2appMap.has(e)}async getAppView(t){const s=this.calcAppViewId(t),i=this.view2appMap.get(s)||ibiz.env.appId;if(this.appMap.has(i)||await this.createApp(i),this.views.has(s))return this.views.get(s);if(this.modelLoaderProvider){const t=await this.modelLoaderProvider.getAppView(i,s);return this.registerAppView(t),t}throw new e("视图[".concat(s,"]不存在"))}async getAppDataEntity(t,s=ibiz.env.appId){if(this.dataEntities.has(s)){const e=this.dataEntities.get(s);if(e.has(t))return e.get(t)}if(this.modelLoaderProvider){let e;return e=-1!==t.indexOf(".")?await this.modelLoaderProvider.getAppDataEntity(s,t):await this.modelLoaderProvider.getAppDataEntityByCodeName(s,t),this.registerAppDataEntity(e,s),e}throw new e("未找到应用实体[".concat(t,"]"))}async createApp(t){if(this.appMap.has(t))return this.appMap.get(t);let s;if(this.apps.has(t))s=this.apps.get(t);else{if(!this.modelLoaderProvider)throw new e("未找到应用[".concat(t,"]模型"));s=await this.modelLoaderProvider.getApp(t),this.registerApp(s)}const i=new xe(s);return this.appMap.set(t,i),await i.init(),i}async getAppAsync(t=ibiz.env.appId){return this.createApp(t)}getApp(t){let e=null;return e=t?t instanceof Object?t.id:t:ibiz.env.appId,this.appMap.get(e)}},gs=t("EngineFactory",class{constructor(){this.viewEngines=new Map}register(t,e){this.viewEngines.set(t,e)}unRegister(t){this.viewEngines.delete(t)}getEngine(t,...e){const{engineType:s,engineCat:i}=t,a="".concat(i,"_").concat(s),n=this.viewEngines.get(a);if(n)return n(...e);ibiz.log.error("没有".concat(a,"对应的引擎"),t)}}),ms=t("ViewEngineBase",class{constructor(t){this.view=t,this.initViewState()}get toolbar(){return this.view.getController("toolbar")}get leftToolbar(){return this.view.getController("lefttoolbar")}get rightToolbar(){return this.view.getController("righttoolbar")}get footerToolbar(){return this.view.getController("footertoolbar")}get viewLayoutPanel(){return this.view.layoutPanel}async onCreated(){const{childNames:t}=this.view;t.push("captionbar","toolbar")}async onMounted(){var t,e;const{model:s,childNames:i}=this.view;ibiz.log.debug("".concat(s.id,"的子组件:").concat(i.join(";"),"都已mounted"));if(!this.calcViewHeaderVisible()){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_header;e&&(e.state.visible=!1)}if(ibiz.env.isMob){if(!this.calcViewFooterVisible()){const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.view_footer;t&&(t.state.visible=!1)}}}async onDestroyed(){}async call(t,e){if("GetData"===t)return this.getData()}initViewState(){}getData(){return[]}calcViewHeaderVisible(){var t,e,s,i;let a=!1;const{model:n}=this.view;if(!1===n.showCaptionBar){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_captionbar;e&&(e.state.visible=!1)}else a=!0;if(ibiz.env.isMob){if(this.leftToolbar)a=!0;else{const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.lefttoolbar;t&&(t.state.visible=!1)}if(this.rightToolbar)a=!0;else{const t=null==(s=this.viewLayoutPanel)?void 0:s.panelItems.righttoolbar;t&&(t.state.visible=!1)}}else if(this.toolbar)a=!0;else{const t=null==(i=this.viewLayoutPanel)?void 0:i.panelItems.view_toolbar;t&&(t.state.visible=!1)}return a}calcViewFooterVisible(){let t=!1;return this.footerToolbar&&(t=!0),t}async loadEntityData(){const{appDataEntityId:t}=this.view.model,{evt:s,context:i,params:a}=this.view;if(!t)throw new e("该视图没有实体,无法加载实体数据");const n=ibiz.hub.getApp(i.srfappid),r=await n.deService.exec(t,"get",i,a),{data:o}=r;o&&(this.view.state.srfactiveviewdata=o,s.emit("onDataChange",{actionType:"LOAD",data:[o]}),o.srfkey&&s.emit("onViewInfoChange",{dataInfo:o.srfmajortext||""}))}}),fs=(t("MDViewEngine",class extends ms{get xdataControlName(){return this.view.model.xdataControlName}get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get xdataControl(){return this.view.getController(this.xdataControlName)}async onCreated(){await super.onCreated();const{childNames:t}=this.view;t.push(this.xdataControlName,"searchform","searchbar")}async onMounted(){await super.onMounted();const{model:t}=this.view;this.xdataControl.evt.on("onActive",(async t=>{await this.openData(t)})),this.xdataControl.evt.on("onSelectionChange",(async t=>{var e;null==(e=this.toolbar)||e.calcButtonState(t.data[0],this.xdataControl.model.appDataEntityId)})),this.xdataControl.evt.on("onBeforeLoad",(()=>{this.xdataControl.state.searchParams=this.getSearchParams()})),this.xdataControl.evt.on("onLoadSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"LOAD"})})),this.xdataControl.evt.on("onRemoveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"REMOVE"})})),this.xdataControl.evt.on("onSaveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"SAVE"})}));const e=this.viewLayoutPanel.panelItems.view_searchform;if(e){const s=!!this.searchForm;e.state.keepAlive=s,e.state.visible=s&&!!t.expandSearchForm}this.searchForm&&this.searchForm.evt.on("onSearch",(()=>{this.refresh()})),this.searchBar&&this.searchBar.evt.on("onSearch",(()=>{this.refresh()})),!this.view.state.noLoadDefault&&t.loadDefault&&this.load()}async call(t,e){return"ToggleFilter"===t?(this.toggleFilter(),null):"Edit"===t||"View"===t?(await this.openData(e),null):"New"===t?(await this.newData(e),null):"Remove"===t?(await this.remove(e),null):"Import"===t?(await this.importData(),null):"Refresh"===t?(await this.refresh(),null):"ExportExcel"===t?(await this.exportData(e),null):"Copy"===t?(this.copy(e),null):"load"===t?(this.load(e),null):super.call(t,e)}getData(){return this.xdataControl.getData()}async openData(t){var e,s;const{data:i,event:a}=t,n=(t.context||this.view.context).clone(),r=t.params||this.view.params;n[((null==(e=i[0].srfdecodename)?void 0:e.toLowerCase())||Z(this.xdataControl.model.appDataEntityId)).toLowerCase()]=i[0].srfkey;-1===await(null==(s=this.view.scheduler)?void 0:s.triggerCustom("opendata",{context:n,params:r,data:i,event:a,view:this.view}))&&ibiz.log.warn("视图[".concat(this.view.model.codeName,"],未配置编辑打开视图"))}async newData(t){var e,i,a;const{data:n,event:r,copyMode:o}=t;if(!(null==(i=null==(e=this.view.model.viewLayoutPanel)?void 0:e.appViewLogics)?void 0:i.find((t=>"newdata"===t.id))))throw new s(this.view.model,"缺少newdata的视图逻辑");const c=this.view.context.clone();o&&(c.srfcopymode=!0);if(-1===await(null==(a=this.view.scheduler)?void 0:a.triggerCustom("newdata",{context:c,params:this.view.params,data:n,event:r,view:this.view})))throw new s(this.view.model,"缺少newdata的视图逻辑")}async remove(t){await this.xdataControl.remove(t)}async load(t={}){await this.xdataControl.load({isInitialLoad:!0,...t})}async refresh(){await this.xdataControl.refresh()}getSearchParams(){const t={};if(this.searchForm){const e=this.searchForm.getData()[0],s=Object.entries(e).reduce(((t,[e,s])=>(null!=s&&""!==s&&(t[e]=s),t)),{});Object.assign(t,s)}if(this.searchBar&&this.searchBar.state.query){const e={query:this.searchBar.state.query};Object.assign(t,e)}return t}async importData(){await this.xdataControl.importData()}async exportData(t){await this.xdataControl.exportData(t)}async copy(t){this.newData(Object.assign(t,{copyMode:!0}))}calcViewHeaderVisible(){let t=super.calcViewHeaderVisible();if(this.searchBar)t=!0;else{const t=this.viewLayoutPanel.panelItems.view_searchbar;t&&(t.state.visible=!1)}return t}toggleFilter(){if(this.searchForm){const t=this.viewLayoutPanel.panelItems.view_searchform;t&&(t.state.visible=!t.state.visible)}}}),class{constructor(){this.layoutPanel=new Dt}}),ws=class{},Is=class extends ws{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName.toLowerCase()}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,a){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new s(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=a[this.value]?a[this.value]:e[this.value];return dt(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new s(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return dt(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new i(this.model,"暂未支持条件值类型为[当前时间]");default:return dt(n[this.dstField],this.op,this.value)}}},Ds=class t extends ws{constructor(e){super(),this.model=e;const s=e.deuilogicLinkConds||[];this.conds=s.map((e=>"SINGLE"===e.logicType?new Is(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,i){let a=!0;if(0===this.conds.length)throw new s(this.model,"界面连接条件逻辑组未配置逻辑项");for(let s=0;s<this.conds.length;s++){const n=this.conds[s].test(t,e,i);if("AND"===this.op&&!1===n){a=!1;break}if("OR"===this.op&&!0===n){a=!0;break}}return this.notMode?!a:a}},As=class{constructor(t){this.model=t,this.links=(t.deuilogicLinks||[]).map((t=>new class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const{linkMode:e,deuilogicLinkGroupCond:s}=this.model;0===e&&s&&(this.groupCond=new Ds(s))}async exec(t){const{linkMode:e}=this.model,{context:s,data:a}=t;switch(e||0){case 0:return!this.groupCond||this.groupCond.test(t,s,a&&a.length>0?a[0]:{});case 1:return!0;case 2:throw new i(this.model,"未支持的逻辑连接类型: 异步结束");case 3:throw new i(this.model,"未支持的逻辑连接类型: 异步拒绝");case 9:throw new i(this.model,"未支持的逻辑连接类型: 异常处理");default:throw new i(this.model,"未支持的逻辑连接类型:".concat(e))}}}(t)))}},Ps=class extends As{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:i,dstDEUILogicParamId:a,retDEUILogicParamId:n}=this.model;if(!e)throw new s(this.model,"未指定应用实体");if(!i)throw new s(this.model,"未指定实体行为");const r=t.params[a],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,i,t.context,r,t.viewParams);c.ok&&(t.params[n]=c.data)}},ys=class extends As{async exec(t){const{dstAppDEUIActionId:e,dstDEUILogicParamId:i}=this.model,{data:a,parameters:n}=t;if(!e)throw new s(this.model,"未配置界面行为");let r=[a];if(i){const e=t.params[i];r=e instanceof Array?e:[e]}await Os.execAndResolved(e,{...n,data:r})}},vs=class extends As{async exec(t){}},Ts=class extends As{async exec(t){t.isEndNode=!0;const{returnType:e,rawValue:s,returnParamId:a}=this.model;switch(e){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=s;break;case"LOGICPARAM":t.result=t.params[a];break;default:throw new i(this.model,"暂未支持的结束节点返回值类型: ".concat(e))}}};function bs(t,e){const{srcDEUILogicParamId:s,srcFieldName:a,srcValue:n}=e,r=e.srcValueType||"SRCDLPARAM";let o;switch(r){case"SRCDLPARAM":o=t.params[s];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return n;case"VIEWPARAM":o=t.viewParams;break;case"APPDATA":o=t.context;break;case"ENVPARAM":o=L(ibiz.env);break;default:throw new i(e,"暂未支持源值类型".concat(r))}const c=null==a?void 0:a.toLowerCase();return o&&c&&(o=o[c]),o}var Cs=class extends As{async exec(t){const e=this.model.deuilogicNodeParams;(null==e?void 0:e.length)&&await Promise.all(e.map((e=>{if("SETPARAMVALUE"===e.paramAction)return this.setParamValue(e,t);throw new i(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))})))}setParamValue(t,e){const{dstFieldName:s,dstDEUILogicParamId:i}=t,a=null==s?void 0:s.toLowerCase(),n=bs(e,t);a?e.params[i][a]=n:e.params[i]=n}},_s=class extends As{async exec(t){t.isEndNode=!0;const{invokeMethod:i,invokeCtrlId:a,invokeParamId:n}=this.model;if(!a)throw new s(this.model,"没有配置界面对象");if(!n)throw new s(this.model,"没有配置操作参数");if(!i)throw new s(this.model,"没有配置调用方法");const r=t.params[n];if(!r)throw new e("没有找到操作参数".concat(n));const o=t.params[a];if(!o)throw new e("没有找到界面对象".concat(a));if(!o[i]||!p(o[i]))throw new e("没有找到调用方法".concat(i));await o[i](r)}},Vs=class extends As{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:i}=this.model;if(!e||!i)throw new s(this.model,"缺少目标参数对象或者源参数对象配置");const a=bs(t,this.model);t.params[e]=a}},Ls=class{constructor(t){var e;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.deuilogicNodes)?void 0:e.length))throw new s(t,"界面逻辑没有配置逻辑节点");t.deuilogicNodes.forEach((t=>{const{logicNodeType:e}=t;let s;switch(e){case"BEGIN":s=new vs(t);break;case"END":s=new Ts(t);break;case"DEACTION":s=new Ps(t);break;case"DEUIACTION":s=new ys(t);break;case"PREPAREJSPARAM":s=new Cs(t);break;case"BINDPARAM":s=new Vs(t);break;case"VIEWCTRLINVOKE":s=new _s(t);break;default:throw new i(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,s)})),t.deuilogicParams.forEach((t=>{this.params.set(t.id,new class{constructor(t){this.model=t}calc(t){const e=this.model.id,a=this.model,{context:n,viewParams:r,data:o,parameters:c}=t,l=ibiz.hub.getApp(n.srfappid);if(a.default)t.params[e]=o&&o.length>0?o[0]:{};else if(a.activeContainerParam)t.params[e]=c.ctrl||c.view;else if(a.activeCtrlParam)t.params[e]=c.ctrl;else if(a.ctrlParam){const i=c.view.getController(a.codeName.toLowerCase());if(!i)throw new s(this.model,"视图逻辑初始化参数,未找到".concat(a.codeName,"指定部件对象"));t.params[e]=i}else if(a.activeViewParam)t.params[e]=c.view;else if(a.appGlobalParam)t.params[e]=ibiz.env;else if(a.applicationParam)t.params[e]=l;else if(a.entityListParam)t.params[e]=[];else{if(a.entityPageParam)throw new i(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[e]={};else{if(a.lastReturnParam)throw new i(a,"未支持的逻辑参数类型: 上次调用返回");if(a.navContextParam)t.params[e]=n;else{if(a.navViewParamParam)throw new i(a,"未支持的逻辑参数类型: 视图路由参数");if(a.routeViewSessionParam)throw new i(a,"未支持的逻辑参数类型: 路由视图会话");if(a.simpleListParam)t.params[e]=[];else if(a.simpleParam)t.params[e]={};else if(a.viewNavDataParam)t.params[e]=r;else if(a.viewSessionParam)throw new i(a,"未支持的逻辑参数类型: 当前视图会话")}}}}renew(t){const e=this.model.id,s=this.model;if(s.entityListParam||s.simpleListParam||s.entityPageParam)t.params[e]=[];else{if(!s.simpleParam&&!s.entityParam)throw new i(s,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}}(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.dstDEUILogicNodeId)&&(e.dstNode=this.nodes.get(e.model.dstDEUILogicNodeId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t){const e=new class{constructor(t,e){this.deLogicParams=t,this.parameters=e,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}get context(){return this.parameters.context}get data(){return this.parameters.data}get viewParams(){return this.parameters.params}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}}(this.params,t);this.initLogicParams(e);const{startDEUILogicNodeId:i}=this.model;if(!i||!this.nodes.has(i))throw new s(this.model,"未设置起始节点");{const t=this.nodes.get(i);await this.deepExec(t,e)}return e.isEndNode?e.result:e.params[e.defaultParamName]?e.params[e.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:s}=t;for(let i=0;i<s.length;i++){const a=s[i];if(await a.exec(e)&&a.dstNode&&(await this.deepExec(a.dstNode,e),!1===t.model.parallelOutput))break}}},Rs=new Map;async function Ms(t,s,i){const a=ibiz.hub.getApp(i.context.srfappid),n=await a.getDEUILogic(t,s);if(!n)throw new e("找不到实体".concat(s,"的界面逻辑").concat(t));Rs.has(n)||Rs.set(n,new Ls(n));const r=Rs.get(n);return await r.exec(i),null}var Os=t("UIActionUtil",class{static async exec(t,s){const i=await it(t);if(!i)throw new e("没找到".concat(t,"的界面行为模型"));return(await rs(i)).exec(i,s)}static async execAndResolved(t,e){const s=await this.exec(t,e);s.closeView?e.view.closeView():s.refresh&&await e.view.callUIAction("Refresh")}}),Ns=class{async exec(t,e){const{context:i,params:a,data:n}=e,r={refresh:t.reloadData,closeView:t.closeEditView},{appDEUILogicId:o,appDataEntityId:c,uilogicAttachMode:l}=t;if("REPLACE"===l){if(!o)throw new s(t,"没有配置实体界面逻辑");return await Ms(o,c,e),r}if(!await this.isConfirm(t))return this.returnError(r);const d=await this.execAction(t,e);if(Object.assign(r,d),!0===r.cancel)return this.returnError(r);const h=await this.doNextAction(t,{...e,context:r.nextContext||i,data:r.data||n,params:r.nextParams||a});if(h&&(Object.assign(r,h),!0===h.cancel))return this.returnError(r);if("AFTER"===t.uilogicAttachMode){if(!o)throw new s(t,"没有配置实体界面逻辑");await Ms(o,c,e)}return r}returnError(t){return Object.assign(t,{refresh:!1,closeView:!1})}async isConfirm(t){return!t.enableConfirm||!t.confirmMsg||ibiz.modal.confirm({title:t.confirmMsg})}async doNextAction(t,e){const s=t.nextId;if(s)return Os.exec(s,e)}async handleParams(t,e,s,i){let a=[];const n=Z(t.appDataEntityId);switch(t.actionTarget){case"NONE":a=[];break;case"SINGLEDATA":a=[s[0]];break;case"MULTIDATA":a=s;break;case"MULTIKEY":a=n&&s.length>0?s.map((t=>({[n]:t.srfkey||t[n]}))):[{}];break;case"SINGLEKEY":{const t=s[0]||{};a=n?[{[n]:t.srfkey||t[n]}]:[{}]}}const r=e.clone(),o=[...t.navigateContexts||[]];if(n&&"NONE"!==t.actionTarget){const{valueItem:e,paramItem:s}=t,i=s||n,a=e||"srfkey";o.unshift({key:i,value:a,rawValue:!1})}const c=["MULTIKEY","MULTIDATA"].includes(t.actionTarget)&&s.length>0,l=X(o,e,i,c?q(o,s):s[0]||{});Object.assign(r,l);const d=t.navigateParams;return{resultContext:r,resultData:a,resultParams:X(d,r,i,c?q(d,s):s[0]||{})}}},Ws=t("BackendUIActionProvider",class extends Ns{async execAction(t,e){const{context:i,params:a,data:n,event:r}=e,o={},c=t.appDataEntityId,l=t.appDEMethodId;if(!c||!l)throw new s(t,"未配置实体或实体行为");const{resultContext:d,resultParams:h,resultData:u}=await this.handleParams(t,i,n,a),p={...a,...h},E=t.frontAppViewId;if(E){const t=await ibiz.commands.execute(Lt.TAG,E,d,h,{event:r});if(!(null==t?void 0:t.ok))return o.cancel=!0,o;(null==t?void 0:t.ok)&&t.data&&(0===u.length&&u.push({}),u.forEach((e=>{e.srfactionparam=t.data})))}const g=ibiz.hub.getApp(null==i?void 0:i.srfappid),m=u.map((t=>{var e;return(null==(e=t.getOrigin)?void 0:e.call(t))||t||{}})),f=["MULTIKEY","MULTIDATA"].includes(t.actionTarget),w=await g.deService.exec(c,l,d,f?m:m[0],p);return w.ok&&t.successMsg&&ibiz.message.success(t.successMsg),Object.assign(o,{data:I(w.data)?w.data:[w.data],nextContext:d,nextParams:p}),o}}),xs=t("SysUIActionProvider",class extends Ns{async execAction(t,e){const{view:s}=e,i=t.uiactionTag;if("Exit"===i)return{closeView:!0};return await s.callUIAction(i,e)||{}}}),Ss=t("FrontUIActionProvider",class extends Ns{async execAction(t,e){const{context:a,params:n,data:r,event:o,noWaitRoute:c}=e;let l={};switch(t.frontProcessType){case"OPENHTMLPAGE":{const e=h.fill(t.htmlPageUrl,a,null==r?void 0:r[0]);window.open(e,"_blank");break}case"TOP":case"WIZARD":{const e=t.frontAppViewId;if(!e)throw new s(t,"未配置打开视图");const{resultContext:i,resultParams:d}=await this.handleParams(t,a,r,n),h=await ibiz.commands.execute(Lt.TAG,e,i,d,{event:o,noWaitRoute:c});(null==h?void 0:h.ok)||(l.cancel=!0),(null==h?void 0:h.ok)&&h.data&&(l.data=h.data,l.nextContext=i,l.nextParams={...n,...d});break}case"OTHER":l=this.doOther(t,e);break;default:throw new i(t,"未支持的前台处理模式[".concat(t.frontProcessType,"]"))}return l}doOther(t,e){const{scriptCode:i}=t,{context:a,params:n,data:r,event:o}=e;if(i){return ft.execScriptFn({context:a,params:n,data:r,el:null==o?void 0:o.target},i)||{}}throw new s(t,"自定义类型缺少配置脚本代码")}}),Fs=t("WFWithdrawUIActionProvider",class extends Ns{async execAction(t,e){const{view:s}=e;let i=!1;return await ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})&&s&&(await s.call("WFWithdraw",e),i=!0),{refresh:!1,closeView:i}}});function Bs(){const t=new Ss;ns("FRONT",(()=>t));const e=new Ws;ns("BACKEND",(()=>e));const s=new xs;ns("SYS",(()=>s));const i=new Fs;ns("DEUIACTION_WFWithdraw",(()=>i))}var ks=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.logicType}execute(t){throw new e("Method not implemented.")}destroy(){}},Us=class extends ks{constructor(){super(...arguments),this.initialized=!1}convertScriptArgs(t){return t}init(t,e,s){this.convertScriptArgs=e;const i=this.logic.scriptCode;this.scriptFn=ft.createScriptFn(t,i,s),this.initialized=!0}execute(t){const e=this.convertScriptArgs(t);return this.scriptFn.exec(e)}},zs=class extends ks{execute(t){const{appDEUILogicId:e,appDataEntityId:i}=this.logic;if(!e)throw new s(this.logic,"没有配置实体界面逻辑");Ms(e,i,t)}},Gs=class{constructor(t){this.triggers=new Map,this.executors=new Map,this.hasViewEventTrigger=!1,this.hasControlEventTrigger=!1,this.logics=t,t.forEach((t=>{try{const e=this.createExecutor(t);this.executors.set(t.id,e);const s=this.createTrigger(t);this.triggers.set(t.id,s),s.bindExecutor(e)}catch(t){ibiz.log.error(t.message)}}))}destroy(){this.triggers.forEach((t=>t.destroy())),this.executors.forEach((t=>t.destroy()))}getExecuteParams(t){let e={};return this.defaultParamsCb&&(e=this.defaultParamsCb()),O(t,e)}createTrigger(t){switch(t.triggerType){case"VIEWEVENT":this.hasViewEventTrigger=!0;break;case"CTRLEVENT":this.hasControlEventTrigger=!0}return ibiz.scheduler.triggerFactory.createTrigger(t,this)}createExecutor(t){return ibiz.scheduler.executorFactory.createExecutor(t,this)}getMatchTriggers(t){const e=[];return this.triggers.forEach((s=>{s.match(t)&&e.push(s)})),e}triggerAndExecute(t,e={}){const s=this.getMatchTriggers(t);if(s.length>0){const t=this.getExecuteParams(e);return s.map((e=>e.execute(t)))}}triggerItemDynaLogic(t,e,s){const i={itemName:t,triggerType:e},a=this.triggerAndExecute(i,s);if(null==a?void 0:a.length)return a.pop()}triggerItemVisible(t,e){return this.triggerItemDynaLogic(t,"ITEMVISIBLE",e)}triggerItemEnable(t,e){return this.triggerItemDynaLogic(t,"ITEMENABLE",e)}triggerItemBlank(t,e){return this.triggerItemDynaLogic(t,"ITEMBLANK",e)}startTimerTrigger(){this.getMatchTriggers({triggerType:"TIMER"}).forEach((t=>t.start()))}triggerCustom(t,e){const s=this.triggers.get(t);if(!s)return-1;const i=this.getExecuteParams(e);return s.execute(i)}triggerControlEvent(t,e){const s={ctrlName:t,eventName:e.eventName,triggerType:"CTRLEVENT"};this.triggerAndExecute(s,e)}},js=class extends Gs{constructor(t){super(t.filter((t=>"APPVIEWENGINE"!==t.triggerType)))}},Xs=class extends Gs{constructor(t){t.forEach((t=>{t.triggerType=t.logicTrigger})),super(t)}triggerViewEvent(t){const e={eventName:t.eventName,triggerType:"VIEWEVENT"};this.triggerAndExecute(e,t)}},Ks=class{constructor(){this.executorFactory=new class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createExecutor(t,e){const s=this.constructorMap.get(t.logicType);if(!s)throw new i(t,"逻辑类型 ".concat(t.logicType," 暂未支持!"));return s(t,e)}},this.triggerFactory=new class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createTrigger(t,e){const s=this.constructorMap.get(t.triggerType);if(!s)throw new i(t,"触发器类型 ".concat(t.triggerType," 暂未支持!"));return s(t,e)}}}createViewScheduler(t){return new Xs(t)}createControlScheduler(t){return new js(t)}},Hs=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.triggerType}bindExecutor(t){this.executor=t,"SCRIPT"===this.executor.type&&this.bindScriptExecutor(t)}bindScriptExecutor(t){t.initialized||t.init([],(t=>t),{isAsync:!0,singleRowReturn:!1})}match(t){return t.triggerType===this.type}execute(t){if(this.executor)return this.executor.execute(t);throw new e("".concat(this.logic.id,"没有绑定executor"))}destroy(){this.executor=void 0}},Ys=class extends Hs{},qs=class extends Hs{bindExecutor(t){if(super.bindExecutor(t),"SCRIPT"!==this.executor.type)throw new e("预定义逻辑类型".concat(this.type,"的触发器类型只能是脚本"))}bindScriptExecutor(t){t.init(["context","viewparams","data","env"],(t=>{const{context:e,params:s,data:i}=t;return{context:e,params:s,data:(null==i?void 0:i[0])||{},env:ibiz.env}}),{singleRowReturn:!0,isAsync:!1})}match(t){return super.match(t)&&t.itemName===this.logic.itemName}execute(t){const s=this.executor.execute(t);if("boolean"==typeof s)return s;throw new e("".concat(this.logic.id,"逻辑返回值不是布尔值"))}},$s=class extends Hs{constructor(){super(...arguments),this.timer=null}start(){this.timer=setInterval((()=>{if(!this.scheduler.defaultParamsCb)throw new e("定时器缺少默认参数回调");const t=this.scheduler.defaultParamsCb();this.executor.execute(t)}),this.logic.timer)}destroy(){super.destroy(),this.timer&&clearInterval(this.timer)}},Qs=class extends ks{execute(t){return"opendata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeOpenDataAppUILogic(this.logic.builtinAppUILogic,t):"newdata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeNewDataAppUILogic(this.logic.builtinAppUILogic,t):void 0}async executeOpenDataAppUILogic(t,i){const{context:a,params:n,...r}=i,{data:o}=i;if(!(null==o?void 0:o[0]))throw new e("opendata没有可操作数据!");const c=t.openDataAppView;if(!c)throw new s(t,"opendata视图逻辑没有配置默认打开视图");const l=c.refAppViewId;if(!l)throw new s(t,"opendata视图逻辑的默认打开视图没有实际引用视图");const d=c.navigateContexts||[],h=Object.assign(a,X(d,a,n,o[0]));let u={};const p=c.navigateParams;E(p)&&(u=X(p,n,a,o[0])),await ibiz.commands.execute(Lt.TAG,l,h,u,r)}async executeNewDataAppUILogic(t,e){const{context:a,params:n,...r}=e,{data:o}=e,{enableWizardAdd:c,enableBatchAdd:l,batchAddOnly:d,newDataAppView:h}=t;let u;if(c){if(u=await this.getWizardNewViewRef(t,e),!u)return}else{if(l)throw new i(t,"enableBatchAdd暂未支持");if(d)throw new i(t,"batchAddOnly暂未支持");if(u=h,!u||!u.refAppViewId)throw new s(t,"newdata视图逻辑没有配置默认新建数据视图")}let p={},g={};const m=(null==o?void 0:o[0])||{},f=u.navigateContexts;E(f)&&(p=X(f,a,n,m)),p=Object.assign(a,p);const w=u.navigateParams;E(w)&&(g=X(w,n,a,m)),a.srfcopymode&&(m.srfkey=void 0,g=Object.assign(g,m.$origin)),await ibiz.commands.execute(Lt.TAG,u.refAppViewId,p,g,r)}async getWizardNewViewRef(t,i){var a;const{wizardAppView:n,newDataAppViews:r}=t,{context:o,params:c,...l}=i;if(!n||!n.refAppViewId)throw new s(t,"缺少默认索引实体选择视图");const d=await ibiz.commands.execute(Lt.TAG,n.refAppViewId,o,c,{...l,openMode:"POPUPMODAL"});if(!d.ok)return;const h=null==(a=d.data)?void 0:a[0];if(!h)throw new e("请选中一条数据");const u=h.srfkey,p=null==r?void 0:r.find((t=>t.refMode===u));if(!p)throw new e("没有找到与索引类型".concat(u,"相关的实体的编辑视图"));return p}},Js=class extends Hs{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const s=t.eventNames.split(",");this.listenEventNames=s.map((t=>Tt[t]||t))}match(t){return super.match(t)&&this.listenEventNames.includes(t.eventName)}},Zs=class extends Hs{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const s=t.eventNames.split(",");this.listenEventNames=s.map((t=>Ct[t]||t))}match(t){return super.match(t)&&t.ctrlName===this.logic.ctrlName&&this.listenEventNames.includes(t.eventName)}};var ti=((t,e,s)=>(s=null!=t?x(k(t)):{},((t,e,s,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let a of B(e))U.call(t,a)||a===s||S(t,a,{get:()=>e[a],enumerable:!(i=F(e,a))||i.enumerable});return t})(!e&&t&&t.__esModule?s:S(s,"default",{value:t,enumerable:!0}),t)))(z(),1);t("PluginStaticResource",class{constructor(t){this.styleElementMap=new Map,this.url=new URL(t);const e=ti.default.dirname(this.url.pathname);this.baseDir=e}dir(t){return ti.default.resolve(this.baseDir,t)}async loadStyle(t){const e=t.map((t=>{const e=this.dir(t);return!this.styleElementMap.has(e)&&(this.styleElementMap.set(e,null),new Promise(((t,s)=>{const i=document.createElement("link");i.setAttribute("type","text/css"),i.setAttribute("rel","stylesheet"),i.setAttribute("href",e),i.onload=t,i.onerror=s,document.head.appendChild(i)})))}));try{await Promise.all(e)}catch(t){ibiz.log.error(t)}}}),t("RemotePluginItem",class{constructor(t,e,s){this.tag=t,this.repo=e,this.config=s}})}}}));
2
2
  //# sourceMappingURL=index.system.min.js.map