var c=(e,l,o)=>new Promise((u,s)=>{var p=t=>{try{i(o.next(t))}catch(r){s(r)}},n=t=>{try{i(o.throw(t))}catch(r){s(r)}},i=t=>t.done?u(t.value):Promise.resolve(t.value).then(p,n);i((o=o.apply(e,l)).next())});import{i as D}from"./index-Ciev1myU.js";import{B as S,u as v}from"./useTable-DDFkSLAM.js";import{T as I}from"./index-CGRglBZ4.js";import{ao as R,v as $,_ as E}from"./entry/index-zvKn-pdS-1723036128379.js";import{u as A}from"./index-CKMlJskw.js";import{T as M,c as N,s as V}from"./TagDrawer-CJ3Nxt1r.js";import{g as F,d as C}from"./fileTag-CU9yzU6w.js";import{M as L}from"./antd-BpJVMJkC.js";import{d as O,f as b,k as f,a5 as m,_ as T,$ as U,a7 as d,a6 as k,G as y,a1 as _,a9 as B}from"./vue-Ba_NIFIa.js";import"./ExclamationCircleOutlined-Cnkz0Igx.js";import"./useForm-D8a_tSFM.js";import"./index-DS6n8p4f.js";import"./tree-DdC1qZyg.js";import"./copyTextToClipboard-B4RY9W25.js";import"./index-CyokevPp.js";import"./index--nwGrTER.js";import"./index-Du5qVIel.js";import"./index-D3r27tdG.js";import"./index-Bx5TlaPA.js";import"./useWindowSizeFn-DqPnFPyk.js";import"./plugin-CDKNJrX9.js";import"./onMountedOrActivated-BsbclbaU.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-BU8vLfok.js";const j=O({name:"TagManagement",components:{BasicTable:S,TagDrawer:M,TableAction:I,Button:R},setup(){const{t:e}=$.useI18n(),l=b(),o=b(!1),[u,{openDrawer:s}]=A(),[p,{reload:n}]=v({title:e("fms.tag.tagList"),api:F,columns:N,formConfig:{labelWidth:120,schemas:V},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,o.value=a.length>0}}});function i(){s(!0,{isUpdate:!1})}function t(a){s(!0,{record:a,isUpdate:!0})}function r(a){return c(this,null,function*(){(yield C({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 C({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:i,handleEdit:t,handleDelete:r,handleSuccess:h,handleBatchDelete:g,showDeleteButton:o}}});function G(e,l,o,u,s,p){const n=m("Button"),i=m("a-button"),t=m("TableAction"),r=m("BasicTable"),g=m("TagDrawer");return T(),U("div",null,[f(r,{onRegister:e.registerTable},{tableTitle:d(()=>[e.showDeleteButton?(T(),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(i,{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"?(T(),k(t,{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"])):B("",!0)]),_:1},8,["onRegister"]),f(g,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const pe=E(j,[["render",G]]);export{pe as default};