import{_ as P,d as w,w as i,aU as N,z as V,bn as S,r as _,o as n,G as k,C as g,h as o,M as c,c as d,a as m,F as A,D,B as R,L as T,j as p,l as B,aq as U}from"./index.js";import F from"./organize-tree.c16f06.js";import{M as j}from"./modal.6749c4.js";import"./useTask.8a645393.js";const M={class:"flex cursor-pointer"},I={key:0,class:"mx-[5px]"},L=["onClick"],O={key:0,class:"mx-[5px]"},$={class:"flex justify-between pt-[20px]"},q={class:"flex gap-1"},G={class:"flex"},W={class:"flex-1"},H=w({__name:"index",setup(J){const b="sort",a=i([]),u=N(!1),r=i({}),v=i({status:"",cat_name:"",company_name:""}),l=i(null);function y(s){a.value.push(s)}function x(s){if(s===a.value.length-1)return;const e=a.value[s],f=e?e.id:"";l.value.changePid(f),l.value.onSearch(),a.value.splice(s+1)}V(()=>a.value,()=>{const s=a.value[a.value.length-1];r.value.companyNo=s?s.companyNo:"",r.value.pid=s?s.id:"0"},{immediate:!0,deep:!0});const{hasPermissionWithCode:z}=S(b);return(s,e)=>{const f=_("ElInput"),C=_("ElButton"),E=_("PageAuth");return n(),k(E,{class:"px-[10px] h-[calc(100vh-60px)] bg-white",pageName:b,margin:!1},{default:g(()=>[o("ul",M,[o("li",{onClick:e[0]||(e[0]=()=>x())},[c(" \u5168\u90E8\u4E00\u7EA7\u5206\u7C7B "),a.value.length>0?(n(),d("span",I,"/")):m("v-if",!0)]),(n(!0),d(A,null,D(a.value,(t,h)=>(n(),d("li",{class:R({"cursor-pointer":!0,"text-[#ccc]":h===a.value.length-1}),key:t.id,onClick:()=>x(h)},[c(T(t.cat_name)+" ",1),h!==a.value.length-1?(n(),d("span",O,"/")):m("v-if",!0)],10,L))),128))]),o("div",$,[o("div",q,[p(f,{modelValue:v.value.cat_name,"onUpdate:modelValue":e[1]||(e[1]=t=>v.value.cat_name=t),placeholder:"\u5206\u7C7B\u540D\u79F0",clearable:"",size:"small",onChange:e[2]||(e[2]=()=>l.value.onSearch())},null,8,["modelValue"])]),o("div",G,[B(z)("003")?(n(),k(C,{key:0,size:"small",type:"primary",onClick:e[3]||(e[3]=t=>{u.value=!0,r.value={}})},{default:g(()=>[c("\u6DFB\u52A0")]),_:1})):m("v-if",!0),p(C,{size:"small",onClick:e[4]||(e[4]=()=>l.value.onSearch())},{default:g(()=>[c("\u5237\u65B0")]),_:1})])]),m(" \u6811\u8282\u70B9 "),o("div",W,[p(F,{ref_key:"organizeTreeRef",ref:l,otherParms:v.value,breadcrumb:a.value,onBreadcrumbChange:y},null,8,["otherParms","breadcrumb"])]),p(j,{data:r.value,"onUpdate:data":e[5]||(e[5]=t=>r.value=t),visible:B(u),"onUpdate:visible":e[6]||(e[6]=t=>U(u)?u.value=t:null),onRefresh:e[7]||(e[7]=t=>l.value.onSearch()),breadcrumb:a.value,type:"create",pid:a.value.length===0?"0":a.value[a.value.length-1].id},null,8,["data","visible","breadcrumb","pid"])]),_:1})}}});var Z=P(H,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/serviceParam/sort/index.vue"]]);export{Z as default};
