|
@@ -7,7 +7,7 @@
|
|
|
<div class="card-head">
|
|
<div class="card-head">
|
|
|
<div class="card-title">
|
|
<div class="card-title">
|
|
|
设备状态总览
|
|
设备状态总览
|
|
|
- <span class="title-sub">按片区聚合 · 设备点阵(3s 刷新)</span>
|
|
|
|
|
|
|
+ <span class="title-sub">按片区聚合 · 设备点阵</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="row gap8 wrap">
|
|
<div class="row gap8 wrap">
|
|
|
<el-input
|
|
<el-input
|
|
@@ -18,6 +18,7 @@
|
|
|
@keyup.enter="locateDevice"
|
|
@keyup.enter="locateDevice"
|
|
|
/>
|
|
/>
|
|
|
<el-button type="primary" :loading="locateLoading" @click="locateDevice">定位</el-button>
|
|
<el-button type="primary" :loading="locateLoading" @click="locateDevice">定位</el-button>
|
|
|
|
|
+ <el-button type="primary" plain size="small" :icon="Refresh" :loading="refreshing" @click="refreshAll">刷新</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -257,7 +258,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { computed, onBeforeUnmount, onMounted, reactive, ref } from "vue";
|
|
|
|
|
|
|
+import { computed, onMounted, reactive, ref } from "vue";
|
|
|
|
|
+import { Refresh } from "@element-plus/icons-vue";
|
|
|
import { getEquipmentStatusStatistics, listEquipmentTypeAll } from "@/api/pipeNetwork/pdeviceInform";
|
|
import { getEquipmentStatusStatistics, listEquipmentTypeAll } from "@/api/pipeNetwork/pdeviceInform";
|
|
|
import {
|
|
import {
|
|
|
pagePerceptionEquipment,
|
|
pagePerceptionEquipment,
|
|
@@ -270,6 +272,7 @@ import { buildMinioAttachmentUrl } from "@/utils/minioAttachment";
|
|
|
import { indicatorName, loadIndicatorNames } from "@/utils/warningIndicator";
|
|
import { indicatorName, loadIndicatorNames } from "@/utils/warningIndicator";
|
|
|
|
|
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
|
|
+const refreshing = ref(false);
|
|
|
const stats = ref({});
|
|
const stats = ref({});
|
|
|
const equipmentList = ref([]);
|
|
const equipmentList = ref([]);
|
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
@@ -295,7 +298,6 @@ const profileOpen = ref(false);
|
|
|
const profileLoading = ref(false);
|
|
const profileLoading = ref(false);
|
|
|
const profile = ref({ base: null, records: [], indicators: [], origCollTable: "", recordView: { columns: [], rows: [] } });
|
|
const profile = ref({ base: null, records: [], indicators: [], origCollTable: "", recordView: { columns: [], rows: [] } });
|
|
|
const currentProfileId = ref("");
|
|
const currentProfileId = ref("");
|
|
|
-let refreshTimer = null;
|
|
|
|
|
|
|
|
|
|
const districtOptions = [
|
|
const districtOptions = [
|
|
|
{ value: 0, label: "城南" },
|
|
{ value: 0, label: "城南" },
|
|
@@ -525,12 +527,19 @@ function refreshProfile() {
|
|
|
loadProfile(currentProfileId.value);
|
|
loadProfile(currentProfileId.value);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function refreshAll() {
|
|
|
|
|
- loadStatistics();
|
|
|
|
|
- loadEquipment();
|
|
|
|
|
- loadAreaRank();
|
|
|
|
|
- loadAlarmTypeDist();
|
|
|
|
|
- loadAlarms();
|
|
|
|
|
|
|
+async function refreshAll() {
|
|
|
|
|
+ refreshing.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ await Promise.allSettled([
|
|
|
|
|
+ loadStatistics(),
|
|
|
|
|
+ loadEquipment(),
|
|
|
|
|
+ loadAreaRank(),
|
|
|
|
|
+ loadAlarmTypeDist(),
|
|
|
|
|
+ loadAlarms()
|
|
|
|
|
+ ]);
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ refreshing.value = false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function loadTypeOptions() {
|
|
function loadTypeOptions() {
|
|
@@ -543,11 +552,6 @@ onMounted(() => {
|
|
|
loadIndicatorNames();
|
|
loadIndicatorNames();
|
|
|
loadTypeOptions();
|
|
loadTypeOptions();
|
|
|
refreshAll();
|
|
refreshAll();
|
|
|
- refreshTimer = setInterval(refreshAll, 3000);
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-onBeforeUnmount(() => {
|
|
|
|
|
- if (refreshTimer) clearInterval(refreshTimer);
|
|
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|