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si{Pa^PZ(K>v8bewLke)`jjyf`Af@XW9P=PlC?LL3f
zEdzDUt(N;78xuZ}_GP$-H1_4Ne<<~J9{HSd;?B##?lz6lN&&gE<
z#U>;AQlM>TNNZQB@A!s;pI$GPYrCfa|98tRfbVPpU8VMWJqTgg9pm7kzRB5g_3dGt
z$UoB>vS82TwQ*sWD#=oZetqi9f#8_nb`dbyBL36@F8}~On#AG~}
zl85V~3y(O?neQ{vPLY0|ll~hpf3s!JT$!74Dn7yQ%zE+jk73v?V5DLC7Vub@=1>{x
z`{4a_Dgn`BP7PR|QA(<7Z8!(1x$rGqgjj)h$Aclo
zhvXLEqJYWO!Jy5|G$Hr{PJk56tfo#H!FSQ|s$%;X87lHfDO{krG`%6Fayxj5aT-*U
zmAX~A#^Za)SR7|B_RdxBG9ldjgTqPqtaY<|@6?5XK!>!?#X62I-Q-1j;{IaKuW!fT
zElDQzx7Uy=!}Ngboctp~v0j_uDNQ9U0Nlz1qAKnTG$
z914aLdA~DZ>(z9@vn)I*&R=mP*{c01II`?yG0j#H--{=iGEcN`TB2B-Y(}NinJk`Y
zPHKgT*_1HcH;M
znu2D=o3uB#fQg$jXh!kJ62l3w@|l7?93G>ri>=Nsz#TV*UdM%AjNAe~8nFd(e6bGd
zc=kE;PxN1lanrkanO?-zz0^>1V=a%9K_^PYa;stq_A&J}9e_RwOJblJ$1}KLFYd
BnWz8&
diff --git a/lazy-timer-fe/src/pages/Charts/Bar.jsx b/lazy-timer-fe/src/pages/Charts/Bar.jsx
index e29351a..d90852a 100644
--- a/lazy-timer-fe/src/pages/Charts/Bar.jsx
+++ b/lazy-timer-fe/src/pages/Charts/Bar.jsx
@@ -1,9 +1,6 @@
import React, { useEffect, useState } from 'react'
import ReactECharts from 'echarts-for-react'
-import moment from 'moment'
-import { ChartComponent, SeriesCollectionDirective, SeriesDirective, Inject, Legend, Category, Tooltip, ColumnSeries, DataLabel } from '@syncfusion/ej2-react-charts'
-import { barCustomSeries, barPrimaryXAxis, barPrimaryYAxis } from '../../data/dummy'
import { ChartsHeader } from '../../components'
import { useStateContext } from '../../contexts/ContextProvider'
import { getDayScreenUseTime } from '../../service/getDayScreenUseTime/index'
@@ -17,7 +14,7 @@ const Bar = () => {
// 格式化日期
var yyyy = date.getFullYear().toString()
var mm = (date.getMonth() + 1).toString()
- var dd = date.getDate().toString()
+ var dd = (date.getDate() + 1).toString()
var mmChars = mm.split('')
var ddChars = dd.split('')
@@ -201,7 +198,7 @@ const Bar = () => {
}
}
})
- })
+ }, [])
return (
diff --git a/lazy-timer-fe/src/pages/Charts/Line.jsx b/lazy-timer-fe/src/pages/Charts/Line.jsx
index 66e2b8b..eaca36f 100644
--- a/lazy-timer-fe/src/pages/Charts/Line.jsx
+++ b/lazy-timer-fe/src/pages/Charts/Line.jsx
@@ -1,14 +1,239 @@
-import React from 'react';
+import React, { useEffect, useState } from 'react'
+import ReactECharts from 'echarts-for-react'
-import { ChartsHeader, LineChart } from '../../components';
+import { ChartsHeader } from '../../components'
+import { useStateContext } from '../../contexts/ContextProvider'
+import { getDayScreenUseTime } from '../../service/getDayScreenUseTime/index'
-const Line = () => (
-
-);
+const Line = () => {
+ const { currentColor, currentMode } = useStateContext()
+ let [option, setOption] = useState({})
-export default Line;
+ /* 生成本周日期, 格式为 MM-DD */
+ function convertDate(date) {
+ // 格式化日期
+ var yyyy = date.getFullYear().toString()
+ var mm = (date.getMonth() + 1).toString()
+ var dd = (date.getDate() + 1).toString()
+
+ var mmChars = mm.split('')
+ var ddChars = dd.split('')
+
+ return (mmChars[1] ? mm : '0' + mmChars[0]) + '-' + (ddChars[1] ? dd : '0' + ddChars[0])
+ }
+
+ let currentWeekDates = new Array(7)
+ for (let i = 0; i < 7; i++) {
+ const curr = new Date()
+ currentWeekDates[i] = convertDate(new Date(curr.setDate(curr.getDate() - curr.getDay() + i)))
+ }
+
+ let currentWeekFirstScreenTime = new Array(7)
+ let bgColor = '#fff'
+ let color = ['#0090FF', '#36CE9E', '#FFC005', '#FF515A', '#8B5CFF', '#00CA69']
+ let echartData = [
+ {
+ name: '周一',
+ value1: 100
+ },
+ {
+ name: '周二',
+ value1: 138
+ },
+ {
+ name: '周三',
+ value1: 350
+ },
+ {
+ name: '周四',
+ value1: 173
+ },
+ {
+ name: '周五',
+ value1: 180
+ },
+ {
+ name: '周六',
+ value1: 150
+ },
+ {
+ name: '周日',
+ value1: 180
+ }
+ ]
+ let xAxisData = echartData.map(v => v.name)
+ for (let i = 0; i < 7; i++) {
+ xAxisData[i] = xAxisData[i] + ' ' + currentWeekDates[i]
+ }
+
+ const hexToRgba = (hex, opacity) => {
+ let rgbaColor = ''
+ let reg = /^#[\da-f]{6}$/i
+ if (reg.test(hex)) {
+ rgbaColor = `rgba(${parseInt('0x' + hex.slice(1, 3))},${parseInt('0x' + hex.slice(3, 5))},${parseInt('0x' + hex.slice(5, 7))},${opacity})`
+ }
+ return rgbaColor
+ }
+
+ useEffect(async () => {
+ for (let i = 0; i < 7; i++) {
+ let receivedJson = await getDayScreenUseTime('2022-' + currentWeekDates[i])
+ let firstScreenTimeH = parseInt(receivedJson.data.firstScreenTime.substring(0, 2))
+ let firstScreenTimeM = parseInt(receivedJson.data.firstScreenTime.substring(3, 5))
+ let firstScreenTimeS = parseInt(receivedJson.data.firstScreenTime.substring(6, 8))
+ if (firstScreenTimeH !== NaN && firstScreenTimeM !== NaN && firstScreenTimeS !== NaN) {
+ currentWeekFirstScreenTime[i] = 3600 * firstScreenTimeH + 60 * firstScreenTimeM + firstScreenTimeS
+ } else {
+ currentWeekFirstScreenTime[i] = NaN
+ }
+ }
+
+ setOption({
+ backgroundColor: bgColor,
+ color: color,
+ legend: {
+ right: 10,
+ top: 10
+ },
+ tooltip: {
+ trigger: 'axis',
+ formatter: function (params) {
+ let html = ''
+ params.forEach(v => {
+ if (!isNaN(v.value)) {
+ html += `
+
+ ${v.seriesName}
+
${Math.floor(v.value / 3600) + '时' + Math.floor((v.value % 3600) / 60) + '分钟' + Math.floor(v.value % 60) + '秒'}
+ `
+ } else {
+ html = `
+
+ ${v.seriesName}
+
该天还尚未开始
+ `
+ }
+ })
+ return html
+ },
+ extraCssText: 'background: #fff; border-radius: 0;box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);color: #333;',
+ axisPointer: {
+ type: 'shadow',
+ shadowStyle: {
+ color: '#ffffff',
+ shadowColor: 'rgba(225,225,225,1)',
+ shadowBlur: 5
+ }
+ }
+ },
+ grid: {
+ top: 100,
+ containLabel: true
+ },
+ xAxis: [
+ {
+ type: 'category',
+ boundaryGap: false,
+ axisLabel: {
+ formatter: '{value}',
+ textStyle: {
+ color: '#333'
+ }
+ },
+ axisLine: {
+ lineStyle: {
+ color: '#D9D9D9'
+ }
+ },
+ data: xAxisData.map(function (str) {
+ return str.replace(' ', '\n')
+ })
+ }
+ ],
+ yAxis: [
+ {
+ type: 'value',
+ // name: '单位:万千瓦时',
+ axisLabel: {
+ textStyle: {
+ color: '#666'
+ },
+ formatter: (value, index, format) => {
+ return Math.floor(value / 3600) + '时'
+ }
+ },
+ max: 86400,
+ nameTextStyle: {
+ color: '#666',
+ fontSize: 12,
+ lineHeight: 40
+ },
+ splitLine: {
+ lineStyle: {
+ type: 'dashed',
+ color: '#E9E9E9'
+ }
+ },
+ axisLine: {
+ show: false
+ },
+ axisTick: {
+ show: false
+ }
+ }
+ ],
+ series: [
+ {
+ name: '第一次屏幕使用时刻',
+ type: 'line',
+ smooth: true,
+ // showSymbol: false,/
+ symbolSize: 8,
+ zlevel: 3,
+ lineStyle: {
+ normal: {
+ color: color[0],
+ shadowBlur: 3,
+ shadowColor: hexToRgba(color[0], 0.5),
+ shadowOffsetY: 8
+ }
+ },
+ areaStyle: {
+ // normal: {
+ // color: new echarts.graphic.LinearGradient(
+ // 0,
+ // 0,
+ // 0,
+ // 1,
+ // [
+ // {
+ // offset: 0,
+ // color: hexToRgba(color[0], 0.3)
+ // },
+ // {
+ // offset: 1,
+ // color: hexToRgba(color[0], 0.1)
+ // }
+ // ],
+ // false
+ // ),
+ shadowColor: hexToRgba(color[0], 0.1),
+ shadowBlur: 10
+ },
+ data: currentWeekFirstScreenTime
+ }
+ ]
+ })
+ }, [])
+
+ return (
+
+ )
+}
+
+export default Line
diff --git a/lazy-timer-fe/src/pages/Customers.jsx b/lazy-timer-fe/src/pages/Customers.jsx
index 599e895..825243f 100644
--- a/lazy-timer-fe/src/pages/Customers.jsx
+++ b/lazy-timer-fe/src/pages/Customers.jsx
@@ -11,7 +11,7 @@ const Customers = () => {
return (
-
+
{
+ return post('/getDayActivity', {
+ dateTimeStr
+ })
+}
\ No newline at end of file