import{_ as L,d as V,X as G,aU as I,w as k,bn as J,b0 as W,r as l,aC as X,l as e,H as K,o as p,c as x,j as t,C as o,M as Q,L as Y,G as h,J as f,a as C,aq as Z,b4 as ee,aN as B}from"./index.js";import{M as te,h as ne,a as ae,b as se}from"./modal.4cd7fc.js";const oe=[{value:"0",label:"\u7981\u7528"},{value:"1",label:"\u542F\u7528"}],ue={key:0,class:"mt-[10px]"},le={key:1,class:"w-full leading-[198px] text-center border-[#ccc] border rounded-sm mt-2 color-[#ccc] font-bold"},ie=V({__name:"organize-tree",props:{otherParms:{type:Object,required:!0},breadcrumb:{type:Array,required:!0}},emits:["breadcrumbChange"],setup(y,{expose:F,emit:w}){const A=y,D=G(),m=I(!1),c=k(""),{hasPermissionWithCode:b}=J("exclusive"),_=k({}),{data:v,run:T,loading:S,isError:z}=W({isList:!0});function O(n){c.value=n.id,i(),w("breadcrumbChange",n)}function i(){const n={...c.value?{pid:c.value}:{pid:0},...A.otherParms};T(ne(n))}function P(){i()}function M(n){ee.confirm("\u786E\u5B9A\u8981\u5220\u9664?",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(async()=>{(await ae({id:n})).code===0?(B.success("\u5220\u9664\u6210\u529F"),i()):B.warning("\u5220\u9664\u5931\u8D25")})}function N(n){_.value=n,m.value=!0}const j=async n=>{const{id:u,status:s}=n,{code:E,message:d}=await se({id:u,status:s+""=="1"?"0":"1"});D({code:E,message:d,handler:()=>i()})};return P(),F({changePid:n=>c.value=n,onSearch:()=>i()}),(n,u)=>{const s=l("ElTableColumn"),E=l("ElTag"),d=l("ElButton"),g=l("el-tooltip"),R=l("el-button"),q=l("el-popconfirm"),U=l("ElTable"),$=X("loading");return e(v)&&e(v).length>0&&!e(z)?K((p(),x("ul",ue,[t(U,{data:e(v),border:"",size:"small"},{default:o(()=>[t(s,{label:"\u4E13\u5C5E\u7C7B\u578B\u540D\u79F0",prop:"name","min-width":"160px"}),t(s,{label:"\u72B6\u6001",prop:"status",width:"70px"},{default:o(({row:a})=>[t(E,{type:String(a.status)==="0"?"warning":""},{default:o(()=>{var r;return[Q(Y(((r=e(oe).find(({value:H})=>H===String(a.status)))==null?void 0:r.label)||"--"),1)]}),_:2},1032,["type"])]),_:1}),t(s,{label:"\u7B49\u7EA7",prop:"level",width:"80px"}),t(s,{label:"\u521B\u5EFA\u4EBA\u90E8\u95E8",prop:"company_name",width:"120px"}),t(s,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"addtime",width:"160px"}),t(s,{label:"\u64CD\u4F5C",width:"140px"},{default:o(({row:a})=>[e(b)("005")?(p(),h(g,{key:0,effect:"dark",content:"\u7F16\u8F91\u4E13\u5C5E\u5206\u7C7B",placement:"top"},{default:o(()=>[t(d,{link:"",class:"reset-margin",type:"primary",icon:e(f)("edits"),onClick:r=>N(a)},null,8,["icon","onClick"])]),_:2},1024)):C("v-if",!0),e(b)("006")?(p(),h(g,{key:1,effect:"dark",content:"\u5220\u9664\u4E13\u5C5E\u5206\u7C7B",placement:"top"},{default:o(()=>[t(d,{link:"",class:"reset-margin",type:"primary",icon:e(f)("delete"),onClick:r=>M(a.id)},null,8,["icon","onClick"])]),_:2},1024)):C("v-if",!0),e(b)("004")?(p(),h(q,{key:2,title:String(a.status)==="1"?"\u6539\u4E3A\u7981\u7528\uFF1F":"\u6539\u4E3A\u542F\u7528\uFF1F",onConfirm:r=>j(a)},{reference:o(()=>[t(R,{class:"reset-margin",link:"",type:"primary",size:"small",icon:e(f)(String(a.status)==="1"?"close-circle-line":"checkbox-circle-line")},null,8,["icon"])]),_:2},1032,["title","onConfirm"])):C("v-if",!0),t(g,{effect:"dark",content:"\u4E0B\u4E00\u7EA7",placement:"top"},{default:o(()=>[t(d,{link:"",class:"reset-margin",type:"primary",icon:e(f)("arrow-right-s-line"),onClick:r=>O(a)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"]),t(te,{data:_.value,"onUpdate:data":u[0]||(u[0]=a=>_.value=a),visible:e(m),"onUpdate:visible":u[1]||(u[1]=a=>Z(m)?m.value=a:null),pid:c.value,breadcrumb:y.breadcrumb,onRefresh:i},null,8,["data","visible","pid","breadcrumb"])])),[[$,e(S)]]):(p(),x("div",le," \u6682\u65E0\u6570\u636E "))}}});var re=L(ie,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/exclusive/cpns/organize-tree.vue"]]),pe=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"}));export{re as O,pe as o,oe as s};
