1 |
- import{a as H,r as i,_ as Q,q as X,aj as f,at as Y,c as A,o as C,L as O,S as d,T as $,u as o,b as s,Q as x,y as V,K as u,M as ee,J as te,P as S,H as oe,R as se}from"./vue.D1BjjNmv.js";import{ap as ae,aq as ne,ag as M,ai as y,af as le}from"./index.CUwaQBEt.js";import{M as E}from"./md5.DLPczxzP.js";import{c as re,g as ie,r as de}from"./crud.CI0Vy9iI.js";import{_ as pe}from"./index.vue_vue_type_script_setup_true_name_importExcel_lang.DZp19gnR.js";import{i as F,L as ue}from"./echarts.BCoidMgp.js";import{_ as ce}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./dictionary.BEngG2X4.js";import"./authFunction.Du6kfec4.js";const me={class:"dept-user-com-box dept-info"},we={class:"di-left"},fe={class:"di-cell"},_e={class:"content"},ve={class:"di-cell"},ge={class:"content"},he={class:"di-cell"},xe={class:"content"},ye={class:"di-cell"},Pe={key:0,style:{display:"flex","justify-content":"center","align-items":"center"}},be={class:"dialog-footer"},Ce=H({name:"user"}),Ve=H({...Ce,setup(Se,{expose:T}){let k,D;const R=i(),B=i(),{crudExpose:v}=ae({crudRef:R,crudBinding:B});let g=i(""),I=i(),N=i(),c=i(!1),l=i({}),p=i(!1),m=i(!1),t=Q({id:0,newPassword:"",newPassword2:""});const W=()=>{var r,h;const a=((r=l.value.sub_dept_map)==null?void 0:r.map(_=>_.name))||[],e=((h=l.value.sub_dept_map)==null?void 0:h.map(_=>_.count))||[],w={tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},xAxis:{type:"category",data:a,axisTick:{alignWithLabel:!0}},yAxis:{type:"value"},dataZoom:[{type:"inside"}],grid:{top:"6%",right:"5%",bottom:"10%",left:"10%"},series:[{data:e,type:"bar",barWidth:"60%",showBackground:!0,itemStyle:{color:new ue(0,0,0,1,[{offset:0,color:"#83bff6"},{offset:.5,color:"#188df0"},{offset:1,color:"#188df0"}])}}]};k.setOption(w)},j=()=>{var e,w,r;const a={tooltip:{trigger:"item"},legend:{orient:"vertical",right:"0%",left:"65%",top:"center",itemWidth:12,itemHeight:12},series:[{type:"pie",radius:"65%",center:["32%","50%"],label:{show:!1,position:"center"},color:["#188df0","#f56c6c","#dcdfe6"],data:[{value:((e=l.value.gender)==null?void 0:e.male)||0,name:"男"},{value:((w=l.value.gender)==null?void 0:w.female)||0,name:"女"},{value:((r=l.value.gender)==null?void 0:r.unknown)||0,name:"未知"}]}]};D.setOption(a)},P=async()=>{const a=await ie(g.value,c.value?"1":"0");(a==null?void 0:a.code)===2e3&&(l.value=a.data,W(),j())},U=a=>{g.value=a,v.doSearch({form:{dept:a}}),P()},q=()=>{U(g.value)},Z=({id:a})=>{t.id=a,m.value=!0},b=()=>{m.value=!1,t.id=0,t.newPassword="",t.newPassword2=""},z=async()=>{if(!t.id){y("请选择用户!");return}if(!t.newPassword||!t.newPassword2){y("请输入密码!");return}if(t.newPassword!==t.newPassword2){y("两次输入密码不一致");return}const a=new RegExp("(?=.*[0-9])(?=.*[a-zA-Z]).{8,30}");if(!a.test(t.newPassword)||!a.test(t.newPassword2)){y("您的密码复杂度太低(密码中必须包含字母、数字)");return}const e=await de(t.id,{newPassword:E.hashStr(t.newPassword),newPassword2:E.hashStr(t.newPassword2)});(e==null?void 0:e.code)===2e3&&(le(e.msg||"修改成功!"),b())};X(()=>{k=F(I.value),D=F(N.value),P(),v.doRefresh()}),T({handleDoRefreshUser:U});const{crudOptions:G}=re({crudExpose:v,context:{getDeptInfo:P,isShowChildFlag:c,handleResetPwdOpen:Z}});return ne({crudExpose:v,crudOptions:G,context:{}}),(a,e)=>{const w=f("el-switch"),r=f("el-button"),h=f("el-image"),_=f("fs-crud"),L=f("el-input"),J=f("el-dialog"),K=Y("auth");return C(),A(se,null,[O(s("div",me,[s("div",we,[s("h3",null,x(o(l).dept_name||""),1),s("div",fe,[e[5]||(e[5]=s("p",null,"部门负责人:",-1)),s("p",_e,x(o(l).owner||"无"),1)]),s("div",ve,[e[6]||(e[6]=s("p",null,"部门人数:",-1)),s("p",ge,x(o(l).dept_user||0)+"人",1)]),s("div",he,[e[7]||(e[7]=s("p",null,"部门简介:",-1)),s("p",xe,x(o(l).description||"无"),1)]),s("div",ye,[e[8]||(e[8]=s("p",null,"显示子级:",-1)),d(w,{modelValue:o(c),"onUpdate:modelValue":e[0]||(e[0]=n=>V(c)?c.value=n:c=n),"inline-prompt":"","active-text":"是","inactive-text":"否",disabled:!o(g),onChange:q,style:{"--el-switch-on-color":"var(--el-color-primary)"}},null,8,["modelValue","disabled"])])]),s("div",{style:{height:"180px",width:"380px"},ref_key:"deptCountBar",ref:I},null,512),s("div",{style:{height:"180px",width:"200px"},ref_key:"deptSexPie",ref:N},null,512)],512),[[$,!o(p)]]),d(_,oe({ref_key:"crudRef",ref:R},B.value,{customClass:o(p)?"dept-user-com-box dept-user-com-table-cover":"dept-user-com-box dept-user-com-table"}),{"toolbar-left":u(()=>[d(r,{icon:o(p)?"View":"Hide",circle:"",onClick:e[1]||(e[1]=n=>V(p)?p.value=!o(p):p=!o(p))},null,8,["icon"])]),"actionbar-right":u(()=>[O((C(),te(pe,{api:"api/system/user/"},{default:u(()=>e[9]||(e[9]=[S("导入 ")])),_:1})),[[K,"user:Import"]])]),cell_avatar:u(n=>[n.row.avatar?(C(),A("div",Pe,[d(h,{style:{width:"50px",height:"50px","border-radius":"50%","aspect-ratio":"1 /1"},src:o(M)(n.row.avatar),"preview-src-list":[o(M)(n.row.avatar)],"preview-teleported":!0},null,8,["src","preview-src-list"])])):ee("",!0)]),_:1},16,["customClass"]),d(J,{modelValue:o(m),"onUpdate:modelValue":e[4]||(e[4]=n=>V(m)?m.value=n:m=n),title:"重设密码",width:"400px",draggable:"","before-close":b},{footer:u(()=>[s("span",be,[d(r,{onClick:b},{default:u(()=>e[10]||(e[10]=[S("取消")])),_:1}),d(r,{type:"primary",onClick:z},{default:u(()=>e[11]||(e[11]=[S(" 保存 ")])),_:1})])]),default:u(()=>[s("div",null,[d(L,{modelValue:o(t).newPassword,"onUpdate:modelValue":e[2]||(e[2]=n=>o(t).newPassword=n),type:"password",placeholder:"请输入密码","show-password":"",style:{"margin-bottom":"20px"}},null,8,["modelValue"]),d(L,{modelValue:o(t).newPassword2,"onUpdate:modelValue":e[3]||(e[3]=n=>o(t).newPassword2=n),type:"password",placeholder:"请再次输入密码","show-password":""},null,8,["modelValue"])])]),_:1},8,["modelValue"])],64)}}}),Oe=ce(Ve,[["__scopeId","data-v-6a53335b"]]);export{Oe as default};
|