import{a as J,J as G,r as m,v as H,d as r,N as V,o as g,g as M,z as c,O as $,l as t,k as o,f as l,m as x,n as f,e as h,B as W,i as X,t as Y,L as Z}from"./index-C3I6HYnn.js";import ee from"./selectUser-CmhqV-PR.js";import{a as oe,b as te,c as le}from"./role-BjTun1CJ.js";const ne={class:"app-container"},ae=Z({name:"AuthUser"}),de=Object.assign(ae,{setup(se){const R=J(),{proxy:i}=G(),{sys_normal_disable:P}=i.useDict("sys_normal_disable"),N=m([]),w=m(!0),b=m(!0),S=m(!0),y=m(0),k=m([]),a=H({pageNum:1,pageSize:10,roleId:R.params.roleId,userName:void 0,phonenumber:void 0});function p(){w.value=!0,oe(a).then(s=>{N.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){k.value=s.map(e=>e.userId),S.value=!s.length}function z(){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 L(){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"),O=r("el-form"),C=r("el-col"),j=r("right-toolbar"),q=r("el-row"),u=r("el-table-column"),K=r("dict-tag"),Q=r("el-table"),E=r("pagination"),I=V("hasPermi"),F=V("loading");return g(),M("div",ne,[c(o(O,{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(q,{gutter:10,class:"mb8"},{default:l(()=>[o(C,{span:1.5},{default:l(()=>[c((g(),h(d,{type:"primary",plain:"",icon:"Plus",onClick:z},{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(S),onClick:L},{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(j,{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(N),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(K,{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=>[c((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)]]),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};
