import{X as b,n as V,p as g}from"./index.Dzkftxcu.js";import B from"./index.CXuabdX6.js";import F from"./index.CgSD74y2.js";import N from"./index.ajdHND2t.js";import{G as M,D as A}from"./api.DXSIyw8u.js";import{w as C,D as r,O as G,aF as c,a0 as h,y as w,a1 as n,a8 as l,z as v,G as s,R as z,a3 as E}from"./vue.Bi2Y_N79.js";import{_ as O}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.es.DmevZXPX.js";import"./md5.DLPczxzP.js";import"./crud.CHw_7n-T.js";import"./dictionary.8p9vqoBs.js";import"./authFunction.CWrv1prI.js";import"./index.vue_vue_type_script_setup_true_name_importExcel_lang.CMR4YSWq.js";import"./echarts.D5sl-F-p.js";const X={class:"dept-box dept-left"},j={class:"dept-box dept-table"},I=C({name:"dept"}),K=C({...I,setup(L){let d=r([]),m=r([]),a=r(!1),p=r({}),i=r(null),u=r(null);const f=async()=>{let e=await M({});if(e?.code===2e3&&Array.isArray(e.data)){const t=b.toArrayTree(e.data,{parentKey:"parent",children:"children"});d.value=t}},x=e=>{i.value?.handleDoRefreshUser(e.id)},y=(e,t)=>{V.confirm("您确认删除该部门吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{const o=await A(e);t(),o?.code===2e3&&(g(o.msg),f(),i.value?.handleDoRefreshUser(""))})},T=(e,t)=>{if(e==="update"&&t){const o=u.value?.treeRef?.currentNode.parent.data||{};m.value=[o],p.value=t}a.value=!0},_=e=>{e==="submit"&&f(),a.value=!1,p.value={}};return G(()=>{f()}),(e,t)=>{const o=c("el-col"),R=c("el-row"),U=c("el-drawer"),k=c("fs-page");return w(),h(k,null,{default:n(()=>[l(R,{class:"dept-el-row"},{default:n(()=>[l(o,{span:3},{default:n(()=>[v("div",X,[l(B,{ref_key:"deptTreeRef",ref:u,treeData:s(d),onTreeClick:x,onUpdateDept:T,onDeleteDept:y},null,8,["treeData"])])]),_:1}),l(o,{span:21},{default:n(()=>[v("div",j,[l(N,{ref_key:"deptUserRef",ref:i},null,512)])]),_:1})]),_:1}),l(U,{modelValue:s(a),"onUpdate:modelValue":t[0]||(t[0]=D=>z(a)?a.value=D:a=D),title:"部门配置",direction:"rtl",size:"500px","close-on-click-modal":!1,"before-close":_},{default:n(()=>[s(a)?(w(),h(F,{key:0,initFormData:s(p),treeData:s(d),cacheData:s(m),onDrawerClose:_},null,8,["initFormData","treeData","cacheData"])):E("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),re=O(K,[["__scopeId","data-v-31d84f24"]]);export{re as default};