index-BqnwjZVl.js 3.4 KB

1
  1. var c=(e,s,o)=>new Promise((d,r)=>{var u=t=>{try{i(o.next(t))}catch(l){r(l)}},n=t=>{try{i(o.throw(t))}catch(l){r(l)}},i=t=>t.done?d(t.value):Promise.resolve(t.value).then(u,n);i((o=o.apply(e,s)).next())});import{i as D}from"./index-BQgPd3bX.js";import{B as T,u as L}from"./useTable-B6PunZL5.js";import{T as S}from"./index-BIj58_Cj.js";import{ao as v,v as I,_ as $}from"./entry/index-DJx93RYF-1731481145019.js";import{u as E}from"./index-CzIUqxsa.js";import{L as A,c as M,s as N}from"./LabelRelationshipDrawer-KPhYOxdN.js";import{g as V,d as g}from"./labelRelationship-DvRhWUMJ.js";import{M as F}from"./antd-CBeLo_oO.js";import{d as O,f as k,k as f,a9 as m,_ as w,$ as U,a7 as p,a6 as y,G as R,a2 as _,a0 as B}from"./vue-B5pbXMv7.js";import"./ExclamationCircleOutlined-Ca0mYuiu.js";import"./useForm-pwHPrILC.js";import"./index-D_SNX-7K.js";import"./tree-BtJaOqz0.js";import"./copyTextToClipboard-Dngb1Nn3.js";import"./index-BDsRYE32.js";import"./index-wDJjh9Os.js";import"./index-BzfGKMh3.js";import"./index-DkGmfgEA.js";import"./index-Cuu0w1HY.js";import"./useWindowSizeFn-BxA6-zLj.js";import"./plugin-C2XGVjF6.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-lvT7rWOs.js";const j=O({name:"LabelRelationshipManagement",components:{BasicTable:T,LabelRelationshipDrawer:A,TableAction:S,Button:v},setup(){const{t:e}=I.useI18n(),s=k(),o=k(!1),[d,{openDrawer:r}]=E(),[u,{reload:n}]=L({title:e("wechat.labelRelationship.labelRelationshipList"),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,C)=>{s.value=a,o.value=a.length>0}}});function i(){r(!0,{isUpdate:!1})}function t(a){r(!0,{record:a,isUpdate:!0})}function l(a){return c(this,null,function*(){(yield g({ids:[a.id]})).code===0&&(yield n())})}function h(){return c(this,null,function*(){F.confirm({title:e("common.deleteConfirm"),icon:f(D.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){(yield g({ids:s.value})).code===0&&(o.value=!1,yield n())})},onCancel(){}})})}function b(){return c(this,null,function*(){yield n()})}return{t:e,registerTable:u,registerDrawer:d,handleCreate:i,handleEdit:t,handleDelete:l,handleSuccess:b,handleBatchDelete:h,showDeleteButton:o}}});function G(e,s,o,d,r,u){const n=m("Button"),i=m("a-button"),t=m("TableAction"),l=m("BasicTable"),h=m("LabelRelationshipDrawer");return w(),U("div",null,[f(l,{onRegister:e.registerTable},{tableTitle:p(()=>[e.showDeleteButton?(w(),y(n,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:p(()=>[R(_(e.t("common.delete")),1)]),_:1},8,["onClick"])):B("",!0)]),toolbar:p(()=>[f(i,{type:"primary",onClick:e.handleCreate},{default:p(()=>[R(_(e.t("wechat.labelRelationship.addLabelRelationship")),1)]),_:1},8,["onClick"])]),bodyCell:p(({column:b,record:a})=>[b.key==="action"?(w(),y(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(h,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const fe=$(j,[["render",G]]);export{fe as default};