Commit fc501814 authored by 李纪文's avatar 李纪文

fix: 增加统计查看

parent 14a4cb57
......@@ -8,7 +8,7 @@ const baseURI = typeof DUMI_TYPE !== 'undefined' && DUMI_TYPE === 'dumi' ? '/api
// 获取统计数据
export function getStatisticsInfo(data) {
return request({
url: `${baseURI}/PandaMonitor/Monitor/Device/EquipmentDataReport`,
url: `${baseURI}/PandaMonitor/Monitor/Device/EquipmentDataReportByBack`,
method: REQUEST_METHOD_POST,
data,
});
......
......@@ -41,8 +41,8 @@ const StatisticalHistoryView = (props) => {
// 自定义时间类型
const onPickerChange = (value) => {
setPicker(value);
const start = moment(dateTime).subtract(2, value).format('YYYY-MM-DD 00:00:00');
const end = moment(dateTime).format('YYYY-MM-DD 23:59:59');
let start = moment(dateTime).subtract(2, value).startOf(value).format('YYYY-MM-DD 00:00:00');
let end = moment(dateTime).endOf(value).format('YYYY-MM-DD 23:59:59');
setTime({ startDate: start, endDate: end });
};
......@@ -156,8 +156,9 @@ const StatisticalHistoryView = (props) => {
const dataTable = data0.map((item, index) => {
return {
...item,
value1: data1[index]?.value,
value2: data1[index]?.value,
value0: item?.value === 0 || item?.value ? item?.value : '-',
value1: data1[index]?.value === 0 || data1[index]?.value ? data1[index]?.value : '-',
value2: data2[index]?.value === 0 || data2[index]?.value ? data2[index]?.value : '-',
};
});
renderChart(dataChart, data);
......@@ -169,11 +170,14 @@ const StatisticalHistoryView = (props) => {
const { unit, dName } = data;
const series = [];
dataInfo.data.forEach((item, index) => {
const config = dName.indexOf('流量') > -1 ? { areaStyle: {} } : {};
const config = !index && dName.indexOf('流量') > -1 ? { areaStyle: {} } : {};
const style = index ? {lineStyle:{normal:{type:'dashed'}}} : {}
const list = {
name: dataInfo.name[index],
type: 'line',
smooth: true,
...config,
...style,
data: item.map((arr) => {
return {
name: arr.pt,
......@@ -198,8 +202,8 @@ const StatisticalHistoryView = (props) => {
containLabel: true,
left: 10,
right: 10,
top: 10,
bottom: 10
// top: 20,
bottom: 10,
},
toolbox: {
show: false,
......@@ -235,7 +239,7 @@ const StatisticalHistoryView = (props) => {
};
const renderTable = (dataInfo, timeName) => {
const dataIndex = ['value', 'value1', 'value2'];
const dataIndex = ['value0', 'value1', 'value2'];
const column1 = [
{
title: '时间',
......
......@@ -51,7 +51,7 @@
}
&-chart {
flex: 3;
flex: 4;
overflow: hidden;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment