fix : 修复预览隧道时切换报错bug

This commit is contained in:
2024-09-02 15:45:01 +08:00
parent 02194afce4
commit 00a04d0d79
4 changed files with 100 additions and 225 deletions

View File

@@ -61,7 +61,7 @@
<div v-else class="shrink-right" @click="closeRight"></div>
</div>
<div class="switch-btn">
<div class="arrow" @click="previousBtn"></div>
<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">
@@ -113,7 +113,6 @@
<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 ? '已读' : '未读' }}
</el-tag>
@@ -485,7 +484,10 @@ const getTunnel = (id) => {
});
}
const changeTunnel = (e) => {
socket.close()
console.info("🚀 ~method:'socket' -----", socket)
if(socket){
socket.close()
}
let newObj = {}
tunnelList.value.forEach((item, index) => {
if (index === e) {
@@ -519,10 +521,14 @@ const manageSelect = (index) => {
router.push("/user/" + localStorage.getItem('currentSiteId'));
}
}
socket.close()
if(socket){
socket.close()
}
};
const handleChangeSite = debounce((item) => {
socket.close()
if(socket){
socket.close()
}
currentSite.value = item.label
currentSiteId.value = item.value
getTunnel(item.value)