index.BH-EVF6M.js 5.4 KB

1
  1. import{d as z,r as i,Z as G,j as K,ai as v,aq as J,o as U,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,K as Y,F as $,M as ee,S as V}from"./vue.1RczIYhx.js";import{C as te,O as oe,w as P,n as se}from"./index.DYFzjhQc.js";import"./elementPlus.CXoFsoPv.js";import{M as N}from"./md5.DLPczxzP.js";import{c as ae,g as ne,r as le}from"./crud.BAv9R1xh.js";import{_ as re}from"./index.vue_vue_type_script_setup_true_name_importExcel_lang.CluoUvmL.js";import{i as F,L as ie}from"./echarts.DoXO02ct.js";import{_ as de}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./dictionary.Cc7w6JTx.js";import"./authFunction.C1mZum89.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"},ve={class:"di-cell"},_e={class:"content"},he={class:"di-cell"},ge={class:"dialog-footer"},xe=z({__name:"index",setup(Pe,{expose:M}){let S,D;const k=i(),B=i(),{crudExpose:_}=te({crudRef:k,crudBinding:B});let h=i(""),R=i(),O=i(),c=i(!1),n=i({}),d=i(!1),m=i(!1),t=G({id:0,newPassword:"",newPassword2:""});const E=()=>{var r,g;const s=((r=n.value.sub_dept_map)==null?void 0:r.map(f=>f.name))||[],e=((g=n.value.sub_dept_map)==null?void 0:g.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 ie(0,0,0,1,[{offset:0,color:"#83bff6"},{offset:.5,color:"#188df0"},{offset:1,color:"#188df0"}])}}]};S.setOption(w)},L=()=>{var e,w,r;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:((r=n.value.gender)==null?void 0:r.unknown)||0,name:"未知"}]}]};D.setOption(s)},y=async()=>{const s=await ne(h.value,c.value?"1":"0");(s==null?void 0:s.code)===2e3&&(n.value=s.data,E(),L())},I=s=>{h.value=s,_.doSearch({form:{dept:s}}),y()},T=()=>{I(h.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(O.value),y(),_.doRefresh()}),M({handleDoRefreshUser:I});const{crudOptions:H}=ae({crudExpose:_,context:{getDeptInfo:y,isShowChildFlag:c,handleResetPwdOpen:W}});return oe({crudExpose:_,crudOptions:H,context:{}}),(s,e)=>{const w=v("el-switch"),r=v("el-button"),g=v("fs-crud"),f=v("el-input"),j=v("el-dialog"),q=J("auth");return U(),Q($,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",ve,[e[7]||(e[7]=o("p",null,"部门简介:",-1)),o("p",_e,x(a(n).description||"无"),1)]),o("div",he,[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(h),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:O},null,512)],512),[[X,!a(d)]]),p(g,Y({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(r,{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((U(),ee(re,{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",ge,[p(r,{onClick:b},{default:u(()=>e[10]||(e[10]=[V("取消")])),_:1}),p(r,{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)}}}),Ie=de(xe,[["__scopeId","data-v-eabee23c"]]);export{Ie as default};