@farris/ui-vue 1.7.2-beta.1 → 1.7.2-beta.2
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.
- package/components/avatar/index.esm.js +155 -148
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +1 -1
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +226 -224
- package/components/calendar/index.umd.cjs +3 -3
- package/components/collection-property-editor/index.esm.js +225 -223
- package/components/collection-property-editor/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +76 -71
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/comment/index.esm.js +169 -167
- package/components/comment/index.umd.cjs +6 -6
- package/components/component/index.esm.js +3691 -3043
- package/components/component/index.umd.cjs +2 -2
- package/components/condition/index.esm.js +2015 -1352
- package/components/condition/index.umd.cjs +2 -2
- package/components/data-grid/index.esm.js +407 -430
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +3082 -3196
- package/components/data-view/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3364 -2713
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +66 -64
- package/components/drawer/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1176 -524
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +182 -180
- package/components/dynamic-resolver/index.umd.cjs +2 -2
- package/components/dynamic-view/index.esm.js +531 -455
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +2352 -1700
- package/components/events-editor/index.umd.cjs +3 -3
- package/components/expression-editor/index.esm.js +8 -3
- package/components/expression-editor/index.umd.cjs +2 -2
- package/components/filter-bar/index.esm.js +422 -413
- package/components/filter-bar/index.umd.cjs +2 -2
- package/components/filter-condition-editor/index.esm.js +8 -3
- package/components/filter-condition-editor/index.umd.cjs +1 -1
- package/components/image/index.esm.js +363 -354
- package/components/image/index.umd.cjs +2 -2
- package/components/language-textbox/index.esm.js +189 -187
- package/components/language-textbox/index.umd.cjs +2 -2
- package/components/list-view/index.esm.js +388 -389
- package/components/list-view/index.umd.cjs +5 -5
- package/components/mapping-editor/index.esm.js +1465 -1488
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +180 -173
- package/components/number-range/index.umd.cjs +1 -1
- package/components/order/index.esm.js +815 -811
- package/components/order/index.umd.cjs +5 -5
- package/components/property-panel/index.esm.js +429 -420
- package/components/property-panel/index.umd.cjs +3 -3
- package/components/query-solution/index.esm.js +4746 -4085
- package/components/query-solution/index.umd.cjs +7 -7
- package/components/schema-selector/index.esm.js +1401 -1402
- package/components/schema-selector/index.umd.cjs +5 -5
- package/components/section/index.esm.js +102 -100
- package/components/section/index.umd.cjs +2 -2
- package/components/sort-condition-editor/index.esm.js +8 -3
- package/components/sort-condition-editor/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +537 -538
- package/components/transfer/index.umd.cjs +5 -5
- package/components/tree-grid/index.esm.js +280 -283
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +200 -202
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +533 -519
- package/components/uploader/index.umd.cjs +2 -2
- package/designer/data-grid/index.esm.js +3806 -3905
- package/designer/data-grid/index.umd.cjs +9 -9
- package/designer/drawer/index.esm.js +188 -186
- package/designer/drawer/index.umd.cjs +2 -2
- package/designer/dynamic-form/index.esm.js +1562 -1073
- package/designer/dynamic-form/index.umd.cjs +2 -2
- package/designer/farris-designer.all.esm.js +9793 -8613
- package/designer/farris-designer.all.umd.cjs +8 -8
- package/designer/list-view/index.esm.js +564 -564
- package/designer/list-view/index.umd.cjs +6 -6
- package/designer/radio-group/index.esm.js +236 -229
- package/designer/radio-group/index.umd.cjs +1 -1
- package/designer/response-layout-editor/index.esm.js +178 -171
- package/designer/response-layout-editor/index.umd.cjs +1 -1
- package/designer/tabs/index.esm.js +3154 -2508
- package/designer/tabs/index.umd.cjs +2 -2
- package/designer/time-picker/index.esm.js +193 -186
- package/designer/time-picker/index.umd.cjs +1 -1
- package/designer/tree-grid/index.esm.js +444 -447
- package/designer/tree-grid/index.umd.cjs +1 -1
- package/farris.all.esm.js +60126 -59649
- package/farris.all.umd.cjs +30 -30
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/components.d.ts +1 -1
- package/types/condition/src/composition/condition-value/dropdown-value.d.ts +4 -0
- package/types/data-grid/index.d.ts +2 -5
- package/types/data-grid/src/data-grid.component.d.ts +1 -2
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/appearance/use-cell-position.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +0 -4
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +2 -2
- package/types/data-view/composition/visualization/use-visual-data-bound.d.ts +2 -3
- package/types/data-view/composition/visualization/use-visual-data-row.d.ts +1 -2
- package/types/designer-canvas/src/composition/dg-control.d.ts +24 -0
- package/types/dynamic-form/designer.d.ts +0 -1
- package/types/dynamic-form/index.d.ts +4 -3
- package/types/dynamic-form/src/designer/dynamic-form.design.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form.design.props.d.ts +14 -0
- package/types/dynamic-form/src/designer/use-dynamic-form-rules.d.ts +2 -0
- package/types/dynamic-form/src/dynamic-form.component.d.ts +8 -0
- package/types/dynamic-form/src/response-form.props.d.ts +13 -1
- package/types/dynamic-form/src/schema/response-form-schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +1 -0
- package/types/dynamic-resolver/src/types.d.ts +1 -0
- package/types/dynamic-view/index.d.ts +43 -3
- package/types/dynamic-view/src/components/maps.d.ts +6 -6
- package/types/dynamic-view/src/composition/index.d.ts +5 -0
- package/types/dynamic-view/src/composition/use-utils.d.ts +12 -0
- package/types/dynamic-view/src/dynamic-view.component.d.ts +6 -6
- package/types/language-textbox/index.d.ts +3 -3
- package/types/language-textbox/src/components/language-contents.component.d.ts +1 -1
- package/types/language-textbox/src/language-textbox.component.d.ts +1 -1
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +1 -1
- package/types/lookup/src/components/popup-container.component.d.ts +3 -3
- package/types/property-panel/src/property-panel.component.d.ts +3 -3
- package/types/tree-grid/src/components/data/data-area.component.d.ts +2 -2
- package/types/tree-grid/src/tree-grid.props.d.ts +0 -1
- package/types/tree-view/src/components/data/tree-area.component.d.ts +1 -1
- package/types/tree-view/src/tree-view.props.d.ts +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(b,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("../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","../property-panel/index.umd.js"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b["events-editor"]={},b.Vue,b.dynamicResolver,b.LodashES,b.common,b.designerCanvas,b.notify,b.FTreeview,b.FSchemaSelector,b.modal,b.FInputGroup,b.FComboList,b.FEventParameter,b.locale,b.FAccordion,b.FAvatar,b.FButtonEdit,b.FButtonGroup,b.FCalendar,b.FCapsule,b.FCheckbox,b.FCheckboxGroup,b.FComboTree,b.FComponent,b.FColorPicker,b.FContentContainer,b.FDatePicker,b.FDataGrid,b.FDropdown,b.FDynamicForm,b.FEventsEditor$1,b.FFilterBar,b.FFieldSelector,b.FBindingSelector,b.FImageCropper,b.FInputGroup$1,b.FLayout,b.FListNav,b.FListView,b.FLookup,b.FMappingEditor,b.FNav,b.FNumberRange,b.FNumberSpinner,b.FOrder,b.FPageHeader,b.FPageFooter,b.FPagination,b.FProgress,b.FQuerySolution,b.FRadioGroup,b.FRate,b.FResponseToolbar,b.FResponseLayout,b.FResponseLayoutEditorSetting,b.FSearchBox,b.FSection,b.FSmokeDetector,b.FSplitter,b.FStep,b.FSwitch,b.FTabs,b.FTags,b.FText,b.FTimePicker,b.FTransfer,b.FUploader,b.FVerifyDetail,b.FVideo,b.FTextArea,b.FTreeGrid,b.FFilterConditionEditor,b.FFieldset,b.FSortConditionEditor,b.FMenuLookup,b.FDrawer,b.FJsonEditor,b.FPropertyEditor,b.FExpressionEditor,b.FCodeEditor,b.FHtmlTemplate,b.FCollectionPropertyEditor,b.FModal,b.FExternalContainer,b.FLanguageTextbox,b.FImage,b.FComment))})(this,function(b,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){"use strict";const Ct=new Map([["appearance",ae.resolveAppearance]]);function wt(n,x,g){return x}const bt={$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"]},Nt={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,bt,Ct,wt,Nt);function Je(){function n(g,v){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 S=a.findIndex(p=>g===p.controllerId);return S!==-1&&(u=a[S].commands.findIndex(p=>v===p.handlerName)),u!==-1}function x(g,v,a){const u=n(g.controllerName.id,v.handlerName);return a.componentLists.length!==0&&u&&(v.hasPath=!0,v.targetComponent=v.targetComponent||a.componentLists[0].componentId,v.componentLists=H.cloneDeep(a.componentLists)),v}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 St(n,x){const g=e.inject("designerContext"),v=g&&g.dgControl?g.dgControl:Qe.DgControl,a=e.ref(""),u=e.ref("");function S(r){var l,N,B,o;let h="controlIcon fd-i-Family ",f="";switch(r==null?void 0:r.type){case"form-group":{f=((l=v[r.type])==null?void 0:l.icon)||((N=r.editor)==null?void 0:N.type)||"",(B=v[r.editor.type])!=null&&B.icon&&(f=v[r.editor.type].icon);break}default:f=((o=v[r.type])==null?void 0:o.icon)||r.type}const s=`fd_pc-${f}`;return h+=s,h}function p(r,h){var l;let f=r.id;const s=h==null?void 0:h.contents;if((h==null?void 0:h.type)==="splitter"&&s&&s.length===2){const N=h.direction!=="column";r.id===((l=s[0])==null?void 0:l.id)?f=N?"左侧区域":"上方区域":f=N?"右侧区域":"下方区域"}return f}function q(r){if(r.isLikeCardContainer)return"区块";const h=r.appearance&&r.appearance.class||"",f=h.split(" ");return r.id==="page-header"&&h&&h==="f-page-header"?"页头":f.includes("f-page-header-base")?"页头容器":f.includes("f-page-header-extend")?"页头扩展容器":f.includes("f-title")?"标题容器":f.includes("f-page")?"根容器":f.includes("f-page-main")?"内容区域":f.includes("f-scrollspy-content")&&r.isScrollspyContainer?"滚动监听容器":f.includes("f-grid-is-sub")?"表格容器":f.includes("f-filter-container")?"筛选条容器":"容器"}function O(r){const{componentType:h}=r;switch(h){case ce.Frame:return"根组件";case ce.dataGrid:return(n==null?void 0:n.formSchemaUtils.selectNode(r,s=>s.type===(v["tree-grid"]&&v["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,h){const f=r.name||r.text||r.label||r.title||r.mainTitle;if(r.type!=="component"&&f&&typeof f=="string")return f.trim();switch(r.type){case"content-container":return q(r);case"splitter-pane":return p(r,h);case"component":return O(r);default:return v[r.type]&&v[r.type].name||r.id}}function y(r,h){const f=r.length?r[0]:null;if(!f)return;u.value="",a.value=f.originalId;const s=f?`${f.originalId}-design-item`:"",l=document.getElementById(s);l&&l.click(),x.emit("selectionChanged",f)}function C(r){if(!r)return;const h=`${r}-design-item`,f=document.getElementById(h);f&&f.click()}return{getIcon:S,getTitle:w,onChanged:y,currentSelectedNodeId:a,currentSelectedOutsideNodeId:u,triggerOutsideClick:C}}function Vt(n,x){const{getIcon:g,getTitle:v}=x;function a(w,y,C,r,h){var s;const f=(s=n.data.module)==null?void 0:s.components.find(l=>l.id===w.component);f&&u([f],y,C,r,h)}function u(w,y,C,r,h){return w.forEach(f=>{if(f.type==="component"&&(h=f.id),f.type==="component-ref"){a(f,y,C,r,h);return}const s={originalId:f.id,layer:C,originalParent:r==null?void 0:r.id,componentId:h,name:v(f,r),type:f.type,controlIcon:g(f),rawSchema:f};y.push(H.cloneDeep(s)),(f.contents||f.buttons)&&u(f.contents||f.buttons,y,C+1,f,h)}),y}function S(w){const y=[],C=w.find(s=>s.layer===0);w=w.filter(s=>s.layer!==0),y.push(C);let r=C.originalId,h=0,f=1e3;for(;w.length!==0||f===0;){const s=w.find(l=>l.originalParent===r);s?(y.push(s),r=s.originalId,w=w.filter(l=>l.originalId!==r),h=0):(h-=1,r=y.slice(h)[0].originalId),f-=1}return y}function p(w){return w.forEach((y,C)=>{y.id=(C+1).toString()}),w.forEach(y=>{var C;y.parent=((C=w.find(r=>r.originalId===y.originalParent))==null?void 0:C.id)||""}),w.forEach(y=>{y.hasChildren=w.findIndex(C=>C.parent===y.id)>0}),w}function q(w){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},C=[];return w.forEach(r=>{r[0].originalParent=y.originalId,C.push(...r)}),C.unshift(y),C}function O(){const w=n.data.module?e.ref(n.data.module.components):e.ref([n.data]);if(!w.value)return;const y=[];w.value.forEach(f=>{if(f){const s=[];s.push(f);const B=u(s,[],1,null,f.id);y.push(B)}});const C=q(y),r=S(C);return p(r)}return{getData:O}}function me(n){const x=e.inject("sourceOutlineData")||[],g=e.ref(),v=e.ref(!1),a=e.ref([]),u=e.ref();function S(s,l,N,B){var o,_,W,$;return{id:se.useGuid().guid(),source:B||{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:($=s.sourceCommunication)==null?void 0:$.externalContainerId,event:l||"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 p(s){var l,N;(l=s==null?void 0:s.communication)!=null&&l.length&&((N=s==null?void 0:s.communication)==null||N.map(B=>{var o,_;if(B!=null&&B.id&&!((o=B==null?void 0:B.source)!=null&&o.componentId)){const W=(_=n.getFormSchema().module.communications)==null?void 0:_.find($=>$.id===(B==null?void 0:B.id));W&&Object.assign(B,W)}}))}function q(s){const l=n.getFormSchema(),{communications:N}=l.module;N||(l.module.communications=[]);const B=l.module.communications.findIndex(o=>o.id===s.id);B===-1?l.module.communications.push(s):Object.assign(l.module.communications[B],s)}function O(s){var l;if((l=s==null?void 0:s.communication)!=null&&l.length){const N=n.getFormSchema();s.communication.map(B=>{N.module.communications&&B&&(N.module.communications=N.module.communications.filter(o=>o.id!==B.id))}),s.communication=[]}}function w(s){var N;const l=n.getFormSchema();s&&((N=l.module.communications)!=null&&N.length)&&(l.module.communications=l.module.communications.filter(B=>B.id!==s))}function y(s,l,N){const B=St(s,l),o=n.externalFormSchema.get(N);if(o!=null&&o.content){const _={data:o.content},{getData:W}=Vt(_,B);return W()}return[]}function C(s){var N;if(!((N=s==null?void 0:s.source)!=null&&N.componentId)){v.value=!1;return}const l=x.find(B=>B.originalId===s.source.componentId);l?(v.value=!1,g.value=l):(v.value=!0,g.value={id:s.source.componentId})}function r(s){var o,_,W,$;a.value=[];const l=(o=g.value)==null?void 0:o.rawSchema;if(!l){u.value=null;return}const N=l.type==="form-group"&&l.editor?l.editor.type:l.type,B=(_=ae.schemaMap[N])==null?void 0:_.events;B&&Object.keys(B).forEach(V=>{a.value.push({eventCode:V,eventName:B[V]})}),(W=s.source)!=null&&W.event&&(($=a.value)!=null&&$.length)&&(u.value=a.value.find(V=>{var k;return V.eventCode===((k=s.source)==null?void 0:k.event)}))}function h(s){var B,o,_,W,$,V,k,c;if(!(s!=null&&s.length))return;C(s[0]),r(s[0]);let l="",N="";return v.value?l=`${((B=s[0].source)==null?void 0:B.componentId)||""}-${((o=s[0].source)==null?void 0:o.event)||""}`:(l=(_=g.value)==null?void 0:_.name,l&&((W=u.value)!=null&&W.eventName)&&(l+=`-${($=u.value)==null?void 0:$.eventName}`),N=`${(V=g.value)==null?void 0:V.name} (${(k=g.value)==null?void 0:k.originalId})`,N=`${N}
|
|
2
|
-
${(c=u.value)==null?void 0:c.eventName} (${u.value.eventCode})`),{title:l,titleTip:N,isControlInvalid:v.value}}function f(s){var l;if((l=s==null?void 0:s.communication)!=null&&l.length){const N=s==null?void 0:s.communication[0];return N==null?void 0:N.source}}return{createNewCommunication:S,resolveCommunication:p,clearAllCommunication:O,clearCommunicationById:w,saveCommunication:q,assembleSourceOutline:y,resolveSourceControlEventTitle:h,resolveCommunicationSource:f}}function xt(n,x,g){const v=e.ref([]),{boundEvents:a,unBoundEvent:u}=x;function S(C){var h,f;return{event:{label:(h=C.boundEvents)==null?void 0:h.label,name:(f=C.boundEvents)==null?void 0:f.name},showSwitch:[{showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2}],command:H.cloneDeep(C.command),controller:H.cloneDeep(C.controller),communication:C.communication}}function p(){var C;v.value=(C=a.value)==null?void 0:C.map(r=>S(r))}function q(C,r){const f=S({boundEvents:C,command:null,controller:{id:"",name:"",label:""},communication:r?[r]:[]});if(r){f.showSwitch[0].showSwitchNumber=2,f.showSwitch[0].showSection[2][2]=!1,f.showSwitch[0].showSection[2][3]=!1,f.needSelectCommunicationCommand=!0,v.value.unshift(f);return}C&&(f.showSwitch[0].showSwitchNumber=1,f.showSwitch[0].showSection[2][3]=!0,v.value.unshift(f))}function O(){var C;(C=v.value)==null||C.forEach(r=>{r.showSwitch.forEach(h=>{h.showSection[2][3]=!1}),r.shouldShowCommunicationPanel=!1})}function w(C){v.value[C].showSwitch.forEach(r=>{r.showSection[2][3]=!r.showSection[2][3]})}function y(C){if(C>=0&&C<=v.value.length-1){const r=v.value[C];u(r.event),v.value.splice(C,1);const{clearAllCommunication:h}=me(n);h(r)}}return{addNewInteraction:q,collapseInteractions:O,deleteInteracton:y,toggleMethodInInteraction:w,interactions:v,loadInteractions:p}}function Ft(n){const x=e.ref([]),g=e.ref([]),v=e.ref([]),{isContextDependent:a}=Je();function u(){const{allComponentList:C}=n.value;n.value.componentLists.length&&n.value.viewModel&&n.value.viewModel.forEach(r=>{r.controllerList.forEach(h=>{if(h.targetComponent){const f=C.find(l=>l.componentId===h.targetComponent);if((f?f.viewModelId:void 0)===n.value.viewModelId)h.hasPath=!1;else{const l=a(r.controllerName.id,h.handlerName);h.hasPath=l?!0:h.hasPath,h.componentLists=l?H.cloneDeep(n.value.componentLists):h.componentLists}}})}),n.value.componentLists.length&&n.value.boundEventsList&&n.value.boundEventsList.forEach(r=>{var h;if((h=r.command)!=null&&h.targetComponent){const f=C.find(l=>{var N;return l.componentId===(((N=r.command)==null?void 0:N.targetComponent)||"")});if((f?f.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?H.cloneDeep(n.value.componentLists):r.command.componentLists}}})}function S(){const C=g.value.reduce((h,f)=>(h.set(f.boundEvents.label,!0),h),new Map);return x.value.filter(h=>!C.has(h.label))}function p(){var r;const C=((r=g.value)==null?void 0:r.length)>0;v.value=C?S():x.value}function q(){u(),x.value=n.value.events,g.value=n.value.boundEventsList,p()}function O(C){v.value=v.value.filter(r=>r.label!==C.label)}function w(C){g.value=g.value.filter(r=>r.boundEvents.label!==C.label),p()}function y(){var h;const C=(h=n.value)==null?void 0:h.getEventList(),{events:r}=C;C&&(n.value.events=H.cloneDeep(r),n.value.boundEventsList=C.boundEventsList),n.value.boundEventsList&&(n.value.boundEventsList=n.value.boundEventsList.filter(function(f){return r.find(s=>s.label===f.boundEvents.label)}))}return{allEvents:x,boundEvents:g,candidateEvents:v,excludeFromCandidates:O,loadEvents:q,resetBoundEvents:y,unBoundEvent:w}}const yt={sourceCommunication:{type:Object,default:{}}},jt={events:{type:Array,default:[]}},Et=e.defineComponent({name:"FEventList",props:jt,emits:["click"],setup(n,x){const g=e.ref(n.events);function v(u){x.emit("click",u)}function a(u){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>v(u),class:"f-page-events-editor-first-bound-event-name"},[u.name])])}return()=>e.createVNode("div",{class:"f-page-events-editor-events"},[g.value.map(u=>a(u))])}}),fe={communication:{type:Object},sourceCommunication:{type:Object,default:{}},event:{type:String,default:""}},Pt=e.defineComponent({name:"FSelectSourceControl",props:fe,emits:["selectSourceEvent","deleteControl"],setup(n,x){const g=e.inject("useFormSchema"),{createNewCommunication:v}=me(g),a=e.ref();a.value=v(n);const u=e.ref([{field:"name",title:"",dataType:"string"}]),S=e.ref([]),p=e.ref(),q=e.ref(),O=e.ref(!0),w=e.ref(!1),y=e.ref([]),C=e.ref(),r=e.ref(!0),h=e.ref(!1);function f(){const V=e.inject("sourceOutlineData");S.value=V||[],q.value.updateDataSource(S.value)}function s(){var k,c,t;if(!((c=(k=a.value)==null?void 0:k.source)!=null&&c.componentId)){h.value=!1;return}const V=(t=S.value)==null?void 0:t.find(i=>i.originalId===a.value.source.componentId);V?(q.value.selectItemById(V.id),h.value=!1):(h.value=!0,p.value={id:a.value.source.componentId})}function l(){var V,k,c;(k=(V=a.value)==null?void 0:V.source)!=null&&k.event&&((c=y.value)!=null&&c.length)&&(C.value=y.value.find(t=>{var i,d;return t.eventCode===((d=(i=a.value)==null?void 0:i.source)==null?void 0:d.event)}))}e.onMounted(()=>{f(),s(),l(),r.value=!1});function N(){var t;y.value=[];const V=p.value.rawSchema,k=V.type==="form-group"&&V.editor?V.editor.type:V.type,c=(t=ae.schemaMap[k])==null?void 0:t.events;c&&Object.keys(c).forEach(i=>{y.value.push({eventCode:i,eventName:c[i]})})}function B(V){O.value=!1,h.value=!1;const k=p.value!==V[0];k&&(p.value=V[0],N()),r.value||(w.value=!0),!r.value&&k&&(C.value=null)}const o=e.computed(()=>({"item-list":!0,"d-none":!O.value})),_=e.computed(()=>V=>{var k;return{item:!0,selected:((k=C.value)==null?void 0:k.eventCode)===V}});function W(V){var k;O.value=!1,w.value=!1,C.value=V,a.value.source.componentId=p.value.rawSchema.id,a.value.source.event=(k=C.value)==null?void 0:k.eventCode,x.emit("selectSourceEvent",a.value)}const $=e.computed(()=>({"form-container":!0,"position-relative":!0,invalid:h.value}));return()=>e.createVNode("div",{class:$.value},[e.createVNode("div",{class:o.value,style:"min-height:220px;"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择源控件")]),e.createVNode(Ue.FTreeView,{ref:q,data:S.value,columns:u.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("请选择事件")]),y.value.map(V=>e.createVNode("span",{class:_.value(V.eventCode),onClick:()=>W(V)},[V.eventName]))])])])}}),Mt=e.defineComponent({name:"FInteractionButton",props:yt,emits:["clickEventItem","selectSourceControl"],setup(n,x){const g=new de.FNotifyService,v=e.inject("useEventsComposition"),a=e.inject("useInteractionCompostion"),{candidateEvents:u}=v,{collapseInteractions:S}=a,p=e.ref(!1),q=e.ref(!1);function O(h){u.value=u.value.filter(f=>f.label!==h.label)}function w(){var h;(h=n.sourceCommunication)!=null&&h.needSelectSourceControl?q.value=!q.value:p.value=!p.value}function y(h){w(),O(h),x.emit("clickEventItem",h)}function C(){var h;if(!((h=n.sourceCommunication)!=null&&h.needSelectSourceControl)&&u.value.length===0){g.info({position:"top-center",message:"事件已全部绑定"});return}S(),w()}function r(h){q.value=!1,x.emit("selectSourceControl",h)}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("新建交互事件")])])]),p.value&&e.createVNode(Et,{events:u.value,onClick:y},null),q.value&&e.createVNode(Pt,{sourceCommunication:n.sourceCommunication,onSelectSourceEvent:r},null)])}}),Tt={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}},Lt={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:{}}},Bt={controllers:{type:Array,default:[]}},It=e.defineComponent({name:"FCommandList",props:Bt,emits:["selectMethod"],setup(n,x){function g(p){return p.controllerList.length!==0}function v(p){return g(p)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:p.controllerName.name},[p.controllerName.name])])}function a(p,q){x.emit("selectMethod",{method:p,controller:q})}function u(p){return p.controllerList.map(q=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>a(q,p)},[e.createVNode("div",{class:"f-page-internals-command-name",title:q.label},[q.name])]))}function S(p){return e.createVNode("div",null,[v(p),u(p)])}return()=>e.createVNode("div",{class:"f-page-internals"},[n.controllers.map(p=>S(p))])}}),kt={getEventPath:{type:Function,default:null},notifyService:{type:Object},useFormSchema:{type:Object},sourceCommunication:{type:Object,default:{}},event:{Type:Object}},qt=e.defineComponent({name:"FBoundEventSelector",props:kt,emits:["cancel","submit"],setup(n,x){var F,A;const g=e.ref(),v=e.ref([]),a=e.ref('<i class="f-icon f-icon-search"></i>'),u=n.useFormSchema.getFormMetadataBasicInfo(),S=e.ref(""),p=e.ref(),q=((F=n.sourceCommunication)==null?void 0:F.unSupportedEventCodes)||[],O=e.ref(!q.includes(n.event.label)&&((A=n.useFormSchema.externalFormSchema)==null?void 0:A.size)>0),w=e.ref(),y=e.ref([]);e.onBeforeMount(()=>{if(n.getEventPath){const m=n.getEventPath();g.value=m.viewModelDisplay;const{actionWithPath:I}=m;I.forEach(D=>{D.sourceComponent.map.forEach(U=>{U.active=!1,U.hide=!1})}),v.value=H.cloneDeep(I)}});function C(m=""){m=m.replace(/ /g,"").replace(/>/g,"").toLowerCase(),m===""&&(m=" "),v.value.forEach(I=>{const D=I.path;I.sourceComponent.map.forEach(U=>{const K=U.command.name,X=U.event.name,P=U.command.label;`${D}${K}${X}${P}`.toLowerCase().includes(m)?U.hide=!1:U.hide=!0})})}function r(m=""){m=m.replace(/ /g,"").replace(/>/g,"").toLowerCase(),y.value.forEach(I=>{if(!I.isCommandNode)return;const D=I.name||"",U=I.code||"",K=I.viewmodelName||"",X=`${D}${U}${K}`.toLowerCase();m&&!X.includes(m)?I.hide=!0:I.hide=!1})}function h(m=""){!w.value||w.value.id===u.id?C(m):r(m)}function f(){const m=e.createVNode("div",{class:"f-vm-search"},[e.createVNode("div",{class:"f-vm-searchBar"},[e.createVNode(Xe,{updateOn:"change",groupText:a.value,modelValue:S.value,"onUpdate:modelValue":I=>S.value=I,onChange:h,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"},[m])])]):m}function s(m){return{"f-vm-item":!0,"f-vm-item-focus":m.active}}function l(m,I){let D=0;v.value.forEach(U=>{U.sourceComponent.map.forEach(K=>{!K.command.isInvalid&&m.controller.id===K.controller.id&&m.command.id===K.command.id&&m.event.label===K.event.label&&I.sourceComponent.id===U.sourceComponent.id?(m.active=!m.active,p.value=H.cloneDeep(m)):(K.command.isInvalid&&m.controller.id===K.controller.id&&m.command.id===K.command.id&&m.event.label===K.event.label&&I.sourceComponent.id===U.sourceComponent.id&&(D++,D===1&&(new de.FNotifyService().info({position:"top-center",message:"该方法已失效"}),p.value=null)),K.active=!1)})})}function N(m){return{"f-event-func":!m.command.isInvalid,"f-event-func-invalid":m.command.isInvalid}}function B(m){return m.sourceComponent.map.filter(I=>!I.hide).map(I=>{if(!I.command.isInvalid)return e.createVNode("div",{class:s(I),onClick:()=>l(I,m)},[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(I)},[I.command.name,e.createTextVNode("("),I.command.label,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[m.path,I.event.name])])})}function o(){return v.value.length>0?e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[v.value.map(m=>B(m))]):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(!p.value){n.notifyService.info({position:"top-center",message:"请选择需要绑定的方法"});return}x.emit("submit",{selectedCommand:p.value,selectedForm:w.value})}function $(){const m=n.useFormSchema.externalFormSchema,I=[];return I.push({containerId:"",id:u.id,code:u.code,name:u.name}),Array.from(m.keys()).forEach(D=>{const U=m.get(D);I.push({containerId:D,id:U.id,code:U.code,name:U.name})}),I}const V=e.computed(()=>({"f-vm-all":!0," h-100":!0,"has-page-list":O.value}));function k(m){var K,X;const{viewmodels:I,components:D}=m.module;if((I==null?void 0:I.length)===0||(D==null?void 0:D.length)===0)return[];y.value=[];const U=(X=(K=n.sourceCommunication)==null?void 0:K.parameterData)==null?void 0:X.getViewModelName;I.forEach(P=>{if(!P||!P.commands||P.commands.length===0)return[];const J=D.find(re=>re.viewModel===P.id),Z=U&&J?U(J,P.name,m):"";y.value.push({id:P.id,code:P.code,name:Z||P.name}),P.commands.forEach(re=>{re.isInvalid||y.value.push({...re,viewmodelId:P.id,viewmodelName:Z||P.name,isCommandNode:!0})})})}function c(m){var I,D,U;if(!(m.id===w.value.id&&m.containerId===w.value.containerId))if(w.value=m,S.value="",p.value=null,w.value.id!==u.id){const K=(D=n.useFormSchema.externalFormSchema)==null?void 0:D.get((I=w.value)==null?void 0:I.containerId);(U=K==null?void 0:K.content)!=null&&U.module&&k(K.content)}else v.value.map(K=>{K.sourceComponent.map.map(X=>{X.hide=!1,X.active=!1})})}function t(){const m=$();w.value||(w.value=m[0]);const I=e.computed(()=>D=>{var U;return{"f-list-view-group-item":!0,"f-listview-active":D.id===((U=w.value)==null?void 0:U.id)&&D.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;"},[m.map(D=>{let U=D.name;return D.containerId&&(U+=`, 所属外部容器:${D.containerId}`),e.createVNode("li",{class:I.value(D),onClick:()=>c(D)},[e.createVNode("div",{class:"f-list-content"},[e.createVNode("div",{class:"f-navSelector-leftCategory",title:U},[D.name])])])})])])])])}function i(m){y.value.map(I=>I.active=!1),m.active=!0,p.value=m}function d(){return e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[y.value.filter(m=>!m.hide).map(m=>{if(m.isCommandNode)return e.createVNode("div",{class:s(m),onClick:()=>i(m)},[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"},[m.name,e.createTextVNode("("),m.code,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[m.viewmodelName])])})])}return()=>e.createVNode("div",{class:V.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"},[f(),!w.value||w.value.id===u.id?o():d()])]),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("确定")])])])}}),Dt=e.defineComponent({name:"FCommandSource",props:Lt,emits:["addInternalCommandListChanged","newImportChanged","selectBoundMethod","click","existChanged","newFunctionChanged","close","selectMethod","addCommunication"],setup(n,x){const g=e.inject("useMethodsComposition"),v=e.inject("useFormCommand"),a=new de.FNotifyService,{checkIfNewControllerExists:u,addNewController:S}=g,p=e.ref(n.controllers),q=e.inject("useFormSchema"),O=e.inject(Ye.F_MODAL_SERVICE_TOKEN);let w,y;const C=e.ref(!1);e.onMounted(()=>{C.value=q.externalFormSchema.size>0});function r(i,d,F){if(S(i),i.Commands){const A=v.getInternalControllerFromControllerMetadata(i,d,F);u(A)&&a.info({position:"top-center",message:"该控制器已存在"})}}async function h(i){v.getSupportedControllerMetadata(i).then(d=>{d&&r(d.controller,d.code,d.nameSpace)}).finally(()=>{w&&w.destroy&&w.destroy()})}function f(i){w&&w.destroy&&w.destroy()}function s(){const i={formBasicInfo:q==null?void 0:q.getFormMetadataBasicInfo()};return e.createVNode(Ge.FSchemaSelector,{injectSymbolToken:se.ControllerSchemaRepositorySymbol,"view-type":"NavList",editorParams:i,showFooter:!0,onCancel:f,onSubmit:h},null)}function l(){w=O.open({title:"选择控制器",width:950,render:s,showButtons:!1})}function N(){x.emit("newFunctionChanged")}function B(){y&&y.destroy&&y.destroy()}function o(i){const{selectedCommand:d,selectedForm:F}=i;!F||(F==null?void 0:F.id)===q.getFormMetadataBasicInfo().id?(g.selectBoundCommand(d,n.iteractionDisplayOrder),x.emit("selectBoundMethod")):x.emit("addCommunication",i),B()}function _(){const{getEventPath:i}=g;return e.createVNode(qt,{getEventPath:i,notifyService:a,useFormSchema:q,sourceCommunication:n.sourceCommunication,event:n.event,onCancel:B,onSubmit:o},null)}function W(){y=O.open({title:"已有方法",width:950,height:500,fitContent:!1,render:_,showButtons:!1,enableEsc:!1,draggable:!0})}function $(){x.emit("close",null)}function V(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function k(){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:()=>N()},[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:()=>W()},[e.createTextVNode("已有方法")])])])}function c(i){x.emit("selectMethod",i)}function t(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(It,{controllers:p.value,onSelectMethod:c},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[t(),V(),k(),V(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:$},[e.createTextVNode("取消")])])])}}),At={command:{type:Object,default:{}},showParameter:{type:Boolean,default:!1},controller:{type:Object,default:{}},showDeleteIcon:{type:Boolean,default:!1}},$t=e.defineComponent({name:"FParameterEditor",props:At,emits:["confirm","change","targetChange","viewSource","deleteCommand"],setup(n,x){const g=new de.FNotifyService,v=e.inject("FMessageBoxService"),a=e.ref(H.cloneDeep(n.command)),u=e.ref(n.controller),S=e.ref(0),p=e.computed(()=>a.value.id==="abandoned"),q=e.computed(()=>a.value.id==="deleted"),O=e.computed(()=>n.showDeleteIcon),w=e.computed(()=>a.value!==null),y=e.inject("useMethodsComposition"),C=e.ref(n.showParameter),r=e.inject("useFormSchema"),h=e.computed(()=>a.value.componentLists&&a.value.hasPath),f=e.computed(()=>{const P=a.value.id!=="abandoned"&&a.value.id!=="deleted",J=h.value,Z=a.value.property&&a.value.property.length>0;return P&&(J||Z)});function s(){const{targetComponent:P}=a.value;let J="";return a.value.componentLists&&a.value.componentLists.forEach(Z=>{if(Z.componentId===P){J=Z.viewModelId;return}}),J}const l=e.ref(s()),N=e.computed(()=>a.value.targetComponent||"");function B(){g.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:()=>B()},null)}function _(){g.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 $(P){C.value=!C.value}function V(){return e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>$(S.value)},null)}function k(P,J){a.value.targetComponent=P[0].componentId,x.emit("targetChange",a.value)}function c(){const P=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"),P]])]),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:k},null)])])])}function t(P,J){J.value=P}function i(){x.emit("change",a.value)}function d(){let P="";return N.value?P=r.getViewModelIdByComponentId(N.value):P=y.getViewModeId(),P}function F(P,J){var Ce,we,be,Ne,he,ve,T,R,G,z,Q,ee,ne,te,oe,Se,Ve,xe,le,Fe,ye;const Z=d(),Le=r.getViewModelById(Z).commands.find(Y=>{var ie;return(Y==null?void 0:Y.id)===((ie=n.command)==null?void 0:ie.id)}),Be=e.reactive(P.context.data),{assembleSchemaFieldsByComponent:Ie,assembleOutline:ke,assembleStateVariables:qe,assembleSchemaFieldsUnderBoundEntity:De,getEditor:Ae}=P.context.generalData,{designerMode:$e}=r,Oe=Y=>{t(Y,P),i()},Re=Y=>{var ie,ge,ue,je;return((je=(ue=(ge=(ie=P==null?void 0:P.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:P==null?void 0:P.origin.defaultValue,modelValue:P.value,"onUpdate:modelValue":Y=>P.value=Y,data:Be,editor:Ae(P.value,P,Le,Z,Oe),fieldData:Ie(),formData:ke(),varData:qe(),activeViewModelFieldData:De(N.value),editorControlSource:(Ce=P==null?void 0:P.origin)==null?void 0:Ce.controlSource,customRowStatus:Re,idField:((he=(Ne=(be=(we=P==null?void 0:P.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=(T=(ve=P==null?void 0:P.origin)==null?void 0:ve.controlSource)==null?void 0:T.context)==null?void 0:R.valueField)==null?void 0:G.value)||((ne=(ee=(Q=(z=P==null?void 0:P.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=P==null?void 0:P.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=P==null?void 0:P.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,P),i()},onValueChange:Y=>{var ie,ge;if(((ie=P.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,P),i()}},null)}function A(){var P;return(P=a.value.property)==null?void 0:P.map((J,Z)=>{const re=e.reactive({content:J.description,placement:"top"});return e.createVNode("div",{key:J.name+Z},[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"},[F(J,a.value)])])})}function m(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[h.value&&c(),A()])}function I(P){P.stopPropagation(),x.emit("viewSource",{command:a.value,event:P})}function D(){v.question(`确定删除命令【${a.value.name}】吗?`,"",()=>{x.emit("deleteCommand")})}function U(){return e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:P=>D()},null)}const K=e.computed(()=>{var P;return{cursor:p.value||u.value.isCommon||((P=u.value)==null?void 0:P.label.indexOf(r==null?void 0:r.getModule().code))===-1?"default":"pointer"}});function X(){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:I},[a.value.name]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[p.value&&o(),q.value&&W(),f.value&&V(),O.value&&U()])]),C.value&&m()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[w.value&&X()])}}),Ot={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0}},Me=e.defineComponent({name:"FResponseForm",props:Ot,emits:[],setup(n,x){const g=e.ref(),v=e.computed(()=>{const a=Ze.LocaleService.getLocale(),u=n.customClass.split(" "),S={"drag-container":!0};return u.reduce((p,q)=>(p[q]=!0,p),S),n.adaptForLanguage&&a&&(S["farris-form-controls-inline"]=a!=="en"),S});return()=>n.visible&&e.withDirectives(e.createVNode("div",{ref:g,class:v.value,style:n.customStyle},[x.slots.default&&x.slots.default()]),[[e.resolveDirective("area-response")]])}}),Rt={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}},Ut={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"}},Gt=e.defineComponent({name:"FDynamicFormLabel",props:Ut,emits:[],setup(n,x){e.ref(n.title||n.text);const g=e.ref(n.required),v=e.ref(n.text),a=e.ref(n.valid),u=e.ref(n.inValidTip);e.watch(()=>n.text,()=>{v.value=n.text}),e.watch(()=>n.required,(w,y)=>{w!==y&&(g.value=w)}),e.watch([()=>n.valid,()=>n.inValidTip],([w,y])=>{a.value=w,u.value=y});const S=e.computed(()=>a.value?v.value:u.value),p=e.computed(()=>a.value?"":"color:red"),q=e.computed(()=>({"col-form-label":!0,"f-width-auto":g.value&&(n.showType==="none"||!v.value)})),O=e.computed(()=>n.showType==="force-none"?!1:n.showType==="reserve-space"||g.value||!!v.value&&n.showType!=="none");return()=>O.value&&e.createVNode("label",{class:q.value,title:S.value,style:p.value},[!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"},[g.value&&e.createVNode("span",{class:"farris-label-info text-danger"},[e.createTextVNode("*")]),n.showType==="visible"&&v.value])])}}),{globalStorageKey:_t}=se.useThirdComponent(),j={},E={},M={},L={};async function zt(){{const n={schemaMap:ae.schemaMap,propertyConfigSchemaMap:ae.propertyConfigSchemaMap,propertyEffectMap:ae.propertyEffectMap,schemaResolverMap:ae.schemaResolverMap};nn.register(j,E,M,L),en.register(j,E,M,L),tn.register(j,E,M,L),on.register(j,E,M,L),an.register(j,E,M,L,n),rn.register(j,E,M,L),ze.register(j,E,M,L,n),He.register(j,E,M,L,n),ze.register(j,E,M,L,n),He.register(j,E,M,L,n),_e.register(j,E,M,L,n),cn.register(j,E,M,L),ln.register(j,E,M,L),sn.register(j,E,M,L,n),dn.register(j,E,M,L),un.register(j,E,M,L,n),mn.register(j,E,M,L,n),fn.register(j,E,M,L),hn.register(j,E,M,L,n),vn.register(j,E,M,L),dt.register(j,E,M,L),gn.register(j,E,M,L),pn.register(j,E,M,L),tt.register(j,E,M,L),wn.register(j,E,M,L),bn.register(j,E,M,L,n),Nn.register(j,E,M,L,n),Vn.register(j,E,M,L,n),Sn.register(j,E,M,L),xn.register(j,E,M,L,n),Fn.register(j,E,M,L),yn.register(j,E,M,L),jn.register(j,E,M,L),En.register(j,E,M,L,n),Pn.register(j,E,M,L),Mn.register(j,E,M,L,n),Tn.register(j,E,M,L),Ln.register(j,E,M,L),Bn.register(j,E,M,L),In.register(j,E,M,L,n),kn.register(j,E,M,L,n),qn.register(j,E,M,L),An.register(j,E,M,L,n),$n.register(j,E,M,L),Dn.register(j,E,M,L),Ge.register(j,E,M),On.register(j,E,M,L),Rn.register(j,E,M,L,n),Un.register(j,E,M,L),Gn.register(j,E,M,L),_n.register(j,E,M,L),zn.register(j,E,M,L,n),at.register(j,E,M,L),Hn.register(j,E,M,L,n),Wn.register(j,E,M,L),Kn.register(j,E,M,L),Jn.register(j,E,M,L,n),Qn.register(j,E,M,L),Ue.register(j,E,M,L),Xn.register(j,E,M,L),Yn.register(j,E,M,L),Zn.register(j,E,M,L),et.register(j,E,M,L,n),nt.register(j,E,M,L),Cn.register(j,E,M,L),Ee.register(j,E,M,L),ot.register(j,E,M,L,n),rt.register(j,E,M,L),it.register(j,E,M,L),ct.register(j,E,M,L),lt.register(j,E,M,L),st.register(j,E,M,L),ut.register(j,E,M,L,n),mt.register(j,E,M,L),ft.register(j,E,M,L),ht.register(j,E,M,L),vt.register(j,E,M,L,n),gt.register(j,E,M,L,n),pt.register(j,E,M,L);const x=window[_t];if(x)for(const g in x)x[g].createPropsResolver=ae.createPropsResolver,x[g].register(j,E,M)}}function Ht(){zt();function n(S){const p=j[S];if(!p)throw new Error(`Could not find the editor of type '${S}'`);return p}function x(S,p){const q=E[S];return q?q(p):{}}function g(S){switch(S){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 v(S){switch(S){case"combo-list":case"input-group":case"textarea":return"onClear"}}function a(S){switch(S){case"input-group":case"textarea":return"onMousedownEvent"}}function u(S){switch(S){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:x,resolveEditorType:n,getChangeFunctionName:g,getClearFunctionName:v,getMousedownFunctionName:a,getMouseupFunctionName:u}}const Wt={errors:{type:Object,default:null}},Kt=e.defineComponent({name:"FValidationMessage",props:Wt,emits:[],setup(n,x){const g=e.ref(n.errors);e.watch(()=>n.errors,u=>{g.value=u});const v=e.ref(!0),a=e.computed(()=>{if(g.value){const u=Object.keys(g.value).map(S=>{var p;return(p=g.value[S])==null?void 0:p.name});return u.length?u.join(" "):""}return""});return()=>a.value&&e.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>v.value=!v.value},[!v.value&&e.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),v.value&&e.createVNode("span",{class:"f-feedback-message"},[a.value])])}}),Te=e.defineComponent({name:"FDynamicFormGroup",props:Rt,emits:["change","update:modelValue"],setup(n,x){var i;const g=e.ref(n.id),v=e.ref(n.customClass),a=e.ref(n.editor),u=e.ref(n.label),S=e.ref(n.modelValue),p=e.ref(n.readonly),q=e.ref(((i=n.editor)==null?void 0:i.required)||n.required),O=e.ref(n.showLabel),w=e.ref(n.visible);e.ref(n.type);const y=e.ref(),C=e.ref(n.errors),r=se.isMobilePhone(),h=e.ref(n.editor.type||"input-group"),f=e.computed(()=>O.value?n.showLabelType:"none"),{resolveEditorProps:s,resolveEditorType:l,getChangeFunctionName:N,getClearFunctionName:B}=Ht(),o=e.computed(()=>{const d={"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":p.value,"form-group--in-mobile":r};return d["form-group--has-"+h.value]=!0,d}),_=e.computed(()=>{if(n.fill)return{maxWidth:"none"}});function W(d,F,A){S.value=F!==void 0?F:d,x.emit("update:modelValue",S.value),x.emit("change",S.value,{newValue:d,newModelValue:F,parameters:A})}function $(){x.emit("update:modelValue","")}function V(d){return(...F)=>{$(),typeof d=="function"&&d(...F)}}function k(d){return(F,A,m)=>{W(F,A,m),typeof d=="function"&&d(F,A,m)}}const c=e.computed(()=>{const d=a.value.type||"input-group",F=l(d),A=s(d,a.value),m=N(d),I=B(a.value.type);return I&&(A[I]=V(A[I])),m&&(A[m]=k(A[m])),(A.id==null||A.id==="")&&(A.id=g.value),d==="number-range"&&a.value.onBeginValueChange&&typeof a.value.onBeginValueChange=="function"?(a.value.onBeginValueChange&&typeof a.value.onBeginValueChange=="function"&&(A.onBeginValueChange=a.value.onBeginValueChange),a.value.onEndValueChange&&typeof a.value.onEndValueChange=="function"&&(A.onEndValueChange=a.value.onEndValueChange)):d==="lookup"&&a.value["onUpdate:idValue"]&&typeof a.value["onUpdate:idValue"]=="function"?(A["onUpdate:idValue"]=a.value["onUpdate:idValue"],A.id=g.value):d==="collection-property-editor"&&a.value.onSelectionChange&&typeof a.value.onSelectionChange=="function"?A.onSelectionChange=a.value.onSelectionChange:d==="property-editor"&&(A.onBeforeOpenVariables=a.value.onBeforeOpenVariables),()=>e.createVNode(F,e.mergeProps({ref:y},A,{modelValue:S.value,"onUpdate:modelValue":D=>S.value=D}),x.slots)});function t(){return e.createVNode(Kt,{id:`${g.value}-validation-message`,errors:C.value},null)}return e.watch([()=>n.id,()=>n.customClass,()=>n.editor,()=>n.label,()=>n.modelValue,()=>n.readonly,()=>n.required,()=>n.showLabel,()=>n.visible,()=>n.errors],([d,F,A,m,I,D,U,K,X,P])=>{var J;g.value=d,v.value=F,a.value=A,u.value=m,S.value=I,p.value=D,q.value=((J=a.value)==null?void 0:J.required)||U,O.value=K,w.value=X,C.value=P}),x.expose({editorRef:y}),()=>w.value&&e.createVNode("div",{id:`${g.value}-form-group`,class:v.value,style:n.customStyle},[e.createVNode("div",{class:"farris-group-wrap",style:_.value},[e.createVNode("div",{class:o.value},[e.createVNode(Gt,{id:`${g.value}-lable`,showType:f.value,required:q.value,text:u.value,title:u.value},null),e.createVNode("div",{class:"farris-input-wrap"},[c.value(),t()])])])])}});Me.install=n=>{n.component(Me.name,Me).component(Te.name,Te)};const Jt=e.defineComponent({name:"FSelectParameters",props:fe,emits:["changed"],setup(n,x){var c;const g=new de.FNotifyService;g.globalConfig={position:"top-center"};const v=e.inject("FMessageBoxService"),a=e.ref(n.communication),u=e.ref(((c=a.value)==null?void 0:c.paramMappings)||[]),S=e.inject("useFormSchema"),p=S.getFormMetadataBasicInfo(),q=e.ref([]),O=e.ref([]),w=e.ref({}),y=e.ref({}),C=e.computed(()=>t=>{let i="",d="";if(t.sourceValue&&t.targetVariable){const F=O.value.find(A=>A.statePath===`${t.targetVariableViewModelId}.${t.targetVariable}`);F&&F.name?(y.value[t.targetVariable]=!1,i=`${t.sourceValue}--->${F.name}`,d=`将 ${t.sourceValue} 赋值给 ${F.name}`):(y.value[t.targetVariable]=!0,i=`${t.sourceValue}--->${t.targetVariable}`,d=`将 ${t.sourceValue} 赋值给 ${t.targetVariable}`)}return{displayText:i,displayTextTip:d}});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(d=>!(!d.sourceValue&&!d.targetVariable))),a.value.paramMappings=u.value,t!==((i=a.value.paramMappings)==null?void 0:i.length)&&x.emit("changed")}e.onUnmounted(()=>{r()});function h(t){var m,I;const{viewmodels:i,components:d}=t.module;if((i==null?void 0:i.length)===0||(d==null?void 0:d.length)===0)return[];const F=[];O.value=[];const A=(I=(m=n.sourceCommunication)==null?void 0:m.parameterData)==null?void 0:I.getViewModelName;return i.forEach(D=>{if(!D||!D.states||D.states.length===0)return[];const U=[],K=d.find(J=>J.viewModel===D.id),X=A&&K?A(K,D.name,t):"";D.states.forEach(J=>{const Z={...J,statePath:D.id+"."+J.code};U.push({data:Z,children:[]}),O.value.push(Z)});const P={data:{id:D.id,code:D.code,name:X||D.name,statePath:D.id},children:U};F.push(P)}),F}function f(){var t,i;if(!((t=a.value)!=null&&t.target.formId))return[];if(a.value.target.formId===p.id)q.value=h(S.getFormSchema());else{const d=S.externalFormSchema.get(a.value.target.externalContainerId);(i=d==null?void 0:d.content)!=null&&i.module&&(q.value=h(d==null?void 0:d.content))}}function s(){Object.keys(w.value).forEach(t=>{w.value[t]=!1})}function l(){s();const t=se.useGuid().guid();u.value.push({id:t,sourceValue:"",targetVariable:"",targetVariableViewModelId:""}),a.value.paramMappings=u.value,w.value[t]=!0}function N(t,i,d){t.stopPropagation();function F(){u.value=u.value.filter(A=>A.id!==i.id),a.value.paramMappings=u.value,s(),x.emit("changed")}d?v.question(`确定删除参数【${d}】吗?`,"",()=>{F()}):F()}function B(t){w.value[t.id]||(s(),w.value[t.id]=!0)}function o(t,i){if(!i.sourceValue){g.warning("请选择源参数");return}if(!i.targetVariable){g.warning("请选择目标参数");return}w.value[t.id]=!1,Object.assign(t,i),delete t.statePath,x.emit("changed")}function _(t){w.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(()=>{f()}),e.watch(()=>n.communication,t=>{f()},{deep:!0});function W(t,i,d){var F;if((F=d.newValue)!=null&&F.length){const{statePath:A}=d.newValue[0];if((A==null?void 0:A.indexOf("."))>0){const m=A.split(".");i.targetVariableViewModelId=m[0],i.targetVariable=m[1]}}}function $(t){return{type:"combo-tree",textField:"name",valueField:"statePath",idField:"statePath",data:q.value,editable:!1,enableClear:!1,customRowStatus:i=>i.raw.parent?(u.value.find(F=>F.id!==t.id&&`${F.targetVariableViewModelId}.${F.targetVariable}`===i.raw.statePath)&&(i.disabled=!0),i):(i.disabled=!0,i)}}function V(t){const i=H.cloneDeep(t);i.statePath=`${i.targetVariableViewModelId}.${i.targetVariable}`;const d=$(t);let F=S.getFormSchema();if(a.value.source.formId!==p.id){const D=S.externalFormSchema.get(a.value.source.externalContainerId);D!=null&&D.content&&(F=D==null?void 0:D.content)}const{assembleSchemaFieldsByComponent:A,assembleOutline:m,assembleStateVariables:I}=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":D=>i.sourceValue=D,fieldData:A(F),formData:m(F),varData:I(F),editorType:"Default",editable:!0},null),e.createVNode(Te,{label:"目标参数",modelValue:i.statePath,"onUpdate:modelValue":D=>i.statePath=D,customClass:"col-12 mb-2",editor:d,onChange:(D,U)=>W(D,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:l,closeAllParameterPanel:s});const k=e.computed(()=>t=>({"param-container":!0,"ml-3":!0,invalid:t}));return()=>u.value.length?u.value.map(t=>{const{displayText:i,displayTextTip:d}=C.value(t),F=y.value[t.targetVariable];return e.createVNode("div",{class:k.value(F)},[e.createVNode("div",{class:"selected-item position-relative"},[e.createVNode("span",{class:"form-control mr-3",title:d,onClick:()=>B(t)},[i||"请配置参数"]),F?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:A=>N(A,t,i)},null)])]),w.value[t.id]?V(t):""])}):""}}),Qt=e.defineComponent({name:"FCommunicationCommandItem",props:fe,emits:["addParameter","deleteCommand","toggleParameterPanel"],setup(n,x){const g=e.ref(n.communication),v=e.inject("FMessageBoxService"),a=e.inject("useFormSchema"),u=a.getFormMetadataBasicInfo(),S=e.ref([]),p=e.ref(),q=e.ref(!1),O=e.ref([]),w=e.ref(),y=e.ref(!1),C=e.ref(n.communication.paramMappings&&n.communication.paramMappings.length>0),r=e.computed(()=>{var c,t,i,d;if(!p.value)return"";const V=((c=p.value)==null?void 0:c.name)||((t=p.value)==null?void 0:t.code)||"",k=((i=w.value)==null?void 0:i.name)||((d=w.value)==null?void 0:d.code)||"";return`${V}-${k}`}),h=e.computed(()=>{var d,F,A,m,I,D;if(!p.value)return"";const V=((d=p.value)==null?void 0:d.name)||((F=p.value)==null?void 0:F.code)||"",k=((A=w.value)==null?void 0:A.name)||((m=w.value)==null?void 0:m.code)||"",c=((I=p.value)==null?void 0:I.code)||"",t=((D=w.value)==null?void 0:D.code)||"",i=p.value.containerId?`, 所属外部容器: ${p.value.containerId}`:"";return`${V} (${c}${i})
|
|
3
|
-
${k} (${t})`}),f=e.computed(()=>q.value?"目标表单已失效,请删除当前方法。":y.value?"目标命令已失效,请删除当前方法。":"");function s(){var V,k;if((k=(V=g.value)==null?void 0:V.target)!=null&&k.formId){const c=S.value.find(t=>t.id===g.value.target.formId&&t.containerId===g.value.target.externalContainerId);q.value=!c,p.value=c||{containerId:g.value.target.externalContainerId,id:g.value.target.formId,code:g.value.target.formCode}}else q.value=!1}function l(){var k,c;const V=a.externalFormSchema;Array.from(V.keys()).forEach(t=>{var d,F;const i=V.get(t);((F=(d=g.value)==null?void 0:d.source)==null?void 0:F.externalContainerId)!==t&&S.value.push({containerId:t,id:i.id,code:i.code,name:i.name})}),((c=(k=g.value)==null?void 0:k.source)==null?void 0:c.formId)!==u.id&&S.value.unshift({containerId:"",id:u.id,code:u.code,name:u.name}),s()}function N(){var V,k;if((k=(V=g.value)==null?void 0:V.target)!=null&&k.commandCode){const{commandCode:c,commandViewmodelId:t}=g.value.target,i=O.value.find(d=>d.code===c&&d.viewmodelId===t);w.value=i||{code:g.value.target.commandCode},y.value=!i}else w.value=null,y.value=!1}function B(V){var i,d;const{viewmodels:k,components:c}=V.module;if((k==null?void 0:k.length)===0||(c==null?void 0:c.length)===0)return[];O.value=[];const t=(d=(i=n.sourceCommunication)==null?void 0:i.parameterData)==null?void 0:d.getViewModelName;k.forEach(F=>{if(!F||!F.commands||F.commands.length===0)return[];const A=c.find(I=>I.viewModel===F.id),m=t&&A?t(A,F.name,V):"";O.value.push({id:F.id,code:F.code,name:m||F.name}),F.commands.forEach(I=>{I.isInvalid||O.value.push({...I,viewmodelId:F.id,isCommandNode:!0})})})}function o(){var V,k,c;if(!((V=p.value)!=null&&V.id))return[];if(p.value.id===u.id)B(a.getFormSchema());else{const t=a.externalFormSchema.get((k=p.value)==null?void 0:k.containerId);(c=t==null?void 0:t.content)!=null&&c.module&&B(t.content)}N()}e.onMounted(()=>{l(),o()}),e.watch(()=>n.communication,V=>{C.value=n.communication.paramMappings&&n.communication.paramMappings.length>0,s(),o()},{deep:!0});function _(){x.emit("addParameter")}function W(){v.question(`确定删除命令【${r.value}】吗?`,"",()=>{x.emit("deleteCommand")})}function $(){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:h.value},[r.value]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[q.value||y.value?e.createVNode("div",null,[e.createVNode("span",{title:f.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:V=>W()},null)]):e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-icon f-icon-home-add",title:"新增参数",style:"font-size: 11px;",onClick:_},null),C.value&&e.createVNode("div",{class:"f-icon f-icon-edit-button",title:"收折参数",onClick:()=>$()},null),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:V=>W()},null)])])])])}}),Yt=e.defineComponent({name:"FCombineForm",props:fe,emits:["changed","deleteCommand","addCommand"],setup(n,x){const g=e.inject("useFormSchema"),{saveCommunication:v}=me(g),a=e.ref(n.communication),u=e.computed(()=>{var s,l,N,B;return((l=(s=a.value)==null?void 0:s.source)==null?void 0:l.componentId)&&((B=(N=a.value)==null?void 0:N.source)==null?void 0:B.event)}),S=e.ref(!0),p=e.ref(!0),q=e.ref(),O=e.ref();function w(){v(a.value),x.emit("changed",a.value)}function y(){q.value&&q.value.addParameter(),p.value=!1}function C(){x.emit("deleteCommand")}function r(){p.value=!p.value}const h=e.computed(()=>({"d-none":p.value}));function f(){q.value&&q.value.closeAllParameterPanel()}return x.expose({closeAllParameterPanel:f}),()=>e.createVNode("div",{class:"combine-form-container pb-2"},[u.value&&e.createVNode(e.Fragment,null,[e.createVNode(Qt,{ref:O,communication:a.value,sourceCommunication:n.sourceCommunication,onAddParameter:y,onDeleteCommand:C,onToggleParameterPanel:r},null),S.value&&e.createVNode("div",{class:h.value},[e.createVNode(Jt,{ref:q,communication:a.value,onChanged:w,sourceCommunication:n.sourceCommunication},null)])])])}}),Xt=e.defineComponent({name:"FSelectCommunicationCommand",props:fe,emits:["selectCommand","addParameter","deleteCommand","toggleParameterPanel"],setup(n,x){const g=e.inject("useFormSchema"),v=g.getFormMetadataBasicInfo(),a=e.ref([]),u=e.ref(),S=e.ref([]),p=e.ref(),q=e.ref(!0),O=e.ref(!1);function w(){var N;const l=g.externalFormSchema;Array.from(l.keys()).forEach(B=>{var _;const o=l.get(B);((_=n.sourceCommunication)==null?void 0:_.externalContainerId)!==B&&a.value.push({containerId:B,id:o.id,code:o.code,name:o.name})}),((N=n.sourceCommunication)==null?void 0:N.formId)!==v.id&&a.value.unshift({containerId:"",id:v.id,code:v.code,name:v.name})}function y(l){var _,W;const{viewmodels:N,components:B}=l.module;if((N==null?void 0:N.length)===0||(B==null?void 0:B.length)===0)return[];S.value=[];const o=(W=(_=n.sourceCommunication)==null?void 0:_.parameterData)==null?void 0:W.getViewModelName;N.forEach($=>{if(!$||!$.commands||$.commands.length===0)return[];const V=B.find(c=>c.viewModel===$.id),k=o&&V?o(V,$.name,l):"";S.value.push({id:$.id,code:$.code,name:k||$.name}),$.commands.forEach(c=>{c.isInvalid||S.value.push({...c,viewmodelId:$.id,isCommandNode:!0})})})}function C(){var l,N,B;if(!((l=u.value)!=null&&l.id))return[];if(u.value.id===v.id)y(g.getFormSchema());else{const o=g.externalFormSchema.get((N=u.value)==null?void 0:N.containerId);(B=o==null?void 0:o.content)!=null&&B.module&&y(o.content)}}e.onMounted(()=>{w(),C()});function r(l){u.value=l,q.value=!1,O.value=!0,C()}const h=e.computed(()=>l=>{var N,B;return{item:!0,selected:((N=u.value)==null?void 0:N.id)===l.id&&((B=u.value)==null?void 0:B.containerId)===l.containerId}}),f=e.computed(()=>l=>{var N;return{item:!0,selected:((N=p.value)==null?void 0:N.id)===l.id,"pl-4":l.isCommandNode,disabled:!l.isCommandNode}});function s(l){l.isCommandNode&&(O.value=!1,p.value=l,x.emit("selectCommand",{targetForm:u.value,targetCommand:l}))}return()=>e.createVNode("div",{class:"form-container position-relative"},[q.value&&e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标页面")]),a.value.map(l=>e.createVNode("span",{class:h.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("请选择目标命令")]),S.value.map(l=>e.createVNode("span",{class:f.value(l),title:l.code,onClick:()=>s(l)},[l.name]))]):""])}}),Zt=e.defineComponent({name:"FInteractionItem",props:Tt,emits:["addAction","delete","toggle"],setup(n,x){var he,ve;const{guid:g}=se.useGuid(),v=e.inject("FMessageBoxService"),a=e.inject("useMethodsComposition"),{toggleSelectingMethod:u,emitFinalState:S,getViewModeId:p,getMethodsOnViewModel:q,getComponentList:O,updateTarget:w,updateCommandHasPath:y}=a,C=e.inject("useFormSchema"),{clearCommunicationById:r,resolveSourceControlEventTitle:h,resolveCommunication:f,createNewCommunication:s,saveCommunication:l,resolveCommunicationSource:N}=me(C),B=e.ref(n.controllers),o=e.ref(n.interaction),_=e.ref(!1),W=e.computed(()=>{const T=o.value.showSwitch[0];return T.showSection[T.showSwitchNumber][2]}),$=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)||$.value;const V=e.computed(()=>{var z;const T=!!((z=o.value.command)!=null&&z.id),R=o.value.showSwitch[0],G=R.showSection[R.showSwitchNumber][3];return T&&G}),k=e.ref(o.value.needSelectCommunicationCommand||!1),c=e.ref(),t=e.ref(),i=e.ref(!1),d=e.ref(),F=e.ref([]);function A(){if($.value){const T=h(o.value.communication);if(T){const{title:R,titleTip:G,isControlInvalid:z}=T;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(()=>{f(o.value),A(),d.value=N(o.value)||n.sourceCommunication});const m=e.computed(()=>({"f-icon":!0,"f-icon-arrow-chevron-down":V.value||o.value.shouldShowCommunicationPanel,"f-icon-arrow-chevron-left":!V.value&&!o.value.shouldShowCommunicationPanel}));function I(){var G,z;let T=(G=o.value.command)!=null&&G.id?1:0;T=T+(((z=o.value.communication)==null?void 0:z.length)||0);const R=`确定删除【${c.value}】吗?`;v.question(R,"",()=>{x.emit("delete",n.displayOrder)})}function D(){var z;const T=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&&(T.showSection[T.showSwitchNumber][3]=!T.showSection[T.showSwitchNumber][3],x.emit("toggle",n.displayOrder))}function U(){var z,Q;const T=!!((z=o.value.command)!=null&&z.id),R=o.value.communication&&o.value.communication.length>0;if($.value){k.value=!k.value,(Q=F.value)!=null&&Q.length&&F.value.map(ee=>{ee.closeAllParameterPanel()});return}R&&(o.value.shouldShowCommunicationPanel=!o.value.shouldShowCommunicationPanel);const G=o.value.showSwitch[0];u(G,T),x.emit("addAction",n.displayOrder)}function K(T){const R=o.value.communication!==void 0;T===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 X(T,R,G){let z=`${R}${G}${T}`,Q=-1;const ee=q();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)T+=1,z=`${R}${G}${T}`;else{Q=0;break}}return{newName:z,suffix:T}}function P(T){const{method:R,controller:G}=T,{label:z,handlerName:Q,property:ee,componentLists:ne,hasPath:te}=R,oe=p().replace(/-/g,"").replace("component","").replace("viewmodel",""),Se=z.slice(0,1).toUpperCase()+z.slice(1),{newName:Ve,suffix:xe}=X(1,oe,Se),{controllerName:le}=G,Fe=le.id,ye={id:g(),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&&C.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),S(!1,null)}function J(){o.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},o.value.controller={label:"",name:"",id:""},S(!0,o.value.event);const T=o.value.showSwitch[0];u(T,!0)}function Z(T,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)===T.formId&&((te=ee.target)==null?void 0:te.externalContainerId)===T.externalContainerId&&((oe=ee.target)==null?void 0:oe.commandCode)===T.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,T),z=o.value.communication[0]):(z=s(n,o.value.event.label,T,R),o.value.communication.push(z)),S(!1,null),l(z)}function re(T){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,T){const{selectedCommand:z,selectedForm:Q}=T,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)||""};Z(ee)}}function Le(){const T=o.value.showSwitch[0];T.showSwitchNumber=2,T.showSection[T.showSwitchNumber][2]=!1,T.showSection[T.showSwitchNumber][3]=!0,_.value=!1,o.value.communication&&o.value.communication.length>0&&(o.value.shouldShowCommunicationPanel=!0),S(!1,null)}function Be(){return e.createVNode(Dt,{controllers:B.value,sourceCommunication:n.sourceCommunication,onClose:K,onSelectMethod:P,onNewFunctionChanged:()=>J(),onAddCommunication:re,haveBoundCommand:n.haveBoundCommand,iteractionDisplayOrder:n.displayOrder,onSelectBoundMethod:Le,event:o.value.event},null)}function Ie(){const T=o.value.showSwitch[0];T.showSection[T.showSwitchNumber][3]=!1}function ke(T){o.value.command=H.cloneDeep(T),S(!1,null)}function qe(T){T.componentLists=O(),w(T),o.value.command=H.cloneDeep(T),S(!1,null)}function De(T){var G;const{controller:R}=o.value;R.isCommon||(G=n.viewSourceHandle)==null||G.call(n,{...T,...o.value})}function Ae(){o.value.command=null,S(!1,null)}function $e(){return e.createVNode($t,{command:o.value.command,controller:o.value.controller,showParameter:_.value,showDeleteIcon:o.value.communication&&o.value.communication.length>0,onConfirm:()=>Ie(),onChange:T=>ke(T),onTargetChange:T=>qe(T),onViewSource:T=>De(T),onDeleteCommand:Ae},null)}function Oe(T,R){o.value.communication&&o.value.communication.length>R&&(o.value.communication[R]=T,S(!1,null))}function Re(T,R){var G;o.value.communication&&o.value.communication.length>R&&(o.value.communication.splice(R,1),r(T.id),o.value.communication.length===0&&!((G=o.value.command)!=null&&G.id)?x.emit("delete",n.displayOrder):S(!1,null))}function Ce(T,R){const{source:G,target:z}=T;Z(z,G),o.value.shouldShowCommunicationPanel=!0}function we(T,R){return e.createVNode(Yt,{ref:G=>{G&&(F.value[R]=G)},communication:T,event:o.value.event.label,sourceCommunication:n.sourceCommunication,onChanged:G=>Oe(G,R),onDeleteCommand:()=>Re(T,R),onAddCommand:G=>Ce(G)},null)}function be(T){const{targetForm:R,targetCommand:G}=T,z={formId:R.id,formCode:R.code,externalContainerId:R.containerId,commandCode:G.code,commandViewmodelId:G.viewmodelId};Z(z,d.value),o.value.shouldShowCommunicationPanel=!0,k.value=!1,o.value.needSelectCommunicationCommand=!1}function Ne(){return e.createVNode(Xt,{sourceCommunication:n.sourceCommunication,onSelectCommand:T=>be(T)},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:m.value,style:"font-size: 10px;",onClick:D},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",style:"font-size: 13px;float: right; margin:8px;",onClick:I},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(),k.value&&Ne(),V.value&&$e(),!i.value&&o.value.shouldShowCommunicationPanel&&o.value.communication&&o.value.communication.length>0?o.value.communication.map((T,R)=>we(T,R)):""])}});function eo(n,x,g){const{interactions:v}=x,{setComponentLists:a}=Je(),u=e.ref(n.value.internalCommandList);function S(c){v.value[c].showSwitch=[],v.value[c].showSwitch.push(H.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),v.value=H.cloneDeep(v.value)}function p(c){var i;const t=[];return(i=n.value.newController)==null||i.forEach(d=>{c.forEach(F=>{d.Code===F.controller.label&&t.push(H.cloneDeep(d))})}),t}function q(c){if(n.value.repititionCommand.length!==0)return n.value.repititionCommand.forEach(t=>{c.forEach(i=>{var d,F,A,m;if(t.command.id===((d=i.command)==null?void 0:d.id)){t.command.params=H.cloneDeep((F=i.command)==null?void 0:F.property);const I=(A=i.command)==null?void 0:A.targetComponent;(m=i.command)==null||m.componentLists.forEach(D=>{t.targetComponent=D.componentId===I?{id:D.componentId,viewModelId:D.viewModelId}:t.targetComponent})}})}),n.value.repititionCommand}function O(c=!1,t=null){var m;n.value.newFuncEvents=t?H.cloneDeep(t):null,n.value.isAddControllerMethod=c;const i=[],d=H.cloneDeep(n.value.internalCommandList);v.value.map(I=>{const D=H.cloneDeep(I.controller),U=H.cloneDeep(I.command),K=H.cloneDeep(I.event),X=H.cloneDeep(I.communication),P={controller:D,command:U,boundEvents:K,communication:X};i.push(H.cloneDeep(P))});const F=(m=n.value.newController)!=null&&m.length&&i.length?H.cloneDeep(p(i)):[];n.value.repititionCommand&&(n.value.repititionCommand=q(i));const A={viewModelId:n.value.viewModelId,savedCommand:H.cloneDeep(n.value.viewModel),boundEventsList:H.cloneDeep(i),events:H.cloneDeep(n.value.events),internalCommandList:H.cloneDeep(d),componentLists:[],relativePath:n.value.relativePath,envType:n.value.envType,newController:H.cloneDeep(F),isAddControllerMethod:n.value.isAddControllerMethod,repititionCommand:n.value.repititionCommand,preCommand:n.value.preCommand,newFuncEvents:n.value.newFuncEvents};g.emit("savedCommandListChanged",A)}function w(c){c.showSection[c.showSwitchNumber][2]=!0}function y(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 h(c,t=!1){c.showSection[c.showSwitchNumber][2]?(y(c),t&&C(c)):(w(c),t&&r(c))}function f(){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 l(){return n.value.viewModelId}function N(){return n.value.getEventPath?n.value.getEventPath().viewModelDisplay:[]}function B(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 d=i+1;d<t.length;d++)t[i].Id===t[d].Id&&(t.splice(d,1),d--)}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 $(c,t){v.value.forEach(i=>{var d;((d=i.command)==null?void 0:d.label)===t.label&&(i.command=t)})}function V(c,t){$(c,t)}function k(c,t){const i=v.value[t];c.event=c.event.label?c.event:H.cloneDeep(i.event);let d=!1;n.value.repititionCommand||(n.value.repititionCommand=[]),n.value.repititionCommand.forEach(m=>{m.command.id===c.command.id&&m.event.label===c.event.label&&m.targetComponent.viewModelId===c.targetComponent.viewModelId&&(d=!0),m.command.id===c.command.id&&m.event.label===c.event.label&&m.targetComponent.viewModelId!==c.targetComponent.viewModelId&&(m=H.cloneDeep(c))}),d||n.value.repititionCommand.push(H.cloneDeep(c));let F={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 A={controllerName:c.controller};F=a(A,F,n.value),i.command=H.cloneDeep(F),i.controller=H.cloneDeep(c.controller),V(i,F)}return{controllers:u,onClosed:S,emitFinalState:O,toggleSelectingMethod:h,getViewModeId:l,getComponentList:f,updateTarget:s,updateCommandHasPath:B,addNewController:o,checkIfNewControllerExists:_,getMethodsOnViewModel:N,getEventPath:W,selectBoundCommand:k}}const pe=e.defineComponent({name:"FEventsEditor",props:Pe,emits:["savedCommandListChanged"],setup(n,x){const g=e.ref(n.initialData),v=e.inject("designer-host-service"),a=Ft(g),{loadEvents:u,resetBoundEvents:S}=a,p=e.inject("useFormSchema"),q=xt(p,a),{addNewInteraction:O,deleteInteracton:w,interactions:y,loadInteractions:C}=q,r=eo(g,q,x),{emitFinalState:h,controllers:f}=r;e.provide("useEventsComposition",a),e.provide("useInteractionCompostion",q),e.provide("useMethodsComposition",r);function s(){g.value.isAddControllerMethod=!1}function l(){var V,k;const $=(k=(V=g.value)==null?void 0:V.sourceCommunication)==null?void 0:k.externalContainerId;if($){const{assembleSourceOutline:c}=me(p),t=c(v,x,$);e.provide("sourceOutlineData",t)}}e.onMounted(()=>{s(),S(),u(),C(),l()});function N($){w($),h(!1,null)}function B($,V){const k=$.showSwitch[0],c=k.showSection[k.showSwitchNumber][3];let t=!1;return n.initialData.getEventPath&&(n.initialData.getEventPath().actionWithPath.length!==0?t=!0:t=!1),e.createVNode(Zt,{key:`${V}`,controllers:f.value,interaction:$,displayOrder:V,collapsed:c,onDelete:N,sourceCommunication:g.value.sourceCommunication,viewSourceHandle:n.viewSourceHandle,haveBoundCommand:t},null)}function o(){var $;return($=y.value)==null?void 0:$.map((V,k)=>{var t;let c=V.event.label;return(t=V.communication)!=null&&t.length&&(c=`${V.communication.map(d=>d.id).join("-")}_${c}`),e.createVNode("div",{class:"events-display-order",key:`${c}_${k}`},[B(V,k)])})}function _($){O($)}function W($){const V=$.source;if(y.value.find(c=>{var t;if((t=c.communication)!=null&&t.length&&c.communication.find(d=>{var F,A,m;return((F=d.source)==null?void 0:F.formId)===V.formId&&((A=d.source)==null?void 0:A.componentId)===V.componentId&&((m=d.source)==null?void 0:m.event)===V.event}))return!0})){new de.FNotifyService().info({position:"top-center",message:"事件已存在,请勿重复添加。"});return}O({label:"onCommunication",name:"组件通讯"},$)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(Mt,{sourceCommunication:g.value.sourceCommunication,onClickEventItem:_,onSelectSourceControl:W},null),o()])])}}),no={install(n){n.component(pe.name,pe)},register(n,x,g,v){n["events-editor"]=pe,x["events-editor"]=Ke}};b.FEventsEditor=pe,b.default=no,b.eventsEditorProps=Pe,b.propsResolver=Ke,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(F,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("../dynamic-view/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("../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","../dynamic-view/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","../property-panel/index.umd.js"],e):(F=typeof globalThis<"u"?globalThis:F||self,e(F["events-editor"]={},F.Vue,F.dynamicResolver,F.LodashES,F.common,F.designerCanvas,F.notify,F.FTreeview,F.FSchemaSelector,F.modal,F.FInputGroup,F.FComboList,F.FEventParameter,F.locale,F.dynamicView,F.FAccordion,F.FAvatar,F.FButtonEdit,F.FButtonGroup,F.FCalendar,F.FCapsule,F.FCheckbox,F.FCheckboxGroup,F.FComboTree,F.FComponent,F.FColorPicker,F.FContentContainer,F.FDatePicker,F.FDataGrid,F.FDropdown,F.FDynamicForm$1,F.FEventsEditor$1,F.FFilterBar,F.FFieldSelector,F.FBindingSelector,F.FImageCropper,F.FInputGroup$1,F.FLayout,F.FListNav,F.FListView,F.FLookup,F.FMappingEditor,F.FNav,F.FNumberRange,F.FNumberSpinner,F.FOrder,F.FPageHeader,F.FPageFooter,F.FPagination,F.FProgress,F.FQuerySolution,F.FRadioGroup,F.FRate,F.FResponseToolbar,F.FResponseLayout,F.FResponseLayoutEditorSetting,F.FSearchBox,F.FSection,F.FSmokeDetector,F.FSplitter,F.FStep,F.FSwitch,F.FTabs,F.FTags,F.FText,F.FTimePicker,F.FTransfer,F.FUploader,F.FVerifyDetail,F.FVideo,F.FTextArea,F.FTreeGrid,F.FFilterConditionEditor,F.FFieldset,F.FSortConditionEditor,F.FMenuLookup,F.FDrawer,F.FJsonEditor,F.FPropertyEditor,F.FExpressionEditor,F.FCodeEditor,F.FHtmlTemplate,F.FCollectionPropertyEditor,F.FModal,F.FExternalContainer,F.FLanguageTextbox,F.FImage,F.FComment))})(this,function(F,e,ne,K,ce,rn,ge,He,ze,cn,ln,We,De,Ke,me,sn,dn,un,mn,fn,pn,Je,Qe,hn,gn,vn,Cn,bn,Nn,yn,wn,Vn,Fn,Sn,xn,jn,En,Pn,Mn,Tn,Bn,Ln,kn,In,$n,Dn,qn,On,An,Rn,Un,Gn,_n,Hn,zn,Wn,Kn,Jn,Qn,Yn,Xn,Zn,et,nt,tt,ot,at,rt,it,ct,lt,st,dt,ut,mt,ft,pt,ht,gt,vt,Ct,bt,Nt,yt,wt,Vt,Ft,St){"use strict";var ho=Object.defineProperty;var go=(F,e,ne)=>e in F?ho(F,e,{enumerable:!0,configurable:!0,writable:!0,value:ne}):F[e]=ne;var $e=(F,e,ne)=>go(F,typeof e!="symbol"?e+"":e,ne);const xt=new Map([["appearance",ne.resolveAppearance]]);function jt(n,l,c){return l}const Et={$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"]},Pt={title:"events-editor",description:"A Farris Component",type:"object",categories:{}},Ye=[{label:"pageChange",name:"MockMock切换页码"},{label:"pageSizeChanged",name:"Mock分页条数变化事件"},{label:"scrollYLoad",name:"Mock滚动加载事件"},{label:"onEditClicked",name:"Mock操作列点击编辑"},{label:"onDeleteClicked",name:"Mock操作列点击删除"}],qe={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:Ye,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:Ye,boundEventsList:[]})}},viewSourceHandle:{type:Function,default:()=>{}}},Xe=ne.createPropsResolver(qe,Et,xt,jt,Pt);function Ze(){function n(c,s){const t=[{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=t.findIndex(C=>c===C.controllerId);return V!==-1&&(u=t[V].commands.findIndex(C=>s===C.handlerName)),u!==-1}function l(c,s,t){const u=n(c.controllerName.id,s.handlerName);return t.componentLists.length!==0&&u&&(s.hasPath=!0,s.targetComponent=s.targetComponent||t.componentLists[0].componentId,s.componentLists=K.cloneDeep(t.componentLists)),s}return{isContextDependent:n,setComponentLists:l}}var pe=(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))(pe||{});function Mt(n,l){const c=e.inject("designerContext"),s=c&&c.dgControl?c.dgControl:rn.DgControl,t=e.ref(""),u=e.ref("");function V(i){var f,h,S,a;let v="controlIcon fd-i-Family ",N="";switch(i==null?void 0:i.type){case"form-group":{N=((f=s[i.type])==null?void 0:f.icon)||((h=i.editor)==null?void 0:h.type)||"",(S=s[i.editor.type])!=null&&S.icon&&(N=s[i.editor.type].icon);break}default:N=((a=s[i.type])==null?void 0:a.icon)||i.type}const g=`fd_pc-${N}`;return v+=g,v}function C(i,v){var f;let N=i.id;const g=v==null?void 0:v.contents;if((v==null?void 0:v.type)==="splitter"&&g&&g.length===2){const h=v.direction!=="column";i.id===((f=g[0])==null?void 0:f.id)?N=h?"左侧区域":"上方区域":N=h?"右侧区域":"下方区域"}return N}function k(i){if(i.isLikeCardContainer)return"区块";const v=i.appearance&&i.appearance.class||"",N=v.split(" ");return i.id==="page-header"&&v&&v==="f-page-header"?"页头":N.includes("f-page-header-base")?"页头容器":N.includes("f-page-header-extend")?"页头扩展容器":N.includes("f-title")?"标题容器":N.includes("f-page")?"根容器":N.includes("f-page-main")?"内容区域":N.includes("f-scrollspy-content")&&i.isScrollspyContainer?"滚动监听容器":N.includes("f-grid-is-sub")?"表格容器":N.includes("f-filter-container")?"筛选条容器":"容器"}function D(i){const{componentType:v}=i;switch(v){case pe.Frame:return"根组件";case pe.dataGrid:return(n==null?void 0:n.formSchemaUtils.selectNode(i,g=>g.type===(s["tree-grid"]&&s["tree-grid"].type)))?"树表格组件":"表格组件";case pe.uploader:return"附件组件";case pe.listView:return"列表视图组件";case pe.form:return"卡片组件";case pe.calendar:return"日历组件";case pe.page:return i.name||"页面";default:return"组件"}}function y(i,v){const N=i.name||i.text||i.label||i.title||i.mainTitle;if(i.type!=="component"&&N&&typeof N=="string")return N.trim();switch(i.type){case"content-container":return k(i);case"splitter-pane":return C(i,v);case"component":return D(i);default:return s[i.type]&&s[i.type].name||i.id}}function x(i,v){const N=i.length?i[0]:null;if(!N)return;u.value="",t.value=N.originalId;const g=N?`${N.originalId}-design-item`:"",f=document.getElementById(g);f&&f.click(),l.emit("selectionChanged",N)}function p(i){if(!i)return;const v=`${i}-design-item`,N=document.getElementById(v);N&&N.click()}return{getIcon:V,getTitle:y,onChanged:x,currentSelectedNodeId:t,currentSelectedOutsideNodeId:u,triggerOutsideClick:p}}function Tt(n,l){const{getIcon:c,getTitle:s}=l;function t(y,x,p,i,v){var g;const N=(g=n.data.module)==null?void 0:g.components.find(f=>f.id===y.component);N&&u([N],x,p,i,v)}function u(y,x,p,i,v){return y.forEach(N=>{if(N.type==="component"&&(v=N.id),N.type==="component-ref"){t(N,x,p,i,v);return}const g={originalId:N.id,layer:p,originalParent:i==null?void 0:i.id,componentId:v,name:s(N,i),type:N.type,controlIcon:c(N),rawSchema:N};x.push(K.cloneDeep(g)),(N.contents||N.buttons)&&u(N.contents||N.buttons,x,p+1,N,v)}),x}function V(y){const x=[],p=y.find(g=>g.layer===0);y=y.filter(g=>g.layer!==0),x.push(p);let i=p.originalId,v=0,N=1e3;for(;y.length!==0||N===0;){const g=y.find(f=>f.originalParent===i);g?(x.push(g),i=g.originalId,y=y.filter(f=>f.originalId!==i),v=0):(v-=1,i=x.slice(v)[0].originalId),N-=1}return x}function C(y){return y.forEach((x,p)=>{x.id=(p+1).toString()}),y.forEach(x=>{var p;x.parent=((p=y.find(i=>i.originalId===x.originalParent))==null?void 0:p.id)||""}),y.forEach(x=>{x.hasChildren=y.findIndex(p=>p.parent===x.id)>0}),y}function k(y){const x={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 y.forEach(i=>{i[0].originalParent=x.originalId,p.push(...i)}),p.unshift(x),p}function D(){const y=n.data.module?e.ref(n.data.module.components):e.ref([n.data]);if(!y.value)return;const x=[];y.value.forEach(N=>{if(N){const g=[];g.push(N);const S=u(g,[],1,null,N.id);x.push(S)}});const p=k(x),i=V(p);return C(i)}return{getData:D}}function Ce(n){const l=e.inject("sourceOutlineData")||[],c=e.ref(),s=e.ref(!1),t=e.ref([]),u=e.ref();function V(g,f,h,S){var a,G,z,U;return{id:ce.useGuid().guid(),source:S||{formId:(a=g.sourceCommunication)==null?void 0:a.formId,formCode:(G=g.sourceCommunication)==null?void 0:G.formCode,componentId:(z=g.sourceCommunication)==null?void 0:z.componentId,externalContainerId:(U=g.sourceCommunication)==null?void 0:U.externalContainerId,event:f||"onCommunication"},target:{formId:(h==null?void 0:h.formId)||"",formCode:(h==null?void 0:h.formCode)||"",externalContainerId:(h==null?void 0:h.externalContainerId)||"",commandCode:(h==null?void 0:h.commandCode)||"",commandViewmodelId:(h==null?void 0:h.commandViewmodelId)||""},paramMappings:[]}}function C(g){var f,h;(f=g==null?void 0:g.communication)!=null&&f.length&&((h=g==null?void 0:g.communication)==null||h.map(S=>{var a,G;if(S!=null&&S.id&&!((a=S==null?void 0:S.source)!=null&&a.componentId)){const z=(G=n.getFormSchema().module.communications)==null?void 0:G.find(U=>U.id===(S==null?void 0:S.id));z&&Object.assign(S,z)}}))}function k(g){const f=n.getFormSchema(),{communications:h}=f.module;h||(f.module.communications=[]);const S=f.module.communications.findIndex(a=>a.id===g.id);S===-1?f.module.communications.push(g):Object.assign(f.module.communications[S],g)}function D(g){var f;if((f=g==null?void 0:g.communication)!=null&&f.length){const h=n.getFormSchema();g.communication.map(S=>{h.module.communications&&S&&(h.module.communications=h.module.communications.filter(a=>a.id!==S.id))}),g.communication=[]}}function y(g){var h;const f=n.getFormSchema();g&&((h=f.module.communications)!=null&&h.length)&&(f.module.communications=f.module.communications.filter(S=>S.id!==g))}function x(g,f,h){const S=Mt(g,f),a=n.externalFormSchema.get(h);if(a!=null&&a.content){const G={data:a.content},{getData:z}=Tt(G,S);return z()}return[]}function p(g){var h;if(!((h=g==null?void 0:g.source)!=null&&h.componentId)){s.value=!1;return}const f=l.find(S=>S.originalId===g.source.componentId);f?(s.value=!1,c.value=f):(s.value=!0,c.value={id:g.source.componentId})}function i(g){var a,G,z,U;t.value=[];const f=(a=c.value)==null?void 0:a.rawSchema;if(!f){u.value=null;return}const h=f.type==="form-group"&&f.editor?f.editor.type:f.type,S=(G=ne.schemaMap[h])==null?void 0:G.events;S&&Object.keys(S).forEach(j=>{t.value.push({eventCode:j,eventName:S[j]})}),(z=g.source)!=null&&z.event&&((U=t.value)!=null&&U.length)&&(u.value=t.value.find(j=>{var O;return j.eventCode===((O=g.source)==null?void 0:O.event)}))}function v(g){var S,a,G,z,U,j,O,m;if(!(g!=null&&g.length))return;p(g[0]),i(g[0]);let f="",h="";return s.value?f=`${((S=g[0].source)==null?void 0:S.componentId)||""}-${((a=g[0].source)==null?void 0:a.event)||""}`:(f=(G=c.value)==null?void 0:G.name,f&&((z=u.value)!=null&&z.eventName)&&(f+=`-${(U=u.value)==null?void 0:U.eventName}`),h=`${(j=c.value)==null?void 0:j.name} (${(O=c.value)==null?void 0:O.originalId})`,h=`${h}
|
|
2
|
+
${(m=u.value)==null?void 0:m.eventName} (${u.value.eventCode})`),{title:f,titleTip:h,isControlInvalid:s.value}}function N(g){var f;if((f=g==null?void 0:g.communication)!=null&&f.length){const h=g==null?void 0:g.communication[0];return h==null?void 0:h.source}}return{createNewCommunication:V,resolveCommunication:C,clearAllCommunication:D,clearCommunicationById:y,saveCommunication:k,assembleSourceOutline:x,resolveSourceControlEventTitle:v,resolveCommunicationSource:N}}function Bt(n,l,c){const s=e.ref([]),{boundEvents:t,unBoundEvent:u}=l;function V(p){var v,N;return{event:{label:(v=p.boundEvents)==null?void 0:v.label,name:(N=p.boundEvents)==null?void 0:N.name},showSwitch:[{showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2}],command:K.cloneDeep(p.command),controller:K.cloneDeep(p.controller),communication:p.communication}}function C(){var p;s.value=(p=t.value)==null?void 0:p.map(i=>V(i))}function k(p,i){const N=V({boundEvents:p,command:null,controller:{id:"",name:"",label:""},communication:i?[i]:[]});if(i){N.showSwitch[0].showSwitchNumber=2,N.showSwitch[0].showSection[2][2]=!1,N.showSwitch[0].showSection[2][3]=!1,N.needSelectCommunicationCommand=!0,s.value.unshift(N);return}p&&(N.showSwitch[0].showSwitchNumber=1,N.showSwitch[0].showSection[2][3]=!0,s.value.unshift(N))}function D(){var p;(p=s.value)==null||p.forEach(i=>{i.showSwitch.forEach(v=>{v.showSection[2][3]=!1}),i.shouldShowCommunicationPanel=!1})}function y(p){s.value[p].showSwitch.forEach(i=>{i.showSection[2][3]=!i.showSection[2][3]})}function x(p){if(p>=0&&p<=s.value.length-1){const i=s.value[p];u(i.event),s.value.splice(p,1);const{clearAllCommunication:v}=Ce(n);v(i)}}return{addNewInteraction:k,collapseInteractions:D,deleteInteracton:x,toggleMethodInInteraction:y,interactions:s,loadInteractions:C}}function Lt(n){const l=e.ref([]),c=e.ref([]),s=e.ref([]),{isContextDependent:t}=Ze();function u(){const{allComponentList:p}=n.value;n.value.componentLists.length&&n.value.viewModel&&n.value.viewModel.forEach(i=>{i.controllerList.forEach(v=>{if(v.targetComponent){const N=p.find(f=>f.componentId===v.targetComponent);if((N?N.viewModelId:void 0)===n.value.viewModelId)v.hasPath=!1;else{const f=t(i.controllerName.id,v.handlerName);v.hasPath=f?!0:v.hasPath,v.componentLists=f?K.cloneDeep(n.value.componentLists):v.componentLists}}})}),n.value.componentLists.length&&n.value.boundEventsList&&n.value.boundEventsList.forEach(i=>{var v;if((v=i.command)!=null&&v.targetComponent){const N=p.find(f=>{var h;return f.componentId===(((h=i.command)==null?void 0:h.targetComponent)||"")});if((N?N.viewModelId:void 0)===n.value.viewModelId)i.command.hasPath=!1;else{const f=t(i.controller.id,i.command.handlerName);i.command.hasPath=f?!0:i.command.hasPath,i.command.componentLists=f?K.cloneDeep(n.value.componentLists):i.command.componentLists}}})}function V(){const p=c.value.reduce((v,N)=>(v.set(N.boundEvents.label,!0),v),new Map);return l.value.filter(v=>!p.has(v.label))}function C(){var i;const p=((i=c.value)==null?void 0:i.length)>0;s.value=p?V():l.value}function k(){u(),l.value=n.value.events,c.value=n.value.boundEventsList,C()}function D(p){s.value=s.value.filter(i=>i.label!==p.label)}function y(p){c.value=c.value.filter(i=>i.boundEvents.label!==p.label),C()}function x(){var v;const p=(v=n.value)==null?void 0:v.getEventList(),{events:i}=p;p&&(n.value.events=K.cloneDeep(i),n.value.boundEventsList=p.boundEventsList),n.value.boundEventsList&&(n.value.boundEventsList=n.value.boundEventsList.filter(function(N){return i.find(g=>g.label===N.boundEvents.label)}))}return{allEvents:l,boundEvents:c,candidateEvents:s,excludeFromCandidates:D,loadEvents:k,resetBoundEvents:x,unBoundEvent:y}}const kt={sourceCommunication:{type:Object,default:{}}},It={events:{type:Array,default:[]}},$t=e.defineComponent({name:"FEventList",props:It,emits:["click"],setup(n,l){const c=e.ref(n.events);function s(u){l.emit("click",u)}function t(u){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>s(u),class:"f-page-events-editor-first-bound-event-name"},[u.name])])}return()=>e.createVNode("div",{class:"f-page-events-editor-events"},[c.value.map(u=>t(u))])}}),be={communication:{type:Object},sourceCommunication:{type:Object,default:{}},event:{type:String,default:""}},Dt=e.defineComponent({name:"FSelectSourceControl",props:be,emits:["selectSourceEvent","deleteControl"],setup(n,l){const c=e.inject("useFormSchema"),{createNewCommunication:s}=Ce(c),t=e.ref();t.value=s(n);const u=e.ref([{field:"name",title:"",dataType:"string"}]),V=e.ref([]),C=e.ref(),k=e.ref(),D=e.ref(!0),y=e.ref(!1),x=e.ref([]),p=e.ref(),i=e.ref(!0),v=e.ref(!1);function N(){const j=e.inject("sourceOutlineData");V.value=j||[],k.value.updateDataSource(V.value)}function g(){var O,m,r;if(!((m=(O=t.value)==null?void 0:O.source)!=null&&m.componentId)){v.value=!1;return}const j=(r=V.value)==null?void 0:r.find(d=>d.originalId===t.value.source.componentId);j?(k.value.selectItemById(j.id),v.value=!1):(v.value=!0,C.value={id:t.value.source.componentId})}function f(){var j,O,m;(O=(j=t.value)==null?void 0:j.source)!=null&&O.event&&((m=x.value)!=null&&m.length)&&(p.value=x.value.find(r=>{var d,b;return r.eventCode===((b=(d=t.value)==null?void 0:d.source)==null?void 0:b.event)}))}e.onMounted(()=>{N(),g(),f(),i.value=!1});function h(){var r;x.value=[];const j=C.value.rawSchema,O=j.type==="form-group"&&j.editor?j.editor.type:j.type,m=(r=ne.schemaMap[O])==null?void 0:r.events;m&&Object.keys(m).forEach(d=>{x.value.push({eventCode:d,eventName:m[d]})})}function S(j){D.value=!1,v.value=!1;const O=C.value!==j[0];O&&(C.value=j[0],h()),i.value||(y.value=!0),!i.value&&O&&(p.value=null)}const a=e.computed(()=>({"item-list":!0,"d-none":!D.value})),G=e.computed(()=>j=>{var O;return{item:!0,selected:((O=p.value)==null?void 0:O.eventCode)===j}});function z(j){var O;D.value=!1,y.value=!1,p.value=j,t.value.source.componentId=C.value.rawSchema.id,t.value.source.event=(O=p.value)==null?void 0:O.eventCode,l.emit("selectSourceEvent",t.value)}const U=e.computed(()=>({"form-container":!0,"position-relative":!0,invalid:v.value}));return()=>e.createVNode("div",{class:U.value},[e.createVNode("div",{class:a.value,style:"min-height:220px;"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择源控件")]),e.createVNode(He.FTreeView,{ref:k,data:V.value,columns:u.value,columnOption:{fitColumns:!0,fitMode:"expand"},showTreeNodeIcons:!0,fit:!0,iconField:"controlIcon",onSelectionChange:S},null)]),y.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择事件")]),x.value.map(j=>e.createVNode("span",{class:G.value(j.eventCode),onClick:()=>z(j)},[j.eventName]))])])])}}),qt=e.defineComponent({name:"FInteractionButton",props:kt,emits:["clickEventItem","selectSourceControl"],setup(n,l){const c=new ge.FNotifyService,s=e.inject("useEventsComposition"),t=e.inject("useInteractionCompostion"),{candidateEvents:u}=s,{collapseInteractions:V}=t,C=e.ref(!1),k=e.ref(!1);function D(v){u.value=u.value.filter(N=>N.label!==v.label)}function y(){var v;(v=n.sourceCommunication)!=null&&v.needSelectSourceControl?k.value=!k.value:C.value=!C.value}function x(v){y(),D(v),l.emit("clickEventItem",v)}function p(){var v;if(!((v=n.sourceCommunication)!=null&&v.needSelectSourceControl)&&u.value.length===0){c.info({position:"top-center",message:"事件已全部绑定"});return}V(),y()}function i(v){k.value=!1,l.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:p},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),C.value&&e.createVNode($t,{events:u.value,onClick:x},null),k.value&&e.createVNode(Dt,{sourceCommunication:n.sourceCommunication,onSelectSourceEvent:i},null)])}}),Ot={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}},At={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:{}}},Rt={controllers:{type:Array,default:[]}},Ut=e.defineComponent({name:"FCommandList",props:Rt,emits:["selectMethod"],setup(n,l){function c(C){return C.controllerList.length!==0}function s(C){return c(C)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:C.controllerName.name},[C.controllerName.name])])}function t(C,k){l.emit("selectMethod",{method:C,controller:k})}function u(C){return C.controllerList.map(k=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>t(k,C)},[e.createVNode("div",{class:"f-page-internals-command-name",title:k.label},[k.name])]))}function V(C){return e.createVNode("div",null,[s(C),u(C)])}return()=>e.createVNode("div",{class:"f-page-internals"},[n.controllers.map(C=>V(C))])}}),Gt={getEventPath:{type:Function,default:null},notifyService:{type:Object},useFormSchema:{type:Object},sourceCommunication:{type:Object,default:{}},event:{Type:Object}},_t=e.defineComponent({name:"FBoundEventSelector",props:Gt,emits:["cancel","submit"],setup(n,l){var P,R;const c=e.ref(),s=e.ref([]),t=e.ref('<i class="f-icon f-icon-search"></i>'),u=n.useFormSchema.getFormMetadataBasicInfo(),V=e.ref(""),C=e.ref(),k=((P=n.sourceCommunication)==null?void 0:P.unSupportedEventCodes)||[],D=e.ref(!k.includes(n.event.label)&&((R=n.useFormSchema.externalFormSchema)==null?void 0:R.size)>0),y=e.ref(),x=e.ref([]);e.onBeforeMount(()=>{if(n.getEventPath){const w=n.getEventPath();c.value=w.viewModelDisplay;const{actionWithPath:q}=w;q.forEach(o=>{o.sourceComponent.map.forEach(B=>{B.active=!1,B.hide=!1})}),s.value=K.cloneDeep(q)}});function p(w=""){w=w.replace(/ /g,"").replace(/>/g,"").toLowerCase(),w===""&&(w=" "),s.value.forEach(q=>{const o=q.path;q.sourceComponent.map.forEach(B=>{const A=B.command.name,H=B.event.name,E=B.command.label;`${o}${A}${H}${E}`.toLowerCase().includes(w)?B.hide=!1:B.hide=!0})})}function i(w=""){w=w.replace(/ /g,"").replace(/>/g,"").toLowerCase(),x.value.forEach(q=>{if(!q.isCommandNode)return;const o=q.name||"",B=q.code||"",A=q.viewmodelName||"",H=`${o}${B}${A}`.toLowerCase();w&&!H.includes(w)?q.hide=!0:q.hide=!1})}function v(w=""){!y.value||y.value.id===u.id?p(w):i(w)}function N(){const w=e.createVNode("div",{class:"f-vm-search"},[e.createVNode("div",{class:"f-vm-searchBar"},[e.createVNode(ln,{updateOn:"change",groupText:t.value,modelValue:V.value,"onUpdate:modelValue":q=>V.value=q,onChange:v,placeholder:"请输入名称/编号/路径搜索"},null)])]);return D.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"},[w])])]):w}function g(w){return{"f-vm-item":!0,"f-vm-item-focus":w.active}}function f(w,q){let o=0;s.value.forEach(B=>{B.sourceComponent.map.forEach(A=>{!A.command.isInvalid&&w.controller.id===A.controller.id&&w.command.id===A.command.id&&w.event.label===A.event.label&&q.sourceComponent.id===B.sourceComponent.id?(w.active=!w.active,C.value=K.cloneDeep(w)):(A.command.isInvalid&&w.controller.id===A.controller.id&&w.command.id===A.command.id&&w.event.label===A.event.label&&q.sourceComponent.id===B.sourceComponent.id&&(o++,o===1&&(new ge.FNotifyService().info({position:"top-center",message:"该方法已失效"}),C.value=null)),A.active=!1)})})}function h(w){return{"f-event-func":!w.command.isInvalid,"f-event-func-invalid":w.command.isInvalid}}function S(w){return w.sourceComponent.map.filter(q=>!q.hide).map(q=>{if(!q.command.isInvalid)return e.createVNode("div",{class:g(q),onClick:()=>f(q,w)},[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:h(q)},[q.command.name,e.createTextVNode("("),q.command.label,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[w.path,q.event.name])])})}function a(){return s.value.length>0?e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[s.value.map(w=>S(w))]):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 G(){l.emit("cancel")}function z(){if(!C.value){n.notifyService.info({position:"top-center",message:"请选择需要绑定的方法"});return}l.emit("submit",{selectedCommand:C.value,selectedForm:y.value})}function U(){const w=n.useFormSchema.externalFormSchema,q=[];return q.push({containerId:"",id:u.id,code:u.code,name:u.name}),Array.from(w.keys()).forEach(o=>{const B=w.get(o);q.push({containerId:o,id:B.id,code:B.code,name:B.name})}),q}const j=e.computed(()=>({"f-vm-all":!0," h-100":!0,"has-page-list":D.value}));function O(w){var A,H;const{viewmodels:q,components:o}=w.module;if((q==null?void 0:q.length)===0||(o==null?void 0:o.length)===0)return[];x.value=[];const B=(H=(A=n.sourceCommunication)==null?void 0:A.parameterData)==null?void 0:H.getViewModelName;q.forEach(E=>{if(!E||!E.commands||E.commands.length===0)return[];const J=o.find(ee=>ee.viewModel===E.id),Y=B&&J?B(J,E.name,w):"";x.value.push({id:E.id,code:E.code,name:Y||E.name}),E.commands.forEach(ee=>{ee.isInvalid||x.value.push({...ee,viewmodelId:E.id,viewmodelName:Y||E.name,isCommandNode:!0})})})}function m(w){var q,o,B;if(!(w.id===y.value.id&&w.containerId===y.value.containerId))if(y.value=w,V.value="",C.value=null,y.value.id!==u.id){const A=(o=n.useFormSchema.externalFormSchema)==null?void 0:o.get((q=y.value)==null?void 0:q.containerId);(B=A==null?void 0:A.content)!=null&&B.module&&O(A.content)}else s.value.map(A=>{A.sourceComponent.map.map(H=>{H.hide=!1,H.active=!1})})}function r(){const w=U();y.value||(y.value=w[0]);const q=e.computed(()=>o=>{var B;return{"f-list-view-group-item":!0,"f-listview-active":o.id===((B=y.value)==null?void 0:B.id)&&o.containerId===y.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;"},[w.map(o=>{let B=o.name;return o.containerId&&(B+=`, 所属外部容器:${o.containerId}`),e.createVNode("li",{class:q.value(o),onClick:()=>m(o)},[e.createVNode("div",{class:"f-list-content"},[e.createVNode("div",{class:"f-navSelector-leftCategory",title:B},[o.name])])])})])])])])}function d(w){x.value.map(q=>q.active=!1),w.active=!0,C.value=w}function b(){return e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[x.value.filter(w=>!w.hide).map(w=>{if(w.isCommandNode)return e.createVNode("div",{class:g(w),onClick:()=>d(w)},[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"},[w.name,e.createTextVNode("("),w.code,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[w.viewmodelName])])})])}return()=>e.createVNode("div",{class:j.value},[e.createVNode("div",{class:"d-flex f-utils-fill-flex-row splitter"},[D.value?r():"",e.createVNode("div",{class:"f-utils-fill-flex-column"},[N(),!y.value||y.value.id===u.id?a():b()])]),e.createVNode("div",{class:"modal-footer"},[e.createVNode("button",{type:"button",class:"btn btn-secondary",onClick:G},[e.createTextVNode("取消")]),e.createVNode("button",{type:"button",class:"btn btn-primary",onClick:z},[e.createTextVNode("确定")])])])}}),Ht=e.defineComponent({name:"FCommandSource",props:At,emits:["addInternalCommandListChanged","newImportChanged","selectBoundMethod","click","existChanged","newFunctionChanged","close","selectMethod","addCommunication"],setup(n,l){const c=e.inject("useMethodsComposition"),s=e.inject("useFormCommand"),t=new ge.FNotifyService,{checkIfNewControllerExists:u,addNewController:V}=c,C=e.ref(n.controllers),k=e.inject("useFormSchema"),D=e.inject(cn.F_MODAL_SERVICE_TOKEN);let y,x;const p=e.ref(!1);e.onMounted(()=>{p.value=k.externalFormSchema.size>0});function i(d,b,P){if(V(d),d.Commands){const R=s.getInternalControllerFromControllerMetadata(d,b,P);u(R)&&t.info({position:"top-center",message:"该控制器已存在"})}}async function v(d){s.getSupportedControllerMetadata(d).then(b=>{b&&i(b.controller,b.code,b.nameSpace)}).finally(()=>{y&&y.destroy&&y.destroy()})}function N(d){y&&y.destroy&&y.destroy()}function g(){const d={formBasicInfo:k==null?void 0:k.getFormMetadataBasicInfo()};return e.createVNode(ze.FSchemaSelector,{injectSymbolToken:ce.ControllerSchemaRepositorySymbol,"view-type":"NavList",editorParams:d,showFooter:!0,onCancel:N,onSubmit:v},null)}function f(){y=D.open({title:"选择控制器",width:950,render:g,showButtons:!1})}function h(){l.emit("newFunctionChanged")}function S(){x&&x.destroy&&x.destroy()}function a(d){const{selectedCommand:b,selectedForm:P}=d;!P||(P==null?void 0:P.id)===k.getFormMetadataBasicInfo().id?(c.selectBoundCommand(b,n.iteractionDisplayOrder),l.emit("selectBoundMethod")):l.emit("addCommunication",d),S()}function G(){const{getEventPath:d}=c;return e.createVNode(_t,{getEventPath:d,notifyService:t,useFormSchema:k,sourceCommunication:n.sourceCommunication,event:n.event,onCancel:S,onSubmit:a},null)}function z(){x=D.open({title:"已有方法",width:950,height:500,fitContent:!1,render:G,showButtons:!1,enableEsc:!1,draggable:!0})}function U(){l.emit("close",null)}function j(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function O(){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:()=>f()},[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:()=>h()},[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:()=>z()},[e.createTextVNode("已有方法")])])])}function m(d){l.emit("selectMethod",d)}function r(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(Ut,{controllers:C.value,onSelectMethod:m},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[r(),j(),O(),j(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:U},[e.createTextVNode("取消")])])])}}),zt={command:{type:Object,default:{}},showParameter:{type:Boolean,default:!1},controller:{type:Object,default:{}},showDeleteIcon:{type:Boolean,default:!1}},Wt=e.defineComponent({name:"FParameterEditor",props:zt,emits:["confirm","change","targetChange","viewSource","deleteCommand"],setup(n,l){const c=new ge.FNotifyService,s=e.inject("FMessageBoxService"),t=e.ref(K.cloneDeep(n.command)),u=e.ref(n.controller),V=e.ref(0),C=e.computed(()=>t.value.id==="abandoned"),k=e.computed(()=>t.value.id==="deleted"),D=e.computed(()=>n.showDeleteIcon),y=e.computed(()=>t.value!==null),x=e.inject("useMethodsComposition"),p=e.ref(n.showParameter),i=e.inject("useFormSchema"),v=e.computed(()=>t.value.componentLists&&t.value.hasPath),N=e.computed(()=>{const E=t.value.id!=="abandoned"&&t.value.id!=="deleted",J=v.value,Y=t.value.property&&t.value.property.length>0;return E&&(J||Y)});function g(){const{targetComponent:E}=t.value;let J="";return t.value.componentLists&&t.value.componentLists.forEach(Y=>{if(Y.componentId===E){J=Y.viewModelId;return}}),J}const f=e.ref(g()),h=e.computed(()=>t.value.targetComponent||"");function S(){c.info({position:"top-center",message:"方法已被移除,请重新绑定"})}function a(){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:()=>S()},null)}function G(){c.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:()=>G()},null)}function U(E){p.value=!p.value}function j(){return e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>U(V.value)},null)}function O(E,J){t.value.targetComponent=E[0].componentId,l.emit("targetChange",t.value)}function m(){const E=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"),E]])]),e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-dropdown"},[e.createVNode(We,{modelValue:f.value,"onUpdate:modelValue":J=>f.value=J,enableClear:!1,idField:"viewModelId",valueField:"viewModelId",textField:"componentId",data:t.value.componentLists,editable:!1,onChange:O},null)])])])}function r(E,J){J.value=E}function d(){l.emit("change",t.value)}function b(){let E="";return h.value?E=i.getViewModelIdByComponentId(h.value):E=x.getViewModeId(),E}function P(E,J){var xe,je,Ee,Pe,Ne,ye,I,_,W,Q,X,oe,le,de,ue,Me,Te,Be,he,Le,ke;const Y=b(),ie=i.getViewModelById(Y).commands.find(Z=>{var fe;return(Z==null?void 0:Z.id)===((fe=n.command)==null?void 0:fe.id)}),se=e.reactive(E.context.data),{assembleSchemaFieldsByComponent:te,assembleOutline:ae,assembleStateVariables:re,assembleSchemaFieldsUnderBoundEntity:Ae,getEditor:Re}=E.context.generalData,{designerMode:Ue}=i,Ge=Z=>{r(Z,E),d()},_e=Z=>{var fe,we,ve,Ie;return((Ie=(ve=(we=(fe=E==null?void 0:E.origin)==null?void 0:fe.controlSource)==null?void 0:we.context)==null?void 0:ve.data)==null?void 0:Ie.value)===":Entity"||Z.raw.children&&Z.raw.children.length&&(Z.disabled=!0),Z};return e.createVNode(De,{readonly:Ue==="PC_RTC"&&!J.isRtcCommand,defaultValue:E==null?void 0:E.origin.defaultValue,modelValue:E.value,"onUpdate:modelValue":Z=>E.value=Z,data:se,editor:Re(E.value,E,ie,Y,Ge),fieldData:te(),formData:ae(),varData:re(),activeViewModelFieldData:Ae(h.value),editorControlSource:(xe=E==null?void 0:E.origin)==null?void 0:xe.controlSource,customRowStatus:_e,idField:((Ne=(Pe=(Ee=(je=E==null?void 0:E.origin)==null?void 0:je.controlSource)==null?void 0:Ee.context)==null?void 0:Pe.data)==null?void 0:Ne.value)===":Entity"?"bindTo":((W=(_=(I=(ye=E==null?void 0:E.origin)==null?void 0:ye.controlSource)==null?void 0:I.context)==null?void 0:_.valueField)==null?void 0:W.value)||((le=(oe=(X=(Q=E==null?void 0:E.origin)==null?void 0:Q.controlSource)==null?void 0:X.context)==null?void 0:oe.idField)==null?void 0:le.value)||"id",textField:((Te=(Me=(ue=(de=E==null?void 0:E.origin)==null?void 0:de.controlSource)==null?void 0:ue.context)==null?void 0:Me.textField)==null?void 0:Te.value)||"label",editable:(ke=(Le=(he=(Be=E==null?void 0:E.origin)==null?void 0:Be.controlSource)==null?void 0:he.context)==null?void 0:Le.editable)==null?void 0:ke.value,onConfirm:Z=>{r(Z,E),d()},onValueChange:Z=>{var fe,we;if(((fe=E.origin)==null?void 0:fe.Code)==="lookupId"){const ve=(we=t.value.property)==null?void 0:we.find(Ie=>Ie.name==="mappingFields");ve&&ve.value&&(ve.value="")}r(Z,E),d()}},null)}function R(){var E;return(E=t.value.property)==null?void 0:E.map((J,Y)=>{const ee=e.reactive({content:J.description,placement:"top"});return e.createVNode("div",{key:J.name+Y},[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"),ee]])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[P(J,t.value)])])})}function w(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[v.value&&m(),R()])}function q(E){E.stopPropagation(),l.emit("viewSource",{command:t.value,event:E})}function o(){s.question(`确定删除命令【${t.value.name}】吗?`,"",()=>{l.emit("deleteCommand")})}function B(){return e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:E=>o()},null)}const A=e.computed(()=>{var E;return{cursor:C.value||u.value.isCommon||((E=u.value)==null?void 0:E.label.indexOf(i==null?void 0:i.getModule().code))===-1?"default":"pointer"}});function H(){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:A.value,title:t.value.label,onDblclick:q},[t.value.name]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[C.value&&a(),k.value&&z(),N.value&&j(),D.value&&B()])]),p.value&&w()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[y.value&&H()])}}),Kt="root-viewmodel";class Jt{constructor(l,c){$e(this,"formSchemaUtils");$e(this,"controlCreatorUtils");$e(this,"designViewModelUtils");this.resolver=l,this.designerHostService=c,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(l){const c=this.createComponentRefNode(l),s=this.createComponentNode(l),t=this.createViewModeNode(l),u=this.formSchemaUtils.getFormSchema();return u.module.viewmodels.push(t),u.module.components.push(s),this.designViewModelUtils.assembleDesignViewModel(),c}createComponentRefNode(l){const c=this.resolver.getSchemaByType("component-ref");return Object.assign(c,{id:`${l.componentId}-component-ref`,component:`${l.componentId}-component`}),c}createComponentNode(l){const c=this.resolver.getSchemaByType("component"),s=this.createFormComponentContents(l);return Object.assign(c,{id:`${l.componentId}-component`,viewModel:`${l.componentId}-component-viewmodel`,componentType:l.componentType,appearance:{class:this.getFormComponentClass(l)},formColumns:l.formColumns,contents:s}),c}getFormComponentClass(l){var s,t;const{templateId:c}=this.formSchemaUtils.getFormSchema().module;if(c==="double-list-in-tab-template"&&((t=(s=l.parentComponentInstance)==null?void 0:s.schema)==null?void 0:t.type)==="tab-page"){const u=l.parentComponentInstance.parent&&l.parentComponentInstance.parent.schema;if((u==null?void 0:u.type)==="tabs"&&(u==null?void 0:u.fill)===!0)return"f-struct-wrapper f-utils-fill-flex-column"}return"f-struct-wrapper"}createFormComponentContents(l){var C,k;const c=this.resolver.getSchemaByType("section");Object.assign(c,{id:l.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:l.componentName});const s=this.resolver.getSchemaByType("response-form"),t=[];Object.assign(s,{id:l.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:t,controlsInline:!0}),c.contents=[s];const{selectedFields:u}=l;u==null||u.forEach(D=>{if(D.$type===ce.FormSchemaEntityField$Type.SimpleField){const y=K.cloneDeep(D),x=this.resolveControlClassByFormColumns(l),p=this.controlCreatorUtils.setFormFieldProperty(y,"",x);p&&t.push(p)}});const{templateId:V}=this.formSchemaUtils.getFormSchema().module;if(V==="double-list-in-tab-template"&&((k=(C=l.parentComponentInstance)==null?void 0:C.schema)==null?void 0:k.type)==="tab-page"){const D=l.parentComponentInstance.parent&&l.parentComponentInstance.parent.schema;(D==null?void 0:D.type)==="tabs"&&(D==null?void 0:D.fill)===!0&&(c.appearance.class="f-section-grid f-section-in-main px-0 pt-0",c.fill=!0)}return[c]}resolveControlClassByFormColumns(l){let c="";switch(l.formColumns){case 1:{c="col-12 col-md-12 col-xl-12 col-el-12";break}case 2:{c="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{c="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{c="col-12 col-md-6 col-xl-3 col-el-2";break}}return c}createViewModeNode(l){return{id:`${l.componentId}-component-viewmodel`,code:`${l.componentId}-component-viewmodel`,name:l.componentName,bindTo:l.bindTo,parent:Kt,fields:this.assembleViewModelFields(l),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(l){const c=[],{selectedFields:s}=l;return s==null||s.forEach(t=>{if(t.$type===ce.FormSchemaEntityField$Type.SimpleField){let u="blur";const V=t.type.name;(V===ce.FormSchemaEntityFieldTypeName.Enum||V===ce.FormSchemaEntityFieldTypeName.Boolean)&&(u="change"),c.push({type:"Form",id:t.id,fieldName:t.bindingField,groupId:null,groupName:null,updateOn:u,fieldSchema:{}})}}),c}}function en(n,l,c,s){var u,V,C,k,D,y;const t=c.parentComponentInstance;if(t&&s){const x=(u=t.schema)==null?void 0:u.type,i={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((V=c.bindingSourceContext)==null?void 0:V.entityTitle)||((k=(C=c.bindingSourceContext)==null?void 0:C.bindingEntity)==null?void 0:k.name)||"标题",componentType:"form",formColumns:x==="splitter-pane"?1:4,parentContainerId:t.schema.id,parentComponentInstance:t,bindTo:((D=c.bindingSourceContext)==null?void 0:D.bindTo)||"/",selectedFields:(y=c.bindingSourceContext)==null?void 0:y.bindingEntityFields};return new Jt(n,s).createComponent(i)}else return l}const Qt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"},formType:{description:"",type:"string",default:"static"}},required:["id","type","contents"]},nn=new Map([["appearance",ne.resolveAppearance]]),Yt={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/dynamic-form.schema.json",title:"dynamic-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"dynamic-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1},adaptForLanguage:{description:"",type:"boolean",default:!0},formType:{description:"",type:"string",default:"dynamic"},layout:{description:"",type:"string",default:"col-12 col-md-6 col-xl-3 col-el-2"},fields:{description:"",type:"array"},formData:{description:"",type:"object"}},required:["id","type","contents"]},Ve={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0},adaptForLanguage:{type:Boolean,default:!0},fields:{type:Array,default:[]},formData:{type:Object,default:null},layout:{type:String,default:"col-12 col-md-6 col-xl-3 col-el-2"}},Xt=Object.assign({},Ve,{canRenderForm:{type:Boolean,default:!0},callback:{type:Function}});ne.createPropsResolver(Ve,Qt,nn,en),ne.createPropsResolver(Ve,Yt,nn,en);const Fe=e.defineComponent({name:"FDynamicForm",props:Xt,emits:["update:modelValue","event"],setup(n,l){const c=e.ref(n.fields),s=new Map,t=e.ref(n.callback);me.loadRegister();const u=me.useComponentManager(),V=e.ref(n.formData||{}),C=me.useBindingData(V,l);me.useEntityState(c.value).setup();const D=new Map,y=e.ref(n.canRenderForm),{mergeArray:x,resolveCallbacks:p,resolveEvents:i}=me.useDynamicViewUtils(),v=e.computed(()=>{const o=Ke.LocaleService.getLocale(),B=n.fields&&n.fields.length>0,A={"f-form-layout":B,"farris-form":B};return n.adaptForLanguage&&o&&(A["farris-form-controls-inline"]=o!=="en"),ce.getCustomClass(A,n.customClass)});function N(){function o(B,A){const{id:H}=B||{},{field:E}=B.binding||{};return{modelValue:A.getValue(H),"onUpdate:modelValue":J=>{A.setValue(H,E||H,J)}}}return{resolve:o}}function g(o){const B=N();return C.getValue(o.id)===void 0&&Object.hasOwnProperty.call(o,"modelValue")&&C.setValue(o.id,void 0,o.modelValue),B.resolve(o,C)}function f(o){const B={};return o&&Object.entries(o).forEach(([A,H])=>{B[A]=()=>Array.isArray(H)?H.map(E=>G(E)):G(H)}),B}function h(o){return o.type?o.type:o.fields?"fieldset":"form-group"}function S(o){const B=h(o);let A=o.customClass;A||(A=B==="form-group"?n.layout:"col-12 px-0");const{fields:H,customClass:E,...J}=o,Y={...i(o,l,B)},ee={...p(o,t,B)};return{props:{...{...J,customClass:A,...g(o)},key:o.id,ref:te=>{if(te&&o.id&&!u.has(o.id)){u.register(o.id,te);const ae={token:o.id,name:"component:ready",type:h(o),payloads:[e.ref(te)],schema:o};l.emit("event",ae)}},onVnodeUnmounted:te=>{if(o.id&&u.has(o.id)){u.remove(o.id);const ae={token:o.id,name:"component:unmounted",type:h(o),payloads:[te],schema:o};l.emit("event",ae)}}},eventProps:Y,callbackProps:ee}}function a(o,B){return Array.isArray(o)?o.map(A=>B(A)):B(o)}function G(o,B){var ee;const A=h(o),H=me.componentMap[A];if(o.id&&s.set(o.id,o),!H)return null;const E=()=>o.fields?o.fields.map(ie=>G(ie)):null,J=(ie,se,te)=>{let ae;return te&&te.length>0?ae=e.createVNode(ie,{...se},te):ae=e.createVNode(ie,{...se},null),ae},Y=((ee=D.get(o.id))==null?void 0:ee.props)||{};return o.fields&&o.fields.length>0?J(H,Y,[E()]):o.slots?J(H,Y,[...Object.values(f(o.slots))]):J(H,Y)}function z(o){const B=h(o);if(!me.componentMap[B])return;const{props:H,eventProps:E,callbackProps:J}=S(o),Y=me.resolverMap[B],ee=Y?Y.editorResolver:null,{componentEventProps:ie,editorEventProps:se}=E,{componentCallbackProps:te,editorCallbackProps:ae}=J;if(ie&&Object.keys(ie).length>0&&Object.assign(H,ie),te&&Object.keys(te).length>0&&Object.assign(H,te),ee&&se&&Object.keys(se).length>0){const re=ee.resolve(o);Object.assign(re,se)}if(ee&&ae&&Object.keys(ae).length>0){const re=ee.resolve(o);Object.assign(re,ae)}if(H&&Object.keys(H).length>0){const re=D.get(o.id);re?K.merge(re==null?void 0:re.props,H):D.set(o.id,e.reactive({props:H}))}!o.fields||!Array.isArray(o.fields)||o.fields.forEach(re=>z(re))}function U(o){const B=h(o);me.componentMap[B]&&(j(o),!(!o.fields||!Array.isArray(o.fields))&&o.fields.forEach(H=>U(H)))}function j(o){const B=g(o);if(B&&Object.keys(B).length>0){const A=D.get(o.id);if(!A)D.set(o.id,e.reactive({props:B}));else{const H={...A==null?void 0:A.props};Object.keys(B).forEach(E=>{H[E]=B[E]}),Object.assign(A==null?void 0:A.props,H)}}}e.onMounted(()=>{}),e.watch(()=>n.formData,o=>{V.value=o}),e.watch(()=>V.value,o=>{a(c.value,U)},{deep:!0});function O(o){o&&a(c.value,z)}e.watch(()=>n.fields,o=>{s.clear(),u.clear(),V.value=n.formData||{},D.clear(),c.value=o,O(o)}),O(n.fields);function m(o){o.$forceUpdate&&o.$forceUpdate()}function r(o){return C.getValue(o)}function d(){return V.value}function b(o,B){C.setValue(o,void 0,B);const A=s.get(o);A&&j(A)}function P(o){var B;return(B=D.get(o))==null?void 0:B.props}function R(o,B){const A=D.get(o);K.mergeWith(A==null?void 0:A.props,B,x)}l.expose({componentManager:u,rerender:m,getProps:P,setProps:R,getControlValue:r,setControlValue:b,getValues:d});function w(){return y.value&&e.withDirectives(e.createVNode("div",{class:v.value,style:n.customStyle},[l.slots.default&&l.slots.default(),c.value&&c.value.length>0&&a(c.value,G)]),[[e.resolveDirective("area-response")]])}function q(){return!y.value&&c.value&&c.value.length>0&&a(c.value,G)}return()=>n.visible?w()||q():null}}),tn=e.defineComponent({name:"FResponseForm",props:Ve,emits:[],setup(n,l){var x;const c=e.ref(),s=e.ref(),t=e.computed(()=>{const p=Ke.LocaleService.getLocale(),i=n.fields&&n.fields.length>0,v={"drag-container":!0,"f-form-layout":i,"farris-form":i};return n.adaptForLanguage&&p&&(v["farris-form-controls-inline"]=p!=="en"),ce.getCustomClass(v,n.customClass)}),u=(x=s.value)==null?void 0:x.componentManager;function V(p){s.value.render(p)}function C(p){return s.value.getControlValue(p)}function k(p,i){s.value.setControlValue(p,i)}function D(p){return s.value.getProps(p)}function y(p,i){s.value.setProps(p,i)}return l.expose({componentManager:u,rerender:V,getProps:D,setProps:y,getControlValue:C,setControlValue:k}),()=>n.visible&&e.withDirectives(e.createVNode("div",{ref:c,class:t.value,style:n.customStyle},[l.slots.default&&l.slots.default(),n.fields&&n.fields.length>0&&e.createVNode(Fe,{ref:s,fields:n.fields,canRenderForm:!1,formData:n.formData,layout:n.layout},null)]),[[e.resolveDirective("area-response")]])}}),Zt={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],default:null},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}},eo={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"}},no=e.defineComponent({name:"FDynamicFormLabel",props:eo,emits:[],setup(n,l){e.ref(n.title||n.text);const c=e.ref(n.required),s=e.ref(n.text),t=e.ref(n.valid),u=e.ref(n.inValidTip);e.watch(()=>n.text,()=>{s.value=n.text}),e.watch(()=>n.required,(y,x)=>{y!==x&&(c.value=y)}),e.watch([()=>n.valid,()=>n.inValidTip],([y,x])=>{t.value=y,u.value=x});const V=e.computed(()=>t.value?s.value:u.value),C=e.computed(()=>t.value?"":"color:red"),k=e.computed(()=>({"col-form-label":!0,"f-width-auto":c.value&&(n.showType==="none"||!s.value)})),D=e.computed(()=>n.showType==="force-none"?!1:n.showType==="reserve-space"||c.value||!!s.value&&n.showType!=="none");return()=>D.value&&e.createVNode("label",{class:k.value,title:V.value,style:C.value},[!t.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"},[c.value&&e.createVNode("span",{class:"farris-label-info text-danger"},[e.createTextVNode("*")]),n.showType==="visible"&&s.value])])}}),{globalStorageKey:to}=ce.useThirdComponent(),M={},T={},L={},$={};async function oo(){{const n={schemaMap:ne.schemaMap,propertyConfigSchemaMap:ne.propertyConfigSchemaMap,propertyEffectMap:ne.propertyEffectMap,schemaResolverMap:ne.schemaResolverMap};dn.register(M,T,L,$),sn.register(M,T,L,$),un.register(M,T,L,$),mn.register(M,T,L,$),fn.register(M,T,L,$,n),pn.register(M,T,L,$),Je.register(M,T,L,$,n),Qe.register(M,T,L,$,n),Je.register(M,T,L,$,n),Qe.register(M,T,L,$,n),We.register(M,T,L,$,n),hn.register(M,T,L,$),gn.register(M,T,L,$),Cn.register(M,T,L,$,n),vn.register(M,T,L,$),bn.register(M,T,L,$,n),Nn.register(M,T,L,$,n),yn.register(M,T,L,$),wn.register(M,T,L,$,n),Vn.register(M,T,L,$),vt.register(M,T,L,$),Fn.register(M,T,L,$),Sn.register(M,T,L,$),dt.register(M,T,L,$),jn.register(M,T,L,$),En.register(M,T,L,$,n),Pn.register(M,T,L,$,n),Tn.register(M,T,L,$,n),Mn.register(M,T,L,$),Bn.register(M,T,L,$,n),Ln.register(M,T,L,$),kn.register(M,T,L,$),In.register(M,T,L,$),$n.register(M,T,L,$,n),Dn.register(M,T,L,$),qn.register(M,T,L,$,n),On.register(M,T,L,$),An.register(M,T,L,$),Rn.register(M,T,L,$),Un.register(M,T,L,$,n),Gn.register(M,T,L,$,n),_n.register(M,T,L,$),zn.register(M,T,L,$,n),Wn.register(M,T,L,$),Hn.register(M,T,L,$),ze.register(M,T,L),Kn.register(M,T,L,$),Jn.register(M,T,L,$,n),Qn.register(M,T,L,$),Yn.register(M,T,L,$),Xn.register(M,T,L,$),Zn.register(M,T,L,$,n),mt.register(M,T,L,$),et.register(M,T,L,$,n),nt.register(M,T,L,$),tt.register(M,T,L,$),ot.register(M,T,L,$,n),at.register(M,T,L,$),He.register(M,T,L,$),it.register(M,T,L,$),rt.register(M,T,L,$),ct.register(M,T,L,$),lt.register(M,T,L,$,n),st.register(M,T,L,$),xn.register(M,T,L,$),De.register(M,T,L,$),ut.register(M,T,L,$,n),ft.register(M,T,L,$),pt.register(M,T,L,$),ht.register(M,T,L,$),gt.register(M,T,L,$),Ct.register(M,T,L,$),bt.register(M,T,L,$,n),Nt.register(M,T,L,$),yt.register(M,T,L,$),wt.register(M,T,L,$),Vt.register(M,T,L,$,n),Ft.register(M,T,L,$,n),St.register(M,T,L,$);const l=window[to];if(l)for(const c in l)l[c].createPropsResolver=ne.createPropsResolver,l[c].register(M,T,L)}}function on(){oo();function n(V){const C=M[V];if(!C)throw new Error(`Could not find the editor of type '${V}'`);return C}function l(V,C){const k=T[V];return k?k(C):{}}function c(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 s(V){switch(V){case"combo-list":case"input-group":case"textarea":return"onClear"}}function t(V){switch(V){case"input-group":case"textarea":return"onMousedownEvent"}}function u(V){switch(V){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:l,resolveEditorType:n,getChangeFunctionName:c,getClearFunctionName:s,getMousedownFunctionName:t,getMouseupFunctionName:u}}const ao={errors:{type:Object,default:null}},ro=e.defineComponent({name:"FValidationMessage",props:ao,emits:[],setup(n,l){const c=e.ref(n.errors);e.watch(()=>n.errors,u=>{c.value=u});const s=e.ref(!0),t=e.computed(()=>{if(c.value){const u=Object.keys(c.value).map(V=>{var C;return(C=c.value[V])==null?void 0:C.name});return u.length?u.join(" "):""}return""});return()=>t.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"},[t.value])])}}),Oe=e.defineComponent({name:"FDynamicFormGroup",props:Zt,emits:["change","update:modelValue"],setup(n,l){var d;const c=e.ref(n.id),s=e.ref(n.customClass),t=e.ref(n.editor),u=e.ref(n.label),V=e.ref(n.modelValue),C=e.ref(n.readonly),k=e.ref(((d=n.editor)==null?void 0:d.required)||n.required),D=e.ref(n.showLabel),y=e.ref(n.visible);e.ref(n.type);const x=e.ref(),p=e.ref(n.errors),i=ce.isMobilePhone(),v=e.ref(n.editor.type||"input-group"),N=e.computed(()=>D.value?n.showLabelType:"none"),{resolveEditorProps:g,resolveEditorType:f,getChangeFunctionName:h,getClearFunctionName:S}=on(),a=e.computed(()=>{const b={"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":C.value,"form-group--in-mobile":i};return b["form-group--has-"+v.value]=!0,b}),G=e.computed(()=>{if(n.fill)return{maxWidth:"none"}});function z(b,P,R){V.value=P!==void 0?P:b,l.emit("update:modelValue",V.value),l.emit("change",V.value,{newValue:b,newModelValue:P,parameters:R})}function U(){l.emit("update:modelValue","")}function j(b){return(...P)=>{U(),typeof b=="function"&&b(...P)}}function O(b){return(P,R,w)=>{z(P,R,w),typeof b=="function"&&b(P,R,w)}}const m=e.computed(()=>{const b=t.value.type||"input-group",P=f(b),R=g(b,t.value),w=h(b),q=S(t.value.type);return q&&(R[q]=j(R[q])),w&&(R[w]=O(R[w])),(R.id==null||R.id==="")&&(R.id=c.value),b==="number-range"&&t.value.onBeginValueChange&&typeof t.value.onBeginValueChange=="function"?(t.value.onBeginValueChange&&typeof t.value.onBeginValueChange=="function"&&(R.onBeginValueChange=t.value.onBeginValueChange),t.value.onEndValueChange&&typeof t.value.onEndValueChange=="function"&&(R.onEndValueChange=t.value.onEndValueChange)):b==="lookup"&&t.value["onUpdate:idValue"]&&typeof t.value["onUpdate:idValue"]=="function"?(R["onUpdate:idValue"]=t.value["onUpdate:idValue"],R.id=c.value):b==="collection-property-editor"&&t.value.onSelectionChange&&typeof t.value.onSelectionChange=="function"?R.onSelectionChange=t.value.onSelectionChange:b==="property-editor"&&(R.onBeforeOpenVariables=t.value.onBeforeOpenVariables),()=>e.createVNode(P,e.mergeProps({ref:x},R,{modelValue:V.value,"onUpdate:modelValue":o=>V.value=o}),l.slots)});function r(){return e.createVNode(ro,{id:`${c.value}-validation-message`,errors:p.value},null)}return e.watch([()=>n.id,()=>n.customClass,()=>n.editor,()=>n.label,()=>n.modelValue,()=>n.readonly,()=>n.required,()=>n.showLabel,()=>n.visible,()=>n.errors],([b,P,R,w,q,o,B,A,H,E])=>{var J;c.value=b,s.value=P,t.value=R,u.value=w,V.value=q,C.value=o,k.value=((J=t.value)==null?void 0:J.required)||B,D.value=A,y.value=H,p.value=E}),l.expose({editorRef:x}),()=>y.value&&e.createVNode("div",{id:`${c.value}-form-group`,class:s.value,style:n.customStyle},[e.createVNode("div",{class:"farris-group-wrap",style:G.value},[e.createVNode("div",{class:a.value},[e.createVNode(no,{id:`${c.value}-lable`,showType:N.value,required:k.value,text:u.value,title:u.value},null),e.createVNode("div",{class:"farris-input-wrap"},[m.value(),r()])])])])}}),io={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},an=e.defineComponent({name:"FDynamicFormInput",props:io,emits:["change","update:modelValue","mousedown","mouseup"],setup(n,l){const c=e.ref(n.id),s=e.ref(n.editor),t=e.ref(n.modelValue),{resolveEditorProps:u,resolveEditorType:V,getChangeFunctionName:C,getMousedownFunctionName:k,getMouseupFunctionName:D,getClearFunctionName:y}=on();function x(h,S,a){t.value=S!==void 0?S:h,l.emit("update:modelValue",t.value),l.emit("change",t.value,{newValue:h,newModelValue:S,parameters:a})}function p(h){l.emit("mousedown",h)}function i(h){l.emit("mouseup",h)}function v(){l.emit("update:modelValue","")}function N(h){return(...S)=>{v(),typeof h=="function"&&h(...S)}}function g(h){return(S,a,G)=>{x(S,a,G),typeof h=="function"&&h(S,a,G)}}const f=e.computed(()=>{const h=V(s.value.type),S=u(s.value.type,s.value);S.focusOnCreated=n.focusOnCreated,S.selectOnCreated=n.selectOnCreated;const a=C(s.value.type),G=y(s.value.type);G&&(S[G]=N(S[G])),a&&(S[a]=g(S[a]));const z=k(s.value.type);S[z]=p;const U=D(s.value.type);return S[U]=i,S.id=c.value,()=>e.createVNode(h,e.mergeProps(S,{modelValue:t.value,"onUpdate:modelValue":j=>t.value=j}),null)});return e.watch([()=>n.id,()=>n.editor,()=>n.modelValue],([h,S,a])=>{c.value=h,s.value=S,t.value=a}),()=>f.value()}});Fe.install=n=>{n.component(tn.name,tn).component(an.name,an).component(Fe.name,Fe).component(Oe.name,Oe)};const co=e.defineComponent({name:"FSelectParameters",props:be,emits:["changed"],setup(n,l){var m;const c=new ge.FNotifyService;c.globalConfig={position:"top-center"};const s=e.inject("FMessageBoxService"),t=e.ref(n.communication),u=e.ref(((m=t.value)==null?void 0:m.paramMappings)||[]),V=e.inject("useFormSchema"),C=V.getFormMetadataBasicInfo(),k=e.ref([]),D=e.ref([]),y=e.ref({}),x=e.ref({}),p=e.computed(()=>r=>{let d="",b="";if(r.sourceValue&&r.targetVariable){const P=D.value.find(R=>R.statePath===`${r.targetVariableViewModelId}.${r.targetVariable}`);P&&P.name?(x.value[r.targetVariable]=!1,d=`${r.sourceValue}--->${P.name}`,b=`将 ${r.sourceValue} 赋值给 ${P.name}`):(x.value[r.targetVariable]=!0,d=`${r.sourceValue}--->${r.targetVariable}`,b=`将 ${r.sourceValue} 赋值给 ${r.targetVariable}`)}return{displayText:d,displayTextTip:b}});e.watch(()=>n.communication,r=>{t.value=r,u.value=t.value.paramMappings||[]},{deep:!0});function i(){var d;const r=u.value.length||0;u.value.length&&(u.value=u.value.filter(b=>!(!b.sourceValue&&!b.targetVariable))),t.value.paramMappings=u.value,r!==((d=t.value.paramMappings)==null?void 0:d.length)&&l.emit("changed")}e.onUnmounted(()=>{i()});function v(r){var w,q;const{viewmodels:d,components:b}=r.module;if((d==null?void 0:d.length)===0||(b==null?void 0:b.length)===0)return[];const P=[];D.value=[];const R=(q=(w=n.sourceCommunication)==null?void 0:w.parameterData)==null?void 0:q.getViewModelName;return d.forEach(o=>{if(!o||!o.states||o.states.length===0)return[];const B=[],A=b.find(J=>J.viewModel===o.id),H=R&&A?R(A,o.name,r):"";o.states.forEach(J=>{const Y={...J,statePath:o.id+"."+J.code};B.push({data:Y,children:[]}),D.value.push(Y)});const E={data:{id:o.id,code:o.code,name:H||o.name,statePath:o.id},children:B};P.push(E)}),P}function N(){var r,d;if(!((r=t.value)!=null&&r.target.formId))return[];if(t.value.target.formId===C.id)k.value=v(V.getFormSchema());else{const b=V.externalFormSchema.get(t.value.target.externalContainerId);(d=b==null?void 0:b.content)!=null&&d.module&&(k.value=v(b==null?void 0:b.content))}}function g(){Object.keys(y.value).forEach(r=>{y.value[r]=!1})}function f(){g();const r=ce.useGuid().guid();u.value.push({id:r,sourceValue:"",targetVariable:"",targetVariableViewModelId:""}),t.value.paramMappings=u.value,y.value[r]=!0}function h(r,d,b){r.stopPropagation();function P(){u.value=u.value.filter(R=>R.id!==d.id),t.value.paramMappings=u.value,g(),l.emit("changed")}b?s.question(`确定删除参数【${b}】吗?`,"",()=>{P()}):P()}function S(r){y.value[r.id]||(g(),y.value[r.id]=!0)}function a(r,d){if(!d.sourceValue){c.warning("请选择源参数");return}if(!d.targetVariable){c.warning("请选择目标参数");return}y.value[r.id]=!1,Object.assign(r,d),delete r.statePath,l.emit("changed")}function G(r){y.value[r.id]=!1,!r.sourceValue&&!r.targetVariable&&!r.targetVariableViewModelId&&(u.value=u.value.filter(d=>d.id!==r.id),t.value.paramMappings=u.value,l.emit("changed"))}e.onMounted(()=>{N()}),e.watch(()=>n.communication,r=>{N()},{deep:!0});function z(r,d,b){var P;if((P=b.newValue)!=null&&P.length){const{statePath:R}=b.newValue[0];if((R==null?void 0:R.indexOf("."))>0){const w=R.split(".");d.targetVariableViewModelId=w[0],d.targetVariable=w[1]}}}function U(r){return{type:"combo-tree",textField:"name",valueField:"statePath",idField:"statePath",data:k.value,editable:!1,enableClear:!1,customRowStatus:d=>d.raw.parent?(u.value.find(P=>P.id!==r.id&&`${P.targetVariableViewModelId}.${P.targetVariable}`===d.raw.statePath)&&(d.disabled=!0),d):(d.disabled=!0,d)}}function j(r){const d=K.cloneDeep(r);d.statePath=`${d.targetVariableViewModelId}.${d.targetVariable}`;const b=U(r);let P=V.getFormSchema();if(t.value.source.formId!==C.id){const o=V.externalFormSchema.get(t.value.source.externalContainerId);o!=null&&o.content&&(P=o==null?void 0:o.content)}const{assembleSchemaFieldsByComponent:R,assembleOutline:w,assembleStateVariables:q}=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(De,{class:"col-12 mb-2",modelValue:d.sourceValue,"onUpdate:modelValue":o=>d.sourceValue=o,fieldData:R(P),formData:w(P),varData:q(P),editorType:"Default",editable:!0},null),e.createVNode(Oe,{label:"目标参数",modelValue:d.statePath,"onUpdate:modelValue":o=>d.statePath=o,customClass:"col-12 mb-2",editor:b,onChange:(o,B)=>z(o,d,B)},null),e.createVNode("div",{class:"d-flex justify-content-end"},[e.createVNode("button",{class:"btn btn-secondary mr-2",onClick:()=>G(r)},[e.createTextVNode("取消")]),e.createVNode("button",{class:"btn btn-primary",onClick:()=>a(r,d)},[e.createTextVNode("确定")])])])}l.expose({addParameter:f,closeAllParameterPanel:g});const O=e.computed(()=>r=>({"param-container":!0,"ml-3":!0,invalid:r}));return()=>u.value.length?u.value.map(r=>{const{displayText:d,displayTextTip:b}=p.value(r),P=x.value[r.targetVariable];return e.createVNode("div",{class:O.value(P)},[e.createVNode("div",{class:"selected-item position-relative"},[e.createVNode("span",{class:"form-control mr-3",title:b,onClick:()=>S(r)},[d||"请配置参数"]),P?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:R=>h(R,r,d)},null)])]),y.value[r.id]?j(r):""])}):""}}),lo=e.defineComponent({name:"FCommunicationCommandItem",props:be,emits:["addParameter","deleteCommand","toggleParameterPanel"],setup(n,l){const c=e.ref(n.communication),s=e.inject("FMessageBoxService"),t=e.inject("useFormSchema"),u=t.getFormMetadataBasicInfo(),V=e.ref([]),C=e.ref(),k=e.ref(!1),D=e.ref([]),y=e.ref(),x=e.ref(!1),p=e.ref(n.communication.paramMappings&&n.communication.paramMappings.length>0),i=e.computed(()=>{var m,r,d,b;if(!C.value)return"";const j=((m=C.value)==null?void 0:m.name)||((r=C.value)==null?void 0:r.code)||"",O=((d=y.value)==null?void 0:d.name)||((b=y.value)==null?void 0:b.code)||"";return`${j}-${O}`}),v=e.computed(()=>{var b,P,R,w,q,o;if(!C.value)return"";const j=((b=C.value)==null?void 0:b.name)||((P=C.value)==null?void 0:P.code)||"",O=((R=y.value)==null?void 0:R.name)||((w=y.value)==null?void 0:w.code)||"",m=((q=C.value)==null?void 0:q.code)||"",r=((o=y.value)==null?void 0:o.code)||"",d=C.value.containerId?`, 所属外部容器: ${C.value.containerId}`:"";return`${j} (${m}${d})
|
|
3
|
+
${O} (${r})`}),N=e.computed(()=>k.value?"目标表单已失效,请删除当前方法。":x.value?"目标命令已失效,请删除当前方法。":"");function g(){var j,O;if((O=(j=c.value)==null?void 0:j.target)!=null&&O.formId){const m=V.value.find(r=>r.id===c.value.target.formId&&r.containerId===c.value.target.externalContainerId);k.value=!m,C.value=m||{containerId:c.value.target.externalContainerId,id:c.value.target.formId,code:c.value.target.formCode}}else k.value=!1}function f(){var O,m;const j=t.externalFormSchema;Array.from(j.keys()).forEach(r=>{var b,P;const d=j.get(r);((P=(b=c.value)==null?void 0:b.source)==null?void 0:P.externalContainerId)!==r&&V.value.push({containerId:r,id:d.id,code:d.code,name:d.name})}),((m=(O=c.value)==null?void 0:O.source)==null?void 0:m.formId)!==u.id&&V.value.unshift({containerId:"",id:u.id,code:u.code,name:u.name}),g()}function h(){var j,O;if((O=(j=c.value)==null?void 0:j.target)!=null&&O.commandCode){const{commandCode:m,commandViewmodelId:r}=c.value.target,d=D.value.find(b=>b.code===m&&b.viewmodelId===r);y.value=d||{code:c.value.target.commandCode},x.value=!d}else y.value=null,x.value=!1}function S(j){var d,b;const{viewmodels:O,components:m}=j.module;if((O==null?void 0:O.length)===0||(m==null?void 0:m.length)===0)return[];D.value=[];const r=(b=(d=n.sourceCommunication)==null?void 0:d.parameterData)==null?void 0:b.getViewModelName;O.forEach(P=>{if(!P||!P.commands||P.commands.length===0)return[];const R=m.find(q=>q.viewModel===P.id),w=r&&R?r(R,P.name,j):"";D.value.push({id:P.id,code:P.code,name:w||P.name}),P.commands.forEach(q=>{q.isInvalid||D.value.push({...q,viewmodelId:P.id,isCommandNode:!0})})})}function a(){var j,O,m;if(!((j=C.value)!=null&&j.id))return[];if(C.value.id===u.id)S(t.getFormSchema());else{const r=t.externalFormSchema.get((O=C.value)==null?void 0:O.containerId);(m=r==null?void 0:r.content)!=null&&m.module&&S(r.content)}h()}e.onMounted(()=>{f(),a()}),e.watch(()=>n.communication,j=>{p.value=n.communication.paramMappings&&n.communication.paramMappings.length>0,g(),a()},{deep:!0});function G(){l.emit("addParameter")}function z(){s.question(`确定删除命令【${i.value}】吗?`,"",()=>{l.emit("deleteCommand")})}function U(){l.emit("toggleParameterPanel")}return()=>e.createVNode("div",{class:"form-container position-relative"},[i.value&&e.createVNode("div",{class:"f-page-parameter-editor-first-row"},[e.createVNode("span",{class:"f-page-parameter-editor-command-name",title:v.value},[i.value]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[k.value||x.value?e.createVNode("div",null,[e.createVNode("span",{title:N.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:j=>z()},null)]):e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-icon f-icon-home-add",title:"新增参数",style:"font-size: 11px;",onClick:G},null),p.value&&e.createVNode("div",{class:"f-icon f-icon-edit-button",title:"收折参数",onClick:()=>U()},null),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:j=>z()},null)])])])])}}),so=e.defineComponent({name:"FCombineForm",props:be,emits:["changed","deleteCommand","addCommand"],setup(n,l){const c=e.inject("useFormSchema"),{saveCommunication:s}=Ce(c),t=e.ref(n.communication),u=e.computed(()=>{var g,f,h,S;return((f=(g=t.value)==null?void 0:g.source)==null?void 0:f.componentId)&&((S=(h=t.value)==null?void 0:h.source)==null?void 0:S.event)}),V=e.ref(!0),C=e.ref(!0),k=e.ref(),D=e.ref();function y(){s(t.value),l.emit("changed",t.value)}function x(){k.value&&k.value.addParameter(),C.value=!1}function p(){l.emit("deleteCommand")}function i(){C.value=!C.value}const v=e.computed(()=>({"d-none":C.value}));function N(){k.value&&k.value.closeAllParameterPanel()}return l.expose({closeAllParameterPanel:N}),()=>e.createVNode("div",{class:"combine-form-container pb-2"},[u.value&&e.createVNode(e.Fragment,null,[e.createVNode(lo,{ref:D,communication:t.value,sourceCommunication:n.sourceCommunication,onAddParameter:x,onDeleteCommand:p,onToggleParameterPanel:i},null),V.value&&e.createVNode("div",{class:v.value},[e.createVNode(co,{ref:k,communication:t.value,onChanged:y,sourceCommunication:n.sourceCommunication},null)])])])}}),uo=e.defineComponent({name:"FSelectCommunicationCommand",props:be,emits:["selectCommand","addParameter","deleteCommand","toggleParameterPanel"],setup(n,l){const c=e.inject("useFormSchema"),s=c.getFormMetadataBasicInfo(),t=e.ref([]),u=e.ref(),V=e.ref([]),C=e.ref(),k=e.ref(!0),D=e.ref(!1);function y(){var h;const f=c.externalFormSchema;Array.from(f.keys()).forEach(S=>{var G;const a=f.get(S);((G=n.sourceCommunication)==null?void 0:G.externalContainerId)!==S&&t.value.push({containerId:S,id:a.id,code:a.code,name:a.name})}),((h=n.sourceCommunication)==null?void 0:h.formId)!==s.id&&t.value.unshift({containerId:"",id:s.id,code:s.code,name:s.name})}function x(f){var G,z;const{viewmodels:h,components:S}=f.module;if((h==null?void 0:h.length)===0||(S==null?void 0:S.length)===0)return[];V.value=[];const a=(z=(G=n.sourceCommunication)==null?void 0:G.parameterData)==null?void 0:z.getViewModelName;h.forEach(U=>{if(!U||!U.commands||U.commands.length===0)return[];const j=S.find(m=>m.viewModel===U.id),O=a&&j?a(j,U.name,f):"";V.value.push({id:U.id,code:U.code,name:O||U.name}),U.commands.forEach(m=>{m.isInvalid||V.value.push({...m,viewmodelId:U.id,isCommandNode:!0})})})}function p(){var f,h,S;if(!((f=u.value)!=null&&f.id))return[];if(u.value.id===s.id)x(c.getFormSchema());else{const a=c.externalFormSchema.get((h=u.value)==null?void 0:h.containerId);(S=a==null?void 0:a.content)!=null&&S.module&&x(a.content)}}e.onMounted(()=>{y(),p()});function i(f){u.value=f,k.value=!1,D.value=!0,p()}const v=e.computed(()=>f=>{var h,S;return{item:!0,selected:((h=u.value)==null?void 0:h.id)===f.id&&((S=u.value)==null?void 0:S.containerId)===f.containerId}}),N=e.computed(()=>f=>{var h;return{item:!0,selected:((h=C.value)==null?void 0:h.id)===f.id,"pl-4":f.isCommandNode,disabled:!f.isCommandNode}});function g(f){f.isCommandNode&&(D.value=!1,C.value=f,l.emit("selectCommand",{targetForm:u.value,targetCommand:f}))}return()=>e.createVNode("div",{class:"form-container position-relative"},[k.value&&e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标页面")]),t.value.map(f=>e.createVNode("span",{class:v.value(f),onClick:()=>i(f),title:f.containerId?`所属外部容器:${f.containerId}`:"当前页面"},[f.name]))]),D.value?e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择目标命令")]),V.value.map(f=>e.createVNode("span",{class:N.value(f),title:f.code,onClick:()=>g(f)},[f.name]))]):""])}}),mo=e.defineComponent({name:"FInteractionItem",props:Ot,emits:["addAction","delete","toggle"],setup(n,l){var Ne,ye;const{guid:c}=ce.useGuid(),s=e.inject("FMessageBoxService"),t=e.inject("useMethodsComposition"),{toggleSelectingMethod:u,emitFinalState:V,getViewModeId:C,getMethodsOnViewModel:k,getComponentList:D,updateTarget:y,updateCommandHasPath:x}=t,p=e.inject("useFormSchema"),{clearCommunicationById:i,resolveSourceControlEventTitle:v,resolveCommunication:N,createNewCommunication:g,saveCommunication:f,resolveCommunicationSource:h}=Ce(p),S=e.ref(n.controllers),a=e.ref(n.interaction),G=e.ref(!1),z=e.computed(()=>{const I=a.value.showSwitch[0];return I.showSection[I.showSwitchNumber][2]}),U=e.ref(n.sourceCommunication.needSelectSourceControl);a.value.shouldShowCommunicationPanel=a.value.shouldShowCommunicationPanel===!1?!1:!!((ye=(Ne=a.value)==null?void 0:Ne.communication)!=null&&ye.length)||U.value;const j=e.computed(()=>{var Q;const I=!!((Q=a.value.command)!=null&&Q.id),_=a.value.showSwitch[0],W=_.showSection[_.showSwitchNumber][3];return I&&W}),O=e.ref(a.value.needSelectCommunicationCommand||!1),m=e.ref(),r=e.ref(),d=e.ref(!1),b=e.ref(),P=e.ref([]);function R(){if(U.value){const I=v(a.value.communication);if(I){const{title:_,titleTip:W,isControlInvalid:Q}=I;m.value=_,r.value=Q?"源表单或事件已失效,请删除":W||_,d.value=Q}}else r.value=a.value.event.label,m.value=a.value.event.name}e.onBeforeMount(()=>{N(a.value),R(),b.value=h(a.value)||n.sourceCommunication});const w=e.computed(()=>({"f-icon":!0,"f-icon-arrow-chevron-down":j.value||a.value.shouldShowCommunicationPanel,"f-icon-arrow-chevron-left":!j.value&&!a.value.shouldShowCommunicationPanel}));function q(){var W,Q;let I=(W=a.value.command)!=null&&W.id?1:0;I=I+(((Q=a.value.communication)==null?void 0:Q.length)||0);const _=`确定删除【${m.value}】吗?`;s.question(_,"",()=>{l.emit("delete",n.displayOrder)})}function o(){var Q;const I=a.value.showSwitch[0],_=!!((Q=a.value.command)!=null&&Q.id);a.value.communication&&a.value.communication.length>0&&(a.value.shouldShowCommunicationPanel=!a.value.shouldShowCommunicationPanel),_&&(I.showSection[I.showSwitchNumber][3]=!I.showSection[I.showSwitchNumber][3],l.emit("toggle",n.displayOrder))}function B(){var Q,X;const I=!!((Q=a.value.command)!=null&&Q.id),_=a.value.communication&&a.value.communication.length>0;if(U.value){O.value=!O.value,(X=P.value)!=null&&X.length&&P.value.map(oe=>{oe.closeAllParameterPanel()});return}_&&(a.value.shouldShowCommunicationPanel=!a.value.shouldShowCommunicationPanel);const W=a.value.showSwitch[0];u(W,I),l.emit("addAction",n.displayOrder)}function A(I){const _=a.value.communication!==void 0;I===null&&a.value.command===null&&!_&&l.emit("delete",n.displayOrder),a.value.communication&&(a.value.shouldShowCommunicationPanel=z.value);const W=a.value.showSwitch[0];u(W,_)}function H(I,_,W){let Q=`${_}${W}${I}`,X=-1;const oe=k();for(;X===-1;){let le=!1;for(let de=0;de<oe.length;de++)oe[de].controllerList.forEach(ue=>{ue.label||ue.label===""?le=ue.label.toLowerCase()===Q.toLowerCase()?!0:le:le=!1});if(le)I+=1,Q=`${_}${W}${I}`;else{X=0;break}}return{newName:Q,suffix:I}}function E(I){const{method:_,controller:W}=I,{label:Q,handlerName:X,property:oe,componentLists:le,hasPath:de}=_,ue=C().replace(/-/g,"").replace("component","").replace("viewmodel",""),Me=Q.slice(0,1).toUpperCase()+Q.slice(1),{newName:Te,suffix:Be}=H(1,ue,Me),{controllerName:he}=W,Le=he.id,ke={id:c(),label:Te,name:`${_.name}${Be}`,handlerName:X,hasPath:de,cmpId:Le,property:oe,componentLists:le};a.value.command=x(W,ke),a.value.command&&p.designerMode==="PC_RTC"&&(a.value.command.isRtcCommand=!0),a.value.controller={id:he.id,label:he.label,name:he.name,isCommon:he.isCommon};const Z=a.value.showSwitch[0];Z.showSwitchNumber=2,Z.showSection[Z.showSwitchNumber][2]=!1,Z.showSection[Z.showSwitchNumber][3]=!0,G.value=!0,a.value.communication&&a.value.communication.length>0&&(a.value.shouldShowCommunicationPanel=!0),V(!1,null)}function J(){a.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},a.value.controller={label:"",name:"",id:""},V(!0,a.value.event);const I=a.value.showSwitch[0];u(I,!0)}function Y(I,_){var X;if(a.value.communication||(a.value.communication=[]),a.value.communication.find(oe=>{var le,de,ue;return((le=oe.target)==null?void 0:le.formId)===I.formId&&((de=oe.target)==null?void 0:de.externalContainerId)===I.externalContainerId&&((ue=oe.target)==null?void 0:ue.commandCode)===I.commandCode})){new ge.FNotifyService().info({position:"top-center",message:"方法已存在,请勿重复添加。"});return}let Q;a.value.communication.length===1&&!((X=a.value.communication[0].target)!=null&&X.formId)?(Object.assign(a.value.communication[0].target,I),Q=a.value.communication[0]):(Q=g(n,a.value.event.label,I,_),a.value.communication.push(Q)),V(!1,null),f(Q)}function ee(I){var W;const _=a.value.showSwitch[0];if(_.showSection[_.showSwitchNumber][2]=!1,(W=a.value.command)!=null&&W.id&&(_.showSection[_.showSwitchNumber][3]=!0),a.value.shouldShowCommunicationPanel=!0,I){const{selectedCommand:Q,selectedForm:X}=I,oe={formId:(X==null?void 0:X.id)||"",formCode:(X==null?void 0:X.code)||"",externalContainerId:(X==null?void 0:X.containerId)||"",commandCode:(Q==null?void 0:Q.code)||"",commandViewmodelId:(Q==null?void 0:Q.viewmodelId)||""};Y(oe)}}function ie(){const I=a.value.showSwitch[0];I.showSwitchNumber=2,I.showSection[I.showSwitchNumber][2]=!1,I.showSection[I.showSwitchNumber][3]=!0,G.value=!1,a.value.communication&&a.value.communication.length>0&&(a.value.shouldShowCommunicationPanel=!0),V(!1,null)}function se(){return e.createVNode(Ht,{controllers:S.value,sourceCommunication:n.sourceCommunication,onClose:A,onSelectMethod:E,onNewFunctionChanged:()=>J(),onAddCommunication:ee,haveBoundCommand:n.haveBoundCommand,iteractionDisplayOrder:n.displayOrder,onSelectBoundMethod:ie,event:a.value.event},null)}function te(){const I=a.value.showSwitch[0];I.showSection[I.showSwitchNumber][3]=!1}function ae(I){a.value.command=K.cloneDeep(I),V(!1,null)}function re(I){I.componentLists=D(),y(I),a.value.command=K.cloneDeep(I),V(!1,null)}function Ae(I){var W;const{controller:_}=a.value;_.isCommon||(W=n.viewSourceHandle)==null||W.call(n,{...I,...a.value})}function Re(){a.value.command=null,V(!1,null)}function Ue(){return e.createVNode(Wt,{command:a.value.command,controller:a.value.controller,showParameter:G.value,showDeleteIcon:a.value.communication&&a.value.communication.length>0,onConfirm:()=>te(),onChange:I=>ae(I),onTargetChange:I=>re(I),onViewSource:I=>Ae(I),onDeleteCommand:Re},null)}function Ge(I,_){a.value.communication&&a.value.communication.length>_&&(a.value.communication[_]=I,V(!1,null))}function _e(I,_){var W;a.value.communication&&a.value.communication.length>_&&(a.value.communication.splice(_,1),i(I.id),a.value.communication.length===0&&!((W=a.value.command)!=null&&W.id)?l.emit("delete",n.displayOrder):V(!1,null))}function xe(I,_){const{source:W,target:Q}=I;Y(Q,W),a.value.shouldShowCommunicationPanel=!0}function je(I,_){return e.createVNode(so,{ref:W=>{W&&(P.value[_]=W)},communication:I,event:a.value.event.label,sourceCommunication:n.sourceCommunication,onChanged:W=>Ge(W,_),onDeleteCommand:()=>_e(I,_),onAddCommand:W=>xe(W)},null)}function Ee(I){const{targetForm:_,targetCommand:W}=I,Q={formId:_.id,formCode:_.code,externalContainerId:_.containerId,commandCode:W.code,commandViewmodelId:W.viewmodelId};Y(Q,b.value),a.value.shouldShowCommunicationPanel=!0,O.value=!1,a.value.needSelectCommunicationCommand=!1}function Pe(){return e.createVNode(uo,{sourceCommunication:n.sourceCommunication,onSelectCommand:I=>Ee(I)},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:r.value},[m.value]),!d.value&&e.createVNode("div",{style:"float:right;margin:5px;"},[e.createVNode("div",{class:w.value,style:"font-size: 10px;",onClick:o},null)]),e.createVNode("div",{class:"f-icon f-icon-yxs_delete",style:"font-size: 13px;float: right; margin:8px;",onClick:q},null),!d.value&&e.createVNode("div",{class:"f-icon f-icon-home-add",style:"float:right; font-size: 10px; margin:8px;",onClick:B},null),d.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&&se(),O.value&&Pe(),j.value&&Ue(),!d.value&&a.value.shouldShowCommunicationPanel&&a.value.communication&&a.value.communication.length>0?a.value.communication.map((I,_)=>je(I,_)):""])}});function fo(n,l,c){const{interactions:s}=l,{setComponentLists:t}=Ze(),u=e.ref(n.value.internalCommandList);function V(m){s.value[m].showSwitch=[],s.value[m].showSwitch.push(K.cloneDeep({showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2})),s.value=K.cloneDeep(s.value)}function C(m){var d;const r=[];return(d=n.value.newController)==null||d.forEach(b=>{m.forEach(P=>{b.Code===P.controller.label&&r.push(K.cloneDeep(b))})}),r}function k(m){if(n.value.repititionCommand.length!==0)return n.value.repititionCommand.forEach(r=>{m.forEach(d=>{var b,P,R,w;if(r.command.id===((b=d.command)==null?void 0:b.id)){r.command.params=K.cloneDeep((P=d.command)==null?void 0:P.property);const q=(R=d.command)==null?void 0:R.targetComponent;(w=d.command)==null||w.componentLists.forEach(o=>{r.targetComponent=o.componentId===q?{id:o.componentId,viewModelId:o.viewModelId}:r.targetComponent})}})}),n.value.repititionCommand}function D(m=!1,r=null){var w;n.value.newFuncEvents=r?K.cloneDeep(r):null,n.value.isAddControllerMethod=m;const d=[],b=K.cloneDeep(n.value.internalCommandList);s.value.map(q=>{const o=K.cloneDeep(q.controller),B=K.cloneDeep(q.command),A=K.cloneDeep(q.event),H=K.cloneDeep(q.communication),E={controller:o,command:B,boundEvents:A,communication:H};d.push(K.cloneDeep(E))});const P=(w=n.value.newController)!=null&&w.length&&d.length?K.cloneDeep(C(d)):[];n.value.repititionCommand&&(n.value.repititionCommand=k(d));const R={viewModelId:n.value.viewModelId,savedCommand:K.cloneDeep(n.value.viewModel),boundEventsList:K.cloneDeep(d),events:K.cloneDeep(n.value.events),internalCommandList:K.cloneDeep(b),componentLists:[],relativePath:n.value.relativePath,envType:n.value.envType,newController:K.cloneDeep(P),isAddControllerMethod:n.value.isAddControllerMethod,repititionCommand:n.value.repititionCommand,preCommand:n.value.preCommand,newFuncEvents:n.value.newFuncEvents};c.emit("savedCommandListChanged",R)}function y(m){m.showSection[m.showSwitchNumber][2]=!0}function x(m){m.showSection[m.showSwitchNumber][2]=!1}function p(m){m.showSection[m.showSwitchNumber][3]=!0}function i(m){m.showSection[m.showSwitchNumber][3]=!1}function v(m,r=!1){m.showSection[m.showSwitchNumber][2]?(x(m),r&&p(m)):(y(m),r&&i(m))}function N(){return n.value.componentLists}function g(m){n.value.viewModel.forEach(r=>{for(let d=0;d<r.controllerList.length;d++)r.controllerList[d].label===m.label&&(r.controllerList[d]=K.cloneDeep(m))})}function f(){return n.value.viewModelId}function h(){return n.value.getEventPath?n.value.getEventPath().viewModelDisplay:[]}function S(m,r){return t(m,r,n.value)}function a(m){n.value.newController=n.value.newController||[],n.value.newController.push(K.cloneDeep(m));const r=n.value.newController;for(let d=0;d<r.length;d++)for(let b=d+1;b<r.length;b++)r[d].Id===r[b].Id&&(r.splice(b,1),b--)}function G(m){let r=!1;return n.value.internalCommandList.forEach(d=>{if(d.controllerName.label===m.controllerName.label){r=!0;return}}),r||n.value.internalCommandList.push(m),r}function z(){var m;if((m=n.value)!=null&&m.getEventPath)return n.value.getEventPath()}function U(m,r){s.value.forEach(d=>{var b;((b=d.command)==null?void 0:b.label)===r.label&&(d.command=r)})}function j(m,r){U(m,r)}function O(m,r){const d=s.value[r];m.event=m.event.label?m.event:K.cloneDeep(d.event);let b=!1;n.value.repititionCommand||(n.value.repititionCommand=[]),n.value.repititionCommand.forEach(w=>{w.command.id===m.command.id&&w.event.label===m.event.label&&w.targetComponent.viewModelId===m.targetComponent.viewModelId&&(b=!0),w.command.id===m.command.id&&w.event.label===m.event.label&&w.targetComponent.viewModelId!==m.targetComponent.viewModelId&&(w=K.cloneDeep(m))}),b||n.value.repititionCommand.push(K.cloneDeep(m));let P={id:m.command.id,label:m.command.label,name:m.command.name,handlerName:m.command.handlerName,cmpId:m.controller.id,componentLists:[],hasPath:!1,targetComponent:m.targetComponent.id,property:K.cloneDeep(m.command.params),shortcut:{},isRtcCommand:m.command.isRtcCommand,isNewGenerated:m.command.isNewGenerated||!1,isInvalid:!1};const R={controllerName:m.controller};P=t(R,P,n.value),d.command=K.cloneDeep(P),d.controller=K.cloneDeep(m.controller),j(d,P)}return{controllers:u,onClosed:V,emitFinalState:D,toggleSelectingMethod:v,getViewModeId:f,getComponentList:N,updateTarget:g,updateCommandHasPath:S,addNewController:a,checkIfNewControllerExists:G,getMethodsOnViewModel:h,getEventPath:z,selectBoundCommand:O}}const Se=e.defineComponent({name:"FEventsEditor",props:qe,emits:["savedCommandListChanged"],setup(n,l){const c=e.ref(n.initialData),s=e.inject("designer-host-service"),t=Lt(c),{loadEvents:u,resetBoundEvents:V}=t,C=e.inject("useFormSchema"),k=Bt(C,t),{addNewInteraction:D,deleteInteracton:y,interactions:x,loadInteractions:p}=k,i=fo(c,k,l),{emitFinalState:v,controllers:N}=i;e.provide("useEventsComposition",t),e.provide("useInteractionCompostion",k),e.provide("useMethodsComposition",i);function g(){c.value.isAddControllerMethod=!1}function f(){var j,O;const U=(O=(j=c.value)==null?void 0:j.sourceCommunication)==null?void 0:O.externalContainerId;if(U){const{assembleSourceOutline:m}=Ce(C),r=m(s,l,U);e.provide("sourceOutlineData",r)}}e.onMounted(()=>{g(),V(),u(),p(),f()});function h(U){y(U),v(!1,null)}function S(U,j){const O=U.showSwitch[0],m=O.showSection[O.showSwitchNumber][3];let r=!1;return n.initialData.getEventPath&&(n.initialData.getEventPath().actionWithPath.length!==0?r=!0:r=!1),e.createVNode(mo,{key:`${j}`,controllers:N.value,interaction:U,displayOrder:j,collapsed:m,onDelete:h,sourceCommunication:c.value.sourceCommunication,viewSourceHandle:n.viewSourceHandle,haveBoundCommand:r},null)}function a(){var U;return(U=x.value)==null?void 0:U.map((j,O)=>{var r;let m=j.event.label;return(r=j.communication)!=null&&r.length&&(m=`${j.communication.map(b=>b.id).join("-")}_${m}`),e.createVNode("div",{class:"events-display-order",key:`${m}_${O}`},[S(j,O)])})}function G(U){D(U)}function z(U){const j=U.source;if(x.value.find(m=>{var r;if((r=m.communication)!=null&&r.length&&m.communication.find(b=>{var P,R,w;return((P=b.source)==null?void 0:P.formId)===j.formId&&((R=b.source)==null?void 0:R.componentId)===j.componentId&&((w=b.source)==null?void 0:w.event)===j.event}))return!0})){new ge.FNotifyService().info({position:"top-center",message:"事件已存在,请勿重复添加。"});return}D({label:"onCommunication",name:"组件通讯"},U)}return()=>e.createVNode("div",{class:"f-page-events-editor"},[e.createVNode("div",{class:"f-page-events-editor-content"},[e.createVNode(qt,{sourceCommunication:c.value.sourceCommunication,onClickEventItem:G,onSelectSourceControl:z},null),a()])])}}),po={install(n){n.component(Se.name,Se)},register(n,l,c,s){n["events-editor"]=Se,l["events-editor"]=Xe}};F.FEventsEditor=Se,F.default=po,F.eventsEditorProps=qe,F.propsResolver=Xe,Object.defineProperties(F,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -886,6 +886,11 @@ const it = /* @__PURE__ */ new Map([
|
|
|
886
886
|
description: "清空事件",
|
|
887
887
|
type: "string",
|
|
888
888
|
default: ""
|
|
889
|
+
},
|
|
890
|
+
onDataChanged: {
|
|
891
|
+
description: "清空事件",
|
|
892
|
+
type: "string",
|
|
893
|
+
default: ""
|
|
889
894
|
}
|
|
890
895
|
}, Jn = [
|
|
891
896
|
"type"
|
|
@@ -1259,7 +1264,7 @@ function oa(e, t) {
|
|
|
1259
1264
|
d !== s && (a.value = s, u(s));
|
|
1260
1265
|
});
|
|
1261
1266
|
function b(s) {
|
|
1262
|
-
l.value = s;
|
|
1267
|
+
l.value = s, t.emit("dataChanged", s);
|
|
1263
1268
|
}
|
|
1264
1269
|
function T() {
|
|
1265
1270
|
return l.value;
|
|
@@ -1285,7 +1290,7 @@ function oa(e, t) {
|
|
|
1285
1290
|
const ue = /* @__PURE__ */ G({
|
|
1286
1291
|
name: "FComboList",
|
|
1287
1292
|
props: be,
|
|
1288
|
-
emits: ["clear", "update:modelValue", "change", "input"],
|
|
1293
|
+
emits: ["clear", "update:modelValue", "change", "input", "dataChanged"],
|
|
1289
1294
|
setup(e, t) {
|
|
1290
1295
|
const n = c(), a = c(), l = c(e.disabled || e.readonly), o = c(e.enableClear), i = c(e.enableSearch), u = c(e.readonly), {
|
|
1291
1296
|
dataSource: f,
|
|
@@ -6681,7 +6686,7 @@ function Nl(e, t, n) {
|
|
|
6681
6686
|
const Il = /* @__PURE__ */ G({
|
|
6682
6687
|
name: "FButtonEdit",
|
|
6683
6688
|
props: yl,
|
|
6684
|
-
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue", "beforeClearValue"],
|
|
6689
|
+
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue", "beforeClearValue", "shown"],
|
|
6685
6690
|
setup(e, t) {
|
|
6686
6691
|
const n = c(), a = c(e.customClass), l = c(e.modelValue), o = Bl(e, t, n, l), {
|
|
6687
6692
|
shouldPopupContent: i,
|