index-BSAimwpD.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)}},a=t=>{try{r(o.throw(t))}catch(i){s(i)}},r=t=>t.done?u(t.value):Promise.resolve(t.value).then(p,a);r((o=o.apply(e,l)).next())});import{i as D}from"./index-BafL01UE.js";import{B as T,u as M}from"./useTable-B21ZSRGf.js";import{T as S}from"./index-CreXae4i.js";import{ao as v,v as I,_ as $}from"./entry/index-CcR3XhtN-1721963535400.js";import{u as E}from"./index-Dqidnd8s.js";import{M as A,c as N,s as V}from"./MemberRankDrawer-OoyWCokV.js";import{g as F,d as C}from"./memberRank-Cyb3Bzkj.js";import{M as L}from"./antd-c1uHJHtu.js";import{d as O,f as g,k as f,a7 as m,_ as k,$ as U,a9 as d,a8 as y,G as R,a1 as _,ab as B}from"./vue-YAQxJ0SI.js";import"./ExclamationCircleOutlined-zuBeZsMm.js";import"./useForm-is4aOu_w.js";import"./index-SFOPTrfU.js";import"./tree-DPeXdKHt.js";import"./copyTextToClipboard-B66dlzI3.js";import"./index-CRJT002a.js";import"./index-D0dQHoLY.js";import"./index-D9thwvDd.js";import"./index-D8KFrDWL.js";import"./index-Bcn8BOBC.js";import"./useWindowSizeFn-D6dCWzyH.js";import"./plugin-BtkwVqDc.js";import"./onMountedOrActivated-9LbCg5GM.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-X3pPIR41.js";const j=O({name:"MemberRankManagement",components:{BasicTable:T,MemberRankDrawer:A,TableAction:S,Button:v},setup(){const{t:e}=I.useI18n(),l=g(),o=g(!1),[u,{openDrawer:s}]=E(),[p,{reload:a}]=M({title:e("sys.memberRank.memberRankList"),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:(n,w)=>{l.value=n,o.value=n.length>0}}});function r(){s(!0,{isUpdate:!1})}function t(n){s(!0,{record:n,isUpdate:!0})}function i(n){return c(this,null,function*(){(yield C({ids:[n.id]})).code===0&&(yield a())})}function b(){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 a())})},onCancel(){}})})}function h(){return c(this,null,function*(){yield a()})}return{t:e,registerTable:p,registerDrawer:u,handleCreate:r,handleEdit:t,handleDelete:i,handleSuccess:h,handleBatchDelete:b,showDeleteButton:o}}});function G(e,l,o,u,s,p){const a=m("Button"),r=m("a-button"),t=m("TableAction"),i=m("BasicTable"),b=m("MemberRankDrawer");return k(),U("div",null,[f(i,{onRegister:e.registerTable},{tableTitle:d(()=>[e.showDeleteButton?(k(),y(a,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:d(()=>[R(_(e.t("common.delete")),1)]),_:1},8,["onClick"])):B("",!0)]),toolbar:d(()=>[f(r,{type:"primary",onClick:e.handleCreate},{default:d(()=>[R(_(e.t("sys.memberRank.addMemberRank")),1)]),_:1},8,["onClick"])]),bodyCell:d(({column:h,record:n})=>[h.key==="action"?(k(),y(t,{key:0,actions:[{icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,n)},{icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,n)}}]},null,8,["actions"])):B("",!0)]),_:1},8,["onRegister"]),f(b,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const pe=$(j,[["render",G]]);export{pe as default};