import{_ as q,$ as z,u as F,r as i,a6 as J,d as s,aa as P,o as N,c as G,e as t,w as a,f as o,J as S,k as H,l as m,x as V,V as L,R as C,m as $,s as M,p as Q,q as W}from"./index.bba5ce79.js";import{h as X,i as Y}from"./user.4c0e1c1c.js";const T=_=>(Q("data-v-7d915e85"),_=_(),W(),_),Z={class:"app-container"},ee=T(()=>m("h4",{class:"form-header h4"},"\u57FA\u672C\u4FE1\u606F",-1)),te=T(()=>m("h4",{class:"form-header h4"},"\u89D2\u8272\u4FE1\u606F",-1)),oe={style:{"text-align":"center","margin-left":"-120px","margin-top":"30px"}},le=z({name:"AuthRole"}),ne=Object.assign(le,{setup(_){const b=F(),{proxy:f}=M(),v=i(!0),h=i(0),u=i(1),d=i(10),w=i([]),g=i([]),r=i({nickName:void 0,userName:void 0,userId:void 0});function B(l){f.$refs.roleRef.toggleRowSelection(l)}function U(l){w.value=l.map(e=>e.roleId)}function j(l){return l.roleId}function I(){const l={path:"/system/user"};f.$tab.closeOpenPage(l)}function A(){const l=r.value.userId,e=w.value.join(",");Y({userId:l,roleIds:e}).then(c=>{f.$modal.msgSuccess("\u6388\u6743\u6210\u529F"),I()})}return(()=>{const l=b.params&&b.params.userId;l&&(v.value=!0,X(l).then(e=>{r.value=e.user,g.value=e.roles,h.value=g.value.length,J(()=>{g.value.forEach(c=>{c.flag&&f.$refs.roleRef.toggleRowSelection(c)})}),v.value=!1}))})(),(l,e)=>{const c=s("el-input"),R=s("el-form-item"),x=s("el-col"),D=s("el-row"),k=s("el-form"),p=s("el-table-column"),E=s("el-table"),K=s("pagination"),y=s("el-button"),O=P("loading");return N(),G("div",Z,[ee,t(k,{model:o(r),"label-width":"80px"},{default:a(()=>[t(D,null,{default:a(()=>[t(x,{span:8,offset:2},{default:a(()=>[t(R,{label:"\u7528\u6237\u6635\u79F0",prop:"nickName"},{default:a(()=>[t(c,{modelValue:o(r).nickName,"onUpdate:modelValue":e[0]||(e[0]=n=>o(r).nickName=n),disabled:""},null,8,["modelValue"])]),_:1})]),_:1}),t(x,{span:8,offset:2},{default:a(()=>[t(R,{label:"\u767B\u5F55\u8D26\u53F7",prop:"userName"},{default:a(()=>[t(c,{modelValue:o(r).userName,"onUpdate:modelValue":e[1]||(e[1]=n=>o(r).userName=n),disabled:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"]),te,S((N(),H(E,{"row-key":j,onRowClick:B,ref:"roleRef",onSelectionChange:U,data:o(g).slice((o(u)-1)*o(d),o(u)*o(d))},{default:a(()=>[t(p,{label:"\u5E8F\u53F7",width:"55",type:"index",align:"center"},{default:a(n=>[m("span",null,V((o(u)-1)*o(d)+n.$index+1),1)]),_:1}),t(p,{type:"selection","reserve-selection":!0,width:"55"}),t(p,{label:"\u89D2\u8272\u7F16\u53F7",align:"center",prop:"roleId"}),t(p,{label:"\u89D2\u8272\u540D\u79F0",align:"center",prop:"roleName"}),t(p,{label:"\u6743\u9650\u5B57\u7B26",align:"center",prop:"roleKey"}),t(p,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"180"},{default:a(n=>[m("span",null,V(l.parseTime(n.row.createTime)),1)]),_:1})]),_:1},8,["data"])),[[O,o(v)]]),S(t(K,{total:o(h),page:o(u),"onUpdate:page":e[2]||(e[2]=n=>C(u)?u.value=n:null),limit:o(d),"onUpdate:limit":e[3]||(e[3]=n=>C(d)?d.value=n:null)},null,8,["total","page","limit"]),[[L,o(h)>0]]),t(k,{"label-width":"100px"},{default:a(()=>[m("div",oe,[t(y,{type:"primary",onClick:e[4]||(e[4]=n=>A())},{default:a(()=>[$("\u63D0\u4EA4")]),_:1}),t(y,{onClick:e[5]||(e[5]=n=>I())},{default:a(()=>[$("\u8FD4\u56DE")]),_:1})])]),_:1})])}}}),re=q(ne,[["__scopeId","data-v-7d915e85"]]);export{re as default};
