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

+ 5 - 2
src/views/vent/monitorManager/comment/GroupMonitorTable.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="vent-table">
     <a-radio-group v-model:value="selectRowIndex" @change="setSelectedRowKeys" style="width: 100%">
-      <a-table :columns="columns" :pagination="false" :data-source="dataTableSource" bordered style="margin-top: 5px" :scroll="tableScroll" :selectType="'radio'" :customRow="rowClick">
+      <a-table :columns="columns" :pagination="false" :data-source="dataTableSource" ref="tableRef" bordered style="margin-top: 5px" :scroll="tableScroll" :selectType="'radio'" :customRow="rowClick">
         <template #bodyCell="{ column, record }">
           <template v-if="column.dataIndex === 'isCheck'">
             <a-radio :value="record.deviceID" />
@@ -57,7 +57,7 @@
       default: true
     }
   });
-
+  const tableRef = ref()
   const emits = defineEmits(['selectRow']);
   const dataTableSource = ref<any[]>([]);
   const loading = ref(true);
@@ -236,6 +236,9 @@
   onMounted(() => {
     // 如果是https
     // 反之是websocket
+    
+    debugger
+
   });
 
   onUnmounted(() => {});

+ 17 - 7
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -202,7 +202,7 @@
         </div> -->
         <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
           <a-tab-pane key="1" tab="实时监测">
-            <GroupMonitorTable  v-if="activeKey === '1'" ref="MonitorDataTable" :dataSource="dataSource" :columnsType="`${selectData.deviceType}_monitor`" @selectRow="getSelectRow" :scroll="scroll" :is-action="true">
+            <GroupMonitorTable  v-if="activeKey === '1'" ref="MonitorDataTable" :dataSource="dataSource" :columnsType="`${selectData.deviceType}_monitor`" @selectRow="getSelectRow" :scroll="{y: scroll.y - (headElHeight - 56) }" :is-action="true">
               <template #action="{ record }">
                 <a class="table-action-link" @click="deviceEdit($event, 'reportInfo', record)">报表录入</a>
                 <a class="table-action-link" @click="deviceEdit($event, 'deviceInfo', record)">设备编辑</a>
@@ -527,7 +527,7 @@
   const leftColumns = ref<BasicColumn[]>([])
   const devicekide = ref('fanlocal')
   const deviceType = ref(selectData.deviceType)
-
+  let headElHeight = ref(0)
 
   watch(deviceType , (type) => {
     rightColumns.value = getTableHeaderColumns(type + '_monitor_right') as []
@@ -554,6 +554,12 @@
       selectData = lodash.cloneDeep(initData)
       loading.value = false
       if(selectData.deviceID)MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID])
+      
+      const headEl = document.querySelector(`.zxm-table-thead`);
+      if (headEl) {
+        headElHeight.value = headEl.clientHeight
+      }
+
     })
   }
 
@@ -652,6 +658,12 @@
     modalType.value = selectIndex > 0 ? 'fm' : 'fc';
 
     nextTick(() => {
+      debugger
+      const headEl = document.querySelector(`.zxm-table-thead`);
+      if (headEl) {
+        headElHeight.value = headEl.clientHeight
+      }
+
       setModelType(modalType.value).then(() => {
         // loading.value = false;
       });
@@ -857,12 +869,10 @@
 
   onMounted(() => {
     
-    mountedThree(player1.value).then(() => {
+    mountedThree(player1.value).then(async () => {
+      await getMonitor(true);
       nextTick(async() => {
-        await getMonitor(true);
-        
-        addCssText();
-        // playSmoke('startSmoke', 'top', frequencyVal.value, 'open');
+        addCssText();        
       });
     });
     document.body.addEventListener('mousedown', addPlayVideo, false);

+ 8 - 2
src/views/vent/monitorManager/mainFanMonitor/index.vue

@@ -202,7 +202,7 @@
       <dv-border-box8 :dur="5"  :style="`padding: 5px; height: ${scroll.y + 120}px`" >
         <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
           <a-tab-pane key="1" tab="实时监测">
-            <GroupMonitorTable v-if="activeKey === '1'" ref="MonitorDataTable" :dataSource="dataSource" columnsType="fanmain_monitor" @selectRow="getSelectRow" :scroll="scroll"/>
+            <GroupMonitorTable v-if="activeKey === '1'" ref="MonitorDataTable" :dataSource="dataSource" columnsType="fanmain_monitor" @selectRow="getSelectRow" :scroll="{y: scroll.y - (headElHeight - 56)}"/>
           </a-tab-pane>
           <!-- <a-tab-pane key="2" tab="实时曲线图" force-render>
             <div class="tab-item" v-if="activeKey === '2'">
@@ -364,6 +364,7 @@
   const dataMonitorRowIndex = ref(0);
   // 默认数据右边监测的是1#风机
   const warningMonitorRowIndex = ref(0);
+  let headElHeight = ref(0)
 
   // 监测数据
   const selectData = reactive({
@@ -511,7 +512,12 @@
       setModelType(type).then(() => {
         loading.value = false;
       });
-
+      if(!headElHeight.value){
+        const headEl = document.querySelector(`.zxm-table-thead`);
+        if (headEl) {
+          headElHeight.value = headEl.clientHeight
+        }
+      } 
       const data = dataSource.value[selectRowIndex.value];
       if (data['Fan1StartStatus'] == 1) {
         selectDevice('warningMonitorRowIndex', 0)