From ff72273c7cd5fd33173615ac188fc03bfc1a1ad7 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Sun, 04 Feb 2024 13:44:46 +0800 Subject: [PATCH] fix:修改成16位风向值 --- src/views/onlineRate/index.vue | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/views/onlineRate/index.vue b/src/views/onlineRate/index.vue index fa5a68c..abe1530 100644 --- a/src/views/onlineRate/index.vue +++ b/src/views/onlineRate/index.vue @@ -69,7 +69,7 @@ </el-form> </div> <div> - <p>���������������������<span class="greenClor">{{ tableData.length }}</span>������������<span class="greenClor">{{ onlineData }}</span>��������������� <span :class=" onlineRate<90 ?'redClor':'greenClor'">{{ onlineRate }}%</span></p> + <p>���������������������<span class="greenClor">{{ macOnlineData.sum }}</span>������������<span class="greenClor">{{ macOnlineData.online }}</span>��������������� <span :class="Number(macOnlineData.onlineRate)<90 ?'redClor':'greenClor'">{{ macOnlineData.onlineRate }}%</span></p> <div> <el-table v-loading="loading" @@ -216,6 +216,7 @@ time: '������', selectTime: '', macDate: {}, + macOnlineData: {}, orgData: [], tableData: [], handleShow: false, @@ -259,7 +260,7 @@ return this.tableData.filter(item => item.state !== '0').length || 0 }, onlineRate () { - return Math.floor((this.onlineData / this.tableData.length) * 100) || 0 + return (this.onlineData / this.tableData.length) * 100 || 0 } }, watch: { @@ -302,6 +303,7 @@ this.macDate.endTime = this.formInline.endTime }, handleSearch () { + this.getOnlineData() if (this.formInline.organizationId !== '') { if (this.time === '������') { this.formInline.startTime = dayjs().startOf('day').format('YYYY-MM-DD HH:mm') @@ -326,6 +328,21 @@ this.$message.warning('���������������������������') } }, + getOnlineData () { + this.$request({ + url: '/onlineRate/state', + method: 'get', + params: { + organizationId: this.formInline.organizationId + } + }) + .then(res => { + this.macOnlineData = res.data + }) + .catch(err => { + console.log(err) + }) + }, getOrganizationId () { this.$request({ url: '/organization/getOrganizationId', -- Gitblit v1.8.0