From 0761d9e95393d7f0301a49613c095db363d79e75 Mon Sep 17 00:00:00 2001
From: yupan <yupanx@163.com>
Date: Thu, 27 Oct 2022 09:50:21 +0800
Subject: [PATCH] 1、新增站点数据页面 2、修改监测因子趋势显示bug 3、修改监测因子趋势和监测因子对比页面的时间控件
---
src/views/contrast/index.vue | 65 +++++++++++++++++++++++---------
1 files changed, 46 insertions(+), 19 deletions(-)
diff --git a/src/views/contrast/index.vue b/src/views/contrast/index.vue
index b342c19..f238603 100644
--- a/src/views/contrast/index.vue
+++ b/src/views/contrast/index.vue
@@ -1,4 +1,4 @@
-<template>
++<template>
<div style="width:100%">
<div class="topSelect">
<el-cascader
@@ -25,13 +25,22 @@
:value="item.value"
/>
</el-select> -->
- <el-radio-group v-model="radio1" style="margin-left:20px">
+ <!-- <el-radio-group v-model="radio1" style="margin-left:20px">
<el-radio-button label="������" />
- <el-radio-button label="������" />
+ <el-radio-button label="������" /> -->
<!-- <el-radio-button label="������" />
<el-radio-button label="���������" /> -->
- </el-radio-group>
- <component :is="dataType" style="padding-left:0;margin-left:20px;width:160px" @sendPickerChild="showPickerChild" />
+ <!-- </el-radio-group> -->
+ <el-select v-model="radio1" placeholder="���������" style="margin-left:20px">
+ <el-option
+ v-for="item in options1"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ <component :is="dataType" class="select11" style="padding-left:0;margin-left:20px;width:160px" @sendPickerChild="showPickerChild" />
<!--������������-->
<el-button @click="selectData" class="btn1">������</el-button>
</div>
@@ -73,7 +82,7 @@
}
}
export default {
-// import ���������������������������������������������������
+// import ���������������������������������������������������props
components: {
LineChart,
DatePicker,
@@ -104,7 +113,7 @@
// newMac2:'',
newSensor: [],
radio1: '������',
- unit: 1,
+ unit: 0,
type: 'select',
newLineChartData: {
series: [],
@@ -115,7 +124,18 @@
defaultData: [],
newListData: [],
chartSensorName: '',
- middleData: []
+ middleData: [],
+ options1:[
+
+ {
+ label:'������',
+ value:'������'
+ }
+ , {
+ label:'������',
+ value:'������'
+ }
+ ]
}
},
// ������������ ���������data������
@@ -142,10 +162,10 @@
radio1(nv, ov) {
if (nv === '������') {
this.dataType = 'HourPicker'
- this.unit = 1
+ this.unit = 0
} else if (nv === '������') {
this.dataType = 'DatePicker'
- this.unit = 3
+ this.unit = 1
}
// else if (nv === '������') {
// this.dataType = 'MouthPicker'
@@ -189,10 +209,8 @@
for (let i = 0; i < this.defaultData.length; i++) {
this.options.push({ value: this.defaultData[i].name, label: this.defaultData[i].name })
this.options[i].children = []
- if (this.defaultData[i].devices) {
- for (let j = 0; j < this.defaultData[i].devices.length; j++) {
- this.options[i].children.push({ value: [this.defaultData[i].devices[j].name, this.defaultData[i].devices[j].mac], label: this.defaultData[i].devices[j].name })
- }
+ for (let j = 0; j < this.defaultData[i].devices.length; j++) {
+ this.options[i].children.push({ value: [this.defaultData[i].devices[j].name, this.defaultData[i].devices[j].mac], label: this.defaultData[i].devices[j].name })
}
}
})
@@ -233,18 +251,18 @@
title: []
}
this.newXData = []
- this.$request({
- url: '/dataDisplay/sensorComparisonDisplay',
+ this.$request({ // dataDisplay/sensorComparisonDisplayV2
+ url: '/dataDisplay/sensorComparisonDisplayV2',
method: 'post',
data: {
mac: this.newMac1[0],
- sensors: this.value1,
+ sensorCodes: this.value1,
reportType: this.unit,
- time: this.newData
+ times: this.newData
}
}).then((res) => {
// console.log('������������������������������')
- // console.log(res)
+ console.log(res, 111)
this.middleData = JSON.parse(JSON.stringify(res.data))
const data = res.data
// ���������������
@@ -276,6 +294,7 @@
// ���������sort������������
data.sort(this.compare('sort', true))
// ������������������������������
+
// for (let i = 0; i < data.length; i++) {
// newLineChartData.series.push({ data: [], name: '', type: 'line' })
// newLineChartData.series[i].name = data[i].name
@@ -290,6 +309,7 @@
newLineChartData.series[i].name = data[i].name
newLineChartData.title.push(data[i].name)
for (let j = 0; j < data[i].timeValueList.length; j++) {
+ // console.log(data);
data[i].timeValueList[j].value = data[i].timeValueList[j].value * data[i].Factor
newLineChartData.series[i].data.push({ value: 0, data0: 0 })
newLineChartData.series[i].data[j].value = data[i].timeValueList[j].value
@@ -305,6 +325,7 @@
}
}
this.lineChartData = newLineChartData
+ // console.log(newLineChartData.series[0].name);
}).catch((err) => {
console.log(err)
})
@@ -443,4 +464,10 @@
margin-left: 1%;
height: 40px;
}
+.select11{
+ width: 20% !important
+}
+/deep/.el-date-editor .el-range-separator{
+ width: 11%
+}
</style>
--
Gitblit v1.8.0