<template>
|
<div class="page-header" v-if="!$store.state.user.autoLogin">
|
<div class="page-header-container">
|
<flex-layout direction="row">
|
<div class="page-header-left" slot="header">
|
<template v-if="$CFG.clientName.name != 'jstzLd9'">
|
<img
|
class="header-first-logo"
|
:src="logoUrl"
|
v-if="logoConfig.value"
|
/>
|
<span class="header-carve-up" v-if="logoConfig.value"></span>
|
<span>{{ platformName }}</span>
|
<span class="sys-version">{{ version }}</span>
|
</template>
|
</div>
|
<div class="page-header-content">
|
<div v-if="$CFG.clientName.name != 'cdsh'" class="header-info-list">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
:content="serverInfo.disk.message"
|
placement="bottom"
|
>
|
<div class="header-info-item">
|
<progress-bar
|
v-if="showProgress"
|
:options="options"
|
:value="serverInfo.disk.progress"
|
>
|
</progress-bar>
|
</div>
|
</el-tooltip>
|
<el-tooltip
|
class="item"
|
effect="dark"
|
:content="serverInfo.cpu.message"
|
placement="bottom"
|
>
|
<div class="header-info-item">
|
<progress-bar
|
v-if="showProgress"
|
:options="options"
|
:value="serverInfo.cpu.progress"
|
>
|
</progress-bar>
|
</div>
|
</el-tooltip>
|
<el-tooltip
|
class="item"
|
effect="dark"
|
:content="serverInfo.memory.message"
|
placement="bottom"
|
>
|
<div class="header-info-item">
|
<progress-bar
|
v-if="showProgress"
|
:options="options"
|
:value="serverInfo.memory.progress"
|
></progress-bar>
|
</div>
|
</el-tooltip>
|
<el-tooltip
|
class="item"
|
effect="dark"
|
:content="serverInfo.linkNum.message"
|
placement="bottom"
|
>
|
<div class="header-info-item">
|
<progress-bar
|
v-if="showProgress"
|
:options="options"
|
:value="serverInfo.linkNum.progress"
|
></progress-bar>
|
</div>
|
</el-tooltip>
|
<div class="header-info-item" style="margin-left: 60px">
|
<progress-state
|
icon="el-icon-fuwuqi"
|
:state="processInfo.sql"
|
:content="processSqlMsg"
|
>
|
</progress-state>
|
<progress-state
|
icon="el-icon-WIFIwofi"
|
:state="processInfo.link"
|
:content="processLinkMsg"
|
>
|
</progress-state>
|
<progress-state
|
icon="el-icon-dianchi"
|
:state="processInfo.behind"
|
:content="processBehindMsg"
|
></progress-state>
|
<progress-state
|
icon="el-icon-gaojing"
|
@click.native="alarmAlert()"
|
:state="processInfo.alarm"
|
:content="processAlarmMsg"
|
></progress-state>
|
<progress-state
|
icon="el-icon-jihua"
|
:state="processInfo.displan"
|
:content="processDisplanMsg"
|
></progress-state>
|
<progress-state
|
icon="el-icon-tingdian"
|
:state="processInfo.power"
|
:content="processPowerMsg"
|
></progress-state>
|
<progress-state
|
icon="el-icon-jiankong"
|
:state="processInfo.control"
|
:content="processControlMsg"
|
></progress-state>
|
<progress-state
|
icon="el-icon-pifu"
|
:state="1"
|
v-if="skin"
|
:content="themeInfo"
|
@handleClick="handleClick"
|
></progress-state>
|
<progress-state
|
icon="el-icon-dapingzhanshi_active"
|
:state="1"
|
content="大屏展示"
|
v-if="isSxty"
|
@handleClick="showBigScreen"
|
></progress-state>
|
<progress-state
|
icon="el-icon-mac"
|
:state="macState"
|
content="mac地址生成"
|
v-if="isWHYC && macFlag"
|
@handleClick="showMac"
|
></progress-state>
|
<progress-state icon="el-icon-danweixinxi" :state="1" content="3D机房" v-if="isTydc" @handleClick="show3DHome"></progress-state>
|
</div>
|
<!-- <weather-component-->
|
<!-- v-if="weatherState"-->
|
<!-- ></weather-component>-->
|
</div>
|
<div class="data-totals">
|
<hdw-badge-btn
|
v-if="inUseMenu.monitorWarn"
|
text="电源告警数"
|
:value="numbers.powerWarn"
|
@click="goPages('powerWarn')"
|
>
|
</hdw-badge-btn>
|
<hdw-badge-btn
|
v-if="false"
|
text="机房停电数"
|
:value="numbers.powerOff"
|
@click="goPages('powerOff')"
|
>
|
</hdw-badge-btn>
|
<hdw-badge-btn
|
v-if="inUseMenu.eleWarn"
|
text="电池告警数"
|
:value="numbers.battWarn"
|
@click="goPages('battWarn')"
|
>
|
</hdw-badge-btn>
|
<hdw-badge-btn
|
v-if="inUseMenu.deviceWarn"
|
text="设备告警数"
|
:value="numbers.devWarn"
|
@click="goPages('devWarn')"
|
>
|
</hdw-badge-btn>
|
<!-- <hdw-badge-btn text="容量落后单体数量" :value="numbers.lowMon" @click="goPages('lowMon')"></hdw-badge-btn>-->
|
<!-- <hdw-badge-btn text="未完成放电计划数" :value="numbers.plan" @click="goPages('plan')"></hdw-badge-btn>-->
|
<hdw-badge-btn
|
v-if="inUseMenu.discharge"
|
text="核容测试设备"
|
:value="numbers.nuclear"
|
@click="goPages('nuclear')"
|
>
|
</hdw-badge-btn>
|
<!-- <hdw-badge-btn-->
|
<!-- v-if="inUseMenu.seriousWarn"-->
|
<!-- text="严重告警数"-->
|
<!-- :value="numbers.levelNum"-->
|
<!-- @click="goPages('powerBoxAlarm')"-->
|
<!-- >-->
|
<!-- </hdw-badge-btn>-->
|
<!-- <hdw-badge-btn-->
|
<!-- v-if="inUseMenu.endure"-->
|
<!-- text="整体续航"-->
|
<!-- :value="numbers.levelNum"-->
|
<!-- no-value-->
|
<!-- @click="goPages('endure')"-->
|
<!-- ></hdw-badge-btn>-->
|
<!-- <hdw-badge-btn-->
|
<!-- v-if="inUseMenu.endure"-->
|
<!-- text="区域续航"-->
|
<!-- :value="numbers.levelNum"-->
|
<!-- @click="goPages('endure')"-->
|
<!-- no-value-->
|
<!-- ></hdw-badge-btn>-->
|
<!-- <div class="term-date" v-show="termDateShow">-->
|
<!-- <span>有效期:</span>-->
|
<!-- <span class="term-date-value">{{ termDate }}</span>-->
|
<!-- <span>天</span>-->
|
<!-- </div>-->
|
</div>
|
<!-- <div class="system-tools">-->
|
<!-- <div class="tools-item"><i class="iconfont el-icon-pifu-"></i></div>-->
|
<!-- </div>-->
|
</div>
|
<div class="page-header-right" slot="footer">
|
<div class="hdw-avatar">
|
<span class="hdw-avatar-icon">
|
<i class="iconfont el-icon-Userselect"></i>
|
</span>
|
<el-dropdown @command="commandClick">
|
<span class="hdw-avatar-text">
|
{{ username
|
}}<i
|
class="el-icon-arrow-down el-icon--right"
|
v-if="!$store.state.user.autoLogin"
|
></i>
|
</span>
|
<el-dropdown-menu
|
slot="dropdown"
|
v-if="!$store.state.user.autoLogin"
|
>
|
<el-dropdown-item command="passwordChange"
|
>密码修改</el-dropdown-item
|
>
|
<el-dropdown-item command="outSystem"
|
>安全退出</el-dropdown-item
|
>
|
</el-dropdown-menu>
|
</el-dropdown>
|
<img
|
v-if="showLogo"
|
src="../../assets/images/fuguang_logo.jpg"
|
class="fuguang-logo"
|
/>
|
</div>
|
</div>
|
</flex-layout>
|
</div>
|
<el-drawer
|
title="我是标题"
|
:visible.sync="pifuDrawer"
|
size="360px"
|
:with-header="false"
|
:modal-append-to-body="false"
|
>
|
<pifu-list></pifu-list>
|
</el-drawer>
|
<el-drawer
|
title="我的常用功能"
|
:visible.sync="usefulToolsDrawer"
|
size="240px"
|
custom-class="useful-tools"
|
:with-header="false"
|
:modal-append-to-body="false"
|
>
|
<useful-tools @close="closeUsefulTools"></useful-tools>
|
</el-drawer>
|
<!-- 密码修改 -->
|
<el-dialog
|
title="密码修改"
|
width="400px"
|
:visible.sync="pwd.show"
|
:close-on-click-modal="false"
|
top="0"
|
class="dialog-center"
|
:modal-append-to-body="false"
|
>
|
<pwd-change v-if="pwd.show" :visible.sync="pwd.show" :name="username"></pwd-change>
|
</el-dialog>
|
<!-- 短信猫和声光告警的配置 -->
|
<el-dialog
|
title="短信猫和声光告警的配置"
|
width="600px"
|
:visible.sync="alarmAlertStatus"
|
:close-on-click-modal="false"
|
top="0"
|
class="dialog-center"
|
:modal-append-to-body="false"
|
>
|
<alarm-alert
|
v-if="alarmAlertStatus"
|
:visible.sync="alarmAlertStatus"
|
></alarm-alert>
|
</el-dialog>
|
<big-screen-page
|
@close="closeBigScreen"
|
v-if="bigScreenState"
|
></big-screen-page>
|
<div class="dragging-box" v-if="!usefulToolsDrawer">
|
<div class="drag-box-content" @click="usefulToolsDrawer = true">
|
<div>我的</div>
|
<div>菜单</div>
|
</div>
|
</div>
|
<el-dialog
|
title="mac地址生成工具"
|
:fullscreen="true"
|
:visible.sync="macVisible"
|
top="0"
|
class="dialog-center dialog-mac"
|
>
|
<create-mac v-if="macVisible"></create-mac>
|
</el-dialog>
|
<el-dialog
|
title="3D机房"
|
:fullscreen="true"
|
:visible.sync="threeHomeVisible"
|
top="0"
|
class="dialog-center">
|
<home-ty v-if="threeHomeVisible"></home-ty>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import createMac from "@/views/jobManage/createMac.vue";
|
import HdwBadgeBtn from "./HdwBadgeBtn";
|
import ProgressState from "./ProcessState";
|
import PifuList from "./PifuList";
|
import PwdChange from "./PwdChange";
|
import alarmAlert from "./alarmAlert";
|
import platform from "@/assets/js/config";
|
import nfdw from "@/assets/images/nfdw-log.png";
|
import gjdw from "@/assets/images/gjdw-log.png";
|
import gjdx from "@/assets/images/gjdx-log.png";
|
import qwh from "@/assets/images/qwh-logo.png";
|
import gdnr from "@/assets/images/gdnr-logo.png";
|
import szdt from "@/assets/images/szdt-logo.png";
|
import { Timeout } from "@/assets/js/tools";
|
import getPageMenu from "@/assets/js/tools/getPageMenu";
|
import checkMenuIsUse from "@/assets/js/tools/checkMenuIsUse";
|
import BMap from "BMap";
|
import WeatherComponent from "./weatherComponent";
|
import BMapTools from "@/assets/js/tools/BMapTools";
|
import getScreenUrl from "@/assets/js/tools/getScreenUrl";
|
import { searchHomePage, getAllRealTabsConfig } from "@/layout/js/api";
|
import {
|
getLicenseResTime,
|
searchVersion,
|
getMacUks,
|
} from "@/views/login/js/api";
|
import { getPageMenuApi } from "@/views/pageSetting/js/api";
|
import createWs from "@/assets/js/websocket";
|
const WSMixin = createWs("homePageSocket");
|
import BigScreenPage from "@/components/bigScreenPage/big_screen_page.vue";
|
import VueDraggableResizable from "vue-draggable-resizable";
|
import UsefulTools from "@/layout/components/UsefulTools.vue";
|
import config from "@/assets/js/config";
|
import HomeTy from "@/views/home/home-ty.vue";
|
import { searchParam } from "@/views/pageSetting/js/api";
|
export default {
|
bMapTools: new BMapTools(BMap),
|
components: {
|
UsefulTools,
|
WeatherComponent,
|
HdwBadgeBtn,
|
ProgressState,
|
PifuList,
|
PwdChange,
|
alarmAlert,
|
BigScreenPage,
|
VueDraggableResizable,
|
createMac,
|
HomeTy,
|
},
|
mixins: [WSMixin],
|
data() {
|
let platformName = sessionStorage.getItem("platformName");
|
let isSxty = platform.clientName.name === "sxty";
|
let isTydc = platform.clientName.name === "tydc";
|
return {
|
isTydc,
|
threeHomeVisible: false,
|
ukList: [],
|
macState: 0,
|
macVisible: false,
|
alarmAlertStatus: false,
|
skinActive: "science-blue",
|
logoConfig: platform.logo,
|
showProgress: false,
|
pifuDrawer: false,
|
usefulToolsDrawer: false,
|
showLogo: false,
|
version: "",
|
skin: platform.skin.value,
|
isSxty,
|
weatherState: platform.weather.value,
|
bigScreen: platform.bigScreen.value,
|
username: sessionStorage.getItem("username"),
|
termDateShow: true,
|
termDate: 0,
|
menus: [],
|
options: {
|
text: {
|
color: "#041F6C",
|
shadowEnable: true,
|
shadowColor: "transparent",
|
fontSize: 12,
|
fontWeight: "bold",
|
fontFamily: "Helvetica",
|
dynamicPosition: false,
|
hideText: false,
|
},
|
progress: {
|
color: "#f06824",
|
backgroundColor: "#FFE329",
|
},
|
layout: {
|
height: 15,
|
width: 70,
|
verticalTextAlign: 70,
|
horizontalTextAlign: 35,
|
zeroOffset: 0,
|
strokeWidth: 30,
|
progressPadding: 0,
|
type: "line",
|
},
|
},
|
numbers: {
|
lowMon: 0,
|
powerOff: 0,
|
battWarn: 0,
|
devWarn: 0,
|
plan: 0,
|
nuclear: 0,
|
powerWarn: 0,
|
levelNum: 0,
|
},
|
serverInfo: {
|
disk: {
|
progress: 0,
|
message: "服务器数据磁盘总量:未知;剩余:未知",
|
},
|
cpu: {
|
progress: 0,
|
message: "TM:未知",
|
},
|
memory: {
|
progress: 0,
|
message: "FM:未知",
|
},
|
linkNum: {
|
progress: 0,
|
message: "DBC:未知",
|
},
|
},
|
processInfo: {
|
// 0:异常 1:正常 2:暂未开启
|
alarm: 0, //告警标识位
|
behind: 0, //落后标识位
|
displan: 0, //放电计划标识位
|
power: 0, //机房停电标识位
|
control: 0, //线程监控标识位
|
sql: 0, //服务器数据实时更新
|
link: 0, //服务器连接
|
},
|
value: 0,
|
timer: new Timeout(),
|
pwd: {
|
show: false,
|
},
|
platformName: platformName ? platformName : "蓄电池后台监控管理平台",
|
inUseMenu: {
|
monitorWarn: true, // 电源告警数
|
powerDown: true, // 停电告警数
|
eleWarn: true, // 电池告警数
|
deviceWarn: true, // 设备告警数
|
discharge: true, // 核容设备数
|
seriousWarn: true, // 严重告警数
|
endure: true, // 整体和区域续航
|
},
|
address: {
|
province: "",
|
city: "",
|
district: "",
|
},
|
bigScreenState: false,
|
width: 0,
|
height: 0,
|
x: 0,
|
y: 171,
|
winWidth: 0,
|
winHeight: 0,
|
};
|
},
|
methods: {
|
getMacUks() {
|
getMacUks()
|
.then((res) => {
|
let { code, data, data2 } = res.data;
|
let list = [];
|
if (code && data) {
|
list = data2;
|
// 如果有ukeyid 手动触发ukey插拨
|
if (this.$store.state.ukey.id) {
|
this.$store.dispatch("ukey/changeId", false);
|
this.$store.dispatch("ukey/changeId", true);
|
}
|
}
|
this.ukList = list;
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
showMac() {
|
// TODO 调试时动这里
|
if (!this.$store.state.ukey.id) {
|
this.$message.error("请插入ukey");
|
return false;
|
}
|
if (!this.macState) {
|
this.$message.error("ukey与当前用户不匹配");
|
return false;
|
}
|
this.macVisible = true;
|
},
|
show3DHome() {
|
this.threeHomeVisible = true;
|
},
|
closeUsefulTools() {
|
this.usefulToolsDrawer = false;
|
},
|
alarmAlert() {
|
this.alarmAlertStatus = !this.alarmAlertStatus;
|
},
|
handleClick() {
|
this.pifuDrawer = true;
|
},
|
goToScreenManage() {
|
let userId = sessionStorage.getItem("userId");
|
let url;
|
if (process.env.NODE_ENV != "dev") {
|
url = getScreenUrl() + "index.html#/?userId=" + userId;
|
} else {
|
url = "http://localhost:8008/#/?userId=" + userId;
|
}
|
window.open(url);
|
},
|
showBigScreen() {
|
this.bigScreenState = true;
|
},
|
closeBigScreen() {
|
this.bigScreenState = false;
|
},
|
outSystem() {
|
sessionStorage.removeItem("username");
|
sessionStorage.removeItem("userId");
|
sessionStorage.removeItem("userPower");
|
this.$store.dispatch("tagsView/delAllViews").then(({ visitedViews }) => {
|
this.$router.push("/login");
|
});
|
},
|
passwordChange() {
|
this.pwd.show = true;
|
},
|
commandClick(name) {
|
switch (name) {
|
case "outSystem":
|
this.outSystem();
|
break;
|
case "passwordChange":
|
this.passwordChange();
|
break;
|
default:
|
this.$layer.msg("该功能暂未开放!");
|
break;
|
}
|
},
|
startSearch() {
|
this.timer.start(() => {
|
this.$axios
|
.all([this.searchHomePage()])
|
.then(() => {
|
this.timer.open();
|
})
|
.catch((error) => {
|
console.log(error);
|
});
|
}, 4 * 1000);
|
},
|
onWSOpen() {
|
this.sendMessage();
|
},
|
sendMessage() {
|
let userId = sessionStorage.getItem("userId");
|
this.SOCKET.send(Number(userId));
|
},
|
onWSMessage(res) {
|
let rs = JSON.parse(res.data);
|
if (rs.code == 1) {
|
let data = rs.data;
|
this.setServerData(data["服务器信息"]);
|
this.setLabelNumber(data);
|
this.setProcessState(data["线程状态"]);
|
} else {
|
this.setServerData();
|
this.setLabelNumber();
|
}
|
},
|
// 查询头部信息
|
searchHomePage() {
|
searchHomePage()
|
.then((res) => {
|
let rs = res.data;
|
if (rs.code == 1) {
|
let data = rs.data;
|
this.setServerData(data["服务器信息"]);
|
this.setLabelNumber(data);
|
this.setProcessState(data["线程状态"]);
|
} else {
|
this.setServerData();
|
this.setLabelNumber();
|
}
|
})
|
.catch((error) => {
|
console.log(error);
|
});
|
},
|
/**
|
* 设置服务器信息
|
* @param data 服务器信息
|
*/
|
setServerData(data) {
|
if (data) {
|
let totalDiscSpace = data.totalDiscSpace;
|
// 设置服务器磁盘信息
|
this.serverInfo.disk.progress = data.diskRate;
|
this.serverInfo.disk.message =
|
"服务器数据磁盘总量" +
|
(data.totalDiscSpace - data.freeDiscSpace) +
|
"G/" +
|
data.totalDiscSpace +
|
"G";
|
|
// 设置服务器cpu信息
|
this.serverInfo.cpu.progress = data.serverCpuRate;
|
this.serverInfo.cpu.message =
|
"CPU使用率:" + data.serverCpuRate + "/100";
|
|
// 设置服务器内存的信息
|
this.serverInfo.memory.progress = data.memRate;
|
this.serverInfo.memory.message =
|
"服务器内存:" +
|
(data.totalMem - data.freeMen).toHold(2) +
|
"G/" +
|
data.totalMem +
|
"G";
|
|
// 设置服务器的连接数
|
this.serverInfo.linkNum.progress = data.connRate;
|
this.serverInfo.linkNum.message =
|
"DBC:" + data.dbCOnnCount + "/" + data.dbConnMax;
|
|
// 更新服务器更新和连接状态
|
var nowtime = new Date(data.note.replace(/\-/g, "/"));
|
var sertime = new Date(data.serverDatetime.replace(/\-/g, "/"));
|
var timelong = Math.abs(parseInt(sertime - nowtime));
|
if (timelong / (1000 * 60) > 2) {
|
this.processInfo.sql = 0;
|
} else {
|
this.processInfo.sql = 1;
|
}
|
this.processInfo.link = 1;
|
} else {
|
this.processInfo.sql = 0;
|
this.processInfo.link = 0;
|
}
|
},
|
|
/**
|
* 设置label的值
|
* @param data 头部数据信息
|
*/
|
setLabelNumber(data) {
|
if (data) {
|
this.numbers.plan = data["未放电的计划总数"];
|
this.numbers.powerOff = data["机房停电总数-断电实时数"];
|
this.numbers.nuclear = data["正在核容测试的信息"].length;
|
this.numbers.battWarn = data["电池告警数"];
|
this.numbers.powerWarn = data["电源告警个数"];
|
this.numbers.levelNum = data["电源紧急告警个数"];
|
this.numbers.lowMon = data["落后单体数量"];
|
this.numbers.devWarn = data["设备告警数"];
|
} else {
|
this.numbers.plan = 0;
|
this.numbers.powerOff = 0;
|
this.numbers.nuclear = 0;
|
this.numbers.battWarn = 0;
|
this.numbers.powerWarn = 0;
|
this.numbers.levelNum = 0;
|
this.numbers.lowMon = 0;
|
this.numbers.devWarn = 0;
|
}
|
},
|
|
/**
|
* 设置线程状态
|
* @param data 线程状态数据
|
*/
|
setProcessState(data) {
|
if (data) {
|
let alarmBatt = false; //电池告警
|
let alarmDev = false; //设备告警
|
let alarmCap = false; //容量告警
|
let badmon = false; //落后单体
|
// 遍历并处理数据
|
data.forEach((item) => {
|
switch (item.serverName) {
|
// 告警线程
|
case "BMS_FBSDEV_ALARM":
|
if (item.processName == "BMS_FBSDEV_ALARM_BATT") {
|
if (item.serverFlag == 0) {
|
alarmBatt = 0;
|
} else {
|
alarmBatt = this.checkTimeOut2(item);
|
}
|
} else if (item.processName == "BMS_FBSDEV_ALARM_DEV") {
|
if (item.serverFlag == 0) {
|
alarmDev = 0;
|
} else {
|
alarmDev = this.checkTimeOut2(item);
|
}
|
}
|
|
if (this.processInfo.alarm == 2 || item.serverFlag == 2) {
|
this.processInfo.alarm = 2;
|
} else {
|
this.processInfo.alarm = alarmBatt && alarmBatt;
|
}
|
break;
|
// 电池落后
|
case "BMS_FBSDEV_BADBATT":
|
if (item.processName == "BMS_FBSDEV_BADBATT_MON") {
|
//落后单体线程
|
if (item.serverFlag == 0) {
|
badmon = 0;
|
} else {
|
badmon = this.checkTimeOut2(item);
|
}
|
} else if (item.processName == "BMS_FBSDEV_BADBATT_CAP") {
|
//容量告警线程
|
if (item.serverFlag == 0) {
|
alarmCap = 0;
|
} else {
|
alarmCap = this.checkTimeOut2(item);
|
}
|
}
|
if (this.processInfo.behind == 2 || item.serverFlag == 2) {
|
this.processInfo.behind = 2;
|
} else {
|
this.processInfo.behind = badmon && alarmCap;
|
}
|
break;
|
// 放电计划线程
|
case "BMS_FBSDEV_PLAN":
|
if (item.processName == "BMS_FBSDEV_PLAN") {
|
if (item.serverFlag == 0) {
|
this.processInfo.displan = 0;
|
} else {
|
this.processInfo.displan = this.checkTimeOut2(item);
|
}
|
}
|
if (this.processInfo.displan == 2 || item.serverFlag == 2) {
|
this.processInfo.displan = 2;
|
}
|
break;
|
case "BMS_FBSDEV_POWER_FAIL":
|
if (item.processName == "BMS_FBSDEV_POWER_FAIL") {
|
if (item.serverFlag == 0) {
|
this.processInfo.power = 0;
|
} else {
|
this.processInfo.power = this.checkTimeOut2(item);
|
}
|
}
|
if (this.processInfo.power == 2 || item.serverFlag == 2) {
|
this.processInfo.power = 2;
|
}
|
break;
|
// 线程监控线程
|
case "BMS_FBSDEV_LISTEN":
|
if (item.processName == "BMS_FBSDEV_LISTEN") {
|
if (item.serverFlag == 0) {
|
this.processInfo.control = 0;
|
} else {
|
this.processInfo.control = this.checkTimeOut2(item);
|
}
|
}
|
if (this.processInfo.control == 2 || item.serverFlag == 2) {
|
this.processInfo.control = 2;
|
}
|
break;
|
}
|
});
|
}
|
},
|
checkTimeOut2(temp) {
|
var flag = 0;
|
if (temp != undefined) {
|
let startTime = new Date(temp.processTime);
|
let endTime = new Date(temp.note);
|
let totalms = (endTime.getTime() - startTime.getTime()) / 1000;
|
if (totalms < temp.outTime) {
|
flag = 1;
|
}
|
}
|
return flag;
|
},
|
goPages(type) {
|
let message = "";
|
switch (type) {
|
case "powerOff":
|
//机房状态查询
|
this.$router.push("/dataMager/powercut");
|
break;
|
case "battWarn":
|
//电池实时告警
|
this.$router.push("/alarmMager/batteryrTimequery?pageFlag="+Math.random());
|
break;
|
case "devWarn":
|
//设备实时告警
|
this.$router.push("/alarmMager/deviceTimequery?pageFlag="+Math.random());
|
break;
|
case "nuclear":
|
//设备状态查询
|
this.$router.push("/dataTest/btsStatus?status=2&pageFlag="+Math.random());
|
break;
|
case "powerWarn":
|
//电源实时告警
|
this.$router.push("/alarmMager/powerRealtimeInfo");
|
break;
|
case "powerBoxAlarm":
|
message.params = {
|
pageInfo: {
|
label: "通讯电源实时告警",
|
name: "powerBoxAlarm",
|
src: "#/powerBoxAlarm?level=1",
|
closable: true,
|
},
|
};
|
//通讯电源实时告警
|
// this.$router.push('/powerBoxAlarm')
|
break;
|
case "endure":
|
//电池信息统计分析
|
this.$router.push("/dataMager/produceTotal");
|
break;
|
default:
|
message = false;
|
this.$layer.msg("该功能暂未开放!");
|
break;
|
}
|
},
|
changeSkin() {
|
this.$nextTick(() => {
|
this.showProgress = true;
|
if (this.skinActive == "science-green") {
|
this.options.progress.color = "#fb8d1a";
|
this.options.progress.backgroundColor = "#1ccfe5";
|
} else if (this.skinActive == "science-blue") {
|
this.options.progress.color = "#f06824";
|
this.options.progress.backgroundColor = "#FFE329";
|
} else if (this.skinActive == "science-black") {
|
this.options.progress.color = "#ff6502";
|
this.options.progress.backgroundColor = "#fffffe";
|
} else if (this.skinActive == "science-purple") {
|
this.options.progress.color = "#ff5503";
|
this.options.progress.backgroundColor = "#ffce00";
|
} else if (this.skinActive == "science-ziluolan") {
|
this.options.progress.color = "#ff5503";
|
this.options.progress.backgroundColor = "#ffce00";
|
} else if (this.skinActive == "science-skyBlue") {
|
this.options.progress.color = "#f06824";
|
this.options.progress.backgroundColor = "#FFE329";
|
}
|
});
|
},
|
getLicenseResTime() {
|
getLicenseResTime()
|
.then((res) => {
|
let rs = res.data;
|
if (rs.code == 1) {
|
this.termDateShow = true;
|
this.termDate = rs.data;
|
} else if (rs.code == 2) {
|
this.termDateShow = false;
|
}
|
})
|
.catch((error) => {
|
console.log(error);
|
});
|
},
|
searchVersion() {
|
searchVersion()
|
.then((res) => {
|
let rs = res.data;
|
if (rs.code == 1) {
|
let data = rs.data["1"][0];
|
this.version = data.param;
|
}
|
})
|
.catch((error) => {});
|
},
|
getPageMenu() {
|
getPageMenuApi()
|
.then((res) => {
|
let rs = res.data;
|
let data = [];
|
if (rs.code == 1) {
|
data = rs.data;
|
}
|
this.menus = getPageMenu();
|
this.changeMenus(this.menus, data);
|
this.changeBox(this.menus);
|
})
|
.catch((error) => {
|
this.menus = getPageMenu();
|
this.changeBox(this.menus);
|
console.log(error);
|
});
|
},
|
changeMenus(menus, list) {
|
menus.forEach((menu) => {
|
let item = "";
|
for (let i = 0; i < list.length; i++) {
|
if (menu.id == list[i].id) {
|
item = list[i];
|
break;
|
}
|
}
|
if (item && item.childrens) {
|
item.childrens.forEach((children) => {
|
for (let i = 0; i < menu.childrens.length; i++) {
|
let item2 = menu.childrens[i];
|
if (item2.id == children.id) {
|
item2.enableduse = children.enableduse;
|
break;
|
}
|
}
|
});
|
}
|
});
|
},
|
changeBox(menus) {
|
// 通信电源总站
|
this.inUseMenu.monitorWarn = checkMenuIsUse(4001, menus);
|
// 机房状态查询
|
this.inUseMenu.powerDown = checkMenuIsUse(3006, menus);
|
// 电池告警数
|
this.inUseMenu.eleWarn = checkMenuIsUse(4003, menus);
|
// 设备告警数
|
this.inUseMenu.deviceWarn = checkMenuIsUse(4005, menus);
|
// 核容设备
|
this.inUseMenu.discharge = checkMenuIsUse(2005, menus);
|
// 严重告警数
|
this.inUseMenu.seriousWarn = checkMenuIsUse(4007, menus);
|
// 整体和区域续航
|
this.inUseMenu.endure = checkMenuIsUse(5006, menus);
|
},
|
initPageConfig() {
|
getAllRealTabsConfig()
|
.then((res) => {
|
let rs = res?.data?.data || [];
|
let arr = [];
|
for (let key in rs) {
|
arr.push(...rs[key]);
|
}
|
// 设置pageConfig
|
this.$store.dispatch("user/changeRealTabsConfig", arr);
|
})
|
.catch((error) => {
|
// 设置pageConfig
|
this.$store.dispatch("user/changeRealTabsConfig", []);
|
});
|
},
|
resizeProgressBar() {
|
let winWidth = document.body.clientWidth;
|
let winHeight = document.body.clientHeight;
|
let ratio = winWidth / 1920>1?1:winWidth / 1920;
|
let width = 70 * ratio;
|
let height = 15 * ratio;
|
let fontSize = 12 * ratio;
|
// 根据缩放比例显示进度条的长,高和内容字体
|
this.options.layout.width = width;
|
this.options.layout.height = height;
|
this.options.text.fontSize = fontSize;
|
// 移除进度调
|
this.showProgress = false;
|
if (this.winWidth) {
|
this.x = (this.x / this.winWidth) * winWidth;
|
this.y = (this.y / this.winHeight) * winHeight;
|
}
|
this.winWidth = winWidth;
|
this.winHeight = winHeight;
|
this.$nextTick(() => {
|
// 显示进度条
|
this.showProgress = true;
|
});
|
},
|
showPasswordMessage() { // 根据登录状态,提示是否修改密码
|
const useLoginState = sessionStorage.getItem("useLoginState");
|
console.log(useLoginState);
|
// 用户登录状态 0-(不做动作) 2-初始密码登录 3-密码长时间未登录
|
if(!(useLoginState === "2" || useLoginState === "3")) {
|
return;
|
}
|
let message = useLoginState === "2"?"初始密码登录,请及时更新密码":"密码长时间未修改,请及时更新密码";
|
this.$confirm(message, '系统提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
closeOnClickModal: false,
|
closeOnPressEscape: false
|
}).then(() => {
|
this.passwordChange();
|
// 用户登录状态 0-(不做动作) 2-首次登录 3-密码长时间未登录
|
sessionStorage.setItem("useLoginState", "0");
|
}).catch(() => {
|
// 用户登录状态 0-(不做动作) 2-首次登录 3-密码长时间未登录
|
sessionStorage.setItem("useLoginState", "0");
|
});
|
},
|
async searchPasswordRules() {
|
try {
|
let res = await searchParam({categoryId: 10});
|
let rs = res.data;
|
if (rs.code === 1 && rs.data.list.length !== 0) {
|
let data = rs.data.list;
|
// 读取字符长度
|
sessionStorage.setItem("passwordNum", data[0].status);
|
// 读取密码类型
|
sessionStorage.setItem("passwordType", data[1].status);
|
} else {
|
// 读取字符长度
|
sessionStorage.setItem("passwordNum", "8");
|
// 读取密码类型
|
sessionStorage.setItem("passwordType", "4");
|
}
|
}catch (e){
|
// 读取字符长度
|
sessionStorage.setItem("passwordNum", "8");
|
// 读取密码类型
|
sessionStorage.setItem("passwordType", "4");
|
console.log("查询密码规则错误:"+e);
|
}
|
|
}
|
},
|
computed: {
|
isWHYC() {
|
return this.$CFG.WHYC.value;
|
},
|
macFlag() {
|
return this.ukList.some((v) => v.uname == this.username);
|
},
|
processAlarmMsg() {
|
let result = "未知";
|
switch (this.processInfo.alarm) {
|
case 0:
|
result = "告警监测线程:异常";
|
break;
|
case 1:
|
result = "告警监测线程:正常";
|
break;
|
case 2:
|
result = "告警监测线程:未启用";
|
break;
|
}
|
return result;
|
},
|
processBehindMsg() {
|
let result = "未知";
|
switch (this.processInfo.behind) {
|
case 0:
|
result = "落后单体监测线程:异常";
|
break;
|
case 1:
|
result = "落后单体监测线程:正常";
|
break;
|
case 2:
|
result = "落后单体监测线程:未启用";
|
break;
|
}
|
return result;
|
},
|
processDisplanMsg() {
|
let result = "未知";
|
switch (this.processInfo.displan) {
|
case 0:
|
result = "放电计划监测线程:异常";
|
break;
|
case 1:
|
result = "放电计划监测线程:正常";
|
break;
|
case 2:
|
result = "放电计划监测线程:未启用";
|
break;
|
}
|
return result;
|
},
|
processPowerMsg() {
|
let result = "未知";
|
switch (this.processInfo.power) {
|
case 0:
|
result = "机房停电监测线程:异常";
|
break;
|
case 1:
|
result = "机房停电监测线程:正常";
|
break;
|
case 2:
|
result = "机房停电监测线程:未启用";
|
break;
|
}
|
return result;
|
},
|
processControlMsg() {
|
let result = "未知";
|
switch (this.processInfo.control) {
|
case 0:
|
result = "线程监控程序运行:异常";
|
break;
|
case 1:
|
result = "线程监控程序运行:正常";
|
break;
|
case 2:
|
result = "线程监控程序运行:未启用";
|
break;
|
}
|
return result;
|
},
|
processSqlMsg() {
|
let result = "未知";
|
switch (this.processInfo.sql) {
|
case 0:
|
result = "服务器实时更新数据:异常";
|
break;
|
case 1:
|
result = "服务器实时更新数据:正常";
|
break;
|
}
|
return result;
|
},
|
processLinkMsg() {
|
let result = "未知";
|
switch (this.processInfo.link) {
|
case 0:
|
result = "服务器连接:异常";
|
break;
|
case 1:
|
result = "服务器连接:正常";
|
break;
|
}
|
return result;
|
},
|
themeInfo() {
|
return "当前主题:" + this.$store.state.theme.themeName;
|
},
|
logoUrl() {
|
let logoConfig = this.logoConfig;
|
let image = gjdw;
|
switch (logoConfig.fileName) {
|
case "nfdw":
|
image = nfdw;
|
break;
|
case "gjdx":
|
image = gjdx;
|
break;
|
case "qwh":
|
image = qwh;
|
break;
|
case "gdnr":
|
image = gdnr;
|
break;
|
case "szdt":
|
image = szdt;
|
break;
|
|
}
|
return image;
|
},
|
},
|
created() {
|
this.skinActive = localStorage.getItem("activeSkin");
|
this.showProgress = false;
|
this.changeSkin();
|
},
|
watch: {
|
"$store.state.theme.activeSkin"(val) {
|
this.skinActive = localStorage.getItem("activeSkin");
|
this.showProgress = false;
|
this.changeSkin();
|
},
|
"$store.state.ukey.id": {
|
handler(id) {
|
if (id) {
|
// 判断 id为当前有效用户所对应的有效ukid才设为1
|
if (this.macFlag) {
|
let ukeyId = this.ukList.filter((v) => v.uname == this.username)[0]
|
.ukeyId;
|
if (id == ukeyId) {
|
this.macState = 1;
|
} else {
|
this.macState = 0;
|
}
|
}
|
} else {
|
this.macState = 0;
|
this.macVisible = false;
|
}
|
// console.log(id, "ukid", this.macFlag, this.macState);
|
},
|
immediate: true,
|
},
|
},
|
mounted() {
|
|
this.searchPasswordRules();
|
|
this.showPasswordMessage();
|
|
this.getMacUks();
|
// 启动请求
|
// this.startSearch();
|
|
// 查询剩余天数
|
this.getLicenseResTime();
|
|
// 查询版本
|
this.searchVersion();
|
|
// 查询导航
|
this.getPageMenu();
|
|
// 初始化实时页面页签
|
this.initPageConfig();
|
|
this.resizeProgressBar();
|
|
this.x = this.winWidth - 85;
|
|
window.addEventListener("resize", this.resizeProgressBar);
|
},
|
destroyed() {
|
window.removeEventListener("resize", this.resizeProgressBar);
|
this.timer.stop();
|
},
|
};
|
</script>
|
|
<style scoped>
|
.page-header-container {
|
height: 70px;
|
}
|
|
.page-header-content {
|
position: relative;
|
height: 100%;
|
overflow: hidden;
|
padding-top: 5px;
|
box-sizing: border-box;
|
}
|
|
.page-header-left {
|
height: 100%;
|
display: flex;
|
align-items: center;
|
padding-right: 130px;
|
min-width: 12em;
|
}
|
|
.page-header-left img {
|
height: 40px;
|
vertical-align: middle;
|
}
|
|
.page-header-left span {
|
font-size: 33px;
|
font-weight: bold;
|
letter-spacing: 4px;
|
}
|
|
.page-header-left span.sys-version {
|
font-size: 24px;
|
margin-left: 4px;
|
font-weight: normal;
|
padding-top: 8px;
|
}
|
|
.data-totals {
|
padding-left: 18px;
|
}
|
|
.data-totals-item {
|
margin-right: 18px;
|
}
|
|
.header-info-list {
|
padding-left: 18px;
|
display: flex;
|
align-items: center;
|
}
|
|
.header-info-item {
|
display: inline-block;
|
min-width: 85px;
|
padding-top: 4px;
|
padding-bottom: 2px;
|
}
|
|
.info-banner {
|
display: inline-block;
|
color: #ffffff;
|
background-color: blue;
|
}
|
|
.info-banner-text {
|
display: inline-block;
|
padding-top: 8px;
|
padding-bottom: 8px;
|
}
|
|
.hdw-avatar {
|
display: inline-block;
|
margin-top: 10px;
|
margin-right: 16px;
|
cursor: pointer;
|
color: #e4e3e3;
|
}
|
|
.hdw-avatar:hover {
|
color: #ffffff;
|
}
|
|
.hdw-avatar:hover .el-icon-arrow-down {
|
transform: rotate(180deg);
|
}
|
|
.hdw-avatar-icon {
|
display: inline-flex;
|
width: 38px;
|
height: 38px;
|
border-radius: 50%;
|
justify-content: center;
|
background-color: #4ba1fa;
|
align-items: center;
|
color: #032c8f;
|
}
|
|
.hdw-avatar-icon .iconfont {
|
font-size: 16px;
|
}
|
|
.hdw-avatar-text {
|
color: #4ba1fa;
|
margin-left: 8px;
|
}
|
|
.hdw-avatar-text .el-icon-arrow-down {
|
margin-left: 4px;
|
}
|
|
.fuguang-logo {
|
height: 45px;
|
margin-left: 8px;
|
vertical-align: middle;
|
}
|
|
.header-first-logo {
|
margin-left: 20px;
|
}
|
|
.header-carve-up {
|
display: inline-block;
|
height: 28px;
|
width: 1px;
|
background-color: #00feff;
|
margin-left: 12px;
|
margin-right: 12px;
|
}
|
|
.system-tools {
|
position: absolute;
|
top: 8px;
|
right: 8px;
|
}
|
|
.tools-item {
|
display: inline-block;
|
padding: 8px;
|
border-radius: 50%;
|
background-color: #4ba1fa;
|
}
|
|
.system-tools .iconfont {
|
font-size: 20px;
|
color: #041f6c;
|
}
|
|
.term-date {
|
display: inline-block;
|
margin-left: 16px;
|
font-size: 12px;
|
padding: 2px 8px;
|
}
|
|
.term-date-value {
|
display: inline-block;
|
text-align: center;
|
padding: 0 8px;
|
font-size: 14px;
|
border-radius: 6px;
|
margin-right: 8px;
|
}
|
|
.drag-box-content {
|
width: 85px;
|
height: 41px;
|
background-image: url("./images/drag_img.png");
|
background-size: 100% 100%;
|
font-size: 14px;
|
padding-left: 40px;
|
box-sizing: border-box;
|
white-space: nowrap;
|
text-overflow-ellipsis: ellipsis;
|
cursor: pointer;
|
}
|
|
.dragging-box {
|
position: absolute;
|
top: 180px;
|
right: -55px;
|
z-index: 998;
|
}
|
|
.dragging-box:hover {
|
right: 0;
|
}
|
|
>>> .el-drawer.rtl.useful-tools {
|
padding: 0;
|
border: 1px solid #00feff;
|
}
|
.dialog-mac >>> .el-dialog__body {
|
background: #02195c;
|
}
|
</style>
|