var e=Object.defineProperty,t=Object.defineProperties,r=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(t,r,a)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a;import{E as i,_ as p}from"./index-C4WacTPc.js";import{d as n,a as d,r as m,o as c,e as u,f as j,h as b,p as x,l as v,m as f,z as h,O as w}from"./index-ip5gDR6L.js";/* empty css                    *//* empty css               *//* empty css                 *//* empty css                       *//* empty css                        *//* empty css                */import{b as g}from"./dashboard-C-Wq9kTO.js";import{E as y,a as _}from"./index-B1PFnxt8.js";import{_ as O}from"./_plugin-vue_export-helper-BCo6x5W8.js";/* empty css                  *//* empty css                  *//* empty css                     *//* empty css                  *//* empty css                 */import"./el-tooltip-l0sNRNKZ.js";import"./index-DbRz3Zuu.js";import"./index-fnD_mPvE.js";import"./index-C9KXwj2c.js";import"./index-CHAf6FpU.js";import"./use-form-item-BDb3ZgPk.js";import"./use-form-common-props-BwBs_jod.js";import"./_initCloneObject-DwsgJamq.js";import"./isArrayLikeObject-OMLaZ5Za.js";import"./index-Br3btmwp.js";import"./index-D1xXI5gl.js";import"./token-DWNpOE8r.js";import"./index-D-10FtUD.js";import"./scroll-ChxXkPhM.js";import"./debounce-B9s63_mG.js";import"./index-Jz5GfFad.js";import"./vnode-6FKeug3R.js";import"./index-KXWZe8V3.js";import"./index-D-iZIej9.js";import"./index-DfrOVkw6.js";const C={class:"art-card p-5 h-128 overflow-hidden mb-5 max-sm:mb-4"},P={class:"art-card-header"},k={class:"title"},A={class:"text-success"},D={style:{display:"flex","align-items":"center"}},S=["src"],z={class:"ml-2"},E={class:"text-g-700"},I={class:"text-g-700"},V={class:"text-g-700"},B={class:"text-g-500 text-sm"},F=O(n({__name:"new-user",setup(e){const n=d("本月"),O=d(0),F=m([]),M=()=>{return e=this,i=null,p=function*(){try{const{list:e}=yield g(1,20);F.splice(0,F.length,...e.map(e=>{return i=((e,t)=>{for(var r in t||(t={}))s.call(t,r)&&l(e,r,t[r]);if(a)for(var r of a(t))o.call(t,r)&&l(e,r,t[r]);return e})({},e),p={createdAt:e.createdAt.slice(0,10)},t(i,r(p));var i,p}));const i=e.filter(e=>e.createdAt>=new Date((new Date).getFullYear(),(new Date).getMonth(),1).toISOString()).length,p=e.length-i;O.value=p?Math.round((i-p)/p*100):0}catch(e){w.error("获取新用户失败"),F.splice(0)}},new Promise((t,r)=>{var a=e=>{try{o(p.next(e))}catch(t){r(t)}},s=e=>{try{o(p.throw(e))}catch(t){r(t)}},o=e=>e.done?t(e.value):Promise.resolve(e.value).then(a,s);o((p=p.apply(e,i)).next())});var e,i,p};return c(()=>{M()}),(e,t)=>{const r=y,a=_,s=i,o=p;return j(),u("div",C,[b("div",P,[b("div",k,[t[2]||(t[2]=b("h4",null,"新用户",-1)),b("p",null,[t[1]||(t[1]=v("本月增长",-1)),b("span",A,"+"+f(O.value)+"%",1)])]),x(a,{modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=e=>n.value=e)},{default:h(()=>[x(r,{value:"本月",label:"本月"}),x(r,{value:"上月",label:"上月"}),x(r,{value:"今年",label:"今年"})]),_:1},8,["modelValue"])]),x(o,{class:"w-full",data:F,style:{width:"100%"},size:"large",border:!1,stripe:!1,"header-cell-style":{background:"transparent"}},{default:h(()=>[x(s,{label:"头像",prop:"avatar",width:"150px"},{default:h(e=>[b("div",D,[b("img",{class:"size-9 rounded-lg",src:e.row.avatar,alt:"avatar"},null,8,S),b("span",z,f(e.row.nickname),1)])]),_:1}),x(s,{label:"积分余额",prop:"pointsBalance",width:"100px"},{default:h(e=>[b("span",E,f(e.row.pointsBalance),1)]),_:1}),x(s,{label:"资产数",prop:"inventoryCount",width:"90px"},{default:h(e=>[b("span",I,f(e.row.inventoryCount),1)]),_:1}),x(s,{label:"道具卡",prop:"itemCardCount",width:"90px"},{default:h(e=>[b("span",V,f(e.row.itemCardCount),1)]),_:1}),x(s,{label:"注册时间",prop:"createdAt",width:"160px"},{default:h(e=>[b("span",B,f(e.row.createdAt),1)]),_:1})]),_:1},8,["data"])])}}}),[["__scopeId","data-v-9a6ace2b"]]);export{F as default};
