@farris/ui-vue
Version:
Farris Vue, a Farris Design based Vue3 component library.
2 lines • 109 kB
JavaScript
(function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("../dynamic-resolver/index.umd.js"),require("lodash-es"),require("../common/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../notify/index.umd.js"),require("../tree-view/index.umd.js"),require("../schema-selector/index.umd.js"),require("../modal/index.umd.js"),require("../input-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../event-parameter/index.umd.js"),require("../locale/index.umd.js"),require("../dynamic-view/index.umd.js"),require("../section/index.umd.js"),require("../accordion/index.umd.js"),require("../../designer/avatar/index.umd.js"),require("../../designer/approval-logs/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../button/index.umd.js"),require("../calendar/index.umd.js"),require("../../designer/capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../table/index.umd.js"),require("../../designer/date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../../designer/dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../../designer/list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../../designer/nav/index.umd.js"),require("../number-range/index.umd.js"),require("../../designer/number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../../designer/rate/index.umd.js"),require("../../designer/response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../../designer/response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../../designer/section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../../designer/switch/index.umd.js"),require("../../designer/tabs/index.umd.js"),require("../../designer/tags/index.umd.js"),require("../text/index.umd.js"),require("../../designer/time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../../designer/textarea/index.umd.js"),require("../../designer/tree-grid/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../../designer/drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../collection-property-editor/index.umd.js"),require("../../designer/modal/index.umd.js"),require("../external-container/index.umd.js"),require("../language-textbox/index.umd.js"),require("../image/index.umd.js"),require("../comment/index.umd.js"),require("../../designer/wizard/index.umd.js"),require("../tooltip/index.umd.js"),require("../property-panel/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../dynamic-resolver/index.umd.js","lodash-es","../common/index.umd.js","../designer-canvas/index.umd.js","../notify/index.umd.js","../tree-view/index.umd.js","../schema-selector/index.umd.js","../modal/index.umd.js","../input-group/index.umd.js","../combo-list/index.umd.js","../event-parameter/index.umd.js","../locale/index.umd.js","../dynamic-view/index.umd.js","../section/index.umd.js","../accordion/index.umd.js","../../designer/avatar/index.umd.js","../../designer/approval-logs/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../button/index.umd.js","../calendar/index.umd.js","../../designer/capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../table/index.umd.js","../../designer/date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../../designer/dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../../designer/list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../../designer/nav/index.umd.js","../number-range/index.umd.js","../../designer/number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../../designer/rate/index.umd.js","../../designer/response-toolbar/index.umd.js","../response-layout/index.umd.js","../../designer/response-layout-editor/index.umd.js","../search-box/index.umd.js","../../designer/section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../../designer/switch/index.umd.js","../../designer/tabs/index.umd.js","../../designer/tags/index.umd.js","../text/index.umd.js","../../designer/time-picker/index.umd.js","../transfer/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../../designer/textarea/index.umd.js","../../designer/tree-grid/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../../designer/drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../collection-property-editor/index.umd.js","../../designer/modal/index.umd.js","../external-container/index.umd.js","../language-textbox/index.umd.js","../image/index.umd.js","../comment/index.umd.js","../../designer/wizard/index.umd.js","../tooltip/index.umd.js","../property-panel/index.umd.js"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w["events-editor"]={},w.Vue,w.dynamicResolver,w.LodashES,w.common,w.designerCanvas,w.notify,w.FTreeview,w.FSchemaSelector,w.modal,w.FInputGroup,w.FComboList,w.FEventParameter,w.locale,w.dynamicView,w.FSection,w.FAccordion,w.FAvatar,w.FApprovalLogs,w.FButtonEdit,w.FButtonGroup,w.FButton,w.FCalendar,w.FCapsule,w.FCheckbox,w.FCheckboxGroup,w.FComboTree,w.FComponent,w.FColorPicker,w.FContentContainer,w.FTable,w.FDatePicker,w.FDataGrid,w.FDropdown,w.FDynamicForm$1,w.FEventsEditor$1,w.FFilterBar,w.FFieldSelector,w.FBindingSelector,w.FImageCropper,w.FInputGroup$1,w.FLayout,w.FListNav,w.FListView,w.FLookup,w.FMappingEditor,w.FNav,w.FNumberRange,w.FNumberSpinner,w.FOrder,w.FPageHeader,w.FPageFooter,w.FPagination,w.FProgress,w.FQuerySolution,w.FRadioGroup,w.FRate,w.FResponseToolbar,w.FResponseLayout,w.FResponseLayoutEditorSetting,w.FSearchBox,w.FSection$1,w.FSmokeDetector,w.FSplitter,w.FStep,w.FSwitch,w.FTabs,w.FTags,w.FText,w.FTimePicker,w.FTransfer,w.FUploader,w.FVerifyDetail,w.FVideo,w.FTextArea,w.FTreeGrid,w.FFilterConditionEditor,w.FFieldset,w.FSortConditionEditor,w.FMenuLookup,w.FDrawer,w.FJsonEditor,w.FPropertyEditor,w.FExpressionEditor,w.FCodeEditor,w.FHtmlTemplate,w.FCollectionPropertyEditor,w.FModal,w.FExternalContainer,w.FLanguageTextbox,w.FImage,w.FComment,w.FWizard,w.FTooltip))})(this,function(w,e,ie,J,fe,cn,Fe,We,Ke,sn,dn,Qe,Ge,Je,be,un,mn,fn,pn,hn,gn,vn,Cn,bn,Ye,Xe,yn,Nn,wn,Fn,Vn,Sn,xn,jn,En,Pn,Mn,Tn,kn,Ln,Bn,In,$n,qn,Dn,On,An,Rn,Un,Hn,Gn,_n,zn,Wn,Kn,Qn,Jn,Yn,Xn,Zn,et,nt,tt,ot,at,rt,it,lt,ct,st,dt,ut,mt,ft,pt,ht,gt,vt,Ct,bt,yt,Nt,wt,Ft,Vt,St,xt,jt,Et,Pt,Mt,Tt,kt,Lt){"use strict";var Vo=Object.defineProperty;var So=(w,e,ie)=>e in w?Vo(w,e,{enumerable:!0,configurable:!0,writable:!0,value:ie}):w[e]=ie;var He=(w,e,ie)=>So(w,typeof e!="symbol"?e+"":e,ie);const Bt=new Map([["appearance",ie.resolveAppearance]]);function It(n,a,l){return a}const $t={$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"]},qt={title:"events-editor",description:"A Farris Component",type:"object",categories:{}},Ze=[{label:"pageChange",name:"MockMock切换页码"},{label:"pageSizeChanged",name:"Mock分页条数变化事件"},{label:"scrollYLoad",name:"Mock滚动加载事件"},{label:"onEditClicked",name:"Mock操作列点击编辑"},{label:"onDeleteClicked",name:"Mock操作列点击删除"}],_e={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:Ze,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:Ze,boundEventsList:[]})}},viewSourceHandle:{type:Function,default:()=>{}}},en=ie.createPropsResolver(_e,$t,Bt,It,qt);function nn(){function n(l,c){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 s=-1;const y=t.findIndex(b=>l===b.controllerId);return y!==-1&&(s=t[y].commands.findIndex(b=>c===b.handlerName)),s!==-1}function a(l,c,t){const s=n(l.controllerName.id,c.handlerName);return t.componentLists.length!==0&&s&&(c.hasPath=!0,c.targetComponent=c.targetComponent||t.componentLists[0].componentId,c.componentLists=J.cloneDeep(t.componentLists)),c}return{isContextDependent:n,setComponentLists:a}}var ye=(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.table="table",n))(ye||{});function Dt(n,a){const l=e.inject("designerContext"),c=l&&l.dgControl?l.dgControl:cn.DgControl,t=e.ref(""),s=e.ref("");function y(o){var p,v,F,r;let f="controlIcon fd-i-Family ",V="";switch(o==null?void 0:o.type){case"form-group":{V=((p=c[o.type])==null?void 0:p.icon)||((v=o.editor)==null?void 0:v.type)||"",(F=c[o.editor.type])!=null&&F.icon&&(V=c[o.editor.type].icon);break}default:V=((r=c[o.type])==null?void 0:r.icon)||o.type}const g=`fd_pc-${V}`;return f+=g,f}function b(o,f){var p;let V=o.id;const g=f==null?void 0:f.contents;if((f==null?void 0:f.type)==="splitter"&&g&&g.length===2){const v=f.direction!=="column";o.id===((p=g[0])==null?void 0:p.id)?V=v?"左侧区域":"上方区域":V=v?"右侧区域":"下方区域"}return V}function T(o){if(o.isLikeCardContainer)return"区块";const f=o.appearance&&o.appearance.class||"",V=f.split(" ");return o.id==="page-header"&&f&&f==="f-page-header"?"页头":V.includes("f-page-header-base")?"页头容器":V.includes("f-page-header-extend")?"页头扩展容器":V.includes("f-title")?"标题容器":V.includes("f-page")?"根容器":V.includes("f-page-main")?"内容区域":V.includes("f-scrollspy-content")&&o.isScrollspyContainer?"滚动监听容器":V.includes("f-grid-is-sub")?"表格容器":V.includes("f-filter-container")?"筛选条容器":"容器"}function $(o){const{componentType:f}=o;switch(f){case ye.Frame:return"根组件";case ye.dataGrid:return(n==null?void 0:n.formSchemaUtils.selectNode(o,g=>g.type===(c["tree-grid"]&&c["tree-grid"].type)))?"树表格组件":"表格组件";case ye.uploader:return"附件组件";case ye.listView:return"列表视图组件";case ye.form:return"卡片组件";case ye.calendar:return"日历组件";case ye.table:return"表格布局组件";case ye.page:return o.name||"页面";default:return"组件"}}function E(o,f){const V=o.name||o.text||o.label||o.title||o.mainTitle;if(o.type!=="component"&&V&&typeof V=="string")return V.trim();switch(o.type){case"content-container":return T(o);case"splitter-pane":return b(o,f);case"component":return $(o);default:return c[o.type]&&c[o.type].name||o.id}}function S(o,f){const V=o.length?o[0]:null;if(!V)return;s.value="",t.value=V.originalId;const g=V?`${V.originalId}-design-item`:"",p=document.getElementById(g);p&&p.click(),a.emit("selectionChanged",V)}function u(o){if(!o)return;const f=`${o}-design-item`,V=document.getElementById(f);V&&V.click()}return{getIcon:y,getTitle:E,onChanged:S,currentSelectedNodeId:t,currentSelectedOutsideNodeId:s,triggerOutsideClick:u}}function Ot(n,a,l=!1){const{getIcon:c,getTitle:t}=a;function s(S,u,o,f,V){var p;const g=(p=n.data.module)==null?void 0:p.components.find(v=>v.id===S.component);g&&y([g],u,o,f,V)}function y(S,u,o,f,V){return S.forEach(g=>{var v,F;if(g.type==="component"&&(V=g.id),g.type==="component-ref"){s(g,u,o,f,V);return}const p={originalId:g.id,layer:o,originalParent:f==null?void 0:f.id,componentId:V,name:t(g,f),type:g.type,controlIcon:c(g),rawSchema:g};u.push(J.cloneDeep(p)),(g.contents||g.buttons)&&y(g.contents||g.buttons,u,o+1,g,V),l&&(F=(v=g.toolbar)==null?void 0:v.buttons)!=null&&F.length&&y(g.toolbar.buttons,u,o+1,g,V)}),u}function b(S){const u=[],o=S.find(p=>p.layer===0);S=S.filter(p=>p.layer!==0),u.push(o);let f=o.originalId,V=0,g=1e3;for(;S.length!==0||g===0;){const p=S.find(v=>v.originalParent===f);p?(u.push(p),f=p.originalId,S=S.filter(v=>v.originalId!==f),V=0):(V-=1,f=u.slice(V)[0].originalId),g-=1}return u}function T(S){return S.forEach((u,o)=>{u.id=(o+1).toString()}),S.forEach(u=>{var o;u.parent=((o=S.find(f=>f.originalId===u.originalParent))==null?void 0:o.id)||""}),S.forEach(u=>{u.hasChildren=S.findIndex(o=>o.parent===u.id)>0}),S}function $(S){const u={originalId:n.data.module.id,layer:0,originalParent:null,name:"页面",type:"module",controlIcon:"controlIcon fd-i-Family fd_pc-module",rawSchema:n.data.module},o=[];return S.forEach(f=>{f[0].originalParent=u.originalId,o.push(...f)}),o.unshift(u),o}function E(){const S=n.data.module?e.ref(n.data.module.components):e.ref([n.data]);if(!S.value)return;const u=[];S.value.forEach(g=>{if(g){const p=[];p.push(g);const r=y(p,[],1,null,g.id);u.push(r)}});const o=$(u),f=b(o);return T(f)}return{getData:E}}function Se(n){const a=e.inject("sourceOutlineData")||[],l=e.ref(),c=e.ref(!1),t=e.ref([]),s=e.ref();function y(g,p,v,F){var r,_,z,R;return{id:fe.useGuid().guid(),source:F||{formId:(r=g.sourceCommunication)==null?void 0:r.formId,formCode:(_=g.sourceCommunication)==null?void 0:_.formCode,componentId:(z=g.sourceCommunication)==null?void 0:z.componentId,externalContainerId:(R=g.sourceCommunication)==null?void 0:R.externalContainerId,event:p||"onCommunication"},target:{formId:(v==null?void 0:v.formId)||"",formCode:(v==null?void 0:v.formCode)||"",externalContainerId:(v==null?void 0:v.externalContainerId)||"",commandCode:(v==null?void 0:v.commandCode)||"",commandViewmodelId:(v==null?void 0:v.commandViewmodelId)||""},paramMappings:[]}}function b(g){var p,v;(p=g==null?void 0:g.communication)!=null&&p.length&&((v=g==null?void 0:g.communication)==null||v.map(F=>{var r,_;if(F!=null&&F.id&&!((r=F==null?void 0:F.source)!=null&&r.componentId)){const z=(_=n.getFormSchema().module.communications)==null?void 0:_.find(R=>R.id===(F==null?void 0:F.id));z&&Object.assign(F,z)}}))}function T(g){const p=n.getFormSchema(),{communications:v}=p.module;v||(p.module.communications=[]);const F=p.module.communications.findIndex(r=>r.id===g.id);F===-1?p.module.communications.push(g):Object.assign(p.module.communications[F],g)}function $(g){var p;if((p=g==null?void 0:g.communication)!=null&&p.length){const v=n.getFormSchema();g.communication.map(F=>{v.module.communications&&F&&(v.module.communications=v.module.communications.filter(r=>r.id!==F.id))}),g.communication=[]}}function E(g){var v;const p=n.getFormSchema();g&&((v=p.module.communications)!=null&&v.length)&&(p.module.communications=p.module.communications.filter(F=>F.id!==g))}function S(g,p,v){const F=Dt(g,p),r=n.externalFormSchema.get(v);if(r!=null&&r.content){const _={data:r.content},{getData:z}=Ot(_,F,!0);return z()}return[]}function u(g){var v;if(!((v=g==null?void 0:g.source)!=null&&v.componentId)){c.value=!1;return}const p=a.find(F=>F.originalId===g.source.componentId);p?(c.value=!1,l.value=p):(c.value=!0,l.value={id:g.source.componentId})}function o(g){var F,r,_;t.value=[];const p=(F=l.value)==null?void 0:F.rawSchema;if(!p){s.value=null;return}const v=n.resolveComponentEvents(ie.schemaMap,p);v&&Object.keys(v).forEach(z=>{t.value.push({eventCode:z,eventName:v[z]})}),(r=g.source)!=null&&r.event&&((_=t.value)!=null&&_.length)&&(s.value=t.value.find(z=>{var R;return z.eventCode===((R=g.source)==null?void 0:R.event)}))}function f(g){var F,r,_,z,R,B,q,d;if(!(g!=null&&g.length))return;u(g[0]),o(g[0]);let p="",v="";return c.value?p=`${((F=g[0].source)==null?void 0:F.componentId)||""}-${((r=g[0].source)==null?void 0:r.event)||""}`:(p=(_=l.value)==null?void 0:_.name,p&&((z=s.value)!=null&&z.eventName)&&(p+=`-${(R=s.value)==null?void 0:R.eventName}`),v=`${(B=l.value)==null?void 0:B.name} (${(q=l.value)==null?void 0:q.originalId})`,v=`${v}
${(d=s.value)==null?void 0:d.eventName} (${s.value.eventCode})`),{title:p,titleTip:v,isControlInvalid:c.value}}function V(g){var p;if((p=g==null?void 0:g.communication)!=null&&p.length){const v=g==null?void 0:g.communication[0];return v==null?void 0:v.source}}return{createNewCommunication:y,resolveCommunication:b,clearAllCommunication:$,clearCommunicationById:E,saveCommunication:T,assembleSourceOutline:S,resolveSourceControlEventTitle:f,resolveCommunicationSource:V}}function At(n,a,l){const c=e.ref([]),{boundEvents:t,unBoundEvent:s}=a;function y(u){var f,V;return{event:{label:(f=u.boundEvents)==null?void 0:f.label,name:(V=u.boundEvents)==null?void 0:V.name},showSwitch:[{showSection:[[!1,!1,!1,!1,!1],[!1,!1,!0,!1,!1],[!1,!0,!1,!0,!1]],showSwitchNumber:2}],command:J.cloneDeep(u.command),controller:J.cloneDeep(u.controller),communication:u.communication}}function b(){var u;c.value=(u=t.value)==null?void 0:u.map(o=>y(o))}function T(u,o){const V=y({boundEvents:u,command:null,controller:{id:"",name:"",label:""},communication:o?[o]:[]});if(o){V.showSwitch[0].showSwitchNumber=2,V.showSwitch[0].showSection[2][2]=!1,V.showSwitch[0].showSection[2][3]=!1,V.needSelectCommunicationCommand=!0,c.value.unshift(V);return}u&&(V.showSwitch[0].showSwitchNumber=1,V.showSwitch[0].showSection[2][3]=!0,c.value.unshift(V))}function $(){var u;(u=c.value)==null||u.forEach(o=>{o.showSwitch.forEach(f=>{f.showSection[2][3]=!1}),o.shouldShowCommunicationPanel=!1})}function E(u){c.value[u].showSwitch.forEach(o=>{o.showSection[2][3]=!o.showSection[2][3]})}function S(u){if(u>=0&&u<=c.value.length-1){const o=c.value[u];s(o.event),c.value.splice(u,1);const{clearAllCommunication:f}=Se(n);f(o)}}return{addNewInteraction:T,collapseInteractions:$,deleteInteracton:S,toggleMethodInInteraction:E,interactions:c,loadInteractions:b}}function Rt(n){const a=e.ref([]),l=e.ref([]),c=e.ref([]),{isContextDependent:t}=nn();function s(){const{allComponentList:u}=n.value;n.value.componentLists.length&&n.value.viewModel&&n.value.viewModel.forEach(o=>{o.controllerList.forEach(f=>{if(f.targetComponent){const V=u.find(p=>p.componentId===f.targetComponent);if((V?V.viewModelId:void 0)===n.value.viewModelId)f.hasPath=!1;else{const p=t(o.controllerName.id,f.handlerName);f.hasPath=p?!0:f.hasPath,f.componentLists=p?J.cloneDeep(n.value.componentLists):f.componentLists}}})}),n.value.componentLists.length&&n.value.boundEventsList&&n.value.boundEventsList.forEach(o=>{var f;if((f=o.command)!=null&&f.targetComponent){const V=u.find(p=>{var v;return p.componentId===(((v=o.command)==null?void 0:v.targetComponent)||"")});if((V?V.viewModelId:void 0)===n.value.viewModelId)o.command.hasPath=!1;else{const p=t(o.controller.id,o.command.handlerName);o.command.hasPath=p?!0:o.command.hasPath,o.command.componentLists=p?J.cloneDeep(n.value.componentLists):o.command.componentLists}}})}function y(){const u=l.value.reduce((f,V)=>(f.set(V.boundEvents.label,!0),f),new Map);return a.value.filter(f=>!u.has(f.label))}function b(){var o;const u=((o=l.value)==null?void 0:o.length)>0;c.value=u?y():a.value}function T(){s(),a.value=n.value.events,l.value=n.value.boundEventsList,b()}function $(u){c.value=c.value.filter(o=>o.label!==u.label)}function E(u){l.value=l.value.filter(o=>o.boundEvents.label!==u.label),b()}function S(){var f;const u=(f=n.value)==null?void 0:f.getEventList(),{events:o}=u;u&&(n.value.events=J.cloneDeep(o),n.value.boundEventsList=u.boundEventsList),n.value.boundEventsList&&(n.value.boundEventsList=n.value.boundEventsList.filter(function(V){return o.find(g=>g.label===V.boundEvents.label)}))}return{allEvents:a,boundEvents:l,candidateEvents:c,excludeFromCandidates:$,loadEvents:T,resetBoundEvents:S,unBoundEvent:E}}const Ut={sourceCommunication:{type:Object,default:{}}},Ht={events:{type:Array,default:[]}},Gt=e.defineComponent({name:"FEventList",props:Ht,emits:["click"],setup(n,a){const l=e.ref(n.events);function c(s){a.emit("click",s)}function t(s){return e.createVNode("div",{class:"f-page-events-editor-first-bound-event"},[e.createVNode("div",{onClick:()=>c(s),class:"f-page-events-editor-first-bound-event-name"},[s.name])])}return()=>e.createVNode("div",{class:"f-page-events-editor-events"},[l.value.map(s=>t(s))])}}),xe={communication:{type:Object},sourceCommunication:{type:Object,default:{}},event:{type:String,default:""}},_t=e.defineComponent({name:"FSelectSourceControl",props:xe,emits:["selectSourceEvent","deleteControl"],setup(n,a){const l=e.inject("useFormSchema"),{createNewCommunication:c}=Se(l),t=e.ref();t.value=c(n);const s=e.ref([{field:"name",title:"",dataType:"string"}]),y=e.ref([]),b=e.ref(),T=e.ref(),$=e.ref(!0),E=e.ref(!1),S=e.ref([]),u=e.ref(),o=e.ref(!0),f=e.ref(!1);function V(){const B=e.inject("sourceOutlineData");y.value=B||[],T.value.updateDataSource(y.value)}function g(){var q,d,i;if(!((d=(q=t.value)==null?void 0:q.source)!=null&&d.componentId)){f.value=!1;return}const B=(i=y.value)==null?void 0:i.find(m=>m.originalId===t.value.source.componentId);B?(T.value.selectItemById(B.id),f.value=!1):(f.value=!0,b.value={id:t.value.source.componentId})}function p(){var B,q,d;(q=(B=t.value)==null?void 0:B.source)!=null&&q.event&&((d=S.value)!=null&&d.length)&&(u.value=S.value.find(i=>{var m,C;return i.eventCode===((C=(m=t.value)==null?void 0:m.source)==null?void 0:C.event)}))}e.onMounted(()=>{V(),g(),p(),o.value=!1});function v(){S.value=[];const B=b.value.rawSchema,q=l.resolveComponentEvents(ie.schemaMap,B);q&&Object.keys(q).forEach(d=>{S.value.push({eventCode:d,eventName:q[d]})})}function F(B){$.value=!1,f.value=!1;const q=b.value!==B[0];q&&(b.value=B[0],v()),o.value||(E.value=!0),!o.value&&q&&(u.value=null)}const r=e.computed(()=>({"item-list":!0,"d-none":!$.value})),_=e.computed(()=>B=>{var q;return{item:!0,selected:((q=u.value)==null?void 0:q.eventCode)===B}});function z(B){var q;$.value=!1,E.value=!1,u.value=B,t.value.source.componentId=b.value.rawSchema.id,t.value.source.event=(q=u.value)==null?void 0:q.eventCode,a.emit("selectSourceEvent",t.value)}const R=e.computed(()=>({"form-container":!0,"position-relative":!0,invalid:f.value}));return()=>e.createVNode("div",{class:R.value},[e.createVNode("div",{class:r.value,style:"min-height:220px;"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择源控件")]),e.createVNode("div",{style:"overflow:auto;flex:1;display:block"},[e.createVNode(We.FTreeView,{ref:T,autoExpandWidth:!0,data:y.value,columns:s.value,columnOption:{fitColumns:!0,fitMode:"expand"},showTreeNodeIcons:!0,fit:!1,autoHeight:!0,iconField:"controlIcon",onSelectionChange:F},null)])]),E.value&&e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"item-list"},[e.createVNode("span",{class:"tip"},[e.createTextVNode("请选择事件")]),S.value.map(B=>e.createVNode("span",{class:_.value(B.eventCode),onClick:()=>z(B)},[B.eventName]))])])])}}),zt=e.defineComponent({name:"FInteractionButton",props:Ut,emits:["clickEventItem","selectSourceControl"],setup(n,a){const l=new Fe.FNotifyService,c=e.inject("useEventsComposition"),t=e.inject("useInteractionCompostion"),{candidateEvents:s}=c,{collapseInteractions:y}=t,b=e.ref(!1),T=e.ref(!1);function $(f){s.value=s.value.filter(V=>V.label!==f.label)}function E(){var f;(f=n.sourceCommunication)!=null&&f.needSelectSourceControl?T.value=!T.value:b.value=!b.value}function S(f){E(),$(f),a.emit("clickEventItem",f)}function u(){var f;if(!((f=n.sourceCommunication)!=null&&f.needSelectSourceControl)&&s.value.length===0){l.info({position:"top-center",message:"事件已全部绑定"});return}y(),E()}function o(f){T.value=!1,a.emit("selectSourceControl",f)}return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:"f-page-events-editor-top-button"},[e.createVNode("button",{class:"f-page-events-editor-button",onClick:u},[e.createVNode("span",{class:"f-page-events-editor-text"},[e.createTextVNode("新建交互事件")])])]),b.value&&e.createVNode(Gt,{events:s.value,onClick:S},null),T.value&&e.createVNode(_t,{sourceCommunication:n.sourceCommunication,onSelectSourceEvent:o},null)])}}),Wt={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}},Kt={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:{}}},Qt={controllers:{type:Array,default:[]}},Jt=e.defineComponent({name:"FCommandList",props:Qt,emits:["selectMethod"],setup(n,a){function l(b){return b.controllerList.length!==0}function c(b){return l(b)&&e.createVNode("div",{class:"f-page-internals-controller"},[e.createVNode("div",{class:"f-page-internals-controller-name",title:b.controllerName.name},[b.controllerName.name])])}function t(b,T){a.emit("selectMethod",{method:b,controller:T})}function s(b){return b.controllerList.map(T=>e.createVNode("div",{class:"f-page-internals-command",onClick:()=>t(T,b)},[e.createVNode("div",{class:"f-page-internals-command-name",title:T.label},[T.name])]))}function y(b){return e.createVNode("div",null,[c(b),s(b)])}return()=>e.createVNode("div",{class:"f-page-internals"},[n.controllers.map(b=>y(b))])}}),Yt={getEventPath:{type:Function,default:null},notifyService:{type:Object},useFormSchema:{type:Object},sourceCommunication:{type:Object,default:{}},event:{Type:Object}},Xt=e.defineComponent({name:"FBoundEventSelector",props:Yt,emits:["cancel","submit"],setup(n,a){var x,A;const l=e.ref(),c=e.ref([]),t=e.ref('<i class="f-icon f-icon-search"></i>'),s=n.useFormSchema.getFormMetadataBasicInfo(),y=e.ref(""),b=e.ref(),T=((x=n.sourceCommunication)==null?void 0:x.unSupportedEventCodes)||[],$=e.ref(!T.includes(n.event.label)&&((A=n.useFormSchema.externalFormSchema)==null?void 0:A.size)>0),E=e.ref(),S=e.ref([]);e.onBeforeMount(()=>{if(n.getEventPath){const N=n.getEventPath();l.value=N.viewModelDisplay;const{actionWithPath:D}=N;D.forEach(O=>{O.sourceComponent.map.forEach(W=>{W.active=!1,W.hide=!1})}),c.value=J.cloneDeep(D)}});function u(N=""){N=N.replace(/ /g,"").replace(/>/g,"").toLowerCase(),N===""&&(N=" "),c.value.forEach(D=>{const O=D.path;D.sourceComponent.map.forEach(W=>{const X=W.command.name,ae=W.event.name,k=W.command.label;`${O}${X}${ae}${k}`.toLowerCase().includes(N)?W.hide=!1:W.hide=!0})})}function o(N=""){N=N.replace(/ /g,"").replace(/>/g,"").toLowerCase(),S.value.forEach(D=>{if(!D.isCommandNode)return;const O=D.name||"",W=D.code||"",X=D.viewmodelName||"",ae=`${O}${W}${X}`.toLowerCase();N&&!ae.includes(N)?D.hide=!0:D.hide=!1})}function f(N=""){!E.value||E.value.id===s.id?u(N):o(N)}function V(){const N=e.createVNode("div",{class:"f-vm-search"},[e.createVNode("div",{class:"f-vm-searchBar"},[e.createVNode(dn,{updateOn:"change",groupText:t.value,modelValue:y.value,"onUpdate:modelValue":D=>y.value=D,onChange:f,placeholder:"请输入名称/编号/路径搜索"},null)])]);return $.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"},[N])])]):N}function g(N){return{"f-vm-item":!0,"f-vm-item-focus":N.active}}function p(N,D){let O=0;c.value.forEach(W=>{W.sourceComponent.map.forEach(X=>{!X.command.isInvalid&&N.controller.id===X.controller.id&&N.command.id===X.command.id&&N.event.label===X.event.label&&D.sourceComponent.id===W.sourceComponent.id?(N.active=!N.active,b.value=J.cloneDeep(N)):(X.command.isInvalid&&N.controller.id===X.controller.id&&N.command.id===X.command.id&&N.event.label===X.event.label&&D.sourceComponent.id===W.sourceComponent.id&&(O++,O===1&&(new Fe.FNotifyService().info({position:"top-center",message:"该方法已失效"}),b.value=null)),X.active=!1)})})}function v(N){return{"f-event-func":!N.command.isInvalid,"f-event-func-invalid":N.command.isInvalid}}function F(N){return N.sourceComponent.map.filter(D=>!D.hide).map(D=>{if(!D.command.isInvalid)return e.createVNode("div",{class:g(D),onClick:()=>p(D,N)},[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:v(D)},[D.command.name,e.createTextVNode("("),D.command.label,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[N.path,D.event.name])])})}function r(){return c.value.length>0?e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[c.value.map(N=>F(N))]):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 _(){a.emit("cancel")}function z(){if(!b.value){n.notifyService.info({position:"top-center",message:"请选择需要绑定的方法"});return}a.emit("submit",{selectedCommand:b.value,selectedForm:E.value})}function R(){const N=n.useFormSchema.externalFormSchema,D=[];return D.push({containerId:"",id:s.id,code:s.code,name:s.name}),Array.from(N.keys()).forEach(O=>{const W=N.get(O);D.push({containerId:O,id:W.id,code:W.code,name:W.name})}),D}const B=e.computed(()=>({"f-vm-all":!0," h-100":!0,"has-page-list":$.value}));function q(N){var X,ae;const{viewmodels:D,components:O}=N.module;if((D==null?void 0:D.length)===0||(O==null?void 0:O.length)===0)return[];S.value=[];const W=(ae=(X=n.sourceCommunication)==null?void 0:X.parameterData)==null?void 0:ae.getViewModelName;D.forEach(k=>{if(!k||!k.commands||k.commands.length===0)return[];const Z=O.find(ge=>ge.viewModel===k.id),re=W&&Z?W(Z,k.name,N):"";S.value.push({id:k.id,code:k.code,name:re||k.name}),k.commands.forEach(ge=>{ge.isInvalid||S.value.push({...ge,viewmodelId:k.id,viewmodelName:re||k.name,isCommandNode:!0})})})}function d(N){var D,O,W;if(!(N.id===E.value.id&&N.containerId===E.value.containerId))if(E.value=N,y.value="",b.value=null,E.value.id!==s.id){const X=(O=n.useFormSchema.externalFormSchema)==null?void 0:O.get((D=E.value)==null?void 0:D.containerId);(W=X==null?void 0:X.content)!=null&&W.module&&q(X.content)}else c.value.map(X=>{X.sourceComponent.map.map(ae=>{ae.hide=!1,ae.active=!1})})}function i(){const N=R();E.value||(E.value=N[0]);const D=e.computed(()=>O=>{var W;return{"f-list-view-group-item":!0,"f-listview-active":O.id===((W=E.value)==null?void 0:W.id)&&O.containerId===E.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;"},[N.map(O=>{let W=O.name;return O.containerId&&(W+=`, 所属外部容器:${O.containerId}`),e.createVNode("li",{class:D.value(O),onClick:()=>d(O)},[e.createVNode("div",{class:"f-list-content"},[e.createVNode("div",{class:"f-navSelector-leftCategory",title:W},[O.name])])])})])])])])}function m(N){S.value.map(D=>D.active=!1),N.active=!0,b.value=N}function C(){return e.createVNode("div",{class:"f-vm-viewModel flex-fill"},[S.value.filter(N=>!N.hide).map(N=>{if(N.isCommandNode)return e.createVNode("div",{class:g(N),onClick:()=>m(N)},[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"},[N.name,e.createTextVNode("("),N.code,e.createTextVNode(")")])]),e.createVNode("div",{class:"f-event-path"},[N.viewmodelName])])})])}return()=>e.createVNode("div",{class:B.value},[e.createVNode("div",{class:"d-flex f-utils-fill-flex-row splitter"},[$.value?i():"",e.createVNode("div",{class:"f-utils-fill-flex-column"},[V(),!E.value||E.value.id===s.id?r():C()])]),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:z},[e.createTextVNode("确定")])])])}}),Zt=e.defineComponent({name:"FCommandSource",props:Kt,emits:["addInternalCommandListChanged","newImportChanged","selectBoundMethod","click","existChanged","newFunctionChanged","close","selectMethod","addCommunication"],setup(n,a){const l=e.inject("useMethodsComposition"),c=e.inject("useFormCommand"),t=new Fe.FNotifyService,{checkIfNewControllerExists:s,addNewController:y}=l,b=e.ref(n.controllers),T=e.inject("useFormSchema"),$=e.inject(sn.F_MODAL_SERVICE_TOKEN);let E,S;const u=e.ref(!1);e.onMounted(()=>{u.value=T.externalFormSchema.size>0});function o(m,C,x){if(y(m),m.Commands){const A=c.getInternalControllerFromControllerMetadata(m,C,x);s(A)&&t.info({position:"top-center",message:"该控制器已存在"})}}async function f(m){c.getSupportedControllerMetadata(m).then(C=>{C&&o(C.controller,C.code,C.nameSpace)}).finally(()=>{E&&E.destroy&&E.destroy()})}function V(m){E&&E.destroy&&E.destroy()}function g(){const m={formBasicInfo:T==null?void 0:T.getFormMetadataBasicInfo()};return e.createVNode(Ke.FSchemaSelector,{injectSymbolToken:fe.ControllerSchemaRepositorySymbol,"view-type":"NavList",editorParams:m,showFooter:!0,onCancel:V,onSubmit:f},null)}function p(){E=$.open({title:"选择控制器",width:950,render:g,showButtons:!1})}function v(){a.emit("newFunctionChanged")}function F(){S&&S.destroy&&S.destroy()}function r(m){const{selectedCommand:C,selectedForm:x}=m;!x||(x==null?void 0:x.id)===T.getFormMetadataBasicInfo().id?(l.selectBoundCommand(C,n.iteractionDisplayOrder),a.emit("selectBoundMethod")):a.emit("addCommunication",m),F()}function _(){const{getEventPath:m}=l;return e.createVNode(Xt,{getEventPath:m,notifyService:t,useFormSchema:T,sourceCommunication:n.sourceCommunication,event:n.event,onCancel:F,onSubmit:r},null)}function z(){S=$.open({title:"已有方法",width:950,height:500,fitContent:!1,render:_,showButtons:!1,enableEsc:!1,draggable:!0})}function R(){a.emit("close",null)}function B(){return e.createVNode("div",{class:"f-command-breakline"},[e.createTextVNode("------------------------------------------------------------")])}function q(){return e.createVNode("div",{class:"f-page-internals-new-command"},[e.createVNode("div",{class:"f-page-internals-new-command-func1"},[e.createVNode("div",{class:"f-icon f-icon-panel-retraction"},null),e.createVNode("div",{class:"f-function-class",onClick:()=>p()},[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:()=>v()},[e.createTextVNode("添加新方法")])]),(n.haveBoundCommand||u.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 d(m){a.emit("selectMethod",m)}function i(){return e.createVNode("div",{class:"f-page-command-source-choice"},[e.createVNode(Jt,{controllers:b.value,onSelectMethod:d},null)])}return()=>e.createVNode("div",{class:"f-page-events-editor-command-source"},[i(),B(),q(),B(),e.createVNode("div",null,[e.createVNode("div",{class:"f-page-internals-close",onClick:R},[e.createTextVNode("取消")])])])}}),eo={command:{type:Object,default:{}},showParameter:{type:Boolean,default:!1},controller:{type:Object,default:{}},showDeleteIcon:{type:Boolean,default:!1}},no=e.defineComponent({name:"FParameterEditor",props:eo,emits:["confirm","change","targetChange","viewSource","deleteCommand"],setup(n,a){const l=new Fe.FNotifyService,c=e.inject("FMessageBoxService"),t=e.ref(J.cloneDeep(n.command)),s=e.ref(n.controller),y=e.ref(0),b=e.computed(()=>t.value.id==="abandoned"),T=e.computed(()=>t.value.id==="deleted"),$=e.computed(()=>n.showDeleteIcon),E=e.computed(()=>t.value!==null),S=e.inject("useMethodsComposition"),u=e.ref(n.showParameter),o=e.inject("useFormSchema"),f=e.computed(()=>t.value.componentLists&&t.value.hasPath),V=e.computed(()=>{const k=t.value.id!=="abandoned"&&t.value.id!=="deleted",Z=f.value,re=t.value.property&&t.value.property.length>0;return k&&(Z||re)});function g(){const{targetComponent:k}=t.value;let Z="";return t.value.componentLists&&t.value.componentLists.forEach(re=>{if(re.componentId===k){Z=re.viewModelId;return}}),Z}const p=e.ref(g()),v=e.computed(()=>t.value.targetComponent||"");function F(){l.info({position:"top-center",message:"方法已被移除,请重新绑定"})}function r(){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:()=>F()},null)}function _(){l.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:()=>_()},null)}function R(k){u.value=!u.value}function B(){return e.createVNode("div",{class:"f-icon f-icon-edit-button",style:"font-size: 13px;margin-right:10px;",onClick:()=>R(y.value)},null)}function q(k,Z){t.value.targetComponent=k[0].componentId,a.emit("targetChange",t.value)}function d(){const k=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"),k]])]),e.createVNode("div",{class:"f-page-parameter-editor-targetComponent-dropdown"},[e.createVNode(Qe,{modelValue:p.value,"onUpdate:modelValue":Z=>p.value=Z,enableClear:!1,idField:"viewModelId",valueField:"viewModelId",textField:"componentId",data:t.value.componentLists,editable:!1,onChange:q},null)])])])}function i(k,Z){Z.value=k}function m(){a.emit("change",t.value)}function C(){let k="";return v.value?k=o.getViewModelIdByComponentId(v.value):k=S.getViewModeId(),k}function x(k,Z){var pe,ue,ne,le,se,me,j,G,Q,Y,te,ce,he,ve,Ce,qe,De,Oe,we,Ae,Re;const re=C(),Ee=o.getViewModelById(re).commands.find(oe=>{var Ne;return(oe==null?void 0:oe.id)===((Ne=n.command)==null?void 0:Ne.id)}),Pe=e.reactive(k.context.data),{assembleSchemaFieldsByComponent:Me,assembleOutline:Te,assembleStateVariables:h,assembleSchemaFieldsUnderBoundEntity:U,getEditor:H}=k.context.generalData,{designerMode:K}=o,ee=oe=>{i(oe,k),m()},de=oe=>{var Ne,ke,Ve,Ue;return((Ue=(Ve=(ke=(Ne=k==null?void 0:k.origin)==null?void 0:Ne.controlSource)==null?void 0:ke.context)==null?void 0:Ve.data)==null?void 0:Ue.value)===":Entity"||oe.raw.children&&oe.raw.children.length&&(oe.disabled=!0),oe};return e.createVNode(Ge,{readonly:K==="PC_RTC"&&!Z.isRtcCommand,defaultValue:k==null?void 0:k.origin.defaultValue,modelValue:k.value,"onUpdate:modelValue":oe=>k.value=oe,data:Pe,editor:H(k.value,k,Ee,re,ee),fieldData:Me(),formData:Te(),varData:h(),activeViewModelFieldData:U(v.value),editorControlSource:(pe=k==null?void 0:k.origin)==null?void 0:pe.controlSource,customRowStatus:de,idField:((se=(le=(ne=(ue=k==null?void 0:k.origin)==null?void 0:ue.controlSource)==null?void 0:ne.context)==null?void 0:le.data)==null?void 0:se.value)===":Entity"?"bindTo":((Q=(G=(j=(me=k==null?void 0:k.origin)==null?void 0:me.controlSource)==null?void 0:j.context)==null?void 0:G.valueField)==null?void 0:Q.value)||((he=(ce=(te=(Y=k==null?void 0:k.origin)==null?void 0:Y.controlSource)==null?void 0:te.context)==null?void 0:ce.idField)==null?void 0:he.value)||"id",textField:((De=(qe=(Ce=(ve=k==null?void 0:k.origin)==null?void 0:ve.controlSource)==null?void 0:Ce.context)==null?void 0:qe.textField)==null?void 0:De.value)||"label",editable:(Re=(Ae=(we=(Oe=k==null?void 0:k.origin)==null?void 0:Oe.controlSource)==null?void 0:we.context)==null?void 0:Ae.editable)==null?void 0:Re.value,onConfirm:oe=>{i(oe,k),m()},onValueChange:oe=>{var Ne,ke;if(((Ne=k.origin)==null?void 0:Ne.Code)==="lookupId"){const Ve=(ke=t.value.property)==null?void 0:ke.find(Ue=>Ue.name==="mappingFields");Ve&&Ve.value&&(Ve.value="")}i(oe,k),m()}},null)}function A(){var k;return(k=t.value.property)==null?void 0:k.map((Z,re)=>{const ge=e.reactive({content:Z.description,placement:"top"});return e.createVNode("div",{key:Z.name+re},[e.createVNode("div",{class:"f-page-parameter-editor-row1"},[e.createVNode("div",{class:"f-page-parameter-editor-parameter-name"},[Z.shownName,Z.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"),ge]])])]),e.createVNode("div",{class:"f-page-parameter-editor-row2"},[x(Z,t.value)])])})}function N(){return e.createVNode("div",{class:"f-page-parameter-editor-group"},[f.value&&d(),A()])}function D(k){k.stopPropagation(),a.emit("viewSource",{command:t.value,event:k})}function O(){c.question(`确定删除命令【${t.value.name}】吗?`,"",()=>{a.emit("deleteCommand")})}function W(){return e.createVNode("div",{class:"f-icon f-icon-yxs_delete",title:"删除命令",onClick:k=>O()},null)}const X=e.computed(()=>{var k;return{cursor:b.value||s.value.isCommon||((k=s.value)==null?void 0:k.label.indexOf(o==null?void 0:o.getModule().code))===-1?"default":"pointer"}});function ae(){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:X.value,title:t.value.label,onDblclick:D},[t.value.name]),e.createVNode("div",{class:"f-page-parameter-editor-first-row-icon"},[b.value&&r(),T.value&&z(),V.value&&B(),$.value&&W()])]),u.value&&N()])}return()=>e.createVNode("div",{class:"f-page-parameter-editor"},[E.value&&ae()])}}),to="root-viewmodel";class oo{constructor(a,l){He(this,"formSchemaUtils");He(this,"controlCreatorUtils");He(this,"designViewModelUtils");this.resolver=a,this.designerHostServ