index-kbjHCrcg.js 3.2 KB

1
  1. var c=(e,l,o)=>new Promise((p,s)=>{var u=t=>{try{i(o.next(t))}catch(r){s(r)}},a=t=>{try{i(o.throw(t))}catch(r){s(r)}},i=t=>t.done?p(t.value):Promise.resolve(t.value).then(u,a);i((o=o.apply(e,l)).next())});import{i as T}from"./index-CoaWcf4I.js";import{B as A,u as S}from"./useTable-0MXyfnu6.js";import{T as v}from"./index-CfBz3pOO.js";import{ap as I,v as R,_ as $}from"./entry/index-CmQmcgVX-1722947009025.js";import{u as E}from"./index-4VYRrlov.js";import{A as M,g as N,c as V,s as F,d as g}from"./ApiDrawer-C93M-b10.js";import{M as L}from"./antd-Da-U8e33.js";import{d as O,f as y,k as f,a7 as m,_ as w,$ as U,a9 as d,a8 as k,G as _,a1 as B,ab as D}from"./vue-BNCny8i2.js";import"./ExclamationCircleOutlined-DvSBc0c4.js";import"./useForm-CT3jbI8E.js";import"./index-RuA9g7mG.js";import"./tree-r2zLM0s-.js";import"./copyTextToClipboard-W8PXYY-K.js";import"./index-DQp1zcaB.js";import"./index-K4HGtjGs.js";import"./index-DJeguOKX.js";import"./index-CRD2KyxH.js";import"./index-Bs6oOfhC.js";import"./useWindowSizeFn-CDLb2t6U.js";import"./plugin-BJOvH3fv.js";import"./onMountedOrActivated-DUkWHYas.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-ShHu8Y34.js";const j=O({name:"ApiManagement",components:{BasicTable:A,ApiDrawer:M,TableAction:v,Button:I},setup(){const{t:e}=R.useI18n(),l=y(),o=y(!1),[p,{openDrawer:s}]=E(),[u,{reload:a}]=S({title:e("sys.apis.apiList"),api:N,columns:V,formConfig:{labelWidth:120,schemas:F},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,C)=>{l.value=n,o.value=n.length>0}}});function i(){s(!0,{isUpdate:!1})}function t(n){s(!0,{record:n,isUpdate:!0})}function r(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(T.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){(yield g({ids:l.value})).code===0&&(o.value=!1,yield a())})},onCancel(){}})})}function b(){return c(this,null,function*(){yield a()})}return{t:e,registerTable:u,registerDrawer:p,handleCreate:i,handleEdit:t,handleDelete:r,handleSuccess:b,handleBatchDelete:h,showDeleteButton:o}}});function G(e,l,o,p,s,u){const a=m("Button"),i=m("a-button"),t=m("TableAction"),r=m("BasicTable"),h=m("ApiDrawer");return w(),U("div",null,[f(r,{onRegister:e.registerTable},{tableTitle:d(()=>[e.showDeleteButton?(w(),k(a,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:d(()=>[_(B(e.t("common.delete")),1)]),_:1},8,["onClick"])):D("",!0)]),toolbar:d(()=>[f(i,{type:"primary",onClick:e.handleCreate},{default:d(()=>[_(B(e.t("sys.apis.addApi")),1)]),_:1},8,["onClick"])]),bodyCell:d(({column:b,record:n})=>[b.key==="action"?(w(),k(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"])):D("",!0)]),_:1},8,["onRegister"]),f(h,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const pe=$(j,[["render",G]]);export{pe as default};