@farris/ui-vue 1.8.0-alpha.0 → 1.8.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/components/avatar/index.esm.js +138 -1526
  2. package/components/avatar/index.umd.cjs +1 -6
  3. package/components/button/index.css +1 -1
  4. package/components/button/index.esm.js +15951 -15410
  5. package/components/button/index.umd.cjs +27 -27
  6. package/components/calendar/index.esm.js +269 -255
  7. package/components/calendar/index.umd.cjs +3 -3
  8. package/components/collection-property-editor/index.esm.js +243 -229
  9. package/components/collection-property-editor/index.umd.cjs +2 -2
  10. package/components/combo-list/index.esm.js +32 -32
  11. package/components/combo-list/index.umd.cjs +1 -1
  12. package/components/comment/index.esm.js +473 -456
  13. package/components/comment/index.umd.cjs +6 -6
  14. package/components/component/index.css +1 -1
  15. package/components/component/index.esm.js +2503 -2239
  16. package/components/component/index.umd.cjs +2 -2
  17. package/components/condition/index.esm.js +1064 -954
  18. package/components/condition/index.umd.cjs +2 -2
  19. package/components/data-grid/index.esm.js +1 -1
  20. package/components/data-grid/index.umd.cjs +1 -1
  21. package/components/designer-canvas/index.css +1 -1
  22. package/components/designer-canvas/index.esm.js +3894 -3058
  23. package/components/designer-canvas/index.umd.cjs +1 -1
  24. package/components/drawer/index.esm.js +91 -77
  25. package/components/drawer/index.umd.cjs +2 -2
  26. package/components/dynamic-form/index.esm.js +220 -215
  27. package/components/dynamic-form/index.umd.cjs +1 -1
  28. package/components/dynamic-resolver/index.esm.js +145 -131
  29. package/components/dynamic-resolver/index.umd.cjs +2 -2
  30. package/components/dynamic-view/index.esm.js +336 -329
  31. package/components/dynamic-view/index.umd.cjs +1 -1
  32. package/components/events-editor/index.esm.js +1611 -1536
  33. package/components/events-editor/index.umd.cjs +3 -3
  34. package/components/expression-editor/index.esm.js +219 -219
  35. package/components/expression-editor/index.umd.cjs +2 -2
  36. package/components/external-container/index.esm.js +179 -178
  37. package/components/external-container/index.umd.cjs +1 -1
  38. package/components/fieldset/index.esm.js +285 -221
  39. package/components/fieldset/index.umd.cjs +1 -1
  40. package/components/filter-bar/index.css +1 -0
  41. package/components/filter-bar/index.esm.js +1512 -1290
  42. package/components/filter-bar/index.umd.cjs +7 -7
  43. package/components/filter-condition-editor/index.esm.js +851 -831
  44. package/components/filter-condition-editor/index.umd.cjs +3 -3
  45. package/components/flow-canvas/index.esm.js +520 -501
  46. package/components/flow-canvas/index.umd.cjs +8 -8
  47. package/components/image/index.esm.js +101 -79
  48. package/components/image/index.umd.cjs +3 -3
  49. package/components/language-textbox/index.esm.js +330 -251
  50. package/components/language-textbox/index.umd.cjs +2 -2
  51. package/components/list-nav/index.esm.js +399 -313
  52. package/components/list-nav/index.umd.cjs +1 -1
  53. package/components/locale/index.esm.js +3 -0
  54. package/components/locale/index.umd.cjs +1 -1
  55. package/components/lookup/index.esm.js +997 -976
  56. package/components/lookup/index.umd.cjs +2 -2
  57. package/components/mapping-editor/index.esm.js +725 -705
  58. package/components/mapping-editor/index.umd.cjs +1 -1
  59. package/components/message-box/index.esm.js +542 -522
  60. package/components/message-box/index.umd.cjs +1 -1
  61. package/components/nav/index.esm.js +95 -308
  62. package/components/nav/index.umd.cjs +1 -1
  63. package/components/number-range/index.esm.js +115 -107
  64. package/components/number-range/index.umd.cjs +2 -2
  65. package/components/order/index.esm.js +56 -54
  66. package/components/order/index.umd.cjs +1 -1
  67. package/components/page-footer/index.esm.js +135 -123
  68. package/components/page-footer/index.umd.cjs +1 -1
  69. package/components/page-header/index.esm.js +266 -222
  70. package/components/page-header/index.umd.cjs +1 -1
  71. package/components/property-panel/index.esm.js +402 -375
  72. package/components/property-panel/index.umd.cjs +4 -4
  73. package/components/query-solution/index.esm.js +3171 -3061
  74. package/components/query-solution/index.umd.cjs +7 -7
  75. package/components/response-toolbar/index.esm.js +1 -1
  76. package/components/response-toolbar/index.umd.cjs +1 -1
  77. package/components/schema-selector/index.esm.js +1620 -1608
  78. package/components/schema-selector/index.umd.cjs +5 -5
  79. package/components/scroll-navbar/index.esm.js +150 -136
  80. package/components/scroll-navbar/index.umd.cjs +2 -2
  81. package/components/section/index.esm.js +323 -311
  82. package/components/section/index.umd.cjs +2 -2
  83. package/components/sort-condition-editor/index.esm.js +850 -830
  84. package/components/sort-condition-editor/index.umd.cjs +3 -3
  85. package/components/step/index.esm.js +991 -224
  86. package/components/step/index.umd.cjs +1 -1
  87. package/components/tabs/index.esm.js +356 -334
  88. package/components/tabs/index.umd.cjs +1 -1
  89. package/components/wizard/index.esm.js +159 -162
  90. package/components/wizard/index.umd.cjs +1 -1
  91. package/designer/avatar/index.esm.js +1721 -0
  92. package/designer/avatar/index.umd.cjs +6 -0
  93. package/designer/button-edit/index.esm.js +2 -1
  94. package/designer/button-edit/index.umd.cjs +1 -1
  95. package/designer/data-grid/index.esm.js +693 -659
  96. package/designer/data-grid/index.umd.cjs +6 -6
  97. package/designer/data-view/index.esm.js +90 -78
  98. package/designer/data-view/index.umd.cjs +2 -2
  99. package/designer/date-picker/index.esm.js +203 -203
  100. package/designer/date-picker/index.umd.cjs +1 -1
  101. package/designer/drawer/index.esm.js +181 -167
  102. package/designer/drawer/index.umd.cjs +2 -2
  103. package/designer/dynamic-form/index.esm.js +228 -206
  104. package/designer/dynamic-form/index.umd.cjs +2 -2
  105. package/designer/farris-designer.all.esm.js +10014 -9692
  106. package/designer/farris-designer.all.umd.cjs +18 -18
  107. package/designer/index.css +1 -1
  108. package/designer/input-group/index.esm.js +15 -15
  109. package/designer/input-group/index.umd.cjs +1 -1
  110. package/designer/nav/index.esm.js +1719 -0
  111. package/designer/nav/index.umd.cjs +6 -0
  112. package/designer/number-spinner/index.esm.js +8 -7
  113. package/designer/number-spinner/index.umd.cjs +1 -1
  114. package/designer/radio-group/index.esm.js +133 -125
  115. package/designer/radio-group/index.umd.cjs +2 -2
  116. package/designer/response-toolbar/index.esm.js +864 -863
  117. package/designer/response-toolbar/index.umd.cjs +1 -1
  118. package/designer/section/index.esm.js +245 -183
  119. package/designer/section/index.umd.cjs +1 -1
  120. package/designer/tabs/index.css +1 -1
  121. package/designer/tabs/index.esm.js +3667 -2810
  122. package/designer/tabs/index.umd.cjs +2 -2
  123. package/designer/time-picker/index.esm.js +26 -17
  124. package/designer/time-picker/index.umd.cjs +2 -2
  125. package/designer/tree-grid/index.esm.js +69 -37
  126. package/designer/tree-grid/index.umd.cjs +1 -1
  127. package/designer/wizard/index.esm.js +110 -110
  128. package/designer/wizard/index.umd.cjs +3 -3
  129. package/farris.all.esm.js +39993 -39089
  130. package/farris.all.umd.cjs +36 -36
  131. package/index.css +1 -1
  132. package/locales/filter-bar/ui/en.json +1 -0
  133. package/locales/filter-bar/ui/zh-CHS.json +1 -0
  134. package/locales/filter-bar/ui/zh-CHT.json +1 -0
  135. package/locales/ui/en.json +1 -0
  136. package/locales/ui/zh-CHS.json +1 -0
  137. package/locales/ui/zh-CHT.json +1 -0
  138. package/package.json +1 -1
  139. package/types/avatar/designer.d.ts +28 -0
  140. package/types/avatar/index.d.ts +0 -15
  141. package/types/avatar/src/composition/types.d.ts +3 -0
  142. package/types/avatar/src/composition/use-file.d.ts +19 -0
  143. package/types/avatar/src/composition/use-image.d.ts +1 -1
  144. package/types/avatar/src/designer/avatar.design.props.d.ts +24 -0
  145. package/types/avatar/src/property-config/avatar.property-config.d.ts +11 -13
  146. package/types/avatar/src/schema/schema-mapper.d.ts +2 -0
  147. package/types/components.d.ts +3 -0
  148. package/types/condition/index.d.ts +18 -6
  149. package/types/condition/src/condition-fields.component.d.ts +9 -3
  150. package/types/condition/src/condition-fields.design.component.d.ts +9 -3
  151. package/types/condition/src/condition-list.component.d.ts +9 -3
  152. package/types/condition/src/condition.props.d.ts +11 -0
  153. package/types/data-view/designer/property-config/use-appearance.d.ts +17 -10
  154. package/types/data-view/designer/property-config/use-pagination.d.ts +0 -6
  155. package/types/designer-canvas/src/composition/dg-control.d.ts +13 -0
  156. package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.component.d.ts +3 -0
  157. package/types/dynamic-form/src/component/dynamic-form-label/dynamic-form-label.props.d.ts +4 -0
  158. package/types/dynamic-resolver/src/converter/tree-auto-check.converter.d.ts +3 -0
  159. package/types/dynamic-view/src/components/maps.d.ts +130 -4
  160. package/types/filter-bar/src/composition/types.d.ts +2 -0
  161. package/types/filter-bar/src/filter-bar.props.d.ts +0 -1
  162. package/types/filter-bar/src/locale/locale.d.ts +2 -1
  163. package/types/filter-bar/src/property-config/filter-bar.property-config.d.ts +0 -1
  164. package/types/language-textbox/index.d.ts +65 -2
  165. package/types/language-textbox/src/designer/language-textbox.design.component.d.ts +36 -0
  166. package/types/language-textbox/src/language-textbox.component.d.ts +38 -1
  167. package/types/language-textbox/src/language-textbox.props.d.ts +20 -0
  168. package/types/lookup/src/components/popup-container.component.d.ts +3 -3
  169. package/types/lookup/src/composition/use-compat.d.ts +28 -0
  170. package/types/lookup/src/composition/use-state.d.ts +1 -0
  171. package/types/message-box/src/message-box.service.d.ts +2 -1
  172. package/types/nav/designer.d.ts +28 -0
  173. package/types/nav/index.d.ts +24 -20
  174. package/types/nav/src/designer/nav.design.props.d.ts +29 -0
  175. package/types/nav/src/designer/use-design-rules.d.ts +3 -0
  176. package/types/nav/src/property-config/nav.property-config.d.ts +9 -0
  177. package/types/nav/src/schema/schema-mapper.d.ts +4 -0
  178. package/types/page-footer/src/designer/use-designer-rules.d.ts +2 -2
  179. package/types/page-header/src/designer/use-designer-rules.d.ts +2 -2
  180. package/types/property-panel/src/composition/entity/input-base-property.d.ts +1 -0
  181. package/types/query-solution/src/designer/query-solution-config/composition/use-util.d.ts +1 -1
  182. package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +1 -1
  183. package/types/section/src/designer/section.design.props.d.ts +4 -0
  184. package/types/section/src/property-config/section.property-config.d.ts +39 -0
  185. package/types/section/src/schema/toolbar-resolver.d.ts +0 -1
  186. package/types/step/src/designer/use-designer-rules.d.ts +3 -0
  187. package/types/step/src/designer/use-step-creator.d.ts +6 -0
  188. package/types/step/src/property-config/step.property-config.d.ts +15 -0
  189. package/types/step/src/schema/schema-resolver.d.ts +2 -1
  190. package/types/tabs/src/composition/types.d.ts +4 -0
  191. package/types/tabs/src/tabs.props.d.ts +6 -0
  192. package/types/tooltip/index.d.ts +3 -3
  193. package/types/tooltip/src/tooltip.component.d.ts +2 -2
