Commit ee5a8176 authored by yating.lin's avatar yating.lin

温度下限改为 -10 历史页热应激改为文字显示

parent ebc5a4d8
......@@ -52,14 +52,15 @@ export class EnvAddModelPage implements OnInit {
}
tempHaveTouch(event) {
const selectedId = event.target.value - 10; // 温度: 10~
for (let i = 10; i <= 50; i++) {
this.defaultColumnOptions[0][i - 10] = i.toString();
const value = event.target.value ? +event.target.value + 10 : 10;
const selectedId = value ; // 温度下限: -10
for (let i = -10; i <= 50; i++) {
this.defaultColumnOptions[0][i + 10] = i.toString();
}
if (this.fanMode.selecting === false) {
this.fanMode.selecting = true;
this.openPicker(1, 41, this.defaultColumnOptions, event, selectedId);
this.openPicker(1, 61, this.defaultColumnOptions, event, selectedId);
}
}
......
......@@ -317,14 +317,14 @@ export class EnvCfgPage implements OnInit {
}
tempHaveTouch(event) {
const selectedId = event.target.value - 10; // 温度: 10~
for (let i = 10; i <= 50; i++) {
this.defaultColumnOptions[0][i - 10] = i.toString();
const selectedId = +event.target.value + 10 ; // 温度下限: -10
for (let i = -10; i <= 50; i++) {
this.defaultColumnOptions[0][i + 10] = i.toString();
}
if (this.fanMode.selecting === false) {
this.fanMode.selecting = true;
this.openPicker(1, 41, this.defaultColumnOptions, event, selectedId);
this.openPicker(1, 61, this.defaultColumnOptions, event, selectedId);
}
}
......
......@@ -26,6 +26,7 @@ export class EnvHistoryPage implements OnInit {
chartOption = {
backgroundColor: '#fff',
tooltip: {
formatter: function(params) {},
trigger: 'axis',
axisPointer: {
// 坐标轴指示器,坐标轴触发有效
......@@ -134,7 +135,7 @@ export class EnvHistoryPage implements OnInit {
paintChart(param) {
const heatLevel = [
{id: 0, value: ''},
{id: 0, value: ''},
{id: 1, value: '轻'},
{id: 2, value: '中'},
{id: 3, value: '重'},
......@@ -165,6 +166,36 @@ export class EnvHistoryPage implements OnInit {
this.chartOption = {
backgroundColor: '#fff',
tooltip: {
formatter: function (params) {
const xNames = params[0].name;
let htmlStr = '';
htmlStr = xNames + '<br/>';
for (let i = 0; i < params.length; i++) {
const paramInfo = params[i];
if (paramInfo.seriesName === '温度') {
htmlStr += '<div style="font-size:12px;">';
htmlStr += '<span style="margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:5px;background-color:' +
paramInfo.color + ';"></span>';
htmlStr += paramInfo.seriesName + ':' + paramInfo.value + ' ℃';
htmlStr += '</div>';
} else if (paramInfo.seriesName === '湿度') {
htmlStr += '<div style="font-size:12px;">';
htmlStr += '<span style="margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:5px;background-color:' +
paramInfo.color + ';"></span>';
htmlStr += paramInfo.seriesName + ':' + paramInfo.value + '% RH';
htmlStr += '</div>';
} else {
const heatLevelValue: any = heatLevel.find( item => (item.id === +paramInfo.value));
const heatName = heatLevelValue.value ? heatLevelValue.value : '无';
htmlStr += '<div style="font-size:12px;">';
htmlStr += '<span style="margin-right:5px;display:inline-block;width:10px;height:10px;border-radius:5px;background-color:' +
paramInfo.color + ';"></span>';
htmlStr += paramInfo.seriesName + ':' + heatName;
htmlStr += '</div>';
}
}
return htmlStr;
},
trigger: 'axis',
// axisPointer: {
// type: 'cross',
......@@ -177,7 +208,7 @@ export class EnvHistoryPage implements OnInit {
type: 'line', // 默认为直线,可选为:'line' | 'shadow'
label: 'cross',
show: true
},
}
},
legend: {
data: ['温度', '湿度', '热应激']
......@@ -205,7 +236,7 @@ export class EnvHistoryPage implements OnInit {
splitLine: {show: false},
position: 'left',
min: 0,
max: 50,
// max: 50,
axisLine: {
lineStyle: {
width: 1,
......@@ -217,7 +248,7 @@ export class EnvHistoryPage implements OnInit {
name: '湿度(% RH)',
type: 'value',
min: 0,
max: 100,
// max: 100,
splitLine: {show: false},
position: 'right',
axisLine: {
......
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