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

+ 34 - 6
src/views/vent/monitorManager/comment/AlarmHistoryTable.vue

@@ -11,7 +11,8 @@
   import { useListPage } from '/@/hooks/system/useListPage';
   import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
   import { defHttp } from '/@/utils/http/axios';
-  
+  import dayjs from 'dayjs';
+
   const props = defineProps({
     columnsType: {
       type: String,
@@ -47,8 +48,23 @@
   });
   const alarmHistory = ref()
   const columns = ref([])
+  let deviceOptions = <any[]>[]
+
   const tableScroll = props.scroll.y ? ref({ y: props.scroll.y - 100 }) : ref({})
+  
+  async function getDeviceList() {
+    let result;
+    result = await props.deviceListApi()
+    if (result && result['records'] && result['records'].length > 0) {
+      const deviceList = result['records']
+      deviceOptions = []
+      deviceOptions = deviceList.map((item) => {
+        return { label: item['strinstallpos'], value: item['id'], strtype: item['strtype'], strinstallpos: item['strinstallpos'], devicekind: item['devicekind'] }
+      })
+    }
+  }
 
+  await getDeviceList()
   watch(
     () => {
       return props.columnsType;
@@ -104,6 +120,10 @@
             label: '时间范围',
             field: 'createTime',
             component: 'RangePicker',
+            defaultValue: [
+              dayjs().subtract(1, 'day'),
+              dayjs(),
+            ],
             componentProps: {
               valueFormat: 'YYYY-MM-DD HH:mm:ss',
             },
@@ -111,13 +131,21 @@
           {
             label: '查询设备',
             field: 'gdeviceid',
-            component: 'ApiSelect',
+            component: 'Select',
+            defaultValue: deviceOptions[0] ? deviceOptions[0]['value'] : '',
+            required: true,
             componentProps: {
-              api: props.deviceListApi,
-              resultField: 'records',
-              labelField: 'strname',
-              valueField: 'id',
+              options: deviceOptions,
+              onChange: (e, option) => {
+                if (option && (option['strinstallpos'] || option['strtype'] || option['devicekind'])) historyType.value = option['strtype'] || option['devicekind']
+              },
             },
+            // componentProps: {
+            //   api: props.deviceListApi,
+            //   resultField: 'records',
+            //   labelField: 'strname',
+            //   valueField: 'id',
+            // },
           },
         ],
         fieldMapToTime: [['createTime', ['createTime_begin', 'createTime_end'], '']],

+ 5 - 0
src/views/vent/monitorManager/comment/HandlerHistoryTable.vue

@@ -11,6 +11,7 @@
   import { useListPage } from '/@/hooks/system/useListPage';
   import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
   import { defHttp } from '/@/utils/http/axios';
+  import dayjs from 'dayjs';
 
 
   const list = (params) => defHttp.get({ url: '/safety/ventanalyDevicesetLog/list', params });
@@ -106,6 +107,10 @@
             label: '时间范围',
             field: 'createTime',
             component: 'RangePicker',
+            defaultValue: [
+              dayjs().subtract(1, 'day'),
+              dayjs(),
+            ],
             componentProps: {
               valueFormat: 'YYYY-MM-DD HH:mm:ss',
             },

+ 3 - 3
src/views/vent/monitorManager/deviceMonitor/components/device/device.data.ts

@@ -146,7 +146,7 @@ export const majorColumns: BasicColumn[] = [
       //   dataIndex: 'name1'
       // },
       {
-        title: '密度(kg/m3)',
+        title: '密度(kg/m³)',
         align: 'center',
         dataIndex: 'density1',
         width: 100,
@@ -180,7 +180,7 @@ export const majorColumns: BasicColumn[] = [
       //   dataIndex: 'name1'
       // },
       {
-        title: '密度(kg/m3)',
+        title: '密度(kg/m³)',
         align: 'center',
         dataIndex: 'density2',
         width: 100,
@@ -207,7 +207,7 @@ export const majorColumns: BasicColumn[] = [
     width: 100,
   },
   {
-    title: '风阻(Ns²/m^8)',
+    title: '风阻(Ns²/m)',
     align: 'center',
     dataIndex: 'wdrag',
     width: 110,

+ 10 - 1
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -91,7 +91,7 @@
               </GroupMonitorTable>
             </template>
             <template v-else-if="deviceType == 'majorpath' && activeKey == '1'">
-              <a-table :columns="majorColumns" :data-source="dataSource" bordered :scroll="scroll" :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`" :dataSource="dataSource"
@@ -682,6 +682,15 @@ async function findTreeDataValue(obj) {
       if (item.type == type) {
         deviceType.value = obj.deviceid ? 'sys' : item.type
         if (obj.deviceid) systemID.value = obj.deviceid
+        // const setKey = (item) => {
+        //   if(item.parentKey){
+        //     selectedKeys.value.push(item.parentKey)
+        //     expandedKeys.value.push(item.parentKey)
+        //   }
+        //   selectedKeys.value.push(item.key)
+        //   expandedKeys.value.push(item.key)
+        // }
+        // setKey(item)
         selectedKeys.value = [item.key]
         expandedKeys.value = [item.key]
         treeNodeTitle.value = item.title

+ 4 - 4
src/views/vent/monitorManager/deviceMonitor/index.vue

@@ -51,14 +51,14 @@ onMounted(() => {
   if (type === 'network') {
     routerParam.value = 'network'
     actions.setGlobalState({ pageObj: { pageType: 'network' } });
-  } else if (type === 'home') {
-    actions.setGlobalState({ pageObj: { pageType: 'home' } });
-  }
-  else if (type === 'tunMonitor') {
+  }else if (type === 'tunMonitor') {
     if (deviceType) {
       pageData.value = { pageType: deviceType }
       actions.setGlobalState({ pageObj: { pageType: deviceType } });
     }
+  }else{
+    routerParam.value = 'home'
+    actions.setGlobalState({ pageObj: { pageType: 'home' } });
   }
   actions.onGlobalStateChange((newState) => {
     for (const key in newState) {

+ 1 - 1
src/views/vent/monitorManager/windrectMonitor/index.vue

@@ -112,7 +112,7 @@
               <HandlerHistoryTable columns-type="operator_history" device-type="windrect" :device-list-api="baseList" designScope="operator_history" :scroll="scroll"/>
             </div>
           </a-tab-pane>
-          <a-tab-pane key="6" tab="测风结果">
+          <a-tab-pane v-if="globalConfig?.simulatedPassword" key="6" tab="测风结果">
             <ResultTable  deviceType="windrect_list" :scroll="scroll"/>
           </a-tab-pane>
         </a-tabs>