From 1553774e6aa52480bdf2f03ea4230dac33c77b74 Mon Sep 17 00:00:00 2001 From: ihzero Date: Thu, 11 Jan 2024 17:27:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/basics/components/szjc.vue | 56 ++++++++++++++++++++++++++++ src/pages/basics/components/trjc.vue | 23 ++++++++++++ 2 files changed, 79 insertions(+) diff --git a/src/pages/basics/components/szjc.vue b/src/pages/basics/components/szjc.vue index e437f7b..c80939e 100644 --- a/src/pages/basics/components/szjc.vue +++ b/src/pages/basics/components/szjc.vue @@ -8,6 +8,17 @@ + + + import QiunDataCharts from '@/components/qiun-data-charts/qiun-data-charts.vue' 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 { props: { baseId: { @@ -30,6 +74,8 @@ export default { components: { QiunDataCharts }, data() { return { + desList, + current: 0, loadingType: 1, opts: { dataLabel: false, //显示数据 @@ -53,16 +99,26 @@ export default { }, } }, + computed: { + currentTab() { + return this.desList[this.current] + }, + }, mounted() { this.init() }, methods: { + changeTab(e) { + this.current = e + this.init() + }, async init() { try { const { data } = await http.get('/api/device-base-data-statics', { params: { base_id: this.baseId, device_type: 3, + device_column: this.currentTab.key, }, }) const resData = data.data diff --git a/src/pages/basics/components/trjc.vue b/src/pages/basics/components/trjc.vue index f4f963d..3ad9320 100644 --- a/src/pages/basics/components/trjc.vue +++ b/src/pages/basics/components/trjc.vue @@ -8,6 +8,17 @@ + + +