import{d as N,r as i,j as O,a9 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,aq as j,ar as q}from"./vue.65d9dadc.js";import{T as K,M as Z}from"./index.373e4c1e.js";import"./elementPlus.c5b0e04f.js";import{c as $,g as z}from"./crud.335fd81e.js";import{_ as J}from"./index.vue_vue_type_script_setup_true_name_importExcel_lang.1f27ca12.js";import{i as V,L as Q}from"./echarts.72dc8373.js";import{_ as X}from"./_plugin-vue_export-helper.c27b6911.js";import"./dictionary.e641576e.js";import"./dictionary.afac2490.js";const v=p=>(j("data-v-ebcfe13d"),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=N({__name:"index",setup(p,{expose:P}){let b,w;const C=i(),S=i(),{crudExpose:u}=K({crudRef:C,crudBinding:S});let _=i(""),D=i(),B=i(),r=i(!1),s=i({}),n=i(!1);const R=()=>{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"}])}}]};b.setOption(d)},A=()=>{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:"未知"}]}]};w.setOption(t)},x=async()=>{const t=await z(_.value,r.value?"1":"0");(t==null?void 0:t.code)===2e3&&(s.value=t.data,R(),A())},k=t=>{_.value=t,u.doSearch({form:{dept:t}}),x()},L=()=>{k(_.value)};O(()=>{u.doRefresh(),b=V(D.value),w=V(B.value),x()}),P({handleDoRefreshUser:k});const{crudOptions:M}=$({crudExpose:u,context:{getDeptInfo:x,isShowChildFlag:r}});return Z({crudExpose:u,crudOptions:M,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:L,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:C},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 we=X(ue,[["__scopeId","data-v-ebcfe13d"]]);export{we as default};
