2 lines
3.7 KiB
JavaScript
2 lines
3.7 KiB
JavaScript
var B=Object.defineProperty,K=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var L=(a,e,t)=>e in a?B(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,v=(a,e)=>{for(var t in e||(e={}))j.call(e,t)&&L(a,t,e[t]);if(I)for(var t of I(e))G.call(e,t)&&L(a,t,e[t]);return a},D=(a,e)=>K(a,W(e));var _=(a,e,t)=>new Promise((b,n)=>{var f=o=>{try{i(t.next(o))}catch(u){n(u)}},r=o=>{try{i(t.throw(o))}catch(u){n(u)}},i=o=>o.done?b(o.value):Promise.resolve(o.value).then(f,r);i((t=t.apply(a,e)).next())});import{_ as H}from"./form.vue_vue_type_script_setup_true_lang-Cbivz3Ba.js";import{n as s,W as J,aK as E,ag as z,aA as C}from"./index-CRmU-Qpi.js";import{u as w,w as N}from"./xlsx-DaVhO591.js";import{b as F,g as Q}from"./room-3H8Bx0CI.js";import{_ as U}from"./index.vue_vue_type_script_setup_true_lang-Vno3adgp.js";function oe(){const a=s(),e=s(!0),t=s([]),b=s(!1),n=s({room_id:"",status:"",stime:"",etime:""}),f=s([{label:"房间ID",prop:"room_id",type:"input"},{label:"红包状态",prop:"status",type:"select",optionList:[{label:"未开始",value:0},{label:"进行中",value:1},{label:"已结束",value:2},{label:"已退回",value:3}]},{label:"开始时间",prop:"stime",type:"date"},{label:"结束时间",prop:"etime",type:"date"}]),r=s({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),i=s([{label:"房间ID",prop:"room_id"},{label:"房间名字",prop:"room_name"},{label:"发放人ID",prop:"user_code"},{label:"发放人昵称",prop:"nickname"},{label:"红包类型",prop:"type_text"},{label:"口令",prop:"password"},{label:"多少秒后开抢",prop:"countdown"},{label:"币种",prop:"coin_type_text"},{label:"总金额",prop:"total_amount"},{label:"总数量",prop:"total_count"},{label:"剩余金额",prop:"left_amount"},{label:"剩余数量",prop:"left_count"},{label:"状态",prop:"status_text"},{label:"红包备注",prop:"remark"},{label:"创建时间",prop:"createtime"},{label:"操作",fixed:"right",width:210,slot:"operation"}]),o=l=>_(this,null,function*(){e.value=!0,n.value=v({},l);const{data:p,code:m}=yield F(D(v({},l),{page:r.value.currentPage,page_limit:r.value.pageSize}));m&&(t.value=p.lists,r.value.total=p.count,r.value.currentPage=p.page),e.value=!1}),u=l=>{r.value.pageSize=l,o(n.value)},P=l=>{r.value.currentPage=l,o(n.value)},$=(l="审核",p)=>_(this,null,function*(){const{code:m,data:h}=yield Q({redpacket_id:p.id});m&&J(()=>{E({title:`${l}`,props:{rowData:h},width:"40%",hideFooter:!0,closeOnClickModal:!1,contentRenderer:()=>z(H,{ref:a,formInline:null})})})}),x=s(null);return{searchForm:n,searchLabel:f,onSearch:o,isShow:b,tableList:t,tableLabel:i,pagination:r,handleSizeChange:u,handleCurrentChange:P,loading:e,openDialog:$,exportExcel:()=>{let l=[];E({title:"导出数据",props:{formInline:{time:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>z(U,{ref:x,formInline:null}),beforeSure:(p,{options:m})=>{const h=x.value.getRef(),d=m.props.formInline,M=c=>_(this,null,function*(){const{data:O,code:T}=yield F({stime:c.search_status_time,etime:c.search_end_time,page:1,page_limit:2e4});if(T){l=O.lists;const y=l.map(g=>{const R=[];return i.value.forEach(A=>{R.push(g[A.prop])}),R}),k=[];i.value.forEach(g=>{k.push(g.label)}),y.unshift(k);const q=w.aoa_to_sheet(y),S=w.book_new();w.book_append_sheet(S,q,"数据报表"),N(S,`房间红包发放统计${c.search_status_time} - ${c.search_end_time}.xlsx`),C("导出成功",{type:"success"}),p()}else C("获取数据失败,请重试!",{type:"error"})});h.validate(c=>{c&&d.time&&d.time.length&&M({search_status_time:d.time[0]||"",search_end_time:d.time[1]||""})})}})}}}export{oe as useData};
|