import{P as B}from"./page.3b4d44cb.js";import{b7 as $,b as k,ar as F,N as G,E as H,_ as E,c as u,e as L,k as P,i as t,g as v,h as e,m as c,t as _}from"./index.0308b213.js";import{L as S,M as I}from"./storeActivity.634c4426.js";const N={components:{Page:B},setup(){const o=$(),n=k({loading:!1,delLoading:!1,tableData:[],selectIds:[]}),p=a=>{o.push({path:"/store/marketing/addHuanGouDiscount",query:{id:a}})},f=a=>{n.selectIds=a.map(s=>s.id)},m=k({page:1,limit:10}),g=()=>{n.loading=!0,S(m).then(a=>{console.log("\u8BF7\u6C42\u7ED3\u679C\uFF1A",a),n.tableData=a.list}).finally(()=>{n.loading=!1})};g();const r=a=>{G.alert("\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F","\u63D0\u793A",{showCancelButton:!0}).then(s=>{!(a!=null&&a.length)&&(n.delLoading=!0),I({ids:a||n.selectIds}).then(b=>{H.success("\u5220\u9664\u6210\u529F"),g()}).finally(()=>{!(a!=null&&a.length)&&(n.delLoading=!1)})}).catch(s=>{})};return{...F(n),toAddHuanGou:p,del:r,tableSelects:f}}};const M={class:"container"},V=c("\u521B\u5EFA\u8D85\u503C\u6362\u8D2D"),R=c("\u7F16\u8F91"),j=c("\u5220\u9664"),q=c("\u5220\u9664");function T(o,n,p,f,m,g){const r=u("el-button"),a=u("el-col"),s=u("el-row"),b=u("el-alert"),d=u("el-table-column"),h=u("el-tag"),D=u("el-table"),A=u("Page");return L(),P(A,{showBorder:!1,loading:o.loading},{main:t(()=>[v("div",M,[e(s,null,{default:t(()=>[e(a,null,{default:t(()=>[e(r,{type:"primary",onClick:n[0]||(n[0]=l=>o.toAddHuanGou())},{default:t(()=>[V]),_:1})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(a,null,{default:t(()=>[e(b,{title:"\u6BCF\u4E2A\u95E8\u5E97\u6700\u591A\u652F\u6301\u4E0A\u67B6\u4E00\u4E2A\u8D85\u503C\u6362\u8D2D\u6D3B\u52A8\u3002",type:"warning",closable:!1,"show-icon":""})]),_:1})]),_:1}),e(s,null,{default:t(()=>[e(a,null,{default:t(()=>[e(D,{border:"",data:o.tableData,style:{width:"100%"},onSelectionChange:o.tableSelects},{default:t(()=>[e(d,{align:"center",type:"selection"}),e(d,{align:"center",prop:"title",label:"\u6D3B\u52A8\u4E3B\u9898"}),e(d,{align:"center",label:"\u6BCF\u4EBA\u9650\u8D2D"},{default:t(l=>[e(s,{justify:"center"},{default:t(()=>[e(h,{effect:"dark",type:"danger"},{default:t(()=>[c("\u6BCF\u5355\u6362\u8D2D"+_(l.row.goods_limit)+"\u79CD\u5546\u54C1",1)]),_:2},1024)]),_:2},1024)]),_:1}),e(d,{align:"center",prop:"date",label:"\u6D3B\u52A8\u65E5\u671F"},{default:t(l=>[v("span",null,_(l.row.starttime)+" ~ "+_(l.row.endtime),1)]),_:1}),e(d,{align:"center",label:"\u72B6\u6001"},{default:t(l=>{var i,y;return[e(h,{effect:"dark",type:(y=(i=l.row)==null?void 0:i.bargain_status)==null?void 0:y.css},{default:t(()=>{var w,C;return[c(_((C=(w=l.row)==null?void 0:w.bargain_status)==null?void 0:C.text),1)]}),_:2},1032,["type"])]}),_:1}),e(d,{align:"center",label:"\u64CD\u4F5C"},{default:t(l=>[e(r,{onClick:i=>o.toAddHuanGou(l.row.id)},{default:t(()=>[R]),_:2},1032,["onClick"]),e(r,{onClick:i=>o.del(l.row.id)},{default:t(()=>[j]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data","onSelectionChange"])]),_:1})]),_:1}),e(r,{type:"danger",loading:o.delLoading,onClick:n[1]||(n[1]=l=>o.del())},{default:t(()=>[q]),_:1},8,["loading"])])]),_:1},8,["loading"])}const K=E(N,[["render",T],["__scopeId","data-v-28b72a64"]]);export{K as default};
