index.b65d96c7.js 5.4 KB

1
  1. import{d as z,r,Z as G,j as K,ai as _,aq as J,o as O,c as Q,P as A,V as X,u as a,a as o,T as x,U as p,D as C,O as u,M as Y,S as V,K as $,F as ee}from"./vue.86c1cb21.js";import{t as te,x as oe,w as P,m as se}from"./index.59c4c6ab.js";import"./elementPlus.8e650391.js";import{M as N}from"./md5.b5efbca3.js";import{c as ae,g as ne,r as le}from"./crud.518144c9.js";import{_ as ie}from"./index.vue_vue_type_script_setup_true_name_importExcel_lang.2dfa8b0c.js";import{i as F,L as re}from"./echarts.041eecf8.js";import{_ as de}from"./_plugin-vue_export-helper.c27b6911.js";import"./dictionary.a8cda1ac.js";import"./authFunction.db0b1d3f.js";const pe={class:"dept-user-com-box dept-info"},ue={class:"di-left"},ce={class:"di-cell"},me={class:"content"},we={class:"di-cell"},fe={class:"content"},_e={class:"di-cell"},ve={class:"content"},ge={class:"di-cell"},he={class:"dialog-footer"},xe=z({__name:"index",setup(Pe,{expose:M}){let S,D;const k=r(),B=r(),{crudExpose:v}=te({crudRef:k,crudBinding:B});let g=r(""),R=r(),I=r(),c=r(!1),n=r({}),d=r(!1),m=r(!1),t=G({id:0,newPassword:"",newPassword2:""});const E=()=>{var i,h;const s=((i=n.value.sub_dept_map)==null?void 0:i.map(f=>f.name))||[],e=((h=n.value.sub_dept_map)==null?void 0:h.map(f=>f.count))||[],w={tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},xAxis:{type:"category",data:s,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 re(0,0,0,1,[{offset:0,color:"#83bff6"},{offset:.5,color:"#188df0"},{offset:1,color:"#188df0"}])}}]};S.setOption(w)},L=()=>{var e,w,i;const s={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=n.value.gender)==null?void 0:e.male)||0,name:"男"},{value:((w=n.value.gender)==null?void 0:w.female)||0,name:"女"},{value:((i=n.value.gender)==null?void 0:i.unknown)||0,name:"未知"}]}]};D.setOption(s)},y=async()=>{const s=await ne(g.value,c.value?"1":"0");(s==null?void 0:s.code)===2e3&&(n.value=s.data,E(),L())},U=s=>{g.value=s,v.doSearch({form:{dept:s}}),y()},T=()=>{U(g.value)},W=({id:s})=>{t.id=s,m.value=!0},b=()=>{m.value=!1,t.id=0,t.newPassword="",t.newPassword2=""},Z=async()=>{if(!t.id){P("请选择用户!");return}if(!t.newPassword||!t.newPassword2){P("请输入密码!");return}if(t.newPassword!==t.newPassword2){P("两次输入密码不一致");return}const s=new RegExp("(?=.*[0-9])(?=.*[a-zA-Z]).{8,30}");if(!s.test(t.newPassword)||!s.test(t.newPassword2)){P("您的密码复杂度太低(密码中必须包含字母、数字)");return}const e=await le(t.id,{newPassword:N.hashStr(t.newPassword),newPassword2:N.hashStr(t.newPassword2)});(e==null?void 0:e.code)===2e3&&(se(e.msg||"修改成功!"),b())};K(()=>{S=F(R.value),D=F(I.value),y(),v.doRefresh()}),M({handleDoRefreshUser:U});const{crudOptions:H}=ae({crudExpose:v,context:{getDeptInfo:y,isShowChildFlag:c,handleResetPwdOpen:W}});return oe({crudExpose:v,crudOptions:H,context:{}}),(s,e)=>{const w=_("el-switch"),i=_("el-button"),h=_("fs-crud"),f=_("el-input"),j=_("el-dialog"),q=J("auth");return O(),Q(ee,null,[A(o("div",pe,[o("div",ue,[o("h3",null,x(a(n).dept_name||""),1),o("div",ce,[e[5]||(e[5]=o("p",null,"部门负责人:",-1)),o("p",me,x(a(n).owner||"无"),1)]),o("div",we,[e[6]||(e[6]=o("p",null,"部门人数:",-1)),o("p",fe,x(a(n).dept_user||0)+"人",1)]),o("div",_e,[e[7]||(e[7]=o("p",null,"部门简介:",-1)),o("p",ve,x(a(n).description||"无"),1)]),o("div",ge,[e[8]||(e[8]=o("p",null,"显示子级:",-1)),p(w,{modelValue:a(c),"onUpdate:modelValue":e[0]||(e[0]=l=>C(c)?c.value=l:c=l),"inline-prompt":"","active-text":"是","inactive-text":"否",disabled:!a(g),onChange:T,style:{"--el-switch-on-color":"var(--el-color-primary)"}},null,8,["modelValue","disabled"])])]),o("div",{style:{height:"180px",width:"380px"},ref_key:"deptCountBar",ref:R},null,512),o("div",{style:{height:"180px",width:"200px"},ref_key:"deptSexPie",ref:I},null,512)],512),[[X,!a(d)]]),p(h,$({ref_key:"crudRef",ref:k},B.value,{customClass:a(d)?"dept-user-com-box dept-user-com-table-cover":"dept-user-com-box dept-user-com-table"}),{"toolbar-left":u(()=>[p(i,{icon:a(d)?"View":"Hide",circle:"",onClick:e[1]||(e[1]=l=>C(d)?d.value=!a(d):d=!a(d))},null,8,["icon"])]),"actionbar-right":u(()=>[A((O(),Y(ie,{api:"api/system/user/"},{default:u(()=>e[9]||(e[9]=[V("导入 ")])),_:1})),[[q,"user:Import"]])]),_:1},16,["customClass"]),p(j,{modelValue:a(m),"onUpdate:modelValue":e[4]||(e[4]=l=>C(m)?m.value=l:m=l),title:"重设密码",width:"400px",draggable:"","before-close":b},{footer:u(()=>[o("span",he,[p(i,{onClick:b},{default:u(()=>e[10]||(e[10]=[V("取消")])),_:1}),p(i,{type:"primary",onClick:Z},{default:u(()=>e[11]||(e[11]=[V(" 保存 ")])),_:1})])]),default:u(()=>[o("div",null,[p(f,{modelValue:a(t).newPassword,"onUpdate:modelValue":e[2]||(e[2]=l=>a(t).newPassword=l),type:"password",placeholder:"请输入密码","show-password":"",style:{"margin-bottom":"20px"}},null,8,["modelValue"]),p(f,{modelValue:a(t).newPassword2,"onUpdate:modelValue":e[3]||(e[3]=l=>a(t).newPassword2=l),type:"password",placeholder:"请再次输入密码","show-password":""},null,8,["modelValue"])])]),_:1},8,["modelValue"])],64)}}});const Ue=de(xe,[["__scopeId","data-v-eabee23c"]]);export{Ue as default};