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