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-B8miXP3d.js";import{B as U,u as x}from"./useTable-Ol_P-TxG.js";import{T as S}from"./index-BEZBHtc2.js";import{ao as W,v,_ as I}from"./entry/index-BOVpYCVt-1731915664217.js";import{u as R}from"./index-CwBw3p8r.js";import{W as $,g as E,c as A,s as M,d as g}from"./WxCardUserDrawer-BVgox2M6.js";import{M as N}from"./antd-DXvsKA0x.js";import{d as V,f as k,k as f,a9 as d,_ as w,$ as F,a7 as m,a6 as y,G as _,a2 as B,a0 as D}from"./vue-B5pbXMv7.js";import"./ExclamationCircleOutlined-BaVgfZo1.js";import"./useForm-B-PbqzOc.js";import"./index-x2bUusKH.js";import"./tree-Nv0Zt4Ov.js";import"./copyTextToClipboard-7uPthhEV.js";import"./index-DKfaJplO.js";import"./index-EdNvCi60.js";import"./index-DTfAZuwl.js";import"./index-BcSUkfeU.js";import"./index-DaqRmjER.js";import"./useWindowSizeFn-CzjmevD7.js";import"./plugin-CRRssOeV.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-CRwDSVfI.js";const L=V({name:"WxCardUserManagement",components:{BasicTable:U,WxCardUserDrawer:$,TableAction:S,Button:W},setup(){const{t:e}=v.useI18n(),l=k(),o=k(!1),[u,{openDrawer:s}]=R(),[p,{reload:n}]=x({title:e("wechat.wxCardUser.wxCardUserList"),api:E,columns:A,formConfig:{labelWidth:120,schemas:M},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*(){N.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 O(e,l,o,u,s,p){const n=d("Button"),r=d("a-button"),t=d("TableAction"),i=d("BasicTable"),C=d("WxCardUserDrawer");return w(),F("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.wxCardUser.addWxCardUser")),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=I(L,[["render",O]]);export{pe as default};
|