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

2 lines
2.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 S=Object.defineProperty,C=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var m=(t,e,a)=>e in t?S(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,h=(t,e)=>{for(var a in e||(e={}))w.call(e,a)&&m(t,a,e[a]);if(b)for(var a of b(e))z.call(e,a)&&m(t,a,e[a]);return t},f=(t,e)=>C(t,_(e));var p=(t,e,a)=>new Promise((n,r)=>{var g=o=>{try{s(a.next(o))}catch(u){r(u)}},d=o=>{try{s(a.throw(o))}catch(u){r(u)}},s=o=>o.done?n(o.value):Promise.resolve(o.value).then(g,d);s((a=a.apply(t,e)).next())});import{n as i,b as D,r as k,aA as v,fI as x}from"./index-CRmU-Qpi.js";import{a as L,d as P,c as R}from"./backpack-BEosm8mY.js";function F(){const t=i(!0),e=i([]),a=i(!1),n=i({total:0,pageSize:10,currentPage:1,pageSizes:[10,20,50,100],background:!0}),r=i({search_id:"",search_nickname:"",search_mobile:""}),g=i([{label:"名称",prop:"search_nickname",type:"input"},{label:"手机号",prop:"search_mobile",type:"input"}]),d=i([{label:"ID",prop:"id"},{label:"头像",prop:"avatar",cellRenderer:({row:l})=>D(k("el-image"),{fit:"cover","preview-teleported":!0,src:l.avatar,"preview-src-list":Array.of(l.avatar),class:"w-[24px] h-[24px] rounded-full align-middle"},null)},{label:"昵称",prop:"nickname"},{label:"生成时间",prop:"createtime"},{label:"手机号",prop:"mobile"},{label:"操作",fixed:"right",slot:"operation"}]),s=l=>p(this,null,function*(){t.value=!0,r.value=h({},l);const{data:c,code:y}=yield L(f(h({},l),{page:n.value.currentPage,page_limit:n.value.pageSize}));y&&(e.value=c.lists,n.value.total=c.count,n.value.currentPage=c.page),t.value=!1});return{searchForm:r,searchLabel:g,onSearch:s,isShow:a,tableList:e,tableLabel:d,pagination:n,handleSizeChange:l=>{n.value.pageSize=l,s(r.value)},handleCurrentChange:l=>{n.value.currentPage=l,s(r.value)},loading:t,generateData:()=>p(this,null,function*(){x.confirm("该操作将自动生成20条机器人数据是否继续","提示",{type:"warning"}).then(()=>p(this,null,function*(){const{code:l,msg:c}=yield R();l?(v("操作成功",{type:"success"}),s(r.value)):v(c,{type:"error"})})).catch(()=>{})}),handleDelete:l=>p(this,null,function*(){const{code:c}=yield P({user_id:l.id});c&&(v(`您删除了名称为${l.nickname}的这条数据`,{type:"success"}),s(r.value))})}}export{F as useData};