Files
yusheng-admin/dist/static/js/hook-BNdml3vY.js

2 lines
3.1 KiB
JavaScript
Raw Normal View History

2025-10-23 11:07:17 +08:00
var x=Object.defineProperty,k=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var S=(t,e,a)=>e in t?x(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,b=(t,e)=>{for(var a in e||(e={}))C.call(e,a)&&S(t,a,e[a]);if(y)for(var a of y(e))D.call(e,a)&&S(t,a,e[a]);return t},L=(t,e)=>k(t,z(e));var f=(t,e,a)=>new Promise((p,s)=>{var d=o=>{try{u(a.next(o))}catch(n){s(n)}},g=o=>{try{u(a.throw(o))}catch(n){s(n)}},u=o=>o.done?p(o.value):Promise.resolve(o.value).then(d,g);u((a=a.apply(t,e)).next())});import{f as I,b as P}from"./blindBox-BqHhL4EW.js";import{u as h,w as E}from"./xlsx-DaVhO591.js";import{n as i,aA as T}from"./index-CRmU-Qpi.js";function G(){const t=i(!0),e=i([]),a=i(!1),p=i({total:0,pageSize:10,currentPage:1,pageSizes:[10,20,50,100],background:!0}),s=i({user_id:"",gift_id:"",room_id:"",gift_bag_id:"",periods:"",stime:"",etime:""}),d=i([{label:"总抽奖次数",prop:"total"},{label:"总抽奖金额(支出)",prop:"total_money"},{label:"总礼物价值(收入)",prop:"total_gift_money"},{label:"统计(收入/支出)",prop:"ratio"},{label:"盈亏(收入-支出)",prop:"profit_loss"},{label:"盈亏比(盈亏/支出)",prop:"profit_loss_ratio"}]),g=i({}),u=i([{label:"用户ID",prop:"user_id",type:"input"},{label:"礼物ID",prop:"gift_id",type:"input"},{label:"房间ID",prop:"room_id",type:"input"},{label:"礼包类型",prop:"gift_bag_id",type:"select",optionList:[]},{label:"期数",prop:"periods",type:"input"},{label:"开始时间",prop:"stime",type:"date"},{label:"结束时间",prop:"etime",type:"date"}]),o=i([{label:"ID",prop:"gift_id"},{label:"盲盒类型",prop:"gift_bag_type"},{label:"期数",prop:"periods"},{label:"所在房间",prop:"room_name"},{label:"开奖人",prop:"user_name"},{label:"支付价格",prop:"bag_price"},{label:"礼物ID",prop:"gift_id"},{label:"礼物名称",prop:"gift_name"},{label:"礼物价格",prop:"gift_price"},{label:"抽中数量",prop:"gift_num"},{label:"接收人",prop:"gift_user_name"},{label:"创建时间",prop:"createtime"}]),n=l=>f(this,null,function*(){t.value=!0,s.value=b({},l);const{data:r,code:c}=yield I(L(b({},l),{page:p.value.currentPage,page_limit:p.value.pageSize}));c&&(e.value=r.lists.map(_=>b(b({},_),r.total)),g.value=r.total_data,p.value.total=r.count,p.value.currentPage=r.page),t.value=!1});return{searchForm:s,searchLabel:u,onSearch:n,isShow:a,tableList:e,tableLabel:o,pagination:p,handleSizeChange:l=>{p.value.pageSize=l,n(s.value)},handleCurrentChange:l=>{p.value.currentPage=l,n(s.value)},loading:t,getType:()=>f(this,null,function*(){const{code:l,data:r}=yield P(4);u.value[3].optionList=l?r.map(c=>({label:c.name,value:c.id})):[]}),exportExcel:()=>{const l=e.value.map(m=>{const v=[];return o.value.forEach(w=>{v.push(m[w.prop])}),v}),r=[];o.value.forEach(m=>{r.push(m.label)}),l.unshift(r);const c=h.aoa_to_sheet(l),_=h.book_new();h.book_append_sheet(_,c,"数据报表"),E(_,`盲盒开奖记录统计第${p.value.currentPage}页.xlsx`),T("导出成功",{type:"success"})},statisticsList:d,statisticsData:g}}export{G as useData};