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

2 lines
3.4 KiB
JavaScript

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