index-DLZwttbG.js 3.3 KB

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