Ver código fonte

束管日报表修改

bobo04052021@163.com 3 meses atrás
pai
commit
9962b57f47

+ 13 - 13
src/views/vent/bundle/bundleMonitorTable/bundle-table.data.ts

@@ -11,7 +11,7 @@ export const columns: BasicColumn[] = [
     title: '测点名称',
     dataIndex: 'jcdd',
     key: 'jcdd',
-    width: 130,
+    width: 150,
     align: 'center',
   },
   {
@@ -28,14 +28,14 @@ export const columns: BasicColumn[] = [
         title: '最大值',
         dataIndex: 'co_max',
         key: 'co_max',
-        width: 100,
+        width: 80,
         align: 'center',
       },
       {
         title: '平均值',
         dataIndex: 'co_ave',
         key: 'co_ave',
-        width: 120,
+        width: 80,
         align: 'center',
       },
     ],
@@ -47,14 +47,14 @@ export const columns: BasicColumn[] = [
         title: '最大值',
         dataIndex: 'co2_max',
         key: 'co2_max',
-        width: 100,
+        width: 80,
         align: 'center',
       },
       {
         title: '平均值',
         dataIndex: 'co2_ave',
         key: 'co2_ave',
-        width: 120,
+        width: 80,
         align: 'center',
       },
     ],
@@ -66,14 +66,14 @@ export const columns: BasicColumn[] = [
         title: '最小值',
         dataIndex: 'o2_min',
         key: 'o2_min',
-        width: 100,
+        width: 80,
         align: 'center',
       },
       {
         title: '平均值',
         dataIndex: 'o2_ave',
         key: 'o2_ave',
-        width: 120,
+        width: 80,
         align: 'center',
       },
     ],
@@ -85,14 +85,14 @@ export const columns: BasicColumn[] = [
         title: '最大值',
         dataIndex: 'ch4_max',
         key: 'ch4_max',
-        width: 100,
+        width: 80,
         align: 'center',
       },
       {
         title: '平均值',
         dataIndex: 'ch4_ave',
         key: 'ch4_ave',
-        width: 120,
+        width: 80,
         align: 'center',
       },
     ],
@@ -104,14 +104,14 @@ export const columns: BasicColumn[] = [
         title: '最大值',
         dataIndex: 'c2h2_max',
         key: 'c2h2_max',
-        width: 100,
+        width: 80,
         align: 'center',
       },
       {
         title: '平均值',
         dataIndex: 'c2h2_ave',
         key: 'c2h2_ave',
-        width: 120,
+        width: 80,
         align: 'center',
       },
     ],
@@ -123,14 +123,14 @@ export const columns: BasicColumn[] = [
         title: '最大值',
         dataIndex: 'c2h4_max',
         key: 'c2h4_max',
-        width: 100,
+        width: 80,
         align: 'center',
       },
       {
         title: '平均值',
         dataIndex: 'c2h4_ave',
         key: 'c2h4_ave',
-        width: 120,
+        width: 80,
         align: 'center',
       },
     ],

+ 3 - 17
src/views/vent/bundle/bundleMonitorTable/index.vue

@@ -13,25 +13,11 @@ import customHeader from '/@/components/vent/customHeader.vue';
 
 let tableData = ref<any[]>([]);
 
-//获取粉尘监测结果数据
 async function getTableList() {
   let res = await getBundleInfoList({ type: 'bundle' });
-  console.log('API 返回的数据:', res); // 打印 API 返回的完整数据
-  if (res && res.result && typeof res.result.content === 'string') {
-    try {
-      let content = JSON.parse(res.result.content);
-      if (Array.isArray(content)) {
-        content.forEach((element) => {
-          element.zygx = '生产\n检修'; // 新增 zygx 字段
-        });
-        tableData.value = content;
-      } else {
-        console.error('解析后的 content 不是一个数组:', content);
-      }
-    } catch (error) {
-      console.error('解析 content 字符串时出错:', error);
-    }
-  }
+  const content = res.content;
+  let contentArr = JSON.parse(content);
+  tableData.value = contentArr;
 }
 
 onMounted(() => {