Commit 11907e95 authored by co_dengxiongwen's avatar co_dengxiongwen

tj

parent 826ccb50
......@@ -2,11 +2,7 @@
<div id="app">
<router-view v-if="isRouterAlive" />
<div>
<div
v-for="(item, index) in showList"
:key="index"
v-if="index < 4 && ishowAlarm"
>
<div v-for="(item, index) in showList" :key="index" v-if="index < 4">
<div :class="'tip' + (index + 1)">
<div class="title">
<el-row :span="24">
......@@ -104,7 +100,6 @@ export default {
data() {
return {
is3DShow: false,
ishowAlarm: true,
dialogVisible: false,
isRouterAlive: true,
queryDetailVisible: false,
......@@ -117,10 +112,10 @@ export default {
watch: {},
computed: {},
mounted() {
//let token = util.cookies.get('token')
this.initWebSocket()
this.initWebSocket2()
this.getDateList()
this.getDateList2()
},
destroyed: function() {
this.websocketclose()
......@@ -169,24 +164,14 @@ export default {
},
//接收后端返回的数据
websocketonmessage(e) {
console.log('takeover:', sessionStorage.getItem('takeover'))
if (
sessionStorage.getItem('takeover') != undefined &&
sessionStorage.getItem('takeover') == 'true'
) {
this.ishowAlarm = false
} else {
this.ishowAlarm = true
}
// 在这里使用后端返回的数据,对数据进行处理渲染
// this.tipList = []
this.showList = []
if (
sessionStorage.getItem('token') &&
sessionStorage.getItem('token') != undefined
sessionStorage.getItem('token') !== undefined
) {
// if (util.cookies.get('token') && util.cookies.get('token') != undefined) { //登录才能获取
// this.tipList = JSON.parse(e.data)
//登录才能获取
var alarmsInfo = JSON.parse(e.data)
//console.log(alarmsInfo, '-------')
if (alarmsInfo.status != 1) {
......@@ -206,7 +191,6 @@ export default {
}
}
this.tipList.push(alarmsInfo)
// this.sendMessage(alarmsInfo.resourceCode)
if (flag) {
var x = 0
var resourceCode = this.$store.state.d2admin.bjCode.resourceCode
......@@ -214,30 +198,19 @@ export default {
if (
resourceCode &&
resourceCode.split('+')[0] === alarmsInfo.resourceCode &&
resourceCode.split('+')[2] === alarmsInfo.lineId &&
resourceCode.split('+')[3] === alarmsInfo.stationId
resourceCode.split('+')[2] === alarmsInfo.stationId
) {
x =
Number(resourceCode.substring(resourceCode.indexOf('+') + 1)) +
1
this.$store.dispatch(
'd2admin/bjCode/set',
alarmsInfo.resourceCode +
'+' +
x +
'+' +
alarmsInfo.lineId +
'+' +
alarmsInfo.stationId
alarmsInfo.resourceCode + '+' + x + '+' + alarmsInfo.stationId
)
} else {
this.$store.dispatch(
'd2admin/bjCode/set',
alarmsInfo.resourceCode +
'+0+' +
alarmsInfo.lineId +
'+' +
alarmsInfo.stationId
alarmsInfo.resourceCode + '+0+' + alarmsInfo.stationId
)
}
}
......@@ -286,10 +259,6 @@ export default {
websocketclose(e) {
console.log('断开连接', e)
},
send() {
this.websock.send('1')
},
// ====================================
//初始化weosocket2
initWebSocket2() {
......@@ -332,12 +301,10 @@ export default {
sessionStorage.getItem('token') &&
sessionStorage.getItem('token') != undefined
) {
var paramsInfo = JSON.parse(e.data)
console.log('paramsInfo:', paramsInfo)
// 集合
// this.$store.dispatch('d2admin/typeList/set', e.typeList)
//登录才能获取
// this.tipList = JSON.parse(e.data)
console.log('接管数据' + e.data)
this.$store.dispatch('d2admin/typeList/set', paramsInfo)
}
},
//连接建立失败重连
......@@ -349,24 +316,19 @@ export default {
websocketclose2(e) {
console.log('断开连接2', e)
},
send2() {
this.websock.send('2')
},
//登录后页面刷新的时候获取
getDateList() {
this.tipList = []
this.showList = []
if (
sessionStorage.getItem('token') &&
sessionStorage.getItem('token') != undefined
sessionStorage.getItem('token') !== undefined
) {
this.$http({
url: this.$http.adornUrlAlarm('/alarmsInfo/queryList'),
method: 'post',
params: this.$http.adornParams({
status: 1,
stationId: localStorage.getItem('stationId')
status: 1
})
}).then((data) => {
if (data && data.code === 0) {
......@@ -384,15 +346,28 @@ export default {
if (this.showList) {
this.showList.sort(this.sortBy('occurrenceTime', true))
}
// console.log(this.tipList, '-------')
// console.log(this.showList, '-------')
//console.log(this.showList, '1----------1')
this.$store.dispatch('d2admin/toast/set', this.tipList.length)
}
})
}
},
getDateList2() {
if (
sessionStorage.getItem('token') &&
sessionStorage.getItem('token') !== undefined
) {
this.$http({
url: this.$http.adornUrlAlarm('/kanban/getListParam'),
method: 'post',
params: this.$http.adornParams({})
}).then((data) => {
if (data && data.code === 0) {
console.log('typeList:', data.bean)
this.$store.dispatch('d2admin/typeList/set', data.bean)
}
})
}
},
/**数组根据数组对象中的某个属性值进行排序的方法
* 使用例子:newArray.sort(sortBy('number',false)) //表示根据number属性降序排列;若第二个参数不传递,默认表示升序排序
* @param attr 排序的属性 如number属性
......@@ -473,24 +448,6 @@ export default {
background-color: #b9c9e3 !important;
}
// 状态-点
// .danger,
// .success,
// .warning {
// width: 5px;
// height: 5px;
// border-radius: 100%;
// background: #ff3723;
// display: inline-block;
// vertical-align: middle;
// }
// .success {
// background: #42cd00;
// }
// .warning {
// background: #ffa101;
// }
// 弹出框
.el-dialog__title {
line-height: 24px;
......
This diff is collapsed.
......@@ -39,119 +39,118 @@ export default {
mapId: '',
mapList: [],
dataList: [
{
name: '喷淋系统',
list: [
{
leftName: '喷淋系统',
rightName: '水流压力',
type: 'slyl',
value: '0.319mp',
scope: '参考值:0.2~0.8mp'
}
]
},
{
name: '喷淋系统',
list: [
{
leftName: '喷淋系统',
rightName: '一氧化碳',
type: 'co',
value: '22.5℃',
scope: '参考值:0.0~50℃'
},
{
leftName: '喷淋系统',
rightName: '湿度',
type: 'sd',
value: '22.5℃',
scope: '参考值:0.0~50℃'
},
{
leftName: '喷淋系统',
rightName: '风速',
type: 'fs',
value: '22.5℃',
scope: '参考值:0.0~50℃'
},
{
leftName: '喷淋系统',
rightName: '风速',
type: 'fs',
value: '22.5℃',
scope: '参考值:0.0~50℃'
}
]
},
{
name: '喷淋系统',
list: [
{
leftName: '喷淋系统',
rightName: '风压',
type: 'fy',
value: '0.319mp',
scope: '参考值:0.2~0.8mp'
},
{
leftName: '喷淋系统',
rightName: '泵房温度',
type: 'wd',
value: '22.5℃',
scope: '参考值:0.0~50℃'
},
{
leftName: '喷淋系统',
rightName: '水位高度',
type: 'swgd',
value: '22.5℃',
scope: '参考值:0.0~50℃'
},
{
leftName: '喷淋系统',
rightName: '水位高度',
type: 'swgd',
value: '22.5℃',
scope: '参考值:0.0~50℃'
}
]
},
{
name: '喷淋系统',
list: [
{
leftName: '喷淋系统',
rightName: '水流压力',
type: 'slyl',
value: '0.319mp',
scope: '参考值:0.2~0.8mp'
},
{
leftName: '喷淋系统',
rightName: '泵房温度',
type: 'wdh',
value: '60.5℃',
over: true,
scope: '参考值:0.0~50℃'
},
{
leftName: '喷淋系统',
rightName: '水位高度',
type: 'swgd',
value: '22.5℃',
scope: '参考值:0.0~50℃'
},
{
leftName: '喷淋系统',
rightName: '水位高度',
type: 'swgd',
value: '22.5℃',
scope: '参考值:0.0~50℃'
}
]
}
// {
// name: '喷淋系统',
// list: [
// {
// leftName: '喷淋系统',
// rightName: '水流压力',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// }
// ]
// },
// {
// name: '喷淋系统',
// list: [
// {
// leftName: '喷淋系统',
// rightName: '一氧化碳',
// type: 'co',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '湿度',
// type: 'sd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '风速',
// type: 'fs',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '风速',
// type: 'fs',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// }
// ]
// },
// {
// name: '喷淋系统',
// list: [
// {
// leftName: '喷淋系统',
// rightName: '风压',
// type: 'fy',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// },
// {
// leftName: '喷淋系统',
// rightName: '泵房温度',
// type: 'wd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '水位高度',
// type: 'swgd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '水位高度',
// type: 'swgd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// }
// ]
// },
// {
// name: '喷淋系统',
// list: [
// {
// leftName: '喷淋系统',
// rightName: '水流压力',
// type: 'slyl',
// value: '0.319mp',
// scope: '参考值:0.2~0.8mp'
// },
// {
// leftName: '喷淋系统',
// rightName: '泵房温度',
// type: 'wdh',
// value: '60.5℃',
// over: true,
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '水位高度',
// type: 'swgd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// },
// {
// leftName: '喷淋系统',
// rightName: '水位高度',
// type: 'swgd',
// value: '22.5℃',
// scope: '参考值:0.0~50℃'
// }
// ]
// }
]
}
},
......
......@@ -231,6 +231,7 @@ service.interceptors.response.use(
sessionStorage.removeItem('uuid')
if (this) {
this.$parent.getDateList()
this.$parent.getDateList2()
//清空接管提示框
// this.$store.dispatch('d2admin/takeover/setTakeover', null)
}
......
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