index-BQcMRc3m.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 T}from"./index-BwFer0gF.js";import{B as x,u as S}from"./useTable-BvGx2hOb.js";import{T as W}from"./index-cfTHEGJC.js";import{ao as v,v as I,_ as R}from"./entry/index-_47knzYp-1731674619279.js";import{u as $}from"./index-CXzpB-hr.js";import{W as E,g as A,c as M,s as N,d as g}from"./WxCardDrawer-JHWiFogS.js";import{M as V}from"./antd-CBeLo_oO.js";import{d as F,f as k,k as f,a9 as d,_ as w,$ as L,a7 as m,a6 as y,G as _,a2 as B,a0 as D}from"./vue-B5pbXMv7.js";import"./ExclamationCircleOutlined-DKZl6vgb.js";import"./useForm-Bx3dD47S.js";import"./index-DzmEi_Cz.js";import"./tree-DzWyTcw6.js";import"./copyTextToClipboard-wHy60X1A.js";import"./index-CuMkjCMo.js";import"./index-Ck_gyeb3.js";import"./index-CJOsG-Mp.js";import"./index-DkGmfgEA.js";import"./index-CTfnwg9z.js";import"./useWindowSizeFn-CK_IE3dL.js";import"./plugin-C2XGVjF6.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-YaPA5f_C.js";const O=F({name:"WxCardManagement",components:{BasicTable:x,WxCardDrawer:E,TableAction:W,Button:v},setup(){const{t:e}=I.useI18n(),l=k(),o=k(!1),[u,{openDrawer:s}]=$(),[p,{reload:n}]=S({title:e("wechat.wxCard.wxCardList"),api:A,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",columnWidth:20,onChange:(a,b)=>{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 g({ids:[a.id]})).code===0&&(yield n())})}function C(){return c(this,null,function*(){V.confirm({title:e("common.deleteConfirm"),icon:f(T.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){(yield g({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:C,showDeleteButton:o}}});function U(e,l,o,u,s,p){const n=d("Button"),r=d("a-button"),t=d("TableAction"),i=d("BasicTable"),C=d("WxCardDrawer");return w(),L("div",null,[f(i,{onRegister:e.registerTable},{tableTitle:m(()=>[e.showDeleteButton?(w(),y(n,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:m(()=>[_(B(e.t("common.delete")),1)]),_:1},8,["onClick"])):D("",!0)]),toolbar:m(()=>[f(r,{type:"primary",onClick:e.handleCreate},{default:m(()=>[_(B(e.t("wechat.wxCard.addWxCard")),1)]),_:1},8,["onClick"])]),bodyCell:m(({column:h,record:a})=>[h.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"])):D("",!0)]),_:1},8,["onRegister"]),f(C,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const pe=R(O,[["render",U]]);export{pe as default};