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

2 lines
5.2 KiB
JavaScript

var G=Object.defineProperty,H=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var O=(l,a,i)=>a in l?G(l,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):l[a]=i,d=(l,a)=>{for(var i in a||(a={}))Q.call(a,i)&&O(l,i,a[i]);if(M)for(var i of M(a))U.call(a,i)&&O(l,i,a[i]);return l},x=(l,a)=>H(l,J(a));var c=(l,a,i)=>new Promise((S,o)=>{var n=p=>{try{_(i.next(p))}catch(m){o(m)}},r=p=>{try{_(i.throw(p))}catch(m){o(m)}},_=p=>p.done?S(p.value):Promise.resolve(p.value).then(n,r);_((i=i.apply(l,a)).next())});import{a as W,b as X,r as Y,c as Z,g as w,d as D,e as ee,s as te}from"./blindBox-BqHhL4EW.js";import{_ as ae}from"./Turntable.vue_vue_type_script_setup_true_lang-B_gAyEw_.js";import{_ as ie}from"./form.vue_vue_type_script_setup_true_lang-DgHrOfP6.js";import{_ as le}from"./settingRule.vue_vue_type_script_setup_true_lang-DX7Hd4GC.js";import{n as s,b as k,r as q,aA as g,aK as z,ag as F}from"./index-CRmU-Qpi.js";import"./lotteryResults-DJYXQbLC.js";import"./index.vue_vue_type_script_setup_true_lang-B9ljupwd.js";import"./hooks-ItYVRz1P.js";import"./room-3H8Bx0CI.js";import"./index.vue_vue_type_script_setup_true_lang-8Iz1Oohf.js";function Re(){const l=s(),a=s(!0),i=s([]),S=s(!1),o=s({total:0,pageSize:10,currentPage:1,pageSizes:[10,20,50,100],background:!0}),n=s({gift_id:"",gift_name:""}),r=s(0),_=s([]),p=s([{label:"每期总次数",prop:"total_count"},{label:"每期总礼物价值(收入)",prop:"total_price"},{label:"每期总抽奖花费(支出)",prop:"total_cost"},{label:"每期统计(收入/支出)",prop:"profit_loss_ratio",tip:"%"}]),m=s({}),$=s([{label:"礼物ID",prop:"gift_id",type:"input"},{label:"礼物名称",prop:"gift_name",type:"input"}]),A=s([{label:"礼物ID",prop:"gift_id"},{label:"礼物名称",prop:"gift_name"},{label:"封面图",prop:"base_image",cellRenderer:({row:e})=>k(q("el-image"),{fit:"cover","preview-teleported":!0,src:e.base_image,"preview-src-list":Array.of(e.base_image),class:"w-[50px] h-[50px] align-middle"},null)},{label:"价格",prop:"gift_price"},{label:"每期数量",prop:"quantity"},{label:"未开数量",prop:"remaining_number"},{label:"多少次后可参与开奖",prop:"weight"},{label:"公屏",prop:"is_public_screen",cellRenderer:({row:e})=>k(q("el-tag"),{type:e.is_public_screen===1?"success":"error"},{default:()=>[e.is_public_screen===1?"是":"否"]})},{label:"全服播报",prop:"is_public_server",cellRenderer:({row:e})=>k(q("el-tag"),{type:e.is_public_server===1?"success":"error"},{default:()=>[e.is_public_server===1?"是":"否"]})},{label:"添加时间",prop:"createtime"},{label:"操作",fixed:"right",width:210,slot:"operation"}]),f=e=>c(this,null,function*(){a.value=!0,n.value=d({},e);const{data:t,code:u}=yield W(x(d({},e),{gift_bag_id:r.value,page:o.value.currentPage,page_limit:o.value.pageSize}));u&&(i.value=t.lists.map(v=>d(d({},v),t.total)),m.value=t.total_data,o.value.total=t.count,o.value.currentPage=t.page),a.value=!1}),N=e=>{o.value.pageSize=e,f(n.value)},T=e=>{o.value.currentPage=e,f(n.value)},K=()=>c(this,null,function*(){const{code:e,data:t}=yield X({activities_id:5});_.value=e?t.map(u=>({label:u.name,value:u.id})):[],e&&I(t[0].id)}),I=e=>{r.value=e,f(n.value)};return{searchForm:n,searchLabel:$,onSearch:f,isShow:S,tableList:i,tableLabel:A,pagination:o,handleSizeChange:N,handleCurrentChange:T,loading:a,getType:K,activeName:r,typeList:_,statisticsList:p,statisticsData:m,handleClick:I,openDialog:(e="新增",t)=>c(this,null,function*(){var u,v,h,R;z({title:`${e}盲盒礼物`,props:{formInline:{gift_id:(u=t==null?void 0:t.gift_id)!=null?u:"",quantity:(v=t==null?void 0:t.quantity)!=null?v:1,weight:(h=t==null?void 0:t.weight)!=null?h:1,is_world_show:(R=t==null?void 0:t.is_world_show)!=null?R:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>F(ie,{ref:l,formInline:null}),beforeSure:(B,{options:b})=>{const L=l.value.getRef(),P=b.props.formInline,V=y=>c(this,null,function*(){const{code:C}=yield D(x(d({},y),{gift_bag_id:r.value}));C?(g("新增成功",{type:"success"}),f(n.value),B()):g("新增失败",{type:"error"})}),j=y=>c(this,null,function*(){const{code:C,msg:E}=yield ee(x(d({},y),{gift_bag_id:r.value,id:t.id}));C?(g("修改成功",{type:"success"}),f(n.value),B()):g(E,{type:"error"})});L.validate(y=>{y&&(e==="新增"?V(P):j(P))})}})}),resetSetting:()=>c(this,null,function*(){const{data:e,code:t}=yield Y({gift_bag_id:r.value});t&&(g("重置成功",{type:"success"}),I(r.value))}),handleDelete:e=>c(this,null,function*(){const{code:t}=yield Z({id:e.id});t&&(g("您删除了这条数据",{type:"success"}),f(n.value))}),setting:()=>c(this,null,function*(){const{data:e,code:t}=yield w({gift_bag_id:r.value});z({title:"设置盲盒规则",props:{formInline:d({},e)},width:"40%",closeOnClickModal:!1,contentRenderer:()=>F(le,{ref:l,formInline:null}),beforeSure:(u,{options:v})=>{const h=l.value.getRef(),R=v.props.formInline,B=b=>c(this,null,function*(){const{code:L}=yield te(d({},b));L?(g("设置成功",{type:"success"}),f(n.value),u()):g("设置失败",{type:"error"})});h.validate(b=>{b&&B(R)})}})}),openLotteryRecord:()=>{z({title:"盲盒转盘开奖记录",fullscreen:!0,hideFooter:!0,closeOnClickModal:!1,contentRenderer:()=>F(ae,{ref:l,formInline:null})})}}}export{Re as useData};