index-DZziKc2w.js 3.3 KB

1
  1. var c=(e,l,o)=>new Promise((p,s)=>{var d=t=>{try{r(o.next(t))}catch(i){s(i)}},a=t=>{try{r(o.throw(t))}catch(i){s(i)}},r=t=>t.done?p(t.value):Promise.resolve(t.value).then(d,a);r((o=o.apply(e,l)).next())});import{i as y}from"./index-Ci2v5RRf.js";import{B,u as S}from"./useTable-CaBV0A9D.js";import{T as v}from"./index-BPgn07DB.js";import{ao as F,v as I,_ as R}from"./entry/index-CP6zkLsN-1726190694502.js";import{u as $}from"./index-Bh1SitHa.js";import{D as A,c as E,s as M}from"./DepartmentDrawer-DS63mIbR.js";import{g as N,d as C}from"./department-B6vcHhpB.js";import{M as V}from"./antd-Bp5u6ujY.js";import{d as L,f as g,k as f,a6 as m,_ as D,$ as O,a8 as u,a7 as T,G as _,a2 as U,a0 as k}from"./vue-CmlY4eyV.js";import"./ExclamationCircleOutlined-BR1Enpph.js";import"./useForm-DYTnyn58.js";import"./index-D5QnXKgB.js";import"./tree-Cz4SXb17.js";import"./copyTextToClipboard-o-L2h2rZ.js";import"./index-BAxfTGAN.js";import"./index-caYAhZot.js";import"./index-Ci1vkPDT.js";import"./index-B_Pz7KLI.js";import"./index-5JuY20kX.js";import"./useWindowSizeFn-c2oM7mG1.js";import"./plugin-BdCvh_fX.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C4hclMrd.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-Dv9W1z21.js";const j=L({name:"DepartmentManagement",components:{BasicTable:B,DepartmentDrawer:A,TableAction:v,Button:F},setup(){const{t:e}=I.useI18n(),l=g(),o=g(!1),[p,{openDrawer:s}]=$(),[d,{reload:a}]=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)=>{l.value=n,o.value=n.length>0}}});function r(){s(!0,{isUpdate:!1})}function t(n){s(!0,{record:n,isUpdate:!0})}function i(n){return c(this,null,function*(){(yield C({ids:[n.id]})).code===0&&(yield a())})}function h(){return c(this,null,function*(){V.confirm({title:e("common.deleteConfirm"),icon:f(y.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){(yield C({ids:l.value})).code===0&&(o.value=!1,yield a())})},onCancel(){}})})}function b(){return c(this,null,function*(){yield a()})}return{t:e,registerTable:d,registerDrawer:p,handleCreate:r,handleEdit:t,handleDelete:i,handleSuccess:b,handleBatchDelete:h,showDeleteButton:o}}});function x(e,l,o,p,s,d){const a=m("Button"),r=m("a-button"),t=m("TableAction"),i=m("BasicTable"),h=m("DepartmentDrawer");return D(),O("div",null,[f(i,{onRegister:e.registerTable},{tableTitle:u(()=>[e.showDeleteButton?(D(),T(a,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:u(()=>[_(U(e.t("common.delete")),1)]),_:1},8,["onClick"])):k("",!0)]),toolbar:u(()=>[f(r,{type:"primary",onClick:e.handleCreate},{default:u(()=>[_(" 添加租户 ")]),_: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"])):k("",!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};