import{d as T,r as u,a as B,o as z,f as r,i as t,w as o,s as D,aj as G,p as f,t as H,q as J,v as s,F as v,x as y,j as K,k as O,m as k,l as g,ak as Q,E as N,a4 as V,y as w,h as E,_ as W}from"./index-ByQGGPf6.js";const X={class:"permission-container"},Y={key:0,class:"el-icon-arrow-down"},Z={key:0,class:"role-dropdown__list"},ee={class:"role-dropdown__label"},oe={key:0,class:"el-icon-arrow-right"},ne={key:0,class:"role-dropdown__list"},le={class:"role-dropdown__label"},ae=T({__name:"configMsg",setup(se){const x=H(),S=D();J(),u(!0),u([]),u([]);const $=B({data_scope:"ALL",role_name:"",role_describe:"",dept_ids:[]}),q=B({role_name:[{required:!0,message:"请输入角色名称！",trigger:"blur"},{min:1,max:10,message:"长度在 1 到 10 个字符",trigger:"blur"}]}),b=u([]);u(!1),u(!1),u(!1),u(S.query.id);const h=e=>Array.isArray(e.children)&&e.children.length!==0,m=(e,n)=>{e.child&&e.child.length&&(e.child=M(e.child,e.checked))},M=(e,n)=>{const d=[...e];return d.map(c=>{c.checked=n,c.children&&c.children.length&&(c.children=M(c.children,n))}),d},_=e=>{if(!Array.isArray(e))return!1;const n=e.length,d=e.filter(c=>c.checked).length;return d!==0&&n!==d},U=u(),I=()=>{U.value.validate(e=>{if(e){let n={vos:b.value};Q(n).then(d=>{N.success("保存成功！"),R()})}else return N.error("表单填写有误，请检查！"),!1})},R=()=>{G({company_id:x.state.companId}).then(e=>{b.value=e})};return z(()=>{R()}),(e,n)=>{const d=f("el-checkbox"),c=f("el-col"),C=f("el-popover"),L=f("el-row"),F=f("el-form-item"),P=f("el-button"),j=f("el-form");return s(),r("div",X,[t(j,{model:$,rules:q,ref_key:"configMsgFormRef",ref:U,"label-width":"200px",class:"demo-ruleForm"},{default:o(()=>[t(F,{label:"消息配置",prop:"permission"},{default:o(()=>[(s(!0),r(v,null,y(b.value,p=>(s(),r("div",{key:p.identifier,class:"level_1"},[t(L,{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:_(p.children),onChange:l=>m(p,"")},null,8,["modelValue","onUpdate:modelValue","label","indeterminate","onChange"])]),_:2},1024),t(c,{span:20},{default:o(()=>[(s(!0),r(v,null,y(p.child,l=>(s(),r("div",{key:l.identifier,class:"checkbox-dropdown"},[t(C,{placement:"bottom",trigger:"hover","open-delay":300,disabled:!h(l),"append-to-body":!1},{reference:o(()=>[t(d,{modelValue:l.has_select,"onUpdate:modelValue":a=>l.has_select=a,indeterminate:_(l.child),onClick:n[0]||(n[0]=V(()=>{},["stop"])),onChange:a=>m(l,p)},{default:o(()=>[k(w(l.name)+" ",1),h(l)?(s(),r("i",Y)):g("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","indeterminate","onChange"])]),default:o(()=>[h(l)?(s(),r("div",Z,[(s(!0),r(v,null,y(l.child,a=>(s(),r("div",{class:"role-dropdown",key:a.identifier},[t(C,{placement:"right",trigger:"hover","open-delay":200,disabled:!h(a),"append-to-body":!1},{reference:o(()=>[E("div",ee,[t(d,{modelValue:a.has_select,"onUpdate:modelValue":i=>a.has_select=i,indeterminate:_(a.child),onClick:n[1]||(n[1]=V(()=>{},["stop"])),onChange:i=>m(a,l)},{default:o(()=>[k(w(a.name)+" ",1),h(a)?(s(),r("i",oe)):g("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","indeterminate","onChange"])])]),default:o(()=>[h(a)?(s(),r("div",ne,[(s(!0),r(v,null,y(a.child,i=>(s(),r("div",{class:"role-dropdown",key:i.identifier},[t(C,{placement:"right",trigger:"hover","open-delay":200,disabled:!h(i),"append-to-body":!1},{reference:o(()=>[E("div",le,[t(d,{modelValue:i.has_select,"onUpdate:modelValue":A=>i.has_select=A,indeterminate:_(i.child),onClick:n[2]||(n[2]=V(()=>{},["stop"])),onChange:A=>m(i,a)},{default:o(()=>[k(w(i.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue","indeterminate","onChange"])])]),_:2},1032,["disabled"])]))),128))])):g("",!0)]),_:2},1032,["disabled"])]))),128))])):g("",!0)]),_:2},1032,["disabled"])]))),128))]),_:2},1024)]),_:2},1024)]))),128))]),_:1}),t(F,{label:""},{default:o(()=>[K(x).state.user.user.founder!==1?(s(),O(P,{key:0,type:"primary",size:"small",style:{"margin-top":"15px"},onClick:I},{default:o(()=>[k("保存设置")]),_:1})):g("",!0)]),_:1})]),_:1},8,["model","rules"])])}}}),te=W(ae,[["__scopeId","data-v-44acc77d"]]);export{te as default};
