Преглед изворни кода

设备管理点表关联参数传递错误

hongrunxia пре 1 година
родитељ
комит
b9d72a6de7

+ 4 - 5
src/views/vent/deviceManager/comment/DeviceModal.vue

@@ -12,12 +12,12 @@
   >
     <a-tabs v-if="props.showTab" v-model:activeKey="activeKey">
       <a-tab-pane key="1" tab="基本信息" force-render>
-        <FormModal :record="record" @saveOrUpdate="(values) => emit('saveOrUpdate', values)" />
+        <FormModal :record="deviceData" @saveOrUpdate="(values) => emit('saveOrUpdate', values)" />
       </a-tab-pane>
       <a-tab-pane key="2" tab="点表关联">
         <PointTable
           :columns="pointColumns"
-          :pointType="record.strtype"
+          :pointType="deviceData.strtype"
           :deviceId="deviceData.id"
           @save="savePointData"
           @delete="deletePointById"
@@ -31,13 +31,13 @@
       </a-tab-pane>
       <a-tab-pane key="5" :tab="deviceType !== 'managesys' ? '报警配置' : '配置预警设备'">
         <template v-if="activeKey == '5'">
-          <WarningTable v-if="deviceType !== 'managesys'" :deviceId="deviceData.id" :pointType="record.strtype" />
+          <WarningTable v-if="deviceType !== 'managesys'" :deviceId="deviceData.id" :pointType="deviceData.strtype" />
           <BackWindDeviceTable  v-else :deviceId="deviceData.id" />
         </template>
       </a-tab-pane>
       <a-tab-pane v-if="deviceType == 'managesys'" key = "6" tab="配置控制设备">
         <template v-if="activeKey == '6'">
-          <WarningTable v-if="deviceType !== 'managesys'" :deviceId="deviceData.id" :pointType="record.strtype" />
+          <WarningTable v-if="deviceType !== 'managesys'" :deviceId="deviceData.id" :pointType="deviceData.strtype" />
           <ManagerWarningTable v-else :deviceId="deviceData.id" />
         </template>
       </a-tab-pane>
@@ -86,7 +86,6 @@
   
   //表单赋值
   const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
-    debugger
     //重置表单
     setModalProps({ confirmLoading: false });
     Object.assign(record, data.record);

+ 10 - 4
src/views/vent/deviceManager/comment/pointTabel/PointTable.vue

@@ -39,7 +39,7 @@
   </div>
 </template>
 <script lang="ts">
-  import { defineComponent, ref, nextTick, inject, onMounted } from 'vue';
+  import { defineComponent, ref, nextTick, inject, onMounted, watch } from 'vue';
   import { BasicTable, useTable, TableAction, BasicColumn, ActionItem, EditRecordRow } from '/@/components/Table';
   import { Select } from 'ant-design-vue';
   import { ApiTreeSelect } from '/@/components/Form';
@@ -200,12 +200,18 @@
         }
         // console.log(column, value, record);
       }
