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

2 lines
3.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var P=Object.defineProperty,$=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var R=(n,t,a)=>t in n?P(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a,x=(n,t)=>{for(var a in t||(t={}))T.call(t,a)&&R(n,a,t[a]);if(C)for(var a of C(t))V.call(t,a)&&R(n,a,t[a]);return n},U=(n,t)=>$(n,M(t));var u=(n,t,a)=>new Promise((f,l)=>{var m=i=>{try{o(a.next(i))}catch(g){l(g)}},v=i=>{try{o(a.throw(i))}catch(g){l(g)}},o=i=>i.done?f(i.value):Promise.resolve(i.value).then(m,v);o((a=a.apply(n,t)).next())});import{_ as k}from"./form.vue_vue_type_script_setup_true_lang-CMV64P_c.js";import{n as r,b as E,r as j,fI as q,aA as d,aK as A,ag as F}from"./index-CRmU-Qpi.js";import{u as H,h as K,i as N,j as O,l as G}from"./union-ZelC57cN.js";function D(){const n=r(),t=r(!0),a=r([]),f=r(!1),l=r({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),m=r([{label:"ID",prop:"id"},{label:"规则名称",prop:"start_amount"},{label:"目标流水(金币)",prop:"end_amount"},{label:"补贴奖励(%",prop:"subsidy_ratio"},{label:"创建时间",prop:"createtime"},{label:"启用状态",prop:"upStatus",cellRenderer:({row:e,props:s})=>E(j("el-switch"),{modelValue:e.status,"onUpdate:modelValue":c=>e.status=c,onChange:()=>v(e),"active-value":1,"inactive-value":2,"active-text":"正常","inactive-text":"禁用","active-color":"#13ce66","inactive-color":"#ff4949"},null)},{label:"操作",fixed:"right",width:210,slot:"operation"}]),v=e=>u(this,null,function*(){t.value||q.confirm(`确认要<strong>${e.status===2?"禁用":"启用"}</strong><strong style='color:var(--el-color-primary)'></strong>吗?`,"系统提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",dangerouslyUseHTMLString:!0,draggable:!0}).then(()=>u(this,null,function*(){const{data:s,code:c}=yield H({id:e.id,status:e.status});c&&d(`${e.status===2?"禁用":"启用"}`,{type:"success"})})).catch(()=>{e.status==2?e.status=1:e.status=2})}),o=()=>u(this,null,function*(){t.value=!0;const{data:e,code:s}=yield K({page:l.value.currentPage,page_limit:l.value.pageSize});s&&(a.value=e.lists,l.value.total=e.count,l.value.currentPage=e.page),t.value=!1});return{onSearch:o,isShow:f,tableList:a,tableLabel:m,pagination:l,handleSizeChange:e=>{l.value.pageSize=e,o()},handleCurrentChange:e=>{l.value.currentPage=e,o()},loading:t,handleDelete:e=>u(this,null,function*(){const{code:s}=yield N({id:e.id});s&&(d(`您删除了规则名称为【${e.start_amount}】的这条数据`,{type:"success"}),o())}),openDialog:(e="新增",s)=>{var c,y,b;A({title:`${e}奖励规则`,props:{formInline:{start_amount:(c=s==null?void 0:s.start_amount)!=null?c:"",end_amount:(y=s==null?void 0:s.end_amount)!=null?y:"",subsidy_ratio:(b=s==null?void 0:s.subsidy_ratio)!=null?b:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>F(k,{ref:n,formInline:null}),beforeSure:(_,{options:z})=>{const I=n.value.getRef(),S=z.props.formInline,B=p=>u(this,null,function*(){const{code:h}=yield O(p);h?(d("新增成功",{type:"success"}),o(),_()):d("新增失败",{type:"error"})}),L=p=>u(this,null,function*(){const{code:h}=yield G(U(x({},p),{id:s.id}));h?(d("修改成功",{type:"success"}),o(),_()):d("修改失败",{type:"error"})});I.validate(p=>{p&&(e==="新增"?B(S):L(S))})}})}}}export{D as useData};