Files
aiot-platform-ui/apps/web-antd/dist/js/trend-chart-QblwskeE.js
lzh c16d049c38
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-31 23:16:25 +08:00

2 lines
2.3 KiB
JavaScript

import{bu as i,am as g,ac as _}from"./bootstrap-peLAqOBq.js";import{u as b,_ as v}from"./use-echarts-CUydHgm6.js";import{m as x,b9 as w,aa as f,w as E,ad as d,b2 as m,ae as C,ac as L,bL as T,j as p,u as l}from"../jse/index-index-fr7m5rpH.js";const D={class:"trend-chart"},z={key:0,class:"chart-empty"},k=x({__name:"trend-chart",props:{records:{}},setup(u){const r=u,n=w(),{renderEcharts:y}=b(n),h=f(()=>{const o=[],e=[],a=[];for(let t=0;t<24;t++)o.push(`${String(t).padStart(2,"0")}:00`),e.push(0),a.push(0);for(const t of r.records){if(t.enterTime){const c=new Date(t.enterTime).getHours();e[c]++}if(t.leaveTime){const c=new Date(t.leaveTime).getHours();a[c]++}}return{hours:o,enterCounts:e,leaveCounts:a}}),s=f(()=>r.records.length>0);function S(){const{hours:o,enterCounts:e,leaveCounts:a}=h.value;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:o,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:e,lineStyle:{width:2.5,color:"#52c41a"},itemStyle:{color:"#52c41a"},areaStyle:{opacity:.12,color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(82, 196, 26, 0.3)"},{offset:1,color:"rgba(82, 196, 26, 0.02)"}]}}},{name:"离开",type:"line",smooth:!0,symbol:"circle",symbolSize:5,data:a,lineStyle:{width:2.5,color:"#ff4d4f"},itemStyle:{color:"#ff4d4f"},areaStyle:{opacity:.12,color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(255, 77, 79, 0.3)"},{offset:1,color:"rgba(255, 77, 79, 0.02)"}]}}}]}}return E(()=>r.records,()=>{s.value&&y(S())},{immediate:!0,deep:!0}),(o,e)=>(m(),d("div",D,[e[0]||(e[0]=C("div",{class:"chart-title"},"时段出入趋势",-1)),s.value?L("",!0):(m(),d("div",z,[p(l(i),{description:"暂无数据",image:l(i).PRESENTED_IMAGE_SIMPLE},null,8,["image"])])),T(p(l(v),{ref_key:"chartRef",ref:n,height:"260",width:"100%"},null,512),[[g,s.value]])]))}}),B=_(k,[["__scopeId","data-v-23faa0fe"]]);export{B as default};