Commit ac3bf6e4 authored by neogcg's avatar neogcg

Merge branch 'dev_gcg' into dev

parents cd221e90 0eb7b9ea
<template>
<div id="app">
<router-view />
<!-- <audio ref="audio" id="my_audio" src="./assets/audio/19000.wav" controls autoplay hidden="hidden"/> -->
<router-view />
<audio ref="audio" id="my_audio" src="./assets/audio/19000.wav" controls autoplay hidden="hidden"/>
<transition name="tipalerm">
<div class="tips" v-if="tflag">
<p>提示</p>
......@@ -64,16 +65,15 @@ export default {
},
mounted() {
let audioPlay = document.getElementById("my_audio");
this.websocket = socket({
onmessage: this.receiveMessage,
});
// this.websocket = socket({
// onmessage: this.receiveMessage,
// });
EventBus.$on("dialogAlarm", (data) => {
// 接收消息之后 声音弹窗显示
// audioPlay.play();
audioPlay.play();
this.msg = data;
this.levelcolor();
// console.log(data);
this.tflag = true;
setTimeout(() => {
this.tflag = false;
......@@ -91,33 +91,27 @@ export default {
watch: {
$route(to, from) {
if (to.path == "/login") {
setTimeout( this.websocket.close(), 500)
setTimeout(this.closeWebsocket(),300)
// this.websocket.close()
console.log("在登录页");
}
},
usertoken: {
immediate: true,
handler(newV) {
if (newV) {
this.closeWebsocket();
this.websocket = socket({
if (newV != '') {
this.websocket = socket({
onmessage: this.receiveMessage,
});
} else{
this.closeWebsocket();
}
}
},
},
// userId: {
// immediate: true,
// handler(newV) {
// if (newV) {
// this.closeWebsocket();
// this.websocket = socket({
// onmessage: this.receiveMessage,
// });
// }
// },
// },
},
};
</script>
......
<template>
<section class="app-main">
<transition name="fade-transform" mode="out-in">
<router-view :key="key" />
<!-- <keep-alive include="Dashboard"> -->
<router-view :key="key" />
<!-- </keep-alive> -->
</transition>
</section>
</template>
......
......@@ -96,7 +96,11 @@ export default {
<style lang="scss" scoped>
.navbar {
overflow: hidden;
position: relative;
position: fixed;
top: 0;
left: 0;
z-index: 5;
width: 100%;
background: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08);
.log {
......
......@@ -53,7 +53,7 @@ export const constantRoutes = [
path: 'dashboard',
name: 'Dashboard',
component: () => import('@/views/dashboard/index'),
meta: { title: '首页', icon: 'homePage' }
meta: { title: '首页', icon: 'homePage'}
}]
},
{
......@@ -73,7 +73,7 @@ export const constantRoutes = [
path: 'device',
name: 'device',
component: () => import('@/views/alarm/device/index'),
meta: { title: '设备连接告警' }
meta: { title: '设备连接告警'}
}
]
},
......
......@@ -51,7 +51,7 @@
prop="alarmInfo"
label="告警信息"
align="center"
width="200"
width="160"
>
</el-table-column>
<el-table-column
......@@ -66,7 +66,7 @@
align="center"
width="105"
/>
<el-table-column prop="confirmPerson" label="确认人" align="center" />
<el-table-column prop="confirmPerson" label="确认人" align="center" width="100" />
<el-table-column prop="confirmTime" label="确认时间" align="center" />
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
......
......@@ -140,6 +140,7 @@ import search from "./components/search.vue";
import download from "@/utils/download";
import { successAlert, warningAlert } from "@/utils/alert";
export default {
name:'device',
data() {
return {
alarmInfo: "",
......
......@@ -67,20 +67,22 @@ export const DetailMixins = {
levelcolor() {
let la = document.getElementsByClassName("levelData");
for (var i = 0; i < this.statusList.length; i++) {
if (la[i].innerHTML == "连接正常") {
if (this.statusList[i].value == "连接正常") {
la[i].style.color = "green";
} else if (la[i].innerHTML == "连接异常") {
la[i].innerHTML = "连接正常"
} if (this.statusList[i].value == "连接异常") {
la[i].style.color = "#f00";
la[i].innerHTML = "告警"
} else if (la[i].innerHTML == "正常") {
} if (this.statusList[i].value == "正常") {
la[i].style.color = "green";
} else if (la[i].innerHTML == "紧急") {
la[i].innerHTML = "正常"
} if (this.statusList[i].value == "紧急") {
la[i].style.color = "#f00";
la[i].innerHTML = "紧急告警"
} else if (la[i].innerHTML == "重要") {
} if (this.statusList[i].value == "重要") {
la[i].style.color = "#f89850";
la[i].innerHTML = "重要告警"
} else if (la[i].innerHTML == "一般") {
} if (this.statusList[i].value == "一般") {
la[i].style.color = "#ead906";
la[i].innerHTML = "一般告警"
}
......
......@@ -52,7 +52,7 @@
<el-row :gutter="20">
<el-col :span="10" class="value_handle" :style="acolor3">{{form.status.connectAlarm}}</el-col>
<el-col :span="10"
><el-button class="alarmbtn" type="primary" size="mini" v-if="form.status.connectAlarm == '告警'"
><el-button class="alarmbtn" type="primary" size="mini" v-if="form.status.connectAlarm == '告警' || form.status.connectAlarm == '连接异常'"
@click="toalarm(form.status.connectAlarm)">处理告警</el-button></el-col>
</el-row>
</el-col>
......@@ -273,7 +273,7 @@ export default {
this.$message.success("修改成功");
});
},
levelcolor2() {
waylevelcolor() {
if (this.form.status.monitorAlarm == '正常') {
this.acolor.color = 'green'
} else if (this.form.status.monitorAlarm == '紧急') {
......@@ -287,7 +287,7 @@ export default {
this.form.status.monitorAlarm = '一般告警'
}
},
levelcolor3() {
waylevelcolor2() {
if (this.form.status.connectAlarm == '连接正常') {
this.acolor3.color = 'green'
} else if (this.form.status.connectAlarm == '连接异常') {
......@@ -322,8 +322,8 @@ export default {
immediate: true,
handler(newV) {
if (newV) {
this.levelcolor2()
this.levelcolor3()
this.waylevelcolor()
this.waylevelcolor2()
}
},
},
......
......@@ -213,6 +213,7 @@
></el-col
>
</el-row>
</div>
</el-card>
</el-col>
......@@ -245,17 +246,18 @@ export default {
for (var i = 0; i < this.statusAlarmfun.length; i++) {
if (la[i].innerHTML == "连接正常") {
la[i].style.color = "green";
} else if (la[i].innerHTML == "连接异常") {
la[i].innerHTML = "连接正常"
} if (la[i].innerHTML == "连接异常") {
la[i].style.color = "#f00";
la[i].innerHTML = "告警"
} else if (la[i].innerHTML == "正常") {
} if (la[i].innerHTML == "正常") {
la[i].style.color = "green";
} else if (la[i].innerHTML == "紧急") {
} if (la[i].innerHTML == "紧急") {
la[i].style.color = "#f00";
} else if (la[i].innerHTML == "重要") {
} if (la[i].innerHTML == "重要") {
la[i].style.color = "#f89850";
la[i].innerHTML = "重要告警"
} else if (la[i].innerHTML == "一般") {
} if (la[i].innerHTML == "一般") {
la[i].style.color = "#ead906";
la[i].innerHTML = "一般告警"
}
......
......@@ -223,12 +223,12 @@
</div>
<div>
<!-- === -->
<el-row class="text" :gutter="24">
<el-row v-if="statusl.length!=0" class="text" :gutter="24">
<el-col :span="10">
<div class="item_name">漏缆状态</div>
</el-col>
<el-col :span="8">
<div class="item_data levelData" :style="acolor" v-if="statusl.length!=0">{{ this.statusl[0].value }}</div>
<div class="item_data levelData" :style="acolor" >{{ this.statusl[0].value }}</div>
</el-col>
<el-col :span="6" >
<el-button class="alarmbtn" type="primary" size="mini"
......@@ -269,8 +269,8 @@
</div>
</el-col>
<el-col :span="6" >
<el-button class="picbtn" type="success" size="mini" @click="isQuery = !isQuery">生成图形</el-button>
<el-button class="picbtn" type="success" size="mini" @click="trans()">生成图形</el-button>
<el-button class="picbtn" type="success" size="mini" >生成图形</el-button>
</el-col>
</el-row>
</div>
......@@ -284,29 +284,15 @@
import { DetailMixins } from "./mixins";
import { leakyCableOpen } from "../api";
export default {
name: "Dashboard",
data() {
return {
isQuery: false,
colspan:14,
acolor:{
color:""
},
leakyList: [],
timeStatus: {},
testasd:[
{name: "设备状态",value: "紧急"},
{name: "时间",value: "2022-12-14"},
{name: "距离",value: "01"},
{name: "驻波比",value: "1"},
{name: "距离",value: "02"},
{name: "驻波比",value: "2"},
{name: "距离",value: "03"},
{name: "驻波比",value: "3"},
{name: "距离",value: "04"},
{name: "驻波比",value: "4"},
],
zhubobi:[],
long:[],
statusl:[]
......@@ -325,7 +311,7 @@ export default {
this.$message.success("修改成功");
});
},
levelcolor2() {
leakylevelcolor() {
if (this.timeStatus.level == '正常') {
this.acolor.color = 'green'
} else if (this.timeStatus.level == '紧急') {
......@@ -389,7 +375,7 @@ export default {
if (newV) {
this.trans();
this.$nextTick(function () {
// this.levelcolor2();
this.leakylevelcolor();
});
}
},
......
......@@ -89,6 +89,8 @@ export default {
return "important";
} else if (row.alarmLevelName == "一般" && column.label == "告警级别") {
return "common";
} else if (row.alarmLevelName == "正常" && column.label == "告警级别") {
return "normal"
}
if (rowIndex % 2 == 1) {
return "stripe";
......@@ -186,6 +188,9 @@ export default {
& ::v-deep .common {
background-color: #ead906;
}
& ::v-deep .normal {
background-color: green;
}
.page {
display: flex;
align-items: center;
......
......@@ -122,8 +122,8 @@ export default {
.content {
border: 1px solid #e3e3e3;
border-radius: 10px;
height: 700px;
overflow-y: scroll;
// height: 700px;
// overflow-y: scroll;
.content-title {
width: 100%;
height: 60px;
......
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