|
@@ -8,9 +8,9 @@
|
|
|
<j-search-select-tag v-model="queryParams.equipmentid" dict="tpm_equipment,equipmentname,id" style="width: 100%"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :xl="4" :lg="7" :md="8" :sm="24">
|
|
|
- <a-form-item label="参数类型">
|
|
|
- <j-dict-select-tag v-model="queryParams.tagtype" placeholder="请输入优先级" dictCode="tpm_tag_type"/>
|
|
|
+ <a-col :xl="6" :lg="11" :md="12" :sm="24">
|
|
|
+ <a-form-item label="查询日期">
|
|
|
+ <a-date-picker v-model="queryParams.date" placeholder="选择日期" style="width:100%;" @change="handleSearch" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
|
@@ -23,44 +23,6 @@
|
|
|
</div>
|
|
|
<div class="trend-charts" ref="trendCharts" :style="{ height: echartsHeight + 'px', }"></div>
|
|
|
|
|
|
- <!-- table区域-begin -->
|
|
|
- <div>
|
|
|
- <a-table
|
|
|
- ref="table"
|
|
|
- size="middle"
|
|
|
- :scroll="{ x: true }"
|
|
|
- style="padding-top:10px;"
|
|
|
- bordered
|
|
|
- rowKey="id"
|
|
|
- :columns="columns2"
|
|
|
- :dataSource="dataSource"
|
|
|
- :pagination="ipagination"
|
|
|
- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
- class="j-table-force-nowrap"
|
|
|
- @change="handleTableChange"
|
|
|
- >
|
|
|
- <template slot="htmlSlot" slot-scope="text">
|
|
|
- <div v-html="text"></div>
|
|
|
- </template>
|
|
|
- <template slot="imgSlot" slot-scope="text, record">
|
|
|
- <span v-if="!text" style="font-size: 12px; font-style: italic">无图片</span>
|
|
|
- <img
|
|
|
- v-else
|
|
|
- :src="getImgView(text)"
|
|
|
- :preview="record.equipmentid"
|
|
|
- height="25px"
|
|
|
- alt=""
|
|
|
- style="max-width: 80px; font-size: 12px; font-style: italic"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template slot="fileSlot" slot-scope="text">
|
|
|
- <span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
|
|
|
- <a-button v-else :ghost="true" type="primary" icon="download" size="small" @click="downloadFile(text)">
|
|
|
- 下载
|
|
|
- </a-button>
|
|
|
- </template>
|
|
|
- </a-table>
|
|
|
- </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -88,83 +50,320 @@ export default {
|
|
|
echartsHeight: window.innerHeight - 450,
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
equipmentid: '1780110297413861377',
|
|
|
- day: null,
|
|
|
- tagtype: "5",
|
|
|
+ date: '',
|
|
|
},
|
|
|
url: {
|
|
|
list: '/equipmentStatistics/equipmentStatistics/listday',
|
|
|
- listinfo: '/equipmentStatistics/equipmentStatistics/listdayinfo',
|
|
|
},
|
|
|
// 时间
|
|
|
timeList: [],
|
|
|
// 表头
|
|
|
columns: [],
|
|
|
- columns1: [
|
|
|
- {
|
|
|
- title: '序号',
|
|
|
- dataIndex: '',
|
|
|
- key: 'rowIndex',
|
|
|
- width: 60,
|
|
|
- align: 'center',
|
|
|
- customRender: function (t, r, index) {
|
|
|
- return parseInt(index) + 1;
|
|
|
- },
|
|
|
+ equipmentparams: [{"tagname": "电流", "symbol": "CURR"},{"tagname": "电压", "symbol": "VOLT"}],
|
|
|
+ mongodbdata: [
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:02:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 230
|
|
|
},
|
|
|
{
|
|
|
- title: '点位名称',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'tagname',
|
|
|
+ "logtime": "2024-02-05 07:03:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 380
|
|
|
},
|
|
|
{
|
|
|
- title: '时间',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'logtime',
|
|
|
+ "logtime": "2024-02-05 07:04:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 340
|
|
|
},
|
|
|
{
|
|
|
- title: '值',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'tagvalue',
|
|
|
+ "logtime": "2024-02-05 07:05:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 340
|
|
|
},
|
|
|
- ],
|
|
|
- columns2: [
|
|
|
- {
|
|
|
- title: '序号',
|
|
|
- dataIndex: '',
|
|
|
- key: 'rowIndex',
|
|
|
- width: 60,
|
|
|
- align: 'center',
|
|
|
- customRender: function (t, r, index) {
|
|
|
- return parseInt(index) + 1;
|
|
|
- },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:06:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 380
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:07:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 400
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:08:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 390
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:09:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 430
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:10:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 480
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:11:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 360
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:12:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 340
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:13:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 390
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:14:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 360
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:15:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 340
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:16:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 370
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:17:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 390
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:18:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 340
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:19:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 330
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:20:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 320
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:21:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 310
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:22:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 351
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:23:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 350
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:24:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 330
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:25:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 280
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:26:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 290
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:27:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 290
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:28:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 290
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:29:00",
|
|
|
+ "CURR": 0.5,
|
|
|
+ "VOLT": 280
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:30:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 270
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:31:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 270
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:32:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 270
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:33:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 280
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:34:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 310
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:35:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 280
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:36:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 250
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:37:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 265
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:38:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 270
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:39:00",
|
|
|
+ "CURR": 0.2,
|
|
|
+ "VOLT": 280
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:40:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 280
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:41:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 300
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:42:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 300
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:43:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 290
|
|
|
},
|
|
|
{
|
|
|
- title: '点位名称',
|
|
|
- align: 'center',
|
|
|
- // dataIndex: 'tagname',
|
|
|
- dataIndex: 'MeterCode',
|
|
|
+ "logtime": "2024-02-05 07:44:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 290
|
|
|
},
|
|
|
{
|
|
|
- title: '时间',
|
|
|
- align: 'center',
|
|
|
- // dataIndex: 'logtime',
|
|
|
- dataIndex: 'Time',
|
|
|
+ "logtime": "2024-02-05 07:45:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 300
|
|
|
},
|
|
|
{
|
|
|
- title: '值',
|
|
|
- align: 'center',
|
|
|
- // dataIndex: 'tagvalue2',
|
|
|
- dataIndex: 'Power',
|
|
|
+ "logtime": "2024-02-05 07:46:00",
|
|
|
+ "CURR": 0.5,
|
|
|
+ "VOLT": 300
|
|
|
},
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:47:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 320
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:48:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 340
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:49:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 340
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:50:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 360
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:51:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 380
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:52:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 400
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:53:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 430
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:54:00",
|
|
|
+ "CURR": 0.3,
|
|
|
+ "VOLT": 430
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:55:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 380
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:56:00",
|
|
|
+ "CURR": 0.4,
|
|
|
+ "VOLT": 350
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:57:00",
|
|
|
+ "CURR": 0.5,
|
|
|
+ "VOLT": 340
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:58:00",
|
|
|
+ "CURR": 0.5,
|
|
|
+ "VOLT": 360
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 07:59:00",
|
|
|
+ "CURR": 0.5,
|
|
|
+ "VOLT": 340
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "logtime": "2024-02-05 08:00:00",
|
|
|
+ "CURR": 0.5,
|
|
|
+ "VOLT": 340
|
|
|
+ }
|
|
|
],
|
|
|
}
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
var now = this.dateformat(new Date()).substring(0, 10)
|
|
|
- this.queryParams.day = now
|
|
|
+ this.queryParams.date = now
|
|
|
this.$nextTick(() => {
|
|
|
})
|
|
|
},
|
|
@@ -186,323 +385,130 @@ export default {
|
|
|
},
|
|
|
/** 查询设备运行状态时间段列表 */
|
|
|
loadData(arg) {
|
|
|
+ var _this = this
|
|
|
+ setTimeout(function() {
|
|
|
+ _this.getList();
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
+ getList(){
|
|
|
var _this = this;
|
|
|
if (!this.url.list) {
|
|
|
this.$message.error('请设置url.list属性!')
|
|
|
return
|
|
|
}
|
|
|
if (!this.queryParams.equipmentid) {
|
|
|
+ this.$message.error('请选择设备!')
|
|
|
return
|
|
|
}
|
|
|
- //加载数据 若传入参数1则加载第一页的内容
|
|
|
- if (arg === 1) {
|
|
|
- this.ipagination.current = 1
|
|
|
- }
|
|
|
- var params = this.getQueryParams() //查询条件
|
|
|
- params.equipmentid = !this.queryParams.equipmentid ? '' : this.queryParams.equipmentid
|
|
|
- params.day = !this.queryParams.day ? '' : this.queryParams.day
|
|
|
- params.tagtype = !this.queryParams.tagtype ? '' : this.queryParams.tagtype
|
|
|
- // this.loading = true
|
|
|
-
|
|
|
- // 电量用另外一个列定义
|
|
|
- if (params.tagtype == "7") {
|
|
|
- this.columns = this.columns2;
|
|
|
- }
|
|
|
- else {
|
|
|
- this.columns = this.columns1;
|
|
|
+ if (!this.queryParams.date) {
|
|
|
+ this.$message.error('请选择查询日期!')
|
|
|
+ return
|
|
|
}
|
|
|
-
|
|
|
// 获取图表信息
|
|
|
- // getAction(_this.url.listinfo, params).then((res) => {
|
|
|
+ // getAction(_this.url.list, _this.queryParams).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
|
|
|
- },
|
|
|
-
|
|
|
- // 获取表格信息
|
|
|
- getList(params) {
|
|
|
- getAction(this.url.list, params).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
- this.dataSource = res.result.records || res.result
|
|
|
- if (res.result.total) {
|
|
|
- this.ipagination.total = res.result.total
|
|
|
- } else {
|
|
|
- this.ipagination.total = 0
|
|
|
- }
|
|
|
- //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
- } else {
|
|
|
- this.$message.warning(res.message)
|
|
|
- }
|
|
|
- })
|
|
|
+ this.getTest();
|
|
|
},
|
|
|
- // 后端好了需要删掉
|
|
|
+ // 后端好了需要删掉
|
|
|
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++;
|
|
|
-
|
|
|
- if (item.meterName === 'GD02') {
|
|
|
- _this.times.push(i.Time.substring(11, 16));
|
|
|
- _this.gd02us.push(i.Ua.toFixed(1));
|
|
|
- }
|
|
|
- else if (item.meterName === 'GD03') {
|
|
|
- _this.gd03us.push(i.Ua.toFixed(1));
|
|
|
- }
|
|
|
- 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()
|
|
|
+ var _this = this
|
|
|
+ _this.gd02us = []
|
|
|
+ _this.times = []
|
|
|
+ this.initEcharts()
|
|
|
},
|
|
|
- // 后端好了需要删掉
|
|
|
initEcharts() {
|
|
|
var _this = this
|
|
|
- var chartDom = _this.$refs.trendCharts
|
|
|
- _this.myChart && _this.myChart.dispose();
|
|
|
+ var chartDom = this.$refs.trendCharts
|
|
|
_this.myChart = echarts.init(chartDom)
|
|
|
+ _this.echartsHeight = 4 * 300;
|
|
|
|
|
|
- var option = {
|
|
|
- animationDuration: 3000, // 动态,刷新时长,3秒
|
|
|
- tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
- position: function (pt) {
|
|
|
- return [pt[0], '20%']
|
|
|
+ // 获取time
|
|
|
+ _this.mongodbdata.forEach((i) => {
|
|
|
+ _this.times.push(i.logtime.substring(11, 16))
|
|
|
+ });
|
|
|
+
|
|
|
+ var leftValue = '5%';
|
|
|
+ // Grid配置
|
|
|
+ var grid = [];
|
|
|
+ // xAxis配置
|
|
|
+ var xAxis = [];
|
|
|
+ // yAxis配置
|
|
|
+ var yAxis = [];
|
|
|
+ // series配置
|
|
|
+ var series1 = [];
|
|
|
+ var paramscount = 0;
|
|
|
+ var paramslength = _this.equipmentparams.length;
|
|
|
+ _this.equipmentparams.forEach((item) => {
|
|
|
+ grid.push({left: leftValue, top: (0.05 + (paramscount) / paramslength) * 100 + "%", bottom: (1.05 - (paramscount + 1) / paramslength) * 100 + "%"});
|
|
|
+
|
|
|
+ xAxis.push({
|
|
|
+ type: 'category',
|
|
|
+ gridIndex: paramscount,
|
|
|
+ boundaryGap: false,
|
|
|
+ name: item.symbol,
|
|
|
+ data: _this.times,
|
|
|
+ });
|
|
|
+
|
|
|
+ yAxis.push({ type: 'value', gridIndex: paramscount });
|
|
|
+
|
|
|
+ // 获取数据
|
|
|
+ var realtimedata = [];
|
|
|
+ _this.mongodbdata.forEach((i) => {
|
|
|
+ realtimedata.push(i[item.symbol])
|
|
|
+ });
|
|
|
+ series1.push({
|
|
|
+ name: item.symbol,
|
|
|
+ type: 'line',
|
|
|
+ symbol: 'none',
|
|
|
+ sampling: 'lttb',
|
|
|
+ xAxisIndex: paramscount,
|
|
|
+ yAxisIndex: paramscount,
|
|
|
+ itemStyle: {
|
|
|
+ color: '#91CC75',
|
|
|
},
|
|
|
- },
|
|
|
+ data: realtimedata
|
|
|
+ });
|
|
|
+
|
|
|
+ paramscount++;
|
|
|
+ })
|
|
|
+ console.log("grid", grid)
|
|
|
+ console.log("xAxis", xAxis)
|
|
|
+ console.log("yAxis", yAxis)
|
|
|
+ console.log("series1", series1)
|
|
|
+ var option = {
|
|
|
title: {
|
|
|
left: 'left',
|
|
|
- text: '参数历史数据',
|
|
|
+ text: '设备运行数据趋势预测',
|
|
|
},
|
|
|
legend: {
|
|
|
- data: ['GD02 U', 'GD03 U', 'GD05 U', 'GD06 U'],
|
|
|
+ data: ['实际值'],
|
|
|
},
|
|
|
- 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: [
|
|
|
- {
|
|
|
- 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,
|
|
|
- },
|
|
|
- ],
|
|
|
- }
|
|
|
-
|
|
|
+ grid: grid,
|
|
|
+ xAxis: xAxis,
|
|
|
+ yAxis: yAxis,
|
|
|
+ series: series1
|
|
|
+ };
|
|
|
+
|
|
|
option && _this.myChart.setOption(option)
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.myChart.resize()
|
|
|
+ }, 1000)
|
|
|
|
|
|
window.addEventListener('resize', function () {
|
|
|
_this.myChart.resize()
|
|
|
})
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
- handleSearch(param) {
|
|
|
- this.getTest()
|
|
|
- // this.getDemandanalysis()
|
|
|
+ handleSearch(arg) {
|
|
|
+ this.loadData(arg)
|
|
|
},
|
|
|
},
|
|
|
- // 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>
|
|
|
|