Files
yusheng-admin/dist/static/js/hook-DSIZoIz5.js
2025-10-23 11:07:17 +08:00

2 lines
2.7 KiB
JavaScript

var A=Object.defineProperty,B=Object.defineProperties;var K=Object.getOwnPropertyDescriptors;var L=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var z=(a,e,t)=>e in a?A(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,_=(a,e)=>{for(var t in e||(e={}))M.call(e,t)&&z(a,t,e[t]);if(L)for(var t of L(e))O.call(e,t)&&z(a,t,e[t]);return a},b=(a,e)=>B(a,K(e));var v=(a,e,t)=>new Promise((i,d)=>{var o=r=>{try{s(t.next(r))}catch(p){d(p)}},c=r=>{try{s(t.throw(r))}catch(p){d(p)}},s=r=>r.done?i(r.value):Promise.resolve(r.value).then(o,c);s((t=t.apply(a,e)).next())});import{u as x,w as T}from"./xlsx-DaVhO591.js";import{n as l,aK as j,ag as G,aA as E}from"./index-CRmU-Qpi.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_lang-Vno3adgp.js";import{c as C}from"./Financial-DLXohchJ.js";function X(){const a=l(!0),e=l([]),t=l(!1),i=l({search_uid:"",start_time:"",end_time:""}),d=l([{label:"用户ID/昵称",prop:"search_uid",type:"input"},{label:"开始时间",prop:"start_time",type:"date"},{label:"结束时间",prop:"end_time",type:"date"}]),o=l({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),c=l([{label:"ID",prop:"id"},{label:"用户ID",prop:"user_code"},{label:"用户昵称",prop:"nickname"},{label:"消耗金额",prop:"earnings_num"},{label:"获得数量(金币)",prop:"coin_num"},{label:"完成时间",prop:"createtime"}]),s=n=>v(this,null,function*(){a.value=!0,i.value=_({},n);const{data:u,code:f}=yield C(b(_({},n),{page:o.value.currentPage,page_limit:o.value.pageSize}));f&&(e.value=u.lists,o.value.total=u.count,o.value.currentPage=u.page),a.value=!1}),r=n=>{o.value.pageSize=n,s(i.value)},p=n=>{o.value.currentPage=n,s(i.value)},S=l(null);return{searchForm:i,searchLabel:d,onSearch:s,isShow:t,tableList:e,tableLabel:c,pagination:o,exportExcel:()=>{let n=[];j({title:"导出数据",props:{formInline:{time:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>G(H,{ref:S,formInline:null}),beforeSure:(u,{options:f})=>{const D=S.value.getRef(),g=f.props.formInline,F=m=>v(this,null,function*(){const{data:P,code:R}=yield C(b(_({},m),{page:1,page_limit:2e4}));if(R){n=P.lists;const w=n.map(h=>{const I=[];return c.value.forEach(q=>{I.push(h[q.prop])}),I}),y=[];c.value.forEach(h=>{y.push(h.label)}),w.unshift(y);const $=x.aoa_to_sheet(w),k=x.book_new();x.book_append_sheet(k,$,"数据报表"),T(k,`兑换列表统计${m.start_time} - ${m.end_time}.xlsx`),E("导出成功",{type:"success"}),u()}else E("获取数据失败,请重试!",{type:"error"})});D.validate(m=>{m&&g.time&&g.time.length&&F({start_time:g.time[0]||"",end_time:g.time[1]||""})})}})},handleSizeChange:r,handleCurrentChange:p,loading:a}}export{X as useData};