import{B as e,G as l,C as a,D as o,y as t,P as r,Q as s,R as p}from"./element-plus-DSMJnpwa.js";import"./index-mv7arXuk.js";/* empty css                  *//* empty css               */import{_ as i}from"./index-CY3mI-ZB.js";/* empty css                    *//* empty css                        */import{_ as u}from"./index-ppR_FSA-.js";/* empty css               *//* empty css                     */import{B as n,g as m,a4 as d,H as c,I as f,O as g,M as b,k as v,u as _,ao as h,Y as w,P as y,Z as j,X as k,d as N,l as x}from"./vue-vendor-DZekML78.js";import{u as I,d as S}from"./index-BsT5MUUa.js";const V={class:"dialog-footer"},C=n({name:"SelectUser"}),R=n({...C,props:{roleId:{type:[Number,String],required:!0}},emits:["ok"],setup(n,{expose:C,emit:R}){const U=n,{proxy:P}=m(),{sys_normal_disable:z}=d(P?.useDict("sys_normal_disable")),B=N([]),T=N(!1),q=N(0),D=N([]),F=x({pageNum:1,pageSize:10,roleId:void 0,userName:void 0,phonenumber:void 0}),K=N(),Q=N(),$=e=>{K.value?.toggleRowSelection(e,!1)},E=e=>{D.value=e.map(e=>e.userId)},G=async()=>{const e=await I(F);B.value=e.rows,q.value=e.total},H=()=>{F.pageNum=1,G()},M=()=>{Q.value?.resetFields(),G()},O=R,X=async()=>{const e=F.roleId,l=D.value.join(",");""!=l?(await S({roleId:e,userIds:l}),P?.$modal.msgSuccess("分配成功"),O("ok"),T.value=!1):P?.$modal.msgError("请选择要分配的用户")};return C({show:()=>{F.roleId=U.roleId,G(),T.value=!0}}),(n,m)=>{const d=o,N=a,x=t,I=l,S=p,C=u,R=s,U=i,D=r,O=e;return c(),f(D,null,{default:g(()=>[b(O,{modelValue:_(T),"onUpdate:modelValue":m[5]||(m[5]=e=>v(T)?T.value=e:null),title:"选择用户",width:"800px",top:"5vh","append-to-body":""},{footer:g(()=>[y("div",V,[b(x,{type:"primary",onClick:X},{default:g(()=>[...m[8]||(m[8]=[w("确 定",-1)])]),_:1}),b(x,{onClick:m[4]||(m[4]=e=>T.value=!1)},{default:g(()=>[...m[9]||(m[9]=[w("取 消",-1)])]),_:1})])]),default:g(()=>[b(I,{ref_key:"queryFormRef",ref:Q,model:_(F),inline:!0},{default:g(()=>[b(N,{label:"用户名称",prop:"userName"},{default:g(()=>[b(d,{modelValue:_(F).userName,"onUpdate:modelValue":m[0]||(m[0]=e=>_(F).userName=e),placeholder:"请输入用户名称",clearable:"",onKeyup:h(H,["enter"])},null,8,["modelValue"])]),_:1}),b(N,{label:"手机号码",prop:"phonenumber"},{default:g(()=>[b(d,{modelValue:_(F).phonenumber,"onUpdate:modelValue":m[1]||(m[1]=e=>_(F).phonenumber=e),placeholder:"请输入手机号码",clearable:"",onKeyup:h(H,["enter"])},null,8,["modelValue"])]),_:1}),b(N,null,{default:g(()=>[b(x,{type:"primary",icon:"Search",onClick:H},{default:g(()=>[...m[6]||(m[6]=[w("搜索",-1)])]),_:1}),b(x,{icon:"Refresh",onClick:M},{default:g(()=>[...m[7]||(m[7]=[w("重置",-1)])]),_:1})]),_:1})]),_:1},8,["model"]),b(D,null,{default:g(()=>[b(R,{ref_key:"tableRef",ref:K,border:"",data:_(B),height:"260px",onRowClick:$,onSelectionChange:E},{default:g(()=>[b(S,{type:"selection",width:"55"}),b(S,{label:"用户名称",prop:"userName","show-overflow-tooltip":!0}),b(S,{label:"用户昵称",prop:"nickName","show-overflow-tooltip":!0}),b(S,{label:"邮箱",prop:"email","show-overflow-tooltip":!0}),b(S,{label:"手机",prop:"phonenumber","show-overflow-tooltip":!0}),b(S,{label:"状态",align:"center",prop:"status"},{default:g(e=>[b(C,{options:_(z),value:e.row.status},null,8,["options","value"])]),_:1}),b(S,{label:"创建时间",align:"center",prop:"createTime",width:"180"},{default:g(e=>[y("span",null,j(_(P).parseTime(e.row.createTime)),1)]),_:1})]),_:1},8,["data"]),_(q)>0?(c(),f(U,{key:0,page:_(F).pageNum,"onUpdate:page":m[2]||(m[2]=e=>_(F).pageNum=e),limit:_(F).pageSize,"onUpdate:limit":m[3]||(m[3]=e=>_(F).pageSize=e),total:_(q),onPagination:G},null,8,["page","limit","total"])):k("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1})}}});export{R as _};
