import{h as G,B as H,a as c,r as J,k as r,G as V,b as g,c as M,H as m,I as $,f as t,l as o,m as l,p as x,q as f,v as h,J as W,d as X,t as Y,K as Z}from"./index-B51TLSWN.js";import ee from"./selectUser-DZUqq5Vw.js";import{a as oe,b as te,c as le}from"./role-Bk-TN7oK.js";const ne={class:"app-container"},ae=Z({name:"AuthUser"}),de=Object.assign(ae,{setup(se){const R=G(),{proxy:i}=H(),{sys_normal_disable:P}=i.useDict("sys_normal_disable"),S=c([]),w=c(!0),b=c(!0),k=c(!0),y=c(0),N=c([]),a=J({pageNum:1,pageSize:10,roleId:R.params.roleId,userName:void 0,phonenumber:void 0});function p(){w.value=!0,oe(a).then(s=>{S.value=s.rows,y.value=s.total,w.value=!1})}function A(){const s={path:"/system/role"};i.$tab.closeOpenPage(s)}function _(){a.pageNum=1,p()}function B(){i.resetForm("queryRef"),_()}function T(s){N.value=s.map(e=>e.userId),k.value=!s.length}function q(){i.$refs.selectRef.show()}function D(s){i.$modal.confirm('确认要取消该用户"'+s.userName+'"角色吗？').then(function(){return le({userId:s.userId,roleId:a.roleId})}).then(()=>{p(),i.$modal.msgSuccess("取消授权成功")}).catch(()=>{})}function K(){const s=a.roleId,e=N.value.join(",");i.$modal.confirm("是否取消选中用户授权数据项?").then(function(){return te({roleId:s,userIds:e})}).then(()=>{p(),i.$modal.msgSuccess("取消授权成功")}).catch(()=>{})}return p(),(s,e)=>{const U=r("el-input"),v=r("el-form-item"),d=r("el-button"),j=r("el-form"),C=r("el-col"),z=r("right-toolbar"),L=r("el-row"),u=r("el-table-column"),O=r("dict-tag"),Q=r("el-table"),E=r("pagination"),I=V("hasPermi"),F=V("loading");return g(),M("div",ne,[m(o(j,{model:t(a),ref:"queryRef",inline:!0},{default:l(()=>[o(v,{label:"用户名称",prop:"userName"},{default:l(()=>[o(U,{modelValue:t(a).userName,"onUpdate:modelValue":e[0]||(e[0]=n=>t(a).userName=n),placeholder:"请输入用户名称",clearable:"",style:{width:"240px"},onKeyup:x(_,["enter"])},null,8,["modelValue"])]),_:1}),o(v,{label:"手机号码",prop:"phonenumber"},{default:l(()=>[o(U,{modelValue:t(a).phonenumber,"onUpdate:modelValue":e[1]||(e[1]=n=>t(a).phonenumber=n),placeholder:"请输入手机号码",clearable:"",style:{width:"240px"},onKeyup:x(_,["enter"])},null,8,["modelValue"])]),_:1}),o(v,null,{default:l(()=>[o(d,{type:"primary",icon:"Search",onClick:_},{default:l(()=>[...e[5]||(e[5]=[f("搜索",-1)])]),_:1}),o(d,{icon:"Refresh",onClick:B},{default:l(()=>[...e[6]||(e[6]=[f("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"]),[[$,t(b)]]),o(L,{gutter:10,class:"mb8"},{default:l(()=>[o(C,{span:1.5},{default:l(()=>[m((g(),h(d,{type:"primary",plain:"",icon:"Plus",onClick:q},{default:l(()=>[...e[7]||(e[7]=[f("添加用户",-1)])]),_:1})),[[I,["system:role:add"]]])]),_:1}),o(C,{span:1.5},{default:l(()=>[m((g(),h(d,{type:"danger",plain:"",icon:"CircleClose",disabled:t(k),onClick:K},{default:l(()=>[...e[8]||(e[8]=[f("批量取消授权",-1)])]),_:1},8,["disabled"])),[[I,["system:role:remove"]]])]),_:1}),o(C,{span:1.5},{default:l(()=>[o(d,{type:"warning",plain:"",icon:"Close",onClick:A},{default:l(()=>[...e[9]||(e[9]=[f("关闭",-1)])]),_:1})]),_:1}),o(z,{showSearch:t(b),"onUpdate:showSearch":e[2]||(e[2]=n=>W(b)?b.value=n:null),onQueryTable:p},null,8,["showSearch"])]),_:1}),m((g(),h(Q,{data:t(S),onSelectionChange:T},{default:l(()=>[o(u,{type:"selection",width:"55",align:"center"}),o(u,{label:"用户名称",prop:"userName","show-overflow-tooltip":!0}),o(u,{label:"用户昵称",prop:"nickName","show-overflow-tooltip":!0}),o(u,{label:"邮箱",prop:"email","show-overflow-tooltip":!0}),o(u,{label:"手机",prop:"phonenumber","show-overflow-tooltip":!0}),o(u,{label:"状态",align:"center",prop:"status"},{default:l(n=>[o(O,{options:t(P),value:n.row.status},null,8,["options","value"])]),_:1}),o(u,{label:"创建时间",align:"center",prop:"createTime",width:"180"},{default:l(n=>[X("span",null,Y(s.parseTime(n.row.createTime)),1)]),_:1}),o(u,{label:"操作",align:"center","class-name":"small-padding fixed-width"},{default:l(n=>[m((g(),h(d,{link:"",type:"primary",icon:"CircleClose",onClick:re=>D(n.row)},{default:l(()=>[...e[10]||(e[10]=[f("取消授权",-1)])]),_:1},8,["onClick"])),[[I,["system:role:remove"]]])]),_:1})]),_:1},8,["data"])),[[F,t(w)]]),m(o(E,{total:t(y),page:t(a).pageNum,"onUpdate:page":e[3]||(e[3]=n=>t(a).pageNum=n),limit:t(a).pageSize,"onUpdate:limit":e[4]||(e[4]=n=>t(a).pageSize=n),onPagination:p},null,8,["total","page","limit"]),[[$,t(y)>0]]),o(t(ee),{ref:"selectRef",roleId:t(a).roleId,onOk:_},null,8,["roleId"])])}}});export{de as default};
