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

2 lines
3.2 KiB
JavaScript

var V=Object.defineProperty,j=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var A=(i,l,s)=>l in i?V(i,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[l]=s,y=(i,l)=>{for(var s in l||(l={}))E.call(l,s)&&A(i,s,l[s]);if(q)for(var s of q(l))G.call(l,s)&&A(i,s,l[s]);return i},_=(i,l)=>j(i,B(l));var o=(i,l,s)=>new Promise((h,a)=>{var f=c=>{try{u(s.next(c))}catch(d){a(d)}},t=c=>{try{u(s.throw(c))}catch(d){a(d)}},u=c=>c.done?h(c.value):Promise.resolve(c.value).then(f,t);u((s=s.apply(i,l)).next())});import{_ as H}from"./form.vue_vue_type_script_setup_true_lang-CeQi_z5K.js";import{n as p,b as F,r as $,aA as g,aK as J,ag as Q}from"./index-CRmU-Qpi.js";import{q as T,d as U,a as W,e as X}from"./level-CSC0PShd.js";import"./index-An8nOBwL.js";function ie(){const i=p(),l=p(!0),s=p([]),h=p(!1),a=p({name:""}),f=p([{label:"分类名称",prop:"name",type:"input"}]),t=p({total:0,pageSize:10,pageSizes:[10,20,50,100],currentPage:1,background:!0}),u=p([{label:"ID",prop:"id"},{label:"等级",prop:"level"},{label:"等级名称",prop:"name"},{label:"财富值",prop:"change_value"},{label:"特权图标",prop:"privilege",cellRenderer:({row:n})=>F($("el-image"),{fit:"cover","preview-teleported":!0,src:n.rights_icon,"preview-src-list":Array.of(n.rights_icon),class:"w-[24px] h-[24px] rounded-full align-middle"},null)},{label:"状态",prop:"status",cellRenderer:({row:n})=>F($("el-tag"),{type:n.status===1?"success":"error"},{default:()=>[n.status===1?"显示":"隐藏"]})},{label:"发布时间",prop:"createtime"},{label:"操作",fixed:"right",width:210,slot:"operation"}]),c=n=>o(this,null,function*(){l.value=!0;const{data:e,code:m}=yield T(_(y({},n),{page:t.value.currentPage,page_limit:t.value.pageSize}));m&&(s.value=e.lists,t.value.total=e.count,t.value.currentPage=e.page),l.value=!1});return{searchForm:a,searchLabel:f,onSearch:c,isShow:h,tableList:s,tableLabel:u,pagination:t,handleSizeChange:n=>{t.value.pageSize=n,c(a.value)},handleCurrentChange:n=>{t.value.currentPage=n,c(a.value)},loading:l,handleDelete:n=>o(this,null,function*(){const{code:e}=yield U({id:n.id});e&&(g(`您删除了等级名称为${n.name}的这条数据`,{type:"success"}),c(a.value))}),openDialog:(n="新增",e)=>{var m,C,S,z,R,x,I,L;J({title:`${n}魅力等级`,props:{formInline:{level:(m=e==null?void 0:e.level)!=null?m:"",name:(C=e==null?void 0:e.name)!=null?C:"",image:(S=e==null?void 0:e.image)!=null?S:"",bg_image:(z=e==null?void 0:e.bg_image)!=null?z:"",color:(R=e==null?void 0:e.color)!=null?R:"",change_value:(x=e==null?void 0:e.change_value)!=null?x:"",status:(I=e==null?void 0:e.status)!=null?I:"",rights_icon:(L=e==null?void 0:e.rights_icon)!=null?L:""}},width:"40%",closeOnClickModal:!1,contentRenderer:()=>Q(H,{ref:i,formInline:null}),beforeSure:(P,{options:K})=>{const M=i.value.getRef(),k=K.props.formInline,N=r=>o(this,null,function*(){const{code:v,msg:b}=yield W(r);v?(g("新增成功",{type:"success"}),c(a.value),P()):g(b,{type:"error"})}),O=r=>o(this,null,function*(){const{code:v,msg:b}=yield X(_(y({},r),{id:e.id}));v?(g("修改成功",{type:"success"}),c(a.value),P()):g(b,{type:"error"})});M.validate(r=>{r&&(n==="新增"?N(k):O(k))})}})}}}export{ie as useData};