Commit 48282e58 authored by 朱超's avatar 朱超

趋势图页面更新

parent da46b311
...@@ -93,10 +93,7 @@ ...@@ -93,10 +93,7 @@
</el-table> </el-table>
</div> </div>
<div v-show="!switchV" id="echartsLayerBlock"> <div v-show="!switchV" id="echartsLayerBlock">
<div <div class="echartsLayer" id="echartsLayer"></div>
class="echartsLayer"
id="echartsLayer"
></div>
</div> </div>
<!-- <div v-show="!nodata"> <!-- <div v-show="!nodata">
<el-empty :image-size="200" description="暂无数据" /> <el-empty :image-size="200" description="暂无数据" />
...@@ -189,8 +186,10 @@ function postHeatUctFun() { ...@@ -189,8 +186,10 @@ function postHeatUctFun() {
interval: 2, interval: 2,
}; };
postHeatUct(heatUctInfo).then((res) => { postHeatUct(heatUctInfo).then((res) => {
echarts.dispose(document.getElementById("echartsLayer"));
// postHeatUct(params).then((res) => { // postHeatUct(params).then((res) => {
if (res.success === true) { if (res.success === true) {
tableData.length = 0;
res.data.forEach((element) => { res.data.forEach((element) => {
let tableArr = { let tableArr = {
transferName: element.transferName, transferName: element.transferName,
...@@ -201,10 +200,14 @@ function postHeatUctFun() { ...@@ -201,10 +200,14 @@ function postHeatUctFun() {
}); });
nodata.value = true; nodata.value = true;
tabloading.value = false; tabloading.value = false;
echartData.length = 0;
echartSeries.length = 0;
echartDataLegend.length = 0;
echartDataTime.length = 0;
echartData.value = dataDeal(res.data); echartData.value = dataDeal(res.data);
echartData.value[0].listInfo.forEach((element) => { echartData.value[0].listInfo.forEach((element) => {
if (element.gatherTime) { if (element.gatherTime) {
echartDataTime.push(element.gatherTime); echartDataTime.push(element.gatherTime.split(" 00:00:00")[0]);
} }
}); });
echartData.value.forEach((element) => { echartData.value.forEach((element) => {
...@@ -240,9 +243,10 @@ function postHeatUctFun() { ...@@ -240,9 +243,10 @@ function postHeatUctFun() {
); );
}); });
echartSeries.forEach((element, index) => { echartSeries.forEach((element, index) => {
console.log(element);
echartDataLegend.push(element.name); echartDataLegend.push(element.name);
}); });
//echartInit(); echartInit();
} else if (res.status == 9) { } else if (res.status == 9) {
setInterval(function () { setInterval(function () {
tabloading.value = false; tabloading.value = false;
...@@ -299,7 +303,7 @@ function echartInit() { ...@@ -299,7 +303,7 @@ function echartInit() {
var chartDom = document.getElementById("echartsLayer"); var chartDom = document.getElementById("echartsLayer");
var myChart = echarts.init(chartDom); var myChart = echarts.init(chartDom);
var option; var option;
myChart.resize({ width:computedWidth.value,height: computedHeight.value }); myChart.resize({ width: computedWidth.value, height: computedHeight.value });
var company = "T"; var company = "T";
option = { option = {
...@@ -364,7 +368,7 @@ function changeFun() { ...@@ -364,7 +368,7 @@ function changeFun() {
nodata.value = true; nodata.value = true;
var divWidth = document.getElementById("contentBlock").offsetWidth; var divWidth = document.getElementById("contentBlock").offsetWidth;
var divHeight = document.getElementById("contentBlock").scrollHeight; var divHeight = document.getElementById("contentBlock").scrollHeight;
computedWidth.value = divWidth + "px" computedWidth.value = divWidth + "px";
computedHeight.value = divHeight * 0.7 + "px"; computedHeight.value = divHeight * 0.7 + "px";
echartInit(); echartInit();
} }
......
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