2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
import{d as e,r as t,o as a,b as s,e as l,X as r,N as i,b2 as n,f as o,i as c,I as d,J as p,T as f,q as x,v as u,j as b,g as v,w as m,m as h}from"./index-BoIUJTA2.js";import"./el-tooltip-l0sNRNKZ.js";/* empty css */import{k as g}from"./operations-Cr4YfoRu.js";import{E as w}from"./index-BMeOzN3u.js";import{_ as y}from"./_plugin-vue_export-helper-BCo6x5W8.js";import"./index-COyGylbk.js";import"./index-Bq8lawOo.js";const k={class:"art-card p-6 overflow-hidden relative group h-full"},j={class:"flex flex-col space-y-4"},_={class:"flex items-center"},R={class:"flex-1 min-w-0"},I={class:"flex justify-between items-center mb-1"},N={class:"font-bold text-g-800 truncate"},P={class:"text-[10px] ml-1 opacity-70"},T={class:"flex-cb text-[11px] text-g-600 mb-2 font-bold leading-none"},q={class:"flex items-center space-x-3"},C={class:"text-g-900"},E={class:"text-g-900"},J={class:"cursor-help"},M={class:"text-primary font-black"},U={class:"relative h-1.5 w-full bg-g-200 dark:bg-white/10 rounded-full overflow-hidden"},X={class:"ml-6 flex flex-col items-center"},$={class:"flex flex-col items-center cursor-help"},z={class:"w-14 h-14 rounded-full border-2 border-primary/20 flex-cc flex-col shadow-inner bg-white"},A={class:"text-sm font-black text-primary"},B={key:0,class:"text-center py-12 text-g-300"},D=y(e({__name:"product-performance",setup(e){const y=t(!1),D=t([]);return a(()=>{return e=this,t=null,a=function*(){y.value=!0;try{D.value=yield g("30d")}catch(e){f.error("获取排行数据失败")}finally{y.value=!1}},new Promise((s,l)=>{var r=e=>{try{n(a.next(e))}catch(t){l(t)}},i=e=>{try{n(a.throw(e))}catch(t){l(t)}},n=e=>e.done?s(e.value):Promise.resolve(e.value).then(r,i);n((a=a.apply(e,t)).next())});var e,t,a}),(e,t)=>{const a=w,f=n;return l(),s("div",k,[t[5]||(t[5]=r('<div class="art-card-header mb-6" data-v-b5ef51b3><div class="title" data-v-b5ef51b3><div class="flex-c mb-1" data-v-b5ef51b3><i class="ri-trophy-fill text-warning mr-2 text-xl" data-v-b5ef51b3></i><h4 class="text-xl font-black text-g-900 tracking-tight" data-v-b5ef51b3>产品动销排行</h4></div><p class="text-sm text-g-500" data-v-b5ef51b3>追踪各盲盒系列的利润贡献与库存效率</p></div></div>',1)),i((l(),s("div",null,[o("div",j,[(l(!0),s(d,null,p(D.value,(e,r)=>(l(),s("div",{key:e.id,class:"performance-item p-4 rounded-2xl bg-g-50/50 dark:bg-white/5 border border-transparent hover:border-primary/20 hover:bg-white dark:hover:bg-white/10 transition-all duration-300"},[o("div",_,[o("div",{class:x(["w-9 h-9 rounded-xl flex-cc font-black text-base mr-4 shadow-sm",r<3?"bg-primary text-white scale-110":"bg-g-200 text-g-700"])},u(r+1),3),o("div",R,[o("div",I,[o("span",N,u(e.seriesName),1),o("span",{class:x(["text-sm font-black transition-colors duration-300",e.profit>=0?"text-danger":"text-success"])},[b(u(e.profit>=0?"+":"-")+"¥"+u(Math.abs(e.profit))+" ",1),o("span",P,"("+u(e.profitRate)+"%)",1)],2)]),o("div",T,[o("div",q,[o("span",null,[t[0]||(t[0]=b("销量: ",-1)),o("span",C,u(e.salesCount),1)]),t[2]||(t[2]=o("span",{class:"w-px h-2 bg-g-200"},null,-1)),o("span",null,[t[1]||(t[1]=b("营收: ",-1)),o("span",E,"¥"+u(e.amount),1)])]),v(a,{content:"该系列营收占总营收的比例",placement:"top"},{default:m(()=>[o("span",J,[t[3]||(t[3]=b("贡献率: ",-1)),o("span",M,u(e.contributionRate)+"%",1)])]),_:2},1024)]),o("div",U,[o("div",{class:"absolute top-0 left-0 h-full bg-gradient-to-r from-primary to-blue-400 rounded-full transition-all duration-1000",style:h({width:`${e.contributionRate}%`})},null,4)])]),o("div",X,[v(a,{content:"商品销售速度,数值越高说明卖得越快",placement:"top"},{default:m(()=>[o("div",$,[t[4]||(t[4]=o("div",{class:"text-[10px] text-g-600 uppercase font-black mb-1"},"周转率",-1)),o("div",z,[o("span",A,u(e.inventoryTurnover),1)])])]),_:2},1024)])])]))),128))]),D.value.length?c("",!0):(l(),s("div",B," 暂无数据 "))])),[[f,y.value]])])}}}),[["__scopeId","data-v-b5ef51b3"]]);export{D as default};
|