Browse Source

数据监控接口字段修改

develop
fuguobin 11 months ago
parent
commit
d470a3b169
  1. 27
      src/api/dashboard/index.ts
  2. 14
      src/api/table/list.ts
  3. 472
      src/views/dashboard/components/BarChart.vue
  4. 20
      src/views/dashboard/components/LineChart.vue
  5. 340
      src/views/dashboard/components/returnChart.vue
  6. 6
      src/views/dashboard/index.vue
  7. 3
      src/views/monitoring/screen/components/main.vue
  8. 16
      src/views/monitoring/screenData/components/main.vue

27
src/api/dashboard/index.ts

@ -52,3 +52,30 @@ export function getDeviceCountApi() {
method: 'get' method: 'get'
}); });
} }
/**
*
*/
export function getFirstLineApi() {
return request({
url: '/home/first/line',
method: 'get'
});
}
/**
*
*/
export function getSupplyTemperatureRanking() {
return request({
url: '/home/first/supplyTemperatureRanking',
method: 'get'
});
}
/**
*
*/
export function getBackTemperatureRanking() {
return request({
url: '/home/first/backTemperatureRanking',
method: 'get'
});
}

14
src/api/table/list.ts

@ -59,6 +59,17 @@ export function getTableData(data: any) {
}); });
} }
/**
* header
*/
export function getMockTableHeader(): AxiosPromise<[]> {
return request({
// url: '/bi/opt/getTableHeader',
url: '/dc/mock/data/monitor/table/header',
method: 'get'
});
}
/** /**
* *
* *
@ -66,7 +77,8 @@ export function getTableData(data: any) {
*/ */
export function getMockTableData(data: any) { export function getMockTableData(data: any) {
return request({ return request({
url: '/bi/opt/mock/getTableDataPage', // url: '/bi/opt/mock/getTableDataPage',
url: '/dc/mock/data/monitor/table/data',
method: 'post', method: 'post',
data: data data: data
}); });

472
src/views/dashboard/components/BarChart.vue

@ -1,11 +1,18 @@
<!-- 线 + 柱混合图 -->
<template> <template>
<div :id="id" :class="className" :style="{ height, width }" /> <div ref="complaintRef" id="stackedLine" class="complaintLine" :style="{ height, width }" />
</template> </template>
<script setup> <script setup>
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { randomColor } from '@/utils/index'; import { randomColor, endTime, debounce } from '@/utils/index';
import { getSupplyTemperatureRanking } from '@/api/dashboard/index';
// import { Ref } from 'vue';
// const complaintRef: Ref<HTMLElement | any> = ref(null);
import useCounter from '@/store/modules/date';
const counterStore = useCounter();
const yearMonthDay = ref();
const timer = ref();
const isCurrentRoute = ref(true);
const mapEcharts = ref();
const props = defineProps({ const props = defineProps({
id: { id: {
@ -28,203 +35,244 @@ const props = defineProps({
} }
}); });
const defualData = [ onMounted(() => {
{ getHeatRate();
cdate: '2016', });
cname: '换热站1,换热站2,换热站3,换热站4,换热站5,换热站6,换热站7,换热站8,换热站9,换热站10', // watchEffect(() => {
cut: '20.9,13.82,3.6,0.56,1.49,9.48,32,21,65,19' // const dataStr = counterStore.dateStr;
}, // if (dataStr != '') {
{ // yearMonthDay.value = counterStore.dateStr.split('-');
cdate: '2017', // getHeatRate();
cname: '换热站1,换热站2,换热站3,换热站4,换热站5,换热站6,换热站7,换热站8,换热站9,换热站10', // }
cut: '18.7,12.82,13.6,9.56,12.49,13.48,21,23,52,53' // });
}, function getHeatRate() {
{ //
cdate: '2018', const params = {};
cname: '换热站1,换热站2,换热站3,换热站4,换热站5,换热站6,换热站7,换热站8,换热站9,换热站10', getSupplyTemperatureRanking().then(res => {
cut: '14.9,18.82,7.6,19.56,13.49,17.48,80,33,63,42' if (res.code === 200 && Object.keys(res.data).length != 0) {
}, dataInfo(res.data);
{ }
cdate: '2019', });
cname: '换热站1,换热站2,换热站3,换热站4,换热站5,换热站6,换热站7,换热站8,换热站9,换热站10',
cut: '16.9,3.82,13.6,15.56,12.49,14.48,54,35,40,20'
},
{
cdate: '2020',
cname: '换热站1,换热站2,换热站3,换热站4,换热站5,换热站6,换热站7,换热站8,换热站9,换热站10',
cut: '3.8,8.82,13.6,21.56,15.49,19.2,16,19,24,52'
},
{
cdate: '2021',
cname: '换热站1,换热站2,换热站3,换热站4,换热站5,换热站6,换热站7,换热站8,换热站9,换热站10',
cut: '23.9,16.82,13.6,17.56,14.49,19.98,18,12,30,35'
},
{
cdate: '2022',
cname: '换热站1,换热站2,换热站3,换热站4,换热站5,换热站6,换热站7,换热站8,换热站9,换热站10',
cut: '12,23,46,52,39,32,25,28,31,37'
},
{
cdate: '2023',
cname: '换热站1,换热站2,换热站3,换热站4,换热站5,换热站6,换热站7,换热站8,换热站9,换热站10',
cut: '52,59,60,49,42,36,10,9,21,28'
}
];
const colors = ['#5470c6', '#91cc75', '#fac858', '#1a94bc', '#f26b1f', '#5bae23'];
const ccolors = {};
var updateFrequency = 1000; //
var years = [];
var startIndex = 0;
for (var i = 0; i < defualData.length; ++i) {
years.push(defualData[i]);
} }
// function dataInfo(data) {
var startYear = years[startIndex].cdate; const defualData = data;
var startName = years[startIndex].cname.split(','); // const defualData = [
var startCut = years[startIndex].cut.split(','); // {
for (let i = 0; i < startName.length; i++) { // cdate: '2016',
if (i < 6) { // cname: '1,2,3,4,5,6,7,8,9,10',
ccolors[startName[i]] = colors[i]; // cut: '20.9,13.82,3.6,0.56,1.49,9.48,32,21,65,19'
} else { // },
ccolors[startName[i]] = randomColor(); // {
// cdate: '2017',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '18.7,12.82,13.6,9.56,12.49,13.48,21,23,52,53'
// },
// {
// cdate: '2018',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '14.9,18.82,7.6,19.56,13.49,17.48,80,33,63,42'
// },
// {
// cdate: '2019',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '16.9,3.82,13.6,15.56,12.49,14.48,54,35,40,20'
// },
// {
// cdate: '2020',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '3.8,8.82,13.6,21.56,15.49,19.2,16,19,24,52'
// },
// {
// cdate: '2021',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '23.9,16.82,13.6,17.56,14.49,19.98,18,12,30,35'
// },
// {
// cdate: '2022',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '12,23,46,52,39,32,25,28,31,37'
// },
// {
// cdate: '2023',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '52,59,60,49,42,36,10,9,21,28'
// }
// ];
const colors = ['#5470c6', '#91cc75', '#fac858', '#1a94bc', '#f26b1f', '#5bae23'];
const ccolors = {};
const chart = echarts.init(document.getElementById('stackedLine'));
mapEcharts.value = chart;
var updateFrequency = 1000; //
var years = [];
var startIndex = 0;
for (var i = 0; i < defualData.length; ++i) {
years.push(defualData[i]);
} }
} //
console.log(ccolors); var startYear = years[startIndex].cdate;
var startName = years[startIndex].cname.split(',');
var startCut = years[startIndex].cut.split(',');
for (let i = 0; i < startName.length; i++) {
if (i < 6) {
ccolors[startName[i]] = colors[i];
} else {
ccolors[startName[i]] = randomColor();
}
}
console.log(ccolors);
const options = { const options = {
// tooltip: { // tooltip: {
// trigger: 'axis', // trigger: 'axis',
// axisPointer: { // axisPointer: {
// type: 'shadow' // type: 'shadow'
// } // }
// }, // },
legend: { legend: {
right: 100, right: 100,
itemWidth: 11, itemWidth: 11,
itemHeight: 2, itemHeight: 2,
color: '#fff', color: '#fff',
fontSize: 14 fontSize: 14
},
grid: {
top: '0',
left: '0',
right: '0',
bottom: '0',
containLabel: true
},
xAxis: {
max: 'dataMax',
type: 'value',
nameTextStyle: {
color: '#000',
fontSize: 12,
padding: [0, 0, 0, 0] //name
}, },
axisTick: { grid: {
// top: '0',
show: false left: '0',
}, right: '10%',
axisLabel: { bottom: '0',
show: true, containLabel: true
color: '#000',
formatter: function (n) {
return Math.round(n) + '';
}
}, },
splitLine: { dataZoom: [
// 线 //Y
show: true, {
lineStyle: { type: 'slider',
//线 show: true,
type: 'dashed', yAxisIndex: [0],
color: '#306269', width: 8,
width: 1, height: '90%',
opacity: 0.2 right: '10',
startValue: 0,
endValue: 10,
zoomLoxk: true,
top: 'middle'
},
{
type: 'inside',
yAxisIndex: [0],
zoomOnMouseWheel: true,
moveOnMouseMove: true,
moveOnMouseWheel: true
} }
} ],
}, xAxis: {
dataset: { max: 'dataMax',
source: defualData type: 'value',
}, nameTextStyle: {
yAxis: { color: '#000',
type: 'category', fontSize: 12,
nameTextStyle: { padding: [0, 0, 0, 0] //name
color: '#000', },
fontSize: 12, axisTick: {
padding: [0, 0, 0, 0] //name //
}, show: false
axisTick: { },
// axisLabel: {
show: false show: true,
}, color: '#000',
axisLabel: { formatter: function (n) {
show: true, return Math.round(n) + '';
color: '#000', }
rich: { },
flag: { splitLine: {
fontSize: 25, // 线
padding: 5 show: true,
lineStyle: {
//线
type: 'dashed',
color: '#306269',
width: 1,
opacity: 0.2
} }
} }
}, },
inverse: true, dataset: {
animationDuration: 300, // source: defualData
animationDurationUpdate: 300, // },
data: startName yAxis: {
}, type: 'category',
series: [ nameTextStyle: {
{ color: '#000',
// name: '2023', fontSize: 12,
type: 'bar', padding: [0, 0, 0, 0] //name
barWidth: 20, //
showBackground: false,
realtimeSort: true, //
itemStyle: {
color: function (param) {
return ccolors[param.name];
}
}, },
encode: { axisTick: {
x: 0, //
y: 3 show: false
}, },
label: { axisLabel: {
show: true, show: true,
precision: 1,
position: 'right',
color: '#000', color: '#000',
valueAnimation: false // rich: {
}, flag: {
emphasis: { fontSize: 25,
focus: 'series' // padding: 5
}
}
}, },
data: startCut inverse: true,
} animationDuration: 300, //
], animationDurationUpdate: 300, //
animationDuration: 0, data: startName
animationDurationUpdate: 3000, },
animationEasing: 'linear', series: [
animationEasingUpdate: 'linear',
graphic: {
elements: [
{ {
type: 'text', // name: '2023',
right: 50, type: 'bar',
bottom: 50, // barWidth: 20, //
style: { showBackground: false,
text: startYear, realtimeSort: true, //
font: 'bolder 80px monospace', itemStyle: {
fill: 'rgba(100, 100, 100, 0.25)' color: function (param) {
return ccolors[param.name];
}
}, },
z: 100 encode: {
x: 0,
y: 3
},
label: {
show: true,
precision: 1,
position: 'right',
color: '#000',
valueAnimation: false //
},
emphasis: {
focus: 'series' //
},
data: startCut
} }
] ],
} animationDuration: 0,
}; animationDurationUpdate: 3000,
animationEasing: 'linear',
onMounted(() => { animationEasingUpdate: 'linear',
// graphic: {
const chart = echarts.init(document.getElementById(props.id)); elements: [
{
type: 'text',
right: 50,
bottom: 50,
style: {
text: startYear,
font: 'bolder 80px monospace',
fill: 'rgba(100, 100, 100, 0.25)'
},
z: 100
}
]
}
};
chart.setOption(options); chart.setOption(options);
for (var i = startIndex; i < defualData.length - 1; ++i) { for (var i = startIndex; i < defualData.length - 1; ++i) {
(function (i) { (function (i) {
@ -233,18 +281,60 @@ onMounted(() => {
}, (i + 1) * updateFrequency); }, (i + 1) * updateFrequency);
})(i); })(i);
} }
//
window.addEventListener('resize', () => {
chart.resize();
});
function getDeviceInfos(year) { function getDeviceInfos(year) {
options.yAxis.data = year.cname.split(','); options.yAxis.data = year.cname.split(',');
options.series[0].data = year.cut.split(','); options.series[0].data = year.cut.split(',');
options.graphic.elements[0].style.text = year.cdate; options.graphic.elements[0].style.text = year.cdate;
const chart = echarts.init(document.getElementById(props.id)); const chart = echarts.init(document.getElementById('stackedLine'));
chart.setOption(options); chart.setOption(options);
} }
//
window.addEventListener('resize', () => {
chart.resize();
});
}
onUnmounted(() => {
if (mapEcharts.value) {
//echarts
echarts.dispose(mapEcharts.value);
mapEcharts.value = null;
}
}); });
// function getDeviceInfoss() {
// //
// const params = filterForm;
// params.startTime = currentEndTime.value;
// params.step = 6;
// params.stepType = '3';
// params.queryType = 2;
// console.log(params);
// getDeviceInfos(params).then(res => {
// if (res.code === 200 && Object.keys(res.data).length != 0) {
// if (isCurrentRoute.value) {
// timer.value = setTimeout(async () => {
// await (timer.value && clearTimeout(timer.value));
// await getDeviceInfoss();
// }, 360000);
// }
// if (res.data.additionalInfo != null) {
// currentEndTime.value = res.data.additionalInfo.endTime;
// console.log(currentEndTime.value, res.data.mainInfos);
// }
// options.series.forEach(originalObj => {
// res.data.mainInfos.forEach(newObj => {
// if (originalObj.name === newObj.name) {
// newObj.data.map(item => {
// originalObj.data.push(item);
// });
// }
// });
// });
// console.log(options.series);
// const chart = echarts.init(document.getElementById('stackedLine'));
// chart.setOption(options);
// } else {
// clearTimeout(timer.value);
// }
// });
// }
</script> </script>

