Explorar el Código

[Fix 0000]解决编译错误问题

bobo04052021@163.com hace 1 día
padre
commit
9405448d01

+ 18 - 67
src/views/vent/home/configurable/belt/belt-new.vue

@@ -128,7 +128,6 @@ interface WarnResult {
 // 处理预警指标展示数据格式
 function groupWarnByType(data: any) {
   const result: WarnResult[] = [];
-
   // 遍历 102、103、104...
   Object.keys(data).forEach((warnKey) => {
     const list = data[warnKey] || [];
@@ -151,7 +150,7 @@ function groupWarnByType(data: any) {
         } else if (fmin != null && fmax == null) {
           warnObj.coRange = `> ${fmin}`;
         }
-        // 处理变化率(原来的逻辑不动)
+        // 处理变化率
         else if (trendMin != null && trendMax != null) {
           if (warnName === '黄色预警(较大风险)') {
             warnObj.coTrend = `加速上升(${trendMin} - ${trendMax})`;
@@ -316,75 +315,27 @@ watch(
     if (newQueryType) {
       changePage(newQueryType as string);
     }
-    modalMonitorData.value = modalRes;
-  }
+  },
+  { immediate: true } // 初始化立刻执行
+);
 
-  // // 定时刷新
-  function initInterval() {
-    if (timer) clearInterval(timer);
-    timer = setInterval(() => {
-      refresh();
-    }, 60000);
-  }
-
-  async function changePage(pageTypeStr) {
-    const target = pageTypeStr || route.query.pageType || 'fire_risk_warn';
-    if (pageType.value === target) return;
-    pageType.value = target;
-    configs.value = pageCache.value[target]?.configs || testBeltNew;
-    await nextTick();
-    await refresh();
-  }
-
-  // watch(
-  //   // 监听动态路由参数 :type
-  //   () => route.params.type,
-  //   (newVal) => {
-  //     if (newVal) {
-  //       console.log('切换页面类型:', newVal);
-  //       refresh(); // 切换路由自动刷新
-  //     }
-  //   }
-  // );
-
-  function initModalAnimate(modal) {
-    console.log('初始化模型', modal);
-    modal.isRender = true;
-    modalAnimate(modal, modalMonitorData);
-  }
-  function clearTimer() {
-    if (timer) {
-      clearInterval(timer);
-      timer = null;
+watch(
+  () => modalMonitorData.value,
+  (newData, oldData) => {
+    if (newData && !Object.keys(oldData).length) {
+      isInitModal.value = true;
     }
   }
-  watch(
-    () => route.query.pageType,
-    (newQueryType) => {
-      if (newQueryType) {
-        changePage(newQueryType as string);
-      }
-    },
-    { immediate: true } // 初始化立刻执行
-  );
+);
 
-  watch(
-    () => modalMonitorData.value,
-    (newData, oldData) => {
-      if (newData && !Object.keys(oldData).length) {
-        isInitModal.value = true;
-      }
-    }
-  );
-
-  onMounted(async () => {
-    await getSysDataSource();
-    await refresh();
-    initInterval();
-  });
-  onUnmounted(() => {
-    clearTimer();
-  });
+onMounted(async () => {
+  await getSysDataSource();
+  await refresh();
+  initInterval();
+});
+onUnmounted(() => {
+  clearTimer();
+});
 </script>
 <style lang="less" scoped>
 .company-home {

+ 3 - 3
src/views/vent/home/configurable/components/belt/WarningResultList.vue

@@ -89,9 +89,9 @@ const handleSwitchChange = (row: any) => {
   row.isPlanned = row.isPlanned === 1 ? 0 : 1;
   console.log('当前值:', row.isPlanned);
 };
-function openModel(data) {
-  console.log(data, '=====data');
-  planData.value = data.alarmRecords['1'];
+function openModel(row) {
+  console.log(row, '=====data');
+  planData.value = row.alarmRecords['1'];
   visible.value = true;
 }
 onMounted(() => {});