import{d as P,r as i,j as O,a8 as g,o as T,c as F,H,N as U,u as o,a as e,L as f,M as h,t as I,G as y,K as W,B as E,F as G,ap as j,aq as q}from"./vue.95e072e2.js";import{T as K,M as Z}from"./index.8a64ecdf.js";import"./elementPlus.58179425.js";import{c as $,g as z}from"./crud.689c379a.js";import{_ as J}from"./index.vue_vue_type_script_setup_true_name_importExcel_lang.47d95a69.js";import{i as V,L as Q}from"./echarts.72dc8373.js";import{_ as X}from"./_plugin-vue_export-helper.c27b6911.js";import"./dictionary.fc2be08e.js";import"./dictionary.95047914.js";const v=p=>(j("data-v-41d2e418"),p=p(),q(),p),Y={class:"dept-user-com-box dept-info"},ee={class:"di-left"},te={class:"di-cell"},oe=v(()=>e("p",null,"部门负责人：",-1)),se={class:"content"},ae={class:"di-cell"},ne=v(()=>e("p",null,"部门人数：",-1)),ie={class:"content"},le={class:"di-cell"},ce=v(()=>e("p",null,"部门简介：",-1)),re={class:"content"},de={class:"di-cell"},pe=v(()=>e("p",null,"显示子级：",-1)),ue=P({name:"user"}),_e=P({...ue,setup(p,{expose:R}){let w,C;const b=i(),S=i(),{crudExpose:u}=K({crudRef:b,crudBinding:S});let _=i(""),D=i(),B=i(),r=i(!1),s=i({}),n=i(!1);const A=()=>{var l,m;const t=((l=s.value.sub_dept_map)==null?void 0:l.map(c=>c.name))||[],a=((m=s.value.sub_dept_map)==null?void 0:m.map(c=>c.count))||[],d={tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},xAxis:{type:"category",data:t,axisTick:{alignWithLabel:!0}},yAxis:{type:"value"},dataZoom:[{type:"inside"}],grid:{top:"6%",right:"5%",bottom:"10%",left:"10%"},series:[{data:a,type:"bar",barWidth:"60%",showBackground:!0,itemStyle:{color:new Q(0,0,0,1,[{offset:0,color:"#83bff6"},{offset:.5,color:"#188df0"},{offset:1,color:"#188df0"}])}}]};w.setOption(d)},L=()=>{var a,d,l;const t={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:((a=s.value.gender)==null?void 0:a.male)||0,name:"男"},{value:((d=s.value.gender)==null?void 0:d.female)||0,name:"女"},{value:((l=s.value.gender)==null?void 0:l.unknown)||0,name:"未知"}]}]};C.setOption(t)},x=async()=>{const t=await z(_.value,r.value?"1":"0");(t==null?void 0:t.code)===2e3&&(s.value=t.data,A(),L())},k=t=>{_.value=t,u.doSearch({form:{dept:t}}),x()},M=()=>{k(_.value)};O(()=>{u.doRefresh(),w=V(D.value),C=V(B.value),x()}),R({handleDoRefreshUser:k});const{crudOptions:N}=$({crudExpose:u,context:{getDeptInfo:x,isShowChildFlag:r}});return Z({crudExpose:u,crudOptions:N,context:{}}),(t,a)=>{const d=g("el-switch"),l=g("el-button"),m=g("fs-crud");return T(),F(G,null,[H(e("div",Y,[e("div",ee,[e("h3",null,f(o(s).dept_name||""),1),e("div",te,[oe,e("p",se,f(o(s).owner||"无"),1)]),e("div",ae,[ne,e("p",ie,f(o(s).dept_user||0)+"人",1)]),e("div",le,[ce,e("p",re,f(o(s).description||"无"),1)]),e("div",de,[pe,h(d,{modelValue:o(r),"onUpdate:modelValue":a[0]||(a[0]=c=>I(r)?r.value=c:r=c),"inline-prompt":"","active-text":"是","inactive-text":"否",disabled:!o(_),onChange:M,style:{"--el-switch-on-color":"var(--el-color-primary)"}},null,8,["modelValue","disabled"])])]),e("div",{style:{height:"180px",width:"380px"},ref_key:"deptCountBar",ref:D},null,512),e("div",{style:{height:"180px",width:"200px"},ref_key:"deptSexPie",ref:B},null,512)],512),[[U,!o(n)]]),h(m,E({ref_key:"crudRef",ref:b},S.value,{customClass:o(n)?"dept-user-com-box dept-user-com-table-cover":"dept-user-com-box dept-user-com-table"}),{"toolbar-left":y(()=>[h(l,{icon:o(n)?"View":"Hide",circle:"",onClick:a[1]||(a[1]=c=>I(n)?n.value=!o(n):n=!o(n))},null,8,["icon"])]),"actionbar-right":y(()=>[h(J,{api:"api/system/user/"},{default:y(()=>[W("导入 ")]),_:1})]),_:1},16,["customClass"])],64)}}});const be=X(_e,[["__scopeId","data-v-41d2e418"]]);export{be as default};
