import{X as k,n as b}from"./index.K_MFulpu.js";import V from"./index.DUFSir39.js";import g from"./index.CTY6rz8e.js";import B from"./index.DrXzmHz2.js";import{G as M,D as N}from"./api.Bhp7pbJG.js";import{E as F}from"./elementPlus.CSBdF9Zt.js";import{d as A,r as l,j as E,ai as d,o as w,M as x,O as c,U as n,a as C,u as s,R as j,D as G}from"./vue.1RczIYhx.js";import{_ as O}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.EO34UlUs.js";import"./index.es.DmevZXPX.js";import"./md5.DLPczxzP.js";import"./crud.Cp1YEHjA.js";import"./dictionary.DpWy6kWR.js";import"./authFunction.CJG6xplX.js";import"./index.vue_vue_type_script_setup_true_name_importExcel_lang.BLGFwON2.js";import"./echarts.DoXO02ct.js";const X={class:"dept-box dept-left"},z={class:"dept-box dept-table"},I=A({__name:"index",setup(K){let i=l([]),_=l([]),o=l(!1),p=l({}),m=l(null),D=l(null);const f=async()=>{let e=await M({});if((e==null?void 0:e.code)===2e3&&Array.isArray(e.data)){const t=k.toArrayTree(e.data,{parentKey:"parent",children:"children"});i.value=t}},y=e=>{var t;(t=m.value)==null||t.handleDoRefreshUser(e.id)},T=(e,t)=>{F.confirm("您确认删除该部门吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{var r;const a=await N(e);t(),(a==null?void 0:a.code)===2e3&&(b(a.msg),f(),(r=m.value)==null||r.handleDoRefreshUser(""))})},U=(e,t)=>{var a,r;if(e==="update"&&t){const u=((r=(a=D.value)==null?void 0:a.treeRef)==null?void 0:r.currentNode.parent.data)||{};_.value=[u],p.value=t}o.value=!0},h=e=>{e==="submit"&&f(),o.value=!1,p.value={}};return E(()=>{f()}),(e,t)=>{const a=d("el-col"),r=d("el-row"),u=d("el-drawer"),R=d("fs-page");return w(),x(R,null,{default:c(()=>[n(r,{class:"dept-el-row"},{default:c(()=>[n(a,{span:6},{default:c(()=>[C("div",X,[n(V,{ref_key:"deptTreeRef",ref:D,treeData:s(i),onTreeClick:y,onUpdateDept:U,onDeleteDept:T},null,8,["treeData"])])]),_:1}),n(a,{span:18},{default:c(()=>[C("div",z,[n(B,{ref_key:"deptUserRef",ref:m},null,512)])]),_:1})]),_:1}),n(u,{modelValue:s(o),"onUpdate:modelValue":t[0]||(t[0]=v=>G(o)?o.value=v:o=v),title:"部门配置",direction:"rtl",size:"500px","close-on-click-modal":!1,"before-close":h},{default:c(()=>[s(o)?(w(),x(g,{key:0,initFormData:s(p),treeData:s(i),cacheData:s(_),onDrawerClose:h},null,8,["initFormData","treeData","cacheData"])):j("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),le=O(I,[["__scopeId","data-v-ac89d335"]]);export{le as default};
