fix:监测数据测点展示nickname,坐标轴从小到大

This commit is contained in:
shijing 2025-09-15 16:38:37 +08:00
parent 34b2d4b4f0
commit 8c885e4cfc
1 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@
> >
<div id="tableWap" style="height: 100%;"> <div id="tableWap" style="height: 100%;">
<el-tabs v-model="activeName" @tab-change="handleClick"> <el-tabs v-model="activeName" @tab-change="handleClick">
<el-tab-pane v-for="item in mpointList" :label="item.name" :name="item.name" :key="item.id" lazy> <el-tab-pane v-for="item in mpointList" :label="item.nickname" :name="item.nickname" :key="item.id" lazy>
<scTable <scTable
ref="table" ref="table"
:apiObj="apiObj" :apiObj="apiObj"
@ -103,7 +103,7 @@ export default {
that.$API.enm.mpoint.list.req({ep_belong:that.equipmentId,page:0}).then((res) => { that.$API.enm.mpoint.list.req({ep_belong:that.equipmentId,page:0}).then((res) => {
if(res.length>0){ if(res.length>0){
that.mpointList = res; that.mpointList = res;
that.activeName = res[0].name; that.activeName = res[0].nickname;
that.params.mpoint = res[0].id; that.params.mpoint = res[0].id;
that.apiObj = that.$API.enm.mplogx; that.apiObj = that.$API.enm.mplogx;
that.handleClick(); that.handleClick();
@ -116,7 +116,7 @@ export default {
console.log('handleClick',val) console.log('handleClick',val)
let that = this; let that = this;
that.mpointList.forEach(item=>{ that.mpointList.forEach(item=>{
if(item.name == that.activeName){ if(item.nickname == that.activeName){
that.query.mpoint = item.id; that.query.mpoint = item.id;
that.query.page = 1; that.query.page = 1;
that.option.title.text = that.activeName; that.option.title.text = that.activeName;
@ -129,9 +129,9 @@ export default {
params.page = 0; params.page = 0;
that.$API.enm.mplogx.req(params).then((res) => { that.$API.enm.mplogx.req(params).then((res) => {
res.forEach(item=>{ res.forEach(item=>{
that.option.xAxis.data.push(item.timex); that.option.xAxis.data.unshift(item.timex);
let value = Number(item.val_float).toFixed(3); let value = Number(item.val_float).toFixed(3);
that.option.series.data.push(value); that.option.series.data.unshift(value);
}) })
}) })
} }