|
@@ -61,7 +61,7 @@ export default {
|
|
date: '',
|
|
date: '',
|
|
},
|
|
},
|
|
url: {
|
|
url: {
|
|
- list: '/equipmentOnoff/equipmentOnoff/getEquipmentHistoryData',
|
|
|
|
|
|
+ list: '/equipmentOnoff/equipmentOnoff/getEquipmentHistoryDataDefault',
|
|
listparams: '/tpmParams/tpmParams/queryByEquipId',
|
|
listparams: '/tpmParams/tpmParams/queryByEquipId',
|
|
},
|
|
},
|
|
deviceOptions: [],
|
|
deviceOptions: [],
|
|
@@ -248,7 +248,8 @@ export default {
|
|
_this.myChart.dispose(); // 销毁实例
|
|
_this.myChart.dispose(); // 销毁实例
|
|
}
|
|
}
|
|
_this.myChart = echarts.init(chartDom)
|
|
_this.myChart = echarts.init(chartDom)
|
|
- _this.echartsHeight = 4 * 300;
|
|
|
|
|
|
+ // _this.echartsHeight = 4 * 300;
|
|
|
|
+ _this.echartsHeight = _this.equipmentparams.length * 180;
|
|
// 获取time
|
|
// 获取time
|
|
_this.times = [];
|
|
_this.times = [];
|
|
_this.mongodbdata.forEach((i) => {
|
|
_this.mongodbdata.forEach((i) => {
|
|
@@ -267,7 +268,19 @@ export default {
|
|
var paramscount = 0;
|
|
var paramscount = 0;
|
|
var paramslength = _this.equipmentparams.length;
|
|
var paramslength = _this.equipmentparams.length;
|
|
_this.equipmentparams.forEach((item) => {
|
|
_this.equipmentparams.forEach((item) => {
|
|
- grid.push({left: leftValue, top: (0.05 + (paramscount) / paramslength) * 100 + "%", bottom: (1.05 - (paramscount + 1) / paramslength) * 100 + "%"});
|
|
|
|
|
|
+ // 加判断是为了最上和最下有点间距好看,也可以不判断直接用注释那句
|
|
|
|
+ var firstTop = 3 // 最上面一个距离顶部占比2%
|
|
|
|
+ var lastBottom = 2 // 最上面一个距离顶部占比2%
|
|
|
|
+ var itemPadding = 3 // 图形之间间隔占比1%
|
|
|
|
+ var itemHP = (100 - firstTop - lastBottom - itemPadding * (paramslength - 1)) / paramslength // 每一个图形占比
|
|
|
|
+ if(paramscount === 0){
|
|
|
|
+ grid.push({left: leftValue, top: firstTop + "%", bottom: (lastBottom + ((itemHP + itemPadding) * (paramslength - (paramscount + 1)))) + "%"});
|
|
|
|
+ } else if (paramscount === (paramslength - 1)){
|
|
|
|
+ grid.push({left: leftValue, top: (firstTop + (itemHP + itemPadding) * paramscount) + "%", bottom: lastBottom + "%"});
|
|
|
|
+ } else {
|
|
|
|
+ grid.push({left: leftValue, top: (firstTop + (itemHP + itemPadding) * paramscount) + "%", bottom: (lastBottom + (itemHP + itemPadding) * (paramslength - (paramscount + 1))) + "%"});
|
|
|
|
+ }
|
|
|
|
+ // grid.push({left: leftValue, top: (0.02 + paramscount / paramslength) * 100 + "%", bottom: (1.01 - (paramscount + 1) / paramslength) * 100 + "%"});;
|
|
|
|
|
|
xAxis.push({
|
|
xAxis.push({
|
|
type: 'category',
|
|
type: 'category',
|