import{r as g,X as K}from"./index.0d411246.js";import{d as L,r as u,j as M,a9 as d,o as s,c as n,a,M as c,G as _,F as b,a0 as y,E as C,K as v,L as U,u as r,t as B,J as I,z as R,aq as X,ar as j}from"./vue.3f733908.js";import{_ as A}from"./_plugin-vue_export-helper.c27b6911.js";import"./elementPlus.0e5067e4.js";import"./echarts.72dc8373.js";function G(){return g({url:"/api/system/role_menu_button_permission/data_scope/",method:"get"})}function J(){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 N=p=>(X("data-v-996afbe0"),p=p(),j(),p),O={class:"permission-com"},Q={class:"pc-item"},W=N(()=>a("p",{class:"pc-title"},"数据授权",-1)),Y={class:"pc-cell"},Z={class:"pc-item pc-menu"},$=N(()=>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=L({__name:"index",setup(p){const x={children:"children",label:"name",value:"id"};let i=u(),V=u([]),m=u(),k=u([]),D=u([]);const S=async()=>{try{const l=await G(),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}},E=async()=>{if(i.value===4){const l=await J(),e=K.toArrayTree(l.data,{parentKey:"parent",strict:!1});k.value=e}};return M(()=>{S()}),(l,e)=>{const T=d("el-radio"),q=d("el-radio-group"),z=d("el-tree-select"),P=d("el-checkbox"),F=d("el-tree"),w=d("el-button");return s(),n("div",O,[a("div",Q,[W,a("div",Y,[c(q,{modelValue:r(i),"onUpdate:modelValue":e[0]||(e[0]=t=>B(i)?i.value=t:i=t),class:"pc-data-permission"},{default:_(()=>[(s(!0),n(b,null,y(r(V),t=>(s(),C(T,{key:t.label,label:t.value,onChange:E},{default:_(()=>[v(U(t.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"]),r(i)===4?(s(),C(z,{key:0,"node-key":"id",modelValue:r(m),"onUpdate:modelValue":e[1]||(e[1]=t=>B(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"])):I("",!0)])]),a("div",Z,[$,a("div",null,[c(F,{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:R(["pc-tree-node",{"tree-node-label-border":!f.is_catalog}])},[a("p",ee,U(t.label),1),f.is_catalog?I("",!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(w,{type:"primary"},{default:_(()=>[v("确定")]),_:1}),c(w,null,{default:_(()=>[v("取消")]),_:1})])])}}});const ue=A(le,[["__scopeId","data-v-996afbe0"]]);export{ue as default};
