Agriculture-front-end/dist/assets/selectUser.72674ea3.js
2023-06-22 06:50:23 +08:00

2 lines
3.7 KiB
JavaScript

import{_ as q,z as A,r as f,A as E,d as r,o as F,c as P,g as Q,e,w as l,l as y,m as _,f as n,j as N,x as O,C as G,D as H,B as J,L as M,s as W}from"./index.9172db1d.js";import{u as X,d as Y}from"./role.c5b62e20.js";const Z={class:"dialog-footer"},ee=A({name:"SelectUser"}),oe=Object.assign(ee,{props:{roleId:{type:[Number,String]}},emits:["ok"],setup(S,{expose:C,emit:V}){const k=S,{proxy:p}=W(),{sys_normal_disable:I}=p.useDict("sys_normal_disable"),h=f([]),i=f(!1),g=f(0),v=f([]),a=E({pageNum:1,pageSize:10,roleId:void 0,userName:void 0,phonenumber:void 0});function U(){a.roleId=k.roleId,b(),i.value=!0}function x(s){p.$refs.refTable.toggleRowSelection(s)}function R(s){v.value=s.map(o=>o.userId)}function b(){X(a).then(s=>{h.value=s.rows,g.value=s.total})}function m(){a.pageNum=1,b()}function T(){p.resetForm("queryRef"),m()}function D(){const s=a.roleId,o=v.value.join(",");if(o==""){p.$modal.msgError("\u8BF7\u9009\u62E9\u8981\u5206\u914D\u7684\u7528\u6237");return}Y({roleId:s,userIds:o}).then(d=>{p.$modal.msgSuccess(d.msg),d.code===200&&(i.value=!1,V("ok"))})}return C({show:U}),(s,o)=>{const d=r("el-input"),w=r("el-form-item"),c=r("el-button"),K=r("el-form"),u=r("el-table-column"),z=r("dict-tag"),B=r("el-table"),L=r("pagination"),$=r("el-row"),j=r("el-dialog");return F(),P(M,null,[Q(" \u6388\u6743\u7528\u6237 "),e(j,{title:"\u9009\u62E9\u7528\u6237",modelValue:n(i),"onUpdate:modelValue":o[5]||(o[5]=t=>J(i)?i.value=t:null),width:"800px",top:"5vh","append-to-body":""},{footer:l(()=>[y("div",Z,[e(c,{type:"primary",onClick:D},{default:l(()=>[_("\u786E \u5B9A")]),_:1}),e(c,{onClick:o[4]||(o[4]=t=>i.value=!1)},{default:l(()=>[_("\u53D6 \u6D88")]),_:1})])]),default:l(()=>[e(K,{model:n(a),ref:"queryRef",inline:!0},{default:l(()=>[e(w,{label:"\u7528\u6237\u540D\u79F0",prop:"userName"},{default:l(()=>[e(d,{modelValue:n(a).userName,"onUpdate:modelValue":o[0]||(o[0]=t=>n(a).userName=t),placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D\u79F0",clearable:"",style:{width:"200px"},onKeyup:N(m,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(w,{label:"\u624B\u673A\u53F7\u7801",prop:"phonenumber"},{default:l(()=>[e(d,{modelValue:n(a).phonenumber,"onUpdate:modelValue":o[1]||(o[1]=t=>n(a).phonenumber=t),placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801",clearable:"",style:{width:"200px"},onKeyup:N(m,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(w,null,{default:l(()=>[e(c,{type:"primary",icon:"Search",onClick:m},{default:l(()=>[_("\u641C\u7D22")]),_:1}),e(c,{icon:"Refresh",onClick:T},{default:l(()=>[_("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["model"]),e($,null,{default:l(()=>[e(B,{onRowClick:x,ref:"refTable",data:n(h),onSelectionChange:R,height:"260px"},{default:l(()=>[e(u,{type:"selection",width:"55"}),e(u,{label:"\u7528\u6237\u540D\u79F0",prop:"userName","show-overflow-tooltip":!0}),e(u,{label:"\u7528\u6237\u6635\u79F0",prop:"nickName","show-overflow-tooltip":!0}),e(u,{label:"\u90AE\u7BB1",prop:"email","show-overflow-tooltip":!0}),e(u,{label:"\u624B\u673A",prop:"phonenumber","show-overflow-tooltip":!0}),e(u,{label:"\u72B6\u6001",align:"center",prop:"status"},{default:l(t=>[e(z,{options:n(I),value:t.row.status},null,8,["options","value"])]),_:1}),e(u,{label:"\u521B\u5EFA\u65F6\u95F4",align:"center",prop:"createTime",width:"180"},{default:l(t=>[y("span",null,O(s.parseTime(t.row.createTime)),1)]),_:1})]),_:1},8,["data"]),G(e(L,{total:n(g),page:n(a).pageNum,"onUpdate:page":o[2]||(o[2]=t=>n(a).pageNum=t),limit:n(a).pageSize,"onUpdate:limit":o[3]||(o[3]=t=>n(a).pageSize=t),onPagination:b},null,8,["total","page","limit"]),[[H,n(g)>0]])]),_:1})]),_:1},8,["modelValue"])],2112)}}}),ne=q(oe,[["__file","/Users/luce/Desktop/\u6570\u5B57\u4E09\u519C/Agriculture-front-end/src/views/system/role/selectUser.vue"]]);export{ne as default};