import{X as R,O as b}from"./index.373e4c1e.js";import g from"./index.675d451e.js";import V from"./index.c8cd2be6.js";import B from"./index.00e4f3c6.js";import{G as M,D as N}from"./api.0bfb3a06.js";import{E}from"./elementPlus.c5b0e04f.js";import{d as F,r as l,j as A,a9 as d,o as x,E as w,G as c,M as n,a as y,u as s,J as G,t as j}from"./vue.65d9dadc.js";import{_ as O}from"./_plugin-vue_export-helper.c27b6911.js";import"./echarts.72dc8373.js";import"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.278ff746.js";import"./index.es.d2375c1e.js";import"./crud.335fd81e.js";import"./dictionary.e641576e.js";import"./dictionary.afac2490.js";import"./index.vue_vue_type_script_setup_true_name_importExcel_lang.1f27ca12.js";const X={class:"dept-box dept-left"},z={class:"dept-box dept-table"},I=F({__name:"index",setup(J){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=R.toArrayTree(e.data,{parentKey:"parent",children:"children",strict:!0});i.value=t}},C=e=>{var t;(t=m.value)==null||t.handleDoRefreshUser(e.id)},T=(e,t)=>{E.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 A(()=>{f()}),(e,t)=>{const a=d("el-col"),r=d("el-row"),u=d("el-drawer"),k=d("fs-page");return x(),w(k,null,{default:c(()=>[n(r,{class:"dept-el-row"},{default:c(()=>[n(a,{span:6},{default:c(()=>[y("div",X,[n(g,{ref_key:"deptTreeRef",ref:D,treeData:s(i),onTreeClick:C,onUpdateDept:U,onDeleteDept:T},null,8,["treeData"])])]),_:1}),n(a,{span:18},{default:c(()=>[y("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=>j(o)?o.value=v:o=v),title:"部门配置",direction:"rtl",size:"500px","close-on-click-modal":!1,"before-close":h},{default:c(()=>[s(o)?(x(),w(V,{key:0,initFormData:s(p),treeData:s(i),cacheData:s(_),onDrawerClose:h},null,8,["initFormData","treeData","cacheData"])):G("",!0)]),_:1},8,["modelValue"])]),_:1})}}});const re=O(I,[["__scopeId","data-v-876615c5"]]);export{re as default};