-      async function getDataSource() {
-        const result = await list({ devicetype: props.pointType, valuetype: 9, deviceid: props.deviceId });
+
+      // watch(() => props.pointType, async(pointType) => {
+      //   await getDataSource(pointType)
+      // })
+
+      async function getDataSource(pointType) {
+        debugger
+        const result = await list({ devicetype: pointType, valuetype: 9, deviceid: props.deviceId });
         dataSource.value = result.records;
       }
       onMounted(async () => {
-        await getDataSource();
+        await getDataSource(props.pointType);
       });
 
       return {

+ 10 - 8
src/views/vent/monitorManager/sensorMonitor/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="sensor-container">
     <a-spin :spinning="loading">
-      <a-tabs class="tabs-box" type="card" v-model:activeKey="activeKey" @change="tabChange">
+      <a-tabs class="tabs-box" type="card" v-model:activeKey="activeKey" @change="tabChange" >
         <a-tab-pane key="1" tab="实时监测">
           <div class="box-bg table-box" style="margin-bottom: 10px">
             <label style="color: #fff">设备类型:</label>
@@ -21,6 +21,7 @@
               design-scope="modelsensor_monitor"
               @select-row="getSelectRow"
               :deviceType="deviceKind"
+              :scroll="{ y: 300 }"
               size="''"
               title="传感器监测"
             >
@@ -41,7 +42,7 @@
               :chartsColumnsType="selectData.deviceType"
               xAxisPropType="readTime"
               :dataSource="detailDataSource"
-              height="100%"
+              height="300px"
               :chartsColumns="chartsColumns"
               chartsType="detail"
               :option="echartsOption"
@@ -285,28 +286,29 @@
     padding: 10px 0 !important;
   }
   .sensor-container {
+    height: 100%;
     position: relative;
     top: 65px;
     padding: 10px;
     z-index: 999;
-    max-height: calc(100vh - 150px);
+    // max-height: calc(100vh - 150px);
     .@{ventSpace}-tabs {
-      max-height: calc(100vh - 100px);
+      max-height: calc(100% - 100px);
       .tab-item {
-        max-height: calc(100vh - 170px);
+        max-height: calc(100% - 170px);
         overflow-y: auto;
       }
     }
     .title-text {
       position: absolute;
-      top: -14px;
+      top: -24px;
       left: 0;
       width: 100%;
       text-align: center;
       color: #fff;
     }
     .table-box {
-      height: calc(60vh - 150px);
+      height: calc(60% - 150px);
       padding: 20px 10px;
       overflow-y: auto;
     }
@@ -328,7 +330,7 @@
       overflow-y: auto;
     }
     .charts-box {
-      height: calc(40vh - 80px);
+      height: calc(40% - 80px);
       padding: 5px 10px;
       margin-top: 10px;
     }

+ 48 - 45
src/views/vent/monitorManager/tunFaceMonitor/components/tunFaceGasHome.vue

@@ -153,52 +153,55 @@ function getMonitor(flag?) {
 async function getDataSource(systemID) {
   const res = await list({ devicetype: 'sys', systemID });
   const result = res.msgTxt;
-  result.forEach(item => {
-    // ''.startsWith
-    if (item.type.startsWith('gate')) {
-      // 风门
-      gateDataSource.value = item['datalist'].filter((data: any) => {
-        const readData = data.readData;
-        return Object.assign(data, readData);
-      })
+  if(result && result.length > 0){
+    result.forEach(item => {
+      // ''.startsWith
+      if (item.type.startsWith('gate')) {
+        // 风门
+        gateDataSource.value = item['datalist'].filter((data: any) => {
+          const readData = data.readData;
+          return Object.assign(data, readData);
+        })
 
-    }
-    if (item.type.startsWith('window')) {
-      // 风窗
-      windowDataSource.value = item['datalist'].filter((data: any) => {
-        const readData = data.readData;
-        return Object.assign(data, readData);
-      })
-    }
-    if (item.type.startsWith('windrect')) {
-      // 测风
-      windDataSource.value = item['datalist'].filter((data: any) => {
-        const readData = data.readData;
-        return Object.assign(data, readData);
-      })
-    }
-    if (item.type === 'modelsensor_temperature') {
-      // 温度
-      temperatureDataSource.value = item['datalist'].filter((data: any) => {
-        const readData = data.readData;
-        return Object.assign(data, readData);
-      })
-    }
-    if (item.type === 'modelsensor_fire') {
-      // 火焰
-      fireDataSource.value = item['datalist'].filter((data: any) => {
-        const readData = data.readData;
-        return Object.assign(data, readData);
-      })
-    }
-    if (item.type === 'sys') {
-      workFaceSource.value = Object.assign(item['datalist'][0], item['datalist'][0].readData);
-    }
-    if (item.type === 'surface_history') {
-      workFaceHistorySource.value = item['datalist'][0]
-    }
-    loading.value = false;
-  })
+      }
+      if (item.type.startsWith('window')) {
+        // 风窗
+        windowDataSource.value = item['datalist'].filter((data: any) => {
+          const readData = data.readData;
+          return Object.assign(data, readData);
+        })
+      }
+      if (item.type.startsWith('windrect')) {
+        // 测风
+        windDataSource.value = item['datalist'].filter((data: any) => {
+          const readData = data.readData;
+          return Object.assign(data, readData);
+        })
+      }
+      if (item.type === 'modelsensor_temperature') {
+        // 温度
+        temperatureDataSource.value = item['datalist'].filter((data: any) => {
+          const readData = data.readData;
+          return Object.assign(data, readData);
+        })
+      }
+      if (item.type === 'modelsensor_fire') {
+        // 火焰
+        fireDataSource.value = item['datalist'].filter((data: any) => {
+          const readData = data.readData;
+          return Object.assign(data, readData);
+        })
+      }
+      if (item.type === 'sys') {
+        workFaceSource.value = Object.assign(item['datalist'][0], item['datalist'][0].readData);
+      }
+      if (item.type === 'surface_history') {
+        workFaceHistorySource.value = item['datalist'][0]
+      }
+      loading.value = false;
+    })
+  }
+  
 }
 
 function toDetail() {