2023-06-06 10:46:36 +08:00
|
|
|
import{_ as Ye,P as je,a as Qe,r as v,A as te,a6 as He,U as Ge,B as Je,d,T as ae,o as u,c as S,e as l,w as t,g as f,l as k,f as a,I as L,G as y,j as ne,J as T,K as D,k as r,m as h,H as oe,x as se,s as We}from"./index.68b143c5.js";import{e as Xe,l as Ze,f as el,h as ll,r as tl,i as ue,j as al,k as nl}from"./user.83c93ab1.js";const ol={class:"app-container"},sl={class:"head-container"},ul={class:"head-container"},dl={class:"dialog-footer"},rl=k("div",{class:"el-upload__text"},[h("\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\uFF0C\u6216"),k("em",null,"\u70B9\u51FB\u4E0A\u4F20")],-1),il={class:"el-upload__tip text-center"},pl={class:"el-upload__tip"},ml=k("span",null,"\u4EC5\u5141\u8BB8\u5BFC\u5165xls\u3001xlsx\u683C\u5F0F\u6587\u4EF6\u3002",-1),fl={class:"dialog-footer"},cl=je({name:"User"}),_l=Object.assign(cl,{setup(vl){const de=Qe(),{proxy:i}=We(),{sys_normal_disable:H,sys_user_sex:re}=i.useDict("sys_normal_disable","sys_user_sex"),G=v([]),x=v(!1),O=v(!0),P=v(!0),z=v([]),J=v(!0),W=v(!0),A=v(0),E=v(""),$=v([]),B=v(""),M=v(void 0),ie=v(void 0),Y=v([]),j=v([]),b=te({open:!1,title:"",isUploading:!1,updateSupport:0,headers:{Authorization:"Bearer "+He()},url:"/stage-api/system/user/importData"}),I=v([{key:0,label:"\u7528\u6237\u7F16\u53F7",visible:!0},{key:1,label:"\u7528\u6237\u540D\u79F0",visible:!0},{key:2,label:"\u7528\u6237\u6635\u79F0",visible:!0},{key:3,label:"\u90E8\u95E8",visible:!0},{key:4,label:"\u624B\u673A\u53F7\u7801",visible:!0},{key:5,label:"\u72B6\u6001",visible:!0},{key:6,label:"\u521B\u5EFA\u65F6\u95F4",visible:!0}]),pe=te({form:{},queryParams:{pageNum:1,pageSize:10,userName:void 0,phonenumber:void 0,status:void 0,deptId:void 0},rules:{userName:[{required:!0,message:"\u7528\u6237\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"},{min:2,max:20,message:"\u7528\u6237\u540D\u79F0\u957F\u5EA6\u5FC5\u987B\u4ECB\u4E8E 2 \u548C 20 \u4E4B\u95F4",trigger:"blur"}],nickName:[{required:!0,message:"\u7528\u6237\u6635\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],password:[{required:!0,message:"\u7528\u6237\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"},{min:5,max:20,message:"\u7528\u6237\u5BC6\u7801\u957F\u5EA6\u5FC5\u987B\u4ECB\u4E8E 5 \u548C 20 \u4E4B\u95F4",trigger:"blur"}],email:[{type:"email",message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u90AE\u7BB1\u5730\u5740",trigger:["blur","change"]}],phonenumber:[{pattern:/^1[3|4|5|6|7|8|9][0-9]\d{8}$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801",trigger:"blur"}]}}),{queryParams:c,form:s,rules:me}=Ge(pe),fe=(o,n)=>o?n.label.indexOf(o)!==-1:!0;Je(B,o=>{i.$refs.deptTreeRef.filter(o)});function ce(){Xe().then(o=>{M.value=o.data})}function U(){O.value=!0,Ze(i.addDateRange(c.value,$.value)).then(o=>{O.value=!1,G.value=o.rows,A.value=o.total})}function _e(o){c.value.deptId=o.id,R()}function R(){c.value.pageNum=1,U()}function ve(){$.value=[],i.resetForm("queryRef"),c.value.deptId=void 0,i.$refs.tree.setCurrentKey(null),R()}function X(o){const n=o.userId||z.value;i.$modal.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u7528\u6237\u7F16\u53F7\u4E3A"'+n+'"\u7684\u6570\u636E\u9879\uFF1F').then(function(){return el(n)}).then(()=>{U(),i.$modal.msgSuccess("\u5220\u9664\u6210\u529F")}).catch(()=>{})}function be(){i.download("system/user/export",{...c.value},`user_${new Date().getTime()}.xlsx`)}function ge(o){let n=o.status==="0"?"\u542F\u7528":"\u505C\u7528";i.$modal.confirm('\u786E\u8BA4\u8981"'+n+'""'+o.userName+'"\u7528\u6237\u5417?').then(function(){return ll(o.userId,o.status)}).then(()=>{i.$modal.msgSuccess(n+"\u6210\u529F")}).catch(function(){o.status=o.status==="0"?"1":"0"})}function he(o){const n=o.userId;de.push("/system/user-auth/role/"+n)}function ye(o){i.$prompt('\u8BF7\u8F93\u5165"'+o.userName+'"\u7684\u65B0\u5BC6\u7801',"\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",closeOnClickModal:!1,inputPattern:/^.{5,20}$/,inputErrorMessage:"\u7528\u6237\u5BC6\u7801\u957F\u5EA6\u5FC5\u987B\u4ECB\u4E8E 5 \u548C 20 \u4E4B\u95F4"}).then(({value:n})=>{tl(o.userId,n).then(p=>{i.$modal.msgSuccess("\u4FEE\u6539\u6210\u529F\uFF0C
|