@@ -1,3 +1,3 @@
1
- (function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../dynamic-resolver/index.umd.js"),require("lodash-es"),require("../common/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../notify/index.umd.js"),require("../tree-view/index.umd.js"),require("../schema-selector/index.umd.js"),require("../modal/index.umd.js"),require("../input-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../event-parameter/index.umd.js"),require("../locale/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../../designer/dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../../designer/number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../../designer/modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../../designer/wizard/index.umd.js"),require("../tooltip/index.umd.js"),require("../property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../dynamic-resolver/index.umd.js","lodash-es","../common/index.umd.js","../designer-canvas/index.umd.js","../notify/index.umd.js","../tree-view/index.umd.js","../schema-selector/index.umd.js","../modal/index.umd.js","../input-group/index.umd.js","../combo-list/index.umd.js","../event-parameter/index.umd.js","../locale/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../../designer/dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../../designer/number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../text/index.umd.js","../../designer/time-picker/index.umd.js","../transfer/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../../designer/tree-grid/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../../designer/modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../../designer/wizard/index.umd.js","../tooltip/index.umd.js","../property-panel/index.umd.js"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w["events-editor"]={},w.Vue,w.dynamicResolver,w.LodashES,w.common,w.designerCanvas,w.notify,w.FTreeview,w.FSchemaSelector,w.modal,w.FInputGroup,w.FComboList,w.FEventParameter,w.locale,w.FAccordion,w.FAvatar,w.FButtonEdit,w.FButtonGroup,w.FCalendar,w.FCapsule,w.FCheckbox,w.FCheckboxGroup,w.FComboTree,w.FComponent,w.FColorPicker,w.FContentContainer,w.FDatePicker,w.FDataGrid,w.FDropdown,w.FDynamicForm,w.FEventsEditor$1,w.FFilterBar,w.FFieldSelector,w.FBindingSelector,w.FImageCropper,w.FInputGroup$1,w.FLayout,w.FListNav,w.FListView,w.FLookup,w.FMappingEditor,w.FNav,w.FNumberRange,w.FNumberSpinner,w.FOrder,w.FPageHeader,w.FPageFooter,w.FPagination,w.FProgress,w.FQuerySolution,w.FRadioGroup,w.FRate,w.FResponseToolbar,w.FResponseLayout,w.FResponseLayoutEditorSetting,w.FSearchBox,w.FSection,w.FSmokeDetector,w.FSplitter,w.FStep,w.FSwitch,w.FTabs,w.FTags,w.FText,w.FTimePicker,w.FTransfer,w.FUploader,w.FVerifyDetail,w.FVideo,w.FTextArea,w.FTreeGrid,w.FFilterConditionEditor,w.FFieldset,w.FSortConditionEditor,w.FMenuLookup,w.FDrawer,w.FJsonEditor,w.FPropertyEditor,w.FExpressionEditor,w.FCodeEditor,w.FHtmlTemplate,w.FCollectionPropertyEditor,w.FModal,w.FExternalContainer,w.FLanguageTextbox,w.FImage,w.FComment,w.FWizard,w.FTooltip))})(this,function(w,e,ae,H,se,Qe,de,Ue,Ge,Ye,Xe,_e,Ee,Ze,en,nn,tn,on,an,rn,ze,He,cn,ln,dn,sn,un,mn,fn,hn,vn,gn,pn,Cn,wn,bn,Nn,Sn,Vn,xn,Fn,yn,jn,En,Pn,Mn,Tn,Ln,Bn,In,kn,qn,Dn,An,$n,On,Rn,Un,Gn,_n,zn,Hn,Wn,Kn,Jn,Qn,Yn,Xn,Zn,et,nt,tt,ot,at,rt,it,ct,lt,dt,st,ut,mt,ft,ht,vt,gt,pt,Ct,wt){"use strict";const bt=new Map([["appearance",ae.resolveAppearance]]);function Nt(n,x,v){return x}const St={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/events-editor.schema.json",title:"events-editor",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for events-editor",type:"string"},type:{description:"The type events of events-editor",type:"events",default:"events-editor"},initialData:{description:"",type:"object",default:{}},viewSourceHandle:{description:"",type:"function",default:null}},required:["id","type"]},Vt={title:"events-editor",description:"A Farris Component",type:"object",categories:{}},We=[{label:"pageChange",name:"MockMock切换页码"},{label:"pageSizeChanged",name:"Mock分页条数变化事件"},{label:"scrollYLoad",name:"Mock滚动加载事件"},{label:"onEditClicked",name:"Mock操作列点击编辑"},{label:"onDeleteClicked",name:"Mock操作列点击删除"}],Pe={initialData:{type:Object,default:{propertyID:"data-grid-component-viewmodel",propertyType:"events",internalCommandList:[{controllerName:{id:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",label:"ListController",name:"列表控制器"},controllerList:[{id:"93ee1cd2-cf0b-40b3-b99f-958a3d1fad1c",label:"Load",name:"Mock加载数据",handlerName:"Load"},{id:"71ae8a4c-6202-4875-9246-2e2d959da37f",label:"Search",name:"Mock查询",handlerName:"Search"},{id:"77556491-41c0-4356-8ccf-25e39817060e",label:"Add",name:"Mock添加数据",handlerName:"Add"},{id:"52fdcac3-46c8-466e-aa5d-19920ece2076",label:"View",name:"Mock查看数据",handlerName:"View"},{id:"7ade9996-0531-4401-b1bc-fb9ec8ee3f8e",label:"Edit",name:"Mock编辑数据",handlerName:"Edit"},{id:"6d5a354f-871f-43e6-82bc-7837184380d3",label:"RemoveRows",name:"Mock删除选中行",handlerName:"RemoveRows"},{id:"1a1b7c33-38f0-469f-a017-223086ee6259",label:"ChangePage",name:"Mock切换页码",handlerName:"ChangePage"},{id:"debae2dd-3387-48cf-90ba-96e74ab5a8e5",label:"Remove",name:"Mock删除指定数据",handlerName:"Remove"}]}],events:We,boundEventsList:[],viewModel:[],componentLists:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],allComponentList:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],newController:[],isAddControllerMethod:!1,getEventList:()=>({events:We,boundEventsList:[]})}},viewSourceHandle:{type:Function,default:()=>{}}},Ke=ae.createPropsResolver(Pe,St,bt,Nt,Vt);function Je(){function n(v,h){const a=[{controllerId:"45be24f9-c1f7-44f7-b447-fe2ada458a61",controllerLabel:"AdvancedListCardController",controllerName:"高级列卡控制器",commands:[{name:"增加子表数据",id:"250cd2a2-9995-4c01-64aa-5029afba08ca",handlerName:"AddItem"},{name:"删除子表数据",id:"a2c06958-29b1-0582-5f3e-c3cfcc741f8f",handlerName:"RemoveItem"},{name:"插入数据",id:"3208b00c-543d-c050-3c54-081715972dda",handlerName:"Insert"},{name:"查询从表数据(分页)",id:"b60b7754-35cf-7eaa-0f1d-bc5e5d61c0bc",handlerName:"queryChild"},{name:"批量删除子表",id:"378fcd7d-ce91-c052-5947-d60ecdb38df9",handlerName:"batchDelete"},{name:"移动数据",id:"fcac5d5e-2367-2b61-a82a-f8e874e8efc0",handlerName:"move"},{name:"打开批量编辑界面",id:"8d8b05d6-2d22-b0b7-7cb8-51bbb8cd8a18",handlerName:"openBatchEditDialog"}]},{controllerId:"d7ce1ba6-49c7-4a27-805f-f78f42e72725",controllerLabel:"EditableListController",controllerName:"可编辑列表控制器",commands:[{name:"打开批量编辑界面",id:"c3831e36-27d1-1c98-dd60-30e2d7ec04d2",handlerName:"openBatchEditDialog"},{name:"加载列表数据",id:"f80e026b-bd9b-002b-d2aa-52c44a633bec",handlerName:"Load"}]},{controllerId:"8fe977a1-2b32-4f0f-a6b3-2657c4d03574",controllerLabel:"TreeCardController",controllerName:"树卡控制器",commands:[{name:"新增子表数据",id:"21b0c3af-3caf-b11d-2360-d9af20016501",handlerName:"AddItem"},{name:"删除子表数据",id:"113f1d77-65a4-63bf-3973-80dd15f294d1",handlerName:"RemoveItem"},{name:"批量删除子表",id:"bf13585c-a8f3-384b-356c-bd8bf06751c4",handlerName:"batchDelete"}]},{controllerId:"8d21e69c-70b3-44f6-88b5-fd6a8d3ce11b",controllerLabel:"PopController",controllerName:"弹出控制器",commands:[{name:"新增子表数据",id:"d6933772-8047-9bde-220b-449481883142",handlerName:"AddItem"},{name:"删除子表数据",id:"03c233eb-e39e-8e34-6809-ee4ab3a0d97c",handlerName:"RemoveItem"},{name:"加载并新增",id:"6882ab4a-9c23-8d59-6aac-de891eae20d2",handlerName:"LoadAndAdd"}]},{controllerId:"43f68561-eae4-4495-b318-d629615523f8",controllerLabel:"BatchEditCommands",controlleName:"批量编辑控制器",commands:[{name:"打开批量编辑界面",id:"a659aaba-daa4-3c07-8b26-164b01726022",handlerName:"openBatchEditDialog"},{name:"复制行",id:"d5f67e0a-767d-a238-5ad4-b1285476c16f",handlerName:"copyRow"},{name:"复制行",id:"229d2dd3-2fe7-f06a-b705-cfa0fc711614",handlerName:"clone"}]},{controllerId:"c121742e-6028-48bf-817c-1dda7fb098df",controllerLabel:"AdvancedListCardWithSidebarController",controllerName:"高级列卡控制器(侧边栏)",commands:[{name:"增加子表数据(侧边栏)",id:"250cd2a2-9995-4c01-64aa-5029afba08ca",handlerName:"AddItem"},{name:"删除子表数据(侧边栏)",id:"a2c06958-29b1-0582-5f3e-c3cfcc741f8f",handlerName:"RemoveItem"}]},{controllerId:"8172a979-2c80-4637-ace7-b13074d3f393",controllerLabel:"CardController",controllerName:"卡片控制器",commands:[{name:"新增子表数据",id:"6f987222-ebe2-0f3c-1594-a12408b22801",handlerName:"AddItem"},{name:"删除子表数据",id:"0cdeddcc-8332-f13f-be96-b5eeac84a334",handlerName:"RemoveItem"},{name:"插入数据",id:"2666b526-a1b2-f268-1629-b1b95b71c8dd",handlerName:"Insert"},{name:"打开批量编辑界面",id:"8104dd8e-bb27-a659-ff7c-a0321523f727",handlerName:"openBatchEditDialog"},{name:"新增子节点(子表树)",id:"bbd11957-de2a-c727-11d6-64788c4b0fa8",handlerName:"addSubChild"},{name:"删除子表树节点",id:"c8c9f652-ba52-3a9b-5eb9-dadd42c832cd",handlerName:"RemoveTreeItem"},{name:"批量删除子表",id:"e96857fa-1617-fd92-8a05-5c684e0819a1",handlerName:"batchDelete"}]},{controllerId:"31c1022c-ab40-4e8d-bc31-85d539f1d36c",controllerLabel:"FileController",controllerName:"文件控制器",commands:[{name:"批量删除文件数据",id:"d5bf021b-1aa4-06fe-3236-188fd218f4f7",handlerName:"removeFileRows"}]},{controllerId:"2eb7bbd1-fabd-4d0f-991d-7242f53225b1",controllerLabel:"AttachmentController",controllerName:"附件控制器",commands:[{name:"上传并更新行",id:"2a84e28f-7202-d858-1466-748a8040c1f9",handlerName:"UploadAndUpdateRow"},{name:"通过属性名上传并更新行",id:"0f98c9b8-a01b-55d4-3115-269a73f7ccff",handlerName:"uploadAndUpdateRowWithPropertyName"},{name:"移除版本附件行",id:"b441b6a7-9e13-9f75-77a2-10b2c1f7ef26",handlerName:"RemoveAttachmentItem"},{name:"上传并批量新增行",id:"e6fc25ca-853b-0b2d-76c9-a1f7a253679b",handlerName:"UploadAndBatchAddRows"},{name:"通过属性名上传并批量更新行",id:"e00b70db-9de3-8e3e-eb59-1c550a255fec",handlerName:"uploadAndBatchAddRowsWithPropertyName"}]},{controllerId:"e353b4e9-e073-4e18-b9f7-ec4cc8ac72b1",controllerLabel:"PrintService",controllerName:"打印控制器",commands:[{name:"根据数据条件批量打印",id:"774fa275-2da1-e927-e8bf-d27d9886a168",handlerName:"printMulti"}]},{controllerId:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",controllerLabel:"ListController",controllerName:"列表控制器",commands:[{name:"加载数据",id:"86c9f281-e5bc-5d5c-1b86-d1e17ab2e850",handlerName:"Load"}]},{controllerId:"7c48ef46-339c-42d4-8365-a21236c63044",controllerLabel:"ListCardController",controllerName:"列卡控制器",commands:[{name:"加载列表数据",id:"e573d6a2-8261-9ad4-c9f1-2e59af53302d",handlerName:"loadList"}]},{controllerId:"26436aa8-88a7-4aee-bf0b-9843c1e8afbf",controllerLabel:"ListListController",controllerName:"双列表控制器",commands:[{name:"加载导航列表数据",id:"f7dd2c84-7abd-d4bf-6b31-71d96035c034",handlerName:"LoadNavList"}]}];let u=-1;const V=a.findIndex(g=>v===g.controllerId);return V!==-1&&(u=a[V].commands.findIndex(g=>h===g.handlerName)),u!==-1}function x(v,h,a){const u=n(v.controllerName.id,h.handlerName);return a.componentLists.length!==0&&u&&(h.hasPath=!0,h.targetComponent=h.targetComponent||a.componentLists[0].componentId,h.componentLists=H.cloneDeep(a.componentLists)),h}return{isContextDependent:n,setComponentLists:x}}var ce=(n=>(n.Frame="frame",n.dataGrid="data-grid",n.listView="list-view",n.form="form",n.uploader="uploader",n.calendar="calendar",n.page="page",n))(ce||{});function xt(n,x){const v=e.inject("designerContext"),h=v&&v.dgControl?v.dgControl:Qe.DgControl,a=e.ref(""),u=e.ref("");function V(r){var d,N,I,o;let f="controlIcon fd-i-Family ",m="";switch(r==null?void 0:r.type){case"form-group":{m=((d=h[r.type])==null?void 0:d.icon)||((N=r.editor)==null?void 0:N.type)||"",(I=h[r.editor.type])!=null&&I.icon&&(m=h[r.editor.type].icon);break}default:m=((o=h[r.type])==null?void 0:o.icon)||r.type}const s=`fd_pc-${m}`;return f+=s,f}function g(r,f){var d;let m=r.id;const s=f==null?void 0:f.contents;if((f==null?void 0:f.type)==="splitter"&&s&&s.length===2){const N=f.direction!=="column";r.id===((d=s[0])==null?void 0:d.id)?m=N?"左侧区域":"上方区域":m=N?"右侧区域":"下方区域"}return m}function D(r){if(r.isLikeCardContainer)return"区块";const f=r.appearance&&r.appearance.class||"",m=f.split(" ");return r.id==="page-header"&&f&&f==="f-page-header"?"页头":m.includes("f-page-header-base")?"页头容器":m.includes("f-page-header-extend")?"页头扩展容器":m.includes("f-title")?"标题容器":m.includes("f-page")?"根容器":m.includes("f-page-main")?"内容区域":m.includes("f-scrollspy-content")&&r.isScrollspyContainer?"滚动监听容器":m.includes("f-grid-is-sub")?"表格容器":m.includes("f-filter-container")?"筛选条容器":"容器"}function O(r){const{componentType:f}=r;switch(f){case ce.Frame:return"根组件";case ce.dataGrid:return(n==null?void 0:n.formSchemaUtils.selectNode(r,s=>s.type===(h["tree-grid"]&&h["tree-grid"].type)))?"树表格组件":"表格组件";case ce.uploader:return"附件组件";case ce.listView:return"列表视图组件";case ce.form:return"卡片组件";case ce.calendar:return"日历组件";case ce.page:return r.name||"页面";default:return"组件"}}function C(r,f){const m=r.name||r.text||r.label||r.title||r.mainTitle;if(r.type!=="component"&&m&&typeof m=="string")return m.trim();switch(r.type){case"content-container":return D(r);case"splitter-pane":return g(r,f);case"component":return O(r);default:return h[r.type]&&h[r.type].name||r.id}}function y(r,f){const m=r.length?r[0]:null;if(!m)return;u.value="",a.value=m.originalId;const s=m?`${m.originalId}-design-item`:"",d=document.getElementById(s);d&&d.click(),x.emit("selectionChanged",m)}function p(r){if(!r)return;const f=`${r}-design-item`,m=document.getElementById(f);m&&m.click()}return{getIcon:V,getTitle:C,onChanged:y,currentSelectedNodeId:a,currentSelectedOutsideNodeId:u,triggerOutsideClick:p}}function Ft(n,x){const{getIcon:v,getTitle:h}=x;function a(C,y,p,r,f){var s;const m=(s=n.data.module)==null?void 0:s.components.find(d=>d.id===C.component);m&&u([m],y,p,r,f)}function u(C,y,p,r,f){return C.forEach(m=>{if(m.type==="component"&&(f=m.id),m.type==="component-ref"){a(m,y,p,r,f);return}const s={originalId:m.id,layer:p,originalParent:r==null?void 0:r.id,componentId:f,name:h(m,r),type:m.type,controlIcon:v(m),rawSchema:m};y.push(H.cloneDeep(s)),(m.contents||m.buttons)&&u(m.contents||m.buttons,y,p+1,m,f)}),y}function V(C){const y=[],p=C.find(s=>s.layer===0);C=C.filter(s=>s.layer!==0),y.push(p);let r=p.originalId,f=0,m=1e3;for(;C.length!==0||m===0;){const s=C.find(d=>d.originalParent===r);s?(y.push(s),r=s.originalId,C=C.filter(d=>d.originalId!==r),f=0):(f-=1,r=y.slice(f)[0].originalId),m-=1}return y}function g(C){return C.forEach((y,p)=>{y.id=(p+1).toString()}),C.forEach(y=>{var p;y.parent=((p=C.find(r=>r.originalId===y.originalParent))==null?void 0:p.id)||""}),C.forEach(y=>{y.hasChildren=C.findIndex(p=>p.parent===y.id)>0}),C}function D(C){const y={originalId:n.data.module.id,layer:0,originalParent:null,name:"页面",type:"module",controlIcon:"controlIcon fd-i-Family fd_pc-module",rawSchema:n.data.module},p=[];return C.forEach(r=>{r[0].originalParent=y.originalId,p.push(...r)}),p.unshift(y),p}function O(){const C=n.data.module?e.ref(n.data.module.components):e.ref([n.data]);if(!C.value)return;const y=[];C.value.forEach(m=>{if(m){const s=[];s.push(m);const I=u(s,[],1,null,m.id);y.push(I)}});const p=D(y),r=V(p);return g(r)}return{getData:O}}function me(n){const x=e.inject("sourceOutlineData")||[],v=e.ref(),h=e.ref(!1),a=e.ref([]),u=e.ref();function V(s,d,N,I){var o,_,W,A;return{id:se.useGuid().guid(),source:I||{formId:(o=s.sourceCommunication)==null?void 0:o.formId,formCode:(_=s.sourceCommunication)==null?void 0:_.formCode,componentId:(W=s.sourceCommunication)==null?void 0:W.componentId,externalContainerId:(A=s.sourceCommunication)==null?void 0:A.externalContainerId,event:d||"onCommunication"},target:{formId:(N==null?void 0:N.formId)||"",formCode:(N==null?void 0:N.formCode)||"",externalContainerId:(N==null?void 0:N.externalContainerId)||"",commandCode:(N==null?void 0:N.commandCode)||"",commandViewmodelId:(N==null?void 0:N.commandViewmodelId)||""},paramMappings:[]}}function g(s){var d,N;(d=s==null?void 0:s.communication)!=null&&d.length&&((N=s==null?void 0:s.communication)==null||N.map(I=>{var o,_;if(I!=null&&I.id&&!((o=I==null?void 0:I.source)!=null&&o.componentId)){const W=(_=n.getFormSchema().module.communications)==null?void 0:_.find(A=>A.id===(I==null?void 0:I.id));W&&Object.assign(I,W)}}))}function D(s){const d=n.getFormSchema(),{communications:N}=d.module;N||(d.module.communications=[]);const I=d.module.communications.findIndex(o=>o.id===s.id);I===-1?d.module.communications.push(s):Object.assign(d.module.communications[I],s)}function O(s){var d;if((d=s==null?void 0:s.communication)!=null&&d.length){const N=n.getFormSchema();s.communication.map(I=>{N.module.communications&&I&&(N.module.communications=N.module.communications.filter(o=>o.id!==I.id))}),s.communication=[]}}function C(s){var N;const d=n.getFormSchema();s&&((N=d.module.communications)!=null&&N.length)&&(d.module.communications=d.module.communications.filter(I=>I.id!==s))}function y(s,d,N){const I=xt(s,d),o=n.externalFormSchema.get(N);if(o!=null&&o.content){const _={data:o.content},{getData:W}=Ft(_,I);return W()}return[]}function p(s){var N;if(!((N=s==null?void 0:s.source)!=null&&N.componentId)){h.value=!1;return}const d=x.find(I=>I.originalId===s.source.componentId);d?(h.value=!1,v.value=d):(h.value=!0,v.value={id:s.source.componentId})}function r(s){var o,_,W,A;a.value=[];const d=(o=v.value)==null?void 0:o.rawSchema;if(!d){u.value=null;return}const N=d.type==="form-group"&&d.editor?d.editor.type:d.type,I=(_=ae.schemaMap[N])==null?void 0:_.events;I&&Object.keys(I).forEach(F=>{a.value.push({eventCode:F,eventName:I[F]})}),(W=s.source)!=null&&W.event&&((A=a.value)!=null&&A.length)&&(u.value=a.value.find(F=>{var q;return F.eventCode===((q=s.source)==null?void 0:q.event)}))}function f(s){var I,o,_,W,A,F,q,c;if(!(s!=null&&s.length))return;p(s[0]),r(s[0]);let d="",N="";return h.value?d=`${((I=s[0].source)==null?void 0:I.componentId)||""}-${((o=s[0].source)==null?void 0:o.event)||""}`:(d=(_=v.value)==null?void 0:_.name,d&&((W=u.value)!=null&&W.eventName)&&(d+=`-${(A=u.value)==null?void 0:A.eventName}`),N=`${(F=v.value)==null?void 0:F.name} (${(q=v.value)==null?void 0:q.originalId})`,N=`${N}
2
- ${(c=u.value)==null?void 0:c.eventName} (${u.value.eventCode})`),{title:d,titleTip:N,isControlInvalid:h.value}}function m(s){var d;if((d=s==null?void 0:s.communication)!=null&&d.length){const N=s==null?void 0:s.communication[0];return N==null?void 0:N.source}}return{createNewCommunication:V,resolveCommunication:g,clearAllCommunication:O,clearCommunicationById:C,saveCommunication:D,assembleSourceOutline:y,resolveSourceControlEventTitle:f,resolveCommunicationSource:m}}function yt(n,x,v){const h=e.ref([]),{boundEvents:a,unBoundEvent:u}=x;function V(p){var f,m;return{event:{label:(f=p.boundEvents)==null?void 0:f.label,name:(m=p.boundEvents)==null?void 0:m.name},showSwitch:[{showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2}],command:H.cloneDeep(p.command),controller:H.cloneDeep(p.controller),communication:p.communication}}function g(){var p;h.value=(p=a.value)==null?void 0:p.map(r=>V(r))}function D(p,r){const m=V({boundEvents:p,command:null,controller:{id:"",name:"",label:""},communication:r?[r]:[]});if(r){m.showSwitch[0].showSwitchNumber=2,m.showSwitch[0].showSection[2][2]=!1,m.showSwitch[0].showSection[2][3]=!1,m.needSelectCommunicationCommand=!0,h.value.unshift(m);return}p&&(m.showSwitch[0].showSwitchNumber=1,m.showSwitch[0].showSection[2][3]=!0,h.value.unshift(m))}function O(){var p;(p=h.value)==null||p.forEach(r=>{r.showSwitch.forEach(f=>{f.showSection[2][3]=!1}),r.shouldShowCommunicationPanel=!1})}function C(p){h.value[p].showSwitch.forEach(r=>{r.showSection[2][3]=!r.showSection[2][3]})}function y(p){if(p>=0&&p<=h.value.length-1){const r=h.value[p];u(r.event),h.value.splice(p,1);const{clearAllCommunication:f}=me(n);f(r)}}return{addNewInteraction:D,collapseInteractions:O,deleteInteracton:y,toggleMethodInInteraction:C,interactions:h,loadInteractions:g}}function jt(n){const x=e.ref([]),v=e.ref([]),h=e.ref([]),{isContextDependent:a}=Je();function u(){const{allComponentList:p}=n.value;n.value.componentLists.length&&n.value.viewModel&&n.value.viewModel.forEach(r=>{r.controllerList.forEach(f=>{if(f.targetComponent){const m=p.find(d=>d.componentId===f.targetComponent);if((m?m.viewModelId:void 0)===n.value.viewModelId)f.hasPath=!1;else{const d=a(r.controllerName.id,f.handlerName);f.hasPath=d?!0:f.hasPath,f.componentLists=d?H.cloneDeep(n.value.componentLists):f.componentLists}}})}),n.value.componentLists.length&&n.value.boundEventsList&&n.value.boundEventsList.forEach(r=>{var f;if((f=r.command)!=null&&f.targetComponent){const m=p.find(d=>{var N;return d.componentId===(((N=r.command)==null?void 0:N.targetComponent)||"")});if((m?m.viewModelId:void 0)===n.value.viewModelId)r.command.hasPath=!1;else{const d=a(r.controller.id,r.command.handlerName);r.command.hasPath=d?!0:r.command.hasPath,r.command.componentLists=d?H.cloneDeep(n.value.componentLists):r.command.componentLists}}})}function V(){const p=v.value.reduce((f,m)=>(f.set(m.boundEvents.label,!0),f),new Map);return x.value.filter(f=>!p.has(f.label))}function g(){var r;const p=((r=v.value)==null?void 0:r.length)>0;h.value=p?V():x.value}function D(){u(),x.value=n.value.events,v.value=n.value.boundEventsList,g()}function O(p){h.value=h.value.filter(r=>r.label!==p.label)}function C(p){v.value=v.value.filter(r=>r.boundEvents.label!==p.label),g()}function y(){var f;const p=(f=n.value)==null?void 0:f.getEventList(),{events:r}=p;p&&(n.value.events=H.cloneDeep(r),n.value.boundEventsList=p.boundEventsList),n.value.boundEventsList&&(n.value.boundEventsList=n.value.boundEventsList.filter(function(m){return r.find(s=>s.label===m.boundEvents.label)}))}return{allEvents:x,boundEvents:v,candidateEvents:h,excludeFromCandidates:O,loadEvents:D,resetBoundEvents:y,unBoundEvent:C}}const Et={sourceCommunication:{type:Object,default:{}}},Pt={events:{type:Array,default:[]}},Mt=e.defineComponent({name:"FEventList",props:Pt,emits:["click"],setup(n,x){const v=e.ref(n.events);function h(u){x.emit("click",u)}function a(u){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>h(u),class:"f-page-events-editor-first-bound-event-name"},[u.name])])}return()=>e.createVNode("div",{class:"f-page-events-editor-events"},[v.value.map(u=>a(u))])}}),fe={communication:{type:Object},sourceCommunication:{type:Object,default:{}},event:{type:String,default:""}},Tt=e.defineComponent({name:"FSelectSourceControl",props:fe,emits:["selectSourceEvent","deleteControl"],setup(n,x){const v=e.inject("useFormSchema"),{createNewCommunication:h}=me(v),a=e.ref();a.value=h(n);const u=e.ref([{field:"name",title:"",dataType:"string"}]),V=e.ref([]),g=e.ref(),D=e.ref(),O=e.ref(!0),C=e.ref(!1),y=e.ref([]),p=e.ref(),r=e.ref(!0),f=e.ref(!1);function m(){const F=e.inject("sourceOutlineData");V.value=F||[],D.value.updateDataSource(V.value)}function s(){var q,c,t;if(!((c=(q=a.value)==null?void 0:q.source)!=null&&c.componentId)){f.value=!1;return}const F=(t=V.value)==null?void 0:t.find(i=>i.originalId===a.value.source.componentId);F?(D.value.selectItemById(F.id),f.value=!1):(f.value=!0,g.value={id:a.value.source.componentId})}function d(){var F,q,c;(q=(F=a.value)==null?void 0:F.source)!=null&&q.event&&((c=y.value)!=null&&c.length)&&(p.value=y.value.find(t=>{var i,S;return t.eventCode===((S=(i=a.value)==null?void 0:i.source)==null?void 0:S.event)}))}e.onMounted(()=>{m(),s(),d(),r.value=!1});function N(){var t;y.value=[];const F=g.value.rawSchema,q=F.type==="form-group"&&F.editor?F.editor.type:F.type,c=(t=ae.schemaMap[q])==null?void 0:t.events;c&&Object.keys(c).forEach(i=>{y.value.push({eventCode:i,eventName:c[i]})})}function I(F){O.value=!1,f.value=!1;const q=g.value!==F[0];q&&(g.value=F[0],N()),r.value||(C.value=!0),!r.value&&q&&(p.value=null)}const o=e.computed(()=>({"item-list":!0,"d-none":!O.value})),_=e.computed(()=>F=>{var q;return{item:!0,selected:((q=p.value)==null?void 0:q.eventCode)===F}});function W(F){var q;O.value=!1,C.value=!1,p.value=F,a.value.source.componentId=g.value.rawSchema.id,a.value.source.event=(q=p.value)==null?void 0:q.eventCode,x.emit("selectSourceEvent",a.value)}const A=e.computed(()=>({"form-container":!0,"position-relative":!0,invalid:f.value}));return()=>e.createVNode("div",{class:A.value},[e.createVNode("div",{class:o.value,style:"min-height:220px;"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择源控件")]),e.createVNode(Ue.FTreeView,{ref:D,data:V.value,columns:u.value,columnOption:{fitColumns:!0,fitMode:"expand"},showTreeNodeIcons:!0,fit:!0,iconField:"controlIcon",onSelectionChange:I},null)]),C.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择事件")]),y.value.map(F=>e.createVNode("span",{class:_.value(F.eventCode),onClick:()=>W(F)},[F.eventName]))])])])}}),Lt=e.defineComponent({name:"FInteractionButton",props:Et,emits:["clickEventItem","selectSourceControl"],setup(n,x){const v=new de.FNotifyService,h=e.inject("useEventsComposition"),a=e.inject("useInteractionCompostion"),{candidateEvents:u}=h,{collapseInteractions:V}=a,g=e.ref(!1),D=e.ref(!1);function O(f){u.value=u.value.filter(m=>m.label!==f.label)}function C(){var f;(f=n.sourceCommunication)!=null&&f.needSelectSourceControl?D.value=!D.value:g.value=!g.value}function y(f){C(),O(f),x.emit("clickEventItem",f)}function p(){var f;if(!((f=n.sourceCommunication)!=null&&f.needSelectSourceControl)&&u.value.length===0){v.info({position:"top-center",message:"事件已全部绑定"});return}V(),C()}function r(f){D.value=!1,x.emit("selectSourceControl",f)}return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-page-events-editor-top-button"},[e.createVNode("button",{class:"f-page-events-editor-button",onClick:p},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),g.value&&e.createVNode(Mt,{events:u.value,onClick:y},null),D.value&&e.createVNode(Tt,{sourceCommunication:n.sourceCommunication,onSelectSourceEvent:r},null)])}}),Bt={collapsed:{type:Boolean,default:!0},displayOrder:{type:Number,default:-1},interaction:{type:Object,default:{}},controllers:{type:Array,default:[]},sourceCommunication:{type:Object,default:{}},viewSourceHandle:{type:Function,default:()=>{}},haveBoundCommand:{Type:Boolean,default:!1}},It={newImport:{Type:Boolean,default:!1},addInternalCommandList:{Type:Array,default:[]},outerLayerValue:{Type:Number,default:0},exit:{Type:Number,default:-1},haveBoundCommand:{Type:Boolean,default:!1},controllers:{type:Array,default:[]},iteractionDisplayOrder:{Type:Number,default:0},event:{Type:Object},sourceCommunication:{type:Object,default:{}}},kt={controllers:{type:Array,default:[]}},qt=e.defineComponent({name:"FCommandList",props:kt,emits:["selectMethod"],setup(n,x){function v(g){return g.controllerList.length!==0}function h(g){return v(g)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:g.controllerName.name},[g.controllerName.name])])}function a(g,D){x.emit("selectMethod",{method:g,controller:D})}function u(g){return g.controllerList.map(D=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>a(D,g)},[e.createVNode("div",{class:"f-page-internals-command-name",title:D.label},[D.name])]))}function V(g){return e.createVNode("div",null,[h(g),u(g)])}return()=>e.createVNode("div",{class:"f-page-internals"},[n.controllers.map(g=>V(g))])}}),Dt={getEventPath:{type:Function,default:null},notifyService:{type:Object},useFormSchema:{type:Object},sourceCommunication:{type:Object,default:{}},event:{Type:Object}},At=e.defineComponent({name:"FBoundEventSelector",props:Dt,emits:["cancel","submit"],setup(n,x){var b,$;const v=e.ref(),h=e.ref([]),a=e.ref('<i class="f-icon f-icon-search"></i>'),u=n.useFormSchema.getFormMetadataBasicInfo(),V=e.ref(""),g=e.ref(),D=((b=n.sourceCommunication)==null?void 0:b.unSupportedEventCodes)||[],O=e.ref(!D.includes(n.event.label)&&(($=n.useFormSchema.externalFormSchema)==null?void 0:$.size)>0),C=e.ref(),y=e.ref([]);e.onBeforeMount(()=>{if(n.getEventPath){const l=n.getEventPath();v.value=l.viewModelDisplay;const{actionWithPath:B}=l;B.forEach(k=>{k.sourceComponent.map.forEach(U=>{U.active=!1,U.hide=!1})}),h.value=H.cloneDeep(B)}});function p(l=""){l=l.replace(/ /g,"").replace(/>/g,"").toLowerCase(),l===""&&(l=" "),h.value.forEach(B=>{const k=B.path;B.sourceComponent.map.forEach(U=>{const K=U.command.name,Z=U.event.name,M=U.command.label;`${k}${K}${Z}${M}`.toLowerCase().includes(l)?U.hide=!1:U.hide=!0})})}function r(l=""){l=l.replace(/ /g,"").replace(/>/g,"").toLowerCase(),y.value.forEach(B=>{if(!B.isCommandNode)return;const k=B.name||"",U=B.code||"",K=B.viewmodelName||"",Z=`${k}${U}${K}`.toLowerCase();l&&!Z.includes(l)?B.hide=!0:B.hide=!1})}function f(l=""){!C.value||C.value.id===u.id?p(l):r(l)}function m(){const l=e.createVNode("div",{class:"f-vm-search"},[e.createVNode("div",{class:"f-vm-searchBar"},[e.createVNode(Xe,{updateOn:"change",groupText:a.value,modelValue:V.value,"onUpdate:modelValue":B=>V.value=B,onChange:f,placeholder:"请输入名称/编号/路径搜索"},null)])]);return O.value?e.createVNode("div",{class:"f-navSelector-header"},[e.createVNode("div",{class:"f-navSelector-recommand"},[e.createVNode("div",{class:"f-navSelector-recommand-text"},[e.createTextVNode("方法列表")])]),e.createVNode("div",{class:"f-navSelector-remainder"},[e.createVNode("div",{class:"f-vm-search"},[l])])]):l}function s(l){return{"f-vm-item":!0,"f-vm-item-focus":l.active}}function d(l,B){let k=0;h.value.forEach(U=>{U.sourceComponent.map.forEach(K=>{!K.command.isInvalid&&l.controller.id===K.controller.id&&l.command.id===K.command.id&&l.event.label===K.event.label&&B.sourceComponent.id===U.sourceComponent.id?(l.active=!l.active,g.value=H.cloneDeep(l)):(K.command.isInvalid&&l.controller.id===K.controller.id&&l.command.id===K.command.id&&l.event.label===K.event.label&&B.sourceComponent.id===U.sourceComponent.id&&(k++,k===1&&(new de.FNotifyService().info({position:"top-center",message:"该方法已失效"}),g.value=null)),K.active=!1)})})}function N(l){return{"f-event-func":!l.command.isInvalid,"f-event-func-invalid":l.command.isInvalid}}function I(l){return l.sourceComponent.map.filter(B=>!B.hide).map(B=>{if(!B.command.isInvalid)return e.createVNode("div",{class:s(B),onClick:()=>d(B,l)},[e.createVNode("div",{class:"f-event-commandItem"},[e.createVNode("div",{class:"f-icon-command"},[e.createVNode("div",{class:"f-icon f-icon-source-code",style:"font-size:10px;color:#30B471;"},[e.createTextVNode(" ")])]),e.createVNode("div",{class:N(B)},[B.command.name,e.createTextVNode("("),B.command.label,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[l.path,B.event.name])])})}function o(){return h.value.length>0?e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[h.value.map(l=>I(l))]):e.createVNode("div",{class:"f-list-view-emptydata",style:"height: 360px;position: relative;"},[e.createVNode("div",{class:"f-datagrid-norecords"},[e.createVNode("div",{class:"f-datagrid-norecords-content"},[e.createTextVNode(" 暂无数据")])])])}function _(){x.emit("cancel")}function W(){if(!g.value){n.notifyService.info({position:"top-center",message:"请选择需要绑定的方法"});return}x.emit("submit",{selectedCommand:g.value,selectedForm:C.value})}function A(){const l=n.useFormSchema.externalFormSchema,B=[];return B.push({containerId:"",id:u.id,code:u.code,name:u.name}),Array.from(l.keys()).forEach(k=>{const U=l.get(k);B.push({containerId:k,id:U.id,code:U.code,name:U.name})}),B}const F=e.computed(()=>({"f-vm-all":!0," h-100":!0,"has-page-list":O.value}));function q(l){var K,Z;const{viewmodels:B,components:k}=l.module;if((B==null?void 0:B.length)===0||(k==null?void 0:k.length)===0)return[];y.value=[];const U=(Z=(K=n.sourceCommunication)==null?void 0:K.parameterData)==null?void 0:Z.getViewModelName;B.forEach(M=>{if(!M||!M.commands||M.commands.length===0)return[];const J=k.find(re=>re.viewModel===M.id),X=U&&J?U(J,M.name,l):"";y.value.push({id:M.id,code:M.code,name:X||M.name}),M.commands.forEach(re=>{re.isInvalid||y.value.push({...re,viewmodelId:M.id,viewmodelName:X||M.name,isCommandNode:!0})})})}function c(l){var B,k,U;if(!(l.id===C.value.id&&l.containerId===C.value.containerId))if(C.value=l,V.value="",g.value=null,C.value.id!==u.id){const K=(k=n.useFormSchema.externalFormSchema)==null?void 0:k.get((B=C.value)==null?void 0:B.containerId);(U=K==null?void 0:K.content)!=null&&U.module&&q(K.content)}else h.value.map(K=>{K.sourceComponent.map.map(Z=>{Z.hide=!1,Z.active=!1})})}function t(){const l=A();C.value||(C.value=l[0]);const B=e.computed(()=>k=>{var U;return{"f-list-view-group-item":!0,"f-listview-active":k.id===((U=C.value)==null?void 0:U.id)&&k.containerId===C.value.containerId}});return e.createVNode("div",{class:"f-page-nav"},[e.createVNode("div",{class:"f-list-view"},[e.createVNode("div",{class:"f-list-view-content"},[e.createVNode("ul",{class:"f-list-view-group",style:"list-style: none;"},[l.map(k=>{let U=k.name;return k.containerId&&(U+=`, 所属外部容器:${k.containerId}`),e.createVNode("li",{class:B.value(k),onClick:()=>c(k)},[e.createVNode("div",{class:"f-list-content"},[e.createVNode("div",{class:"f-navSelector-leftCategory",title:U},[k.name])])])})])])])])}function i(l){y.value.map(B=>B.active=!1),l.active=!0,g.value=l}function S(){return e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[y.value.filter(l=>!l.hide).map(l=>{if(l.isCommandNode)return e.createVNode("div",{class:s(l),onClick:()=>i(l)},[e.createVNode("div",{class:"f-event-commandItem"},[e.createVNode("div",{class:"f-icon-command"},[e.createVNode("div",{class:"f-icon f-icon-source-code",style:"font-size: 10px; color: rgb(48, 180, 113);"},null)]),e.createVNode("div",{class:"f-event-func"},[l.name,e.createTextVNode("("),l.code,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[l.viewmodelName])])})])}return()=>e.createVNode("div",{class:F.value},[e.createVNode("div",{class:"d-flex f-utils-fill-flex-row splitter"},[O.value?t():"",e.createVNode("div",{class:"f-utils-fill-flex-column"},[m(),!C.value||C.value.id===u.id?o():S()])]),e.createVNode("div",{class:"modal-footer"},[e.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:_},[e.createTextVNode("取消")]),e.createVNode("button",{type:"button",class:"btn btn-primary",onClick:W},[e.createTextVNode("确定")])])])}}),$t=e.defineComponent({name:"FCommandSource",props:It,emits:["addInternalCommandListChanged","newImportChanged","selectBoundMethod","click","existChanged","newFunctionChanged","close","selectMethod","addCommunication"],setup(n,x){const v=e.inject("useMethodsComposition"),h=e.inject("useFormCommand"),a=new de.FNotifyService,{checkIfNewControllerExists:u,addNewController:V}=v,g=e.ref(n.controllers),D=e.inject("useFormSchema"),O=e.inject(Ye.F_MODAL_SERVICE_TOKEN);let C,y;const p=e.ref(!1);e.onMounted(()=>{p.value=D.externalFormSchema.size>0});function r(i,S,b){if(V(i),i.Commands){const $=h.getInternalControllerFromControllerMetadata(i,S,b);u($)&&a.info({position:"top-center",message:"该控制器已存在"})}}async function f(i){h.getSupportedControllerMetadata(i).then(S=>{S&&r(S.controller,S.code,S.nameSpace)}).finally(()=>{C&&C.destroy&&C.destroy()})}function m(i){C&&C.destroy&&C.destroy()}function s(){const i={formBasicInfo:D==null?void 0:D.getFormMetadataBasicInfo()};return e.createVNode(Ge.FSchemaSelector,{injectSymbolToken:se.ControllerSchemaRepositorySymbol,"view-type":"NavList",editorParams:i,showFooter:!0,onCancel:m,onSubmit:f},null)}function d(){C=O.open({title:"选择控制器",width:950,render:s,showButtons:!1})}function N(){x.emit("newFunctionChanged")}function I(){y&&y.destroy&&y.destroy()}function o(i){const{selectedCommand:S,selectedForm:b}=i;!b||(b==null?void 0:b.id)===D.getFormMetadataBasicInfo().id?(v.selectBoundCommand(S,n.iteractionDisplayOrder),x.emit("selectBoundMethod")):x.emit("addCommunication",i),I()}function _(){const{getEventPath:i}=v;return e.createVNode(At,{getEventPath:i,notifyService:a,useFormSchema:D,sourceCommunication:n.sourceCommunication,event:n.event,onCancel:I,onSubmit:o},null)}function W(){y=O.open({title:"已有方法",width:950,height:500,fitContent:!1,render:_,showButtons:!1,enableEsc:!1,draggable:!0})}function A(){x.emit("close",null)}function F(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function q(){return e.createVNode("div",{class:"f-page-internals-new-command"},[e.createVNode("div",{class:"f-page-internals-new-command-func1"},[e.createVNode("div",{class:"f-icon f-icon-panel-retraction"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>d()},[e.createTextVNode("引入控制器")])]),e.createVNode("div",{class:"f-page-internals-new-command-func2"},[e.createVNode("div",{class:"f-icon f-icon-new-edit"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>N()},[e.createTextVNode("添加新方法")])]),(n.haveBoundCommand||p.value)&&e.createVNode("div",{class:"f-page-internals-new-command-func3"},[e.createVNode("div",{class:"f-icon f-icon-licensed"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>W()},[e.createTextVNode("已有方法")])])])}function c(i){x.emit("selectMethod",i)}function t(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(qt,{controllers:g.value,onSelectMethod:c},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[t(),F(),q(),F(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:A},[e.createTextVNode("取消")])])])}}),Ot={command:{type:Object,default:{}},showParameter:{type:Boolean,default:!1},controller:{type:Object,default:{}},showDeleteIcon:{type:Boolean,default:!1}},Rt=e.defineComponent({name:"FParameterEditor",props:Ot,emits:["confirm","change","targetChange","viewSource","deleteCommand"],setup(n,x){const v=new de.FNotifyService,h=e.inject("FMessageBoxService"),a=e.ref(H.cloneDeep(n.command)),u=e.ref(n.controller),V=e.ref(0),g=e.computed(()=>a.value.id==="abandoned"),D=e.computed(()=>a.value.id==="deleted"),O=e.computed(()=>n.showDeleteIcon),C=e.computed(()=>a.value!==null),y=e.inject("useMethodsComposition"),p=e.ref(n.showParameter),r=e.inject("useFormSchema"),f=e.computed(()=>a.value.componentLists&&a.value.hasPath),m=e.computed(()=>{const M=a.value.id!=="abandoned"&&a.value.id!=="deleted",J=f.value,X=a.value.property&&a.value.property.length>0;return M&&(J||X)});function s(){const{targetComponent:M}=a.value;let J="";return a.value.componentLists&&a.value.componentLists.forEach(X=>{if(X.componentId===M){J=X.viewModelId;return}}),J}const d=e.ref(s()),N=e.computed(()=>a.value.targetComponent||"");function I(){v.info({position:"top-center",message:"方法已被移除,请重新绑定"})}function o(){return e.createVNode("div",{title:"方法已被移除,请重新绑定",class:"f-icon f-icon-flowline-warning text-danger text-center ",style:"font-size: 13px;margin-right:10px;width: 30px;height: 20px;",onClick:()=>I()},null)}function _(){v.info({position:"top-center",message:"方法已失效,请重新绑定"})}function W(){return e.createVNode("div",{title:"'方法已被删除,请绑定其他方法'",class:"f-icon f-icon-flowline-warning text-danger text-center ",style:"font-size: 13px;margin-right:10px;width: 30px;height: 20px;",onClick:()=>_()},null)}function A(M){p.value=!p.value}function F(){return e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>A(V.value)},null)}function q(M,J){a.value.targetComponent=M[0].componentId,x.emit("targetChange",a.value)}function c(){const M=e.reactive({content:"将此方法添加到指定的组件",placement:"top"});return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-targetComponent"},[e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-topic"},[e.createTextVNode("挂载到目标组件"),e.withDirectives(e.createVNode("span",{class:"farris-label-tips ml-2"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),M]])]),e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-dropdown"},[e.createVNode(_e,{modelValue:d.value,"onUpdate:modelValue":J=>d.value=J,enableClear:!1,idField:"viewModelId",valueField:"viewModelId",textField:"componentId",data:a.value.componentLists,editable:!1,onChange:q},null)])])])}function t(M,J){J.value=M}function i(){x.emit("change",a.value)}function S(){let M="";return N.value?M=r.getViewModelIdByComponentId(N.value):M=y.getViewModeId(),M}function b(M,J){var Ce,we,be,Ne,he,ve,L,R,G,z,Q,ee,ne,te,oe,Se,Ve,xe,le,Fe,ye;const X=S(),Le=r.getViewModelById(X).commands.find(Y=>{var ie;return(Y==null?void 0:Y.id)===((ie=n.command)==null?void 0:ie.id)}),Be=e.reactive(M.context.data),{assembleSchemaFieldsByComponent:Ie,assembleOutline:ke,assembleStateVariables:qe,assembleSchemaFieldsUnderBoundEntity:De,getEditor:Ae}=M.context.generalData,{designerMode:$e}=r,Oe=Y=>{t(Y,M),i()},Re=Y=>{var ie,ge,ue,je;return((je=(ue=(ge=(ie=M==null?void 0:M.origin)==null?void 0:ie.controlSource)==null?void 0:ge.context)==null?void 0:ue.data)==null?void 0:je.value)===":Entity"||Y.raw.children&&Y.raw.children.length&&(Y.disabled=!0),Y};return e.createVNode(Ee,{readonly:$e==="PC_RTC"&&!J.isRtcCommand,defaultValue:M==null?void 0:M.origin.defaultValue,modelValue:M.value,"onUpdate:modelValue":Y=>M.value=Y,data:Be,editor:Ae(M.value,M,Le,X,Oe),fieldData:Ie(),formData:ke(),varData:qe(),activeViewModelFieldData:De(N.value),editorControlSource:(Ce=M==null?void 0:M.origin)==null?void 0:Ce.controlSource,customRowStatus:Re,idField:((he=(Ne=(be=(we=M==null?void 0:M.origin)==null?void 0:we.controlSource)==null?void 0:be.context)==null?void 0:Ne.data)==null?void 0:he.value)===":Entity"?"bindTo":((G=(R=(L=(ve=M==null?void 0:M.origin)==null?void 0:ve.controlSource)==null?void 0:L.context)==null?void 0:R.valueField)==null?void 0:G.value)||((ne=(ee=(Q=(z=M==null?void 0:M.origin)==null?void 0:z.controlSource)==null?void 0:Q.context)==null?void 0:ee.idField)==null?void 0:ne.value)||"id",textField:((Ve=(Se=(oe=(te=M==null?void 0:M.origin)==null?void 0:te.controlSource)==null?void 0:oe.context)==null?void 0:Se.textField)==null?void 0:Ve.value)||"label",editable:(ye=(Fe=(le=(xe=M==null?void 0:M.origin)==null?void 0:xe.controlSource)==null?void 0:le.context)==null?void 0:Fe.editable)==null?void 0:ye.value,onConfirm:Y=>{t(Y,M),i()},onValueChange:Y=>{var ie,ge;if(((ie=M.origin)==null?void 0:ie.Code)==="lookupId"){const ue=(ge=a.value.property)==null?void 0:ge.find(je=>je.name==="mappingFields");ue&&ue.value&&(ue.value="")}t(Y,M),i()}},null)}function $(){var M;return(M=a.value.property)==null?void 0:M.map((J,X)=>{const re=e.reactive({content:J.description,placement:"top"});return e.createVNode("div",{key:J.name+X},[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[J.shownName,J.description&&e.withDirectives(e.createVNode("div",{class:"ml-2 farris-label-tips"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),re]])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[b(J,a.value)])])})}function l(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[f.value&&c(),$()])}function B(M){M.stopPropagation(),x.emit("viewSource",{command:a.value,event:M})}function k(){h.question(`确定删除命令【${a.value.name}】吗?`,"",()=>{x.emit("deleteCommand")})}function U(){return e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:M=>k()},null)}const K=e.computed(()=>{var M;return{cursor:g.value||u.value.isCommon||((M=u.value)==null?void 0:M.label.indexOf(r==null?void 0:r.getModule().code))===-1?"default":"pointer"}});function Z(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",style:K.value,title:a.value.label,onDblclick:B},[a.value.name]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[g.value&&o(),D.value&&W(),m.value&&F(),O.value&&U()])]),p.value&&l()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[C.value&&Z()])}}),Ut={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},Me=e.defineComponent({name:"FResponseForm",props:Ut,emits:[],setup(n,x){const v=e.ref(),h=e.computed(()=>{const a=Ze.LocaleService.getLocale(),u=n.customClass.split(" "),V={"drag-container":!0};return u.reduce((g,D)=>(g[D]=!0,g),V),n.adaptForLanguage&&a&&(V["farris-form-controls-inline"]=a!=="en"),V});return()=>n.visible&&e.withDirectives(e.createVNode("div",{ref:v,class:h.value,style:n.customStyle},[x.slots.default&&x.slots.default()]),[[e.resolveDirective("area-response")]])}}),Gt={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number]},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},showLabelType:{type:String,default:"visible"},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null},fill:{type:Boolean,default:!1},enableTips:{type:Boolean,default:!1},tipsContent:{type:Object,default:""}},_t={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""},showType:{type:String,default:"visible"}},zt=e.defineComponent({name:"FDynamicFormLabel",props:_t,emits:["clickLabel"],setup(n,x){e.ref(n.title||n.text);const v=e.ref(n.required),h=e.ref(n.text),a=e.ref(n.valid),u=e.ref(n.inValidTip);e.watch(()=>n.text,()=>{h.value=n.text}),e.watch(()=>n.required,(C,y)=>{C!==y&&(v.value=C)}),e.watch([()=>n.valid,()=>n.inValidTip],([C,y])=>{a.value=C,u.value=y});const V=e.computed(()=>a.value?h.value:u.value),g=e.computed(()=>a.value?"":"color:red"),D=e.computed(()=>({"col-form-label":!0,"f-width-auto":v.value&&(n.showType==="none"||!h.value)})),O=e.computed(()=>n.showType==="force-none"?!1:n.showType==="reserve-space"||v.value||!!h.value&&n.showType!=="none");return()=>O.value&&e.createVNode("label",{class:D.value,title:V.value,style:g.value,onClick:()=>x.emit("clickLabel")},[!a.value&&e.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:u.value},null),e.createVNode("span",{class:"farris-label-text"},[v.value&&e.createVNode("span",{class:"farris-label-info text-danger"},[e.createTextVNode("*")]),n.showType==="visible"&&h.value])])}}),{globalStorageKey:Ht}=se.useThirdComponent(),j={},E={},P={},T={};async function Wt(){{const n={schemaMap:ae.schemaMap,propertyConfigSchemaMap:ae.propertyConfigSchemaMap,propertyEffectMap:ae.propertyEffectMap,schemaResolverMap:ae.schemaResolverMap};nn.register(j,E,P,T),en.register(j,E,P,T),tn.register(j,E,P,T),on.register(j,E,P,T),an.register(j,E,P,T,n),rn.register(j,E,P,T),ze.register(j,E,P,T,n),He.register(j,E,P,T,n),ze.register(j,E,P,T,n),He.register(j,E,P,T,n),_e.register(j,E,P,T,n),cn.register(j,E,P,T),ln.register(j,E,P,T),sn.register(j,E,P,T,n),dn.register(j,E,P,T),un.register(j,E,P,T,n),mn.register(j,E,P,T,n),fn.register(j,E,P,T),hn.register(j,E,P,T,n),vn.register(j,E,P,T),dt.register(j,E,P,T),gn.register(j,E,P,T),pn.register(j,E,P,T),tt.register(j,E,P,T),wn.register(j,E,P,T),bn.register(j,E,P,T,n),Nn.register(j,E,P,T,n),Vn.register(j,E,P,T,n),Sn.register(j,E,P,T),xn.register(j,E,P,T,n),Fn.register(j,E,P,T),yn.register(j,E,P,T),jn.register(j,E,P,T),En.register(j,E,P,T,n),Pn.register(j,E,P,T),Mn.register(j,E,P,T,n),Tn.register(j,E,P,T),Ln.register(j,E,P,T),Bn.register(j,E,P,T),In.register(j,E,P,T,n),kn.register(j,E,P,T,n),qn.register(j,E,P,T),An.register(j,E,P,T,n),$n.register(j,E,P,T),Dn.register(j,E,P,T),Ge.register(j,E,P),On.register(j,E,P,T),Rn.register(j,E,P,T,n),Un.register(j,E,P,T),Gn.register(j,E,P,T),_n.register(j,E,P,T),zn.register(j,E,P,T,n),at.register(j,E,P,T),Hn.register(j,E,P,T,n),Wn.register(j,E,P,T),Kn.register(j,E,P,T),Jn.register(j,E,P,T,n),Qn.register(j,E,P,T),Ue.register(j,E,P,T),Xn.register(j,E,P,T),Yn.register(j,E,P,T),Zn.register(j,E,P,T),et.register(j,E,P,T,n),nt.register(j,E,P,T),Cn.register(j,E,P,T),Ee.register(j,E,P,T),ot.register(j,E,P,T,n),rt.register(j,E,P,T),it.register(j,E,P,T),ct.register(j,E,P,T),lt.register(j,E,P,T),st.register(j,E,P,T),ut.register(j,E,P,T,n),mt.register(j,E,P,T),ft.register(j,E,P,T),ht.register(j,E,P,T),vt.register(j,E,P,T,n),gt.register(j,E,P,T,n),pt.register(j,E,P,T),Ct.register(j,E,P,T);const x=window[Ht];if(x)for(const v in x)x[v].createPropsResolver=ae.createPropsResolver,x[v].register(j,E,P)}}function Kt(){Wt();function n(V){const g=j[V];if(!g)throw new Error(`Could not find the editor of type '${V}'`);return g}function x(V,g){const D=E[V];return D?D(g):{}}function v(V){switch(V){case"check-box":return"onChangeValue";case"switch":return"onModelValueChanged";case"check-group":return"onChangeValue";case"combo-list":case"combo-tree":return"onChange";case"combo-lookup":return"";case"year-range":case"year-picker":case"month-range":case"month-picker":case"date-range":case"datetime-range":case"datetime-picker":return"onDatePicked";case"date-picker":return"onUpdate:modelValue";case"time-picker":return"onValueChange";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-editor":case"language-textbox":case"rich-text-editor":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":case"item-collection-editor":case"response-form-layout-setting":case"response-layout-editor-setting":case"response-layout-splitter":case"menu-lookup":case"json-editor":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onChange";case"query-solution-config":case"solution-preset":case"filter-bar-config":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged";case"collection-property-editor":return"onValueChange";default:return"onUpdate:modelValue"}}function h(V){switch(V){case"combo-list":case"input-group":case"textarea":return"onClear"}}function a(V){switch(V){case"input-group":case"textarea":return"onMousedownEvent"}}function u(V){switch(V){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:x,resolveEditorType:n,getChangeFunctionName:v,getClearFunctionName:h,getMousedownFunctionName:a,getMouseupFunctionName:u}}const Jt={errors:{type:Object,default:null}},Qt=e.defineComponent({name:"FValidationMessage",props:Jt,emits:[],setup(n,x){const v=e.ref(n.errors);e.watch(()=>n.errors,u=>{v.value=u});const h=e.ref(!0),a=e.computed(()=>{if(v.value){const u=Object.keys(v.value).map(V=>{var g;return(g=v.value[V])==null?void 0:g.name});return u.length?u.join(" "):""}return""});return()=>a.value&&e.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>h.value=!h.value},[!h.value&&e.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),h.value&&e.createVNode("span",{class:"f-feedback-message"},[a.value])])}}),Te=e.defineComponent({name:"FDynamicFormGroup",props:Gt,emits:["change","update:modelValue","clickLabel"],setup(n,x){var S;const v=e.ref(n.id),h=e.ref(n.customClass),a=e.ref(n.editor),u=e.ref(n.label),V=e.ref(n.modelValue),g=e.ref(n.readonly),D=e.ref(((S=n.editor)==null?void 0:S.required)||n.required),O=e.ref(n.showLabel),C=e.ref(n.visible);e.ref(n.type);const y=e.ref(),p=e.ref(n.errors),r=se.isMobilePhone(),f=e.ref(n.editor.type||"input-group"),m=e.computed(()=>O.value?n.showLabelType:"none"),{resolveEditorProps:s,resolveEditorType:d,getChangeFunctionName:N,getClearFunctionName:I}=Kt(),o=e.computed(()=>{const b={"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":g.value,"align-items-start":a.value.type==="textarea"||a.value.type==="rich-text-editor","form-group--in-mobile":r};return b["form-group--has-"+f.value]=!0,b}),_=e.computed(()=>{if(n.fill)return{maxWidth:"none"}});function W(b,$,l){V.value=$!==void 0?$:b,x.emit("update:modelValue",V.value),x.emit("change",V.value,{newValue:b,newModelValue:$,parameters:l})}function A(){x.emit("update:modelValue","")}function F(b){return(...$)=>{A(),typeof b=="function"&&b(...$)}}function q(b){return($,l,B)=>{W($,l,B),typeof b=="function"&&b($,l,B)}}const c=e.computed(()=>{const b=a.value.type||"input-group",$=d(b),l=s(b,a.value),B=N(b),k=I(a.value.type);return k&&(l[k]=F(l[k])),B&&(l[B]=q(l[B])),(l.id==null||l.id==="")&&(l.id=v.value),b==="number-range"&&a.value.onBeginValueChange&&typeof a.value.onBeginValueChange=="function"?(a.value.onBeginValueChange&&typeof a.value.onBeginValueChange=="function"&&(l.onBeginValueChange=a.value.onBeginValueChange),a.value.onEndValueChange&&typeof a.value.onEndValueChange=="function"&&(l.onEndValueChange=a.value.onEndValueChange)):b==="lookup"&&a.value["onUpdate:idValue"]&&typeof a.value["onUpdate:idValue"]=="function"?(l["onUpdate:idValue"]=a.value["onUpdate:idValue"],l.id=v.value):b==="collection-property-editor"&&a.value.onSelectionChange&&typeof a.value.onSelectionChange=="function"?l.onSelectionChange=a.value.onSelectionChange:b==="property-editor"&&(l.onBeforeOpenVariables=a.value.onBeforeOpenVariables),()=>e.createVNode($,e.mergeProps({ref:y},l,{modelValue:V.value,"onUpdate:modelValue":U=>V.value=U}),x.slots)});function t(){return e.createVNode(Qt,{id:`${v.value}-validation-message`,errors:p.value},null)}e.watch([()=>n.id,()=>n.customClass,()=>n.editor,()=>n.label,()=>n.modelValue,()=>n.readonly,()=>n.required,()=>n.showLabel,()=>n.visible,()=>n.errors],([b,$,l,B,k,U,K,Z,M,J])=>{var X;v.value=b,h.value=$,a.value=l,u.value=B,V.value=k,g.value=U,D.value=((X=a.value)==null?void 0:X.required)||K,O.value=Z,C.value=M,p.value=J});function i(b){x.emit("clickLabel",b)}return x.expose({editorRef:y}),()=>C.value&&e.createVNode("div",{id:`${v.value}-form-group`,class:h.value,style:n.customStyle},[e.createVNode("div",{class:"farris-group-wrap",style:_.value},[e.createVNode("div",{class:o.value},[e.createVNode(zt,{id:`${v.value}-lable`,showType:m.value,required:D.value,text:u.value,title:u.value,onClickLabel:i},null),e.createVNode("div",{class:"farris-input-wrap"},[c.value(),t()]),n.enableTips&&e.createVNode(wt,{content:n.tipsContent},{default:()=>[e.createVNode("span",{class:"farris-label-tips ml-1"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)])]})])])])}});Me.install=n=>{n.component(Me.name,Me).component(Te.name,Te)};const Yt=e.defineComponent({name:"FSelectParameters",props:fe,emits:["changed"],setup(n,x){var c;const v=new de.FNotifyService;v.globalConfig={position:"top-center"};const h=e.inject("FMessageBoxService"),a=e.ref(n.communication),u=e.ref(((c=a.value)==null?void 0:c.paramMappings)||[]),V=e.inject("useFormSchema"),g=V.getFormMetadataBasicInfo(),D=e.ref([]),O=e.ref([]),C=e.ref({}),y=e.ref({}),p=e.computed(()=>t=>{let i="",S="";if(t.sourceValue&&t.targetVariable){const b=O.value.find($=>$.statePath===`${t.targetVariableViewModelId}.${t.targetVariable}`);b&&b.name?(y.value[t.targetVariable]=!1,i=`${t.sourceValue}--->${b.name}`,S=`将 ${t.sourceValue} 赋值给 ${b.name}`):(y.value[t.targetVariable]=!0,i=`${t.sourceValue}--->${t.targetVariable}`,S=`将 ${t.sourceValue} 赋值给 ${t.targetVariable}`)}return{displayText:i,displayTextTip:S}});e.watch(()=>n.communication,t=>{a.value=t,u.value=a.value.paramMappings||[]},{deep:!0});function r(){var i;const t=u.value.length||0;u.value.length&&(u.value=u.value.filter(S=>!(!S.sourceValue&&!S.targetVariable))),a.value.paramMappings=u.value,t!==((i=a.value.paramMappings)==null?void 0:i.length)&&x.emit("changed")}e.onUnmounted(()=>{r()});function f(t){var l,B;const{viewmodels:i,components:S}=t.module;if((i==null?void 0:i.length)===0||(S==null?void 0:S.length)===0)return[];const b=[];O.value=[];const $=(B=(l=n.sourceCommunication)==null?void 0:l.parameterData)==null?void 0:B.getViewModelName;return i.forEach(k=>{if(!k||!k.states||k.states.length===0)return[];const U=[],K=S.find(J=>J.viewModel===k.id),Z=$&&K?$(K,k.name,t):"";k.states.forEach(J=>{const X={...J,statePath:k.id+"."+J.code};U.push({data:X,children:[]}),O.value.push(X)});const M={data:{id:k.id,code:k.code,name:Z||k.name,statePath:k.id},children:U};b.push(M)}),b}function m(){var t,i;if(!((t=a.value)!=null&&t.target.formId))return[];if(a.value.target.formId===g.id)D.value=f(V.getFormSchema());else{const S=V.externalFormSchema.get(a.value.target.externalContainerId);(i=S==null?void 0:S.content)!=null&&i.module&&(D.value=f(S==null?void 0:S.content))}}function s(){Object.keys(C.value).forEach(t=>{C.value[t]=!1})}function d(){s();const t=se.useGuid().guid();u.value.push({id:t,sourceValue:"",targetVariable:"",targetVariableViewModelId:""}),a.value.paramMappings=u.value,C.value[t]=!0}function N(t,i,S){t.stopPropagation();function b(){u.value=u.value.filter($=>$.id!==i.id),a.value.paramMappings=u.value,s(),x.emit("changed")}S?h.question(`确定删除参数【${S}】吗?`,"",()=>{b()}):b()}function I(t){C.value[t.id]||(s(),C.value[t.id]=!0)}function o(t,i){if(!i.sourceValue){v.warning("请选择源参数");return}if(!i.targetVariable){v.warning("请选择目标参数");return}C.value[t.id]=!1,Object.assign(t,i),delete t.statePath,x.emit("changed")}function _(t){C.value[t.id]=!1,!t.sourceValue&&!t.targetVariable&&!t.targetVariableViewModelId&&(u.value=u.value.filter(i=>i.id!==t.id),a.value.paramMappings=u.value,x.emit("changed"))}e.onMounted(()=>{m()}),e.watch(()=>n.communication,t=>{m()},{deep:!0});function W(t,i,S){var b;if((b=S.newValue)!=null&&b.length){const{statePath:$}=S.newValue[0];if(($==null?void 0:$.indexOf("."))>0){const l=$.split(".");i.targetVariableViewModelId=l[0],i.targetVariable=l[1]}}}function A(t){return{type:"combo-tree",textField:"name",valueField:"statePath",idField:"statePath",data:D.value,editable:!1,enableClear:!1,customRowStatus:i=>i.raw.parent?(u.value.find(b=>b.id!==t.id&&`${b.targetVariableViewModelId}.${b.targetVariable}`===i.raw.statePath)&&(i.disabled=!0),i):(i.disabled=!0,i)}}function F(t){const i=H.cloneDeep(t);i.statePath=`${i.targetVariableViewModelId}.${i.targetVariable}`;const S=A(t);let b=V.getFormSchema();if(a.value.source.formId!==g.id){const k=V.externalFormSchema.get(a.value.source.externalContainerId);k!=null&&k.content&&(b=k==null?void 0:k.content)}const{assembleSchemaFieldsByComponent:$,assembleOutline:l,assembleStateVariables:B}=n.sourceCommunication.parameterData;return e.createVNode("div",{class:"param-panel"},[e.createVNode("div",{class:"col-12"},[e.createVNode("div",{class:"farris-group-wrap"},[e.createVNode("div",{class:"form-group farris-form-group"},[e.createVNode("label",{class:"col-form-label",title:"源参数"},[e.createVNode("span",{class:"farris-label-text"},[e.createTextVNode("源参数")])])])])]),e.createVNode(Ee,{class:"col-12 mb-2",modelValue:i.sourceValue,"onUpdate:modelValue":k=>i.sourceValue=k,fieldData:$(b),formData:l(b),varData:B(b),editorType:"Default",editable:!0},null),e.createVNode(Te,{label:"目标参数",modelValue:i.statePath,"onUpdate:modelValue":k=>i.statePath=k,customClass:"col-12 mb-2",editor:S,onChange:(k,U)=>W(k,i,U)},null),e.createVNode("div",{class:"d-flex justify-content-end"},[e.createVNode("button",{class:"btn btn-secondary mr-2",onClick:()=>_(t)},[e.createTextVNode("取消")]),e.createVNode("button",{class:"btn btn-primary",onClick:()=>o(t,i)},[e.createTextVNode("确定")])])])}x.expose({addParameter:d,closeAllParameterPanel:s});const q=e.computed(()=>t=>({"param-container":!0,"ml-3":!0,invalid:t}));return()=>u.value.length?u.value.map(t=>{const{displayText:i,displayTextTip:S}=p.value(t),b=y.value[t.targetVariable];return e.createVNode("div",{class:q.value(b)},[e.createVNode("div",{class:"selected-item position-relative"},[e.createVNode("span",{class:"form-control mr-3",title:S,onClick:()=>I(t)},[i||"请配置参数"]),b?e.createVNode("span",{title:"目标参数已失效,请重新选择"},[e.createVNode("i",{class:"f-icon f-icon-flowline-warning text-danger text-tip"},null)]):"",e.createVNode("div",{class:"remove-icon"},[e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除参数",onClick:$=>N($,t,i)},null)])]),C.value[t.id]?F(t):""])}):""}}),Xt=e.defineComponent({name:"FCommunicationCommandItem",props:fe,emits:["addParameter","deleteCommand","toggleParameterPanel"],setup(n,x){const v=e.ref(n.communication),h=e.inject("FMessageBoxService"),a=e.inject("useFormSchema"),u=a.getFormMetadataBasicInfo(),V=e.ref([]),g=e.ref(),D=e.ref(!1),O=e.ref([]),C=e.ref(),y=e.ref(!1),p=e.ref(n.communication.paramMappings&&n.communication.paramMappings.length>0),r=e.computed(()=>{var c,t,i,S;if(!g.value)return"";const F=((c=g.value)==null?void 0:c.name)||((t=g.value)==null?void 0:t.code)||"",q=((i=C.value)==null?void 0:i.name)||((S=C.value)==null?void 0:S.code)||"";return`${F}-${q}`}),f=e.computed(()=>{var S,b,$,l,B,k;if(!g.value)return"";const F=((S=g.value)==null?void 0:S.name)||((b=g.value)==null?void 0:b.code)||"",q=(($=C.value)==null?void 0:$.name)||((l=C.value)==null?void 0:l.code)||"",c=((B=g.value)==null?void 0:B.code)||"",t=((k=C.value)==null?void 0:k.code)||"",i=g.value.containerId?`, 所属外部容器: ${g.value.containerId}`:"";return`${F} (${c}${i})
3
- ${q} (${t})`}),m=e.computed(()=>D.value?"目标表单已失效,请删除当前方法。":y.value?"目标命令已失效,请删除当前方法。":"");function s(){var F,q;if((q=(F=v.value)==null?void 0:F.target)!=null&&q.formId){const c=V.value.find(t=>t.id===v.value.target.formId&&t.containerId===v.value.target.externalContainerId);D.value=!c,g.value=c||{containerId:v.value.target.externalContainerId,id:v.value.target.formId,code:v.value.target.formCode}}else D.value=!1}function d(){var q,c;const F=a.externalFormSchema;Array.from(F.keys()).forEach(t=>{var S,b;const i=F.get(t);((b=(S=v.value)==null?void 0:S.source)==null?void 0:b.externalContainerId)!==t&&V.value.push({containerId:t,id:i.id,code:i.code,name:i.name})}),((c=(q=v.value)==null?void 0:q.source)==null?void 0:c.formId)!==u.id&&V.value.unshift({containerId:"",id:u.id,code:u.code,name:u.name}),s()}function N(){var F,q;if((q=(F=v.value)==null?void 0:F.target)!=null&&q.commandCode){const{commandCode:c,commandViewmodelId:t}=v.value.target,i=O.value.find(S=>S.code===c&&S.viewmodelId===t);C.value=i||{code:v.value.target.commandCode},y.value=!i}else C.value=null,y.value=!1}function I(F){var i,S;const{viewmodels:q,components:c}=F.module;if((q==null?void 0:q.length)===0||(c==null?void 0:c.length)===0)return[];O.value=[];const t=(S=(i=n.sourceCommunication)==null?void 0:i.parameterData)==null?void 0:S.getViewModelName;q.forEach(b=>{if(!b||!b.commands||b.commands.length===0)return[];const $=c.find(B=>B.viewModel===b.id),l=t&&$?t($,b.name,F):"";O.value.push({id:b.id,code:b.code,name:l||b.name}),b.commands.forEach(B=>{B.isInvalid||O.value.push({...B,viewmodelId:b.id,isCommandNode:!0})})})}function o(){var F,q,c;if(!((F=g.value)!=null&&F.id))return[];if(g.value.id===u.id)I(a.getFormSchema());else{const t=a.externalFormSchema.get((q=g.value)==null?void 0:q.containerId);(c=t==null?void 0:t.content)!=null&&c.module&&I(t.content)}N()}e.onMounted(()=>{d(),o()}),e.watch(()=>n.communication,F=>{p.value=n.communication.paramMappings&&n.communication.paramMappings.length>0,s(),o()},{deep:!0});function _(){x.emit("addParameter")}function W(){h.question(`确定删除命令【${r.value}】吗?`,"",()=>{x.emit("deleteCommand")})}function A(){x.emit("toggleParameterPanel")}return()=>e.createVNode("div",{class:"form-container position-relative"},[r.value&&e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",title:f.value},[r.value]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[D.value||y.value?e.createVNode("div",null,[e.createVNode("span",{title:m.value},[e.createVNode("i",{class:"ml-2 f-icon f-icon-flowline-warning text-danger text-tip"},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:F=>W()},null)]):e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-icon f-icon-home-add",title:"新增参数",style:"font-size: 11px;",onClick:_},null),p.value&&e.createVNode("div",{class:"f-icon f-icon-edit-button",title:"收折参数",onClick:()=>A()},null),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:F=>W()},null)])])])])}}),Zt=e.defineComponent({name:"FCombineForm",props:fe,emits:["changed","deleteCommand","addCommand"],setup(n,x){const v=e.inject("useFormSchema"),{saveCommunication:h}=me(v),a=e.ref(n.communication),u=e.computed(()=>{var s,d,N,I;return((d=(s=a.value)==null?void 0:s.source)==null?void 0:d.componentId)&&((I=(N=a.value)==null?void 0:N.source)==null?void 0:I.event)}),V=e.ref(!0),g=e.ref(!0),D=e.ref(),O=e.ref();function C(){h(a.value),x.emit("changed",a.value)}function y(){D.value&&D.value.addParameter(),g.value=!1}function p(){x.emit("deleteCommand")}function r(){g.value=!g.value}const f=e.computed(()=>({"d-none":g.value}));function m(){D.value&&D.value.closeAllParameterPanel()}return x.expose({closeAllParameterPanel:m}),()=>e.createVNode("div",{class:"combine-form-container pb-2"},[u.value&&e.createVNode(e.Fragment,null,[e.createVNode(Xt,{ref:O,communication:a.value,sourceCommunication:n.sourceCommunication,onAddParameter:y,onDeleteCommand:p,onToggleParameterPanel:r},null),V.value&&e.createVNode("div",{class:f.value},[e.createVNode(Yt,{ref:D,communication:a.value,onChanged:C,sourceCommunication:n.sourceCommunication},null)])])])}}),eo=e.defineComponent({name:"FSelectCommunicationCommand",props:fe,emits:["selectCommand","addParameter","deleteCommand","toggleParameterPanel"],setup(n,x){const v=e.inject("useFormSchema"),h=v.getFormMetadataBasicInfo(),a=e.ref([]),u=e.ref(),V=e.ref([]),g=e.ref(),D=e.ref(!0),O=e.ref(!1);function C(){var N;const d=v.externalFormSchema;Array.from(d.keys()).forEach(I=>{var _;const o=d.get(I);((_=n.sourceCommunication)==null?void 0:_.externalContainerId)!==I&&a.value.push({containerId:I,id:o.id,code:o.code,name:o.name})}),((N=n.sourceCommunication)==null?void 0:N.formId)!==h.id&&a.value.unshift({containerId:"",id:h.id,code:h.code,name:h.name})}function y(d){var _,W;const{viewmodels:N,components:I}=d.module;if((N==null?void 0:N.length)===0||(I==null?void 0:I.length)===0)return[];V.value=[];const o=(W=(_=n.sourceCommunication)==null?void 0:_.parameterData)==null?void 0:W.getViewModelName;N.forEach(A=>{if(!A||!A.commands||A.commands.length===0)return[];const F=I.find(c=>c.viewModel===A.id),q=o&&F?o(F,A.name,d):"";V.value.push({id:A.id,code:A.code,name:q||A.name}),A.commands.forEach(c=>{c.isInvalid||V.value.push({...c,viewmodelId:A.id,isCommandNode:!0})})})}function p(){var d,N,I;if(!((d=u.value)!=null&&d.id))return[];if(u.value.id===h.id)y(v.getFormSchema());else{const o=v.externalFormSchema.get((N=u.value)==null?void 0:N.containerId);(I=o==null?void 0:o.content)!=null&&I.module&&y(o.content)}}e.onMounted(()=>{C(),p()});function r(d){u.value=d,D.value=!1,O.value=!0,p()}const f=e.computed(()=>d=>{var N,I;return{item:!0,selected:((N=u.value)==null?void 0:N.id)===d.id&&((I=u.value)==null?void 0:I.containerId)===d.containerId}}),m=e.computed(()=>d=>{var N;return{item:!0,selected:((N=g.value)==null?void 0:N.id)===d.id,"pl-4":d.isCommandNode,disabled:!d.isCommandNode}});function s(d){d.isCommandNode&&(O.value=!1,g.value=d,x.emit("selectCommand",{targetForm:u.value,targetCommand:d}))}return()=>e.createVNode("div",{class:"form-container position-relative"},[D.value&&e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标页面")]),a.value.map(d=>e.createVNode("span",{class:f.value(d),onClick:()=>r(d),title:d.containerId?`所属外部容器:${d.containerId}`:"当前页面"},[d.name]))]),O.value?e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标命令")]),V.value.map(d=>e.createVNode("span",{class:m.value(d),title:d.code,onClick:()=>s(d)},[d.name]))]):""])}}),no=e.defineComponent({name:"FInteractionItem",props:Bt,emits:["addAction","delete","toggle"],setup(n,x){var he,ve;const{guid:v}=se.useGuid(),h=e.inject("FMessageBoxService"),a=e.inject("useMethodsComposition"),{toggleSelectingMethod:u,emitFinalState:V,getViewModeId:g,getMethodsOnViewModel:D,getComponentList:O,updateTarget:C,updateCommandHasPath:y}=a,p=e.inject("useFormSchema"),{clearCommunicationById:r,resolveSourceControlEventTitle:f,resolveCommunication:m,createNewCommunication:s,saveCommunication:d,resolveCommunicationSource:N}=me(p),I=e.ref(n.controllers),o=e.ref(n.interaction),_=e.ref(!1),W=e.computed(()=>{const L=o.value.showSwitch[0];return L.showSection[L.showSwitchNumber][2]}),A=e.ref(n.sourceCommunication.needSelectSourceControl);o.value.shouldShowCommunicationPanel=o.value.shouldShowCommunicationPanel===!1?!1:!!((ve=(he=o.value)==null?void 0:he.communication)!=null&&ve.length)||A.value;const F=e.computed(()=>{var z;const L=!!((z=o.value.command)!=null&&z.id),R=o.value.showSwitch[0],G=R.showSection[R.showSwitchNumber][3];return L&&G}),q=e.ref(o.value.needSelectCommunicationCommand||!1),c=e.ref(),t=e.ref(),i=e.ref(!1),S=e.ref(),b=e.ref([]);function $(){if(A.value){const L=f(o.value.communication);if(L){const{title:R,titleTip:G,isControlInvalid:z}=L;c.value=R,t.value=z?"源表单或事件已失效,请删除":G||R,i.value=z}}else t.value=o.value.event.label,c.value=o.value.event.name}e.onBeforeMount(()=>{m(o.value),$(),S.value=N(o.value)||n.sourceCommunication});const l=e.computed(()=>({"f-icon":!0,"f-icon-arrow-chevron-down":F.value||o.value.shouldShowCommunicationPanel,"f-icon-arrow-chevron-left":!F.value&&!o.value.shouldShowCommunicationPanel}));function B(){var G,z;let L=(G=o.value.command)!=null&&G.id?1:0;L=L+(((z=o.value.communication)==null?void 0:z.length)||0);const R=`确定删除【${c.value}】吗?`;h.question(R,"",()=>{x.emit("delete",n.displayOrder)})}function k(){var z;const L=o.value.showSwitch[0],R=!!((z=o.value.command)!=null&&z.id);o.value.communication&&o.value.communication.length>0&&(o.value.shouldShowCommunicationPanel=!o.value.shouldShowCommunicationPanel),R&&(L.showSection[L.showSwitchNumber][3]=!L.showSection[L.showSwitchNumber][3],x.emit("toggle",n.displayOrder))}function U(){var z,Q;const L=!!((z=o.value.command)!=null&&z.id),R=o.value.communication&&o.value.communication.length>0;if(A.value){q.value=!q.value,(Q=b.value)!=null&&Q.length&&b.value.map(ee=>{ee.closeAllParameterPanel()});return}R&&(o.value.shouldShowCommunicationPanel=!o.value.shouldShowCommunicationPanel);const G=o.value.showSwitch[0];u(G,L),x.emit("addAction",n.displayOrder)}function K(L){const R=o.value.communication!==void 0;L===null&&o.value.command===null&&!R&&x.emit("delete",n.displayOrder),o.value.communication&&(o.value.shouldShowCommunicationPanel=W.value);const G=o.value.showSwitch[0];u(G,R)}function Z(L,R,G){let z=`${R}${G}${L}`,Q=-1;const ee=D();for(;Q===-1;){let ne=!1;for(let te=0;te<ee.length;te++)ee[te].controllerList.forEach(oe=>{oe.label||oe.label===""?ne=oe.label.toLowerCase()===z.toLowerCase()?!0:ne:ne=!1});if(ne)L+=1,z=`${R}${G}${L}`;else{Q=0;break}}return{newName:z,suffix:L}}function M(L){const{method:R,controller:G}=L,{label:z,handlerName:Q,property:ee,componentLists:ne,hasPath:te}=R,oe=g().replace(/-/g,"").replace("component","").replace("viewmodel",""),Se=z.slice(0,1).toUpperCase()+z.slice(1),{newName:Ve,suffix:xe}=Z(1,oe,Se),{controllerName:le}=G,Fe=le.id,ye={id:v(),label:Ve,name:`${R.name}${xe}`,handlerName:Q,hasPath:te,cmpId:Fe,property:ee,componentLists:ne};o.value.command=y(G,ye),o.value.command&&p.designerMode==="PC_RTC"&&(o.value.command.isRtcCommand=!0),o.value.controller={id:le.id,label:le.label,name:le.name,isCommon:le.isCommon};const Y=o.value.showSwitch[0];Y.showSwitchNumber=2,Y.showSection[Y.showSwitchNumber][2]=!1,Y.showSection[Y.showSwitchNumber][3]=!0,_.value=!0,o.value.communication&&o.value.communication.length>0&&(o.value.shouldShowCommunicationPanel=!0),V(!1,null)}function J(){o.value.command={id:"abandoned",label:"未绑定方法",name:"未绑定方法",property:[],hasPath:!1,handlerName:"未绑定方法",cmpId:"",shortcut:{},isRtcCommand:p.designerMode==="PC_RTC"?!0:void 0,isNewGenerated:void 0,extensions:[],isInvalid:!1},o.value.controller={label:"",name:"",id:""},V(!0,o.value.event);const L=o.value.showSwitch[0];u(L,!0)}function X(L,R){var Q;if(o.value.communication||(o.value.communication=[]),o.value.communication.find(ee=>{var ne,te,oe;return((ne=ee.target)==null?void 0:ne.formId)===L.formId&&((te=ee.target)==null?void 0:te.externalContainerId)===L.externalContainerId&&((oe=ee.target)==null?void 0:oe.commandCode)===L.commandCode})){new de.FNotifyService().info({position:"top-center",message:"方法已存在,请勿重复添加。"});return}let z;o.value.communication.length===1&&!((Q=o.value.communication[0].target)!=null&&Q.formId)?(Object.assign(o.value.communication[0].target,L),z=o.value.communication[0]):(z=s(n,o.value.event.label,L,R),o.value.communication.push(z)),V(!1,null),d(z)}function re(L){var G;const R=o.value.showSwitch[0];if(R.showSection[R.showSwitchNumber][2]=!1,(G=o.value.command)!=null&&G.id&&(R.showSection[R.showSwitchNumber][3]=!0),o.value.shouldShowCommunicationPanel=!0,L){const{selectedCommand:z,selectedForm:Q}=L,ee={formId:(Q==null?void 0:Q.id)||"",formCode:(Q==null?void 0:Q.code)||"",externalContainerId:(Q==null?void 0:Q.containerId)||"",commandCode:(z==null?void 0:z.code)||"",commandViewmodelId:(z==null?void 0:z.viewmodelId)||""};X(ee)}}function Le(){const L=o.value.showSwitch[0];L.showSwitchNumber=2,L.showSection[L.showSwitchNumber][2]=!1,L.showSection[L.showSwitchNumber][3]=!0,_.value=!1,o.value.communication&&o.value.communication.length>0&&(o.value.shouldShowCommunicationPanel=!0),V(!1,null)}function Be(){return e.createVNode($t,{controllers:I.value,sourceCommunication:n.sourceCommunication,onClose:K,onSelectMethod:M,onNewFunctionChanged:()=>J(),onAddCommunication:re,haveBoundCommand:n.haveBoundCommand,iteractionDisplayOrder:n.displayOrder,onSelectBoundMethod:Le,event:o.value.event},null)}function Ie(){const L=o.value.showSwitch[0];L.showSection[L.showSwitchNumber][3]=!1}function ke(L){o.value.command=H.cloneDeep(L),V(!1,null)}function qe(L){L.componentLists=O(),C(L),o.value.command=H.cloneDeep(L),V(!1,null)}function De(L){var G;const{controller:R}=o.value;R.isCommon||(G=n.viewSourceHandle)==null||G.call(n,{...L,...o.value})}function Ae(){o.value.command=null,V(!1,null)}function $e(){return e.createVNode(Rt,{command:o.value.command,controller:o.value.controller,showParameter:_.value,showDeleteIcon:o.value.communication&&o.value.communication.length>0,onConfirm:()=>Ie(),onChange:L=>ke(L),onTargetChange:L=>qe(L),onViewSource:L=>De(L),onDeleteCommand:Ae},null)}function Oe(L,R){o.value.communication&&o.value.communication.length>R&&(o.value.communication[R]=L,V(!1,null))}function Re(L,R){var G;o.value.communication&&o.value.communication.length>R&&(o.value.communication.splice(R,1),r(L.id),o.value.communication.length===0&&!((G=o.value.command)!=null&&G.id)?x.emit("delete",n.displayOrder):V(!1,null))}function Ce(L,R){const{source:G,target:z}=L;X(z,G),o.value.shouldShowCommunicationPanel=!0}function we(L,R){return e.createVNode(Zt,{ref:G=>{G&&(b.value[R]=G)},communication:L,event:o.value.event.label,sourceCommunication:n.sourceCommunication,onChanged:G=>Oe(G,R),onDeleteCommand:()=>Re(L,R),onAddCommand:G=>Ce(G)},null)}function be(L){const{targetForm:R,targetCommand:G}=L,z={formId:R.id,formCode:R.code,externalContainerId:R.containerId,commandCode:G.code,commandViewmodelId:G.viewmodelId};X(z,S.value),o.value.shouldShowCommunicationPanel=!0,q.value=!1,o.value.needSelectCommunicationCommand=!1}function Ne(){return e.createVNode(eo,{sourceCommunication:n.sourceCommunication,onSelectCommand:L=>be(L)},null)}return()=>e.createVNode("div",{class:"show-switch"},[e.createVNode("div",{class:"f-page-events-editor-bound-event"},[e.createVNode("div",{class:"f-page-events-editor-bound-event-name",title:t.value},[c.value]),!i.value&&e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:l.value,style:"font-size: 10px;",onClick:k},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",style:"font-size: 13px;float: right; margin:8px;",onClick:B},null),!i.value&&e.createVNode("div",{class:"f-icon f-icon-home-add",style:"float:right; font-size: 10px; margin:8px;",onClick:U},null),i.value&&e.createVNode("div",{class:"f-icon f-icon-flowline-warning text-danger text-tip",title:"源表单或事件已失效,请删除",style:"float:right; font-size: 13px; margin:8px;"},null)]),W.value&&Be(),q.value&&Ne(),F.value&&$e(),!i.value&&o.value.shouldShowCommunicationPanel&&o.value.communication&&o.value.communication.length>0?o.value.communication.map((L,R)=>we(L,R)):""])}});function to(n,x,v){const{interactions:h}=x,{setComponentLists:a}=Je(),u=e.ref(n.value.internalCommandList);function V(c){h.value[c].showSwitch=[],h.value[c].showSwitch.push(H.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),h.value=H.cloneDeep(h.value)}function g(c){var i;const t=[];return(i=n.value.newController)==null||i.forEach(S=>{c.forEach(b=>{S.Code===b.controller.label&&t.push(H.cloneDeep(S))})}),t}function D(c){if(n.value.repititionCommand.length!==0)return n.value.repititionCommand.forEach(t=>{c.forEach(i=>{var S,b,$,l;if(t.command.id===((S=i.command)==null?void 0:S.id)){t.command.params=H.cloneDeep((b=i.command)==null?void 0:b.property);const B=($=i.command)==null?void 0:$.targetComponent;(l=i.command)==null||l.componentLists.forEach(k=>{t.targetComponent=k.componentId===B?{id:k.componentId,viewModelId:k.viewModelId}:t.targetComponent})}})}),n.value.repititionCommand}function O(c=!1,t=null){var l;n.value.newFuncEvents=t?H.cloneDeep(t):null,n.value.isAddControllerMethod=c;const i=[],S=H.cloneDeep(n.value.internalCommandList);h.value.map(B=>{const k=H.cloneDeep(B.controller),U=H.cloneDeep(B.command),K=H.cloneDeep(B.event),Z=H.cloneDeep(B.communication),M={controller:k,command:U,boundEvents:K,communication:Z};i.push(H.cloneDeep(M))});const b=(l=n.value.newController)!=null&&l.length&&i.length?H.cloneDeep(g(i)):[];n.value.repititionCommand&&(n.value.repititionCommand=D(i));const $={viewModelId:n.value.viewModelId,savedCommand:H.cloneDeep(n.value.viewModel),boundEventsList:H.cloneDeep(i),events:H.cloneDeep(n.value.events),internalCommandList:H.cloneDeep(S),componentLists:[],relativePath:n.value.relativePath,envType:n.value.envType,newController:H.cloneDeep(b),isAddControllerMethod:n.value.isAddControllerMethod,repititionCommand:n.value.repititionCommand,preCommand:n.value.preCommand,newFuncEvents:n.value.newFuncEvents};v.emit("savedCommandListChanged",$)}function C(c){c.showSection[c.showSwitchNumber][2]=!0}function y(c){c.showSection[c.showSwitchNumber][2]=!1}function p(c){c.showSection[c.showSwitchNumber][3]=!0}function r(c){c.showSection[c.showSwitchNumber][3]=!1}function f(c,t=!1){c.showSection[c.showSwitchNumber][2]?(y(c),t&&p(c)):(C(c),t&&r(c))}function m(){return n.value.componentLists}function s(c){n.value.viewModel.forEach(t=>{for(let i=0;i<t.controllerList.length;i++)t.controllerList[i].label===c.label&&(t.controllerList[i]=H.cloneDeep(c))})}function d(){return n.value.viewModelId}function N(){return n.value.getEventPath?n.value.getEventPath().viewModelDisplay:[]}function I(c,t){return a(c,t,n.value)}function o(c){n.value.newController=n.value.newController||[],n.value.newController.push(H.cloneDeep(c));const t=n.value.newController;for(let i=0;i<t.length;i++)for(let S=i+1;S<t.length;S++)t[i].Id===t[S].Id&&(t.splice(S,1),S--)}function _(c){let t=!1;return n.value.internalCommandList.forEach(i=>{if(i.controllerName.label===c.controllerName.label){t=!0;return}}),t||n.value.internalCommandList.push(c),t}function W(){var c;if((c=n.value)!=null&&c.getEventPath)return n.value.getEventPath()}function A(c,t){h.value.forEach(i=>{var S;((S=i.command)==null?void 0:S.label)===t.label&&(i.command=t)})}function F(c,t){A(c,t)}function q(c,t){const i=h.value[t];c.event=c.event.label?c.event:H.cloneDeep(i.event);let S=!1;n.value.repititionCommand||(n.value.repititionCommand=[]),n.value.repititionCommand.forEach(l=>{l.command.id===c.command.id&&l.event.label===c.event.label&&l.targetComponent.viewModelId===c.targetComponent.viewModelId&&(S=!0),l.command.id===c.command.id&&l.event.label===c.event.label&&l.targetComponent.viewModelId!==c.targetComponent.viewModelId&&(l=H.cloneDeep(c))}),S||n.value.repititionCommand.push(H.cloneDeep(c));let b={id:c.command.id,label:c.command.label,name:c.command.name,handlerName:c.command.handlerName,cmpId:c.controller.id,componentLists:[],hasPath:!1,targetComponent:c.targetComponent.id,property:H.cloneDeep(c.command.params),shortcut:{},isRtcCommand:c.command.isRtcCommand,isNewGenerated:c.command.isNewGenerated||!1,isInvalid:!1};const $={controllerName:c.controller};b=a($,b,n.value),i.command=H.cloneDeep(b),i.controller=H.cloneDeep(c.controller),F(i,b)}return{controllers:u,onClosed:V,emitFinalState:O,toggleSelectingMethod:f,getViewModeId:d,getComponentList:m,updateTarget:s,updateCommandHasPath:I,addNewController:o,checkIfNewControllerExists:_,getMethodsOnViewModel:N,getEventPath:W,selectBoundCommand:q}}const pe=e.defineComponent({name:"FEventsEditor",props:Pe,emits:["savedCommandListChanged"],setup(n,x){const v=e.ref(n.initialData),h=e.inject("designer-host-service"),a=jt(v),{loadEvents:u,resetBoundEvents:V}=a,g=e.inject("useFormSchema"),D=yt(g,a),{addNewInteraction:O,deleteInteracton:C,interactions:y,loadInteractions:p}=D,r=to(v,D,x),{emitFinalState:f,controllers:m}=r;e.provide("useEventsComposition",a),e.provide("useInteractionCompostion",D),e.provide("useMethodsComposition",r);function s(){v.value.isAddControllerMethod=!1}function d(){var F,q;const A=(q=(F=v.value)==null?void 0:F.sourceCommunication)==null?void 0:q.externalContainerId;if(A){const{assembleSourceOutline:c}=me(g),t=c(h,x,A);e.provide("sourceOutlineData",t)}}e.onMounted(()=>{s(),V(),u(),p(),d()});function N(A){C(A),f(!1,null)}function I(A,F){const q=A.showSwitch[0],c=q.showSection[q.showSwitchNumber][3];let t=!1;return n.initialData.getEventPath&&(n.initialData.getEventPath().actionWithPath.length!==0?t=!0:t=!1),e.createVNode(no,{key:`${F}`,controllers:m.value,interaction:A,displayOrder:F,collapsed:c,onDelete:N,sourceCommunication:v.value.sourceCommunication,viewSourceHandle:n.viewSourceHandle,haveBoundCommand:t},null)}function o(){var A;return(A=y.value)==null?void 0:A.map((F,q)=>{var t;let c=F.event.label;return(t=F.communication)!=null&&t.length&&(c=`${F.communication.map(S=>S.id).join("-")}_${c}`),e.createVNode("div",{class:"events-display-order",key:`${c}_${q}`},[I(F,q)])})}function _(A){O(A)}function W(A){const F=A.source;if(y.value.find(c=>{var t;if((t=c.communication)!=null&&t.length&&c.communication.find(S=>{var b,$,l;return((b=S.source)==null?void 0:b.formId)===F.formId&&(($=S.source)==null?void 0:$.componentId)===F.componentId&&((l=S.source)==null?void 0:l.event)===F.event}))return!0})){new de.FNotifyService().info({position:"top-center",message:"事件已存在,请勿重复添加。"});return}O({label:"onCommunication",name:"组件通讯"},A)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(Lt,{sourceCommunication:v.value.sourceCommunication,onClickEventItem:_,onSelectSourceControl:W},null),o()])])}}),oo={install(n){n.component(pe.name,pe)},register(n,x,v,h){n["events-editor"]=pe,x["events-editor"]=Ke}};w.FEventsEditor=pe,w.default=oo,w.eventsEditorProps=Pe,w.propsResolver=Ke,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(N,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../dynamic-resolver/index.umd.js"),require("lodash-es"),require("../common/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../notify/index.umd.js"),require("../tree-view/index.umd.js"),require("../schema-selector/index.umd.js"),require("../modal/index.umd.js"),require("../input-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../event-parameter/index.umd.js"),require("../locale/index.umd.js"),require("../accordion/index.umd.js"),require("../../designer/avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../button/index.umd.js"),require("../calendar/index.umd.js"),require("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../../designer/dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../../designer/nav/index.umd.js"),require("../number-range/index.umd.js"),require("../../designer/number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../../designer/modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../../designer/wizard/index.umd.js"),require("../tooltip/index.umd.js"),require("../property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../dynamic-resolver/index.umd.js","lodash-es","../common/index.umd.js","../designer-canvas/index.umd.js","../notify/index.umd.js","../tree-view/index.umd.js","../schema-selector/index.umd.js","../modal/index.umd.js","../input-group/index.umd.js","../combo-list/index.umd.js","../event-parameter/index.umd.js","../locale/index.umd.js","../accordion/index.umd.js","../../designer/avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../button/index.umd.js","../calendar/index.umd.js","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../../designer/dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../../designer/nav/index.umd.js","../number-range/index.umd.js","../../designer/number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../text/index.umd.js","../../designer/time-picker/index.umd.js","../transfer/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../../designer/tree-grid/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../../designer/modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../../designer/wizard/index.umd.js","../tooltip/index.umd.js","../property-panel/index.umd.js"],e):(N=typeof globalThis<"u"?globalThis:N||self,e(N["events-editor"]={},N.Vue,N.dynamicResolver,N.LodashES,N.common,N.designerCanvas,N.notify,N.FTreeview,N.FSchemaSelector,N.modal,N.FInputGroup,N.FComboList,N.FEventParameter,N.locale,N.FAccordion,N.FAvatar,N.FButtonEdit,N.FButtonGroup,N.FButton,N.FCalendar,N.FCapsule,N.FCheckbox,N.FCheckboxGroup,N.FComboTree,N.FComponent,N.FColorPicker,N.FContentContainer,N.FDatePicker,N.FDataGrid,N.FDropdown,N.FDynamicForm,N.FEventsEditor$1,N.FFilterBar,N.FFieldSelector,N.FBindingSelector,N.FImageCropper,N.FInputGroup$1,N.FLayout,N.FListNav,N.FListView,N.FLookup,N.FMappingEditor,N.FNav,N.FNumberRange,N.FNumberSpinner,N.FOrder,N.FPageHeader,N.FPageFooter,N.FPagination,N.FProgress,N.FQuerySolution,N.FRadioGroup,N.FRate,N.FResponseToolbar,N.FResponseLayout,N.FResponseLayoutEditorSetting,N.FSearchBox,N.FSection,N.FSmokeDetector,N.FSplitter,N.FStep,N.FSwitch,N.FTabs,N.FTags,N.FText,N.FTimePicker,N.FTransfer,N.FUploader,N.FVerifyDetail,N.FVideo,N.FTextArea,N.FTreeGrid,N.FFilterConditionEditor,N.FFieldset,N.FSortConditionEditor,N.FMenuLookup,N.FDrawer,N.FJsonEditor,N.FPropertyEditor,N.FExpressionEditor,N.FCodeEditor,N.FHtmlTemplate,N.FCollectionPropertyEditor,N.FModal,N.FExternalContainer,N.FLanguageTextbox,N.FImage,N.FComment,N.FWizard,N.FTooltip))})(this,function(N,e,ae,W,se,Xe,de,Ue,Ge,Ze,en,_e,Ee,nn,tn,on,an,rn,cn,ln,dn,ze,He,sn,un,mn,fn,hn,vn,pn,gn,Cn,wn,bn,Nn,Sn,Vn,xn,Fn,yn,jn,En,Pn,Mn,Tn,Ln,Bn,kn,In,qn,Dn,An,On,$n,Rn,Un,Gn,_n,zn,Hn,Wn,Kn,Jn,Qn,Yn,Xn,Zn,et,nt,tt,ot,at,rt,it,ct,lt,dt,st,ut,mt,ft,ht,vt,pt,gt,Ct,wt,bt,Nt,St){"use strict";const Vt=new Map([["appearance",ae.resolveAppearance]]);function xt(n,V,p){return V}const Ft={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/events-editor.schema.json",title:"events-editor",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for events-editor",type:"string"},type:{description:"The type events of events-editor",type:"events",default:"events-editor"},initialData:{description:"",type:"object",default:{}},viewSourceHandle:{description:"",type:"function",default:null}},required:["id","type"]},yt={title:"events-editor",description:"A Farris Component",type:"object",categories:{}},We=[{label:"pageChange",name:"MockMock切换页码"},{label:"pageSizeChanged",name:"Mock分页条数变化事件"},{label:"scrollYLoad",name:"Mock滚动加载事件"},{label:"onEditClicked",name:"Mock操作列点击编辑"},{label:"onDeleteClicked",name:"Mock操作列点击删除"}],Pe={initialData:{type:Object,default:{propertyID:"data-grid-component-viewmodel",propertyType:"events",internalCommandList:[{controllerName:{id:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",label:"ListController",name:"列表控制器"},controllerList:[{id:"93ee1cd2-cf0b-40b3-b99f-958a3d1fad1c",label:"Load",name:"Mock加载数据",handlerName:"Load"},{id:"71ae8a4c-6202-4875-9246-2e2d959da37f",label:"Search",name:"Mock查询",handlerName:"Search"},{id:"77556491-41c0-4356-8ccf-25e39817060e",label:"Add",name:"Mock添加数据",handlerName:"Add"},{id:"52fdcac3-46c8-466e-aa5d-19920ece2076",label:"View",name:"Mock查看数据",handlerName:"View"},{id:"7ade9996-0531-4401-b1bc-fb9ec8ee3f8e",label:"Edit",name:"Mock编辑数据",handlerName:"Edit"},{id:"6d5a354f-871f-43e6-82bc-7837184380d3",label:"RemoveRows",name:"Mock删除选中行",handlerName:"RemoveRows"},{id:"1a1b7c33-38f0-469f-a017-223086ee6259",label:"ChangePage",name:"Mock切换页码",handlerName:"ChangePage"},{id:"debae2dd-3387-48cf-90ba-96e74ab5a8e5",label:"Remove",name:"Mock删除指定数据",handlerName:"Remove"}]}],events:We,boundEventsList:[],viewModel:[],componentLists:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],allComponentList:[{componentId:"root-component",viewModelId:"root-viewmodel"},{componentId:"data-grid-component",viewModelId:"data-grid-component-viewmodel"}],newController:[],isAddControllerMethod:!1,getEventList:()=>({events:We,boundEventsList:[]})}},viewSourceHandle:{type:Function,default:()=>{}}},Ke=ae.createPropsResolver(Pe,Ft,Vt,xt,yt);function Je(){function n(p,s){const a=[{controllerId:"45be24f9-c1f7-44f7-b447-fe2ada458a61",controllerLabel:"AdvancedListCardController",controllerName:"高级列卡控制器",commands:[{name:"增加子表数据",id:"250cd2a2-9995-4c01-64aa-5029afba08ca",handlerName:"AddItem"},{name:"删除子表数据",id:"a2c06958-29b1-0582-5f3e-c3cfcc741f8f",handlerName:"RemoveItem"},{name:"插入数据",id:"3208b00c-543d-c050-3c54-081715972dda",handlerName:"Insert"},{name:"查询从表数据(分页)",id:"b60b7754-35cf-7eaa-0f1d-bc5e5d61c0bc",handlerName:"queryChild"},{name:"批量删除子表",id:"378fcd7d-ce91-c052-5947-d60ecdb38df9",handlerName:"batchDelete"},{name:"移动数据",id:"fcac5d5e-2367-2b61-a82a-f8e874e8efc0",handlerName:"move"},{name:"打开批量编辑界面",id:"8d8b05d6-2d22-b0b7-7cb8-51bbb8cd8a18",handlerName:"openBatchEditDialog"}]},{controllerId:"d7ce1ba6-49c7-4a27-805f-f78f42e72725",controllerLabel:"EditableListController",controllerName:"可编辑列表控制器",commands:[{name:"打开批量编辑界面",id:"c3831e36-27d1-1c98-dd60-30e2d7ec04d2",handlerName:"openBatchEditDialog"},{name:"加载列表数据",id:"f80e026b-bd9b-002b-d2aa-52c44a633bec",handlerName:"Load"}]},{controllerId:"8fe977a1-2b32-4f0f-a6b3-2657c4d03574",controllerLabel:"TreeCardController",controllerName:"树卡控制器",commands:[{name:"新增子表数据",id:"21b0c3af-3caf-b11d-2360-d9af20016501",handlerName:"AddItem"},{name:"删除子表数据",id:"113f1d77-65a4-63bf-3973-80dd15f294d1",handlerName:"RemoveItem"},{name:"批量删除子表",id:"bf13585c-a8f3-384b-356c-bd8bf06751c4",handlerName:"batchDelete"}]},{controllerId:"8d21e69c-70b3-44f6-88b5-fd6a8d3ce11b",controllerLabel:"PopController",controllerName:"弹出控制器",commands:[{name:"新增子表数据",id:"d6933772-8047-9bde-220b-449481883142",handlerName:"AddItem"},{name:"删除子表数据",id:"03c233eb-e39e-8e34-6809-ee4ab3a0d97c",handlerName:"RemoveItem"},{name:"加载并新增",id:"6882ab4a-9c23-8d59-6aac-de891eae20d2",handlerName:"LoadAndAdd"}]},{controllerId:"43f68561-eae4-4495-b318-d629615523f8",controllerLabel:"BatchEditCommands",controlleName:"批量编辑控制器",commands:[{name:"打开批量编辑界面",id:"a659aaba-daa4-3c07-8b26-164b01726022",handlerName:"openBatchEditDialog"},{name:"复制行",id:"d5f67e0a-767d-a238-5ad4-b1285476c16f",handlerName:"copyRow"},{name:"复制行",id:"229d2dd3-2fe7-f06a-b705-cfa0fc711614",handlerName:"clone"}]},{controllerId:"c121742e-6028-48bf-817c-1dda7fb098df",controllerLabel:"AdvancedListCardWithSidebarController",controllerName:"高级列卡控制器(侧边栏)",commands:[{name:"增加子表数据(侧边栏)",id:"250cd2a2-9995-4c01-64aa-5029afba08ca",handlerName:"AddItem"},{name:"删除子表数据(侧边栏)",id:"a2c06958-29b1-0582-5f3e-c3cfcc741f8f",handlerName:"RemoveItem"}]},{controllerId:"8172a979-2c80-4637-ace7-b13074d3f393",controllerLabel:"CardController",controllerName:"卡片控制器",commands:[{name:"新增子表数据",id:"6f987222-ebe2-0f3c-1594-a12408b22801",handlerName:"AddItem"},{name:"删除子表数据",id:"0cdeddcc-8332-f13f-be96-b5eeac84a334",handlerName:"RemoveItem"},{name:"插入数据",id:"2666b526-a1b2-f268-1629-b1b95b71c8dd",handlerName:"Insert"},{name:"打开批量编辑界面",id:"8104dd8e-bb27-a659-ff7c-a0321523f727",handlerName:"openBatchEditDialog"},{name:"新增子节点(子表树)",id:"bbd11957-de2a-c727-11d6-64788c4b0fa8",handlerName:"addSubChild"},{name:"删除子表树节点",id:"c8c9f652-ba52-3a9b-5eb9-dadd42c832cd",handlerName:"RemoveTreeItem"},{name:"批量删除子表",id:"e96857fa-1617-fd92-8a05-5c684e0819a1",handlerName:"batchDelete"}]},{controllerId:"31c1022c-ab40-4e8d-bc31-85d539f1d36c",controllerLabel:"FileController",controllerName:"文件控制器",commands:[{name:"批量删除文件数据",id:"d5bf021b-1aa4-06fe-3236-188fd218f4f7",handlerName:"removeFileRows"}]},{controllerId:"2eb7bbd1-fabd-4d0f-991d-7242f53225b1",controllerLabel:"AttachmentController",controllerName:"附件控制器",commands:[{name:"上传并更新行",id:"2a84e28f-7202-d858-1466-748a8040c1f9",handlerName:"UploadAndUpdateRow"},{name:"通过属性名上传并更新行",id:"0f98c9b8-a01b-55d4-3115-269a73f7ccff",handlerName:"uploadAndUpdateRowWithPropertyName"},{name:"移除版本附件行",id:"b441b6a7-9e13-9f75-77a2-10b2c1f7ef26",handlerName:"RemoveAttachmentItem"},{name:"上传并批量新增行",id:"e6fc25ca-853b-0b2d-76c9-a1f7a253679b",handlerName:"UploadAndBatchAddRows"},{name:"通过属性名上传并批量更新行",id:"e00b70db-9de3-8e3e-eb59-1c550a255fec",handlerName:"uploadAndBatchAddRowsWithPropertyName"}]},{controllerId:"e353b4e9-e073-4e18-b9f7-ec4cc8ac72b1",controllerLabel:"PrintService",controllerName:"打印控制器",commands:[{name:"根据数据条件批量打印",id:"774fa275-2da1-e927-e8bf-d27d9886a168",handlerName:"printMulti"}]},{controllerId:"70b4abd4-9f2c-4b7c-90e9-6ac6f4b74c72",controllerLabel:"ListController",controllerName:"列表控制器",commands:[{name:"加载数据",id:"86c9f281-e5bc-5d5c-1b86-d1e17ab2e850",handlerName:"Load"}]},{controllerId:"7c48ef46-339c-42d4-8365-a21236c63044",controllerLabel:"ListCardController",controllerName:"列卡控制器",commands:[{name:"加载列表数据",id:"e573d6a2-8261-9ad4-c9f1-2e59af53302d",handlerName:"loadList"}]},{controllerId:"26436aa8-88a7-4aee-bf0b-9843c1e8afbf",controllerLabel:"ListListController",controllerName:"双列表控制器",commands:[{name:"加载导航列表数据",id:"f7dd2c84-7abd-d4bf-6b31-71d96035c034",handlerName:"LoadNavList"}]}];let f=-1;const F=a.findIndex(g=>p===g.controllerId);return F!==-1&&(f=a[F].commands.findIndex(g=>s===g.handlerName)),f!==-1}function V(p,s,a){const f=n(p.controllerName.id,s.handlerName);return a.componentLists.length!==0&&f&&(s.hasPath=!0,s.targetComponent=s.targetComponent||a.componentLists[0].componentId,s.componentLists=W.cloneDeep(a.componentLists)),s}return{isContextDependent:n,setComponentLists:V}}var ce=(n=>(n.Frame="frame",n.dataGrid="data-grid",n.listView="list-view",n.form="form",n.uploader="uploader",n.calendar="calendar",n.page="page",n))(ce||{});function jt(n,V){const p=e.inject("designerContext"),s=p&&p.dgControl?p.dgControl:Xe.DgControl,a=e.ref(""),f=e.ref("");function F(r){var l,m,b,t;let v="controlIcon fd-i-Family ",h="";switch(r==null?void 0:r.type){case"form-group":{h=((l=s[r.type])==null?void 0:l.icon)||((m=r.editor)==null?void 0:m.type)||"",(b=s[r.editor.type])!=null&&b.icon&&(h=s[r.editor.type].icon);break}default:h=((t=s[r.type])==null?void 0:t.icon)||r.type}const u=`fd_pc-${h}`;return v+=u,v}function g(r,v){var l;let h=r.id;const u=v==null?void 0:v.contents;if((v==null?void 0:v.type)==="splitter"&&u&&u.length===2){const m=v.direction!=="column";r.id===((l=u[0])==null?void 0:l.id)?h=m?"左侧区域":"上方区域":h=m?"右侧区域":"下方区域"}return h}function I(r){if(r.isLikeCardContainer)return"区块";const v=r.appearance&&r.appearance.class||"",h=v.split(" ");return r.id==="page-header"&&v&&v==="f-page-header"?"页头":h.includes("f-page-header-base")?"页头容器":h.includes("f-page-header-extend")?"页头扩展容器":h.includes("f-title")?"标题容器":h.includes("f-page")?"根容器":h.includes("f-page-main")?"内容区域":h.includes("f-scrollspy-content")&&r.isScrollspyContainer?"滚动监听容器":h.includes("f-grid-is-sub")?"表格容器":h.includes("f-filter-container")?"筛选条容器":"容器"}function O(r){const{componentType:v}=r;switch(v){case ce.Frame:return"根组件";case ce.dataGrid:return(n==null?void 0:n.formSchemaUtils.selectNode(r,u=>u.type===(s["tree-grid"]&&s["tree-grid"].type)))?"树表格组件":"表格组件";case ce.uploader:return"附件组件";case ce.listView:return"列表视图组件";case ce.form:return"卡片组件";case ce.calendar:return"日历组件";case ce.page:return r.name||"页面";default:return"组件"}}function w(r,v){const h=r.name||r.text||r.label||r.title||r.mainTitle;if(r.type!=="component"&&h&&typeof h=="string")return h.trim();switch(r.type){case"content-container":return I(r);case"splitter-pane":return g(r,v);case"component":return O(r);default:return s[r.type]&&s[r.type].name||r.id}}function j(r,v){const h=r.length?r[0]:null;if(!h)return;f.value="",a.value=h.originalId;const u=h?`${h.originalId}-design-item`:"",l=document.getElementById(u);l&&l.click(),V.emit("selectionChanged",h)}function C(r){if(!r)return;const v=`${r}-design-item`,h=document.getElementById(v);h&&h.click()}return{getIcon:F,getTitle:w,onChanged:j,currentSelectedNodeId:a,currentSelectedOutsideNodeId:f,triggerOutsideClick:C}}function Et(n,V){const{getIcon:p,getTitle:s}=V;function a(w,j,C,r,v){var u;const h=(u=n.data.module)==null?void 0:u.components.find(l=>l.id===w.component);h&&f([h],j,C,r,v)}function f(w,j,C,r,v){return w.forEach(h=>{if(h.type==="component"&&(v=h.id),h.type==="component-ref"){a(h,j,C,r,v);return}const u={originalId:h.id,layer:C,originalParent:r==null?void 0:r.id,componentId:v,name:s(h,r),type:h.type,controlIcon:p(h),rawSchema:h};j.push(W.cloneDeep(u)),(h.contents||h.buttons)&&f(h.contents||h.buttons,j,C+1,h,v)}),j}function F(w){const j=[],C=w.find(u=>u.layer===0);w=w.filter(u=>u.layer!==0),j.push(C);let r=C.originalId,v=0,h=1e3;for(;w.length!==0||h===0;){const u=w.find(l=>l.originalParent===r);u?(j.push(u),r=u.originalId,w=w.filter(l=>l.originalId!==r),v=0):(v-=1,r=j.slice(v)[0].originalId),h-=1}return j}function g(w){return w.forEach((j,C)=>{j.id=(C+1).toString()}),w.forEach(j=>{var C;j.parent=((C=w.find(r=>r.originalId===j.originalParent))==null?void 0:C.id)||""}),w.forEach(j=>{j.hasChildren=w.findIndex(C=>C.parent===j.id)>0}),w}function I(w){const j={originalId:n.data.module.id,layer:0,originalParent:null,name:"页面",type:"module",controlIcon:"controlIcon fd-i-Family fd_pc-module",rawSchema:n.data.module},C=[];return w.forEach(r=>{r[0].originalParent=j.originalId,C.push(...r)}),C.unshift(j),C}function O(){const w=n.data.module?e.ref(n.data.module.components):e.ref([n.data]);if(!w.value)return;const j=[];w.value.forEach(h=>{if(h){const u=[];u.push(h);const b=f(u,[],1,null,h.id);j.push(b)}});const C=I(j),r=F(C);return g(r)}return{getData:O}}function me(n){const V=e.inject("sourceOutlineData")||[],p=e.ref(),s=e.ref(!1),a=e.ref([]),f=e.ref();function F(u,l,m,b){var t,U,z,A;return{id:se.useGuid().guid(),source:b||{formId:(t=u.sourceCommunication)==null?void 0:t.formId,formCode:(U=u.sourceCommunication)==null?void 0:U.formCode,componentId:(z=u.sourceCommunication)==null?void 0:z.componentId,externalContainerId:(A=u.sourceCommunication)==null?void 0:A.externalContainerId,event:l||"onCommunication"},target:{formId:(m==null?void 0:m.formId)||"",formCode:(m==null?void 0:m.formCode)||"",externalContainerId:(m==null?void 0:m.externalContainerId)||"",commandCode:(m==null?void 0:m.commandCode)||"",commandViewmodelId:(m==null?void 0:m.commandViewmodelId)||""},paramMappings:[]}}function g(u){var l,m;(l=u==null?void 0:u.communication)!=null&&l.length&&((m=u==null?void 0:u.communication)==null||m.map(b=>{var t,U;if(b!=null&&b.id&&!((t=b==null?void 0:b.source)!=null&&t.componentId)){const z=(U=n.getFormSchema().module.communications)==null?void 0:U.find(A=>A.id===(b==null?void 0:b.id));z&&Object.assign(b,z)}}))}function I(u){const l=n.getFormSchema(),{communications:m}=l.module;m||(l.module.communications=[]);const b=l.module.communications.findIndex(t=>t.id===u.id);b===-1?l.module.communications.push(u):Object.assign(l.module.communications[b],u)}function O(u){var l;if((l=u==null?void 0:u.communication)!=null&&l.length){const m=n.getFormSchema();u.communication.map(b=>{m.module.communications&&b&&(m.module.communications=m.module.communications.filter(t=>t.id!==b.id))}),u.communication=[]}}function w(u){var m;const l=n.getFormSchema();u&&((m=l.module.communications)!=null&&m.length)&&(l.module.communications=l.module.communications.filter(b=>b.id!==u))}function j(u,l,m){const b=jt(u,l),t=n.externalFormSchema.get(m);if(t!=null&&t.content){const U={data:t.content},{getData:z}=Et(U,b);return z()}return[]}function C(u){var m;if(!((m=u==null?void 0:u.source)!=null&&m.componentId)){s.value=!1;return}const l=V.find(b=>b.originalId===u.source.componentId);l?(s.value=!1,p.value=l):(s.value=!0,p.value={id:u.source.componentId})}function r(u){var t,U,z,A;a.value=[];const l=(t=p.value)==null?void 0:t.rawSchema;if(!l){f.value=null;return}const m=l.type==="form-group"&&l.editor?l.editor.type:l.type,b=(U=ae.schemaMap[m])==null?void 0:U.events;b&&Object.keys(b).forEach(y=>{a.value.push({eventCode:y,eventName:b[y]})}),(z=u.source)!=null&&z.event&&((A=a.value)!=null&&A.length)&&(f.value=a.value.find(y=>{var D;return y.eventCode===((D=u.source)==null?void 0:D.event)}))}function v(u){var b,t,U,z,A,y,D,c;if(!(u!=null&&u.length))return;C(u[0]),r(u[0]);let l="",m="";return s.value?l=`${((b=u[0].source)==null?void 0:b.componentId)||""}-${((t=u[0].source)==null?void 0:t.event)||""}`:(l=(U=p.value)==null?void 0:U.name,l&&((z=f.value)!=null&&z.eventName)&&(l+=`-${(A=f.value)==null?void 0:A.eventName}`),m=`${(y=p.value)==null?void 0:y.name} (${(D=p.value)==null?void 0:D.originalId})`,m=`${m}
2
+ ${(c=f.value)==null?void 0:c.eventName} (${f.value.eventCode})`),{title:l,titleTip:m,isControlInvalid:s.value}}function h(u){var l;if((l=u==null?void 0:u.communication)!=null&&l.length){const m=u==null?void 0:u.communication[0];return m==null?void 0:m.source}}return{createNewCommunication:F,resolveCommunication:g,clearAllCommunication:O,clearCommunicationById:w,saveCommunication:I,assembleSourceOutline:j,resolveSourceControlEventTitle:v,resolveCommunicationSource:h}}function Pt(n,V,p){const s=e.ref([]),{boundEvents:a,unBoundEvent:f}=V;function F(C){var v,h;return{event:{label:(v=C.boundEvents)==null?void 0:v.label,name:(h=C.boundEvents)==null?void 0:h.name},showSwitch:[{showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2}],command:W.cloneDeep(C.command),controller:W.cloneDeep(C.controller),communication:C.communication}}function g(){var C;s.value=(C=a.value)==null?void 0:C.map(r=>F(r))}function I(C,r){const h=F({boundEvents:C,command:null,controller:{id:"",name:"",label:""},communication:r?[r]:[]});if(r){h.showSwitch[0].showSwitchNumber=2,h.showSwitch[0].showSection[2][2]=!1,h.showSwitch[0].showSection[2][3]=!1,h.needSelectCommunicationCommand=!0,s.value.unshift(h);return}C&&(h.showSwitch[0].showSwitchNumber=1,h.showSwitch[0].showSection[2][3]=!0,s.value.unshift(h))}function O(){var C;(C=s.value)==null||C.forEach(r=>{r.showSwitch.forEach(v=>{v.showSection[2][3]=!1}),r.shouldShowCommunicationPanel=!1})}function w(C){s.value[C].showSwitch.forEach(r=>{r.showSection[2][3]=!r.showSection[2][3]})}function j(C){if(C>=0&&C<=s.value.length-1){const r=s.value[C];f(r.event),s.value.splice(C,1);const{clearAllCommunication:v}=me(n);v(r)}}return{addNewInteraction:I,collapseInteractions:O,deleteInteracton:j,toggleMethodInInteraction:w,interactions:s,loadInteractions:g}}function Mt(n){const V=e.ref([]),p=e.ref([]),s=e.ref([]),{isContextDependent:a}=Je();function f(){const{allComponentList:C}=n.value;n.value.componentLists.length&&n.value.viewModel&&n.value.viewModel.forEach(r=>{r.controllerList.forEach(v=>{if(v.targetComponent){const h=C.find(l=>l.componentId===v.targetComponent);if((h?h.viewModelId:void 0)===n.value.viewModelId)v.hasPath=!1;else{const l=a(r.controllerName.id,v.handlerName);v.hasPath=l?!0:v.hasPath,v.componentLists=l?W.cloneDeep(n.value.componentLists):v.componentLists}}})}),n.value.componentLists.length&&n.value.boundEventsList&&n.value.boundEventsList.forEach(r=>{var v;if((v=r.command)!=null&&v.targetComponent){const h=C.find(l=>{var m;return l.componentId===(((m=r.command)==null?void 0:m.targetComponent)||"")});if((h?h.viewModelId:void 0)===n.value.viewModelId)r.command.hasPath=!1;else{const l=a(r.controller.id,r.command.handlerName);r.command.hasPath=l?!0:r.command.hasPath,r.command.componentLists=l?W.cloneDeep(n.value.componentLists):r.command.componentLists}}})}function F(){const C=p.value.reduce((v,h)=>(v.set(h.boundEvents.label,!0),v),new Map);return V.value.filter(v=>!C.has(v.label))}function g(){var r;const C=((r=p.value)==null?void 0:r.length)>0;s.value=C?F():V.value}function I(){f(),V.value=n.value.events,p.value=n.value.boundEventsList,g()}function O(C){s.value=s.value.filter(r=>r.label!==C.label)}function w(C){p.value=p.value.filter(r=>r.boundEvents.label!==C.label),g()}function j(){var v;const C=(v=n.value)==null?void 0:v.getEventList(),{events:r}=C;C&&(n.value.events=W.cloneDeep(r),n.value.boundEventsList=C.boundEventsList),n.value.boundEventsList&&(n.value.boundEventsList=n.value.boundEventsList.filter(function(h){return r.find(u=>u.label===h.boundEvents.label)}))}return{allEvents:V,boundEvents:p,candidateEvents:s,excludeFromCandidates:O,loadEvents:I,resetBoundEvents:j,unBoundEvent:w}}const Tt={sourceCommunication:{type:Object,default:{}}},Lt={events:{type:Array,default:[]}},Bt=e.defineComponent({name:"FEventList",props:Lt,emits:["click"],setup(n,V){const p=e.ref(n.events);function s(f){V.emit("click",f)}function a(f){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>s(f),class:"f-page-events-editor-first-bound-event-name"},[f.name])])}return()=>e.createVNode("div",{class:"f-page-events-editor-events"},[p.value.map(f=>a(f))])}}),fe={communication:{type:Object},sourceCommunication:{type:Object,default:{}},event:{type:String,default:""}},kt=e.defineComponent({name:"FSelectSourceControl",props:fe,emits:["selectSourceEvent","deleteControl"],setup(n,V){const p=e.inject("useFormSchema"),{createNewCommunication:s}=me(p),a=e.ref();a.value=s(n);const f=e.ref([{field:"name",title:"",dataType:"string"}]),F=e.ref([]),g=e.ref(),I=e.ref(),O=e.ref(!0),w=e.ref(!1),j=e.ref([]),C=e.ref(),r=e.ref(!0),v=e.ref(!1);function h(){const y=e.inject("sourceOutlineData");F.value=y||[],I.value.updateDataSource(F.value)}function u(){var D,c,o;if(!((c=(D=a.value)==null?void 0:D.source)!=null&&c.componentId)){v.value=!1;return}const y=(o=F.value)==null?void 0:o.find(i=>i.originalId===a.value.source.componentId);y?(I.value.selectItemById(y.id),v.value=!1):(v.value=!0,g.value={id:a.value.source.componentId})}function l(){var y,D,c;(D=(y=a.value)==null?void 0:y.source)!=null&&D.event&&((c=j.value)!=null&&c.length)&&(C.value=j.value.find(o=>{var i,x;return o.eventCode===((x=(i=a.value)==null?void 0:i.source)==null?void 0:x.event)}))}e.onMounted(()=>{h(),u(),l(),r.value=!1});function m(){var o;j.value=[];const y=g.value.rawSchema,D=y.type==="form-group"&&y.editor?y.editor.type:y.type,c=(o=ae.schemaMap[D])==null?void 0:o.events;c&&Object.keys(c).forEach(i=>{j.value.push({eventCode:i,eventName:c[i]})})}function b(y){O.value=!1,v.value=!1;const D=g.value!==y[0];D&&(g.value=y[0],m()),r.value||(w.value=!0),!r.value&&D&&(C.value=null)}const t=e.computed(()=>({"item-list":!0,"d-none":!O.value})),U=e.computed(()=>y=>{var D;return{item:!0,selected:((D=C.value)==null?void 0:D.eventCode)===y}});function z(y){var D;O.value=!1,w.value=!1,C.value=y,a.value.source.componentId=g.value.rawSchema.id,a.value.source.event=(D=C.value)==null?void 0:D.eventCode,V.emit("selectSourceEvent",a.value)}const A=e.computed(()=>({"form-container":!0,"position-relative":!0,invalid:v.value}));return()=>e.createVNode("div",{class:A.value},[e.createVNode("div",{class:t.value,style:"min-height:220px;"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择源控件")]),e.createVNode(Ue.FTreeView,{ref:I,data:F.value,columns:f.value,columnOption:{fitColumns:!0,fitMode:"expand"},showTreeNodeIcons:!0,fit:!0,iconField:"controlIcon",onSelectionChange:b},null)]),w.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择事件")]),j.value.map(y=>e.createVNode("span",{class:U.value(y.eventCode),onClick:()=>z(y)},[y.eventName]))])])])}}),It=e.defineComponent({name:"FInteractionButton",props:Tt,emits:["clickEventItem","selectSourceControl"],setup(n,V){const p=new de.FNotifyService,s=e.inject("useEventsComposition"),a=e.inject("useInteractionCompostion"),{candidateEvents:f}=s,{collapseInteractions:F}=a,g=e.ref(!1),I=e.ref(!1);function O(v){f.value=f.value.filter(h=>h.label!==v.label)}function w(){var v;(v=n.sourceCommunication)!=null&&v.needSelectSourceControl?I.value=!I.value:g.value=!g.value}function j(v){w(),O(v),V.emit("clickEventItem",v)}function C(){var v;if(!((v=n.sourceCommunication)!=null&&v.needSelectSourceControl)&&f.value.length===0){p.info({position:"top-center",message:"事件已全部绑定"});return}F(),w()}function r(v){I.value=!1,V.emit("selectSourceControl",v)}return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-page-events-editor-top-button"},[e.createVNode("button",{class:"f-page-events-editor-button",onClick:C},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),g.value&&e.createVNode(Bt,{events:f.value,onClick:j},null),I.value&&e.createVNode(kt,{sourceCommunication:n.sourceCommunication,onSelectSourceEvent:r},null)])}}),qt={collapsed:{type:Boolean,default:!0},displayOrder:{type:Number,default:-1},interaction:{type:Object,default:{}},controllers:{type:Array,default:[]},sourceCommunication:{type:Object,default:{}},viewSourceHandle:{type:Function,default:()=>{}},haveBoundCommand:{Type:Boolean,default:!1}},Dt={newImport:{Type:Boolean,default:!1},addInternalCommandList:{Type:Array,default:[]},outerLayerValue:{Type:Number,default:0},exit:{Type:Number,default:-1},haveBoundCommand:{Type:Boolean,default:!1},controllers:{type:Array,default:[]},iteractionDisplayOrder:{Type:Number,default:0},event:{Type:Object},sourceCommunication:{type:Object,default:{}}},At={controllers:{type:Array,default:[]}},Ot=e.defineComponent({name:"FCommandList",props:At,emits:["selectMethod"],setup(n,V){function p(g){return g.controllerList.length!==0}function s(g){return p(g)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:g.controllerName.name},[g.controllerName.name])])}function a(g,I){V.emit("selectMethod",{method:g,controller:I})}function f(g){return g.controllerList.map(I=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>a(I,g)},[e.createVNode("div",{class:"f-page-internals-command-name",title:I.label},[I.name])]))}function F(g){return e.createVNode("div",null,[s(g),f(g)])}return()=>e.createVNode("div",{class:"f-page-internals"},[n.controllers.map(g=>F(g))])}}),$t={getEventPath:{type:Function,default:null},notifyService:{type:Object},useFormSchema:{type:Object},sourceCommunication:{type:Object,default:{}},event:{Type:Object}},Rt=e.defineComponent({name:"FBoundEventSelector",props:$t,emits:["cancel","submit"],setup(n,V){var S,$;const p=e.ref(),s=e.ref([]),a=e.ref('<i class="f-icon f-icon-search"></i>'),f=n.useFormSchema.getFormMetadataBasicInfo(),F=e.ref(""),g=e.ref(),I=((S=n.sourceCommunication)==null?void 0:S.unSupportedEventCodes)||[],O=e.ref(!I.includes(n.event.label)&&(($=n.useFormSchema.externalFormSchema)==null?void 0:$.size)>0),w=e.ref(),j=e.ref([]);e.onBeforeMount(()=>{if(n.getEventPath){const d=n.getEventPath();p.value=d.viewModelDisplay;const{actionWithPath:k}=d;k.forEach(q=>{q.sourceComponent.map.forEach(G=>{G.active=!1,G.hide=!1})}),s.value=W.cloneDeep(k)}});function C(d=""){d=d.replace(/ /g,"").replace(/>/g,"").toLowerCase(),d===""&&(d=" "),s.value.forEach(k=>{const q=k.path;k.sourceComponent.map.forEach(G=>{const K=G.command.name,Z=G.event.name,T=G.command.label;`${q}${K}${Z}${T}`.toLowerCase().includes(d)?G.hide=!1:G.hide=!0})})}function r(d=""){d=d.replace(/ /g,"").replace(/>/g,"").toLowerCase(),j.value.forEach(k=>{if(!k.isCommandNode)return;const q=k.name||"",G=k.code||"",K=k.viewmodelName||"",Z=`${q}${G}${K}`.toLowerCase();d&&!Z.includes(d)?k.hide=!0:k.hide=!1})}function v(d=""){!w.value||w.value.id===f.id?C(d):r(d)}function h(){const d=e.createVNode("div",{class:"f-vm-search"},[e.createVNode("div",{class:"f-vm-searchBar"},[e.createVNode(en,{updateOn:"change",groupText:a.value,modelValue:F.value,"onUpdate:modelValue":k=>F.value=k,onChange:v,placeholder:"请输入名称/编号/路径搜索"},null)])]);return O.value?e.createVNode("div",{class:"f-navSelector-header"},[e.createVNode("div",{class:"f-navSelector-recommand"},[e.createVNode("div",{class:"f-navSelector-recommand-text"},[e.createTextVNode("方法列表")])]),e.createVNode("div",{class:"f-navSelector-remainder"},[e.createVNode("div",{class:"f-vm-search"},[d])])]):d}function u(d){return{"f-vm-item":!0,"f-vm-item-focus":d.active}}function l(d,k){let q=0;s.value.forEach(G=>{G.sourceComponent.map.forEach(K=>{!K.command.isInvalid&&d.controller.id===K.controller.id&&d.command.id===K.command.id&&d.event.label===K.event.label&&k.sourceComponent.id===G.sourceComponent.id?(d.active=!d.active,g.value=W.cloneDeep(d)):(K.command.isInvalid&&d.controller.id===K.controller.id&&d.command.id===K.command.id&&d.event.label===K.event.label&&k.sourceComponent.id===G.sourceComponent.id&&(q++,q===1&&(new de.FNotifyService().info({position:"top-center",message:"该方法已失效"}),g.value=null)),K.active=!1)})})}function m(d){return{"f-event-func":!d.command.isInvalid,"f-event-func-invalid":d.command.isInvalid}}function b(d){return d.sourceComponent.map.filter(k=>!k.hide).map(k=>{if(!k.command.isInvalid)return e.createVNode("div",{class:u(k),onClick:()=>l(k,d)},[e.createVNode("div",{class:"f-event-commandItem"},[e.createVNode("div",{class:"f-icon-command"},[e.createVNode("div",{class:"f-icon f-icon-source-code",style:"font-size:10px;color:#30B471;"},[e.createTextVNode(" ")])]),e.createVNode("div",{class:m(k)},[k.command.name,e.createTextVNode("("),k.command.label,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[d.path,k.event.name])])})}function t(){return s.value.length>0?e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[s.value.map(d=>b(d))]):e.createVNode("div",{class:"f-list-view-emptydata",style:"height: 360px;position: relative;"},[e.createVNode("div",{class:"f-datagrid-norecords"},[e.createVNode("div",{class:"f-datagrid-norecords-content"},[e.createTextVNode(" 暂无数据")])])])}function U(){V.emit("cancel")}function z(){if(!g.value){n.notifyService.info({position:"top-center",message:"请选择需要绑定的方法"});return}V.emit("submit",{selectedCommand:g.value,selectedForm:w.value})}function A(){const d=n.useFormSchema.externalFormSchema,k=[];return k.push({containerId:"",id:f.id,code:f.code,name:f.name}),Array.from(d.keys()).forEach(q=>{const G=d.get(q);k.push({containerId:q,id:G.id,code:G.code,name:G.name})}),k}const y=e.computed(()=>({"f-vm-all":!0," h-100":!0,"has-page-list":O.value}));function D(d){var K,Z;const{viewmodels:k,components:q}=d.module;if((k==null?void 0:k.length)===0||(q==null?void 0:q.length)===0)return[];j.value=[];const G=(Z=(K=n.sourceCommunication)==null?void 0:K.parameterData)==null?void 0:Z.getViewModelName;k.forEach(T=>{if(!T||!T.commands||T.commands.length===0)return[];const J=q.find(re=>re.viewModel===T.id),X=G&&J?G(J,T.name,d):"";j.value.push({id:T.id,code:T.code,name:X||T.name}),T.commands.forEach(re=>{re.isInvalid||j.value.push({...re,viewmodelId:T.id,viewmodelName:X||T.name,isCommandNode:!0})})})}function c(d){var k,q,G;if(!(d.id===w.value.id&&d.containerId===w.value.containerId))if(w.value=d,F.value="",g.value=null,w.value.id!==f.id){const K=(q=n.useFormSchema.externalFormSchema)==null?void 0:q.get((k=w.value)==null?void 0:k.containerId);(G=K==null?void 0:K.content)!=null&&G.module&&D(K.content)}else s.value.map(K=>{K.sourceComponent.map.map(Z=>{Z.hide=!1,Z.active=!1})})}function o(){const d=A();w.value||(w.value=d[0]);const k=e.computed(()=>q=>{var G;return{"f-list-view-group-item":!0,"f-listview-active":q.id===((G=w.value)==null?void 0:G.id)&&q.containerId===w.value.containerId}});return e.createVNode("div",{class:"f-page-nav"},[e.createVNode("div",{class:"f-list-view"},[e.createVNode("div",{class:"f-list-view-content"},[e.createVNode("ul",{class:"f-list-view-group",style:"list-style: none;"},[d.map(q=>{let G=q.name;return q.containerId&&(G+=`, 所属外部容器:${q.containerId}`),e.createVNode("li",{class:k.value(q),onClick:()=>c(q)},[e.createVNode("div",{class:"f-list-content"},[e.createVNode("div",{class:"f-navSelector-leftCategory",title:G},[q.name])])])})])])])])}function i(d){j.value.map(k=>k.active=!1),d.active=!0,g.value=d}function x(){return e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[j.value.filter(d=>!d.hide).map(d=>{if(d.isCommandNode)return e.createVNode("div",{class:u(d),onClick:()=>i(d)},[e.createVNode("div",{class:"f-event-commandItem"},[e.createVNode("div",{class:"f-icon-command"},[e.createVNode("div",{class:"f-icon f-icon-source-code",style:"font-size: 10px; color: rgb(48, 180, 113);"},null)]),e.createVNode("div",{class:"f-event-func"},[d.name,e.createTextVNode("("),d.code,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[d.viewmodelName])])})])}return()=>e.createVNode("div",{class:y.value},[e.createVNode("div",{class:"d-flex f-utils-fill-flex-row splitter"},[O.value?o():"",e.createVNode("div",{class:"f-utils-fill-flex-column"},[h(),!w.value||w.value.id===f.id?t():x()])]),e.createVNode("div",{class:"modal-footer"},[e.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:U},[e.createTextVNode("取消")]),e.createVNode("button",{type:"button",class:"btn btn-primary",onClick:z},[e.createTextVNode("确定")])])])}}),Ut=e.defineComponent({name:"FCommandSource",props:Dt,emits:["addInternalCommandListChanged","newImportChanged","selectBoundMethod","click","existChanged","newFunctionChanged","close","selectMethod","addCommunication"],setup(n,V){const p=e.inject("useMethodsComposition"),s=e.inject("useFormCommand"),a=new de.FNotifyService,{checkIfNewControllerExists:f,addNewController:F}=p,g=e.ref(n.controllers),I=e.inject("useFormSchema"),O=e.inject(Ze.F_MODAL_SERVICE_TOKEN);let w,j;const C=e.ref(!1);e.onMounted(()=>{C.value=I.externalFormSchema.size>0});function r(i,x,S){if(F(i),i.Commands){const $=s.getInternalControllerFromControllerMetadata(i,x,S);f($)&&a.info({position:"top-center",message:"该控制器已存在"})}}async function v(i){s.getSupportedControllerMetadata(i).then(x=>{x&&r(x.controller,x.code,x.nameSpace)}).finally(()=>{w&&w.destroy&&w.destroy()})}function h(i){w&&w.destroy&&w.destroy()}function u(){const i={formBasicInfo:I==null?void 0:I.getFormMetadataBasicInfo()};return e.createVNode(Ge.FSchemaSelector,{injectSymbolToken:se.ControllerSchemaRepositorySymbol,"view-type":"NavList",editorParams:i,showFooter:!0,onCancel:h,onSubmit:v},null)}function l(){w=O.open({title:"选择控制器",width:950,render:u,showButtons:!1})}function m(){V.emit("newFunctionChanged")}function b(){j&&j.destroy&&j.destroy()}function t(i){const{selectedCommand:x,selectedForm:S}=i;!S||(S==null?void 0:S.id)===I.getFormMetadataBasicInfo().id?(p.selectBoundCommand(x,n.iteractionDisplayOrder),V.emit("selectBoundMethod")):V.emit("addCommunication",i),b()}function U(){const{getEventPath:i}=p;return e.createVNode(Rt,{getEventPath:i,notifyService:a,useFormSchema:I,sourceCommunication:n.sourceCommunication,event:n.event,onCancel:b,onSubmit:t},null)}function z(){j=O.open({title:"已有方法",width:950,height:500,fitContent:!1,render:U,showButtons:!1,enableEsc:!1,draggable:!0})}function A(){V.emit("close",null)}function y(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function D(){return e.createVNode("div",{class:"f-page-internals-new-command"},[e.createVNode("div",{class:"f-page-internals-new-command-func1"},[e.createVNode("div",{class:"f-icon f-icon-panel-retraction"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>l()},[e.createTextVNode("引入控制器")])]),e.createVNode("div",{class:"f-page-internals-new-command-func2"},[e.createVNode("div",{class:"f-icon f-icon-new-edit"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>m()},[e.createTextVNode("添加新方法")])]),(n.haveBoundCommand||C.value)&&e.createVNode("div",{class:"f-page-internals-new-command-func3"},[e.createVNode("div",{class:"f-icon f-icon-licensed"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>z()},[e.createTextVNode("已有方法")])])])}function c(i){V.emit("selectMethod",i)}function o(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(Ot,{controllers:g.value,onSelectMethod:c},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[o(),y(),D(),y(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:A},[e.createTextVNode("取消")])])])}}),Gt={command:{type:Object,default:{}},showParameter:{type:Boolean,default:!1},controller:{type:Object,default:{}},showDeleteIcon:{type:Boolean,default:!1}},_t=e.defineComponent({name:"FParameterEditor",props:Gt,emits:["confirm","change","targetChange","viewSource","deleteCommand"],setup(n,V){const p=new de.FNotifyService,s=e.inject("FMessageBoxService"),a=e.ref(W.cloneDeep(n.command)),f=e.ref(n.controller),F=e.ref(0),g=e.computed(()=>a.value.id==="abandoned"),I=e.computed(()=>a.value.id==="deleted"),O=e.computed(()=>n.showDeleteIcon),w=e.computed(()=>a.value!==null),j=e.inject("useMethodsComposition"),C=e.ref(n.showParameter),r=e.inject("useFormSchema"),v=e.computed(()=>a.value.componentLists&&a.value.hasPath),h=e.computed(()=>{const T=a.value.id!=="abandoned"&&a.value.id!=="deleted",J=v.value,X=a.value.property&&a.value.property.length>0;return T&&(J||X)});function u(){const{targetComponent:T}=a.value;let J="";return a.value.componentLists&&a.value.componentLists.forEach(X=>{if(X.componentId===T){J=X.viewModelId;return}}),J}const l=e.ref(u()),m=e.computed(()=>a.value.targetComponent||"");function b(){p.info({position:"top-center",message:"方法已被移除,请重新绑定"})}function t(){return e.createVNode("div",{title:"方法已被移除,请重新绑定",class:"f-icon f-icon-flowline-warning text-danger text-center ",style:"font-size: 13px;margin-right:10px;width: 30px;height: 20px;",onClick:()=>b()},null)}function U(){p.info({position:"top-center",message:"方法已失效,请重新绑定"})}function z(){return e.createVNode("div",{title:"'方法已被删除,请绑定其他方法'",class:"f-icon f-icon-flowline-warning text-danger text-center ",style:"font-size: 13px;margin-right:10px;width: 30px;height: 20px;",onClick:()=>U()},null)}function A(T){C.value=!C.value}function y(){return e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>A(F.value)},null)}function D(T,J){a.value.targetComponent=T[0].componentId,V.emit("targetChange",a.value)}function c(){const T=e.reactive({content:"将此方法添加到指定的组件",placement:"top"});return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-targetComponent"},[e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-topic"},[e.createTextVNode("挂载到目标组件"),e.withDirectives(e.createVNode("span",{class:"farris-label-tips ml-2"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),T]])]),e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-dropdown"},[e.createVNode(_e,{modelValue:l.value,"onUpdate:modelValue":J=>l.value=J,enableClear:!1,idField:"viewModelId",valueField:"viewModelId",textField:"componentId",data:a.value.componentLists,editable:!1,onChange:D},null)])])])}function o(T,J){J.value=T}function i(){V.emit("change",a.value)}function x(){let T="";return m.value?T=r.getViewModelIdByComponentId(m.value):T=j.getViewModeId(),T}function S(T,J){var Ce,we,be,Ne,he,ve,B,R,_,H,Q,ee,ne,te,oe,Se,Ve,xe,le,Fe,ye;const X=x(),Le=r.getViewModelById(X).commands.find(Y=>{var ie;return(Y==null?void 0:Y.id)===((ie=n.command)==null?void 0:ie.id)}),Be=e.reactive(T.context.data),{assembleSchemaFieldsByComponent:ke,assembleOutline:Ie,assembleStateVariables:qe,assembleSchemaFieldsUnderBoundEntity:De,getEditor:Ae}=T.context.generalData,{designerMode:Oe}=r,$e=Y=>{o(Y,T),i()},Re=Y=>{var ie,pe,ue,je;return((je=(ue=(pe=(ie=T==null?void 0:T.origin)==null?void 0:ie.controlSource)==null?void 0:pe.context)==null?void 0:ue.data)==null?void 0:je.value)===":Entity"||Y.raw.children&&Y.raw.children.length&&(Y.disabled=!0),Y};return e.createVNode(Ee,{readonly:Oe==="PC_RTC"&&!J.isRtcCommand,defaultValue:T==null?void 0:T.origin.defaultValue,modelValue:T.value,"onUpdate:modelValue":Y=>T.value=Y,data:Be,editor:Ae(T.value,T,Le,X,$e),fieldData:ke(),formData:Ie(),varData:qe(),activeViewModelFieldData:De(m.value),editorControlSource:(Ce=T==null?void 0:T.origin)==null?void 0:Ce.controlSource,customRowStatus:Re,idField:((he=(Ne=(be=(we=T==null?void 0:T.origin)==null?void 0:we.controlSource)==null?void 0:be.context)==null?void 0:Ne.data)==null?void 0:he.value)===":Entity"?"bindTo":((_=(R=(B=(ve=T==null?void 0:T.origin)==null?void 0:ve.controlSource)==null?void 0:B.context)==null?void 0:R.valueField)==null?void 0:_.value)||((ne=(ee=(Q=(H=T==null?void 0:T.origin)==null?void 0:H.controlSource)==null?void 0:Q.context)==null?void 0:ee.idField)==null?void 0:ne.value)||"id",textField:((Ve=(Se=(oe=(te=T==null?void 0:T.origin)==null?void 0:te.controlSource)==null?void 0:oe.context)==null?void 0:Se.textField)==null?void 0:Ve.value)||"label",editable:(ye=(Fe=(le=(xe=T==null?void 0:T.origin)==null?void 0:xe.controlSource)==null?void 0:le.context)==null?void 0:Fe.editable)==null?void 0:ye.value,onConfirm:Y=>{o(Y,T),i()},onValueChange:Y=>{var ie,pe;if(((ie=T.origin)==null?void 0:ie.Code)==="lookupId"){const ue=(pe=a.value.property)==null?void 0:pe.find(je=>je.name==="mappingFields");ue&&ue.value&&(ue.value="")}o(Y,T),i()}},null)}function $(){var T;return(T=a.value.property)==null?void 0:T.map((J,X)=>{const re=e.reactive({content:J.description,placement:"top"});return e.createVNode("div",{key:J.name+X},[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[J.shownName,J.description&&e.withDirectives(e.createVNode("div",{class:"ml-2 farris-label-tips"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)]),[[e.resolveDirective("tooltip"),re]])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[S(J,a.value)])])})}function d(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[v.value&&c(),$()])}function k(T){T.stopPropagation(),V.emit("viewSource",{command:a.value,event:T})}function q(){s.question(`确定删除命令【${a.value.name}】吗?`,"",()=>{V.emit("deleteCommand")})}function G(){return e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:T=>q()},null)}const K=e.computed(()=>{var T;return{cursor:g.value||f.value.isCommon||((T=f.value)==null?void 0:T.label.indexOf(r==null?void 0:r.getModule().code))===-1?"default":"pointer"}});function Z(){return e.createVNode("div",null,[e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",style:K.value,title:a.value.label,onDblclick:k},[a.value.name]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[g.value&&t(),I.value&&z(),h.value&&y(),O.value&&G()])]),C.value&&d()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[w.value&&Z()])}}),zt={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},Me=e.defineComponent({name:"FResponseForm",props:zt,emits:[],setup(n,V){const p=e.ref(),s=e.computed(()=>{const a=nn.LocaleService.getLocale(),f=n.customClass.split(" "),F={"drag-container":!0};return f.reduce((g,I)=>(g[I]=!0,g),F),n.adaptForLanguage&&a&&(F["farris-form-controls-inline"]=a!=="en"),F});return()=>n.visible&&e.withDirectives(e.createVNode("div",{ref:p,class:s.value,style:n.customStyle},[V.slots.default&&V.slots.default()]),[[e.resolveDirective("area-response")]])}}),Ht={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number]},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},showLabelType:{type:String,default:"visible"},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null},fill:{type:Boolean,default:!1},enableTips:{type:Boolean,default:!1},tipsContent:{type:Object,default:""},linkLabel:{type:String,default:!1}},Wt={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""},showType:{type:String,default:"visible"},isLink:{type:Boolean,default:!1}},Kt=e.defineComponent({name:"FDynamicFormLabel",props:Wt,emits:["clickLabel"],setup(n,V){e.ref(n.title||n.text);const p=e.ref(n.required),s=e.ref(n.text),a=e.ref(n.valid),f=e.ref(n.inValidTip);e.watch(()=>n.text,()=>{s.value=n.text}),e.watch(()=>n.required,(w,j)=>{w!==j&&(p.value=w)}),e.watch([()=>n.valid,()=>n.inValidTip],([w,j])=>{a.value=w,f.value=j});const F=e.computed(()=>a.value?s.value:f.value),g=e.computed(()=>a.value?"":"color:red"),I=e.computed(()=>({"col-form-label":!0,"f-width-auto":p.value&&(n.showType==="none"||!s.value),"f-pretend-link":n.isLink})),O=e.computed(()=>n.showType==="force-none"?!1:n.showType==="reserve-space"||p.value||!!s.value&&n.showType!=="none");return()=>O.value&&e.createVNode("label",{class:I.value,title:F.value,style:g.value,onClick:()=>V.emit("clickLabel")},[!a.value&&e.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:f.value},null),e.createVNode("span",{class:"farris-label-text"},[p.value&&e.createVNode("span",{class:"farris-label-info text-danger"},[e.createTextVNode("*")]),n.showType==="visible"&&s.value])])}}),{globalStorageKey:Jt}=se.useThirdComponent(),E={},P={},M={},L={};async function Qt(){{const n={schemaMap:ae.schemaMap,propertyConfigSchemaMap:ae.propertyConfigSchemaMap,propertyEffectMap:ae.propertyEffectMap,schemaResolverMap:ae.schemaResolverMap};on.register(E,P,M,L),tn.register(E,P,M,L),an.register(E,P,M,L),rn.register(E,P,M,L),cn.register(E,P,M,L),ln.register(E,P,M,L,n),dn.register(E,P,M,L),ze.register(E,P,M,L,n),He.register(E,P,M,L,n),ze.register(E,P,M,L,n),He.register(E,P,M,L,n),_e.register(E,P,M,L,n),sn.register(E,P,M,L),un.register(E,P,M,L),fn.register(E,P,M,L,n),mn.register(E,P,M,L),hn.register(E,P,M,L,n),vn.register(E,P,M,L,n),pn.register(E,P,M,L),gn.register(E,P,M,L,n),Cn.register(E,P,M,L),mt.register(E,P,M,L),wn.register(E,P,M,L),bn.register(E,P,M,L),rt.register(E,P,M,L),Sn.register(E,P,M,L),Vn.register(E,P,M,L,n),xn.register(E,P,M,L,n),yn.register(E,P,M,L,n),Fn.register(E,P,M,L),jn.register(E,P,M,L,n),En.register(E,P,M,L),Pn.register(E,P,M,L),Mn.register(E,P,M,L),Tn.register(E,P,M,L,n),Ln.register(E,P,M,L),Bn.register(E,P,M,L,n),kn.register(E,P,M,L),In.register(E,P,M,L),qn.register(E,P,M,L),Dn.register(E,P,M,L,n),An.register(E,P,M,L,n),On.register(E,P,M,L),Rn.register(E,P,M,L,n),Un.register(E,P,M,L),$n.register(E,P,M,L),Ge.register(E,P,M),Gn.register(E,P,M,L),_n.register(E,P,M,L,n),zn.register(E,P,M,L),Hn.register(E,P,M,L),Wn.register(E,P,M,L),Kn.register(E,P,M,L,n),ct.register(E,P,M,L),Jn.register(E,P,M,L,n),Qn.register(E,P,M,L),Yn.register(E,P,M,L),Xn.register(E,P,M,L,n),Zn.register(E,P,M,L),Ue.register(E,P,M,L),nt.register(E,P,M,L),et.register(E,P,M,L),tt.register(E,P,M,L),ot.register(E,P,M,L,n),at.register(E,P,M,L),Nn.register(E,P,M,L),Ee.register(E,P,M,L),it.register(E,P,M,L,n),lt.register(E,P,M,L),dt.register(E,P,M,L),st.register(E,P,M,L),ut.register(E,P,M,L),ft.register(E,P,M,L),ht.register(E,P,M,L,n),vt.register(E,P,M,L),pt.register(E,P,M,L),gt.register(E,P,M,L),Ct.register(E,P,M,L,n),wt.register(E,P,M,L,n),bt.register(E,P,M,L),Nt.register(E,P,M,L);const V=window[Jt];if(V)for(const p in V)V[p].createPropsResolver=ae.createPropsResolver,V[p].register(E,P,M)}}function Qe(){Qt();function n(F){const g=E[F];if(!g)throw new Error(`Could not find the editor of type '${F}'`);return g}function V(F,g){const I=P[F];return I?I(g):{}}function p(F){switch(F){case"check-box":return"onChangeValue";case"switch":return"onModelValueChanged";case"check-group":return"onChangeValue";case"combo-list":case"combo-tree":return"onChange";case"combo-lookup":return"";case"year-range":case"year-picker":case"month-range":case"month-picker":case"date-range":case"datetime-range":case"datetime-picker":return"onDatePicked";case"date-picker":return"onUpdate:modelValue";case"time-picker":return"onValueChange";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-editor":case"language-textbox":case"rich-text-editor":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":case"item-collection-editor":case"response-form-layout-setting":case"response-layout-editor-setting":case"response-layout-splitter":case"menu-lookup":case"json-editor":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onChange";case"query-solution-config":case"solution-preset":case"filter-bar-config":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged";case"collection-property-editor":return"onValueChange";default:return"onUpdate:modelValue"}}function s(F){switch(F){case"combo-list":case"input-group":case"textarea":return"onClear"}}function a(F){switch(F){case"input-group":case"textarea":return"onMousedownEvent"}}function f(F){switch(F){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:V,resolveEditorType:n,getChangeFunctionName:p,getClearFunctionName:s,getMousedownFunctionName:a,getMouseupFunctionName:f}}const Yt={errors:{type:Object,default:null}},Xt=e.defineComponent({name:"FValidationMessage",props:Yt,emits:[],setup(n,V){const p=e.ref(n.errors);e.watch(()=>n.errors,f=>{p.value=f});const s=e.ref(!0),a=e.computed(()=>{if(p.value){const f=Object.keys(p.value).map(F=>{var g;return(g=p.value[F])==null?void 0:g.name});return f.length?f.join(" "):""}return""});return()=>a.value&&e.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>s.value=!s.value},[!s.value&&e.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),s.value&&e.createVNode("span",{class:"f-feedback-message"},[a.value])])}}),Te=e.defineComponent({name:"FDynamicFormGroup",props:Ht,emits:["change","update:modelValue","clickLabel"],setup(n,V){var x;const p=e.ref(n.id),s=e.ref(n.customClass),a=e.ref(n.editor),f=e.ref(n.label),F=e.ref(n.modelValue),g=e.ref(n.readonly),I=e.ref(((x=n.editor)==null?void 0:x.required)||n.required),O=e.ref(n.showLabel),w=e.ref(n.visible);e.ref(n.type);const j=e.ref(),C=e.ref(n.errors),r=se.isMobilePhone(),v=e.ref(n.editor.type||"input-group"),h=e.computed(()=>O.value?n.showLabelType:"none"),{resolveEditorProps:u,resolveEditorType:l,getChangeFunctionName:m,getClearFunctionName:b}=Qe(),t=e.computed(()=>{const S={"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":g.value,"align-items-start":a.value.type==="textarea"||a.value.type==="rich-text-editor","form-group--in-mobile":r};return S["form-group--has-"+v.value]=!0,S}),U=e.computed(()=>{if(n.fill)return{maxWidth:"none"}});function z(S,$,d){F.value=$!==void 0?$:S,V.emit("update:modelValue",F.value),V.emit("change",F.value,{newValue:S,newModelValue:$,parameters:d})}function A(){V.emit("update:modelValue","")}function y(S){return(...$)=>{A(),typeof S=="function"&&S(...$)}}function D(S){return($,d,k)=>{z($,d,k),typeof S=="function"&&S($,d,k)}}const c=e.computed(()=>{const S=a.value.type||"input-group",$=l(S),d=u(S,a.value),k=m(S),q=b(a.value.type);return q&&(d[q]=y(d[q])),k&&(d[k]=D(d[k])),(d.id==null||d.id==="")&&(d.id=p.value),S==="number-range"&&a.value.onBeginValueChange&&typeof a.value.onBeginValueChange=="function"?(a.value.onBeginValueChange&&typeof a.value.onBeginValueChange=="function"&&(d.onBeginValueChange=a.value.onBeginValueChange),a.value.onEndValueChange&&typeof a.value.onEndValueChange=="function"&&(d.onEndValueChange=a.value.onEndValueChange)):S==="lookup"&&a.value["onUpdate:idValue"]&&typeof a.value["onUpdate:idValue"]=="function"?(d["onUpdate:idValue"]=a.value["onUpdate:idValue"],d.id=p.value):S==="collection-property-editor"&&a.value.onSelectionChange&&typeof a.value.onSelectionChange=="function"?d.onSelectionChange=a.value.onSelectionChange:S==="property-editor"&&(d.onBeforeOpenVariables=a.value.onBeforeOpenVariables),()=>e.createVNode($,e.mergeProps({ref:j},d,{modelValue:F.value,"onUpdate:modelValue":G=>F.value=G}),V.slots)});function o(){return e.createVNode(Xt,{id:`${p.value}-validation-message`,errors:C.value},null)}e.watch([()=>n.id,()=>n.customClass,()=>n.editor,()=>n.label,()=>n.modelValue,()=>n.readonly,()=>n.required,()=>n.showLabel,()=>n.visible,()=>n.errors],([S,$,d,k,q,G,K,Z,T,J])=>{var X;p.value=S,s.value=$,a.value=d,f.value=k,F.value=q,g.value=G,I.value=((X=a.value)==null?void 0:X.required)||K,O.value=Z,w.value=T,C.value=J});function i(S){V.emit("clickLabel",S)}return V.expose({editorRef:j}),()=>w.value&&e.createVNode("div",{id:`${p.value}-form-group`,class:s.value,style:n.customStyle},[e.createVNode("div",{class:"farris-group-wrap",style:U.value},[e.createVNode("div",{class:t.value},[e.createVNode(Kt,{id:`${p.value}-lable`,showType:h.value,required:I.value,text:f.value,title:f.value,isLink:!!n.linkLabel,onClickLabel:i},null),e.createVNode("div",{class:"farris-input-wrap"},[c.value(),o()]),n.enableTips&&e.createVNode(St,{content:n.tipsContent},{default:()=>[e.createVNode("span",{class:"farris-label-tips ml-1"},[e.createVNode("i",{class:"f-icon f-icon-description-tips"},null)])]})])])])}}),Zt={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},Ye=e.defineComponent({name:"FDynamicFormInput",props:Zt,emits:["change","update:modelValue","mousedown","mouseup"],setup(n,V){const p=e.ref(n.id),s=e.ref(n.editor),a=e.ref(n.modelValue),{resolveEditorProps:f,resolveEditorType:F,getChangeFunctionName:g,getMousedownFunctionName:I,getMouseupFunctionName:O,getClearFunctionName:w}=Qe();function j(m,b,t){a.value=b!==void 0?b:m,V.emit("update:modelValue",a.value),V.emit("change",a.value,{newValue:m,newModelValue:b,parameters:t})}function C(m){V.emit("mousedown",m)}function r(m){V.emit("mouseup",m)}function v(){V.emit("update:modelValue","")}function h(m){return(...b)=>{v(),typeof m=="function"&&m(...b)}}function u(m){return(b,t,U)=>{j(b,t,U),typeof m=="function"&&m(b,t,U)}}const l=e.computed(()=>{const m=F(s.value.type),b=f(s.value.type,s.value);b.focusOnCreated=n.focusOnCreated,b.selectOnCreated=n.selectOnCreated;const t=g(s.value.type),U=w(s.value.type);U&&(b[U]=h(b[U])),t&&(b[t]=u(b[t]));const z=I(s.value.type);b[z]=C;const A=O(s.value.type);return b[A]=r,b.id=p.value,()=>e.createVNode(m,e.mergeProps(b,{modelValue:a.value,"onUpdate:modelValue":y=>a.value=y}),null)});return e.watch([()=>n.id,()=>n.editor,()=>n.modelValue],([m,b,t])=>{p.value=m,s.value=b,a.value=t}),()=>l.value()}});Me.install=n=>{n.component(Me.name,Me).component(Ye.name,Ye).component(Te.name,Te)};const eo=e.defineComponent({name:"FSelectParameters",props:fe,emits:["changed"],setup(n,V){var c;const p=new de.FNotifyService;p.globalConfig={position:"top-center"};const s=e.inject("FMessageBoxService"),a=e.ref(n.communication),f=e.ref(((c=a.value)==null?void 0:c.paramMappings)||[]),F=e.inject("useFormSchema"),g=F.getFormMetadataBasicInfo(),I=e.ref([]),O=e.ref([]),w=e.ref({}),j=e.ref({}),C=e.computed(()=>o=>{let i="",x="";if(o.sourceValue&&o.targetVariable){const S=O.value.find($=>$.statePath===`${o.targetVariableViewModelId}.${o.targetVariable}`);S&&S.name?(j.value[o.targetVariable]=!1,i=`${o.sourceValue}--->${S.name}`,x=`将 ${o.sourceValue} 赋值给 ${S.name}`):(j.value[o.targetVariable]=!0,i=`${o.sourceValue}--->${o.targetVariable}`,x=`将 ${o.sourceValue} 赋值给 ${o.targetVariable}`)}return{displayText:i,displayTextTip:x}});e.watch(()=>n.communication,o=>{a.value=o,f.value=a.value.paramMappings||[]},{deep:!0});function r(){var i;const o=f.value.length||0;f.value.length&&(f.value=f.value.filter(x=>!(!x.sourceValue&&!x.targetVariable))),a.value.paramMappings=f.value,o!==((i=a.value.paramMappings)==null?void 0:i.length)&&V.emit("changed")}e.onUnmounted(()=>{r()});function v(o){var d,k;const{viewmodels:i,components:x}=o.module;if((i==null?void 0:i.length)===0||(x==null?void 0:x.length)===0)return[];const S=[];O.value=[];const $=(k=(d=n.sourceCommunication)==null?void 0:d.parameterData)==null?void 0:k.getViewModelName;return i.forEach(q=>{if(!q||!q.states||q.states.length===0)return[];const G=[],K=x.find(J=>J.viewModel===q.id),Z=$&&K?$(K,q.name,o):"";q.states.forEach(J=>{const X={...J,statePath:q.id+"."+J.code};G.push({data:X,children:[]}),O.value.push(X)});const T={data:{id:q.id,code:q.code,name:Z||q.name,statePath:q.id},children:G};S.push(T)}),S}function h(){var o,i;if(!((o=a.value)!=null&&o.target.formId))return[];if(a.value.target.formId===g.id)I.value=v(F.getFormSchema());else{const x=F.externalFormSchema.get(a.value.target.externalContainerId);(i=x==null?void 0:x.content)!=null&&i.module&&(I.value=v(x==null?void 0:x.content))}}function u(){Object.keys(w.value).forEach(o=>{w.value[o]=!1})}function l(){u();const o=se.useGuid().guid();f.value.push({id:o,sourceValue:"",targetVariable:"",targetVariableViewModelId:""}),a.value.paramMappings=f.value,w.value[o]=!0}function m(o,i,x){o.stopPropagation();function S(){f.value=f.value.filter($=>$.id!==i.id),a.value.paramMappings=f.value,u(),V.emit("changed")}x?s.question(`确定删除参数【${x}】吗?`,"",()=>{S()}):S()}function b(o){w.value[o.id]||(u(),w.value[o.id]=!0)}function t(o,i){if(!i.sourceValue){p.warning("请选择源参数");return}if(!i.targetVariable){p.warning("请选择目标参数");return}w.value[o.id]=!1,Object.assign(o,i),delete o.statePath,V.emit("changed")}function U(o){w.value[o.id]=!1,!o.sourceValue&&!o.targetVariable&&!o.targetVariableViewModelId&&(f.value=f.value.filter(i=>i.id!==o.id),a.value.paramMappings=f.value,V.emit("changed"))}e.onMounted(()=>{h()}),e.watch(()=>n.communication,o=>{h()},{deep:!0});function z(o,i,x){var S;if((S=x.newValue)!=null&&S.length){const{statePath:$}=x.newValue[0];if(($==null?void 0:$.indexOf("."))>0){const d=$.split(".");i.targetVariableViewModelId=d[0],i.targetVariable=d[1]}}}function A(o){return{type:"combo-tree",textField:"name",valueField:"statePath",idField:"statePath",data:I.value,editable:!1,enableClear:!1,customRowStatus:i=>i.raw.parent?(f.value.find(S=>S.id!==o.id&&`${S.targetVariableViewModelId}.${S.targetVariable}`===i.raw.statePath)&&(i.disabled=!0),i):(i.disabled=!0,i)}}function y(o){const i=W.cloneDeep(o);i.statePath=`${i.targetVariableViewModelId}.${i.targetVariable}`;const x=A(o);let S=F.getFormSchema();if(a.value.source.formId!==g.id){const q=F.externalFormSchema.get(a.value.source.externalContainerId);q!=null&&q.content&&(S=q==null?void 0:q.content)}const{assembleSchemaFieldsByComponent:$,assembleOutline:d,assembleStateVariables:k}=n.sourceCommunication.parameterData;return e.createVNode("div",{class:"param-panel"},[e.createVNode("div",{class:"col-12"},[e.createVNode("div",{class:"farris-group-wrap"},[e.createVNode("div",{class:"form-group farris-form-group"},[e.createVNode("label",{class:"col-form-label",title:"源参数"},[e.createVNode("span",{class:"farris-label-text"},[e.createTextVNode("源参数")])])])])]),e.createVNode(Ee,{class:"col-12 mb-2",modelValue:i.sourceValue,"onUpdate:modelValue":q=>i.sourceValue=q,fieldData:$(S),formData:d(S),varData:k(S),editorType:"Default",editable:!0},null),e.createVNode(Te,{label:"目标参数",modelValue:i.statePath,"onUpdate:modelValue":q=>i.statePath=q,customClass:"col-12 mb-2",editor:x,onChange:(q,G)=>z(q,i,G)},null),e.createVNode("div",{class:"d-flex justify-content-end"},[e.createVNode("button",{class:"btn btn-secondary mr-2",onClick:()=>U(o)},[e.createTextVNode("取消")]),e.createVNode("button",{class:"btn btn-primary",onClick:()=>t(o,i)},[e.createTextVNode("确定")])])])}V.expose({addParameter:l,closeAllParameterPanel:u});const D=e.computed(()=>o=>({"param-container":!0,"ml-3":!0,invalid:o}));return()=>f.value.length?f.value.map(o=>{const{displayText:i,displayTextTip:x}=C.value(o),S=j.value[o.targetVariable];return e.createVNode("div",{class:D.value(S)},[e.createVNode("div",{class:"selected-item position-relative"},[e.createVNode("span",{class:"form-control mr-3",title:x,onClick:()=>b(o)},[i||"请配置参数"]),S?e.createVNode("span",{title:"目标参数已失效,请重新选择"},[e.createVNode("i",{class:"f-icon f-icon-flowline-warning text-danger text-tip"},null)]):"",e.createVNode("div",{class:"remove-icon"},[e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除参数",onClick:$=>m($,o,i)},null)])]),w.value[o.id]?y(o):""])}):""}}),no=e.defineComponent({name:"FCommunicationCommandItem",props:fe,emits:["addParameter","deleteCommand","toggleParameterPanel"],setup(n,V){const p=e.ref(n.communication),s=e.inject("FMessageBoxService"),a=e.inject("useFormSchema"),f=a.getFormMetadataBasicInfo(),F=e.ref([]),g=e.ref(),I=e.ref(!1),O=e.ref([]),w=e.ref(),j=e.ref(!1),C=e.ref(n.communication.paramMappings&&n.communication.paramMappings.length>0),r=e.computed(()=>{var c,o,i,x;if(!g.value)return"";const y=((c=g.value)==null?void 0:c.name)||((o=g.value)==null?void 0:o.code)||"",D=((i=w.value)==null?void 0:i.name)||((x=w.value)==null?void 0:x.code)||"";return`${y}-${D}`}),v=e.computed(()=>{var x,S,$,d,k,q;if(!g.value)return"";const y=((x=g.value)==null?void 0:x.name)||((S=g.value)==null?void 0:S.code)||"",D=(($=w.value)==null?void 0:$.name)||((d=w.value)==null?void 0:d.code)||"",c=((k=g.value)==null?void 0:k.code)||"",o=((q=w.value)==null?void 0:q.code)||"",i=g.value.containerId?`, 所属外部容器: ${g.value.containerId}`:"";return`${y} (${c}${i})
3
+ ${D} (${o})`}),h=e.computed(()=>I.value?"目标表单已失效,请删除当前方法。":j.value?"目标命令已失效,请删除当前方法。":"");function u(){var y,D;if((D=(y=p.value)==null?void 0:y.target)!=null&&D.formId){const c=F.value.find(o=>o.id===p.value.target.formId&&o.containerId===p.value.target.externalContainerId);I.value=!c,g.value=c||{containerId:p.value.target.externalContainerId,id:p.value.target.formId,code:p.value.target.formCode}}else I.value=!1}function l(){var D,c;const y=a.externalFormSchema;Array.from(y.keys()).forEach(o=>{var x,S;const i=y.get(o);((S=(x=p.value)==null?void 0:x.source)==null?void 0:S.externalContainerId)!==o&&F.value.push({containerId:o,id:i.id,code:i.code,name:i.name})}),((c=(D=p.value)==null?void 0:D.source)==null?void 0:c.formId)!==f.id&&F.value.unshift({containerId:"",id:f.id,code:f.code,name:f.name}),u()}function m(){var y,D;if((D=(y=p.value)==null?void 0:y.target)!=null&&D.commandCode){const{commandCode:c,commandViewmodelId:o}=p.value.target,i=O.value.find(x=>x.code===c&&x.viewmodelId===o);w.value=i||{code:p.value.target.commandCode},j.value=!i}else w.value=null,j.value=!1}function b(y){var i,x;const{viewmodels:D,components:c}=y.module;if((D==null?void 0:D.length)===0||(c==null?void 0:c.length)===0)return[];O.value=[];const o=(x=(i=n.sourceCommunication)==null?void 0:i.parameterData)==null?void 0:x.getViewModelName;D.forEach(S=>{if(!S||!S.commands||S.commands.length===0)return[];const $=c.find(k=>k.viewModel===S.id),d=o&&$?o($,S.name,y):"";O.value.push({id:S.id,code:S.code,name:d||S.name}),S.commands.forEach(k=>{k.isInvalid||O.value.push({...k,viewmodelId:S.id,isCommandNode:!0})})})}function t(){var y,D,c;if(!((y=g.value)!=null&&y.id))return[];if(g.value.id===f.id)b(a.getFormSchema());else{const o=a.externalFormSchema.get((D=g.value)==null?void 0:D.containerId);(c=o==null?void 0:o.content)!=null&&c.module&&b(o.content)}m()}e.onMounted(()=>{l(),t()}),e.watch(()=>n.communication,y=>{C.value=n.communication.paramMappings&&n.communication.paramMappings.length>0,u(),t()},{deep:!0});function U(){V.emit("addParameter")}function z(){s.question(`确定删除命令【${r.value}】吗?`,"",()=>{V.emit("deleteCommand")})}function A(){V.emit("toggleParameterPanel")}return()=>e.createVNode("div",{class:"form-container position-relative"},[r.value&&e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",title:v.value},[r.value]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[I.value||j.value?e.createVNode("div",null,[e.createVNode("span",{title:h.value},[e.createVNode("i",{class:"ml-2 f-icon f-icon-flowline-warning text-danger text-tip"},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:y=>z()},null)]):e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-icon f-icon-home-add",title:"新增参数",style:"font-size: 11px;",onClick:U},null),C.value&&e.createVNode("div",{class:"f-icon f-icon-edit-button",title:"收折参数",onClick:()=>A()},null),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:y=>z()},null)])])])])}}),to=e.defineComponent({name:"FCombineForm",props:fe,emits:["changed","deleteCommand","addCommand"],setup(n,V){const p=e.inject("useFormSchema"),{saveCommunication:s}=me(p),a=e.ref(n.communication),f=e.computed(()=>{var u,l,m,b;return((l=(u=a.value)==null?void 0:u.source)==null?void 0:l.componentId)&&((b=(m=a.value)==null?void 0:m.source)==null?void 0:b.event)}),F=e.ref(!0),g=e.ref(!0),I=e.ref(),O=e.ref();function w(){s(a.value),V.emit("changed",a.value)}function j(){I.value&&I.value.addParameter(),g.value=!1}function C(){V.emit("deleteCommand")}function r(){g.value=!g.value}const v=e.computed(()=>({"d-none":g.value}));function h(){I.value&&I.value.closeAllParameterPanel()}return V.expose({closeAllParameterPanel:h}),()=>e.createVNode("div",{class:"combine-form-container pb-2"},[f.value&&e.createVNode(e.Fragment,null,[e.createVNode(no,{ref:O,communication:a.value,sourceCommunication:n.sourceCommunication,onAddParameter:j,onDeleteCommand:C,onToggleParameterPanel:r},null),F.value&&e.createVNode("div",{class:v.value},[e.createVNode(eo,{ref:I,communication:a.value,onChanged:w,sourceCommunication:n.sourceCommunication},null)])])])}}),oo=e.defineComponent({name:"FSelectCommunicationCommand",props:fe,emits:["selectCommand","addParameter","deleteCommand","toggleParameterPanel"],setup(n,V){const p=e.inject("useFormSchema"),s=p.getFormMetadataBasicInfo(),a=e.ref([]),f=e.ref(),F=e.ref([]),g=e.ref(),I=e.ref(!0),O=e.ref(!1);function w(){var m;const l=p.externalFormSchema;Array.from(l.keys()).forEach(b=>{var U;const t=l.get(b);((U=n.sourceCommunication)==null?void 0:U.externalContainerId)!==b&&a.value.push({containerId:b,id:t.id,code:t.code,name:t.name})}),((m=n.sourceCommunication)==null?void 0:m.formId)!==s.id&&a.value.unshift({containerId:"",id:s.id,code:s.code,name:s.name})}function j(l){var U,z;const{viewmodels:m,components:b}=l.module;if((m==null?void 0:m.length)===0||(b==null?void 0:b.length)===0)return[];F.value=[];const t=(z=(U=n.sourceCommunication)==null?void 0:U.parameterData)==null?void 0:z.getViewModelName;m.forEach(A=>{if(!A||!A.commands||A.commands.length===0)return[];const y=b.find(c=>c.viewModel===A.id),D=t&&y?t(y,A.name,l):"";F.value.push({id:A.id,code:A.code,name:D||A.name}),A.commands.forEach(c=>{c.isInvalid||F.value.push({...c,viewmodelId:A.id,isCommandNode:!0})})})}function C(){var l,m,b;if(!((l=f.value)!=null&&l.id))return[];if(f.value.id===s.id)j(p.getFormSchema());else{const t=p.externalFormSchema.get((m=f.value)==null?void 0:m.containerId);(b=t==null?void 0:t.content)!=null&&b.module&&j(t.content)}}e.onMounted(()=>{w(),C()});function r(l){f.value=l,I.value=!1,O.value=!0,C()}const v=e.computed(()=>l=>{var m,b;return{item:!0,selected:((m=f.value)==null?void 0:m.id)===l.id&&((b=f.value)==null?void 0:b.containerId)===l.containerId}}),h=e.computed(()=>l=>{var m;return{item:!0,selected:((m=g.value)==null?void 0:m.id)===l.id,"pl-4":l.isCommandNode,disabled:!l.isCommandNode}});function u(l){l.isCommandNode&&(O.value=!1,g.value=l,V.emit("selectCommand",{targetForm:f.value,targetCommand:l}))}return()=>e.createVNode("div",{class:"form-container position-relative"},[I.value&&e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标页面")]),a.value.map(l=>e.createVNode("span",{class:v.value(l),onClick:()=>r(l),title:l.containerId?`所属外部容器:${l.containerId}`:"当前页面"},[l.name]))]),O.value?e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标命令")]),F.value.map(l=>e.createVNode("span",{class:h.value(l),title:l.code,onClick:()=>u(l)},[l.name]))]):""])}}),ao=e.defineComponent({name:"FInteractionItem",props:qt,emits:["addAction","delete","toggle"],setup(n,V){var he,ve;const{guid:p}=se.useGuid(),s=e.inject("FMessageBoxService"),a=e.inject("useMethodsComposition"),{toggleSelectingMethod:f,emitFinalState:F,getViewModeId:g,getMethodsOnViewModel:I,getComponentList:O,updateTarget:w,updateCommandHasPath:j}=a,C=e.inject("useFormSchema"),{clearCommunicationById:r,resolveSourceControlEventTitle:v,resolveCommunication:h,createNewCommunication:u,saveCommunication:l,resolveCommunicationSource:m}=me(C),b=e.ref(n.controllers),t=e.ref(n.interaction),U=e.ref(!1),z=e.computed(()=>{const B=t.value.showSwitch[0];return B.showSection[B.showSwitchNumber][2]}),A=e.ref(n.sourceCommunication.needSelectSourceControl);t.value.shouldShowCommunicationPanel=t.value.shouldShowCommunicationPanel===!1?!1:!!((ve=(he=t.value)==null?void 0:he.communication)!=null&&ve.length)||A.value;const y=e.computed(()=>{var H;const B=!!((H=t.value.command)!=null&&H.id),R=t.value.showSwitch[0],_=R.showSection[R.showSwitchNumber][3];return B&&_}),D=e.ref(t.value.needSelectCommunicationCommand||!1),c=e.ref(),o=e.ref(),i=e.ref(!1),x=e.ref(),S=e.ref([]);function $(){if(A.value){const B=v(t.value.communication);if(B){const{title:R,titleTip:_,isControlInvalid:H}=B;c.value=R,o.value=H?"源表单或事件已失效,请删除":_||R,i.value=H}}else o.value=t.value.event.label,c.value=t.value.event.name}e.onBeforeMount(()=>{h(t.value),$(),x.value=m(t.value)||n.sourceCommunication});const d=e.computed(()=>({"f-icon":!0,"f-icon-arrow-chevron-down":y.value||t.value.shouldShowCommunicationPanel,"f-icon-arrow-chevron-left":!y.value&&!t.value.shouldShowCommunicationPanel}));function k(){var _,H;let B=(_=t.value.command)!=null&&_.id?1:0;B=B+(((H=t.value.communication)==null?void 0:H.length)||0);const R=`确定删除【${c.value}】吗?`;s.question(R,"",()=>{V.emit("delete",n.displayOrder)})}function q(){var H;const B=t.value.showSwitch[0],R=!!((H=t.value.command)!=null&&H.id);t.value.communication&&t.value.communication.length>0&&(t.value.shouldShowCommunicationPanel=!t.value.shouldShowCommunicationPanel),R&&(B.showSection[B.showSwitchNumber][3]=!B.showSection[B.showSwitchNumber][3],V.emit("toggle",n.displayOrder))}function G(){var H,Q;const B=!!((H=t.value.command)!=null&&H.id),R=t.value.communication&&t.value.communication.length>0;if(A.value){D.value=!D.value,(Q=S.value)!=null&&Q.length&&S.value.map(ee=>{ee.closeAllParameterPanel()});return}R&&(t.value.shouldShowCommunicationPanel=!t.value.shouldShowCommunicationPanel);const _=t.value.showSwitch[0];f(_,B),V.emit("addAction",n.displayOrder)}function K(B){const R=t.value.communication!==void 0;B===null&&t.value.command===null&&!R&&V.emit("delete",n.displayOrder),t.value.communication&&(t.value.shouldShowCommunicationPanel=z.value);const _=t.value.showSwitch[0];f(_,R)}function Z(B,R,_){let H=`${R}${_}${B}`,Q=-1;const ee=I();for(;Q===-1;){let ne=!1;for(let te=0;te<ee.length;te++)ee[te].controllerList.forEach(oe=>{oe.label||oe.label===""?ne=oe.label.toLowerCase()===H.toLowerCase()?!0:ne:ne=!1});if(ne)B+=1,H=`${R}${_}${B}`;else{Q=0;break}}return{newName:H,suffix:B}}function T(B){const{method:R,controller:_}=B,{label:H,handlerName:Q,property:ee,componentLists:ne,hasPath:te}=R,oe=g().replace(/-/g,"").replace("component","").replace("viewmodel",""),Se=H.slice(0,1).toUpperCase()+H.slice(1),{newName:Ve,suffix:xe}=Z(1,oe,Se),{controllerName:le}=_,Fe=le.id,ye={id:p(),label:Ve,name:`${R.name}${xe}`,handlerName:Q,hasPath:te,cmpId:Fe,property:ee,componentLists:ne};t.value.command=j(_,ye),t.value.command&&C.designerMode==="PC_RTC"&&(t.value.command.isRtcCommand=!0),t.value.controller={id:le.id,label:le.label,name:le.name,isCommon:le.isCommon};const Y=t.value.showSwitch[0];Y.showSwitchNumber=2,Y.showSection[Y.showSwitchNumber][2]=!1,Y.showSection[Y.showSwitchNumber][3]=!0,U.value=!0,t.value.communication&&t.value.communication.length>0&&(t.value.shouldShowCommunicationPanel=!0),F(!1,null)}function J(){t.value.command={id:"abandoned",label:"未绑定方法",name:"未绑定方法",property:[],hasPath:!1,handlerName:"未绑定方法",cmpId:"",shortcut:{},isRtcCommand:C.designerMode==="PC_RTC"?!0:void 0,isNewGenerated:void 0,extensions:[],isInvalid:!1},t.value.controller={label:"",name:"",id:""},F(!0,t.value.event);const B=t.value.showSwitch[0];f(B,!0)}function X(B,R){var Q;if(t.value.communication||(t.value.communication=[]),t.value.communication.find(ee=>{var ne,te,oe;return((ne=ee.target)==null?void 0:ne.formId)===B.formId&&((te=ee.target)==null?void 0:te.externalContainerId)===B.externalContainerId&&((oe=ee.target)==null?void 0:oe.commandCode)===B.commandCode})){new de.FNotifyService().info({position:"top-center",message:"方法已存在,请勿重复添加。"});return}let H;t.value.communication.length===1&&!((Q=t.value.communication[0].target)!=null&&Q.formId)?(Object.assign(t.value.communication[0].target,B),H=t.value.communication[0]):(H=u(n,t.value.event.label,B,R),t.value.communication.push(H)),F(!1,null),l(H)}function re(B){var _;const R=t.value.showSwitch[0];if(R.showSection[R.showSwitchNumber][2]=!1,(_=t.value.command)!=null&&_.id&&(R.showSection[R.showSwitchNumber][3]=!0),t.value.shouldShowCommunicationPanel=!0,B){const{selectedCommand:H,selectedForm:Q}=B,ee={formId:(Q==null?void 0:Q.id)||"",formCode:(Q==null?void 0:Q.code)||"",externalContainerId:(Q==null?void 0:Q.containerId)||"",commandCode:(H==null?void 0:H.code)||"",commandViewmodelId:(H==null?void 0:H.viewmodelId)||""};X(ee)}}function Le(){const B=t.value.showSwitch[0];B.showSwitchNumber=2,B.showSection[B.showSwitchNumber][2]=!1,B.showSection[B.showSwitchNumber][3]=!0,U.value=!1,t.value.communication&&t.value.communication.length>0&&(t.value.shouldShowCommunicationPanel=!0),F(!1,null)}function Be(){return e.createVNode(Ut,{controllers:b.value,sourceCommunication:n.sourceCommunication,onClose:K,onSelectMethod:T,onNewFunctionChanged:()=>J(),onAddCommunication:re,haveBoundCommand:n.haveBoundCommand,iteractionDisplayOrder:n.displayOrder,onSelectBoundMethod:Le,event:t.value.event},null)}function ke(){const B=t.value.showSwitch[0];B.showSection[B.showSwitchNumber][3]=!1}function Ie(B){t.value.command=W.cloneDeep(B),F(!1,null)}function qe(B){B.componentLists=O(),w(B),t.value.command=W.cloneDeep(B),F(!1,null)}function De(B){var _;const{controller:R}=t.value;R.isCommon||(_=n.viewSourceHandle)==null||_.call(n,{...B,...t.value})}function Ae(){t.value.command=null,F(!1,null)}function Oe(){return e.createVNode(_t,{command:t.value.command,controller:t.value.controller,showParameter:U.value,showDeleteIcon:t.value.communication&&t.value.communication.length>0,onConfirm:()=>ke(),onChange:B=>Ie(B),onTargetChange:B=>qe(B),onViewSource:B=>De(B),onDeleteCommand:Ae},null)}function $e(B,R){t.value.communication&&t.value.communication.length>R&&(t.value.communication[R]=B,F(!1,null))}function Re(B,R){var _;t.value.communication&&t.value.communication.length>R&&(t.value.communication.splice(R,1),r(B.id),t.value.communication.length===0&&!((_=t.value.command)!=null&&_.id)?V.emit("delete",n.displayOrder):F(!1,null))}function Ce(B,R){const{source:_,target:H}=B;X(H,_),t.value.shouldShowCommunicationPanel=!0}function we(B,R){return e.createVNode(to,{ref:_=>{_&&(S.value[R]=_)},communication:B,event:t.value.event.label,sourceCommunication:n.sourceCommunication,onChanged:_=>$e(_,R),onDeleteCommand:()=>Re(B,R),onAddCommand:_=>Ce(_)},null)}function be(B){const{targetForm:R,targetCommand:_}=B,H={formId:R.id,formCode:R.code,externalContainerId:R.containerId,commandCode:_.code,commandViewmodelId:_.viewmodelId};X(H,x.value),t.value.shouldShowCommunicationPanel=!0,D.value=!1,t.value.needSelectCommunicationCommand=!1}function Ne(){return e.createVNode(oo,{sourceCommunication:n.sourceCommunication,onSelectCommand:B=>be(B)},null)}return()=>e.createVNode("div",{class:"show-switch"},[e.createVNode("div",{class:"f-page-events-editor-bound-event"},[e.createVNode("div",{class:"f-page-events-editor-bound-event-name",title:o.value},[c.value]),!i.value&&e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:d.value,style:"font-size: 10px;",onClick:q},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",style:"font-size: 13px;float: right; margin:8px;",onClick:k},null),!i.value&&e.createVNode("div",{class:"f-icon f-icon-home-add",style:"float:right; font-size: 10px; margin:8px;",onClick:G},null),i.value&&e.createVNode("div",{class:"f-icon f-icon-flowline-warning text-danger text-tip",title:"源表单或事件已失效,请删除",style:"float:right; font-size: 13px; margin:8px;"},null)]),z.value&&Be(),D.value&&Ne(),y.value&&Oe(),!i.value&&t.value.shouldShowCommunicationPanel&&t.value.communication&&t.value.communication.length>0?t.value.communication.map((B,R)=>we(B,R)):""])}});function ro(n,V,p){const{interactions:s}=V,{setComponentLists:a}=Je(),f=e.ref(n.value.internalCommandList);function F(c){s.value[c].showSwitch=[],s.value[c].showSwitch.push(W.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),s.value=W.cloneDeep(s.value)}function g(c){var i;const o=[];return(i=n.value.newController)==null||i.forEach(x=>{c.forEach(S=>{x.Code===S.controller.label&&o.push(W.cloneDeep(x))})}),o}function I(c){if(n.value.repititionCommand.length!==0)return n.value.repititionCommand.forEach(o=>{c.forEach(i=>{var x,S,$,d;if(o.command.id===((x=i.command)==null?void 0:x.id)){o.command.params=W.cloneDeep((S=i.command)==null?void 0:S.property);const k=($=i.command)==null?void 0:$.targetComponent;(d=i.command)==null||d.componentLists.forEach(q=>{o.targetComponent=q.componentId===k?{id:q.componentId,viewModelId:q.viewModelId}:o.targetComponent})}})}),n.value.repititionCommand}function O(c=!1,o=null){var d;n.value.newFuncEvents=o?W.cloneDeep(o):null,n.value.isAddControllerMethod=c;const i=[],x=W.cloneDeep(n.value.internalCommandList);s.value.map(k=>{const q=W.cloneDeep(k.controller),G=W.cloneDeep(k.command),K=W.cloneDeep(k.event),Z=W.cloneDeep(k.communication),T={controller:q,command:G,boundEvents:K,communication:Z};i.push(W.cloneDeep(T))});const S=(d=n.value.newController)!=null&&d.length&&i.length?W.cloneDeep(g(i)):[];n.value.repititionCommand&&(n.value.repititionCommand=I(i));const $={viewModelId:n.value.viewModelId,savedCommand:W.cloneDeep(n.value.viewModel),boundEventsList:W.cloneDeep(i),events:W.cloneDeep(n.value.events),internalCommandList:W.cloneDeep(x),componentLists:[],relativePath:n.value.relativePath,envType:n.value.envType,newController:W.cloneDeep(S),isAddControllerMethod:n.value.isAddControllerMethod,repititionCommand:n.value.repititionCommand,preCommand:n.value.preCommand,newFuncEvents:n.value.newFuncEvents};p.emit("savedCommandListChanged",$)}function w(c){c.showSection[c.showSwitchNumber][2]=!0}function j(c){c.showSection[c.showSwitchNumber][2]=!1}function C(c){c.showSection[c.showSwitchNumber][3]=!0}function r(c){c.showSection[c.showSwitchNumber][3]=!1}function v(c,o=!1){c.showSection[c.showSwitchNumber][2]?(j(c),o&&C(c)):(w(c),o&&r(c))}function h(){return n.value.componentLists}function u(c){n.value.viewModel.forEach(o=>{for(let i=0;i<o.controllerList.length;i++)o.controllerList[i].label===c.label&&(o.controllerList[i]=W.cloneDeep(c))})}function l(){return n.value.viewModelId}function m(){return n.value.getEventPath?n.value.getEventPath().viewModelDisplay:[]}function b(c,o){return a(c,o,n.value)}function t(c){n.value.newController=n.value.newController||[],n.value.newController.push(W.cloneDeep(c));const o=n.value.newController;for(let i=0;i<o.length;i++)for(let x=i+1;x<o.length;x++)o[i].Id===o[x].Id&&(o.splice(x,1),x--)}function U(c){let o=!1;return n.value.internalCommandList.forEach(i=>{if(i.controllerName.label===c.controllerName.label){o=!0;return}}),o||n.value.internalCommandList.push(c),o}function z(){var c;if((c=n.value)!=null&&c.getEventPath)return n.value.getEventPath()}function A(c,o){s.value.forEach(i=>{var x;((x=i.command)==null?void 0:x.label)===o.label&&(i.command=o)})}function y(c,o){A(c,o)}function D(c,o){const i=s.value[o];c.event=c.event.label?c.event:W.cloneDeep(i.event);let x=!1;n.value.repititionCommand||(n.value.repititionCommand=[]),n.value.repititionCommand.forEach(d=>{d.command.id===c.command.id&&d.event.label===c.event.label&&d.targetComponent.viewModelId===c.targetComponent.viewModelId&&(x=!0),d.command.id===c.command.id&&d.event.label===c.event.label&&d.targetComponent.viewModelId!==c.targetComponent.viewModelId&&(d=W.cloneDeep(c))}),x||n.value.repititionCommand.push(W.cloneDeep(c));let S={id:c.command.id,label:c.command.label,name:c.command.name,handlerName:c.command.handlerName,cmpId:c.controller.id,componentLists:[],hasPath:!1,targetComponent:c.targetComponent.id,property:W.cloneDeep(c.command.params),shortcut:{},isRtcCommand:c.command.isRtcCommand,isNewGenerated:c.command.isNewGenerated||!1,isInvalid:!1};const $={controllerName:c.controller};S=a($,S,n.value),i.command=W.cloneDeep(S),i.controller=W.cloneDeep(c.controller),y(i,S)}return{controllers:f,onClosed:F,emitFinalState:O,toggleSelectingMethod:v,getViewModeId:l,getComponentList:h,updateTarget:u,updateCommandHasPath:b,addNewController:t,checkIfNewControllerExists:U,getMethodsOnViewModel:m,getEventPath:z,selectBoundCommand:D}}const ge=e.defineComponent({name:"FEventsEditor",props:Pe,emits:["savedCommandListChanged"],setup(n,V){const p=e.ref(n.initialData),s=e.inject("designer-host-service"),a=Mt(p),{loadEvents:f,resetBoundEvents:F}=a,g=e.inject("useFormSchema"),I=Pt(g,a),{addNewInteraction:O,deleteInteracton:w,interactions:j,loadInteractions:C}=I,r=ro(p,I,V),{emitFinalState:v,controllers:h}=r;e.provide("useEventsComposition",a),e.provide("useInteractionCompostion",I),e.provide("useMethodsComposition",r);function u(){p.value.isAddControllerMethod=!1}function l(){var y,D;const A=(D=(y=p.value)==null?void 0:y.sourceCommunication)==null?void 0:D.externalContainerId;if(A){const{assembleSourceOutline:c}=me(g),o=c(s,V,A);e.provide("sourceOutlineData",o)}}e.onMounted(()=>{u(),F(),f(),C(),l()});function m(A){w(A),v(!1,null)}function b(A,y){const D=A.showSwitch[0],c=D.showSection[D.showSwitchNumber][3];let o=!1;return n.initialData.getEventPath&&(n.initialData.getEventPath().actionWithPath.length!==0?o=!0:o=!1),e.createVNode(ao,{key:`${y}`,controllers:h.value,interaction:A,displayOrder:y,collapsed:c,onDelete:m,sourceCommunication:p.value.sourceCommunication,viewSourceHandle:n.viewSourceHandle,haveBoundCommand:o},null)}function t(){var A;return(A=j.value)==null?void 0:A.map((y,D)=>{var o;let c=y.event.label;return(o=y.communication)!=null&&o.length&&(c=`${y.communication.map(x=>x.id).join("-")}_${c}`),e.createVNode("div",{class:"events-display-order",key:`${c}_${D}`},[b(y,D)])})}function U(A){O(A)}function z(A){const y=A.source;if(j.value.find(c=>{var o;if((o=c.communication)!=null&&o.length&&c.communication.find(x=>{var S,$,d;return((S=x.source)==null?void 0:S.formId)===y.formId&&(($=x.source)==null?void 0:$.componentId)===y.componentId&&((d=x.source)==null?void 0:d.event)===y.event}))return!0})){new de.FNotifyService().info({position:"top-center",message:"事件已存在,请勿重复添加。"});return}O({label:"onCommunication",name:"组件通讯"},A)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(It,{sourceCommunication:p.value.sourceCommunication,onClickEventItem:U,onSelectSourceControl:z},null),t()])])}}),io={install(n){n.component(ge.name,ge)},register(n,V,p,s){n["events-editor"]=ge,V["events-editor"]=Ke}};N.FEventsEditor=ge,N.default=io,N.eventsEditorProps=Pe,N.propsResolver=Ke,Object.defineProperties(N,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});