index-BLA5o-h3.js 3.4 KB

1
  1. var c=(e,l,t)=>new Promise((u,s)=>{var p=o=>{try{n(t.next(o))}catch(i){s(i)}},r=o=>{try{n(t.throw(o))}catch(i){s(i)}},n=o=>o.done?u(o.value):Promise.resolve(o.value).then(p,r);n((t=t.apply(e,l)).next())});import{i as B}from"./index-Ci2v5RRf.js";import{B as D,u as T}from"./useTable-CaBV0A9D.js";import{T as P}from"./index-BPgn07DB.js";import{ao as I,v as R,_ as $}from"./entry/index-CP6zkLsN-1726190694502.js";import{u as E}from"./index-Bh1SitHa.js";import{S as F,c as A,s as M}from"./StorageProviderDrawer-3rJo3w_b.js";import{g as N,d as C}from"./storageProvider-CWyE8-IS.js";import{M as V}from"./antd-Bp5u6ujY.js";import{d as L,f as v,k as f,a6 as m,_ as b,$ as O,a8 as d,a7 as S,G as k,a2 as _,a0 as y}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 U=L({name:"StorageProviderManagement",components:{BasicTable:D,StorageProviderDrawer:F,TableAction:P,Button:I},setup(){const{t:e}=R.useI18n(),l=v(),t=v(!1),[u,{openDrawer:s}]=E(),[p,{reload:r}]=T({title:e("fms.storageProvider.storageProviderList"),api:N,columns:A,formConfig:{labelWidth:120,schemas:M},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:(a,w)=>{l.value=a,t.value=a.length>0}}});function n(){s(!0,{isUpdate:!1})}function o(a){s(!0,{record:a,isUpdate:!0})}function i(a){return c(this,null,function*(){(yield C({ids:[a.id]})).code===0&&(yield r())})}function g(){return c(this,null,function*(){V.confirm({title:e("common.deleteConfirm"),icon:f(B.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){(yield C({ids:l.value})).code===0&&(t.value=!1,yield r())})},onCancel(){}})})}function h(){return c(this,null,function*(){yield r()})}return{t:e,registerTable:p,registerDrawer:u,handleCreate:n,handleEdit:o,handleDelete:i,handleSuccess:h,handleBatchDelete:g,showDeleteButton:t}}});function j(e,l,t,u,s,p){const r=m("Button"),n=m("a-button"),o=m("TableAction"),i=m("BasicTable"),g=m("StorageProviderDrawer");return b(),O("div",null,[f(i,{onRegister:e.registerTable},{tableTitle:d(()=>[e.showDeleteButton?(b(),S(r,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:d(()=>[k(_(e.t("common.delete")),1)]),_:1},8,["onClick"])):y("",!0)]),toolbar:d(()=>[f(n,{type:"primary",onClick:e.handleCreate},{default:d(()=>[k(_(e.t("fms.storageProvider.addStorageProvider")),1)]),_:1},8,["onClick"])]),bodyCell:d(({column:h,record:a})=>[h.key==="action"?(b(),S(o,{key:0,actions:[{label:"编辑",onClick:e.handleEdit.bind(null,a)},{label:"删除",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,a)}}]},null,8,["actions"])):y("",!0)]),_:1},8,["onRegister"]),f(g,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const fe=$(U,[["render",j]]);export{fe as default};