import{X as U,E as k,R as V}from"./index.lP_uh0LI.js";import B from"./index.ClDmy7lQ.js";import N from"./index.D9AVS0lr.js";import F from"./index.DGZ9oeZU.js";import{G as M,D as A}from"./api.D5l9uVQq.js";import{d as b,a as l,o as E,b as d,h as v,f as C,w as c,g as s,s as x,u as n,$ as j,j as G}from"./vue.BxlDVA1H.js";import{_ as X}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.es.DmevZXPX.js";import"./md5.DLPczxzP.js";import"./crud.DiuvoTwR.js";import"./authFunction.z5AMEiSQ.js";import"./dictionary.D0i47SYU.js";import"./index.vue_vue_type_script_setup_true_name_importExcel_lang.NIlRmFc0.js";import"./echarts.DQYQA18e.js";const z={class:"dept-box dept-left"},I={class:"dept-box dept-table"},K=b({name:"dept"}),L=b({...K,setup(O){let p=l([]),_=l([]),o=l(!1),i=l({}),f=l(null),D=l(null);const m=async()=>{let e=await M({});if(console.log(e),(e==null?void 0:e.code)===2e4&&Array.isArray(e.data)){const t=U.toArrayTree(e.data,{parentKey:"parent",children:"children"});console.log(t),p.value=t}},y=e=>{var t;(t=f.value)==null||t.handleDoRefreshUser(e.id)},T=(e,t)=>{k.confirm("您确认删除该部门吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{var r;const a=await A(e);t(),(a==null?void 0:a.code)===2e4&&(V(a.msg),m(),(r=f.value)==null||r.handleDoRefreshUser(""))})},g=(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],i.value=t}o.value=!0},h=e=>{e==="submit"&&m(),o.value=!1,i.value={}};return E(()=>{m()}),(e,t)=>{const a=d("el-col"),r=d("el-row"),u=d("el-drawer"),R=d("fs-page");return C(),v(R,null,{default:c(()=>[s(r,{class:"dept-el-row"},{default:c(()=>[s(a,{span:6},{default:c(()=>[x("div",z,[s(B,{ref_key:"deptTreeRef",ref:D,treeData:n(p),onTreeClick:y,onUpdateDept:g,onDeleteDept:T},null,8,["treeData"])])]),_:1}),s(a,{span:18},{default:c(()=>[x("div",I,[s(F,{ref_key:"deptUserRef",ref:f},null,512)])]),_:1})]),_:1}),s(u,{modelValue:n(o),"onUpdate:modelValue":t[0]||(t[0]=w=>j(o)?o.value=w:o=w),title:"部门配置",direction:"rtl",size:"500px","close-on-click-modal":!1,"before-close":h},{default:c(()=>[n(o)?(C(),v(N,{key:0,initFormData:n(i),treeData:n(p),cacheData:n(_),onDrawerClose:h},null,8,["initFormData","treeData","cacheData"])):G("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),re=X(L,[["__scopeId","data-v-eb225bca"]]);export{re as default};
