2 lines
4.3 KiB
JavaScript
2 lines
4.3 KiB
JavaScript
var T=Object.defineProperty,V=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var $=(r,t,s)=>t in r?T(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s,b=(r,t)=>{for(var s in t||(t={}))J.call(t,s)&&$(r,s,t[s]);if(P)for(var s of P(t))Q.call(t,s)&&$(r,s,t[s]);return r},S=(r,t)=>V(r,w(t));var v=(r,t,s)=>new Promise((x,d)=>{var u=n=>{try{l(s.next(n))}catch(c){d(c)}},k=n=>{try{l(s.throw(n))}catch(c){d(c)}},l=n=>n.done?x(n.value):Promise.resolve(n.value).then(u,k);l((s=s.apply(r,t)).next())});import{_ as U}from"./form.vue_vue_type_script_setup_true_lang-CczCLyB5.js";import{n as i,b as W,r as X,aK as B,ag as M,aA as f}from"./index-CRmU-Qpi.js";import{u as L,w as Y}from"./xlsx-DaVhO591.js";import{F as O,G as Z,H as D}from"./room-3H8Bx0CI.js";import{_ as ee}from"./index.vue_vue_type_script_setup_true_lang-Vno3adgp.js";function ie(){const r=i(),t=i(!0),s=i([]),x=i(!1),d=i([]),u=i({search_user_id:"",search_guild_id:"",search_status_time:"",search_end_time:""}),k=i([{label:"用户ID",prop:"search_user_id",type:"input"},{label:"房间号",prop:"search_guild_id",type:"input"},{label:"开始时间",prop:"search_status_time",type:"date"},{label:"结束时间",prop:"search_end_time",type:"date"}]),l=i({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),n=i([{type:"selection",align:"left"},{label:"用户账号ID",prop:"user_id"},{label:"用户昵称",prop:"user_name"},{label:"房间ID",prop:"room_code"},{label:"房间名称",prop:"room_name"},{label:"房间周流水(金币)",prop:"total_transaction"},{label:"房间周补贴(钻石)",prop:"subsidy_amount"},{label:"是否发放",prop:"status_str",cellRenderer:({row:e})=>W(X("el-tag"),{type:e.status===1?"success":e.status===2?"error":"info"},{default:()=>[e.status===1?"已发放":e.status===2?"已拒绝":"未发放"]})},{label:"时间",prop:"time"},{label:"操作",fixed:"right",width:210,slot:"operation"}]),c=e=>v(this,null,function*(){t.value=!0,u.value=b({},e);const{data:a,code:o}=yield O(S(b({},e),{page:l.value.currentPage,page_limit:l.value.pageSize}));o&&(s.value=a.lists,l.value.total=a.count,l.value.currentPage=a.page),t.value=!1}),j=e=>{l.value.pageSize=e,c(u.value)},q=e=>{l.value.currentPage=e,c(u.value)},A=(e="审核",a)=>{var o,h;B({title:`${e}`,props:{formInline:{id:(o=a==null?void 0:a.id)!=null?o:"",status:"",remark:(h=a==null?void 0:a.remark)!=null?h:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>M(U,{ref:r,formInline:null}),beforeSure:(p,{options:g})=>{const m=r.value.getRef(),I=g.props.formInline,R=_=>v(this,null,function*(){const{code:y}=yield D(S(b({},_),{id:a.id}));y?(f("审核成功",{type:"success"}),c(u.value),p()):f("审核失败",{type:"error"})});m.validate(_=>{_&&e==="审核"&&R(I)})}})},G=e=>{d.value=e},H=()=>v(this,null,function*(){const e=d.value.map(o=>o.id),a=d.value.map(o=>o.status);if(a.length&&a.includes(1))f("内含已发放状态的数据,请重新勾选!",{type:"error"});else if(e.length){const o={ids:e.join(","),status:1,remark:""},{data:h,code:p,msg:g}=yield Z(o);p?(f("批量发放成功",{type:"success"}),c(u.value)):f(g,{type:"error"})}}),F=i(null);return{searchForm:u,searchLabel:k,onSearch:c,isShow:x,tableList:s,tableLabel:n,pagination:l,handleSizeChange:j,handleCurrentChange:q,loading:t,openDialog:A,exportExcel:()=>{let e=[];B({title:"导出数据",props:{formInline:{time:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>M(ee,{ref:F,formInline:null}),beforeSure:(a,{options:o})=>{const h=F.value.getRef(),p=o.props.formInline,g=m=>v(this,null,function*(){const{data:I,code:R}=yield O(S(b({},m),{page:1,page_limit:2e4}));if(R){e=I.lists;const _=e.map(C=>{const E=[];return n.value.forEach(N=>{E.push(C[N.prop])}),E}),y=[];n.value.forEach(C=>{y.push(C.label)}),_.unshift(y);const K=L.aoa_to_sheet(_),z=L.book_new();L.book_append_sheet(z,K,"数据报表"),Y(z,`房间补贴发放统计${m.search_status_time} - ${m.search_end_time}.xlsx`),f("导出成功",{type:"success"}),a()}else f("获取数据失败,请重试!",{type:"error"})});h.validate(m=>{m&&p.time&&p.time.length&&g({search_status_time:p.time[0]||"",search_end_time:p.time[1]||""})})}})},handleSelectionChange:G,multipleSelection:d,batchDistribution:H}}export{ie as useData};
|