1 |
- var c=(e,l,o)=>new Promise((u,s)=>{var p=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?u(t.value):Promise.resolve(t.value).then(p,a);r((o=o.apply(e,l)).next())});import{i as B}from"./index-BSYd2hxY.js";import{B as D,u as T}from"./useTable-C16d97Pc.js";import{T as I}from"./index-CX4KF_X2.js";import{ao as R,v as $,_ as E}from"./entry/index-aWM9ONEg-1721905115166.js";import{u as A}from"./index-DsWc2dai.js";import{S as M,c as N,s as V}from"./ServerDrawer-CqUERXYS.js";import{g as F,d as g}from"./server-BJSD3nZD.js";import{M as L}from"./antd-c1uHJHtu.js";import{d as O,f as v,k as f,a7 as m,_ as b,$ as U,a9 as d,a8 as S,G as k,a1 as y,ab as _}from"./vue-YAQxJ0SI.js";import"./ExclamationCircleOutlined-CqKW4VDE.js";import"./useForm-BUs7QBU2.js";import"./index-CbXq8_QU.js";import"./tree-BeOocfO0.js";import"./copyTextToClipboard-BoCUzXqE.js";import"./index-BzTU6kMb.js";import"./index-AVXO_uSC.js";import"./index-BLu-LcKy.js";import"./index-D8KFrDWL.js";import"./index-CWChM6mK.js";import"./useWindowSizeFn-Ca3SEPFY.js";import"./plugin-BtkwVqDc.js";import"./onMountedOrActivated-9LbCg5GM.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-2hwmyCqe.js";const j=O({name:"ServerManagement",components:{BasicTable:D,ServerDrawer:M,TableAction:I,Button:R},setup(){const{t:e}=$.useI18n(),l=v(),o=v(!1),[u,{openDrawer:s}]=A(),[p,{reload:a}]=T({title:e("wechat.server.serverList"),api:F,columns:N,formConfig:{labelWidth:120,schemas:V},useSearchForm:!0,showTableSetting:!0,bordered:!1,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:30,title:e("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",onChange:(n,C)=>{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 g({ids:[n.id]})).code===0&&(yield a())})}function h(){return c(this,null,function*(){L.confirm({title:e("common.deleteConfirm"),icon:f(B.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){(yield g({ids:l.value})).code===0&&(o.value=!1,yield a())})},onCancel(){}})})}function w(){return c(this,null,function*(){yield a()})}return{t:e,registerTable:p,registerDrawer:u,handleCreate:r,handleEdit:t,handleDelete:i,handleSuccess:w,handleBatchDelete:h,showDeleteButton:o}}});function G(e,l,o,u,s,p){const a=m("Button"),r=m("a-button"),t=m("TableAction"),i=m("BasicTable"),h=m("ServerDrawer");return b(),U("div",null,[f(i,{onRegister:e.registerTable},{tableTitle:d(()=>[e.showDeleteButton?(b(),S(a,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:d(()=>[k(y(e.t("common.delete")),1)]),_:1},8,["onClick"])):_("",!0)]),toolbar:d(()=>[f(r,{type:"primary",onClick:e.handleCreate},{default:d(()=>[k(y(e.t("wechat.server.addServer")),1)]),_:1},8,["onClick"])]),bodyCell:d(({column:w,record:n})=>[w.key==="action"?(b(),S(t,{key:0,actions:[{icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,n)},{icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,n)}}]},null,8,["actions"])):_("",!0)]),_:1},8,["onRegister"]),f(h,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const pe=E(j,[["render",G]]);export{pe as default};
|