修改bug
parent
038c35e6f2
commit
1553774e6a
|
|
@ -8,6 +8,17 @@
|
||||||
<u-line></u-line>
|
<u-line></u-line>
|
||||||
</view>
|
</view>
|
||||||
<view class="py-20rpx">
|
<view class="py-20rpx">
|
||||||
|
<u-tabs
|
||||||
|
:list="desList"
|
||||||
|
bar-height="4"
|
||||||
|
height="50"
|
||||||
|
font-size="28"
|
||||||
|
gutter="18"
|
||||||
|
:current="current"
|
||||||
|
@change="changeTab"
|
||||||
|
></u-tabs>
|
||||||
|
</view>
|
||||||
|
<view class="pb-20rpx">
|
||||||
<qiun-data-charts
|
<qiun-data-charts
|
||||||
:loadingType="loadingType"
|
:loadingType="loadingType"
|
||||||
type="area"
|
type="area"
|
||||||
|
|
@ -21,6 +32,39 @@
|
||||||
<script>
|
<script>
|
||||||
import QiunDataCharts from '@/components/qiun-data-charts/qiun-data-charts.vue'
|
import QiunDataCharts from '@/components/qiun-data-charts/qiun-data-charts.vue'
|
||||||
import { http } from '@/api/index.js'
|
import { http } from '@/api/index.js'
|
||||||
|
|
||||||
|
const desList = [
|
||||||
|
{
|
||||||
|
key: 'turbidity',
|
||||||
|
unit: 'NTU',
|
||||||
|
name: '浊度',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'chlorine',
|
||||||
|
unit: 'mg/L',
|
||||||
|
name: '余氯',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'ph',
|
||||||
|
unit: 'PH',
|
||||||
|
name: 'PH值',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'temperature',
|
||||||
|
unit: '℃',
|
||||||
|
name: '温度',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'oxygen',
|
||||||
|
unit: 'mg/L',
|
||||||
|
name: '溶解氧',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'conductivity',
|
||||||
|
unit: 'uS/cm',
|
||||||
|
name: '电导率',
|
||||||
|
},
|
||||||
|
]
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
baseId: {
|
baseId: {
|
||||||
|
|
@ -30,6 +74,8 @@ export default {
|
||||||
components: { QiunDataCharts },
|
components: { QiunDataCharts },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
desList,
|
||||||
|
current: 0,
|
||||||
loadingType: 1,
|
loadingType: 1,
|
||||||
opts: {
|
opts: {
|
||||||
dataLabel: false, //显示数据
|
dataLabel: false, //显示数据
|
||||||
|
|
@ -53,16 +99,26 @@ export default {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
currentTab() {
|
||||||
|
return this.desList[this.current]
|
||||||
|
},
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeTab(e) {
|
||||||
|
this.current = e
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
async init() {
|
async init() {
|
||||||
try {
|
try {
|
||||||
const { data } = await http.get('/api/device-base-data-statics', {
|
const { data } = await http.get('/api/device-base-data-statics', {
|
||||||
params: {
|
params: {
|
||||||
base_id: this.baseId,
|
base_id: this.baseId,
|
||||||
device_type: 3,
|
device_type: 3,
|
||||||
|
device_column: this.currentTab.key,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
const resData = data.data
|
const resData = data.data
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,17 @@
|
||||||
<u-line></u-line>
|
<u-line></u-line>
|
||||||
</view>
|
</view>
|
||||||
<view class="py-20rpx">
|
<view class="py-20rpx">
|
||||||
|
<u-tabs
|
||||||
|
:list="desList"
|
||||||
|
bar-height="4"
|
||||||
|
height="50"
|
||||||
|
font-size="28"
|
||||||
|
gutter="18"
|
||||||
|
:current="current"
|
||||||
|
@change="changeTab"
|
||||||
|
></u-tabs>
|
||||||
|
</view>
|
||||||
|
<view class="pb-20rpx">
|
||||||
<qiun-data-charts
|
<qiun-data-charts
|
||||||
:loadingType="loadingType"
|
:loadingType="loadingType"
|
||||||
type="area"
|
type="area"
|
||||||
|
|
@ -62,6 +73,8 @@ export default {
|
||||||
components: { QiunDataCharts },
|
components: { QiunDataCharts },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
desList,
|
||||||
|
current: 0,
|
||||||
loadingType: 1,
|
loadingType: 1,
|
||||||
opts: {
|
opts: {
|
||||||
dataLabel: false, //显示数据
|
dataLabel: false, //显示数据
|
||||||
|
|
@ -85,16 +98,26 @@ export default {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
currentTab() {
|
||||||
|
return this.desList[this.current]
|
||||||
|
},
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeTab(e) {
|
||||||
|
this.current = e
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
async init() {
|
async init() {
|
||||||
try {
|
try {
|
||||||
const { data } = await http.get('/api/device-base-data-statics', {
|
const { data } = await http.get('/api/device-base-data-statics', {
|
||||||
params: {
|
params: {
|
||||||
base_id: this.baseId,
|
base_id: this.baseId,
|
||||||
device_type: 2,
|
device_type: 2,
|
||||||
|
device_column: this.currentTab.key,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
const resData = data.data
|
const resData = data.data
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue