import{V as w,d as I,u as L,r as n,a as $,Z as m,c_ as j,aw as q,c as A,o as E,w as a,j as i,W as S,l as y,H as U,aI as W,p as z,B as F,i as H,X}from"./index-9PRMimni.js";import{B as Z}from"./Table-0PViRYCf.js";import{_ as G}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{c as J,f as O,d as Q}from"./dept-C5ivQanA.js";import{_ as Y}from"./CreateDrawer.vue_vue_type_script_setup_true_lang-DcYvrD4P.js";import"./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./componentMap-CElCaWis.js";import"./propTypes-CebMRUpe.js";import"./format-DgF6KtHk.js";import"./omit-B2_8Y6O_.js";import"./_flatRest-DBrd2CHT.js";import"./flatten-DeoUZLdb.js";import"./print-CT_2hrjP.js";import"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import"./useModal-CO65vga3.js";import"./componentSetting-DVhNDBTO.js";import"./useTimeout-BxFilWvD.js";import"./usePageCache-DluHn7Yy.js";import"./tabsView-BXskTdVh.js";import"./Flex-CTSf12gq.js";import"./index-DkvzUEqh.js";import"./index-kKnqLkWM.js";import"./company-PiwOjwod.js";import"./TreeSelect-BZh2DeCh.js";const{t:l}=w(),ee=[{title:"No.",key:"num",width:60,render:(g,e)=>e+1},{title:l("permission.dept.name"),key:"name"},{title:l("permission.dept.higher"),key:"parentName"},{title:l("permission.dept.companyName"),key:"companyName"},{title:l("permission.dept.code"),key:"code"}],Be=I({__name:"dept",setup(g){const{t:e}=w(),d=L(),k=j(),u=n(),v=n([]),b=n(),c=n([]),r=n(),p=n(e("permission.dept.add")),_=n([]),x=$({width:150,title:e("common.optionsText"),key:"action",fixed:"right",align:"center",render(o){return m(G,{style:"text",actions:[{label:e("common.optionsDelText"),labelShow:!1,icon:m("i",{class:"iconfont icon-Delete red"}),onClick:N.bind(null,o)},{label:e("common.optionsEditText"),labelShow:!1,icon:m("i",{class:"iconfont icon-a-Frame28"}),onClick:h.bind(null,o)}]})}}),T=async o=>await O({...o});function D(o){v.value=o,b.value=c.value.filter(t=>o.includes(t.id)).map(t=>t.username).join("，")}function f(){u.value.reload()}function C(){p.value=e("permission.dept.add"),r.value.openModal()}function h(o){p.value=e("permission.dept.edit"),r.value.openModal(),r.value.getInfo(o.id)}function N(o){k.info({title:e("common.delPop.title"),content:e("common.delPop.cont"),positiveText:e("common.okText"),negativeText:e("common.cancelText"),onPositiveClick:async()=>{try{await J(o.id),d.success(e("common.delPop.success")),f()}catch{d.error(e("common.delPop.error"))}}})}async function B(){const o=await Q();c.value=o}return q(()=>{B()}),(o,t)=>{const P=F,R=W,K=U,M=S,V=X;return E(),A(V,null,{default:a(()=>[i(M,{bordered:!1,class:"proCard"},{default:a(()=>[i(y(Z),{columns:y(ee),request:s=>T(s),"row-key":s=>s.id,ref_key:"basicTableRef",ref:u,actionColumn:x,"onUpdate:checkedRowKeys":D,pagination:!0,"virtual-scroll":"","expanded-row-keys":_.value,"onUpdate:expandedRowKeys":t[0]||(t[0]=s=>_.value=s)},{tableTitle:a(()=>[i(K,null,{default:a(()=>[i(R,{trigger:"hover"},{trigger:a(()=>[i(P,{type:"primary",strong:"",bordered:"",secondary:"",class:"size-8",onClick:C},{icon:a(()=>t[1]||(t[1]=[H("i",{class:"iconfont icon-ADD"},null,-1)])),_:1})]),default:a(()=>[t[2]||(t[2]=z(" Add "))]),_:1})]),_:1})]),_:1},8,["columns","request","row-key","actionColumn","expanded-row-keys"])]),_:1}),i(Y,{ref_key:"createDrawerRef",ref:r,title:p.value,deptList:c.value,onChange:f},null,8,["title","deptList"])]),_:1})}}});export{Be as default};
