cxs hace 3 semanas
padre
commit
03df76c75c
Se han modificado 2 ficheros con 42 adiciones y 11 borrados
  1. 40 9
      src/views/alarm/singleDevice/index.vue
  2. 2 2
      src/views/alarm/software/index.vue

+ 40 - 9
src/views/alarm/singleDevice/index.vue

@@ -237,18 +237,49 @@ const getCustomImg = (iconName: string) => {
 
 // 表格配置项
 const columns = reactive<ColumnProps[]>([
-  { prop: "a", label: "状态"},
-  { prop: "b", label: "状态值"},
-  { prop: "c", label: "备注" },
+  { prop: "sta_name", label: "状态"},
+  { prop: "sta_value", label: "状态值"},
+  { prop: "sta_remark", label: "备注" },
 ]);
 
 
-const handlePlatform = (item)=>{
-  radio1.value = '1'
-  itemData.value = item
-  dialog2.visible = true
-  dialog2.title = '传感器信息'
-}
+const handlePlatform = (item) => {
+  if (!item || typeof item !== 'object') {
+    console.error('Invalid item provided');
+    return;
+  }
+
+  radio1.value = '1';
+  itemData.value = item;
+  dialog2.visible = true;
+  dialog2.title = '传感器信息';
+
+  processTableData2.value = [];
+
+  const { se_type } = item;
+  if (se_type === undefined || se_type === null) {
+    console.error('Invalid se_type in item');
+    return;
+  }
+
+  switch (se_type) {
+    case 0:
+      processTableData2.value = processTableFrom.value?.sta_yclq || [];
+      break;
+    case 1:
+      processTableData2.value = processTableFrom.value?.sta_txmk || [];
+      break;
+    default:
+      console.log(se_type);
+      const result = processTableFrom.value?.sta_list?.find(obj => obj.id === se_type.toString());
+      if (result) {
+        processTableData2.value = result.item || [];
+      } else {
+        console.warn(`No matching entry found for se_type: ${se_type}`);
+      }
+      break;
+  }
+};
 
 const itemData= ref({})
 

+ 2 - 2
src/views/alarm/software/index.vue

@@ -52,7 +52,7 @@ import { ColumnProps } from "@/components/ProTable/interface";
 const pageable = ref<any>({
   pageNum: 1,
   pageSize: 20,
-  total: 1
+  total: 0
 });
 
 const queryParams = ref({
@@ -60,7 +60,7 @@ const queryParams = ref({
   name:'',
   pageNum: 1,
   pageSize: 20,
-  total: 2
+  total: 0
 });
 
 // 查询功能