2 lines
2.2 KiB
JavaScript
2 lines
2.2 KiB
JavaScript
import{bu as p,am as g,ac as x}from"./bootstrap-CG9GXOLj.js";import{u as _,_ as v}from"./use-echarts-C773uxJZ.js";import{m as w,b9 as E,aa as C,w as L,ad as m,b2 as u,ae as z,ac as k,bL as I,j as y,u as c}from"../jse/index-index-Z45rumFj.js";const M={class:"trend-chart bg-card"},N={key:0,class:"chart-empty"},A=w({__name:"trend-chart",props:{data:{}},setup(h){const o=h,l=E(),{renderEcharts:S}=_(l),r=C(()=>o.data.length>0);function b(){var d,f;const s=[],a=[],n=[],i=new Map;for(const e of o.data)i.set(e.hour,e);for(let e=0;e<24;e++){s.push(`${String(e).padStart(2,"0")}:00`);const t=i.get(e);a.push((d=t==null?void 0:t.enterCount)!=null?d:0),n.push((f=t==null?void 0:t.leaveCount)!=null?f:0)}return{tooltip:{trigger:"axis"},legend:{data:["进入","离开"],top:"5%",textStyle:{color:"#595959",fontSize:11}},grid:{left:"3%",right:"4%",bottom:"3%",top:"18%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:s,axisLine:{lineStyle:{color:"#d9d9d9"}},axisLabel:{color:"#8c8c8c",fontSize:11,interval:1}},yAxis:{type:"value",name:"次数",minInterval:1,nameTextStyle:{color:"#8c8c8c",fontSize:12},axisLine:{show:!1},axisLabel:{color:"#8c8c8c"},splitLine:{lineStyle:{color:"#f0f0f0",type:"dashed"}}},series:[{name:"进入",type:"line",smooth:!0,symbol:"circle",symbolSize:5,data:a,lineStyle:{width:2.5,color:"#1677ff"},itemStyle:{color:"#1677ff"},areaStyle:{opacity:.12,color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(22, 119, 255, 0.3)"},{offset:1,color:"rgba(22, 119, 255, 0.02)"}]}}},{name:"离开",type:"line",smooth:!0,symbol:"circle",symbolSize:5,data:n,lineStyle:{width:2.5,color:"#fa8c16"},itemStyle:{color:"#fa8c16"},areaStyle:{opacity:.12,color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(250, 140, 22, 0.3)"},{offset:1,color:"rgba(250, 140, 22, 0.02)"}]}}}]}}return L(()=>o.data,()=>{r.value&&S(b())},{immediate:!0,deep:!0}),(s,a)=>(u(),m("div",M,[a[0]||(a[0]=z("div",{class:"chart-title"},"时段出入趋势",-1)),r.value?k("",!0):(u(),m("div",N,[y(c(p),{description:"暂无数据",image:c(p).PRESENTED_IMAGE_SIMPLE},null,8,["image"])])),I(y(c(v),{ref_key:"chartRef",ref:l,height:"260px",width:"100%"},null,512),[[g,r.value]])]))}}),T=x(A,[["__scopeId","data-v-e686c76d"]]);export{T as default};
|