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

perf: 屏蔽退出登录

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