20
src/views/dashboard/components/LineChart.vue

@ -1,10 +1,11 @@
<!-- 线 + 柱混合图 --> <!-- 线 + 柱混合图 -->
<template> <template>
<div :id="id" :class="className" :style="{ height, width }" /> <div :ref="id" :id="id" :class="className" :style="{ height, width }" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { getFirstLineApi } from '@/api/dashboard/index';
const props = defineProps({ const props = defineProps({
id: { id: {
@ -53,9 +54,9 @@ const options = {
dataset: { dataset: {
source: [ source: [
['product', '2024-01-01', '2024-01-02', '2024-01-03', '2024-01-04', '2024-01-05', '2024-01-06', '2024-01-07'], ['product', '2024-01-01', '2024-01-02', '2024-01-03', '2024-01-04', '2024-01-05', '2024-01-06', '2024-01-07'],
['温', 59.2, 78.9, 87.8, 79.5, 52.4, 90.7, 55], ['温', 59.2, 78.9, 87.8, 79.5, 52.4, 90.7, 55],
['回温', 42.0, 60.1, 62.8, 55.9, 30.2, 79.2, 20], ['回温', 42.0, 60.1, 62.8, 55.9, 30.2, 79.2, 20],
['温均温', 52, 77, 75, 70.1, 53.4, 50, 40], ['温均温', 52, 77, 75, 70.1, 53.4, 50, 40],
['回温均温', 40, 52, 61, 49, 20.4, 61.8, 10] ['回温均温', 40, 52, 61, 49, 20.4, 61.8, 10]
] ]
}, },
@ -136,10 +137,23 @@ onMounted(() => {
// //
const chart = echarts.init(document.getElementById(props.id) as HTMLDivElement); const chart = echarts.init(document.getElementById(props.id) as HTMLDivElement);
chart.setOption(options); chart.setOption(options);
getFirstLine();
// //
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
chart.resize(); chart.resize();
}); });
}); });
function getFirstLine() {
//
const params = {};
getFirstLineApi().then((res: any) => {
if (res.code === 200 && Object.keys(res.data).length != 0) {
options.dataset.source = res.data.source;
options.yAxis[0].name = `单位(${res.data.unit})`;
const chart = echarts.init(document.getElementById(props.id) as HTMLDivElement);
chart.setOption(options);
}
});
}
</script> </script>

340
src/views/dashboard/components/returnChart.vue

@ -0,0 +1,340 @@
<template>
<div ref="complaintRef" id="returnChart" class="complaintLine" :style="{ height, width }" />
</template>
<script setup>
import * as echarts from 'echarts';
import { randomColor, endTime, debounce } from '@/utils/index';
import { getBackTemperatureRanking } from '@/api/dashboard/index';
// import { Ref } from 'vue';
// const complaintRef: Ref<HTMLElement | any> = ref(null);
import useCounter from '@/store/modules/date';
const counterStore = useCounter();
const yearMonthDay = ref();
const timer = ref();
const isCurrentRoute = ref(true);
const mapEcharts = ref();
const props = defineProps({
id: {
type: String,
default: 'lineChart'
},
className: {
type: String,
default: ''
},
width: {
type: String,
default: '200px',
required: true
},
height: {
type: String,
default: '200px',
required: true
}
});
onMounted(() => {
getHeatRate();
});
// watchEffect(() => {
// const dataStr = counterStore.dateStr;
// if (dataStr != '') {
// yearMonthDay.value = counterStore.dateStr.split('-');
// getHeatRate();
// }
// });
function getHeatRate() {
//
const params = {};
getBackTemperatureRanking().then(res => {
if (res.code === 200 && Object.keys(res.data).length != 0) {
dataInfo(res.data);
}
});
}
function dataInfo(data) {
const defualData = data;
// const defualData = [
// {
// cdate: '2016',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '20.9,13.82,3.6,0.56,1.49,9.48,32,21,65,19'
// },
// {
// cdate: '2017',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '18.7,12.82,13.6,9.56,12.49,13.48,21,23,52,53'
// },
// {
// cdate: '2018',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '14.9,18.82,7.6,19.56,13.49,17.48,80,33,63,42'
// },
// {
// cdate: '2019',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '16.9,3.82,13.6,15.56,12.49,14.48,54,35,40,20'
// },
// {
// cdate: '2020',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '3.8,8.82,13.6,21.56,15.49,19.2,16,19,24,52'
// },
// {
// cdate: '2021',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '23.9,16.82,13.6,17.56,14.49,19.98,18,12,30,35'
// },
// {
// cdate: '2022',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '12,23,46,52,39,32,25,28,31,37'
// },
// {
// cdate: '2023',
// cname: '1,2,3,4,5,6,7,8,9,10',
// cut: '52,59,60,49,42,36,10,9,21,28'
// }
// ];
const colors = ['#5470c6', '#91cc75', '#fac858', '#1a94bc', '#f26b1f', '#5bae23'];
const ccolors = {};
const chart = echarts.init(document.getElementById('returnChart'));
mapEcharts.value = chart;
var updateFrequency = 1000; //
var years = [];
var startIndex = 0;
for (var i = 0; i < defualData.length; ++i) {
years.push(defualData[i]);
}
//
var startYear = years[startIndex].cdate;
var startName = years[startIndex].cname.split(',');
var startCut = years[startIndex].cut.split(',');
for (let i = 0; i < startName.length; i++) {
if (i < 6) {
ccolors[startName[i]] = colors[i];
} else {
ccolors[startName[i]] = randomColor();
}
}
console.log(ccolors);
const options = {
// tooltip: {
// trigger: 'axis',
// axisPointer: {
// type: 'shadow'
// }
// },
legend: {
right: 100,
itemWidth: 11,
itemHeight: 2,
color: '#fff',
fontSize: 14
},
grid: {
top: '0',
left: '0',
right: '10%',
bottom: '0',
containLabel: true
},
dataZoom: [
//Y
{
type: 'slider',
show: true,
yAxisIndex: [0],
width: 8,
height: '90%',
right: '10',
startValue: 0,
endValue: 10,
zoomLoxk: true,
top: 'middle'
},
{
type: 'inside',
yAxisIndex: [0],
zoomOnMouseWheel: true,
moveOnMouseMove: true,
moveOnMouseWheel: true
}
],
xAxis: {
max: 'dataMax',
type: 'value',
nameTextStyle: {
color: '#000',
fontSize: 12,
padding: [0, 0, 0, 0] //name
},
axisTick: {
//
show: false
},
axisLabel: {
show: true,
color: '#000',
formatter: function (n) {
return Math.round(n) + '';
}
},
splitLine: {
// 线
show: true,
lineStyle: {
//线
type: 'dashed',
color: '#306269',
width: 1,
opacity: 0.2
}
}
},
dataset: {
source: defualData
},
yAxis: {
type: 'category',
nameTextStyle: {
color: '#000',
fontSize: 12,
padding: [0, 0, 0, 0] //name
},
axisTick: {
//
show: false
},
axisLabel: {
show: true,
color: '#000',
rich: {
flag: {
fontSize: 25,
padding: 5
}
}
},
inverse: true,
animationDuration: 300, //
animationDurationUpdate: 300, //
data: startName
},
series: [
{
// name: '2023',
type: 'bar',
// barWidth: 20, //
showBackground: false,
realtimeSort: true, //
itemStyle: {
color: function (param) {
return ccolors[param.name];
}
},
encode: {
x: 0,
y: 3
},
label: {
show: true,
precision: 1,
position: 'right',
color: '#000',
valueAnimation: false //
},
emphasis: {
focus: 'series' //
},
data: startCut
}
],
animationDuration: 0,
animationDurationUpdate: 3000,
animationEasing: 'linear',
animationEasingUpdate: 'linear',
graphic: {
elements: [
{
type: 'text',
right: 50,
bottom: 50,
style: {
text: startYear,
font: 'bolder 80px monospace',
fill: 'rgba(100, 100, 100, 0.25)'
},
z: 100
}
]
}
};
chart.setOption(options);
for (var i = startIndex; i < defualData.length - 1; ++i) {
(function (i) {
setTimeout(function () {
getDeviceInfos(years[i + 1]);
}, (i + 1) * updateFrequency);
})(i);
}
function getDeviceInfos(year) {
options.yAxis.data = year.cname.split(',');
options.series[0].data = year.cut.split(',');
options.graphic.elements[0].style.text = year.cdate;
const chart = echarts.init(document.getElementById('returnChart'));
chart.setOption(options);
}
//
window.addEventListener('resize', () => {
chart.resize();
});
}
onUnmounted(() => {
if (mapEcharts.value) {
//echarts
echarts.dispose(mapEcharts.value);
mapEcharts.value = null;
}
});
// function getDeviceInfoss() {
// //
// const params = filterForm;
// params.startTime = currentEndTime.value;
// params.step = 6;
// params.stepType = '3';
// params.queryType = 2;
// console.log(params);
// getDeviceInfos(params).then(res => {
// if (res.code === 200 && Object.keys(res.data).length != 0) {
// if (isCurrentRoute.value) {
// timer.value = setTimeout(async () => {
// await (timer.value && clearTimeout(timer.value));
// await getDeviceInfoss();
// }, 360000);
// }
// if (res.data.additionalInfo != null) {
// currentEndTime.value = res.data.additionalInfo.endTime;
// console.log(currentEndTime.value, res.data.mainInfos);
// }
// options.series.forEach(originalObj => {
// res.data.mainInfos.forEach(newObj => {
// if (originalObj.name === newObj.name) {
// newObj.data.map(item => {
// originalObj.data.push(item);
// });
// }
// });
// });
// console.log(options.series);
// const chart = echarts.init(document.getElementById('returnChart'));
// chart.setOption(options);
// } else {
// clearTimeout(timer.value);
// }
// });
// }
</script>

6
src/views/dashboard/index.vue

@ -72,14 +72,14 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-card> <el-card>
<template #header> 一网温排行 </template> <template #header> 一网温排行 </template>
<BarChart id="barChart" height="300px" width="100%" /> <BarChart id="barChart" height="300px" width="100%" />
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-card> <el-card>
<template #header> 一网回温排行 </template> <template #header> 一网回温排行 </template>
<BarChart id="barCharts" height="300px" width="100%" /> <ReturnChart id="returnChart" height="300px" width="100%" />
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
@ -102,7 +102,7 @@ import calendar from '@/utils/lunar';
import countTo from '@/utils/countTo'; import countTo from '@/utils/countTo';
import LineChart from './components/LineChart.vue'; import LineChart from './components/LineChart.vue';
import BarChart from './components/BarChart.vue'; import BarChart from './components/BarChart.vue';
import PieChart from './components/PieChart.vue'; import ReturnChart from './components/returnChart.vue';
import avatar from '@/assets/images/avatar.png'; import avatar from '@/assets/images/avatar.png';
import mitt from '@/plugins/bus'; import mitt from '@/plugins/bus';

3
src/views/monitoring/screen/components/main.vue

@ -308,7 +308,7 @@ mitt.on('tableMessage', (res: any) => {
tableArray.splice(index, 1, item); tableArray.splice(index, 1, item);
} }
}); });
console.log('tableData--', tableArray); // console.log('tableData--', tableArray);
$table.loadData(tableArray); $table.loadData(tableArray);
// if (res.code === 'datareal') { // if (res.code === 'datareal') {
// const index = tableData.value.findIndex((obj) => obj.id === res.data.id); // const index = tableData.value.findIndex((obj) => obj.id === res.data.id);
@ -440,6 +440,7 @@ const cellDBLClickEvent: VxeTableEvents.CellDblclick<TableVo> = ({ row, column }
cellRow.value = row; cellRow.value = row;
cellColumn.value = column; cellColumn.value = column;
cellField.value = cellField; cellField.value = cellField;
debugger;
if (cellField.canBeControl === '1' && controlPerm) { if (cellField.canBeControl === '1' && controlPerm) {
modalTitle.value = column.title; modalTitle.value = column.title;
///formData.value.url = data.url; ///formData.value.url = data.url;

16
src/views/monitoring/screenData/components/main.vue

@ -36,19 +36,19 @@
show-overflow show-overflow
@cell-dblclick="cellDBLClickEvent" @cell-dblclick="cellDBLClickEvent"
> >
<template #deviceuuid_default="{ row }"> <template #assetInfo_default="{ row }">
<div class="title"> <div class="title">
<svg-icon <svg-icon
icon-class="warning_lights" icon-class="warning_lights"
style="fill: currentColor; width: 15px; height: 15px; color: green" style="fill: currentColor; width: 15px; height: 15px; color: green"
v-if="row.deviceuuid.deviceStatus === 0" v-if="row.assetInfo.assetStatus === '0'"
/> />
<svg-icon <svg-icon
icon-class="warning_lights" icon-class="warning_lights"
style="fill: currentColor; width: 15px; height: 15px; color: red" style="fill: currentColor; width: 15px; height: 15px; color: red"
v-if="row.deviceuuid.deviceStatus === 2" v-if="row.assetInfo.assetStatus === '2'"
/> />
<span class="name" @click.native="nameClick(row.deviceuuid)">{{ row.gTitle }}</span> <span class="name" @click.native="nameClick(row.assetInfo)">{{ row.gTitle }}</span>
</div> </div>
</template> </template>
<template #pager> <template #pager>
@ -128,7 +128,7 @@ import {
VxeTablePropTypes, VxeTablePropTypes,
VxePagerEvents VxePagerEvents
} from 'vxe-table'; } from 'vxe-table';
import { getTableHeader, getStationInfo, getMockTableData, editConfig, sendCtrl } from '@/api/table/list'; import { getMockTableHeader, getStationInfo, getMockTableData, editConfig, sendCtrl } from '@/api/table/list';
import { TableVo } from '@/api/table/types'; import { TableVo } from '@/api/table/types';
import { tableStore } from '@/store/modules/table'; import { tableStore } from '@/store/modules/table';
import mitt from '@/plugins/bus'; import mitt from '@/plugins/bus';
@ -167,7 +167,7 @@ const tablePage = reactive({
currentPage: 1, currentPage: 1,
pageSize: 10 pageSize: 10
}); });
// const fields = ref(['deviceuuid']) // // const fields = ref(['assetInfo']) //
// const waringArrow = ref([]) // const waringArrow = ref([])
interface FormDataVO { interface FormDataVO {
@ -357,7 +357,7 @@ function stationInfo() {
function tableHeader() { function tableHeader() {
//header //header
getTableHeader().then((res: any) => { getMockTableHeader().then((res: any) => {
console.log(res); console.log(res);
// //
const tableCessText = [ const tableCessText = [
@ -389,7 +389,7 @@ function tableHeader() {
// { // {
// id: 1, // id: 1,
// title: '', // title: '',
// field: 'deviceuuid', // field: 'assetInfo',
// colSort: 2, // colSort: 2,
// colType: '2', // colType: '2',
// width: 150, // width: 150,

Loading…
Cancel
Save