1 |
- var c=(e,a,o)=>new Promise((p,l)=>{var d=t=>{try{i(o.next(t))}catch(s){l(s)}},r=t=>{try{i(o.throw(t))}catch(s){l(s)}},i=t=>t.done?p(t.value):Promise.resolve(t.value).then(d,r);i((o=o.apply(e,a)).next())});import{i as B}from"./index-BQgPd3bX.js";import{B as _,u as S}from"./useTable-B6PunZL5.js";import{T as v}from"./index-BIj58_Cj.js";import{ao as F,v as I,_ as R}from"./entry/index-DJx93RYF-1731481145019.js";import{u as $}from"./index-CzIUqxsa.js";import{D as A,c as E,s as M}from"./DepartmentDrawer-wk1xa3if.js";import{g as N,d as C}from"./department-DVahU7fr.js";import{M as V}from"./antd-CBeLo_oO.js";import{d as L,f as g,k as f,a9 as m,_ as D,$ as O,a7 as u,a6 as T,G as k,a2 as U,a0 as y}from"./vue-B5pbXMv7.js";import"./ExclamationCircleOutlined-Ca0mYuiu.js";import"./useForm-pwHPrILC.js";import"./index-D_SNX-7K.js";import"./tree-BtJaOqz0.js";import"./copyTextToClipboard-Dngb1Nn3.js";import"./index-BDsRYE32.js";import"./index-wDJjh9Os.js";import"./index-BzfGKMh3.js";import"./index-DkGmfgEA.js";import"./index-Cuu0w1HY.js";import"./useWindowSizeFn-BxA6-zLj.js";import"./plugin-C2XGVjF6.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-lvT7rWOs.js";const j=L({name:"DepartmentManagement",components:{BasicTable:_,DepartmentDrawer:A,TableAction:v,Button:F},setup(){const{t:e}=I.useI18n(),a=g(),o=g(!1),[p,{openDrawer:l}]=$(),[d,{reload:r}]=S({title:e("sys.department.departmentList"),api:N,columns:E,formConfig:{labelWidth:120,schemas:M},isTreeTable:!0,useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:30,title:e("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",onChange:(n,w)=>{a.value=n,o.value=n.length>0}}});function i(){l(!0,{isUpdate:!1})}function t(n){l(!0,{record:n,isUpdate:!0})}function s(n){return c(this,null,function*(){(yield C({ids:[n.id]})).code===0&&(yield r())})}function h(){return c(this,null,function*(){V.confirm({title:e("common.deleteConfirm"),icon:f(B.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){(yield C({ids:a.value})).code===0&&(o.value=!1,yield r())})},onCancel(){}})})}function b(){return c(this,null,function*(){yield r()})}return{t:e,registerTable:d,registerDrawer:p,handleCreate:i,handleEdit:t,handleDelete:s,handleSuccess:b,handleBatchDelete:h,showDeleteButton:o}}});function x(e,a,o,p,l,d){const r=m("Button"),i=m("a-button"),t=m("TableAction"),s=m("BasicTable"),h=m("DepartmentDrawer");return D(),O("div",null,[f(s,{onRegister:e.registerTable},{tableTitle:u(()=>[e.showDeleteButton?(D(),T(r,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:u(()=>[k(U(e.t("common.delete")),1)]),_:1},8,["onClick"])):y("",!0)]),toolbar:u(()=>[f(i,{type:"primary",onClick:e.handleCreate},{default:u(()=>a[0]||(a[0]=[k(" 添加租户 ")])),_:1},8,["onClick"])]),bodyCell:u(({column:b,record:n})=>[b.key==="action"?(D(),T(t,{key:0,actions:[{label:"编辑",onClick:e.handleEdit.bind(null,n)},{label:"删除",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,n)}}]},null,8,["actions"])):y("",!0)]),_:1},8,["onRegister"]),f(h,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const fe=R(j,[["render",x]]);export{fe as default};
|