index-wmbFdPGz.js 3.4 KB

1
  1. var c=(e,l,t)=>new Promise((u,s)=>{var p=o=>{try{r(t.next(o))}catch(i){s(i)}},n=o=>{try{r(t.throw(o))}catch(i){s(i)}},r=o=>o.done?u(o.value):Promise.resolve(o.value).then(p,n);r((t=t.apply(e,l)).next())});import{i as B}from"./index-CWIMkCyU.js";import{B as D,u as T}from"./useTable-yjRWbRcT.js";import{T as P}from"./index-Ctq9WGad.js";import{ao as I,v as R,_ as $}from"./entry/index-BR4aaozk-1722999832476.js";import{u as E}from"./index-C2pYGHuD.js";import{S as A,c as M,s as N}from"./StorageProviderDrawer-DnNSKouL.js";import{g as V,d as C}from"./storageProvider-CluPFqEA.js";import{M as F}from"./antd-BQ3qV6bI.js";import{d as L,f as v,k as f,a7 as d,_ as b,$ as O,a9 as m,a8 as S,G as k,a1 as y,ab as _}from"./vue-BNCny8i2.js";import"./ExclamationCircleOutlined-OYz2z3Y1.js";import"./useForm-BPs-bGop.js";import"./index-bMIGtX2N.js";import"./tree-Bzlcl2-1.js";import"./copyTextToClipboard-ohAWhynX.js";import"./index-CCbSIA2Z.js";import"./index-D0xvMl_A.js";import"./index-94nmOQ7g.js";import"./index-CotF8ozl.js";import"./index-Bm3tDEoh.js";import"./useWindowSizeFn-BpJljGvW.js";import"./plugin-DCXEoXS2.js";import"./onMountedOrActivated-DUkWHYas.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-DWA54z3F.js";const U=L({name:"StorageProviderManagement",components:{BasicTable:D,StorageProviderDrawer:A,TableAction:P,Button:I},setup(){const{t:e}=R.useI18n(),l=v(),t=v(!1),[u,{openDrawer:s}]=E(),[p,{reload:n}]=T({title:e("fms.storageProvider.storageProviderList"),api:V,columns:M,formConfig:{labelWidth:120,schemas:N},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 r(){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 n())})}function g(){return c(this,null,function*(){F.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 n())})},onCancel(){}})})}function h(){return c(this,null,function*(){yield n()})}return{t:e,registerTable:p,registerDrawer:u,handleCreate:r,handleEdit:o,handleDelete:i,handleSuccess:h,handleBatchDelete:g,showDeleteButton:t}}});function j(e,l,t,u,s,p){const n=d("Button"),r=d("a-button"),o=d("TableAction"),i=d("BasicTable"),g=d("StorageProviderDrawer");return b(),O("div",null,[f(i,{onRegister:e.registerTable},{tableTitle:m(()=>[e.showDeleteButton?(b(),S(n,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:m(()=>[k(y(e.t("common.delete")),1)]),_:1},8,["onClick"])):_("",!0)]),toolbar:m(()=>[f(r,{type:"primary",onClick:e.handleCreate},{default:m(()=>[k(y(e.t("fms.storageProvider.addStorageProvider")),1)]),_:1},8,["onClick"])]),bodyCell:m(({column:h,record:a})=>[h.key==="action"?(b(),S(o,{key:0,actions:[{icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,a)},{icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,a)}}]},null,8,["actions"])):_("",!0)]),_:1},8,["onRegister"]),f(g,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const pe=$(U,[["render",j]]);export{pe as default};