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

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

parent ebc5a4d8
...@@ -52,14 +52,15 @@ export class EnvAddModelPage implements OnInit { ...@@ -52,14 +52,15 @@ export class EnvAddModelPage implements OnInit {
} }
tempHaveTouch(event) { tempHaveTouch(event) {
const selectedId = event.target.value - 10; // 温度: 10~ const value = event.target.value ? +event.target.value + 10 : 10;
for (let i = 10; i <= 50; i++) { const selectedId = value ; // 温度下限: -10
this.defaultColumnOptions[0][i - 10] = i.toString(); for (let i = -10; i <= 50; i++) {
this.defaultColumnOptions[0][i + 10] = i.toString();
} }
if (this.fanMode.selecting === false) { if (this.fanMode.selecting === false) {
this.fanMode.selecting = true; 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 { ...@@ -317,14 +317,14 @@ export class EnvCfgPage implements OnInit {
} }
tempHaveTouch(event) { tempHaveTouch(event) {
const selectedId = event.target.value - 10; // 温度: 10~ const selectedId = +event.target.value + 10 ; // 温度下限: -10
for (let i = 10; i <= 50; i++) { for (let i = -10; i <= 50; i++) {
this.defaultColumnOptions[0][i - 10] = i.toString(); this.defaultColumnOptions[0][i + 10] = i.toString();
} }
if (this.fanMode.selecting === false) { if (this.fanMode.selecting === false) {
this.fanMode.selecting = true; 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 { ...@@ -26,6 +26,7 @@ export class EnvHistoryPage implements OnInit {
chartOption = { chartOption = {
backgroundColor: '#fff', backgroundColor: '#fff',
tooltip: { tooltip: {
formatter: function(params) {},
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
// 坐标轴指示器,坐标轴触发有效 // 坐标轴指示器,坐标轴触发有效
...@@ -134,7 +135,7 @@ export class EnvHistoryPage implements OnInit { ...@@ -134,7 +135,7 @@ export class EnvHistoryPage implements OnInit {
paintChart(param) { paintChart(param) {
const heatLevel = [ const heatLevel = [
{id: 0, value: ''}, {id: 0, value: ''},
{id: 1, value: '轻'}, {id: 1, value: '轻'},
{id: 2, value: '中'}, {id: 2, value: '中'},
{id: 3, value: '重'}, {id: 3, value: '重'},
...@@ -165,6 +166,36 @@ export class EnvHistoryPage implements OnInit { ...@@ -165,6 +166,36 @@ export class EnvHistoryPage implements OnInit {
this.chartOption = { this.chartOption = {
backgroundColor: '#fff', backgroundColor: '#fff',
tooltip: { 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', trigger: 'axis',
// axisPointer: { // axisPointer: {
// type: 'cross', // type: 'cross',
...@@ -177,7 +208,7 @@ export class EnvHistoryPage implements OnInit { ...@@ -177,7 +208,7 @@ export class EnvHistoryPage implements OnInit {
type: 'line', // 默认为直线,可选为:'line' | 'shadow' type: 'line', // 默认为直线,可选为:'line' | 'shadow'
label: 'cross', label: 'cross',
show: true show: true
}, }
}, },
legend: { legend: {
data: ['温度', '湿度', '热应激'] data: ['温度', '湿度', '热应激']
...@@ -205,7 +236,7 @@ export class EnvHistoryPage implements OnInit { ...@@ -205,7 +236,7 @@ export class EnvHistoryPage implements OnInit {
splitLine: {show: false}, splitLine: {show: false},
position: 'left', position: 'left',
min: 0, min: 0,
max: 50, // max: 50,
axisLine: { axisLine: {
lineStyle: { lineStyle: {
width: 1, width: 1,
...@@ -217,7 +248,7 @@ export class EnvHistoryPage implements OnInit { ...@@ -217,7 +248,7 @@ export class EnvHistoryPage implements OnInit {
name: '湿度(% RH)', name: '湿度(% RH)',
type: 'value', type: 'value',
min: 0, min: 0,
max: 100, // max: 100,
splitLine: {show: false}, splitLine: {show: false},
position: 'right', position: 'right',
axisLine: { 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