import{_ as F,d as G,w as I,bq as v,a0 as q,x as M,r as i,o as a,c as u,G as k,C as h,F as C,D as E,l as x,h as b,L as g,j as d,M as y,a as P}from"./index.js";import{a as U,b as z}from"./index.21ab3104.js";const O={key:0,flex:"","gap-10":""},T={fixed:"","right-5":"","bottom-5":""},H={key:1,class:"text-center mt-[10x] select-none"},J=G({__name:"process-list",props:{currentRole:{type:Object,required:!0}},emits:["saveBtnClick"],setup(_,{emit:B}){const D=_,s=I([]),{run:V}=v({initalData:[],success:e=>s.value=e.action_data}),{data:r,run:w}=v({success:()=>r.value=r.value.filter(({child:e})=>e&&e.length>0)});q(()=>{const{currentRole:e}=D;!e||V(U({roleid:e.id}))});function A(){B("saveBtnClick",x(s))}function L(e,n){const l=r.value[n].child;if(e)return l.forEach(t=>{!s.value.includes(t.id)&&s.value.push(t.id)});l.forEach(t=>{const o=s.value.findIndex(m=>m===t.id);o>=0&&s.value.splice(o,1)})}function R(e){const n=r.value[e].child,l=n.length,t=n.filter(o=>s.value.includes(o.id));return t.length>0&&t.length!==l}function N(e){const n=r.value[e].child,l=n.length;return n.filter(o=>s.value.includes(o.id)).length===l}return M(()=>w(z())),(e,n)=>{const l=i("ElDivider"),t=i("ElCheckbox"),o=i("ElCheckboxGroup"),m=i("ElButton"),S=i("ElScrollbar");return a(),u("div",null,[_.currentRole?(a(),k(S,{key:0,style:{padding:"15px"}},{default:h(()=>[(a(!0),u(C,null,E(x(r),(p,f)=>(a(),u("div",{key:p.id,"w-full":""},[b("p",null,g(p.process_name),1),d(l,{"border-style":"dashed","m-0":""}),p.child?(a(),u("div",O,[d(t,{label:"\u5168\u9009","model-value":N(f),indeterminate:R(f),onChange:c=>L(c,f)},null,8,["model-value","indeterminate","onChange"]),d(o,{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=c=>s.value=c)},{default:h(()=>[(a(!0),u(C,null,E(p.child,(c,j)=>(a(),k(t,{key:j,label:c.id},{default:h(()=>[y(g(c.status_name),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue"])])):P("v-if",!0),d(l)]))),128)),b("div",T,[d(m,{onClick:A,type:"primary",size:"small"},{default:h(()=>[y("\u4FDD\u5B58")]),_:1})])]),_:1})):(a(),u("p",H,"\u6682\u65E0\u6570\u636E"))])}}});var W=F(J,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/interest/processPermission/components/process-list.vue"]]);export{W as default};
