import{h as H,z as J,j as m,A as G,r,H as V,o as g,a as M,I as c,J as $,f as t,d as o,w as l,m as x,e as f,p as h,C as W,b as X,t as Y,D as Z}from"./index-DRK7Vc9g.js";import ee from"./selectUser-vMlNEDTT.js";import{a as oe,b as te,c as le}from"./role-yevzKcKD.js";const ne={class:"app-container"},ae=Z({name:"AuthUser"}),de=Object.assign(ae,{setup(se){const R=H(),{proxy:i}=J(),{sys_normal_disable:A}=i.useDict("sys_normal_disable"),S=m([]),w=m(!0),b=m(!0),N=m(!0),y=m(0),k=m([]),a=G({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 P(){const s={path:"/system/role"};i.$tab.closeOpenPage(s)}function _(){a.pageNum=1,p()}function D(){i.resetForm("queryRef"),_()}function T(s){k.value=s.map(e=>e.userId),N.value=!s.length}function j(){i.$refs.selectRef.show()}function z(s){i.$modal.confirm('确认要取消该用户"'+s.userName+'"角色吗？').then(function(){return le({userId:s.userId,roleId:a.roleId})}).then(()=>{p(),i.$modal.msgSuccess("取消授权成功")}).catch(()=>{})}function B(){const s=a.roleId,e=k.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"),q=r("el-form"),C=r("el-col"),K=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,[c(o(q,{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:D},{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(()=>[c((g(),h(d,{type:"primary",plain:"",icon:"Plus",onClick:j},{default:l(()=>[...e[7]||(e[7]=[f("添加用户",-1)])]),_:1})),[[I,["system:role:add"]]])]),_:1}),o(C,{span:1.5},{default:l(()=>[c((g(),h(d,{type:"danger",plain:"",icon:"CircleClose",disabled:t(N),onClick:B},{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:P},{default:l(()=>[...e[9]||(e[9]=[f("关闭",-1)])]),_:1})]),_:1}),o(K,{showSearch:t(b),"onUpdate:showSearch":e[2]||(e[2]=n=>W(b)?b.value=n:null),onQueryTable:p},null,8,["showSearch"])]),_:1}),c((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(A),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=>[c((g(),h(d,{link:"",type:"primary",icon:"CircleClose",onClick:re=>z(n.row)},{default:l(()=>[...e[10]||(e[10]=[f("取消授权",-1)])]),_:1},8,["onClick"])),[[I,["system:role:remove"]]])]),_:1})]),_:1},8,["data"])),[[F,t(w)]]),c(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};
