import{a7 as R,F as V,ai as g}from"./index.CL7yl-Wb.js";import B from"./index.BipP_faY.js";import F from"./index.EOVfw-TV.js";import M from"./index.BZIHOrY1.js";import{G as N,D as A}from"./api.BbNWdaep.js";import{a as x,r as l,q as j,aj as d,J as w,o as C,K as c,S as s,b,u as n,y as E,M as G}from"./vue.D1BjjNmv.js";import{_ as K}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.es.DmevZXPX.js";import"./md5.DLPczxzP.js";import"./crud.46u6YrKA.js";import"./dictionary.BGob_AR7.js";import"./authFunction.D75vbqds.js";import"./index.vue_vue_type_script_setup_true_name_importExcel_lang.B4Fdev5j.js";import"./echarts.BCoidMgp.js";const q={class:"dept-box dept-left"},z={class:"dept-box dept-table"},I=x({name:"dept"}),J=x({...I,setup(L){let p=l([]),_=l([]),o=l(!1),i=l({}),f=l(null),D=l(null);const m=async()=>{let e=await N({});if((e==null?void 0:e.code)===2e3&&Array.isArray(e.data)){const t=R.toArrayTree(e.data,{parentKey:"parent",children:"children"});p.value=t}},y=e=>{var t;(t=f.value)==null||t.handleDoRefreshUser(e.id)},T=(e,t)=>{V.confirm("您确认删除该部门吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{var r;const a=await A(e);t(),(a==null?void 0:a.code)===2e3&&(g(a.msg),m(),(r=f.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],i.value=t}o.value=!0},h=e=>{e==="submit"&&m(),o.value=!1,i.value={}};return j(()=>{m()}),(e,t)=>{const a=d("el-col"),r=d("el-row"),u=d("el-drawer"),k=d("fs-page");return C(),w(k,null,{default:c(()=>[s(r,{class:"dept-el-row"},{default:c(()=>[s(a,{span:6},{default:c(()=>[b("div",q,[s(B,{ref_key:"deptTreeRef",ref:D,treeData:n(p),onTreeClick:y,onUpdateDept:U,onDeleteDept:T},null,8,["treeData"])])]),_:1}),s(a,{span:18},{default:c(()=>[b("div",z,[s(M,{ref_key:"deptUserRef",ref:f},null,512)])]),_:1})]),_:1}),s(u,{modelValue:n(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(()=>[n(o)?(C(),w(F,{key:0,initFormData:n(i),treeData:n(p),cacheData:n(_),onDrawerClose:h},null,8,["initFormData","treeData","cacheData"])):G("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),re=K(J,[["__scopeId","data-v-24cbbb3f"]]);export{re as default};
