|
@@ -31,10 +31,9 @@
|
|
:scroll="{ x: true }"
|
|
:scroll="{ x: true }"
|
|
bordered
|
|
bordered
|
|
rowKey="id"
|
|
rowKey="id"
|
|
- :columns="columns"
|
|
|
|
|
|
+ :columns="columns2"
|
|
:dataSource="dataSource"
|
|
:dataSource="dataSource"
|
|
:pagination="ipagination"
|
|
:pagination="ipagination"
|
|
- :loading="loading"
|
|
|
|
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
class="j-table-force-nowrap"
|
|
class="j-table-force-nowrap"
|
|
@change="handleTableChange"
|
|
@change="handleTableChange"
|
|
@@ -70,22 +69,27 @@ import { mixinDevice } from '@/utils/mixin'
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
import { httpAction, getAction } from '@/api/manage'
|
|
import { emsdata } from '@/views/module_ems/energyAnalyse/emsdata'
|
|
import { emsdata } from '@/views/module_ems/energyAnalyse/emsdata'
|
|
|
|
+import { pvdata } from '../../module_ems/photovoltaic/pvdata'
|
|
export default {
|
|
export default {
|
|
- name: '',
|
|
|
|
|
|
+ name: 'realtime',
|
|
mixins: [JeecgListMixin, mixinDevice],
|
|
mixins: [JeecgListMixin, mixinDevice],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- loading: true,
|
|
|
|
|
|
+ loading: false,
|
|
dataSource: [],
|
|
dataSource: [],
|
|
dataInfo: null,
|
|
dataInfo: null,
|
|
times: [],
|
|
times: [],
|
|
|
|
+ gd02us: [],
|
|
|
|
+ gd03us: [],
|
|
|
|
+ gd05us: [],
|
|
|
|
+ gd06us: [],
|
|
myChart: null,
|
|
myChart: null,
|
|
echartsHeight: window.innerHeight - 450,
|
|
echartsHeight: window.innerHeight - 450,
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
- equipmentid: '301156882513921',
|
|
|
|
|
|
+ equipmentid: '1780110297413861377',
|
|
day: null,
|
|
day: null,
|
|
tagtype: "5",
|
|
tagtype: "5",
|
|
},
|
|
},
|
|
@@ -138,17 +142,20 @@ export default {
|
|
{
|
|
{
|
|
title: '点位名称',
|
|
title: '点位名称',
|
|
align: 'center',
|
|
align: 'center',
|
|
- dataIndex: 'tagname',
|
|
|
|
|
|
+ // dataIndex: 'tagname',
|
|
|
|
+ dataIndex: 'MeterCode',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '时间',
|
|
title: '时间',
|
|
align: 'center',
|
|
align: 'center',
|
|
- dataIndex: 'logtime',
|
|
|
|
|
|
+ // dataIndex: 'logtime',
|
|
|
|
+ dataIndex: 'Time',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '值',
|
|
title: '值',
|
|
align: 'center',
|
|
align: 'center',
|
|
- dataIndex: 'tagvalue2',
|
|
|
|
|
|
+ // dataIndex: 'tagvalue2',
|
|
|
|
+ dataIndex: 'Power',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
}
|
|
}
|
|
@@ -195,7 +202,7 @@ export default {
|
|
params.equipmentid = !this.queryParams.equipmentid ? '' : this.queryParams.equipmentid
|
|
params.equipmentid = !this.queryParams.equipmentid ? '' : this.queryParams.equipmentid
|
|
params.day = !this.queryParams.day ? '' : this.queryParams.day
|
|
params.day = !this.queryParams.day ? '' : this.queryParams.day
|
|
params.tagtype = !this.queryParams.tagtype ? '' : this.queryParams.tagtype
|
|
params.tagtype = !this.queryParams.tagtype ? '' : this.queryParams.tagtype
|
|
- this.loading = true
|
|
|
|
|
|
+ // this.loading = true
|
|
|
|
|
|
// 电量用另外一个列定义
|
|
// 电量用另外一个列定义
|
|
if (params.tagtype == "7") {
|
|
if (params.tagtype == "7") {
|
|
@@ -206,17 +213,19 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
// 获取图表信息
|
|
// 获取图表信息
|
|
- getAction(_this.url.listinfo, params).then((res) => {
|
|
|
|
- if (res.success) {
|
|
|
|
- _this.dataInfo = res.result.records || res.result;
|
|
|
|
- _this.getList(params);
|
|
|
|
- _this.initEcharts();
|
|
|
|
- } else {
|
|
|
|
- this.$message.warning(res.message)
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- this.loading = false
|
|
|
|
|
|
+ // getAction(_this.url.listinfo, params).then((res) => {
|
|
|
|
+ // if (res.success) {
|
|
|
|
+ // _this.dataInfo = res.result.records || res.result;
|
|
|
|
+ // _this.getList(params);
|
|
|
|
+ // _this.initEcharts();
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message.warning(res.message)
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.getTest()
|
|
|
|
+ }, 2000)
|
|
|
|
+ // this.loading = false
|
|
},
|
|
},
|
|
|
|
|
|
// 获取表格信息
|
|
// 获取表格信息
|
|
@@ -236,50 +245,47 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- initEcharts() {
|
|
|
|
- var _this = this
|
|
|
|
- var chartDom = _this.$refs.trendCharts;
|
|
|
|
- _this.myChart && _this.myChart.dispose();
|
|
|
|
- _this.myChart = echarts.init(chartDom)
|
|
|
|
|
|
+ // 后端好了需要删掉
|
|
|
|
+ getTest() {
|
|
|
|
+ var _this = this;
|
|
|
|
+ var rowid=0;
|
|
|
|
+ _this.times = [],
|
|
|
|
+ _this.gd02us = [],
|
|
|
|
+ _this.gd03us = [],
|
|
|
|
+ _this.gd05us = [],
|
|
|
|
+ _this.gd06us = [],
|
|
|
|
+ pvdata.mdcurveanalysisdata.forEach((item) => {
|
|
|
|
+ item.data.forEach((i) => {
|
|
|
|
+ i.id = rowid;
|
|
|
|
+ _this.dataSource.push(i)
|
|
|
|
+ rowid++;
|
|
|
|
|
|
- var legends = [];
|
|
|
|
- var seriess = [];
|
|
|
|
- _this.times = [];
|
|
|
|
- var rec = 0;
|
|
|
|
- _this.dataInfo.tag.forEach(item => {
|
|
|
|
- legends.push(item.tagname);
|
|
|
|
- var realdatas = [];
|
|
|
|
- _this.dataInfo.list[rec].forEach(realdata => {
|
|
|
|
- // 电量获取值的方法不一样
|
|
|
|
- if (_this.queryParams.tagtype == "7") {
|
|
|
|
- realdatas.push(realdata.tagvalue2);
|
|
|
|
|
|
+ if (item.meterName === 'GD02') {
|
|
|
|
+ _this.times.push(i.Time.substring(11, 16));
|
|
|
|
+ _this.gd02us.push(i.Ua.toFixed(1));
|
|
}
|
|
}
|
|
- else {
|
|
|
|
- realdatas.push(realdata.tagvalue);
|
|
|
|
|
|
+ else if (item.meterName === 'GD03') {
|
|
|
|
+ _this.gd03us.push(i.Ua.toFixed(1));
|
|
}
|
|
}
|
|
- });
|
|
|
|
- seriess.push({
|
|
|
|
- name: item.tagname,
|
|
|
|
- type: 'line',
|
|
|
|
- symbol: 'none',
|
|
|
|
- sampling: 'lttb',
|
|
|
|
- markPoint: {
|
|
|
|
- data: [
|
|
|
|
- { type: 'max', name: 'Max' },
|
|
|
|
- { type: 'min', name: 'Min' },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- data: realdatas,
|
|
|
|
- });
|
|
|
|
- console.log(rec, seriess);
|
|
|
|
- rec++;
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- _this.dataInfo.list[0].forEach(item => {
|
|
|
|
- _this.times.push(item.logtime);
|
|
|
|
- });
|
|
|
|
|
|
+ else if (item.meterName === 'GD05') {
|
|
|
|
+ _this.gd05us.push(i.Ua.toFixed(1));
|
|
|
|
+ }
|
|
|
|
+ else if (item.meterName === 'GD06') {
|
|
|
|
+ _this.gd06us.push(i.Ua.toFixed(1));
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ _this.initEcharts()
|
|
|
|
+ },
|
|
|
|
+ // 后端好了需要删掉
|
|
|
|
+ initEcharts() {
|
|
|
|
+ var _this = this
|
|
|
|
+ var chartDom = _this.$refs.trendCharts
|
|
|
|
+ _this.myChart = echarts.init(chartDom)
|
|
|
|
+ console.log(3)
|
|
|
|
|
|
var option = {
|
|
var option = {
|
|
|
|
+ animationDuration: 3000, // 动态,刷新时长,3秒
|
|
tooltip: {
|
|
tooltip: {
|
|
trigger: 'axis',
|
|
trigger: 'axis',
|
|
position: function (pt) {
|
|
position: function (pt) {
|
|
@@ -288,10 +294,10 @@ export default {
|
|
},
|
|
},
|
|
title: {
|
|
title: {
|
|
left: 'left',
|
|
left: 'left',
|
|
- text: '实时数据',
|
|
|
|
|
|
+ text: '参数历史数据',
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
- data: legends,
|
|
|
|
|
|
+ data: ['GD02 U', 'GD03 U', 'GD05 U', 'GD06 U'],
|
|
},
|
|
},
|
|
xAxis: {
|
|
xAxis: {
|
|
type: 'category',
|
|
type: 'category',
|
|
@@ -316,13 +322,78 @@ export default {
|
|
{
|
|
{
|
|
show: true,
|
|
show: true,
|
|
yAxisIndex: 0,
|
|
yAxisIndex: 0,
|
|
- filterMode: "empty",
|
|
|
|
|
|
+ filterMode: 'empty',
|
|
width: 30,
|
|
width: 30,
|
|
- height: "80%",
|
|
|
|
- right: "7%",
|
|
|
|
|
|
+ height: '80%',
|
|
|
|
+ right: '7%',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ name: 'GD02 U',
|
|
|
|
+ type: 'line',
|
|
|
|
+ symbol: 'none',
|
|
|
|
+ sampling: 'lttb',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#91CC75',
|
|
|
|
+ },
|
|
|
|
+ markPoint: {
|
|
|
|
+ data: [
|
|
|
|
+ { type: 'max', name: 'Max' },
|
|
|
|
+ { type: 'min', name: 'Min' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ data: _this.gd02us,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'GD03 U',
|
|
|
|
+ type: 'line',
|
|
|
|
+ symbol: 'none',
|
|
|
|
+ sampling: 'lttb',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#EE6666',
|
|
|
|
+ },
|
|
|
|
+ markPoint: {
|
|
|
|
+ data: [
|
|
|
|
+ { type: 'max', name: 'Max' },
|
|
|
|
+ { type: 'min', name: 'Min' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ data: _this.gd03us,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'GD05 U',
|
|
|
|
+ type: 'line',
|
|
|
|
+ symbol: 'none',
|
|
|
|
+ sampling: 'lttb',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#FAAD14',
|
|
|
|
+ },
|
|
|
|
+ markPoint: {
|
|
|
|
+ data: [
|
|
|
|
+ { type: 'max', name: 'Max' },
|
|
|
|
+ { type: 'min', name: 'Min' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ data: _this.gd05us,
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'GD06 U',
|
|
|
|
+ type: 'line',
|
|
|
|
+ symbol: 'none',
|
|
|
|
+ sampling: 'lttb',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#5470C6',
|
|
|
|
+ },
|
|
|
|
+ markPoint: {
|
|
|
|
+ data: [
|
|
|
|
+ { type: 'max', name: 'Max' },
|
|
|
|
+ { type: 'min', name: 'Min' },
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ data: _this.gd06us,
|
|
},
|
|
},
|
|
],
|
|
],
|
|
- series: seriess,
|
|
|
|
}
|
|
}
|
|
|
|
|
|
option && _this.myChart.setOption(option)
|
|
option && _this.myChart.setOption(option)
|
|
@@ -331,7 +402,107 @@ export default {
|
|
_this.myChart.resize()
|
|
_this.myChart.resize()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ /** 搜索按钮操作 */
|
|
|
|
+ handleSearch(param) {
|
|
|
|
+ this.getTest()
|
|
|
|
+ // this.getDemandanalysis()
|
|
|
|
+ },
|
|
},
|
|
},
|
|
|
|
+ // initEcharts() {
|
|
|
|
+ // var _this = this
|
|
|
|
+ // var chartDom = _this.$refs.trendCharts;
|
|
|
|
+ // _this.myChart && _this.myChart.dispose();
|
|
|
|
+ // _this.myChart = echarts.init(chartDom)
|
|
|
|
+
|
|
|
|
+ // var legends = [];
|
|
|
|
+ // var seriess = [];
|
|
|
|
+ // _this.times = [];
|
|
|
|
+ // var rec = 0;
|
|
|
|
+ // _this.dataInfo.tag.forEach(item => {
|
|
|
|
+ // legends.push(item.tagname);
|
|
|
|
+ // var realdatas = [];
|
|
|
|
+ // _this.dataInfo.list[rec].forEach(realdata => {
|
|
|
|
+ // // 电量获取值的方法不一样
|
|
|
|
+ // if (_this.queryParams.tagtype == "7") {
|
|
|
|
+ // realdatas.push(realdata.tagvalue2);
|
|
|
|
+ // }
|
|
|
|
+ // else {
|
|
|
|
+ // realdatas.push(realdata.tagvalue);
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ // seriess.push({
|
|
|
|
+ // name: item.tagname,
|
|
|
|
+ // type: 'line',
|
|
|
|
+ // symbol: 'none',
|
|
|
|
+ // sampling: 'lttb',
|
|
|
|
+ // markPoint: {
|
|
|
|
+ // data: [
|
|
|
|
+ // { type: 'max', name: 'Max' },
|
|
|
|
+ // { type: 'min', name: 'Min' },
|
|
|
|
+ // ],
|
|
|
|
+ // },
|
|
|
|
+ // data: realdatas,
|
|
|
|
+ // });
|
|
|
|
+ // console.log(rec, seriess);
|
|
|
|
+ // rec++;
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ // _this.dataInfo.list[0].forEach(item => {
|
|
|
|
+ // _this.times.push(item.logtime);
|
|
|
|
+ // });
|
|
|
|
+
|
|
|
|
+ // var option = {
|
|
|
|
+ // tooltip: {
|
|
|
|
+ // trigger: 'axis',
|
|
|
|
+ // position: function (pt) {
|
|
|
|
+ // return [pt[0], '20%']
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
|
|
+ // title: {
|
|
|
|
+ // left: 'left',
|
|
|
|
+ // text: '实时数据',
|
|
|
|
+ // },
|
|
|
|
+ // legend: {
|
|
|
|
+ // data: legends,
|
|
|
|
+ // },
|
|
|
|
+ // xAxis: {
|
|
|
|
+ // type: 'category',
|
|
|
|
+ // boundaryGap: false,
|
|
|
|
+ // data: _this.times,
|
|
|
|
+ // },
|
|
|
|
+ // yAxis: {
|
|
|
|
+ // type: 'value',
|
|
|
|
+ // boundaryGap: [0, '100%'],
|
|
|
|
+ // },
|
|
|
|
+ // dataZoom: [
|
|
|
|
+ // {
|
|
|
|
+ // type: 'inside',
|
|
|
|
+ // start: 0,
|
|
|
|
+ // end: 100,
|
|
|
|
+ // xAxisIndex: 0,
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // start: 0,
|
|
|
|
+ // end: 10,
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // show: true,
|
|
|
|
+ // yAxisIndex: 0,
|
|
|
|
+ // filterMode: "empty",
|
|
|
|
+ // width: 30,
|
|
|
|
+ // height: "80%",
|
|
|
|
+ // right: "7%",
|
|
|
|
+ // },
|
|
|
|
+ // ],
|
|
|
|
+ // series: seriess,
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // option && _this.myChart.setOption(option)
|
|
|
|
+
|
|
|
|
+ // window.addEventListener('resize', function () {
|
|
|
|
+ // _this.myChart.resize()
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|