import{d as T,u as j,r as u,a as B,o as D,f as r,i as t,w as o,s as H,az as J,p as f,t as K,q as O,v as a,F as b,x as y,j as Q,k as W,m as k,y as C,l as m,aA as X,E as N,ac as x,h as S,_ as Y}from"./index-htML_UHV.js";const Z={class:"permission-container"},ee={key:0,class:"el-icon-arrow-down"},oe={key:0,class:"role-dropdown__list"},ne={class:"role-dropdown__label"},le={key:0,class:"el-icon-arrow-right"},se={key:0,class:"role-dropdown__list"},ae={class:"role-dropdown__label"},re=T({__name:"configMsg",setup(te){const{t:g}=j(),M=K(),E=H();O(),u(!0),u([]),u([]);const I=B({data_scope:"ALL",role_name:"",role_describe:"",dept_ids:[]}),q=B({role_name:[{required:!0,message:g("place")+g("role_names")+"！",trigger:"blur"},{min:1,max:10,message:g("role_name_error")+"!",trigger:"blur"}]}),V=u([]);u(!1),u(!1),u(!1),u(E.query.id);const h=e=>Array.isArray(e.children)&&e.children.length!==0,_=(e,n)=>{e.child&&e.child.length&&(e.child=U(e.child,e.checked))},U=(e,n)=>{const d=[...e];return d.map(c=>{c.checked=n,c.children&&c.children.length&&(c.children=U(c.children,n))}),d},v=e=>{if(!Array.isArray(e))return!1;const n=e.length,d=e.filter(c=>c.checked).length;return d!==0&&n!==d},R=u(),L=()=>{R.value.validate(e=>{if(e){let n={vos:V.value};X(n).then(d=>{N.success(g("sub_success")+"!"),A()})}else return N.error(g("form_erroe")),!1})},A=()=>{J({company_id:M.state.companId}).then(e=>{V.value=e})};return D(()=>{A()}),(e,n)=>{const d=f("el-checkbox"),c=f("el-col"),w=f("el-popover"),P=f("el-row"),F=f("el-form-item"),z=f("el-button"),G=f("el-form");return a(),r("div",Z,[t(G,{model:I,rules:q,ref_key:"configMsgFormRef",ref:R,"label-width":"200px",class:"demo-ruleForm"},{default:o(()=>[t(F,{label:e.$t("MSG_info"),prop:"permission"},{default:o(()=>[(a(!0),r(b,null,y(V.value,p=>(a(),r("div",{key:p.identifier,class:"level_1"},[t(P,{gutter:20},{default:o(()=>[t(c,{span:4},{default:o(()=>[t(d,{modelValue:p.has_select,"onUpdate:modelValue":l=>p.has_select=l,label:p.name,indeterminate:v(p.children),onChange:l=>_(p,"")},null,8,["modelValue","onUpdate:modelValue","label","indeterminate","onChange"])]),_:2},1024),t(c,{span:20},{default:o(()=>[(a(!0),r(b,null,y(p.child,l=>(a(),r("div",{key:l.identifier,class:"checkbox-dropdown"},[t(w,{placement:"bottom",trigger:"hover","open-delay":300,disabled:!h(l),"append-to-body":!1},{reference:o(()=>[t(d,{modelValue:l.has_select,"onUpdate:modelValue":s=>l.has_select=s,indeterminate:v(l.child),onClick:n[0]||(n[0]=x(()=>{},["stop"])),onChange:s=>_(l,p)},{default:o(()=>[k(C(l.name)+" ",1),h(l)?(a(),r("i",ee)):m("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","indeterminate","onChange"])]),default:o(()=>[h(l)?(a(),r("div",oe,[(a(!0),r(b,null,y(l.child,s=>(a(),r("div",{class:"role-dropdown",key:s.identifier},[t(w,{placement:"right",trigger:"hover","open-delay":200,disabled:!h(s),"append-to-body":!1},{reference:o(()=>[S("div",ne,[t(d,{modelValue:s.has_select,"onUpdate:modelValue":i=>s.has_select=i,indeterminate:v(s.child),onClick:n[1]||(n[1]=x(()=>{},["stop"])),onChange:i=>_(s,l)},{default:o(()=>[k(C(s.name)+" ",1),h(s)?(a(),r("i",le)):m("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","indeterminate","onChange"])])]),default:o(()=>[h(s)?(a(),r("div",se,[(a(!0),r(b,null,y(s.child,i=>(a(),r("div",{class:"role-dropdown",key:i.identifier},[t(w,{placement:"right",trigger:"hover","open-delay":200,disabled:!h(i),"append-to-body":!1},{reference:o(()=>[S("div",ae,[t(d,{modelValue:i.has_select,"onUpdate:modelValue":$=>i.has_select=$,indeterminate:v(i.child),onClick:n[2]||(n[2]=x(()=>{},["stop"])),onChange:$=>_(i,s)},{default:o(()=>[k(C(i.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue","indeterminate","onChange"])])]),_:2},1032,["disabled"])]))),128))])):m("",!0)]),_:2},1032,["disabled"])]))),128))])):m("",!0)]),_:2},1032,["disabled"])]))),128))]),_:2},1024)]),_:2},1024)]))),128))]),_:1},8,["label"]),t(F,{label:""},{default:o(()=>[Q(M).state.user.user.founder!==1?(a(),W(z,{key:0,type:"primary",size:"small",style:{"margin-top":"15px"},onClick:L},{default:o(()=>[k(C(e.$t("set_save")),1)]),_:1})):m("",!0)]),_:1})]),_:1},8,["model","rules"])])}}}),ce=Y(re,[["__scopeId","data-v-5606ebb3"]]);export{ce as default};
