import{r as g,X}from"./index.ad3efb29.js";import{d as j,r as u,j as q,ai as d,o as s,c as n,a,U as c,O as _,F as b,a8 as y,M as w,S as v,T as C,u as r,D as I,R as S,I as z,aF as A,aG as G}from"./vue.adf17aba.js";import{_ as K}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.4833989a.js";import"./echarts.72dc8373.js";function L(){return g({url:"/api/system/role_menu_button_permission/data_scope/",method:"get"})}function O(){return g({url:"/api/system/role_menu_button_permission/role_to_dept_all/",method:"get"})}function H(){return g({url:"/api/system/role_menu_button_permission/get_role_permissions/",method:"get"})}const B=p=>(A("data-v-996afbe0"),p=p(),G(),p),J={class:"permission-com"},Q={class:"pc-item"},W=B(()=>a("p",{class:"pc-title"},"数据授权",-1)),Y={class:"pc-cell"},Z={class:"pc-item pc-menu"},$=B(()=>a("p",{class:"pc-title"},"菜单授权",-1)),ee={class:"tree-node-label"},te={key:0},ae={class:"menu-permission-list"},oe={class:"menu-permission-list"},se={class:"pc-btn"},le=j({__name:"index",setup(p){const x={children:"children",label:"name",value:"id"};let i=u(),V=u([]),m=u(),k=u([]),D=u([]);const N=async()=>{try{const l=await L(),e=await H();(l==null?void 0:l.code)===2e3&&(V.value=l.data),(e==null?void 0:e.code)===2e3&&(console.log(e.data),D.value=e.data)}catch{return}},T=async()=>{if(i.value===4){const l=await O(),e=X.toArrayTree(l.data,{parentKey:"parent",strict:!1});k.value=e}};return q(()=>{N()}),(l,e)=>{const F=d("el-radio"),R=d("el-radio-group"),E=d("el-tree-select"),P=d("el-checkbox"),M=d("el-tree"),U=d("el-button");return s(),n("div",J,[a("div",Q,[W,a("div",Y,[c(R,{modelValue:r(i),"onUpdate:modelValue":e[0]||(e[0]=t=>I(i)?i.value=t:i=t),class:"pc-data-permission"},{default:_(()=>[(s(!0),n(b,null,y(r(V),t=>(s(),w(F,{key:t.label,label:t.value,onChange:T},{default:_(()=>[v(C(t.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"]),r(i)===4?(s(),w(E,{key:0,"node-key":"id",modelValue:r(m),"onUpdate:modelValue":e[1]||(e[1]=t=>I(m)?m.value=t:m=t),props:x,data:r(k),multiple:"","check-strictly":"","render-after-expand":!1,"show-checkbox":"",class:"pc-custom-dept"},null,8,["modelValue","data"])):S("",!0)])]),a("div",Z,[$,a("div",null,[c(M,{props:x,data:r(D),"show-checkbox":"","node-key":"id","default-expand-all":"","expand-on-click-node":!1,class:"dc-menu-tree"},{default:_(({node:t,data:f})=>[a("div",{class:z(["pc-tree-node",{"tree-node-label-border":!f.is_catalog}])},[a("p",ee,C(t.label),1),f.is_catalog?S("",!0):(s(),n("div",te,[a("ul",ae,[(s(!0),n(b,null,y(f.menuPermission,o=>(s(),n("li",{key:o.id,class:"menu-permission-item"},[c(P,{modelValue:o.id,"onUpdate:modelValue":h=>o.id=h,label:o.name},null,8,["modelValue","onUpdate:modelValue","label"])]))),128))]),a("ul",oe,[(s(!0),n(b,null,y(f.columns,o=>(s(),n("li",{key:o.id,class:"menu-permission-item"},[c(P,{modelValue:o.id,"onUpdate:modelValue":h=>o.id=h,label:o.title},null,8,["modelValue","onUpdate:modelValue","label"])]))),128))])]))],2)]),_:1},8,["data"])])]),a("div",se,[c(U,{type:"primary"},{default:_(()=>[v("确定")]),_:1}),c(U,null,{default:_(()=>[v("取消")]),_:1})])])}}});const ue=K(le,[["__scopeId","data-v-996afbe0"]]);export{ue as default};
