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