(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0aa783"],{"10c1":function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return s}));var r=n("c621"),a=n("3af9"),c=n("d5fa"),o=n("7a23");const l=Object.assign(Object.assign({},a["Rb"]),{pointerEvents:"all"});var s=Object(o["defineComponent"])({name:"DesignerTree",mixins:[a["u"]],props:Object.assign({},a["v"]),setup(e){Object(o["onBeforeMount"])(()=>{var t;const n=e.currentInstance;if(!n)return;const c=a["R"].fetchOptions(n);c.normalMaskStyle=l;let o=null===(t=a["R"].fetchAreaInstanceNullable(e.currentInstance,a["A"].ROW_ACTIONS))||void 0===t?void 0:t.element;o||(o=a["wb"].createAreaWidgetInstance(n,a["A"].ROW_ACTIONS,{element:{title:Object(r["translateValueByKey"])(a["cb"])}}),a["R"].add(n,o));const s=a["R"].fetchOptions(o);s.draggableItemComponentData=Object.assign(Object.assign({},c.draggableItemComponentData||{}),{style:{position:"relative"}})});const t=Object(o["computed"])(()=>{var t;const n=null===(t=e.currentInstance)||void 0===t?void 0:t.element.properties.nodes;if(null===n||void 0===n?void 0:n.length){const e=[];if(n.forEach(t=>{var n;const a=null===(n=t.modelDefinition)||void 0===n?void 0:n.model;if(a){const n=Object(r["uniqueKeyGenerator"])();e.push({key:n,title:t.modelDefinition.displayName||Object(r["translateValueByKey"])("未命名"),value:{},children:[],isLeaf:!0})}}),e.length)return e}return[{key:Object(r["uniqueKeyGenerator"])(),title:Object(r["translateValueByKey"])("未配置"),value:{},children:[],isLeaf:!0}]}),n=Object(o["computed"])(()=>a["R"].fetchAreaInstanceNullable(e.currentInstance,a["A"].CONTENT)),c=Object(o["computed"])(()=>a["R"].fetchAreaInstanceNullable(e.currentInstance,a["A"].ROW_ACTIONS)),s=Object(o["computed"])(()=>{let e,n;const r=t.value,a=r.length,c=a-1;for(let t=0;t<a;t++){const{key:a,title:o,value:l}=r[t],s={key:a,title:o,value:l,children:[],isLeaf:t===c,selectable:!1};n?(n.children.push(s),s.parent=n):e=s,n=s}return e}),i=Object(o["computed"])(()=>t.value.map(e=>e.key)),d=Object(o["computed"])(()=>r["Optional"].ofNullable(e.currentInstance).map(e=>a["R"].fetchProperties(e)).map(e=>e.enableSearch).map(e=>r["BooleanHelper"].toBoolean(e)).orElse(!1)),u=Object(o["computed"])(()=>r["Optional"].ofNullable(e.currentInstance).map(e=>a["R"].fetchProperties(e)).map(e=>e.selectable).map(e=>r["BooleanHelper"].toBoolean(e)).orElse(!1)),p=Object(o["computed"])(()=>!(!u.value||!n.value));return Object(o["watch"])(()=>u.value,()=>{var e;const t=null===(e=n.value)||void 0===e?void 0:e.element;t&&(t.element.isVirtual=!u.value)},{immediate:!0}),{content:n,rowActions:c,rootNodes:t,rootNode:s,expandedKeys:i,enableSearch:d,selectable:u,hasSelectContent:p}},render(){const{currentInstance:e,widgetCategoryGroup:t,widgetNameGroup:n,widgetTypeGroup:l,content:s,rowActions:i,rootNode:d,expandedKeys:u,enableSearch:p,hasSelectContent:b}=this;if(!d)return[];let O=Object(o["createVNode"])(c["OioTree"],{style:Object(a["kc"])(e),data:[d],expandedKeys:u,blockNode:!0,wrapperClassName:"designer-tree-wrapper"},{title:({title:e,isLeaf:r})=>{let c=e;if(r&&i){const{element:r,index:s}=i;c=[Object(o["createVNode"])("div",{class:"designer-tree-node-wrapper"},[Object(o["createVNode"])("div",{class:"designer-tree-node-title"},e),Object(o["createVNode"])("div",{class:"designer-tree-node-row-actions-wrapper"},[Object(o["createVNode"])(a["w"],{key:r.id,currentInstance:r,currentIndex:s,widgetCategoryGroup:t,widgetNameGroup:n,widgetTypeGroup:l})])])]}return c}});p&&(O=Object(o["createVNode"])("div",{class:"designer-search-tree-wrapper"},[Object(o["createVNode"])(c["OioInputSearch"],{placeholder:Object(r["translateValueByKey"])("请输入关键字")}),O]));const m=[O],g=["designer-tree"];if(b&&s){const{element:e,index:r}=s;m.push(Object(o["createVNode"])("div",{class:"designer-tree-content"},[Object(o["createVNode"])(a["w"],{key:e.id,currentInstance:e,currentIndex:r,widgetCategoryGroup:t,widgetNameGroup:n,widgetTypeGroup:l})]))}else g.push("designer-tree-no-content");return Object(o["createVNode"])("div",{class:g},m)}});s.__file="src/view/component/designer-draggable/component/element/tree/DesignerTree.vue"}}]);