Commit 8e675ba9 authored by “yiyousong”'s avatar “yiyousong”

perf: 屏蔽退出登录

parent c4209e2d
......@@ -49,7 +49,7 @@
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="update">修改密码</el-dropdown-item>
<el-dropdown-item command="logout">退出登录</el-dropdown-item>
<!-- <el-dropdown-item command="logout">退出登录</el-dropdown-item> -->
</el-dropdown-menu>
</el-dropdown>
</div>
......
<template>
<div class="page page-home homeIndex" style="min-height: 100vh">
<el-row :gutter="10">
<el-row style="margin-left: 50px; margin-right: 50px" type="flex" justify="end" :gutter="10">
<el-button type="text" size="mini" style="color: #fff">数据更新:{{
formatterDate(statData.updateTime)
}}
5分钟后自动更新</el-button>
<el-button icon="el-icon-refresh" style="color: #fff" size="mini" @click="syncDeviceStat"
type="text">手动刷新</el-button>
<el-row
style="margin-left: 50px; margin-right: 50px"
type="flex"
justify="end"
:gutter="10"
>
<el-button type="text" size="mini" style="color: #fff"
>数据更新:{{
formatterDate(statData.updateTime)
}}
5分钟后自动更新</el-button
>
<el-button
icon="el-icon-refresh"
style="color: #fff"
size="mini"
@click="syncDeviceStat"
type="text"
>手动刷新</el-button
>
</el-row>
<el-card style="
<el-card
style="
margin-left: 50px;
margin-right: 50px;
margin-top: 10px;
height: 160px;
">
"
>
<div class="total-list">
<!-- 设备总数 -->
<div class="total-item">
<p class="total-item-count">{{ statData.deviceTotalCount }}</p>
<span style="font-size: 12px"><span class="tips">昨日 </span><span :class="{
success: statData.deviceAddCount >= 0,
warn: statData.deviceAddCount < 0,
}">{{
statData.deviceAddCount >= 0
? "+" + statData.deviceAddCount
: "-" + statData.deviceAddCount
}}</span></span>
<span style="font-size: 12px"
><span class="tips">昨日 </span
><span
:class="{
success: statData.deviceAddCount >= 0,
warn: statData.deviceAddCount < 0,
}"
>{{
statData.deviceAddCount >= 0
? "+" + statData.deviceAddCount
: "-" + statData.deviceAddCount
}}</span
></span
>
<p class="total-item-title">
<img src="../assets/images/abzs.png" alt="" />
<span>设备总数</span>
......@@ -36,14 +57,20 @@
<!-- 监控站点数 -->
<div class="total-item">
<p class="total-item-count">{{ statData.siteTotalCount }}</p>
<span style="font-size: 12px"><span class="tips">昨日 </span><span :class="{
success: statData.siteAddCount >= 0,
warn: statData.siteAddCount < 0,
}">{{
statData.siteAddCount >= 0
? "+" + statData.siteAddCount
: "-" + statData.siteAddCount
}}</span></span>
<span style="font-size: 12px"
><span class="tips">昨日 </span
><span
:class="{
success: statData.siteAddCount >= 0,
warn: statData.siteAddCount < 0,
}"
>{{
statData.siteAddCount >= 0
? "+" + statData.siteAddCount
: "-" + statData.siteAddCount
}}</span
></span
>
<p class="total-item-title">
<img src="../assets/images/jczds.png" alt="" />
<span>监控站点数</span>
......@@ -52,9 +79,12 @@
<!-- 在线设备 -->
<div class="total-item">
<p class="total-item-count">{{ statData.deviceOnlineCount }}</p>
<span style="font-size: 12px"><span class="tips">上线率 </span><span
v-bind:class="{ success: statData.deviceOnlineRatio >= 0 }">{{ (statData.deviceOnlineRatio *
100).toFixed(2) }}%</span></span>
<span style="font-size: 12px"
><span class="tips">上线率 </span
><span v-bind:class="{ success: statData.deviceOnlineRatio >= 0 }"
>{{ (statData.deviceOnlineRatio * 100).toFixed(2) }}%</span
></span
>
<p class="total-item-title">
<img src="../assets/images/zxsb.png" alt="" />
<span>在线设备</span>
......@@ -63,9 +93,12 @@
<!-- 离线率 -->
<div class="total-item">
<p class="total-item-count">{{ statData.deviceOfflineCount }}</p>
<span style="font-size: 12px"><span class="tips">离线率 </span><span
v-bind:class="{ warn: statData.deviceOfflineRatio >= 0 }">{{ (statData.deviceOfflineRatio *
100).toFixed(2) }}%</span></span>
<span style="font-size: 12px"
><span class="tips">离线率 </span
><span v-bind:class="{ warn: statData.deviceOfflineRatio >= 0 }"
>{{ (statData.deviceOfflineRatio * 100).toFixed(2) }}%</span
></span
>
<p class="total-item-title">
<img src="../assets/images/lxsb.png" alt="" />
<span>离线设备</span>
......@@ -74,9 +107,12 @@
<!-- 停用设备 -->
<div class="total-item">
<p class="total-item-count">{{ statData.deviceStopRatio }}</p>
<span style="font-size: 12px"><span class="tips">停用率 </span><span
v-bind:class="{ warn: statData.deviceStopRatio >= 0 }">{{ (statData.deviceStopRatio * 100).toFixed(2)
}}%</span></span>
<span style="font-size: 12px"
><span class="tips">停用率 </span
><span v-bind:class="{ warn: statData.deviceStopRatio >= 0 }"
>{{ (statData.deviceStopRatio * 100).toFixed(2) }}%</span
></span
>
<p class="total-item-title">
<img src="../assets/images/tusb.png" alt="" />
<span>停用设备</span>
......@@ -85,9 +121,12 @@
<!-- 未激活设备 -->
<div class="total-item">
<p class="total-item-count">{{ statData.deviceUnActiveRatio }}</p>
<span style="font-size: 12px"><span class="tips">未激活率 </span><span
v-bind:class="{ warn: statData.deviceUnActiveRatio >= 0 }">{{ (statData.deviceUnActiveRatio *
100).toFixed(2) }}%</span></span>
<span style="font-size: 12px"
><span class="tips">未激活率 </span
><span v-bind:class="{ warn: statData.deviceUnActiveRatio >= 0 }"
>{{ (statData.deviceUnActiveRatio * 100).toFixed(2) }}%</span
></span
>
<p class="total-item-title">
<img src="../assets/images/wjhsb.png" alt="" />
<span>未激活设备</span>
......@@ -96,14 +135,20 @@
<!-- 今日警告次数 -->
<div class="total-item">
<p class="total-item-count">{{ statData.alarmTotalCount }}</p>
<span style="font-size: 12px"><span class="tips">昨日 </span><span v-bind:class="{
success: statData.alarmAddCount >= 0,
warn: statData.alarmAddCount < 0,
}">{{
statData.alarmAddCount >= 0
? "+" + statData.alarmAddCount
: "-" + statData.alarmAddCount
}}</span></span>
<span style="font-size: 12px"
><span class="tips">昨日 </span
><span
v-bind:class="{
success: statData.alarmAddCount >= 0,
warn: statData.alarmAddCount < 0,
}"
>{{
statData.alarmAddCount >= 0
? "+" + statData.alarmAddCount
: "-" + statData.alarmAddCount
}}</span
></span
>
<p class="total-item-title">
<img src="../assets/images/gjcs.png" alt="" />
<span>今日告警次数</span>
......@@ -112,31 +157,45 @@
<!-- 今日消息推送 -->
<div class="total-item">
<p class="total-item-count">{{ statData.pushTotalCount }}</p>
<span style="font-size: 12px"><span class="tips">昨日 </span><span v-bind:class="{
success: statData.pushAddCount >= 0,
warn: statData.pushAddCount < 0,
}">{{
statData.pushAddCount >= 0
? "+" + statData.pushAddCount
: "-" + statData.pushAddCount
}}</span></span>
<span style="font-size: 12px"
><span class="tips">昨日 </span
><span
v-bind:class="{
success: statData.pushAddCount >= 0,
warn: statData.pushAddCount < 0,
}"
>{{
statData.pushAddCount >= 0
? "+" + statData.pushAddCount
: "-" + statData.pushAddCount
}}</span
></span
>
<p class="total-item-title">
<img src="../assets/images/xits.png" alt="" />
<span>今日消息推送次数</span>
</p>
</div>
</div>
</el-card>
</el-row>
<el-row style="margin-left: 35px; margin-right: 35px; margin-top: 15px" :gutter="20">
<el-row
style="margin-left: 35px; margin-right: 35px; margin-top: 15px"
:gutter="20"
>
<el-col :span="12">
<!-- 设备数据 -->
<el-card class="box-card">
<div id="deviceTotal" style="width: 100%; height: 300px"></div>
<!-- 天数选择 -->
<el-select class="change-day" v-model="myEchartsDay" @change="changeEchartDay(1)" size="mini" placeholder="请选择">
<el-select
class="change-day"
v-model="myEchartsDay"
@change="changeEchartDay(1)"
size="mini"
placeholder="请选择"
>
<el-option label="近15天" :value="15"> </el-option>
<el-option label="近30天" :value="30"> </el-option>
</el-select>
......@@ -147,7 +206,13 @@
<el-card class="box-card">
<div id="deviceStat" style="width: 100%; height: 300px"></div>
<!-- 天数选择 -->
<el-select class="change-day" size="mini" placeholder="请选择" @change="changeEchartDay(2)" v-model="deviceStatEchartsDay">
<el-select
class="change-day"
size="mini"
placeholder="请选择"
@change="changeEchartDay(2)"
v-model="deviceStatEchartsDay"
>
<el-option label="近15天" :value="15"> </el-option>
<el-option label="近30天" :value="30"> </el-option>
</el-select>
......@@ -155,14 +220,23 @@
</el-col>
</el-row>
<el-row style="margin-left: 35px; margin-right: 35px; margin-top: 10px" :gutter="20">
<el-row
style="margin-left: 35px; margin-right: 35px; margin-top: 10px"
:gutter="20"
>
<el-col :span="12">
<!-- 设备告警 -->
<el-card class="box-card device-alarm">
<div id="deviceAlarm" style="width: 70%; height: 300px"></div>
<div id="PieEcharts" style="width: 30%; height: 300px"></div>
<!-- 天数选择 -->
<el-select class="change-day" v-model="deviceAlarmEchartsDay" @change="changeEchartDay(3)" size="mini" placeholder="请选择">
<el-select
class="change-day"
v-model="deviceAlarmEchartsDay"
@change="changeEchartDay(3)"
size="mini"
placeholder="请选择"
>
<el-option label="近15天" :value="15"> </el-option>
<el-option label="近30天" :value="30"> </el-option>
</el-select>
......@@ -173,7 +247,13 @@
<el-card class="box-card">
<div id="devicePush" style="width: 100%; height: 300px"></div>
<!-- 天数选择 -->
<el-select class="change-day" v-model="devicePushEchartsDay" @change="changeEchartDay(4)" size="mini" placeholder="请选择">
<el-select
class="change-day"
v-model="devicePushEchartsDay"
@change="changeEchartDay(4)"
size="mini"
placeholder="请选择"
>
<el-option label="近15天" :value="15"> </el-option>
<el-option label="近30天" :value="30"> </el-option>
</el-select>
......@@ -266,7 +346,7 @@ export default {
let query = { createTimeStart: this.formatterDate(beforeday) };
//当前选择站点id
query.siteId = this.siteId;
query.size=-1;
query.size = -1;
this.$post("/device/stat/list", query)
.then((res) => {
if (res.code == 1) {
......@@ -297,7 +377,7 @@ export default {
findDeviceStat(beforeday) {
let query = { createTimeStart: this.formatterDate(beforeday) };
query.siteId = this.siteId;
query.size=-1;
query.size = -1;
this.$post("/device/stat/list", query)
.then((res) => {
if (res.code == 1) {
......@@ -328,7 +408,7 @@ export default {
findDeviceAlarm(beforeday) {
let query = { createTimeStart: this.formatterDate(beforeday) };
query.siteId = this.siteId;
query.size=-1;
query.size = -1;
this.$post("/device/stat/list", query)
.then((res) => {
if (res.code == 1) {
......@@ -358,7 +438,7 @@ export default {
findDevicePush(beforeday) {
let query = { createTimeStart: this.formatterDate(beforeday) };
query.siteId = this.siteId;
query.size=-1;
query.size = -1;
this.$post("/device/stat/list", query)
.then((res) => {
if (res.code == 1) {
......@@ -384,22 +464,22 @@ export default {
});
},
changeEchartDay(type){
changeEchartDay(type) {
let today = new Date();
let beforeday = new Date(today);
if(type==1){
if (type == 1) {
beforeday.setDate(beforeday.getDate() - this.myEchartsDay);
this.findDeviceTotalStat(beforeday);
}
if(type==2){
if (type == 2) {
beforeday.setDate(beforeday.getDate() - this.deviceStatEchartsDay);
this.findDeviceStat(beforeday);
}
if(type==3){
if (type == 3) {
beforeday.setDate(beforeday.getDate() - this.deviceAlarmEchartsDay);
this.findDeviceAlarm(beforeday);
}
if(type==4){
if (type == 4) {
beforeday.setDate(beforeday.getDate() - this.devicePushEchartsDay);
this.findDevicePush(beforeday);
}
......@@ -416,8 +496,8 @@ export default {
text: "设备数据",
top: "0",
subtext: "",
fontSize:"16px",
color:"#333"
fontSize: "16px",
color: "#333",
},
// 图例提示框
tooltip: {
......@@ -980,4 +1060,3 @@ export default {
background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%);
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment