trp:上一次代码提交冲突解决

This commit is contained in:
trp
2024-09-02 23:58:12 +08:00
5 changed files with 83 additions and 241 deletions

View File

@@ -125,15 +125,9 @@
<div v-else class="shrink-right" @click="closeRight"></div>
</div>
<div class="switch-btn">
<div class="arrow" @click="previousBtn"></div>
<el-carousel
height="150px"
type="card"
ref="tunnelBtn"
:autoplay="false"
:initial-index="initialIndex"
@change="changeTunnel"
>
<div class="arrow" @click="previousBtn"></div>{{initialIndex}}
<el-carousel height="150px" type="card" ref="tunnelBtn" :autoplay="false" :initial-index="initialIndex"
@change="changeTunnel">
<div class="btn">
<el-carousel-item v-for="item in tunnelList" :key="item.value">
{{ item.label }}
@@ -196,47 +190,16 @@
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<div
class="device-table"
:style="{ marginTop: roleKey === 'administrator' ? '40px' : '0' }"
>
<el-table
stripe
v-loading="loading"
:empty-text="tableEmptyText"
style="background-color: #011c29; --el-table-border-color: none"
:header-cell-style="{
backgroundColor: '#064B66',
color: '#fff',
fontSize: '40px',
borderBottom: 'none',
}"
:data="alarmList"
>
<el-table-column
prop="tunnelName"
label="隧道名称"
align="center"
width="400px"
/>
<el-table-column
prop="alarmContent"
label="告警信息"
align="center"
/>
<el-table-column
prop="alarmTime"
label="告警时间"
align="center"
width="480px"
/>
<el-table-column
prop="lookupStatus"
label="查阅状态"
align="center"
width="200px"
v-if="roleKey !== 'administrator'"
>
<div class="device-table" :style="{ marginTop: roleKey === 'administrator' ? '40px' : '0' }">
<el-table stripe v-loading="loading" :empty-text="tableEmptyText"
style="background-color: #011c29;--el-table-border-color: none;"
:header-cell-style="{ backgroundColor: '#064B66', color: '#fff', fontSize: '40px', borderBottom: 'none' }"
:data="alarmList">
<el-table-column prop="tunnelName" label="隧道名称" align="center" width="400px" />
<el-table-column prop="alarmContent" label="告警信息" align="center" />
<el-table-column prop="alarmTime" label="告警时间" align="center" width="480px" />
<el-table-column prop="lookupStatus" label="查阅状态" align="center" width="200px"
v-if="roleKey !== 'administrator'">
<template #default="scope">
<el-tag :type="scope.row.lookupStatus ? 'success' : 'warning'"
>{{ scope.row.lookupStatus ? "已读" : "未读" }}
@@ -633,8 +596,11 @@ const getTunnel = (id) => {
});
};
const changeTunnel = (e) => {
socket.close();
let newObj = {};
console.info("🚀 ~method:'socket' -----", socket)
if(socket){
socket.close()
}
let newObj = {}
tunnelList.value.forEach((item, index) => {
if (index === e) {
newObj = item;
@@ -670,14 +636,18 @@ const manageSelect = (index) => {
router.push("/user/" + localStorage.getItem("currentSiteId"));
}
}
socket.close();
if(socket){
socket.close()
}
};
const handleChangeSite = debounce((item) => {
socket.close();
currentSite.value = item.label;
currentSiteId.value = item.value;
getTunnel(item.value);
showFan.value = false;
if(socket){
socket.close()
}
currentSite.value = item.label
currentSiteId.value = item.value
getTunnel(item.value)
showFan.value = false
nextTick(() => {
showFan.value = true;
});