import{_ as w,d as N,w as m,aU as B,z as S,r as _,o as c,G as F,C,a as p,c as v,h as u,M as f,F as A,D as U,B as P,L as T,j as o,l as k,aq as R,aN as y}from"./index.js";import{h as j}from"./index.da6d65fd.js";import M from"./organize-tree.6f5c7d.js";import I from"./modal.ce6af8.js";const L={key:0,class:"flex cursor-pointer"},O=u("span",{class:"mx-[5px]"},"/",-1),q=["onClick"],G={key:0,class:"mx-[5px]"},$={class:"flex justify-between pt-[20px]"},H={class:"flex gap-1"},J={class:"flex"},K={class:"flex-1"},Q=N({__name:"index",setup(W){const z="organize",s=m([]),r=B(!1),i=m({}),b=B(!1),d=m({name:"",nickname:""}),n=m(null);function D(a){s.value.push(a)}function x(a){if(a===s.value.length-1)return;const e=s.value[a],t=e?e.id:"";n.value.changePid(t),n.value.onSearch(),s.value.splice(a+1)}async function E(){const{companyNo:a,name:e,pid:t=0}=i.value;(await j({companyNo:a,name:e,pid:t})).code===0?(r.value=!1,y.success("\u6DFB\u52A0\u6210\u529F"),n.value.onSearch()):y.warning("\u6DFB\u52A0\u5931\u8D25")}return S(()=>s.value,()=>{b.value=s.value.length!==0;const a=s.value[s.value.length-1];i.value.companyNo=a?a.companyNo:"",i.value.pid=a?a.id:"0"},{immediate:!0,deep:!0}),(a,e)=>{const t=_("ElInput"),h=_("ElButton"),V=_("PageAuth");return c(),F(V,{class:"px-[10px] h-[calc(100vh-60px)] bg-white",pageName:z,margin:!1},{default:C(()=>[p(" \u9762\u5305\u5C51 "),s.value.length>0?(c(),v("ul",L,[u("li",{onClick:e[0]||(e[0]=()=>x())},[f(" \u5168\u90E8\u5206\u7C7B "),O]),(c(!0),v(A,null,U(s.value,(l,g)=>(c(),v("li",{class:P({"cursor-pointer":!0,"text-[#ccc]":g===s.value.length-1}),key:l.id,onClick:()=>x(g)},[f(T(l.name)+" ",1),g!==s.value.length-1?(c(),v("span",G,"/")):p("v-if",!0)],10,q))),128))])):p("v-if",!0),u("div",$,[u("div",H,[o(t,{modelValue:d.value.name,"onUpdate:modelValue":e[1]||(e[1]=l=>d.value.name=l),placeholder:"\u90E8\u95E8\u540D\u79F0",clearable:"",size:"small",onChange:e[2]||(e[2]=()=>n.value.onSearch())},null,8,["modelValue"]),o(t,{modelValue:d.value.nickname,"onUpdate:modelValue":e[3]||(e[3]=l=>d.value.nickname=l),placeholder:"\u5458\u5DE5\u540D\u79F0",clearable:"",size:"small",onChange:e[4]||(e[4]=()=>n.value.onSearch())},null,8,["modelValue"])]),u("div",J,[o(h,{size:"small",type:"primary",onClick:e[5]||(e[5]=l=>r.value=!0)},{default:C(()=>[f("\u6DFB\u52A0")]),_:1}),o(h,{size:"small",onClick:e[6]||(e[6]=()=>n.value.onSearch())},{default:C(()=>[f("\u5237\u65B0")]),_:1})])]),p(" \u6811\u8282\u70B9 "),u("div",K,[o(M,{ref_key:"organizeTreeRef",ref:n,otherParms:d.value,onBreadcrumbChange:D},null,8,["otherParms"])]),o(I,{data:i.value,"onUpdate:data":e[7]||(e[7]=l=>i.value=l),visible:k(r),"onUpdate:visible":e[8]||(e[8]=l=>R(r)?r.value=l:null),disabledBusiness:k(b),onSubmit:E},null,8,["data","visible","disabledBusiness"])]),_:1})}}});var ae=w(Q,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/interest/organize/index.vue"]]);export{ae as default};
