import{X as k,O as b}from"./index.ad3efb29.js";import g from"./index.f227b7ca.js";import V from"./index.a6649bfb.js";import B from"./index.d9972855.js";import{G as M,D as N}from"./api.f6d3ac4b.js";import{j as F}from"./elementPlus.4833989a.js";import{d as j,r as l,j as A,ai as i,o as x,M as w,O as c,U as n,a as y,u as s,R as O,D as E}from"./vue.adf17aba.js";import{_ as G}from"./_plugin-vue_export-helper.c27b6911.js";import"./echarts.72dc8373.js";import"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.e9645613.js";import"./index.es.d2375c1e.js";import"./crud.6f3b1f27.js";import"./api.abdfe0a6.js";import"./dictionary.bf4815bd.js";import"./dictionary.506d4581.js";import"./index.vue_vue_type_script_setup_true_name_importExcel_lang.ba63a0f6.js";import"./deptDialog.vue_vue_type_script_setup_true_lang.ede3ec2f.js";const X={class:"dept-box dept-left"},z={class:"dept-box dept-table"},I=j({__name:"index",setup(K){let p=l([]),_=l([]),o=l(!1),d=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",strict:!0});p.value=t}},C=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],d.value=t}o.value=!0},h=e=>{e==="submit"&&f(),o.value=!1,d.value={}};return A(()=>{f()}),(e,t)=>{const a=i("el-col"),r=i("el-row"),u=i("el-drawer"),R=i("fs-page");return x(),w(R,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(p),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=>E(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(d),treeData:s(p),cacheData:s(_),onDrawerClose:h},null,8,["initFormData","treeData","cacheData"])):O("",!0)]),_:1},8,["modelValue"])]),_:1})}}});const ne=G(I,[["__scopeId","data-v-876615c5"]]);export{ne as default};
