Procházet zdrojové kódy

束管监测-历史bug修改提交

lxh před 9 měsíci
rodič
revize
e96aadd09f

+ 4 - 0
src/views/vent/monitorManager/deviceMonitor/components/device/device.api.ts

@@ -9,6 +9,8 @@ enum Api {
   itemList = '/sys/dictItem/list',
   devPosition = '/sys/dict/getDictItems/devPosVisible',
   getDepartmentInfo = '/ventanaly-device/getDepartmentInfo',
+  listdays='/safety/ventanalyMonitorData/listdays'
+
 }
 /**
  * 列表接口
@@ -28,3 +30,5 @@ export const itemList = (params) => defHttp.get({ url: Api.itemList, params });
 export const devPosition = (params) => defHttp.get({ url: Api.devPosition, params });
 
 export const getDepartmentInfo = (params) => defHttp.get({ url: Api.getDepartmentInfo, params });
+
+export const listdays = (params) => defHttp.get({ url: Api.listdays, params });

+ 116 - 119
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -7,7 +7,8 @@
       <span class="title">{{ treeNodeTitle }}</span>
     </div>
     <div class="device-select" :class="{ 'device-select-show': treeShow, 'device-select-hide': !treeShow, }">
-      <SvgIcon class="is-expansion-icon expansion-icon" size="28" name="put-away" @click="showTree('treeShow', false)" />
+      <SvgIcon class="is-expansion-icon expansion-icon" size="28" name="put-away"
+        @click="showTree('treeShow', false)" />
       <div class="device-select-box">
         <a-tree :show-line="true" :tree-data="treeData" v-model:selectedKeys="selectedKeys" :autoExpandParent="true"
           v-model:expandedKeys="expandedKeys" @select="onSelect">
@@ -45,15 +46,17 @@
         </div>
       </div>
     </div>
-    
+
     <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 230, scroll, 125)" id="monitorBox">
       <!-- <dv-border-box8 :dur="5"  :style="`padding: 5px; height: ${scroll.y + 100}px`" > -->
       <div :style="`padding: 5px; height: ${scroll.y + 100}px`">
         <div class="to-small" @click="toHome"></div>
         <div class="device-button-group" v-if="deviceList.length > 0">
-          <div class="device-button"  :class="{ 'device-active': deviceActive == device.deviceType }"
-            v-for="(device, index) in deviceList" :key="index" @click="monitorChange(index)">{{ device.deviceName }}</div>
-          <div v-if="haveSysDetailArr.find((item) => deviceType.startsWith(item))" class="enter-detail" @click="goDetail()">
+          <div class="device-button" :class="{ 'device-active': deviceActive == device.deviceType }"
+            v-for="(device, index) in deviceList" :key="index" @click="monitorChange(index)">{{ device.deviceName }}
+          </div>
+          <div v-if="haveSysDetailArr.find((item) => deviceType.startsWith(item))" class="enter-detail"
+            @click="goDetail()">
             <send-outlined />
             {{ treeNodeTitle }}详情
           </div>
@@ -69,8 +72,10 @@
         <div style="color: #fff;">{{ deviceType }}</div>
         <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange" id="tabsBox">
           <a-tab-pane key="1" tab="实时监测">
-            <template v-if="(deviceType.startsWith('fanlocal') || deviceType.startsWith('fanmain')) && activeKey == '1'">
-              <GroupMonitorTable  ref="MonitorDataTable" :dataSource="dataSource" :columnsType="`${deviceType}_monitor`" :scroll="scroll" :isAction="true" :isShowSelect="false">
+            <template
+              v-if="(deviceType.startsWith('fanlocal') || deviceType.startsWith('fanmain')) && activeKey == '1'">
+              <GroupMonitorTable ref="MonitorDataTable" :dataSource="dataSource" :columnsType="`${deviceType}_monitor`"
+                :scroll="scroll" :isAction="true" :isShowSelect="false">
                 <template #action="{ record }">
                   <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
                     {
@@ -91,12 +96,13 @@
               </GroupMonitorTable>
             </template>
             <template v-else-if="deviceType == 'majorpath' && activeKey == '1'">
-              <a-table :columns="majorColumns" :data-source="dataSource" bordered :scroll="{ y: scroll.y - 30 }" :pagination="false"></a-table>
+              <a-table :columns="majorColumns" :data-source="dataSource" bordered :scroll="{ y: scroll.y - 30 }"
+                :pagination="false"></a-table>
             </template>
             <template v-else-if="deviceType.startsWith('safetymonitor') && activeKey == '1'">
-              <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType" :dataSource="dataSource"
-                design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测" 
-                :form-config="formConfig" :scroll="{ y: scroll.y - 110 }">
+              <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType"
+                :dataSource="dataSource" design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false"
+                title="设备监测" :form-config="formConfig" :scroll="{ y: scroll.y - 110 }">
                 <template #action="{ record }">
                   <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
                     {
@@ -122,17 +128,17 @@
                   <div v-if="!record.lowRange && column.dataIndex === 'lowRange'">-</div>
                   <div v-if="!record.dataTypeName && column.dataIndex === 'dataTypeName'">-</div>
                   <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">{{
-                  record.netStatus == '0' ? '断开' : '连接'
-                }}</a-tag>
+                    record.netStatus == '0' ? '断开' : '连接'
+                    }}</a-tag>
                 </template>
               </MonitorTable>
             </template>
             <template v-else-if="deviceType.startsWith('location') && activeKey == '1'">
-              <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType" :dataSource="dataSource"
-                design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测" 
-                :form-config="locationFormConfig" :scroll="{ y: scroll.y - 110 }">
+              <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType"
+                :dataSource="dataSource" design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false"
+                title="设备监测" :form-config="locationFormConfig" :scroll="{ y: scroll.y - 110 }">
                 <template #action="{ record }">
-                  <TableAction :actions=" [
+                  <TableAction :actions="[
                     {
                       label: '定位',
                       onClick: goLocation.bind(null, record),
@@ -142,11 +148,11 @@
               </MonitorTable>
             </template>
             <template v-else-if="deviceType.startsWith('vehicle') && activeKey == '1'">
-              <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType" :dataSource="dataSource"
-                design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测" 
-                :form-config="vehicleFormConfig" :scroll="{ y: scroll.y - 110 }">
+              <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType"
+                :dataSource="dataSource" design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false"
+                title="设备监测" :form-config="vehicleFormConfig" :scroll="{ y: scroll.y - 110 }">
                 <template #action="{ record }">
-                  <TableAction :actions=" [
+                  <TableAction :actions="[
                     {
                       label: '定位',
                       onClick: goLocation.bind(null, record),
@@ -157,18 +163,12 @@
             </template>
             <template v-else>
               <!-- 工作面echarts图标 -->
-              <BarAndLine
-                  v-if="activeKey == '1' && deviceType == 'surface_history'"
-                  class="echarts-line"
-                  xAxisPropType="time"
-                  :dataSource="surfaceEchartsData"
-                  height="300px"
-                  :chartsColumns="surfaceChartsColumns"
-                  :option="echatsOption"
-                  chartsType="listMonitor" />
-              <MonitorTable v-else-if="activeKey == '1'" ref="monitorTable" :columnsType="`${deviceType}_monitor`" :dataSource="dataSource"
-                design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测"
-                :scroll="{ y: scroll.y - 30 }">
+              <BarAndLine v-if="activeKey == '1' && deviceType == 'surface_history'" class="echarts-line"
+                xAxisPropType="time" :dataSource="surfaceEchartsData" height="300px"
+                :chartsColumns="surfaceChartsColumns" :option="echatsOption" chartsType="listMonitor" />
+              <MonitorTable v-else-if="activeKey == '1'" ref="monitorTable" :columnsType="`${deviceType}_monitor`"
+                :dataSource="dataSource" design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false"
+                title="设备监测" :scroll="{ y: scroll.y - 30 }">
                 <template #action="{ record }">
                   <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
                     {
@@ -185,7 +185,7 @@
                       onClick: goLocation.bind(null, record),
                     },
                   ]" />
-              
+
                 </template>
                 <template #filterCell="{ column, record }">
                   <template v-if="deviceType.startsWith('gate')">
@@ -224,12 +224,8 @@
                         color="default">打开</a-tag>
                     </template>
                     <template v-if="column.dataIndex === 'ndoortype'">
-                      <span
-                        v-if="record.ndoortype == 0"
-                        color="red">行车风门</span>
-                      <span
-                        v-else
-                        color="default">行人风门</span>
+                      <span v-if="record.ndoortype == 0" color="red">行车风门</span>
+                      <span v-else color="default">行人风门</span>
                     </template>
                   </template>
                   <template v-else-if="deviceType.startsWith('windrect')">
@@ -276,35 +272,33 @@
             </template>
           </a-tab-pane>
           <a-tab-pane key="2" tab="历史数据" v-if="!(noHistoryArr()).find((item) => deviceType.startsWith(item))">
-            <div class="tab-item" >
-              <HistoryTable ref="historyTable" v-if="activeKey == '2'"
-                :sysId="systemID" 
-                :columns-type="`${deviceType}`"
-                :device-type="deviceType"
-                designScope="device-history" :scroll="scroll" />
+            <div class="tab-item">
+              <HistoryTable ref="historyTable" v-if="activeKey == '2'" :sysId="systemID" :columns-type="`${deviceType}`"
+                :device-type="deviceType" designScope="device-history" :scroll="scroll" />
             </div>
           </a-tab-pane>
           <a-tab-pane key="3" tab="报警历史" v-if="!noWarningArr.find((item) => deviceType.startsWith(item))">
             <div class="tab-item">
               <AlarmHistoryTable ref="alarmHistoryTable" v-if="activeKey == '3'" :sysId="systemID" columns-type="alarm"
                 :device-type="deviceType"
-                :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID, pageSize: 10000 })" :scroll="scroll"
-                designScope="alarm-history" />
+                :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID, pageSize: 10000 })"
+                :scroll="scroll" designScope="alarm-history" />
             </div>
           </a-tab-pane>
           <a-tab-pane key="4" tab="操作历史" v-if="haveHandlerArr.find((item) => deviceType.startsWith(item))">
             <div class="tab-item">
               <HandlerHistoryTable ref="handlerHistoryTable" v-if="activeKey == '4'" :sysId="systemID"
                 columns-type="operator_history" :device-type="deviceType"
-                :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID })" :scroll="scroll"
-                designScope="operator-history" />
+                :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID })"
+                :scroll="scroll" designScope="operator-history" />
             </div>
           </a-tab-pane>
         </a-tabs>
         <!-- </dv-border-box8> -->
       </div>
     </div>
-    <mainPath v-if="deviceType == 'majorpath'" :dataSource="majorPathEchartsData" style="width: 300px; height: 300px; position: absolute; left: 250px;"/>
+    <mainPath v-if="deviceType == 'majorpath'" :dataSource="majorPathEchartsData"
+      style="width: 300px; height: 300px; position: absolute; left: 250px;" />
     <component v-if="modalVisible" :is="currentModal" v-model:visible="modalVisible" :dataSource="dataSource"
       :activeID="activeID" />
   </div>
@@ -313,7 +307,7 @@
 <script setup lang="ts">
 import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, reactive, defineProps, watch } from 'vue'
 import { SendOutlined } from '@ant-design/icons-vue';
-import { list, getDeviceList, getDeviceTypeList, devPosition, getDepartmentInfo } from './device.api'
+import { list, getDeviceList, getDeviceTypeList, devPosition, getDepartmentInfo,  } from './device.api'
 import AlarmHistoryTable from '../../../comment/AlarmHistoryTable.vue';
 import HistoryTable from '../../../comment/HistoryTable.vue';
 import HandlerHistoryTable from '../../../comment/HandlerHistoryTable.vue';
@@ -325,15 +319,16 @@ import { SvgIcon } from '/@/components/Icon';
 import { getActions } from '/@/qiankun/state';
 import { useRouter } from 'vue-router';
 import { setDivHeight } from '/@/utils/event';
-import { majorColumns, haveSysDetailArr, haveDetailArr, haveHandlerArr, noWarningArr, surfaceChartsColumns, noHistoryArr, getMonitorComponent, locationFormConfig, vehicleFormConfig } from  './device.data'
+import { majorColumns, haveSysDetailArr, haveDetailArr, haveHandlerArr, noWarningArr, surfaceChartsColumns, noHistoryArr, getMonitorComponent, locationFormConfig, vehicleFormConfig } from './device.data'
 import mainPath from './modal/mainPath.vue'
 import { formConfig } from '../../../safetyMonitor/safety.data'
 import { getDictItemsByCode } from '/@/utils/dict';
 import BarAndLine from '/@/components/chart/BarAndLine.vue';
 import { nextTick } from 'vue';
+import dayjs from 'dayjs';
 // import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
 
-const {FiberModal, BundleModal, DustModal, BallvalveModal,AtomizingModal, GaspatrolModal} = getMonitorComponent()
+const { FiberModal, BundleModal, DustModal, BallvalveModal, AtomizingModal, GaspatrolModal } = getMonitorComponent()
 type DeviceType = { deviceType: string, deviceName: string, datalist: any[] };
 
 const props = defineProps({
@@ -392,7 +387,7 @@ const scroll = reactive({
   y: 210
 })
 const treeData = ref<TreeProps['treeData']>([]);
-let departmentInfo:Null|Object = null
+let departmentInfo: Null | Object = null
 let startMonitorTimer = 0
 
 //树形菜单选择事件
@@ -406,15 +401,15 @@ const onSelect: TreeProps['onSelect'] = (keys, e) => {
     deviceType.value = e.node.parent.node.type
     systemID.value = e.node.type
     // 传递工作面id信息,用于定位
-    actions.setGlobalState({ locationObj: { pageType: deviceType.value, deviceid: systemID.value  }, pageObj: null });
+    actions.setGlobalState({ locationObj: { pageType: deviceType.value, deviceid: systemID.value }, pageObj: null });
   } else {
     systemType.value = e.node.type
     deviceType.value = e.node.type
-    actions.setGlobalState({ locationObj: { pageType: deviceType.value  }, pageObj: null });
+    actions.setGlobalState({ locationObj: { pageType: deviceType.value }, pageObj: null });
   }
   clearTimeout(timer)
   timer = undefined
-  if(startMonitorTimer){
+  if (startMonitorTimer) {
     clearTimeout(startMonitorTimer)
   }
   startMonitorTimer = setTimeout(() => {
@@ -425,7 +420,7 @@ const onSelect: TreeProps['onSelect'] = (keys, e) => {
     dataSource.value = []
     activeKey.value = '1'
     timer = null
-    if(e.node.children?.length < 1){
+    if (e.node.children?.length < 1) {
       getMonitor(true)
     }
   }, 1000)
@@ -448,7 +443,7 @@ async function getDeviceType(sysType?) {
     let key = '0'
     const getData = (resultList, dataSourceList, keyVal) => {
       resultList.forEach((item, index) => {
-        if (item.deviceType != 'sys'  && item.children && item.children.length > 0) {
+        if (item.deviceType != 'sys' && item.children && item.children.length > 0) {
           const children = getData(item.children, [], `${keyVal}-${index}`)
           // 判断关键阻力路线
           if (item.itemValue == sysType && children[0]) {
@@ -506,13 +501,13 @@ async function getDataSource() {
         return Object.assign(data, readData);
       })
       if (item.type != 'sys') {
-        if(item.type === 'majorpath'){
+        if (item.type === 'majorpath') {
           deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'], datalist: item['datalist'][0]['paths'] })
           majorPathEchartsData.value = item['datalist'][0]
-        }else if(item.type.startsWith('surface_history')) {
+        } else if (item.type.startsWith('surface_history')) {
           surfaceEchartsData.value = item['datalist'][0]
           deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
-        } else{
+        } else {
           deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
         }
       }
@@ -532,7 +527,7 @@ async function getDataSource() {
     }
   } else {
     let res = null
-    if(systemID.value){
+    if (systemID.value) {
       res = await list({ devicetype: 'sys', types: deviceType.value, systemID: systemID.value })
       if (res && res.msgTxt) {
         const result = res.msgTxt;
@@ -544,12 +539,12 @@ async function getDataSource() {
           if (item.type != 'sys') {
             if (item.type.startsWith('majorpath') && item.type == deviceType.value) {
               dataSource.value = item['datalist'][0]['paths']
-               majorPathEchartsData.value = item['datalist'][0]
+              majorPathEchartsData.value = item['datalist'][0]
               return
-            }else if(item.type == deviceType.value) {
-              if( item.type == 'surface_history') { // 工作面图标数据
+            } else if (item.type == deviceType.value) {
+              if (item.type == 'surface_history') { // 工作面图标数据
                 surfaceEchartsData.value = item['datalist'][0]
-              }else{
+              } else {
                 dataSource.value = data
                 console.log('关联设备数据--------------->', data)
               }
@@ -558,41 +553,41 @@ async function getDataSource() {
           }
         })
       }
-    }else{
+    } else {
       let resultData, searchForm;
-      if(monitorTable.value){
+      if (monitorTable.value) {
         // 安全监控
         const formData = monitorTable.value.getForm()
         searchForm = formData.getFieldsValue()
-        if(deviceType.value.startsWith('safetymonitor')){
+        if (deviceType.value.startsWith('safetymonitor')) {
           resultData = await list({ devicetype: deviceType.value, pagetype: 'normal', filterParams: { ...searchForm } })
-        }else if(deviceType.value.startsWith('location')) {
-          if(!departmentInfo) {
+        } else if (deviceType.value.startsWith('location')) {
+          if (!departmentInfo) {
             departmentInfo = await getDepartmentInfo({})
           }
           let department = null
-          if(departmentInfo && searchForm && searchForm['department']){
+          if (departmentInfo && searchForm && searchForm['department']) {
             for (const key in departmentInfo) {
               const item = departmentInfo[key]
-              if (item['id'] === searchForm['department']){
+              if (item['id'] === searchForm['department']) {
                 department = item
                 break;
               }
             }
           }
-          resultData = await list({ devicetype: deviceType.value, pagetype: 'normal', filterParams: { strinstallpos: searchForm && searchForm['stationname'] ? searchForm['stationname'] : '', userName: searchForm && searchForm['strname'] ? searchForm['strname'] : '', userJson: department && department['name'] ? department['name'] : '' }})
-        }else if(deviceType.value.startsWith('vehicle')) {
-          resultData = await list({ devicetype: deviceType.value, pagetype: 'normal', filterParams: {strinstallpos: searchForm && searchForm['stationname'] ? searchForm['stationname'] : '', vehicleName: searchForm && searchForm['strname'] ? searchForm['strname'] : ''}})
-        }else{
-          resultData = await list({ devicetype: deviceType.value, pagetype: 'normal'})
+          resultData = await list({ devicetype: deviceType.value, pagetype: 'normal', filterParams: { strinstallpos: searchForm && searchForm['stationname'] ? searchForm['stationname'] : '', userName: searchForm && searchForm['strname'] ? searchForm['strname'] : '', userJson: department && department['name'] ? department['name'] : '' } })
+        } else if (deviceType.value.startsWith('vehicle')) {
+          resultData = await list({ devicetype: deviceType.value, pagetype: 'normal', filterParams: { strinstallpos: searchForm && searchForm['stationname'] ? searchForm['stationname'] : '', vehicleName: searchForm && searchForm['strname'] ? searchForm['strname'] : '' } })
+        } else {
+          resultData = await list({ devicetype: deviceType.value, pagetype: 'normal' })
         }
-      }else{
+      } else {
         // 非安全监控
-        resultData = await list({ devicetype: deviceType.value, pagetype: 'normal'})
+        resultData = await list({ devicetype: deviceType.value, pagetype: 'normal' })
       }
       if (resultData && resultData.msgTxt) {
         const result = resultData.msgTxt[0];
-        if(result){
+        if (result) {
           const data = result['datalist'].filter((data: any) => {
             const readData = data.readData;
             return Object.assign(data, readData);
@@ -615,20 +610,20 @@ async function getDataSource() {
               dataSource.value = data
             }
           } else {
-            let tableData:any[]=[]
-            data.forEach(el=>{
-              if(el.netStatus==1){
-                tableData.splice(0, 0,el);
-              }else {
+            let tableData: any[] = []
+            data.forEach(el => {
+              if (el.netStatus == 1) {
+                tableData.splice(0, 0, el);
+              } else {
                 tableData.push(el);
               }
             })
             dataSource.value = tableData
           }
-        }else{
+        } else {
           dataSource.value = []
-        }      
-      }else{
+        }
+      } else {
         dataSource.value = []
       }
     }
@@ -648,7 +643,7 @@ function goDetail(record?) {
     } else if (deviceType.value.startsWith('dusting')) {
       currentModal.value = DustModal
       modalVisible.value = true;
-    }else if (deviceType.value.startsWith('bundletube')) {
+    } else if (deviceType.value.startsWith('bundletube')) {
       currentModal.value = BundleModal
       modalVisible.value = true;
     } else if (deviceType.value.startsWith('ballvalve')) {
@@ -715,7 +710,7 @@ function goDetail(record?) {
     } else if (systemType.value.indexOf("sys_surface_junya") != -1) {
       const newPage = router.resolve({ path: '/monitorChannel/balancePress-home', query: { id: systemID.value } })
       window.open(newPage.href, '_blank')
-    }  else if (systemType.value.indexOf("sys_nitrogen") != -1) {
+    } else if (systemType.value.indexOf("sys_nitrogen") != -1) {
       const newPage = router.resolve({ path: '/nitrogen-home', query: { id: systemID.value } })
       window.open(newPage.href, '_blank')
     } else if (deviceType.value.indexOf("forcFan") != -1) {
@@ -751,13 +746,13 @@ async function findTreeDataValue(obj) {
 
       if (item.type == type) {
         deviceType.value = obj.deviceid ? 'sys' : item.type
-        if(type.startsWith('sys_') && item.children[0]){
+        if (type.startsWith('sys_') && item.children[0]) {
           systemID.value = item.children[0]['type']
           selectedKeys.value = [item.children[0]['key']]
           expandedKeys.value = [item.children[0]['key']]
           treeNodeTitle.value = item.children[0]['title']
           deviceType.value = type.substring(4)
-        }else{
+        } else {
           if (obj.deviceid) systemID.value = obj.deviceid
           selectedKeys.value = [item.key]
           expandedKeys.value = [item.key]
@@ -779,7 +774,7 @@ async function findTreeDataValue(obj) {
   }
 
   findDeviceType(treeData.value, obj)
-  
+
   // 无类型时
   if (!treeNodeTitle.value && treeData.value && treeData.value[0] && treeData.value[0]['children']) {
     const defaultData = treeData.value[0]['children'][0]
@@ -830,12 +825,12 @@ function setLocation() {
   }, 600)
 }
 
-watch(() => props.pageData, async(pageObj) => {
+watch(() => props.pageData, async (pageObj) => {
   debugger;
   console.log('ceshi-------------》', pageObj)
   debugger;
   isRefresh.value = false
-  if(!treeData.value || treeData.value?.length < 1){
+  if (!treeData.value || treeData.value?.length < 1) {
     await getDeviceType()
   }
   nextTick(() => {
@@ -850,16 +845,16 @@ watch(() => props.pageData, async(pageObj) => {
 
 onMounted(async () => {
   const pageObj = props.pageData
-  if(!pageObj) return 
+  if (!pageObj) return
   if (pageObj.deviceid) {
     await getDeviceType()
     findTreeDataValue({ deviceid: pageObj.deviceid })
   } else {
-    if (pageObj.pageType.startsWith('sys_')){
+    if (pageObj.pageType.startsWith('sys_')) {
       await getDeviceType(pageObj.pageType)
       findTreeDataValue({ deviceid: systemID.value })
-      
-    }else{
+
+    } else {
       await getDeviceType()
       findTreeDataValue({ deviceType: pageObj.pageType })
     }
@@ -868,7 +863,7 @@ onMounted(async () => {
   const posShowData = pageObj.locationPlane
   if (posShowData) {
     locationList.value = posShowData
-  }else{
+  } else {
     locationList.value = await devPosition({})
   }
 })
@@ -882,7 +877,7 @@ onUnmounted(() => {
 
 </script>
 
-<style lang="less" scoped >
+<style lang="less" scoped>
 @import '/@/design/vent/modal.less';
 @ventSpace: zxm;
 
@@ -1213,6 +1208,7 @@ onUnmounted(() => {
 
 .bottom-tabs-box {
   position: relative;
+
   .tabs-box {
     width: calc(100% - 12px) !important;
     bottom: 3px !important;
@@ -1318,7 +1314,7 @@ onUnmounted(() => {
       &:nth-child(15) {
         left: calc(-6px * 15);
       }
-      
+
       &:nth-child(16) {
         left: calc(-6px * 16);
       }
@@ -1479,22 +1475,23 @@ onUnmounted(() => {
   color: #000000 !important;
 }
 
- :deep(.zxm-select-selector) {
-   height: 34px !important;
-   line-height: 34px !important;
- }
-
- :deep(.zxm-input) {
-   height: 32px !important;
-   line-height: 32px !important;
-   .zxm-select-selection-item{
-     line-height: 32px !important;
-   }
- }
+:deep(.zxm-select-selector) {
+  height: 34px !important;
+  line-height: 34px !important;
+}
+
+:deep(.zxm-input) {
+  height: 32px !important;
+  line-height: 32px !important;
+
+  .zxm-select-selection-item {
+    line-height: 32px !important;
+  }
+}
+
 // :deep(.@{ventSpace}-pagination){
 //   margin-right: 20px !important;
 //   margin-top: 5px !important;
 //   display: flex;
 //   align-items: center;
-// }
-</style>
+// }</style>

+ 29 - 7
src/views/vent/monitorManager/deviceMonitor/components/device/modal/bundle.modal.vue

@@ -91,10 +91,11 @@
           </div>
         </div>
         <div class="right-bottom">
-          <span class="base-title">设备监测曲线&nbsp; <span style="color:red">{{ posMonitor['netStatus'] != 1 ? '(设备未连接)' : '' }}</span></span>
+          <span class="base-title">设备监测曲线&nbsp; <span style="color:red">{{ posMonitor['netStatus'] != 1 ? '(设备未连接)' : ''
+              }}</span></span>
           <div class="echarts-box">
-            <BarAndLine  class="echarts-line" xAxisPropType="time" :dataSource="historyList" height="100%"
-              width="65%" :chartsColumns="chartsColumns" :option="echatsOption" chartsType="listMonitor" />
+            <BarAndLine class="echarts-line" xAxisPropType="ttime" :dataSource="historyList" height="100%" width="65%"
+              :chartsColumns="chartsColumns" :option="echatsOption" chartsType="listMonitor" />
 
             <!-- 爆炸三角形 -->
             <div style="width:35%;height:100%; margin: 0px auto">
@@ -107,7 +108,7 @@
   </BasicModal>
 </template>
 <script lang="ts">
-import { defineComponent, ref, watch, shallowRef } from 'vue';
+import { defineComponent, ref, watch, shallowRef, onMounted } from 'vue';
 import { BasicModal, useModalInner } from '/@/components/Modal';
 import BarAndLine from '/@/components/chart/BarAndLine.vue';
 import blastDelta from './blastDelta.vue'
@@ -115,6 +116,8 @@ import { SvgIcon } from '/@/components/Icon';
 import dayjs from 'dayjs';
 import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
 import { chartsColumnList } from '../device.data';
+import { listdays } from '../device.api';
+
 
 export default defineComponent({
   components: { BasicModal, BarAndLine, SvgIcon, blastDelta },
@@ -165,6 +168,7 @@ export default defineComponent({
     // 选择监测
     function selectDevice(id) {
       loading.value = true;
+      getListdays()
       setModalProps({ loading: true, confirmLoading: true });
       setTimeout(() => {
         loading.value = false;
@@ -183,6 +187,26 @@ export default defineComponent({
       closeModal();
     }
 
+    //获取历史数据
+    async function getListdays() {
+      const ttime_begin = dayjs(new Date().getTime() - (3 * 24 * 60 * 60 * 1000)).format('YYYY-MM-DD hh:mm:ss');
+      const ttime_end = dayjs(new Date().getTime()).format('YYYY-MM-DD hh:mm:ss')
+      const pageNo=1
+      const pageSize=100
+      const skip=8
+      const strtype='bundletube_auto'
+      activeDeviceID
+      let res=await listdays({ttime_begin,ttime_end,pageNo,pageSize,skip,strtype,gdeviceid:activeDeviceID.value})
+      console.log(res,'束管历史数据')
+      let data=res.datalist.records
+      if(data.length!=0){
+        data.forEach(el=>{
+            Object.assign(el,el.readData)
+        })
+        historyList.value=data
+    }
+  }
+
     watch([() => props.dataSource, () => props.activeID], ([newDataSource, newActiveID], [oldDataSource, oldActiveID]) => {
       // if (newActiveID != oldActiveID) {
       //   activeDeviceID.value = newActiveID as string;
@@ -192,14 +216,12 @@ export default defineComponent({
         if ((!activeDeviceID.value && index == 0) || item.deviceID === activeDeviceID.value) {
           // activeDeviceID.value = item.deviceID;
           posMonitor.value = Object.assign(item, item.readData);
-          // historyList.value = item['history'];
-          historyList.value = item['dayhistory'];
+          getListdays()
         }
         item.readTime = item.readTime?.substring(11);
         return item;
       });
     });
-
     return {
       register,
       model: modelRef,