baoshiwei
2025-05-06 8dd7af51db4cf768fbf92002b5b62f7fb9d1c929
zhitan-vue/src/views/realtimemonitor/realtimemonitor/realtimemonitor.vue
@@ -2,7 +2,7 @@
  <div class="page">
    <div class="page-container">
      <div class="page-container-left">
        <LeftTree ref="leftTreeRef" @handleNodeClick="handleNodeClick" />
        <LeftTree ref="leftTreeRef" @handleNodeClick="handleNodeClick" ParentModelCode="LBJT" />
      </div>
      <div class="page-container-right">
        <div class="form-card">
@@ -128,6 +128,7 @@
const energyTypeList = ref(undefined)
let energyRealTimeMonitorList = ref([])
const loading = ref(false)
const tabIndex = ref(0)
const data = reactive({
  queryParams: {
    nodeId: null,
@@ -137,6 +138,39 @@
  query: { ...useRoute().query },
})
const { queryParams, query } = toRefs(data)
const refresher = () => {
  console.log("refresher")
  listEnergyRealTimeMonitor(
      proxy.addDateRange({
        ...queryParams.value,
        ...query.value,
      })
  ).then((res) => {
    if (!!res.code && res.code == 200) {
      res.data.map((item) => {
        item.activeIndex = tabIndex.value
      })
      energyRealTimeMonitorList.value = res.data
    }
  })
}
// 添加定时器
let refreshTimer = null
onMounted(() => {
  refreshTimer = setInterval(() => {
    refresher()
  }, 30000)
})
onBeforeUnmount(() => {
  if (refreshTimer) {
    clearInterval(refreshTimer)
  }
})
/** 节点单击事件 */
function handleNodeClick(data) {
  queryParams.value.nodeId = data.id
@@ -149,6 +183,7 @@
}
function handleClick(item, index) {
  item.activeIndex = index
  tabIndex.value = index
}
// 能源实时监控-能源实时监控-列表
function getList() {
@@ -207,8 +242,8 @@
      text-align: left;
      font-weight: bold;
      font-family: OPPOSans, OPPOSans;
      font-weight: 500;
      font-size: 16px;
      font-size: 14px;
      font-style: normal;
      text-transform: none;
    }
@@ -233,8 +268,8 @@
      .title {
        color: rgba(255, 255, 255, 0.8);
        font-family: OPPOSans, OPPOSans;
        font-weight: 500;
        font-size: 16px;
        font-size: 14px;
        line-height: 19px;
        text-align: left;
        font-style: normal;
@@ -242,7 +277,7 @@
      }
      .num {
        font-size: 24px;
        font-size: 26px;
        color: #36d3ff;
        font-family: OPPOSans, OPPOSans;
        font-weight: 800;
@@ -292,7 +327,7 @@
      text-align: center;
      margin: 5px 8px;
      border-radius: 8px;
      padding: 7px 10px;
      padding: 2px 6px;
      font-family: OPPOSans, OPPOSans;
      font-weight: 500;
      font-size: 16px;
@@ -349,7 +384,7 @@
      }
      .num {
        font-size: 24px;
        font-size: 26px;
        color: #3271eb;
        font-family: OPPOSans, OPPOSans;
        font-weight: 800;
@@ -399,7 +434,7 @@
      text-align: center;
      margin: 5px 8px;
      border-radius: 8px;
      padding: 7px 3px;
      padding: 2px 6px;
      font-family: OPPOSans, OPPOSans;
      font-weight: 500;
      font-size: 16px;
@@ -431,7 +466,7 @@
  text-align: center;
  margin: 2px 6px;
  border-radius: 8px;
  padding: 5px 10px;
  padding: 2px 6px;
  font-family: OPPOSans, OPPOSans;
  font-weight: 500;
  font-size: 14px;