Ver código fonte

[Feat 0000]联动配置模块功能优化

bobo04052021@163.com 1 dia atrás
pai
commit
0fade1f461

+ 1 - 1
.env.development

@@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = /
 
 # 跨域代理,您可以配置多个 ,请注意,没有换行符
 #VITE_PROXY = [["/jeecgboot","http://localhost:8080/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
-VITE_PROXY = [["/sw","http://182.92.126.35:6008"],["/jeecgsystem","http://182.92.126.35:9999"],["/upload","http://39.97.59.228:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/modelreq", "http://39.97.59.228:9999"],["/webRtc", "http://182.92.126.35:8051"], ["/python", "http://127.0.0.1:8008"], ["/tun2D", "http://127.0.0.1:8088/micro-vent-2dModal/tun2D"],["/dataCenter", "http://39.97.59.228:10999"]]
+VITE_PROXY = [["/sw","http://182.92.126.35:6008"],["/jeecgsystem","http://182.92.126.35:9999"],["/upload","http://39.97.59.228:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/modelreq", "http://182.92.126.35:9999"],["/webRtc", "http://182.92.126.35:8051"], ["/python", "http://127.0.0.1:8008"], ["/tun2D", "http://127.0.0.1:8088/micro-vent-2dModal/tun2D"],["/dataCenter", "http://39.97.59.228:10999"]]
 # VITE_PROXY = [["/sw","http://182.92.126.35:6008"],["/jeecgsystem","http://39.97.59.228:9999"],["/upload","http://39.97.59.228:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/modelreq", "http://39.97.59.228:9999"],["/webRtc", "http://182.92.126.35:8051"], ["/python", "http://127.0.0.1:8008"], ["/tun2D", "http://127.0.0.1:8088/micro-vent-2dModal/tun2D"],["/dataCenter", "http://39.97.59.228:10999"]]
 # VITE_PROXY = [["/jeecgsystem","http://192.168.183.88:9999"],["/upload","http://192.168.183.88:9999/upload"],["/documents", "http://192.168.183.88:9050"],["/modelreq", "http://192.168.183.88:9999"],["/webRtc", "http://192.168.183.88:8051"]]
 # VITE_PROXY = [["/jeecgsystem","http://10.10.150.72:9999"],["/upload","http://localhost:3300/upload"],["/documents", "http://10.10.150.72:9050"],["/modelreq", "http://10.10.150.72:9999"],["/webRtc", "http://192.168.183.216:8051"]]

+ 1 - 1
.env.production

@@ -17,7 +17,7 @@ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
 #VITE_PROXY = [["/jeecgsystem","http://10.248.223.116:9999"],["/upload","http://localhost:3300/upload"]]
 #VITE_PROXY = [["/jeecgsystem","http://10.248.210.152:9999"],["/upload","http://10.248.210.152:9999/upload"]]
 #VITE_PROXY = [["/jeecgsystem","http://182.92.126.35:9999"],["/upload","http://182.92.126.35:9999/upload"]]
-VITE_PROXY = [["/sw","http://10.246.167.205:6008"],["/modelreq","http://172.16.41.171:9999"],["/upload","http://172.16.41.171:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/dataCenter", "http://39.97.59.228:10999"]]
+VITE_PROXY = [["/sw","http://10.246.167.205:6008"],["/modelreq","http://182.92.126.35:9999"],["/upload","http://172.16.41.171:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/dataCenter", "http://39.97.59.228:10999"]]
 #VITE_PROXY = [["/jeecgsystem","http://172.16.41.171:9999"],["/upload","http://172.16.41.171:9999/upload"]]
 #VITE_PROXY = [["/jeecgsystem","http://10.120.120.163:9999"],["/upload","http://10.120.120.163:9999/upload"]]
 #VITE_PROXY = [["/jeecgsystem","http://192.168.1.4:9999"],["/upload","http://localhost:3300/upload"]]

+ 45 - 20
src/layouts/default/header/components/weatherBroadcast.vue

@@ -5,10 +5,10 @@
     <a-badge :count="10">
       <a href="#" class="head-example"></a>
     </a-badge> -->
-      <div style="display: flex; flex-direction: row;align-items: center;" class="btn-header">
-        <img :src="parseWeatherData(weatherObj.text)" class="weather-icon" />
-        <span class="unit">{{ weatherObj.pressure }}&nbsp;hPa</span>
-        <FileSearchOutlined style="font-size: 20px; color: #fff;" />
+      <div style="display: flex; flex-direction: row; align-items: center" class="btn-header">
+        <img :src="parseWeatherData(weatherObj?.text)" class="weather-icon" />
+        <span class="unit">{{ weatherObj?.pressure }}&nbsp;hPa</span>
+        <FileSearchOutlined style="font-size: 20px; color: #fff" />
       </div>
     </div>
     <div v-if="isShowWeatherBroad" class="broadcast" ref="VoiceBroadcastRef" id="VoiceBroadcast">
@@ -17,21 +17,36 @@
       </div>
       <div class="broadcast-context">
         <div class="context-tab">
-          <div class="context-tab-item" :class="{ 'context-tab-item-active': activeKey == 0 }" @click="toSelectList(0)">
-            温度</div>
-          <div class="context-tab-item" :class="{ 'context-tab-item-active': activeKey == 1 }" @click="toSelectList(1)">
-            气压</div>
-          <div class="context-tab-item" :class="{ 'context-tab-item-active': activeKey == 2 }" @click="toSelectList(2)">
-            风力</div>
+          <div class="context-tab-item" :class="{ 'context-tab-item-active': activeKey == 0 }" @click="toSelectList(0)"> 温度</div>
+          <div class="context-tab-item" :class="{ 'context-tab-item-active': activeKey == 1 }" @click="toSelectList(1)"> 气压</div>
+          <div class="context-tab-item" :class="{ 'context-tab-item-active': activeKey == 2 }" @click="toSelectList(2)"> 风力</div>
         </div>
         <div class="context-box">
           <div class="echarts-box">
-            <BarAndLine v-if="activeKey == 0" xAxisPropType="fxTime" height="240px" :dataSource="monitorData"
-              :chartsColumns="ChartsColumnsWD" :option="Option" />
-            <BarAndLine v-if="activeKey == 1" xAxisPropType="fxTime" height="240px" :dataSource="monitorData"
-              :chartsColumns="ChartsColumnsQY" :option="Option" />
-            <BarAndLine v-if="activeKey == 2" xAxisPropType="fxTime" height="240px" :dataSource="monitorData"
-              :chartsColumns="ChartsColumnsFL" :option="Option" />
+            <BarAndLine
+              v-if="activeKey == 0"
+              xAxisPropType="fxTime"
+              height="240px"
+              :dataSource="monitorData"
+              :chartsColumns="ChartsColumnsWD"
+              :option="Option"
+            />
+            <BarAndLine
+              v-if="activeKey == 1"
+              xAxisPropType="fxTime"
+              height="240px"
+              :dataSource="monitorData"
+              :chartsColumns="ChartsColumnsQY"
+              :option="Option"
+            />
+            <BarAndLine
+              v-if="activeKey == 2"
+              xAxisPropType="fxTime"
+              height="240px"
+              :dataSource="monitorData"
+              :chartsColumns="ChartsColumnsFL"
+              :option="Option"
+            />
           </div>
         </div>
       </div>
