瀏覽代碼

代码提交

cxs 3 周之前
父節點
當前提交
03df76c75c
共有 2 個文件被更改,包括 42 次插入11 次删除
  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
 });
 
 // 查询功能