|
|
@@ -166,222 +166,226 @@ export default {
|
|
|
return timestamp;
|
|
|
},
|
|
|
//获取折线数据
|
|
|
- initChartDataList() {
|
|
|
- this.$axios({
|
|
|
- method: 'POST',
|
|
|
- url: '/sex_at_ah',
|
|
|
- data: this.qs.stringify({
|
|
|
- begin: this.queryInfo.begin,
|
|
|
- end: this.queryInfo.end,
|
|
|
- e_id: this.queryInfo.e_id,
|
|
|
- })
|
|
|
- }).then((res) => {
|
|
|
- if (res.data.length > 0) {
|
|
|
- var ChartData = [
|
|
|
- {
|
|
|
- name: '温度(°C)',
|
|
|
- dat: []
|
|
|
- },
|
|
|
- {
|
|
|
- name: '湿度(%)',
|
|
|
- dat: []
|
|
|
- },
|
|
|
- {
|
|
|
- name: '红外计数值',
|
|
|
- dat: []
|
|
|
- },
|
|
|
- {
|
|
|
- name: '高压计数值',
|
|
|
- dat: []
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'cpu温度(°C)',
|
|
|
- dat: []
|
|
|
- }
|
|
|
- ]
|
|
|
- var data = res.data
|
|
|
- for (let item of data) {
|
|
|
- ChartData[0].dat.unshift([
|
|
|
- this.returnTime(item.tim),
|
|
|
- Number(item.at)
|
|
|
- ])
|
|
|
- ChartData[1].dat.unshift([
|
|
|
- this.returnTime(item.tim),
|
|
|
- Number(item.ah)
|
|
|
- ])
|
|
|
- ChartData[2].dat.unshift([
|
|
|
- this.returnTime(item.tim),
|
|
|
- Number(item.infr_ct)
|
|
|
- ])
|
|
|
- }
|
|
|
- this.options = {
|
|
|
- chart: {
|
|
|
- zoomType: 'x'
|
|
|
- },
|
|
|
- title: {
|
|
|
- text: '环境温湿度',
|
|
|
- align: 'left'
|
|
|
- },
|
|
|
- subtitle: {
|
|
|
- text: ''
|
|
|
- },
|
|
|
- xAxis: {
|
|
|
- crosshair: true, //十字基准线
|
|
|
- type: 'datetime',
|
|
|
- dateTimeLabelFormats: {
|
|
|
- //根据时间间距X轴自动显示哪种格式
|
|
|
- millisecond: '%H:%M:%S.%L',
|
|
|
- second: '%H:%M:%S',
|
|
|
- minute: '%H:%M',
|
|
|
- hour: '%H:%M',
|
|
|
- day: '%m-%d',
|
|
|
- week: '%m-%d',
|
|
|
- month: '%Y-%m',
|
|
|
- year: '%Y'
|
|
|
- }
|
|
|
- },
|
|
|
- yAxis: {
|
|
|
- title: {
|
|
|
- text: ''
|
|
|
- }
|
|
|
- },
|
|
|
- legend: {
|
|
|
- // layout: 'vertical',
|
|
|
- align: 'right',
|
|
|
- verticalAlign: 'top'
|
|
|
- },
|
|
|
- plotOptions: {
|
|
|
- series: {
|
|
|
- label: {
|
|
|
- connectorAllowed: false
|
|
|
- },
|
|
|
- pointStart: 2010
|
|
|
- }
|
|
|
- },
|
|
|
- series: [
|
|
|
- {
|
|
|
- type: 'spline',
|
|
|
- name: ChartData[0].name,
|
|
|
- data: ChartData[0].dat
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'spline',
|
|
|
- name: ChartData[1].name,
|
|
|
- data: ChartData[1].dat
|
|
|
- },
|
|
|
- ],
|
|
|
- colors: ['#6cbbff', '#ff3f3f','#00e29d', ],
|
|
|
- credits: {
|
|
|
- //去掉默认的highcharts.com
|
|
|
- enabled: false
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- // crosshairs: true,
|
|
|
- shared: true, //折线共享
|
|
|
- headerFormat: '<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>'
|
|
|
- }
|
|
|
- }
|
|
|
- this.options2 = {
|
|
|
- chart: {
|
|
|
- zoomType: 'x'
|
|
|
- },
|
|
|
- title: {
|
|
|
- text: '红外计数值',
|
|
|
- align: 'left'
|
|
|
- },
|
|
|
- subtitle: {
|
|
|
- text: ''
|
|
|
- },
|
|
|
- xAxis: {
|
|
|
- crosshair: true, //十字基准线
|
|
|
- type: 'datetime',
|
|
|
- dateTimeLabelFormats: {
|
|
|
- //根据时间间距X轴自动显示哪种格式
|
|
|
- millisecond: '%H:%M:%S.%L',
|
|
|
- second: '%H:%M:%S',
|
|
|
- minute: '%H:%M',
|
|
|
- hour: '%H:%M',
|
|
|
- day: '%m-%d',
|
|
|
- week: '%m-%d',
|
|
|
- month: '%Y-%m',
|
|
|
- year: '%Y'
|
|
|
- }
|
|
|
- },
|
|
|
- yAxis: {
|
|
|
- title: {
|
|
|
- text: ''
|
|
|
- }
|
|
|
- },
|
|
|
- legend: {
|
|
|
- // layout: 'vertical',
|
|
|
- align: 'right',
|
|
|
- verticalAlign: 'top'
|
|
|
- },
|
|
|
- plotOptions: {
|
|
|
- series: {
|
|
|
- label: {
|
|
|
- connectorAllowed: false
|
|
|
- },
|
|
|
- pointStart: 2010
|
|
|
- }
|
|
|
- },
|
|
|
- series: [
|
|
|
- {
|
|
|
- type: 'spline',
|
|
|
- name: ChartData[2].name,
|
|
|
- data: ChartData[2].dat
|
|
|
- }
|
|
|
- ],
|
|
|
- colors: ['#00e29d', '#6cbbff', '#ff3f3f'],
|
|
|
- credits: {
|
|
|
- //去掉默认的highcharts.com
|
|
|
- enabled: false
|
|
|
- },
|
|
|
- tooltip: {
|
|
|
- // crosshairs: true,
|
|
|
- shared: true, //折线共享
|
|
|
- headerFormat: '<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>'
|
|
|
- },
|
|
|
- responsive: {
|
|
|
- rules: [
|
|
|
- {
|
|
|
- condition: {
|
|
|
- maxWidth: 500
|
|
|
- },
|
|
|
- chartOptions: {
|
|
|
- legend: {
|
|
|
- layout: 'horizontal',
|
|
|
- align: 'center',
|
|
|
- verticalAlign: 'bottom'
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- }
|
|
|
+ // initChartDataList() {
|
|
|
+ // this.$axios({
|
|
|
+ // method: 'POST',
|
|
|
+ // url: '/sex_at_ah',
|
|
|
+ // data: this.qs.stringify({
|
|
|
+ // begin: this.queryInfo.begin,
|
|
|
+ // end: this.queryInfo.end,
|
|
|
+ // e_id: this.queryInfo.e_id,
|
|
|
+ // })
|
|
|
+ // }).then((res) => {
|
|
|
+ // if (res.data.length > 0) {
|
|
|
+ // this.isOne = false;
|
|
|
+ // var ChartData = [
|
|
|
+ // {
|
|
|
+ // name: '温度(°C)',
|
|
|
+ // dat: []
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: '湿度(%)',
|
|
|
+ // dat: []
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: '红外计数值',
|
|
|
+ // dat: []
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: '高压计数值',
|
|
|
+ // dat: []
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // name: 'cpu温度(°C)',
|
|
|
+ // dat: []
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ // var data = res.data
|
|
|
+ // for (let item of data) {
|
|
|
+ // ChartData[0].dat.unshift([
|
|
|
+ // this.returnTime(item.tim),
|
|
|
+ // Number(item.at)
|
|
|
+ // ])
|
|
|
+ // ChartData[1].dat.unshift([
|
|
|
+ // this.returnTime(item.tim),
|
|
|
+ // Number(item.ah)
|
|
|
+ // ])
|
|
|
+ // ChartData[2].dat.unshift([
|
|
|
+ // this.returnTime(item.tim),
|
|
|
+ // Number(item.infr_ct)
|
|
|
+ // ])
|
|
|
+ // }
|
|
|
+ // this.options = {
|
|
|
+ // chart: {
|
|
|
+ // zoomType: 'x'
|
|
|
+ // },
|
|
|
+ // title: {
|
|
|
+ // text: '环境温湿度',
|
|
|
+ // align: 'left'
|
|
|
+ // },
|
|
|
+ // subtitle: {
|
|
|
+ // text: ''
|
|
|
+ // },
|
|
|
+ // xAxis: {
|
|
|
+ // crosshair: true, //十字基准线
|
|
|
+ // type: 'datetime',
|
|
|
+ // dateTimeLabelFormats: {
|
|
|
+ // //根据时间间距X轴自动显示哪种格式
|
|
|
+ // millisecond: '%H:%M:%S.%L',
|
|
|
+ // second: '%H:%M:%S',
|
|
|
+ // minute: '%H:%M',
|
|
|
+ // hour: '%H:%M',
|
|
|
+ // day: '%m-%d',
|
|
|
+ // week: '%m-%d',
|
|
|
+ // month: '%Y-%m',
|
|
|
+ // year: '%Y'
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // yAxis: {
|
|
|
+ // title: {
|
|
|
+ // text: ''
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // legend: {
|
|
|
+ // // layout: 'vertical',
|
|
|
+ // align: 'right',
|
|
|
+ // verticalAlign: 'top'
|
|
|
+ // },
|
|
|
+ // plotOptions: {
|
|
|
+ // series: {
|
|
|
+ // label: {
|
|
|
+ // connectorAllowed: false
|
|
|
+ // },
|
|
|
+ // pointStart: 2010
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // series: [
|
|
|
+ // {
|
|
|
+ // type: 'spline',
|
|
|
+ // name: ChartData[0].name,
|
|
|
+ // data: ChartData[0].dat
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // type: 'spline',
|
|
|
+ // name: ChartData[1].name,
|
|
|
+ // data: ChartData[1].dat
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // colors: ['#6cbbff', '#ff3f3f','#00e29d', ],
|
|
|
+ // credits: {
|
|
|
+ // //去掉默认的highcharts.com
|
|
|
+ // enabled: false
|
|
|
+ // },
|
|
|
+ // tooltip: {
|
|
|
+ // // crosshairs: true,
|
|
|
+ // shared: true, //折线共享
|
|
|
+ // headerFormat: '<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>'
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.options2 = {
|
|
|
+ // chart: {
|
|
|
+ // zoomType: 'x'
|
|
|
+ // },
|
|
|
+ // title: {
|
|
|
+ // text: '红外计数值',
|
|
|
+ // align: 'left'
|
|
|
+ // },
|
|
|
+ // subtitle: {
|
|
|
+ // text: ''
|
|
|
+ // },
|
|
|
+ // xAxis: {
|
|
|
+ // crosshair: true, //十字基准线
|
|
|
+ // type: 'datetime',
|
|
|
+ // dateTimeLabelFormats: {
|
|
|
+ // //根据时间间距X轴自动显示哪种格式
|
|
|
+ // millisecond: '%H:%M:%S.%L',
|
|
|
+ // second: '%H:%M:%S',
|
|
|
+ // minute: '%H:%M',
|
|
|
+ // hour: '%H:%M',
|
|
|
+ // day: '%m-%d',
|
|
|
+ // week: '%m-%d',
|
|
|
+ // month: '%Y-%m',
|
|
|
+ // year: '%Y'
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // yAxis: {
|
|
|
+ // title: {
|
|
|
+ // text: ''
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // legend: {
|
|
|
+ // // layout: 'vertical',
|
|
|
+ // align: 'right',
|
|
|
+ // verticalAlign: 'top'
|
|
|
+ // },
|
|
|
+ // plotOptions: {
|
|
|
+ // series: {
|
|
|
+ // label: {
|
|
|
+ // connectorAllowed: false
|
|
|
+ // },
|
|
|
+ // pointStart: 2010
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // series: [
|
|
|
+ // {
|
|
|
+ // type: 'spline',
|
|
|
+ // name: ChartData[2].name,
|
|
|
+ // data: ChartData[2].dat
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ // colors: ['#00e29d', '#6cbbff', '#ff3f3f'],
|
|
|
+ // credits: {
|
|
|
+ // //去掉默认的highcharts.com
|
|
|
+ // enabled: false
|
|
|
+ // },
|
|
|
+ // tooltip: {
|
|
|
+ // // crosshairs: true,
|
|
|
+ // shared: true, //折线共享
|
|
|
+ // headerFormat: '<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>'
|
|
|
+ // },
|
|
|
+ // responsive: {
|
|
|
+ // rules: [
|
|
|
+ // {
|
|
|
+ // condition: {
|
|
|
+ // maxWidth: 500
|
|
|
+ // },
|
|
|
+ // chartOptions: {
|
|
|
+ // legend: {
|
|
|
+ // layout: 'horizontal',
|
|
|
+ // align: 'center',
|
|
|
+ // verticalAlign: 'bottom'
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
- }else{
|
|
|
- this.options = {};
|
|
|
- this.options2 = {};
|
|
|
- if(this.isSelect){
|
|
|
- this.$refs.setSelected.timeBtnClick(2);
|
|
|
- this.isSelect = false
|
|
|
- this.getChartDataList()
|
|
|
- this.getHisDataList()
|
|
|
- }else if(this.isSelectNian){
|
|
|
- this.$refs.setSelected.timeBtnClick(3);
|
|
|
- this.isSelectNian = false
|
|
|
- this.getChartDataList()
|
|
|
- this.getHisDataList()
|
|
|
- }else if(this.isSelectYear){
|
|
|
- this.$refs.setSelected.timeBtnClick(4);
|
|
|
- this.isSelectYear = false
|
|
|
- this.getChartDataList()
|
|
|
- this.getHisDataList()
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+ // }else{
|
|
|
+ // this.options = {};
|
|
|
+ // this.options2 = {};
|
|
|
+ // if(this.isSelect){
|
|
|
+ // console.log("月月");
|
|
|
+ // this.$refs.setSelected.timeBtnClick(2);
|
|
|
+ // this.isSelect = false
|
|
|
+ // this.getChartDataList()
|
|
|
+ // this.getHisDataList()
|
|
|
+ // }else if(this.isSelectNian){
|
|
|
+ // console.log("半半半");
|
|
|
+ // this.$refs.setSelected.timeBtnClick(3);
|
|
|
+ // this.isSelectNian = false
|
|
|
+ // this.getChartDataList()
|
|
|
+ // this.getHisDataList()
|
|
|
+ // }else if(this.isSelectYear){
|
|
|
+ // console.log("年年年");
|
|
|
+ // this.$refs.setSelected.timeBtnClick(4);
|
|
|
+ // this.isSelectYear = false
|
|
|
+ // this.getChartDataList()
|
|
|
+ // this.getHisDataList()
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
//获取折线数据
|
|
|
getChartDataList() {
|
|
|
this.$axios({
|
|
|
@@ -393,7 +397,9 @@ export default {
|
|
|
e_id: this.queryInfo.e_id,
|
|
|
})
|
|
|
}).then((res) => {
|
|
|
+ console.log(res.data.length)
|
|
|
if (res.data.length > 0) {
|
|
|
+ this.isOne = false;
|
|
|
var ChartData = [
|
|
|
{
|
|
|
name: '温度(°C)',
|
|
|
@@ -576,11 +582,27 @@ export default {
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}else{
|
|
|
this.options = {};
|
|
|
this.options2 = {};
|
|
|
-
|
|
|
+ if(this.isOne){
|
|
|
+ if(this.isSelect){
|
|
|
+ this.$refs.setSelected.timeBtnClick(2);
|
|
|
+ this.isSelect = false
|
|
|
+ // this.getChartDataList()
|
|
|
+ // this.getHisDataList()
|
|
|
+ }else if(this.isSelectNian){
|
|
|
+ this.$refs.setSelected.timeBtnClick(3);
|
|
|
+ this.isSelectNian = false
|
|
|
+ // this.getChartDataList()
|
|
|
+ // this.getHisDataList()
|
|
|
+ }else if(this.isSelectYear){
|
|
|
+ this.$refs.setSelected.timeBtnClick(4);
|
|
|
+ this.isSelectYear = false
|
|
|
+ // this.getChartDataList()
|
|
|
+ // this.getHisDataList()
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -645,20 +667,19 @@ export default {
|
|
|
//改变page
|
|
|
changePage(val) {
|
|
|
this.queryInfo.page = val
|
|
|
+ console.log("改变page表格");
|
|
|
this.getHisDataList()
|
|
|
},
|
|
|
dateChange(data) {
|
|
|
- console.log(data.begin);
|
|
|
this.queryInfo.page = 1
|
|
|
this.queryInfo.begin = data.begin?new Date(data.begin*1000).toLocaleDateString().replace(/\//g,'-'):'';
|
|
|
this.queryInfo.end = data.end?new Date(data.end*1000).toLocaleDateString().replace(/\//g,'-'):'';
|
|
|
this.getHisDataList()
|
|
|
if(this.isOne){
|
|
|
- this.initChartDataList()
|
|
|
- }else{
|
|
|
this.getChartDataList()
|
|
|
}
|
|
|
- this.isOne = false
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
setWidth(item) {
|
|
|
if (item[1] == 'addtime') {
|