|
@@ -506,17 +506,14 @@ async function getDeviceList() {
|
|
|
}
|
|
|
}
|
|
|
//tab选项切换
|
|
|
-async function onChangeTab(tab) {
|
|
|
+function onChangeTab(tab) {
|
|
|
activeKey.value = tab;
|
|
|
stationId.value = ''
|
|
|
if (activeKey.value == 'device') {
|
|
|
// clearTimeout(timer1);
|
|
|
- await getSubStationList();
|
|
|
- await getStationList1();
|
|
|
+ getSubStationList();
|
|
|
} else if (activeKey.value == 'history') {
|
|
|
- await getSubStationList();
|
|
|
- await getStationList();
|
|
|
- await getMonitor1();
|
|
|
+ getSubStationList();
|
|
|
} else {
|
|
|
getStationList();
|
|
|
getMonitor1();
|
|
@@ -711,6 +708,12 @@ async function getSubStationList() {
|
|
|
stationId.value = stationId.value ? stationId.value : cardList[0].id
|
|
|
openNum.value = cardList.value?.filter((v) => v.linkstatus == 1)['length'];
|
|
|
clsoeNum.value = cardList.value?.filter((v) => v.linkstatus == 0)['length'];
|
|
|
+ if (activeKey.value == 'device') {
|
|
|
+ getStationList1();
|
|
|
+ } else if (activeKey.value == 'history') {
|
|
|
+ getStationList();
|
|
|
+ getMonitor1();
|
|
|
+ }
|
|
|
} else {
|
|
|
cardList.value = [];
|
|
|
}
|
|
@@ -976,14 +979,12 @@ async function handleDelStation() {
|
|
|
console.log(res, '删除左侧分站')
|
|
|
if (res) {
|
|
|
getSubStationList();
|
|
|
- getStationList1();
|
|
|
}
|
|
|
}
|
|
|
//取消删除左侧分站
|
|
|
function handleCancelDelStation() { }
|
|
|
-onMounted(async () => {
|
|
|
- await getSubStationList();
|
|
|
- await getStationList1();
|
|
|
+onMounted(() => {
|
|
|
+ getSubStationList();
|
|
|
});
|
|
|
onUnmounted(() => {
|
|
|
if (timer) {
|