import{V as g,d as I,r as t,a as L,Z as d,c_ as $,cZ as j,aw as q,c as A,o as E,w as a,j as i,W as S,l as s,ds as U,H as W,aI as Z,p as z,B as F,i as H,X}from"./index-9PRMimni.js";import{B as G}from"./Table-0PViRYCf.js";import{_ as J}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{d as O,f as Q,c as Y}from"./company-PiwOjwod.js";import{_ as ee}from"./CreateDrawer.vue_vue_type_script_setup_true_lang-C6Kl7MYm.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"./TreeSelect-BZh2DeCh.js";const{t:u}=g(),oe=[{title:"No.",key:"num",width:60,render:(w,e)=>e+1},{title:u("permission.company.name"),key:"name"},{title:u("permission.company.higher"),key:"parentName"},{title:u("permission.company.code"),key:"code"}],he=I({__name:"index",setup(w){const{t:e}=g(),_=j(),k=$(),f=t(),c=t(),b=t([]),x=t(),l=t([]),m=t(e("permission.company.add")),p=t([]),v=L({width:150,title:e("common.optionsText"),key:"action",fixed:"right",align:"center",render(o){return d(J,{style:"text",actions:[{label:e("common.optionsDelText"),labelShow:!1,icon:d("i",{class:"iconfont icon-Delete red"}),onClick:R.bind(null,o)},{label:e("common.optionsEditText"),labelShow:!1,icon:d("i",{class:"iconfont icon-a-Frame28"}),onClick:h.bind(null,o)}]})}});async function T(o){return Q({...o})}function C(o){b.value=o,x.value=l.value.filter(n=>o.includes(n.id)).map(n=>n.username).join("，")}function y(){f.value.reload()}function D(){m.value=e("permission.company.add"),c.value.openModal()}function h(o){m.value=e("permission.company.edit"),c.value.openModal(),c.value.getInfo(o.id)}function R(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 O(o.id),_.success(e("common.delPop.success")),y()}catch{_.error(e("common.delPop.error"))}}})}async function B(){l.value=await Y()}return q(()=>{B()}),(o,n)=>{const P=F,N=Z,K=W,M=S,V=X;return E(),A(V,null,{default:a(()=>[i(M,{bordered:!1,class:"proCard"},{default:a(()=>[i(s(G),{columns:s(oe),request:r=>T(r),"row-key":r=>r.id,ref_key:"basicTableRef",ref:f,actionColumn:s(v),"onUpdate:checkedRowKeys":C,pagination:!0,"virtual-scroll":"","expanded-row-keys":s(p),"onUpdate:expandedRowKeys":n[0]||(n[0]=r=>U(p)?p.value=r:null)},{tableTitle:a(()=>[i(K,null,{default:a(()=>[i(N,{trigger:"hover"},{trigger:a(()=>[i(P,{type:"primary",strong:"",bordered:"",secondary:"",class:"size-8",onClick:D},{icon:a(()=>n[1]||(n[1]=[H("i",{class:"iconfont icon-ADD"},null,-1)])),_:1})]),default:a(()=>[n[2]||(n[2]=z(" Add "))]),_:1})]),_:1})]),_:1},8,["columns","request","row-key","actionColumn","expanded-row-keys"])]),_:1}),i(ee,{ref_key:"createDrawerRef",ref:c,title:s(m),deptList:s(l),onChange:y},null,8,["title","deptList"])]),_:1})}}});export{he as default};