@@ -155,10 +170,20 @@ export default defineComponent({
       activeKey.value = key;
     }
     async function getWeatherInfo() {
-      const res = await getWeather();
-
-      weatherObj.value = JSON.parse(res.weatherDataNow);
-      monitorData.value = JSON.parse(res.weatherData);
+      try {
+        const res = await getWeather();
+        if (res?.weatherDataNow) {
+          // 判空
+          const parsed = JSON.parse(res.weatherDataNow);
+          if (parsed) weatherObj.value = parsed;
+        }
+        if (res?.weatherData) {
+          const parsed = JSON.parse(res.weatherData);
+          if (parsed) monitorData.value = parsed;
+        }
+      } catch (e) {
+        console.error('获取天气信息失败:', e);
+      }
     }
     onMounted(() => {
       nextTick(async () => {

+ 23 - 0
src/store/modules/linkRule.ts

@@ -0,0 +1,23 @@
+import { defineStore } from 'pinia';
+
+export const useLinkRuleStore = defineStore({
+  id: 'link-rule',
+  state: () => {
+    return {
+      selectedRow: null as any | null,
+    };
+  },
+  getters: {
+    getSelectedRow(): any | null {
+      return this.selectedRow;
+    },
+  },
+  actions: {
+    setSelectedRow(row: any | null) {
+      this.selectedRow = row;
+    },
+    clearSelectedRow() {
+      this.selectedRow = null;
+    },
+  },
+});

+ 10 - 12
src/views/vent/home/configurable/components/content.vue

@@ -223,23 +223,17 @@
           <SystemView></SystemView>
         </template>
         <template v-if="config.name === 'rule_table'">
-          <RuleTable :config="config.config" :data="config.data"></RuleTable>
-        </template>
-        <template v-if="config.name === 'link_log'">
-          <LinkLog></LinkLog>
-        </template>
-        <template v-if="config.name === 'rule_num'">
-          <RuleNum></RuleNum>
-        </template>
-        <template v-if="config.name === 'link_edit'">
-          <LinkRuleEdit></LinkRuleEdit>
+          <RuleTable :config="config.config" :data="config.data" :selected-row="selectRuleRow" @row-change="onRowClick"></RuleTable>
         </template>
+        <template v-if="config.name === 'link_log'"> <LinkLog></LinkLog> </template>
+        <template v-if="config.name === 'rule_num'"> <RuleNum></RuleNum> </template>
+        <template v-if="config.name === 'link_edit'"> <LinkRuleEdit :selected-row="selectRuleRow"> </LinkRuleEdit></template>
       </div>
     </div>
   </div>
 </template>
 <script lang="ts" setup>
-import { computed, reactive, watch } from 'vue';
+import { computed, reactive, watch, ref } from 'vue';
 import {
   CommonItem,
   Config,
@@ -308,7 +302,11 @@ const props = defineProps<{
 }>();
 
 const { background, layout } = props.moduleData;
-
+// 存储当前选中行
+const selectRuleRow = ref<null | Record<string, any>>(null);
+const onRowClick = (singleRow) => {
+  selectRuleRow.value = singleRow;
+};
 // 获取当原始配置带 items 项时的最终 items 配置
 function getItems(raw, items: CommonItem[]) {
   return items.map((i) => {

+ 18 - 12
src/views/vent/home/configurable/components/navMenu.vue

@@ -1,15 +1,20 @@
 <template>
   <div class="nav-menu">
-    <div  :class="activeIndex == index ? 'menu-item-active' : 'menu-item'" v-for="(item, index) in menuList" :key="index"
-      @click="handlerClick(item, index)">{{ item.label }}</div>
+    <div
+      :class="activeIndex == index ? 'menu-item-active' : 'menu-item'"
+      v-for="(item, index) in menuList"
+      :key="index"
+      @click="handlerClick(item, index)"
+      >{{ item.label }}</div
+    >
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue'
+import { ref } from 'vue';
 
 //当前激活menu选项索引
-let activeIndex = ref(0)
+let activeIndex = ref(0);
 let menuList = ref<any[]>([
   { label: '一张图', value: 'yzt' },
   { label: '监测预警', value: 'jcyj' },
@@ -17,13 +22,13 @@ let menuList = ref<any[]>([
   { label: '联动配置', value: 'ldpz' },
   { label: '系统管理', value: 'xtgl' },
   { label: '大屏展示', value: 'dpzs' },
-])
-let $emit=defineEmits(['changeMenu'])
+]);
+let $emit = defineEmits(['changeMenu']);
 
 //menu选项切换
 function handlerClick(item, index) {
-  activeIndex.value = index
-  $emit('changeMenu',item.value)
+  activeIndex.value = index;
+  $emit('changeMenu', item.value);
 }
 </script>
 
@@ -31,7 +36,8 @@ function handlerClick(item, index) {
 @import '/@/design/theme.less';
 
 @{theme-deepblue} {
-  .nav-menu {}
+  .nav-menu {
+  }
 }
 
 .nav-menu {
@@ -42,7 +48,7 @@ function handlerClick(item, index) {
   justify-content: space-around;
   align-items: center;
   position: relative;
-  width: 100%;
+  width: 90%;
   height: 100%;
   background: var(--image-modal-nav) no-repeat;
   background-size: 100% 100%;
@@ -58,7 +64,7 @@ function handlerClick(item, index) {
     background: var(--image-modal-nav1) no-repeat;
     background-size: 100% 100%;
     cursor: pointer;
-     user-select: none; /* 禁止选择文本 */
+    user-select: none; /* 禁止选择文本 */
   }
 
   .menu-item-active {
@@ -70,7 +76,7 @@ function handlerClick(item, index) {
     background: var(--image-modal-nav2) no-repeat;
     background-size: 100% 100%;
     cursor: pointer;
-     user-select: none; /* 禁止选择文本 */
+    user-select: none; /* 禁止选择文本 */
   }
 }
 </style>

+ 76 - 0
src/views/vent/home/configurable/components/preset/deviceModal.vue

@@ -0,0 +1,76 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="registerModal"
+    :title="title"
+    width="1000px"
+    :showCancelBtn="false"
+    :showOkBtn="false"
+    :footer="null"
+    :destroyOnClose="true"
+    :mask-closable="false"
+    @cancel="closeModalFn"
+  >
+    <a-tabs v-if="props.showTab" v-model:activeKey="activeKey">
+      <a-tab-pane key="5" tab="配置预警设备" force-render>
+        <template v-if="activeKey == '5'">
+          <BackWindDeviceTable :deviceId="selectSysId" />
+        </template>
+      </a-tab-pane>
+
+      <a-tab-pane key="6" tab="配置控制设备" force-render>
+        <template v-if="activeKey == '6'">
+          <ManagerWarningTable :deviceId="selectSysId" />
+        </template>
+      </a-tab-pane>
+    </a-tabs>
+  </BasicModal>
+</template>
+<script lang="ts" setup>
+import { computed, unref, inject, reactive, ref } from 'vue';
+import { BasicModal, useModalInner } from '/@/components/Modal';
+import FormModal from '../../../../deviceManager/comment/FormModal.vue';
+import BackWindDeviceTable from '../../../../deviceManager/comment/warningTabel/index3.vue';
+import ManagerWarningTable from '../../../../deviceManager/comment/warningTabel/index1.vue';
+
+const props = defineProps({
+  showTab: { type: Boolean, required: true },
+  deviceType: { type: String, default: '' },
+  selectSysId: { type: String, default: '' },
+  selectSysAlarmId: { type: String, default: '' },
+});
+
+const emit = defineEmits(['saveOrUpdate', 'register', 'closeModal']);
+const isUpdate = inject('isUpdate');
+const deviceData = inject('formData') as any;
+const deviceType = inject('deviceType') as any;
+const record = reactive({});
+const activeKey = ref('5');
+
+const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
+  setModalProps({ confirmLoading: false });
+  for (const key in deviceData) delete deviceData[key];
+  Object.assign(deviceData, data.record);
+  activeKey.value = '5';
+});
+
+// 标题
+const title = '编辑';
+
+const closeModalFn = () => {
+  activeKey.value = '5';
+  closeModal();
+  emit('closeModal');
+};
+</script>
+<style scoped lang="less">
+::v-deep .suffix {
+  height: 32px;
+  line-height: 32px;
+  margin-left: 5px;
+  color: #fff;
+}
+::v-deep .j-box-bottom-button-float {
+  background: none !important;
+}
+</style>

+ 66 - 95
src/views/vent/home/configurable/components/preset/linkRuleEdit.vue

@@ -6,42 +6,17 @@
     <div class="basic-box">
       <basicBorder title="触发条件设置">
         <div class="edit-wrap">
-          <div class="edit-left">
-            <div class="edit-item">
-              <div class="item-label">规则名称 : </div>
-              <a-input class="item-input" v-model:value="formData.gzmc" placeholder="请输入" size="small" />
-            </div>
-            <div class="edit-item">
-              <div class="item-label">报警级别 : </div>
-              <a-input class="item-input" v-model:value="formData.bjjb" placeholder="请输入" size="small" />
-            </div>
-            <div class="edit-item">
-              <div class="item-label">温度阈值 : </div>
-              <a-input class="item-input" v-model:value="formData.wdyz" placeholder="请输入" size="small" />
-            </div>
-            <div class="edit-item">
-              <div class="item-label">触发设备 : </div>
-              <a-input class="item-input" v-model:value="formData.cfsb" placeholder="请输入" size="small" />
-            </div>
-            <div class="edit-item">
-              <div class="item-label">持续时间 : </div>
-              <a-input class="item-input" v-model:value="formData.time" placeholder="请输入" size="small" />
-            </div>
-            <div class="edit-item">
-              <div class="item-label">时间范围 : </div>
-              <a-input class="item-input" v-model:value="formData.sjfw" placeholder="请输入" size="small" />
-            </div>
-          </div>
           <div class="edit-right">
             <div class="right-title">条件逻辑说明</div>
             <div class="right-content">
-              <div class="right-item">IF 温度≥{{ formData.wdyz || 60 }}℃</div>
-              <div class="right-item">AND 持续时间≥{{ formData.time || 30 }}s</div>
-              <div class="right-item">AND 设备状态-在线</div>
+              <template v-for="(item, index) in formData" :key="index">
+                <div class="right-item">设备名称: {{ item.alarmName }}</div>
+                <div class="right-item">监测点位: {{ item.monitorName }}</div>
+                <div class="right-item">IF {{ item.fmin ?? '' }}~{{ item.fmax ?? '' }}</div>
+                <div class="right-item">AND 持续时间:{{ item.cxTime ?? '' }}s</div>
+              </template>
               <div class="right-item">AND 时间在生效范围内</div>
               <div class="right-item">THEN 执行联动动作</div>
-              <div class="right-item">【优先级:高】</div>
-              <div class="right-item">此规则触发后将阻断低优先级</div>
             </div>
           </div>
         </div>
@@ -100,8 +75,16 @@
 </template>
 
 <script setup lang="ts">
-import { reactive, ref, onMounted } from 'vue';
+import { reactive, ref, onMounted, watch, computed } from 'vue';
 import basicBorder from '../BasicBorder.vue';
+import { useLinkRuleStore } from '/@/store/modules/linkRule';
+import { getWarningDeviceList } from '../../configurable.api';
+const props = defineProps<{
+  selectedRow?: any | null;
+}>();
+
+const linkRuleStore = useLinkRuleStore();
+const currentSelectedRow = computed(() => linkRuleStore.getSelectedRow);
 
 let titleList = ref<any[]>([
   { label: '序号', value: '1' },
@@ -130,7 +113,6 @@ const steps = ref([
 
 // 模拟接口请求获取步骤状态
 const fetchStepStatus = async () => {
-  // 模拟 API 返回的数据,实际使用时替换为真实接口
   const apiResponse = {
     alarmTrigger: 1, // 报警触发为 1
     conditionJudge: 0, // 条件判断为 1
@@ -146,25 +128,43 @@ const fetchStepStatus = async () => {
   steps.value[3].status = apiResponse.executeAction;
   steps.value[4].status = apiResponse.recordLog;
 };
-let formData = reactive({
-  gzmc: '一级温度报警',
-  bjjb: '一级(严重)',
-  wdyz: '50',
-  cfsb: '声光报警',
-  time: '≥35',
-  sjfw: '值班人员',
-});
-// const formData = ref({
-//   gzmc: '',
-//   bjjb: '',
-//   wdyz: '',
-//   cfsb: '',
-//   time: '',
-//   sjfw: '',
-// });
+const formData = ref([]);
+// 获取预警条目数据
+const getWarningList = async (val) => {
+  const params = {
+    sysId: val.sysId,
+    monitorType: 2,
+    alarmId: val.id,
+    pageSize: 1000,
+  };
+  const res = await getWarningDeviceList(params);
+  formData.value = res.records;
+};
 onMounted(() => {
   fetchStepStatus();
+  if (currentSelectedRow.value) {
+    updateFormData(currentSelectedRow.value);
+    getWarningList(currentSelectedRow.value);
+  }
 });
+
+watch(
+  currentSelectedRow,
+  (newVal) => {
+    console.log(newVal, 'newVal from store');
+    if (newVal) {
+      updateFormData(newVal);
+      getWarningList(newVal);
+    }
+  },
+  { deep: true }
+);
+
+const updateFormData = (row: any) => {
+  console.log('更新表单数据:', row);
+  // 在这里根据 row 数据更新表单或其他逻辑
+  // 例如: formData.gzmc = row.alarmName;
+};
 </script>
 
 <style lang="less" scoped>
@@ -186,19 +186,15 @@ onMounted(() => {
   box-sizing: border-box;
   display: flex;
   flex-direction: column;
-  .item-input {
-    background: transparent !important;
-    background: linear-gradient(to right, #114469, #0b2542) !important;
-    color: #fff;
-    border: 1px solid #2690c1 !important;
-    border-radius: 5px;
-    &:hover,
-    &:focus {
-      background: transparent !important;
-    }
-    box-shadow: none !important;
+  .basic-box {
+    height: 30%;
+    margin-top: 10px;
+  }
+  .basic-box1 {
+    flex: 1;
+
+    margin-top: 10px;
   }
-  .basic-box1,
   .basic-box2 {
     margin-top: 10px;
   }
@@ -209,26 +205,6 @@ onMounted(() => {
     gap: 10px;
     box-sizing: border-box;
   }
-  .edit-left {
-    flex: 1;
-    display: flex;
-    flex-direction: column;
-    justify-content: center;
-    margin: 5px;
-  }
-
-  .edit-item {
-    display: flex;
-    align-items: center;
-    height: 32px;
-    background: linear-gradient(to right, #114469, #0b2542) !important;
-    margin-bottom: 10px;
-    padding: 0 10px;
-    box-sizing: border-box;
-    &:last-child {
-      margin-bottom: 10px;
-    }
-  }
 
   .item-label {
     width: 80px;
@@ -237,8 +213,8 @@ onMounted(() => {
   }
   .edit-right {
     background: #0e395d;
-    width: 50%;
-    height: 93%;
+    width: 100%;
+    height: 100%;
     display: flex;
     flex-direction: column;
     margin-right: 20px;
@@ -261,32 +237,27 @@ onMounted(() => {
   .right-content {
     flex: 1;
     display: flex;
-    flex-direction: column;
+    flex-direction: row;
     margin-top: 5px;
     margin-left: 10px;
   }
 
   .right-item {
-    color: #fff;
-    font-size: 14px;
+    color: #29a1d4;
+    font-size: 12px;
     line-height: 25px;
     font-weight: bold;
     padding: 0 5px;
   }
-  .right-item:nth-child(1) {
+  .right-item:nth-child(3) {
     color: #fc002a;
   }
-  .right-item:nth-child(2),
-  .right-item:nth-child(3),
-  .right-item:nth-child(4) {
-    color: #29a1d4;
+  .right-item:first-child {
+    color: #fff;
   }
-  .right-item:nth-child(5) {
+  .right-item:last-child {
     color: #46e8a3;
   }
-  .right-item:nth-child(6) {
-    margin-top: 10px;
-  }
   .list-title {
     width: 177px;
     height: 30px;

+ 230 - 301
src/views/vent/home/configurable/components/preset/ruleTable.vue

@@ -4,54 +4,70 @@
       <div class="list-title">
         <span>联动规则列表</span>
       </div>
-      <div class="search-btn" @click="redirectTo">
-        <div class="btn-item">跳转新增</div>
+      <div class="search-btn" @click="handleAdd">
+        <div class="btn-item">配置</div>
       </div>
     </div>
     <div v-if="config.type === 'D'" class="search-new">
       <div class="list-title">
         <span>联动日志</span>
       </div>
-      <div class="search">
-        <div class="title-top">
-          <a-input v-model:value="searchWarn" placeholder="搜索" size="small" class="zxm-input zxm-input-sm" />
-          <div class="search-btn" @click="openFilterModal">
-            <div class="btn-item">筛选</div>
-          </div>
+      <div class="time-picker-wrap">
+        <div class="form-row">
+          <label class="form-label">开始时间:</label>
+          <a-date-picker
+            v-model:value="filterForm.startDate"
+            placeholder="请选择开始时间"
+            class="date-picker"
+            show-time
+            format="YYYY-MM-DD HH:mm:ss"
+            style="width: 300px !important"
+          />
         </div>
       </div>
       <div class="time-select">
-        <span class="span">时间范围:</span>
-        <div class="btn" :class="{ active: timeType === 1 }" @click="timeType = 1">今日</div>
-        <div class="btn" :class="{ active: timeType === 2 }" @click="timeType = 2">近三天</div>
-        <div class="btn" :class="{ active: timeType === 3 }" @click="timeType = 3">近七天</div>
+        <span class="span">快捷时间:</span>
+        <div class="btn" :class="{ active: timeType === 1 }" @click="setTimeRange(1)">今日</div>
+        <div class="btn" :class="{ active: timeType === 2 }" @click="setTimeRange(2)">近三天</div>
+        <div class="btn" :class="{ active: timeType === 3 }" @click="setTimeRange(3)">近一月</div>
+        <div class="search-btn" @click="confirmDetail">
+          <div class="btn-item">详情</div>
+        </div>
       </div>
     </div>
     <div class="content-area">
       <div class="table-container">
         <table class="warning-table">
+          <colgroup>
+            <col
+              v-for="col in config.type === 'C' ? config.columns : filterDeviceColumns"
+              :key="col.dataIndex || col.prop"
+              :style="{ width: col.width }"
+            />
+          </colgroup>
           <thead class="table-header">
             <tr>
-              <th v-for="col in config.columns" :key="col.prop" :style="{ width: col.width }">
-                {{ col.name }}
+              <th v-for="col in config.type === 'C' ? config.columns : filterDeviceColumns" :key="col.dataIndex || col.prop">
+                {{ col.title || col.name }}
               </th>
             </tr>
           </thead>
-
           <tbody class="table-body">
-            <tr v-for="(row, index) in tableList" :key="row.warnId || row.id || index" class="table-row">
-              <td v-for="col in config.columns" :key="col.prop" class="table-cell" :style="{ width: col.width }">
-                <template v-if="col.prop === 'operation'">
-                  <span class="text-look">确认</span>
-                </template>
-                <template v-else-if="col.prop === 'status'">
-                  <span class="item-text">{{ row[col.prop] || '-' }}</span>
-                </template>
-                <template v-else-if="col.prop === 'grade'">
-                  <span class="item-text2">{{ row[col.prop] || '-' }}</span>
+            <tr
+              v-for="(row, index) in realTableData"
+              :key="index"
+              class="table-row"
+              :class="config.type === 'C' ? { box_active: isCurrentSelectRow(row) } : ''"
+              @click="config.type === 'C' ? handleRowClick(row) : ''"
+            >
+              <td v-for="col in config.type === 'C' ? config.columns : filterDeviceColumns" :key="col.dataIndex || col.prop" class="table-cell">
+                <template v-if="config.type === 'C' && col.prop === 'operation'">
+                  <span class="text-look" @click="handleEditClick(row)">确认</span>
                 </template>
                 <template v-else>
-                  <span>{{ row[col.prop] || '-' }}</span>
+                  <span class="text-ellipsis" :title="getCellText(row, col)">
+                    {{ getCellText(row, col) }}
+                  </span>
                 </template>
               </td>
             </tr>
@@ -59,37 +75,66 @@
         </table>
       </div>
     </div>
-    <!-- 筛选弹窗 -->
-    <div class="filter-mask" v-if="filterVisible" @click.self="closeFilterModal">
-      <div class="filter-modal">
-        <div class="modal-header">
-          <span>自定义时间筛选</span>
-          <span class="close-icon" @click="closeFilterModal">×</span>
-        </div>
-        <div class="modal-form">
-          <div class="form-row">
-            <label class="form-label">开始日期:</label>
-            <a-date-picker v-model:value="filterForm.startDate" placeholder="请选择开始日期" class="date-picker" />
-          </div>
-          <div class="form-row">
-            <label class="form-label">结束日期:</label>
-            <a-date-picker v-model:value="filterForm.endDate" placeholder="请选择结束日期" class="date-picker" />
-          </div>
-        </div>
-        <div class="modal-footer">
-          <button class="btn-cancel" @click="closeFilterModal">取消</button>
-          <button class="btn-search" @click="confirmFilter">查询</button>
-        </div>
-      </div>
-    </div>
+    <DeviceModal
+      @register="registerModal"
+      :show-tab="true"
+      @saveOrUpdate="saveOrUpdateHandler"
+      :device-type="deviceType"
+      :select-sys-alarm-id="currentSelectInfo.alarmId"
+      :select-sys-id="currentSelectInfo.sysId"
+    />
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref, reactive, watch } from 'vue';
+import { ref, reactive, watch, onMounted, nextTick, computed } from 'vue';
 import dayjs, { Dayjs } from 'dayjs';
 import { message } from 'ant-design-vue';
+import DeviceModal from './deviceModal.vue';
+import { useModal } from '/@/components/Modal';
+import { getAlarmLogList } from '../../configurable.api';
+import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
+import { func } from 'vue-types';
+import { useLinkRuleStore } from '/@/store/modules/linkRule';
+
+const FIXED_STRTYPE = 'sys_openair_fire';
+const deviceType = ref('managesys');
+const isUpdate = ref(false);
 
+const instanceId = ref(`${Date.now()}_${Math.floor(Math.random() * 10000)}`);
+const [registerModal, { openModal, closeModal }] = useModal(instanceId.value);
+
+const linkRuleStore = useLinkRuleStore();
+const emit = defineEmits(['row-change']);
+const currentSelectInfo = ref({
+  sysId: '',
+  alarmId: '',
+});
+const alarmMap: Record<string, string> = {
+  '102': '黄色预警',
+  '103': '橙色预警',
+  '104': '红色预警',
+};
+// 获取单元格文本内容
+const getCellText = (row: any, col: any) => {
+  const field = col.dataIndex ?? col.prop;
+  const val = row[field];
+  if (field === 'alarmLevel' && alarmMap[val]) {
+    return alarmMap[val];
+  }
+  return val ?? '-';
+};
+const deviceColumns = getTableHeaderColumns('alarm_history') as [];
+
+// 过滤日志只展示指定4列
+const filterDeviceColumns = computed(() => {
+  const showKeys = ['devicename', 'wardescrip', 'starttime', 'warntime'];
+  return deviceColumns.filter((item) => showKeys.includes(item.dataIndex));
+});
+
+const realTableData = computed(() => {
+  return props.config.type === 'D' ? alarmList.value : tableList.value;
+});
 const props = defineProps<{
   config: {
     type: string;
@@ -98,80 +143,125 @@ const props = defineProps<{
       name: string;
       prop: string;
       width?: string;
-      render?: (row: any, index: number) => string;
     }[];
-    otherProps: {
-      title: string;
-      prop: string;
-    };
-  };
-  data: {
-    [key: string]: any;
   };
+  data: Record<string, any>;
+  selectedRow?: any | null;
 }>();
+
+const handleEditClick = (row: any) => {};
+// C类型数据源
 const tableList = ref<any[]>([]);
-let searchWarn = ref('');
-const timeType = ref(1);
+// D类型数据源
+const alarmList = ref<any[]>([]);
+
+const timeType = ref(3);
+const filterForm = reactive<{ startDate: Dayjs | null }>({
+  startDate: null,
+});
+// 默认选中第一条(仅Type='C'时执行)
+const autoSelectFirstRow = async () => {
+  await nextTick();
+  if (props.config.type !== 'C') return;
+
+  const list = realTableData.value;
+  if (list.length > 0) {
+    const firstRow = list[0];
+    emit('row-change', firstRow);
+    linkRuleStore.setSelectedRow(firstRow);
+    currentSelectInfo.value.sysId = firstRow.sysId ?? '';
+    currentSelectInfo.value.alarmId = firstRow.alarmId ?? '';
+  } else {
+    emit('row-change', null);
+    linkRuleStore.clearSelectedRow();
+    currentSelectInfo.value = { sysId: '', alarmId: '' };
+  }
+};
+const isCurrentSelectRow = (row: any) => {
+  if (!props.selectedRow) return false;
+  return props.selectedRow === row;
+};
+
+const handleRowClick = (row: any) => {
+  emit('row-change', row);
+  linkRuleStore.setSelectedRow(row);
+  currentSelectInfo.value.sysId = row.sysId ?? '';
+  currentSelectInfo.value.alarmId = row.alarmId ?? '';
+};
+
+async function getAlarmHistory() {
+  const res = await getAlarmLogList({
+    column: 'createTime',
+    deviceKind: null,
+    isOk: false,
+    pageNo: 1,
+    pageSize: 100,
+    startTime: filterForm.startDate?.format('YYYY-MM-DD HH:mm:ss'),
+    systemType: 'ventS',
+  });
+  alarmList.value = res.records || [];
+}
+
+onMounted(() => {
+  getAlarmHistory();
+  autoSelectFirstRow();
+  setTimeRange(3);
+});
 
+// 监听父组件传入数据,赋值给tableList(Type为C时生效)
 watch(
   () => props.data?.[props.config.tableReadFrom],
   (newArr) => {
-    if (!newArr) return;
-    // 只更新内容,不重建表格
-    tableList.value = newArr;
-    console.log(tableList.value, '11111111111111111');
+    tableList.value = newArr || [];
+    autoSelectFirstRow();
   },
   { deep: true, immediate: true }
 );
-function redirectTo() {
-  window.open('/deviceManager/workingFace');
-}
 
-// 筛选弹窗相关
-// 筛选弹窗控制
-const filterVisible = ref(false);
-// 筛选日期表单
-const filterForm = reactive<{ startDate: Dayjs | null; endDate: Dayjs | null }>({
-  startDate: null,
-  endDate: null,
-});
-
-// 打开筛选弹窗
-const openFilterModal = () => {
-  const today = dayjs();
-  const sevenDayAgo = dayjs().subtract(7, 'day');
-  filterForm.startDate = sevenDayAgo;
-  filterForm.endDate = today;
-  filterVisible.value = true;
-};
+async function handleAdd() {
+  isUpdate.value = false;
+  openModal(true, {});
+}
 
-// 关闭弹窗并重置日期
-const closeFilterModal = () => {
-  filterVisible.value = false;
-  filterForm.startDate = null;
-  filterForm.endDate = null;
+const saveOrUpdateHandler = async () => {
+  try {
+    message.success(isUpdate.value ? '编辑成功' : '新增成功');
+    closeModal();
+  } catch (error) {
+    message.error('保存失败,请联系管理员');
+  }
 };
 
-// 确认筛选
-const confirmFilter = () => {
-  if (!filterForm.startDate || !filterForm.endDate) {
-    message.warning('请选择完整起止日期');
-    return;
-  }
-  if (filterForm.startDate.isAfter(filterForm.endDate)) {
-    message.warning('开始日期不能晚于结束日期');
-    return;
+const setTimeRange = (type: number) => {
+  timeType.value = type;
+  let start: Dayjs;
+  switch (type) {
+    case 1:
+      start = dayjs().startOf('day');
+      break;
+    case 2:
+      start = dayjs().subtract(3, 'day').startOf('day');
+      break;
+    case 3:
+      start = dayjs().subtract(30, 'day').startOf('day');
+      break;
+    default:
+      start = dayjs().startOf('day');
   }
-  console.log('筛选参数:', searchWarn.value, filterForm.startDate.format('YYYY-MM-DD'), filterForm.endDate.format('YYYY-MM-DD'));
-  closeFilterModal();
+  filterForm.startDate = start;
+  getAlarmHistory();
 };
+
+// 跳转详情
+function confirmDetail() {
+  window.open('/monitorChannel/device-monitor/warningHistory/home');
+}
 </script>
 
 <style lang="less" scoped>
 @import '/@/design/theme.less';
 .search-table {
   --image-box-bg: url('@/assets/images/home-container/configurable/hsq/2-5.png');
-  --image-box-bg1: url('@/assets/images/home-container/configurable/hsq/2-6.png');
   --image-box-bg2: url('@/assets/images/home-container/configurable/hsq/2-24.png');
   position: relative;
   width: 100%;
@@ -196,7 +286,6 @@ const confirmFilter = () => {
   align-items: center;
   margin-bottom: 5px;
 }
-
 .search-btn {
   width: 85px;
   height: 30px;
@@ -205,27 +294,30 @@ const confirmFilter = () => {
   padding: 3px;
   cursor: pointer;
 }
-.search-new {
-  .title-top {
+.search-new .time-picker-wrap {
+  padding: 10px;
+  .form-row {
     display: flex;
     align-items: center;
-    gap: 10px; // 去掉前面多余空格,less正确写法
-    white-space: nowrap; // 子元素禁止换行
-    flex-wrap: nowrap; // 弹性容器不自动换行
-  }
-  .search-btn {
-    width: 85px;
-    height: 30px;
-    border: 1px solid #01fefc;
-    border-radius: 4px;
-    padding: 3px;
-    cursor: pointer;
-    flex-shrink: 0; // 筛选按钮固定宽度,不压缩
-  }
-  .zxm-input {
-    flex: 1; // 输入框自适应剩余宽度
+    margin-bottom: 8px;
+    .form-label {
+      width: 60px;
+      font-size: 13px;
+      color: #fff;
+      flex-shrink: 0;
+    }
   }
 }
+:deep(.zxm-picker) {
+  border: 1px solid #3ae1ff !important;
+  background-color: #104064 !important;
+}
+:deep(.zxm-picker-input > input) {
+  color: #fff !important;
+}
+:deep(.zxm-picker-suffix) {
+  color: #fff !important;
+}
 .time-select {
   display: flex;
   align-items: center;
@@ -233,12 +325,10 @@ const confirmFilter = () => {
   margin-bottom: 8px;
   gap: 6px;
   white-space: nowrap;
-
   .span {
     color: #fff;
     font-size: 13px;
   }
-
   .btn {
     padding: 3px 8px;
     background: #114268;
@@ -246,18 +336,13 @@ const confirmFilter = () => {
     border-radius: 4px;
     color: #fff;
     cursor: pointer;
-    margin-right: 4px;
     font-size: 13px;
-    white-space: nowrap;
-    transition: all 0.2s;
-
     &.active {
       background-color: #185f8e;
       border-color: #2084c0;
     }
   }
 }
-
 .btn-item {
   display: flex;
   justify-content: center;
@@ -266,64 +351,27 @@ const confirmFilter = () => {
   height: 100%;
   background-color: rgba(32, 166, 169);
 }
-
 .content-area {
-  height: calc(100% - 47px);
-}
-
-.content-title {
-  display: flex;
-  align-items: center;
-  height: 34px;
-  background: var(--image-box-bg2) no-repeat;
-  background-size: 100% 100%;
-  margin-bottom: 6px;
-}
-
-.title-item {
-  display: flex;
-  flex: 1;
-  justify-content: center;
-  align-items: center;
-  color: #01fefc;
-  white-space: nowrap;
-  overflow: hidden;
-  text-overflow: ellipsis;
+  height: 100%;
 }
-
 .table-container {
-  height: 100%;
   width: 100%;
-  flex: 1;
-  overflow: hidden;
+  height: 100%;
+  overflow-y: auto;
 }
-
 .warning-table {
-  height: 100%;
   width: 100%;
   table-layout: fixed;
   border-collapse: collapse;
 }
-
-.table-header {
-  display: table;
-  width: 100%;
+.table-header tr {
+  position: sticky;
+  top: 0;
+  z-index: 10;
   background: var(--image-box-bg2) no-repeat;
   background-size: 100% 100%;
-  height: 30px;
-}
-
-.table-body {
-  display: block;
-  overflow-y: auto;
-  overflow-x: hidden;
-  width: 100%;
-  height: 100%;
 }
-
 .table-row {
-  display: table;
-  width: 100%;
   height: 36px;
   &:nth-child(odd) {
     background-color: #0e3455;
@@ -331,6 +379,9 @@ const confirmFilter = () => {
   &:nth-child(even) {
     background-color: #114268;
   }
+  &.box_active {
+    box-shadow: 2px 0 0 0 #ffa024, inset 0 0 0 2px #ffa024;
+  }
 }
 
 th,
@@ -339,148 +390,26 @@ th,
   padding: 5px;
   font-size: 14px;
   box-sizing: border-box;
-  display: table-cell;
   vertical-align: middle;
 }
-
 th {
   font-weight: bold;
   color: #38e4ef;
-}
-
-.row-status-yellow {
-  color: #ffd700 !important;
-  font-weight: bold;
-}
-.row-status-orange {
-  color: #ff9500 !important;
-  font-weight: bold;
-}
-.row-status-red {
-  color: #ff3333 !important;
-  font-weight: bold;
-}
-
-:deep(.btn-start-spray) {
-  background: #2192d9;
-  color: #fff;
-  border: none;
-  padding: 4px 12px;
-  border-radius: 4px;
-  cursor: pointer;
-  font-size: 12px;
+  height: 30px;
 }
 .text-look {
-  padding: 0px 3px;
-  margin: 0px 2px;
+  padding: 0 3px;
+  margin: 0 2px;
   border-radius: 2px;
   background-color: #2484bc;
   cursor: pointer;
 }
-.item-text2 {
-  color: #f4933d;
-}
-.item-text {
-  color: #4cf3a6;
-}
-.zxm-input {
-  height: 42px;
-  color: #fff;
-  background-color: transparent;
-  border: none;
-  background: var(--image-box-bg1) no-repeat;
-  background-size: 100% 100%;
-}
-
-.zxm-input-sm {
-  padding: 0px 20px;
-}
-
-/* 筛选弹窗样式 */
-.filter-mask {
-  position: fixed;
-  top: 0;
-  left: 0;
+/* 文字省略样式 */
+.text-ellipsis {
+  display: block;
   width: 100%;
-  height: 100%;
-  background: rgba(0, 0, 0, 0.6);
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  z-index: 999;
-}
-.filter-modal {
-  width: 400px;
-  background: #0e3455;
-  border: 1px solid #01fefc;
-  border-radius: 6px;
-  color: #fff;
-}
-.modal-header {
-  height: 40px;
-  line-height: 40px;
-  padding: 0 16px;
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-  border-bottom: 1px solid #114268;
-  color: #01fefc;
-  font-size: 14px;
-  font-weight: bold;
-}
-.close-icon {
-  font-size: 20px;
-  cursor: pointer;
-  color: #ccc;
-}
-.modal-form {
-  padding: 18px;
-}
-.form-row {
-  display: flex;
-  align-items: center;
-  margin-bottom: 16px;
-  .form-label {
-    width: 90px;
-    font-size: 13px;
-  }
-  .date-picker {
-    flex: 1;
-    :deep(.ant-picker) {
-      background: #114268;
-      border: 1px solid #01fefc;
-      color: #fff;
-    }
-    :deep(.ant-picker-input input) {
-      color: #fff;
-    }
-  }
-}
-.modal-footer {
-  height: 48px;
-  display: flex;
-  justify-content: flex-end;
-  gap: 12px;
-  align-items: center;
-  padding: 0 16px;
-  border-top: 1px solid #114268;
-  .btn-cancel {
-    width: 80px;
-    height: 30px;
-    background: transparent;
-    border: 1px solid #01fefc;
-    color: #fff;
-    border-radius: 3px;
-    cursor: pointer;
-  }
-  .btn-search {
-    width: 80px;
-    height: 30px;
-    background: rgba(32, 166, 169);
-    border: 1px solid #01fefc;
-    color: #fff;
-    border-radius: 3px;
-    cursor: pointer;
-  }
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
 }
 </style>

+ 9 - 0
src/views/vent/home/configurable/configurable.api.ts

@@ -24,7 +24,16 @@ enum Api {
   // 预警指标信息获取
   getWarnInfo = '/ventanaly-device/monitor/disaster/findAlarmsBySystemAndMonitorType',
   monitorAndAlertBelt = '/ventanaly-device/monitor/disaster/monitorAndAlertBelt',
+  //预警条目list
+  warningList = '/safety/managesysAlarmInfo/list',
+  // 设备预警历史查询
+  getAlarmLogList = '/monitor/groupCompany/getAlarmLogList',
+  //获取配置预警设备数据
+  getWarningDeviceList = '/safety/managesysAlarm/list',
 }
+export const warningList = (params) => defHttp.get({ url: Api.warningList, params });
+export const getWarningDeviceList = (params) => defHttp.get({ url: Api.getWarningDeviceList, params });
+export const getAlarmLogList = (params) => defHttp.post({ url: Api.getAlarmLogList, params });
 
 export const getWarnInfo = (params) => defHttp.post({ url: Api.getWarnInfo, params });
 export const getMonitorAndAlertBelt = (params) => defHttp.post({ url: Api.monitorAndAlertBelt, params });

+ 14 - 43
src/views/vent/home/configurable/configurable.data.ts

@@ -932,34 +932,28 @@ export const testConfigLink: Config[] = [
           tableReadFrom: 'warnInfo',
           columns: [
             {
-              name: '规则ID',
-              prop: 'linkID',
-              width: '120px',
+              name: '报警条目',
+              prop: 'alarmName',
             },
             {
-              name: '规则名称',
-              prop: 'warnName',
-              width: '180px',
+              name: '预警等级',
+              prop: 'alarmLevel',
             },
             {
-              name: '触发条件',
-              prop: 'grade',
-              width: '180px',
+              name: '所属系统',
+              prop: 'systemType_dictText',
             },
             {
-              name: '联动动作',
-              prop: 'warnCtrl',
-              width: '220px',
+              name: '预警类型',
+              prop: 'alarmType_dictText',
             },
             {
-              name: '状态',
-              prop: 'status',
-              width: '120px',
+              name: '创建人',
+              prop: 'createBy',
             },
             {
               name: '操作',
               prop: 'operation',
-              width: '120px',
             },
           ],
         },
@@ -967,7 +961,7 @@ export const testConfigLink: Config[] = [
       to: '',
     },
     showStyle: {
-      size: 'width:420px;height:calc(100% - 200px);',
+      size: 'width:500px;height:calc(100% - 200px);',
       version: '普通版',
       position: 'top:0px;left:10px;',
     },
@@ -1019,9 +1013,9 @@ export const testConfigLink: Config[] = [
       to: '',
     },
     showStyle: {
-      size: 'width:1020px;height:calc(100% - 76px);',
+      size: 'width:940px;height:calc(100% - 76px);',
       version: '普通版',
-      position: 'top:65px;left:440px;',
+      position: 'top:65px;left:520px;',
     },
   },
   {
@@ -1067,29 +1061,6 @@ export const testConfigLink: Config[] = [
         {
           readFrom: '',
           type: 'D',
-          tableReadFrom: 'warnInfo',
-          columns: [
-            {
-              name: '时间',
-              prop: 'updateTime',
-              width: '120px',
-            },
-            {
-              name: '规则ID',
-              prop: 'linkID',
-              width: '180px',
-            },
-            {
-              name: '动作',
-              prop: 'warnCtrl',
-              width: '180px',
-            },
-            {
-              name: '说明',
-              prop: 'grade',
-              width: '220px',
-            },
-          ],
         },
       ],
       to: '',
@@ -1147,7 +1118,7 @@ export const testConfigLink: Config[] = [
       to: '',
     },
     showStyle: {
-      size: 'width:420px;height:180px;',
+      size: 'width:500px;height:180px;',
       version: '普通版',
       position: 'bottom:10px;bottom:10px;',
     },

+ 1 - 1
src/views/vent/home/configurable/gasInjection.vue

@@ -88,7 +88,7 @@ function changeMenu(param) {
 
   .nav {
     position: absolute;
-    left: 50%;
+    left: 54%;
     top: 60px;
     transform: translate(-50%, 0);
     width: 1000px;

+ 8 - 1052
src/views/vent/home/configurable/linkConfiguration.vue

@@ -13,45 +13,18 @@
   </div>
 </template>
 <script lang="ts" setup>
-import { onMounted, onUnmounted, ref, computed, nextTick, onBeforeMount, watch } from 'vue';
+import { onMounted, onUnmounted, ref, watch } from 'vue';
 import { useInitConfigs, useInitPage } from './hooks/useInit';
 import ModuleCommonHsq from './components/ModuleCommonHsq.vue';
-import { getSystemApi, getWarnInfo, getMonitorAndAlertBelt } from './configurable.api';
+import { getAlarmLogList, warningList } from './configurable.api';
 import { testConfigLink } from './configurable.data';
 
 const { configs, fetchConfigs } = useInitConfigs();
 const { data, updateData } = useInitPage('红沙泉露天煤矿系统');
+const warnResult = ref({
+  warnInfo: [] as any[],
+});
 let interval: number | undefined;
-
-// https获取监测数据
-let timer: null | NodeJS.Timeout = null;
-// 预警等级映射
-const warnTypeMap = {
-  '102': '黄色预警(较大风险)',
-  '103': '橙色预警(重大风险)',
-  '104': '红色预警(特别重大风险)',
-} as const;
-type WarnKey = keyof typeof warnTypeMap;
-
-// 原始单项设备接口类型
-interface RawDeviceItem {
-  deviceType: string;
-  fmin?: number | null;
-  fmax?: number | null;
-  trendMin?: number | null;
-  trendMax?: number | null;
-  trendCxTimeUnit?: number | null;
-}
-
-// 原地扩展后的设备项类型
-interface ExtendDeviceItem extends RawDeviceItem {
-  warnName?: string;
-  warnCtrl?: string;
-  // 统一存储阈值区间
-  valRange?: string;
-  // 统一存储趋势描述
-  trendDesc?: string;
-}
 onMounted(() => {
   fetchConfigs('gas_injection').then(() => {
     configs.value = testConfigLink;
@@ -60,1026 +33,9 @@ onMounted(() => {
 });
 // 刷新数据
 async function refresh() {
-  const warnInfo = [
-    {
-      id: '2057298950319865857',
-      alarmId: '2054074660250234881',
-      alarmName: null,
-      relId: null,
-      orderNum: null,
-      createBy: 'admin',
-      createTime: '2026-05-12 13:42:17',
-      updateBy: null,
-      updateTime: '2026-05-21 11:14:27',
-      sysOrgCode: 'A02A02',
-      sysId: '2028657172566073346',
-      deviceId: '2041418763917168642',
-      monitorId: '1611236056970682458',
-      fmin: 24,
-      fmax: 40,
-      bpmStatus: null,
-      orgCode: null,
-      cxTime: 10,
-      value: null,
-      monitorType: 2,
-      remark: null,
-      dataTrend: '',
-      trendCxTime: null,
-      trendCxTimeUnit: null,
-      trendMin: null,
-      trendMax: null,
-      alarmFlag: null,
-      errTime: null,
-      realAlarmFlag: null,
-      devicePos: null,
-      monitorName: null,
-      deviceName: null,
-      deviceType: 'modelsensor_co',
-      deviceKind: 'modelsensor',
-      warnName: 'CO预警联动',
-      warnCtrl: 'CO报警',
-      status: '启用',
-      grade: '24-40%',
-      linkID: '102',
-    },
-    {
-      id: '2057298950324060162',
-      alarmId: '2054074660250234881',
-      alarmName: null,
-      relId: null,
-      orderNum: null,
-      createBy: 'admin',
-      createTime: '2026-05-12 13:42:17',
-      updateBy: null,
-      updateTime: '2026-05-21 11:14:27',
-      sysOrgCode: 'A02A02',
-      sysId: '2028657172566073346',
-      deviceId: '2041424670260563970',
-      monitorId: '1572423736964422888',
-      fmin: 30,
-      fmax: 34,
-      bpmStatus: null,
-      orgCode: null,
-      cxTime: 10,
-      value: null,
-      monitorType: 2,
-      remark: null,
-      dataTrend: '',
-      trendCxTime: null,
-      trendCxTimeUnit: null,
-      trendMin: null,
-      trendMax: null,
-      alarmFlag: null,
-      errTime: null,
-      realAlarmFlag: null,
-      devicePos: null,
-      monitorName: null,
-      deviceName: null,
-      deviceType: 'modelsensor_temperature',
-      deviceKind: 'modelsensor',
-      warnName: '温度预警联动',
-      warnCtrl: '温度报警',
-      status: '启用',
-      grade: '30-34℃',
-      linkID: '102',
-    },
-    {
-      id: '2057298950328254466',
-      alarmId: '2054074660250234881',
-      alarmName: null,
-      relId: null,
-      orderNum: null,
-      createBy: 'admin',
-      createTime: '2026-05-12 13:42:17',
-      updateBy: null,
-      updateTime: '2026-05-21 11:14:27',
-      sysOrgCode: 'A02A02',
-      sysId: '2028657172566073346',
-      deviceId: '2041418763917168642',
-      monitorId: '1611236056970682458',
-      fmin: null,
-      fmax: null,
-      bpmStatus: null,
-      orgCode: null,
-      cxTime: null,
-      value: null,
-      monitorType: 2,
-      remark: null,
-      dataTrend: '0',
-      trendCxTime: 1,
-      trendCxTimeUnit: 0,
-      trendMin: 5,
-      trendMax: 10,
-      alarmFlag: null,
-      errTime: null,
-      realAlarmFlag: null,
-      devicePos: null,
-      monitorName: null,
-      deviceName: null,
-      deviceType: 'modelsensor_co',
-      deviceKind: 'modelsensor',
-      warnName: 'CO预警联动',
-      warnCtrl: 'CO报警',
-      status: '启用',
-      grade: '24-40%',
-      linkID: '102',
-    },
-    {
-      id: '2057298950332448770',
-      alarmId: '2054074660250234881',
-      alarmName: null,
-      relId: null,
-      orderNum: null,
-      createBy: 'admin',
-      createTime: '2026-05-12 13:42:17',
-      updateBy: null,
-      updateTime: '2026-05-21 11:14:27',
-      sysOrgCode: 'A02A02',
-      sysId: '2028657172566073346',
-      deviceId: '2041412005203120129',
-      monitorId: '2041411689489469441',
-      fmin: 0,
-      fmax: 5,
-      bpmStatus: null,
-      orgCode: null,
-      cxTime: 10,
-      value: null,
-      monitorType: 2,
-      remark: null,
-      dataTrend: '',
-      trendCxTime: null,
-      trendCxTimeUnit: null,
-      trendMin: null,
-      trendMax: null,
-      alarmFlag: null,
-      errTime: null,
-      realAlarmFlag: null,
-      devicePos: null,
-      monitorName: null,
-      deviceName: null,
-      deviceType: 'modelsensor_hcl',
-      deviceKind: 'modelsensor',
-      warnName: 'HCL预警联动',
-      warnCtrl: 'HCL报警',
-      status: '启用',
-      grade: '0-5%',
-      linkID: '102',
-    },
-    {
-      id: '2057298950336643073',
-      alarmId: '2054074660250234881',
-      alarmName: null,
-      relId: null,
-      orderNum: null,
-      createBy: 'admin',
-      createTime: '2026-05-12 13:42:17',
-      updateBy: null,
-      updateTime: '2026-05-21 11:14:27',
-      sysOrgCode: 'A02A02',
-      sysId: '2028657172566073346',
-      deviceId: '2041424670260563970',
-      monitorId: '1572423736964422888',
-      fmin: null,
-      fmax: null,
-      bpmStatus: null,
-      orgCode: null,
-      cxTime: null,
-      value: null,
-      monitorType: 2,
-      remark: null,
-      dataTrend: '0',
-      trendCxTime: 1,
-      trendCxTimeUnit: 1,
-      trendMin: 3,
-      trendMax: null,
-      alarmFlag: null,
-      errTime: null,
-      realAlarmFlag: null,
-      devicePos: null,
-      monitorName: null,
-      deviceName: null,
-      deviceType: 'modelsensor_temperature',
-      deviceKind: 'modelsensor',
-      warnName: '温度预警联动',
-      warnCtrl: '温度报警',
-      status: '启用',
-      grade: '30-34℃',
-      linkID: '102',
-    },
-  ];
-  const resWarn = await {
-    warn_result: [
-      {
-        area: '2#分区红色预警',
-        sysId: 2028657172566073300,
-        advice: '',
-        alarmId: '2054086700515766273',
-        alarmRecords: {
-          '1': [
-            {
-              id: '2054086700679344130',
-              alarmId: '2054086700515766273',
-              alarmName: null,
-              relId: null,
-              orderNum: 1,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:30:07',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041442374828765186',
-              monitorId: '1611236056970682449',
-              fmin: null,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: null,
-              value: '1',
-              monitorType: 1,
-              remark: '',
-              dataTrend: null,
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#球阀',
-              monitorName: '启动',
-              deviceName: '东翼胶带运输大巷球阀',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054086700683538433',
-              alarmId: '2054086700515766273',
-              alarmName: null,
-              relId: null,
-              orderNum: 1,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:30:07',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041442374828765187',
-              monitorId: '1611236056970682449',
-              fmin: null,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: null,
-              value: '1',
-              monitorType: 1,
-              remark: '',
-              dataTrend: null,
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '2#球阀',
-              monitorName: '启动',
-              deviceName: '东翼胶带运输大巷球阀',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054088286164004866',
-              alarmId: '2054086700515766273',
-              alarmName: null,
-              relId: null,
-              orderNum: 2,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:36:25',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '1752953874179284994',
-              monitorId: '1752953596814155778',
-              fmin: null,
-              fmax: null,
-              bpmStatus: '1',
-              orgCode: null,
-              cxTime: null,
-              value: '',
-              monitorType: 1,
-              remark: null,
-              dataTrend: null,
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '风门6',
-              monitorName: '同时打开',
-              deviceName: '风门6',
-              deviceType: null,
-              deviceKind: null,
-            },
-          ],
-          '2': [
-            {
-              id: '2054086700662566914',
-              alarmId: '2054086700515766273',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:30:07',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041418763917168643',
-              monitorId: '1611236056970682458',
-              fmin: 100,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '2#CO传感器',
-              monitorName: '一氧化碳',
-              deviceName: '东翼胶带运输大巷CO传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054086700666761217',
-              alarmId: '2054086700515766273',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:30:07',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041424670260563971',
-              monitorId: '1572423736964422888',
-              fmin: 50,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '2#温度传感器',
-              monitorName: '温度',
-              deviceName: '东翼胶带运输大巷温度传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054086700666761218',
-              alarmId: '2054086700515766273',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:30:07',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041418763917168643',
-              monitorId: '1611236056970682458',
-              fmin: null,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: null,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '0',
-              trendCxTime: 1,
-              trendCxTimeUnit: 0,
-              trendMin: 20,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '2#CO传感器',
-              monitorName: '一氧化碳',
-              deviceName: '东翼胶带运输大巷CO传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054086700670955522',
-              alarmId: '2054086700515766273',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:30:07',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041412005203120130',
-              monitorId: '2041411689489469441',
-              fmin: 10,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '2#HCl传感器',
-              monitorName: 'HCl浓度',
-              deviceName: '东翼胶带运输大巷HCl传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054086700670955523',
-              alarmId: '2054086700515766273',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:30:07',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041424670260563971',
-              monitorId: '1572423736964422888',
-              fmin: null,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: null,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '0',
-              trendCxTime: 1,
-              trendCxTimeUnit: 0,
-              trendMin: 5,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '2#温度传感器',
-              monitorName: '温度',
-              deviceName: '东翼胶带运输大巷温度传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054086700675149826',
-              alarmId: '2054086700515766273',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:30:07',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041422154215034882',
-              monitorId: '1611236056970682454',
-              fmin: 0,
-              fmax: 1,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '2#火焰传感器',
-              monitorName: '火焰',
-              deviceName: '东翼胶带运输大巷火焰传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-          ],
-        },
-        logId: '2054096987822272514',
-        time: '2026-05-12 00:00:00',
-        type: '火焰异常!',
-        deviceId: 2041422154215035000,
-        status: '104',
-      },
-      {
-        area: '1#分区橙色预警',
-        sysId: 2028657172566073300,
-        advice: '',
-        alarmId: '2054081842890977282',
-        alarmRecords: {
-          '1': [
-            {
-              id: '2054081843079720961',
-              alarmId: '2054081842890977282',
-              alarmName: null,
-              relId: null,
-              orderNum: 1,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:10:49',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041442374828765186',
-              monitorId: '1611236056970682449',
-              fmin: null,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: null,
-              value: '1',
-              monitorType: 1,
-              remark: '',
-              dataTrend: null,
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#球阀',
-              monitorName: '启动',
-              deviceName: '东翼胶带运输大巷球阀',
-              deviceType: null,
-              deviceKind: null,
-            },
-          ],
-          '2': [
-            {
-              id: '2054081843062943745',
-              alarmId: '2054081842890977282',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:10:49',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041418763917168642',
-              monitorId: '1611236056970682458',
-              fmin: 40,
-              fmax: 100,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#CO传感器',
-              monitorName: '一氧化碳',
-              deviceName: '东翼胶带运输大巷CO传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054081843067138049',
-              alarmId: '2054081842890977282',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:10:49',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041424670260563970',
-              monitorId: '1572423736964422888',
-              fmin: 34,
-              fmax: 50,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#温度传感器',
-              monitorName: '温度',
-              deviceName: '东翼胶带运输大巷温度传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054081843067138050',
-              alarmId: '2054081842890977282',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:10:49',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041418763917168642',
-              monitorId: '1611236056970682458',
-              fmin: null,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: null,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '0',
-              trendCxTime: 1,
-              trendCxTimeUnit: 0,
-              trendMin: 10,
-              trendMax: 20,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#CO传感器',
-              monitorName: '一氧化碳',
-              deviceName: '东翼胶带运输大巷CO传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054081843067138051',
-              alarmId: '2054081842890977282',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:10:49',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041412005203120129',
-              monitorId: '2041411689489469441',
-              fmin: 5,
-              fmax: 10,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#HCl传感器',
-              monitorName: 'HCl浓度',
-              deviceName: '东翼胶带运输大巷HCl传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054081843071332353',
-              alarmId: '2054081842890977282',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:10:49',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041424670260563970',
-              monitorId: '1572423736964422888',
-              fmin: null,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: null,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '0',
-              trendCxTime: 1,
-              trendCxTimeUnit: 0,
-              trendMin: 1,
-              trendMax: 5,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#温度传感器',
-              monitorName: '温度',
-              deviceName: '东翼胶带运输大巷温度传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2054081843075526657',
-              alarmId: '2054081842890977282',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 14:10:49',
-              updateBy: null,
-              updateTime: null,
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2039530720717275137',
-              monitorId: '1572423736972820485',
-              fmin: 0,
-              fmax: 1,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#烟雾传感器',
-              monitorName: '烟雾',
-              deviceName: '东翼胶带运输大巷烟雾传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-          ],
-        },
-        logId: '2054091940778520577',
-        time: '2026-05-12 00:00:00',
-        type: '烟雾异常!',
-        deviceId: 2039530720717275100,
-        status: '103',
-      },
-      {
-        area: '1#分区黄色预警',
-        sysId: 2028657172566073300,
-        advice: '',
-        alarmId: '2054074660250234881',
-        alarmRecords: {
-          '1': [],
-          '2': [
-            {
-              id: '2057298950319865857',
-              alarmId: '2054074660250234881',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 13:42:17',
-              updateBy: null,
-              updateTime: '2026-05-21 11:14:27',
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041418763917168642',
-              monitorId: '1611236056970682458',
-              fmin: 24,
-              fmax: 40,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#CO传感器',
-              monitorName: '一氧化碳',
-              deviceName: '东翼胶带运输大巷CO传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2057298950324060162',
-              alarmId: '2054074660250234881',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 13:42:17',
-              updateBy: null,
-              updateTime: '2026-05-21 11:14:27',
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041424670260563970',
-              monitorId: '1572423736964422888',
-              fmin: 30,
-              fmax: 34,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#温度传感器',
-              monitorName: '温度',
-              deviceName: '东翼胶带运输大巷温度传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2057298950328254466',
-              alarmId: '2054074660250234881',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 13:42:17',
-              updateBy: null,
-              updateTime: '2026-05-21 11:14:27',
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041418763917168642',
-              monitorId: '1611236056970682458',
-              fmin: null,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: null,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '0',
-              trendCxTime: 1,
-              trendCxTimeUnit: 0,
-              trendMin: 5,
-              trendMax: 10,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#CO传感器',
-              monitorName: '一氧化碳',
-              deviceName: '东翼胶带运输大巷CO传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2057298950332448770',
-              alarmId: '2054074660250234881',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 13:42:17',
-              updateBy: null,
-              updateTime: '2026-05-21 11:14:27',
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041412005203120129',
-              monitorId: '2041411689489469441',
-              fmin: 0,
-              fmax: 5,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: 10,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '',
-              trendCxTime: null,
-              trendCxTimeUnit: null,
-              trendMin: null,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#HCl传感器',
-              monitorName: 'HCl浓度',
-              deviceName: '东翼胶带运输大巷HCl传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-            {
-              id: '2057298950336643073',
-              alarmId: '2054074660250234881',
-              alarmName: null,
-              relId: null,
-              orderNum: null,
-              createBy: 'admin',
-              createTime: '2026-05-12 13:42:17',
-              updateBy: null,
-              updateTime: '2026-05-21 11:14:27',
-              sysOrgCode: 'A02A02',
-              sysId: '2028657172566073346',
-              deviceId: '2041424670260563970',
-              monitorId: '1572423736964422888',
-              fmin: null,
-              fmax: null,
-              bpmStatus: null,
-              orgCode: null,
-              cxTime: null,
-              value: null,
-              monitorType: 2,
-              remark: null,
-              dataTrend: '0',
-              trendCxTime: 1,
-              trendCxTimeUnit: 1,
-              trendMin: 3,
-              trendMax: null,
-              alarmFlag: null,
-              errTime: null,
-              realAlarmFlag: null,
-              devicePos: '1#温度传感器',
-              monitorName: '温度',
-              deviceName: '东翼胶带运输大巷温度传感器',
-              deviceType: null,
-              deviceKind: null,
-            },
-          ],
-        },
-        logId: '2054091940572999682',
-        time: '2026-05-12 00:00:00',
-        type: '一氧化碳异常!',
-        deviceId: 2041418763917168600,
-        status: '102',
-      },
-    ],
-  };
-  resWarn.warnInfo = warnInfo;
-  console.log(resWarn, '预警指标信息');
-  updateData(resWarn);
+  const res = await warningList({ sysId: '2074416476136718337' });
+  warnResult.value.warnInfo = res.records;
+  updateData(warnResult.value);
 }
 
 watch(