2 lines
3.3 KiB
JavaScript
2 lines
3.3 KiB
JavaScript
var G=Object.defineProperty,L=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var $=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var M=(n,t,i)=>t in n?G(n,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[t]=i,y=(n,t)=>{for(var i in t||(t={}))K.call(t,i)&&M(n,i,t[i]);if($)for(var i of $(t))j.call(t,i)&&M(n,i,t[i]);return n},b=(n,t)=>L(n,A(t));var p=(n,t,i)=>new Promise((m,s)=>{var g=o=>{try{u(i.next(o))}catch(f){s(f)}},a=o=>{try{u(i.throw(o))}catch(f){s(f)}},u=o=>o.done?m(o.value):Promise.resolve(o.value).then(g,a);u((i=i.apply(n,t)).next())});import{_ as B}from"./form.vue_vue_type_script_setup_true_lang-D50B9usK.js";import{n as c,aA as d,aK as v,ag as _}from"./index-CRmU-Qpi.js";import{_ as E}from"./record.vue_vue_type_script_setup_true_lang-DDpuDBM8.js";import{_ as H}from"./index.vue_vue_type_script_setup_true_lang-1k8ze5BO.js";import{q as J,d as N,a as Q,e as U}from"./activities-UkTzwAkp.js";import"./index-CnAi1QxJ.js";import"./sortable.esm-7jaD_3Ar.js";import"./epTheme-Dbh1KLs6.js";import"./hook-_9wHMMzO.js";import"./form.vue_vue_type_script_setup_true_lang-B5Zt0w7a.js";function oe(){const n=c(),t=c(!0),i=c([]),m=c(!1),s=c({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),g=c([{label:"ID",prop:"id"},{label:"新人礼包名称",prop:"name"},{label:"新人礼包标题",prop:"title"},{label:"副标题1",prop:"title1"},{label:"副标题2",prop:"title2"},{label:"价值(元)",prop:"money"},{label:"状态",prop:"status_str"},{label:"操作",fixed:"right",width:210,slot:"operation"}]),a=()=>p(this,null,function*(){t.value=!0;const{data:l,code:e}=yield J({page:s.value.currentPage,page_limit:s.value.pageSize,activities_id:7});e&&(i.value=l.lists,s.value.total=l.count,s.value.currentPage=l.page),t.value=!1});return{onSearch:a,isShow:m,tableList:i,tableLabel:g,pagination:s,handleSizeChange:l=>{s.value.pageSize=l,a()},handleCurrentChange:l=>{s.value.currentPage=l,a()},loading:t,handleDelete:l=>p(this,null,function*(){const{code:e}=yield N({id:l.id});e&&(d(`您删除了名称为${l.name}的这条数据`,{type:"success"}),a())}),openDialog:(l="新增",e)=>{var C,S,R,k,z,I;v({title:`${l}首充分类`,props:{formInline:{title:(C=e==null?void 0:e.title)!=null?C:"",name:(S=e==null?void 0:e.name)!=null?S:"",status:(R=e==null?void 0:e.status)!=null?R:"",title1:(k=e==null?void 0:e.title1)!=null?k:"",title2:(z=e==null?void 0:e.title2)!=null?z:"",money:(I=e==null?void 0:e.money)!=null?I:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>_(B,{ref:n,formInline:null}),beforeSure:(P,{options:O})=>{const T=n.value.getRef(),F=O.props.formInline,q=r=>p(this,null,function*(){const{code:h}=yield Q(b(y({},r),{activities_id:7}));h?(d("新增成功",{type:"success"}),a(),P()):d("新增失败",{type:"error"})}),x=r=>p(this,null,function*(){const{code:h}=yield U(b(y({},r),{id:e.id,activities_id:7}));h?(d("修改成功",{type:"success"}),a(),P()):d("修改失败",{type:"error"})});T.validate(r=>{r&&(l==="新增"?q(F):x(F))})}})},openGiftPark:l=>{v({title:"礼包列表",width:"60%",closeOnClickModal:!1,hideFooter:!0,props:{rowData:l},contentRenderer:()=>_(H,{ref:n,formInline:null})})},DistributionRecord:()=>{v({title:"发放记录",width:"60%",closeOnClickModal:!1,hideFooter:!0,contentRenderer:()=>_(E,{ref:n,formInline:null})})}}}export{oe as useData};
|