TradeTrendCard-64f33066.js 4.1 KB

1
  1. import{d as j,r as O,f as z,m as V,o as _,x as T,w as u,h as A,g as f,a as c,Q as I,c as L,F as q,v as E,q as F,t as G,c1 as r,a_ as h,da as Q,ak as U,_ as X,__tla as Z}from"./index-12a7743c.js";import{E as B,__tla as H}from"./el-card-73514116.js";import{_ as J,__tla as K}from"./Echart-735b79c4.js";import{a as N,__tla as R}from"./trade-5f677b7f.js";import{f as p,__tla as S}from"./formatTime-adaaebb7.js";import{C as W,__tla as Y}from"./CardTitle-ffaf8c59.js";let D,$=Promise.all([(()=>{try{return Z}catch{}})(),(()=>{try{return H}catch{}})(),(()=>{try{return K}catch{}})(),(()=>{try{return R}catch{}})(),(()=>{try{return S}catch{}})(),(()=>{try{return Y}catch{}})()]).then(async()=>{let x,b;x={class:"flex flex-row items-center justify-between"},b={class:"flex flex-row items-center gap-2"},D=X(j({name:"TradeTrendCard",__name:"TradeTrendCard",setup(aa){const n=O(1),v=O(!0),w=new Map().set(1,{name:"30\u5929",series:[{name:"\u8BA2\u5355\u91D1\u989D",type:"bar",smooth:!0,data:[]},{name:"\u8BA2\u5355\u6570\u91CF",type:"line",smooth:!0,data:[]}]}).set(7,{name:"\u5468",series:[{name:"\u4E0A\u5468\u91D1\u989D",type:"bar",smooth:!0,data:[]},{name:"\u672C\u5468\u91D1\u989D",type:"bar",smooth:!0,data:[]},{name:"\u4E0A\u5468\u6570\u91CF",type:"line",smooth:!0,data:[]},{name:"\u672C\u5468\u6570\u91CF",type:"line",smooth:!0,data:[]}]}).set(30,{name:"\u6708",series:[{name:"\u4E0A\u6708\u91D1\u989D",type:"bar",smooth:!0,data:[]},{name:"\u672C\u6708\u91D1\u989D",type:"bar",smooth:!0,data:[]},{name:"\u4E0A\u6708\u6570\u91CF",type:"line",smooth:!0,data:[]},{name:"\u672C\u6708\u6570\u91CF",type:"line",smooth:!0,data:[]}]}).set(365,{name:"\u5E74",series:[{name:"\u53BB\u5E74\u91D1\u989D",type:"bar",smooth:!0,data:[]},{name:"\u4ECA\u5E74\u91D1\u989D",type:"bar",smooth:!0,data:[]},{name:"\u53BB\u5E74\u6570\u91CF",type:"line",smooth:!0,data:[]},{name:"\u4ECA\u5E74\u6570\u91CF",type:"line",smooth:!0,data:[]}]}),o=z({grid:{left:20,right:20,bottom:20,top:80,containLabel:!0},legend:{top:50,data:[]},series:[],toolbox:{feature:{dataZoom:{yAxisIndex:!1},brush:{type:["lineX","clear"]},saveAsImage:{show:!0,name:"\u8BA2\u5355\u91CF\u8D8B\u52BF"}}},tooltip:{trigger:"axis",axisPointer:{type:"cross"},padding:[5,10]},xAxis:{type:"category",inverse:!0,boundaryGap:!1,axisTick:{show:!1},data:[],axisLabel:{formatter:e=>{switch(n.value){case 1:return p(e,"MM-DD");case 7:let t=p(e,"ddd");return t=="0"&&(t="\u65E5"),"\u5468"+t;case 30:return p(e,"D");case 365:return p(e,"M")+"\u6708";default:return e}}}},yAxis:{axisTick:{show:!1}}}),g=async()=>{let e,t;switch(n.value){case 7:e=r().startOf("week"),t=r().endOf("week");break;case 30:e=r().startOf("month"),t=r().endOf("month");break;case 365:e=r().startOf("year"),t=r().endOf("year");break;default:e=r().subtract(30,"day").startOf("d"),t=r().endOf("d")}await M(e,t)},M=async(e,t)=>{var m,l,i,P,k,C;v.value=!0;const y=await N(n.value,e,t),d=[],s=[...w.get(n.value).series];for(let a of y)d.push(a.value.date),s.length===2?(s[0].data.push(h(((m=a==null?void 0:a.value)==null?void 0:m.orderPayPrice)||0)),s[1].data.push(h(((l=a==null?void 0:a.value)==null?void 0:l.orderPayCount)||0))):(s[0].data.push(h(((i=a==null?void 0:a.reference)==null?void 0:i.orderPayPrice)||0)),s[1].data.push(h(((P=a==null?void 0:a.value)==null?void 0:P.orderPayPrice)||0)),s[2].data.push(((k=a==null?void 0:a.reference)==null?void 0:k.orderPayCount)||0),s[3].data.push(((C=a==null?void 0:a.value)==null?void 0:C.orderPayCount)||0));o.xAxis.data=d,o.series=s,o.legend.data=s.map(a=>a.name),v.value=!1};return V(()=>{g()}),(e,t)=>{const y=Q,d=U,s=J,m=B;return _(),T(m,{shadow:"never"},{header:u(()=>[A("div",x,[f(c(W),{title:"\u4EA4\u6613\u91CF\u8D8B\u52BF"}),A("div",b,[f(d,{modelValue:c(n),"onUpdate:modelValue":t[0]||(t[0]=l=>I(n)?n.value=l:null),onChange:g},{default:u(()=>[(_(!0),L(q,null,E(c(w).entries(),([l,i])=>(_(),T(y,{key:l,label:l},{default:u(()=>[F(G(i.name),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])])]),default:u(()=>[f(s,{height:300,options:c(o)},null,8,["options"])]),_:1})}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/mall/home/components/TradeTrendCard.vue"]])});export{$ as __tla,D as default};