Commit 650387f1 authored by yanzhongrong's avatar yanzhongrong

cell style audio

parent b2eb3224
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div id="app"> <div id="app">
<router-view /> <router-view />
<audio ref="audio" id="my_audio" src="./assets/audio/19000.wav" controls autoplay hidden="hidden"/> <audio ref="audio" id="my_audio" src="./assets/audio/urgent.wav" muted autoplay />
<transition name="tipalerm"> <transition name="tipalerm">
<div class="tips" v-if="tflag"> <div class="tips" v-if="tflag">
<p>提示</p> <p>提示</p>
...@@ -33,6 +33,12 @@ export default { ...@@ -33,6 +33,12 @@ export default {
alevel: { alevel: {
color: "", color: "",
}, },
audioUrl: '',
audioObj: {
'一般': 'commonly.wav',
'重要': 'importang.wav',
'紧急': 'urgent.wav',
}
}; };
}, },
computed: { computed: {
...@@ -65,13 +71,13 @@ export default { ...@@ -65,13 +71,13 @@ export default {
}, },
mounted() { mounted() {
let audioPlay = document.getElementById("my_audio"); let audioPlay = document.getElementById("my_audio");
// this.websocket = socket({
// onmessage: this.receiveMessage,
// });
EventBus.$on("dialogAlarm", (data) => { EventBus.$on("dialogAlarm", (data) => {
// 接收消息之后 声音弹窗显示 // 接收消息之后 声音弹窗显示
audioPlay.play();
this.msg = data; this.msg = data;
this.audioUrl = './assets/audio/' + this.audioObj[data.level]
setTimeout(() => {
audioPlay.play();
},500)
this.levelcolor(); this.levelcolor();
this.tflag = true; this.tflag = true;
...@@ -83,10 +89,6 @@ export default { ...@@ -83,10 +89,6 @@ export default {
this.websocket.close(); this.websocket.close();
console.log('关闭ws'); console.log('关闭ws');
}); });
// EventBus.$on("wsOpen", () => {
// audioPlay.play()
// // this.websocket.onopen();
// });
}, },
watch: { watch: {
$route(to, from) { $route(to, from) {
......
...@@ -7,4 +7,11 @@ export const alarmLeval = { ...@@ -7,4 +7,11 @@ export const alarmLeval = {
export const ConnectStatusEnum = { export const ConnectStatusEnum = {
0: '连接正常', 0: '连接正常',
1: '连接异常' 1: '连接异常'
}
export const levelStyle = {
'-1': 'level_G',
'0': 'level_Y',
'1': 'level_O',
'2': 'level_R',
} }
\ No newline at end of file
This diff is collapsed.
...@@ -31,16 +31,12 @@ ...@@ -31,16 +31,12 @@
.flex_clo { .flex_clo {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
// height: 880px;
} }
// .leakage-box{
// height: 60px;
// }
.leakage-cable .leakage-top{ .leakage-cable .leakage-top{
padding-right: 10px; padding-right: 10px;
} }
.el-button-group{ .el-button-group{
position: absolute; position: absolute;
} }
...@@ -111,3 +107,19 @@ ...@@ -111,3 +107,19 @@
min-width:52px; min-width:52px;
} }
.level_G {
color: #00D100;
}
.level_R {
color: #FF1744;
}
.level_O {
color: #FF6D00;
}
.level_Y {
color: #FFAB00;
}
...@@ -53,8 +53,8 @@ ...@@ -53,8 +53,8 @@
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="(item, index) in scope.row.alarmInfo" :key="index"> <div v-for="(item, index) in scope.row.alarmInfo" :key="index" :class="levelStyle[item.level]">
<span>距离:{{ item.distance }}</span> <span>距离:{{ item.distance }}</span>&nbsp;&nbsp;
<span>驻波比:{{ item.value }}</span> <span>驻波比:{{ item.value }}</span>
</div> </div>
<div>漏缆百米损耗: {{ scope.row.lossValue }}</div> <div>漏缆百米损耗: {{ scope.row.lossValue }}</div>
...@@ -184,6 +184,7 @@ import { exportLeakyCable } from "@/api/export"; ...@@ -184,6 +184,7 @@ import { exportLeakyCable } from "@/api/export";
import search from "@/views/monitor/leakageCable/components/search.vue"; import search from "@/views/monitor/leakageCable/components/search.vue";
import download from "@/utils/download"; import download from "@/utils/download";
import { successAlert, warningAlert } from "@/utils/alert"; import { successAlert, warningAlert } from "@/utils/alert";
import { levelStyle } from '@/const/index'
export default { export default {
data() { data() {
return { return {
...@@ -210,6 +211,7 @@ export default { ...@@ -210,6 +211,7 @@ export default {
istrue: 0, istrue: 0,
searchOption: {}, searchOption: {},
exids: [], exids: [],
levelStyle
}; };
}, },
components: { search }, components: { search },
...@@ -253,14 +255,14 @@ export default { ...@@ -253,14 +255,14 @@ export default {
cableTimeList(param).then((res) => { cableTimeList(param).then((res) => {
let list = res.records || []; let list = res.records || [];
list.forEach(item => { list.forEach(item => {
if(item.alarmInfo != '') { if(item.alarmInfo != '' && item.alarmInfo != null) {
item.alarmInfo = JSON.parse(item.alarmInfo) item.alarmInfo = JSON.parse(item.alarmInfo)
item.lossValue = eval(item.alarmInfo.map(k => k.lossValue).join('+')) item.lossValue = eval(item.alarmInfo.map(k => k.lossValue).join('+'))
} }
}); });
this.tableData = list; this.tableData = list;
this.total = res.total; this.total = res.total;
this.exids = list.map((i) => i.id); this.exids = list.map(i => i.id);
if (this.istrue == 1) { if (this.istrue == 1) {
if (this.tableData.length != 0) { if (this.tableData.length != 0) {
successAlert("操作成功"); successAlert("操作成功");
...@@ -312,10 +314,6 @@ export default { ...@@ -312,10 +314,6 @@ export default {
} }
}, },
}, },
computed: {
},
watch: {
},
mounted() { mounted() {
this.getTableData(); this.getTableData();
}, },
......
...@@ -251,7 +251,6 @@ export default { ...@@ -251,7 +251,6 @@ export default {
data() { data() {
return { return {
colspan:14, colspan:14,
}; };
}, },
mixins: [DetailMixins], mixins: [DetailMixins],
......
...@@ -39,6 +39,13 @@ ...@@ -39,6 +39,13 @@
> >
</el-table-column> </el-table-column>
<el-table-column prop="alarmInfo" label="告警信息" align="center"> <el-table-column prop="alarmInfo" label="告警信息" align="center">
<template slot-scope="scope">
<div v-for="(item, index) in scope.row.alarmInfo" :key="index" :class="levelStyle[item.level]">
<span>距离:{{ item.distance }}</span>&nbsp;&nbsp;
<span>驻波比:{{ item.value }}</span>
</div>
<div>漏缆百米损耗: {{ scope.row.lossValue }}</div>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="lateUploadTime" prop="lateUploadTime"
...@@ -57,8 +64,8 @@ ...@@ -57,8 +64,8 @@
</template> </template>
<script> <script>
import { CableStatusList, CableStatusExport } from "../api"; import { CableStatusList } from "../api";
import { ConnectStatusEnum } from "@/const/index"; import { ConnectStatusEnum, levelStyle} from "@/const/index";
import search from "./components/search.vue"; import search from "./components/search.vue";
import { exportLeakyCableTime } from "@/api/export"; import { exportLeakyCableTime } from "@/api/export";
import download from "@/utils/download"; import download from "@/utils/download";
...@@ -67,6 +74,7 @@ export default { ...@@ -67,6 +74,7 @@ export default {
data() { data() {
return { return {
ConnectStatusEnum, ConnectStatusEnum,
levelStyle,
params: { params: {
curent: 1, curent: 1,
size: 10, size: 10,
...@@ -120,8 +128,14 @@ export default { ...@@ -120,8 +128,14 @@ export default {
CableStatusList(params).then((res) => { CableStatusList(params).then((res) => {
let list = res.records || []; let list = res.records || [];
this.tableData = list; this.tableData = list;
list.forEach(item => {
if(item.alarmInfo != '' && item.alarmInfo != null) {
item.alarmInfo = JSON.parse(item.alarmInfo)
item.lossValue = eval(item.alarmInfo.map(k => k.lossValue).join('+'))
}
});
this.total = res.records.length; this.total = res.records.length;
this.exids = list.map((i) => i.id); this.exids = list.map(i => i.id);
if (this.istrue==1) { if (this.istrue==1) {
if (this.tableData.length != 0) { if (this.tableData.length != 0) {
successAlert("操作成功"); successAlert("操作成功");
...@@ -133,10 +147,6 @@ export default { ...@@ -133,10 +147,6 @@ export default {
}); });
}, },
toExport() { toExport() {
let params = {
...this.params,
...this.searchOption,
};
if (this.exids.length == 0) { if (this.exids.length == 0) {
this.$message.warning("暂无数据"); this.$message.warning("暂无数据");
return false; return false;
......
...@@ -165,9 +165,9 @@ export default { ...@@ -165,9 +165,9 @@ export default {
antennaFeederLength: [ antennaFeederLength: [
{ required: true, message: "请输入天馈线长度", trigger: "blur" }, { required: true, message: "请输入天馈线长度", trigger: "blur" },
], ],
hundredMetersLoss: [ // hundredMetersLoss: [
{ required: true, message: "请输入漏缆百米损耗", trigger: "blur" }, // { required: true, message: "请输入漏缆百米损耗", trigger: "blur" },
], // ],
inserterLength: [ inserterLength: [
{ required: true, message: "请输入插入器长度", trigger: "blur" }, { required: true, message: "请输入插入器长度", trigger: "blur" },
], ],
......
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