浏览代码

环境模块的 状态 舒适否的显示;空调风量大小的交互修改

zhaojijng 2 年之前
父节点
当前提交
65cdf93dd0

+ 34 - 0
src/hooks/useMap.ts

@@ -0,0 +1,34 @@
+import { useState, useEffect, useMemo } from 'react';
+
+export function getLines(width, text) {
+  var length = text.length;
+  var base = 28;
+  for (var i = 0; i < length; i++) {
+    //大于28 2个 大于40
+    if (width >= base + 12 * i) {
+    }
+  }
+}
+export function getMaxScale(data) {
+  var maxScaleTemp = 1.1;
+  if (data.length > 0) {
+    //找到合适的最大缩放倍数
+    for (var i = 1; i < 12; i++) {
+      var num = 0;
+      data.forEach((item, index) => {
+        var mwidth = item.width * maxScaleTemp;
+        if (mwidth > 75) {
+          num = num + 1;
+        }
+      });
+      console.log('width', num, data.length, i);
+
+      if (num / data.length > 0.9) {
+        break;
+      } else {
+        maxScaleTemp = maxScaleTemp + 0.1;
+      }
+    }
+  }
+  return maxScaleTemp;
+}

+ 57 - 56
src/pages/Environment/index.tsx

@@ -6,11 +6,16 @@ import SearchInput from '@/sagacare_components/SearchInput';
 import TopNavigator from '@/sagacare_components/topNavigator';
 import ChartModal from './components/chartModal';
 import moment from 'moment';
-import { getMapList, queryEnvironmentParam } from '@/services/sagacare_service/environment';
+import {
+  getMapList,
+  queryEnvironmentParam,
+  getSeasonType,
+} from '@/services/sagacare_service/environment';
 import { projectObj } from '@/config/api.js';
 import { equipImageMap } from '@/config/sagacare/sagacare_image.js';
 import { Spin } from 'antd';
 import Icon from '@/tenants-ui/SgIcon';
+import { getMaxScale } from '@/hooks/useMap';
 
 import cx from 'classnames';
 import styles from './index.less';
@@ -99,6 +104,8 @@ const Environment: React.FC = () => {
   const [selNavId, setSelNavId] = useState<string>(navigatorList[0].id);
   const [mapList, setMapList] = useState<API.MapInfo[]>([]);
 
+  const [seasonType, setSeasonType] = useState<any>('Cooling');
+  const [scale, setScale] = useState<number>(0.8);
   const [maxScale, setMaxScale] = useState<number>(1);
   const [mapSize, setMapSize] = useState<any>({});
   const mapListCopy = useRef<any[]>([]);
@@ -161,27 +168,7 @@ const Environment: React.FC = () => {
             item.top = item.top * mscale;
           });
 
-          var maxScaleTemp = 1.1;
-          if (data.length > 0) {
-            //找到合适的最大缩放倍数
-            for (var i = 1; i < 12; i++) {
-              var num = 0;
-              data.forEach((item, index) => {
-                var mwidth = item.width * maxScaleTemp;
-                if (mwidth > 65) {
-                  num = num + 1;
-                }
-              });
-              console.log('width', num, data.length, i);
-
-              if (num / data.length > 0.92) {
-                break;
-              } else {
-                maxScaleTemp = maxScaleTemp + 0.1;
-              }
-            }
-          }
-          console.log('maxScaleTemp', maxScaleTemp);
+          var maxScaleTemp = getMaxScale(data);
           setMaxScale(maxScaleTemp);
 
           setMapList(data);
@@ -197,6 +184,7 @@ const Environment: React.FC = () => {
 
   const changeMapList = useCallback(
     (mscale, moveWidth, moveHeight) => {
+      setScale(mscale);
       var mapListTemp = JSON.parse(JSON.stringify(mapListCopy.current));
       var mapListTemp2 = mapListTemp.map((item, index) => {
         if (index == 0) {
@@ -217,30 +205,37 @@ const Environment: React.FC = () => {
   useEffect(() => {
     if (selNavId && selFloorId) {
       //setLoading(true);
+
+      var p1 = getSeasonType({
+        projectId: projectObj.projectId,
+        date: moment().format('YYYYMMDD'),
+      });
       var floorParams = [{ id: selFloorId, projectId: projectObj.projectId }];
       var endTime = moment();
       var startTime = moment().subtract(30, 'minutes');
       var startStr = startTime.format('YYYYMMDDHHmmss');
       var endStr = endTime.format('YYYYMMDDHHmmss');
 
-      queryEnvironmentParam(floorParams, {
+      var p2 = queryEnvironmentParam(floorParams, {
         endTime: endStr,
         startTime: startStr,
         param: selNavId,
-      })
-        .then((res) => {
-          //setLoading(false);
-          var avgValues = (res.data || {}).avgValues;
+      });
+
+      Promise.all([p1, p2])
+        .then(function (result) {
+          var season = (result[0] && result[0].data) || 'Cooling';
+          setSeasonType(season);
+          var environment = (result[1] && result[1].data) || {};
+          var avgValues = environment.avgValues;
           avgValues = avgValues ? avgValues.toFixed(selNav.fixed) : avgValues;
           var navTemp = { ...selNav, avgValues: avgValues };
           setSelNav(navTemp);
           //空间环境数据
-          var dataSpaces = ((res.data || {}).floors[0] || {}).dataSpaces || [];
+          var dataSpaces = (environment.floors[0] || {}).dataSpaces || [];
           setEnvirMapList(dataSpaces);
         })
-        .catch(() => {
-          // setLoading(false);
-        });
+        .catch(function (err) {});
     }
   }, [selNavId, selFloorId]);
   //合并空间环境数据 和 空间数据
@@ -288,6 +283,7 @@ const Environment: React.FC = () => {
       <TopNavigator
         navigatorList={navigatorList}
         type={'enviroment'}
+        seasonType={seasonType}
         navigatorChange={navigatorChange}
         changeFloorId={changeFloorId}
         changeBuildId={changeBuildId}
@@ -363,32 +359,37 @@ const Environment: React.FC = () => {
                   }}
                 >
                   <div className={mapstyles.content}>
-                    <div className={mapstyles.contentDiv}>
-                      <Icon
-                        className=""
-                        type={getSpaceFunc(item.roomFuncType)}
-                        style={{
-                          fontSize: 18,
-                          display: item.width > 40 && item.height > 40 ? 'block' : 'none',
-                        }}
-                      ></Icon>
-                      <div
-                        className={mapstyles.name}
-                        style={{
-                          display:
-                            (item.width > 80 && item.height > 70) ||
-                            item.width > 100 ||
-                            item.height > 90
-                              ? 'block'
-                              : 'none',
-                        }}
-                      >
-                        {item.localName}
-                      </div>
-                      {getSpaceFunc(item.roomFuncType) &&
-                        ((item.width < 40 && item.height < 90) ||
-                          (item.height < 40 && item.width < 100)) && <div>.</div>}
+                    <Icon
+                      className=""
+                      type={getSpaceFunc(item.roomFuncType)}
+                      style={{
+                        fontSize: 18,
+                        display: item.width > 28 && item.height > 50 ? 'block' : 'none',
+                      }}
+                    ></Icon>
+                    <div
+                      className={mapstyles.name}
+                      style={{
+                        display:
+                          (item.width > 64 && item.height > 80) ||
+                          item.height > 140 ||
+                          item.width > 120 ||
+                          scale == maxScale
+                            ? 'block'
+                            : 'none',
+                      }}
+                    >
+                      {item.localName}
                     </div>
+                    {(getSpaceFunc(item.roomFuncType) || item.localName) &&
+                      !(
+                        (getSpaceFunc(item.roomFuncType) && item.width > 28 && item.height > 50) ||
+                        (item.localName &&
+                          ((item.width > 64 && item.height > 80) ||
+                            item.height > 140 ||
+                            item.width > 120 ||
+                            scale == maxScale))
+                      ) && <div className={mapstyles.pointer}>.</div>}
                   </div>
                 </div>
               </div>

+ 47 - 21
src/pages/Equipment/components/deviceModal/airEq/index.jsx

@@ -1,10 +1,11 @@
 import React, { useState, useEffect, useRef, useCallback } from 'react';
-import { message } from 'antd';
+import { message, Spin } from 'antd';
 import styles from './index.less';
 import commonStyles from '../common.less';
 import { equipImageMap } from '@/config/sagacare/sagacare_image.js';
 import AnSwitch from '../anSwitch';
 import { getFeedbackDocumentsHttp, changeAirHttp } from '@/services/sagacare_service/equipment';
+import { LoadingOutlined } from '@ant-design/icons';
 
 export default ({ spaceId, projectId }) => {
   const {
@@ -27,6 +28,8 @@ export default ({ spaceId, projectId }) => {
   let timer = useRef(null);
   let airLoadingTimer = useRef(null);
   const [spaceStatus, setStatusText] = useState('null');
+  let [changeLoading, setChangeLoading] = useState({ 4: false, 2: false, 5: false, 6: false });
+
   const airExpend = [
     {
       title: '温度调节',
@@ -106,37 +109,52 @@ export default ({ spaceId, projectId }) => {
         setIsOpen(val); // 开关
         firstLoading.current = false;
         // setFirstLoading(false)
-        timerGetAirInfo(1000);
+        timerGetAirInfo(3000);
         setStatusText(res.spaceStatus); // 状态文案
         statusImg(res.icon); // icon
       })
       .catch(() => {
-        timerGetAirInfo(1000);
+        timerGetAirInfo(3000);
         firstLoading.current = false;
         // setIsLoading(false);
       });
   }, []);
 
-  const changeAir = (itemId) => {
-    const paramsObj = {
-      objectId: spaceId, // 空间id
-      valueType: 1, // 固定为1
-      itemId: itemId,
-    };
-    changeAirHttp(paramsObj).then((res) => {
-      if (res.result == 'success') {
-        // message.success('指令下发成功');
-        // getAirInfo();
-        // timerGetAirInfo(2000);
-      } else {
-        // message.error('操作失败,请重试');
+  const changeAir = useCallback(
+    (itemId) => {
+      if (changeLoading[itemId]) {
+        return;
       }
-    });
-  };
+      const paramsObj = {
+        objectId: spaceId, // 空间id
+        valueType: 1, // 固定为1
+        itemId: itemId,
+      };
+
+      // console.log('changeLoading', changeLoading);
+      setChangeLoading({ ...changeLoading, [itemId]: true });
+
+      changeAirHttp(paramsObj)
+        .then((res) => {
+          setChangeLoading({ ...changeLoading, [itemId]: false });
+          if (res.result == 'success') {
+            message.success('指令下发成功');
+            // getAirInfo();
+            // timerGetAirInfo(2000);
+          } else {
+            message.error('操作失败,请重试');
+          }
+        })
+        .catch((err) => {
+          setChangeLoading({ ...changeLoading, [itemId]: false });
+        });
+    },
+    [changeLoading],
+  );
 
   useEffect(() => {
     getAirInfo(); // 获取空调状态
-    timerGetAirInfo(2000);
+    //timerGetAirInfo(2000);
     return () => {
       clearTimeout(timer.current);
     };
@@ -153,10 +171,18 @@ export default ({ spaceId, projectId }) => {
                   <div>{items.title}</div>
                   <div className={styles.itemRight}>
                     <div className={styles.itemBg} onClick={() => changeAir(items.downType)}>
-                      <img className={styles.itemImg} src={items.leftImg} />
+                      {changeLoading[items.downType] ? (
+                        <Spin indicator={<LoadingOutlined style={{ fontSize: 20 }} spin />} />
+                      ) : (
+                        <img className={styles.itemImg} src={items.leftImg} />
+                      )}
                     </div>
                     <div className={styles.itemBg} onClick={() => changeAir(items.upType)}>
-                      <img className={styles.itemImg} src={items.rightImg} />
+                      {changeLoading[items.upType] ? (
+                        <Spin indicator={<LoadingOutlined style={{ fontSize: 20 }} spin />} />
+                      ) : (
+                        <img className={styles.itemImg} src={items.rightImg} />
+                      )}
                     </div>
                   </div>
                 </div>

+ 1 - 1
src/pages/Equipment/equipmentControl.js

@@ -150,7 +150,7 @@ export const getAirInfo = (sitem, callback, num, projectId) => {
             return;
         }
         // debugger;
-        getAirInfo(sitem, callback, num, projectId);
+        //getAirInfo(sitem, callback, num, projectId);
 
     });
 };

+ 36 - 47
src/pages/Equipment/index.tsx

@@ -14,6 +14,7 @@ import cx from 'classnames';
 import { Spin, Modal, message } from 'antd';
 import moment from 'moment';
 
+import { getMaxScale } from '@/hooks/useMap';
 import { ExclamationCircleOutlined } from '@ant-design/icons';
 import { equipImageMap } from '@/config/sagacare/sagacare_image.js';
 import Icon from '@/tenants-ui/SgIcon';
@@ -259,27 +260,7 @@ const Environment: React.FC = () => {
             item.top = item.top * mscale;
           });
 
-          var maxScaleTemp = 1.1;
-          if (data.length > 0) {
-            //找到合适的最大缩放倍数
-            for (var i = 1; i < 12; i++) {
-              var num = 0;
-              data.forEach((item, index) => {
-                var mwidth = item.width * maxScaleTemp;
-                if (mwidth > 65) {
-                  num = num + 1;
-                }
-              });
-              console.log('width', num, data.length, i);
-
-              if (num / data.length > 0.92) {
-                break;
-              } else {
-                maxScaleTemp = maxScaleTemp + 0.1;
-              }
-            }
-          }
-          //console.log('maxScaleTemp', maxScaleTemp);
+          var maxScaleTemp = getMaxScale(data);
           setMaxScale(maxScaleTemp);
 
           setMapList(data);
@@ -565,7 +546,8 @@ const Environment: React.FC = () => {
                           transform:
                             scale == maxScale
                               ? 'scale(1)'
-                              : item.width < 47 || item.height < 20
+                              : item.width < 24 * (item.equipStatusList || []).length ||
+                                item.height < 20
                               ? 'scale(0.3)'
                               : 'scale(1)',
                         }}
@@ -615,32 +597,39 @@ const Environment: React.FC = () => {
                       </div>
                     )}
                     <div className={mapstyles.content}>
-                      <div className={mapstyles.contentDiv}>
-                        <Icon
-                          className=""
-                          type={getSpaceFunc(item.roomFuncType)}
-                          style={{
-                            fontSize: 18,
-                            display: item.width > 40 && item.height > 40 ? 'block' : 'none',
-                          }}
-                        ></Icon>
-                        <div
-                          className={mapstyles.name}
-                          style={{
-                            display:
-                              (item.width > 80 && item.height > 70) ||
-                              item.width > 100 ||
-                              item.height > 90
-                                ? 'block'
-                                : 'none',
-                          }}
-                        >
-                          {item.localName}
-                        </div>
-                        {getSpaceFunc(item.roomFuncType) &&
-                          ((item.width < 40 && item.height < 90) ||
-                            (item.height < 40 && item.width < 100)) && <div>.</div>}
+                      <Icon
+                        className=""
+                        type={getSpaceFunc(item.roomFuncType)}
+                        style={{
+                          fontSize: 18,
+                          display: item.width > 28 && item.height > 50 ? 'block' : 'none',
+                        }}
+                      ></Icon>
+                      <div
+                        className={mapstyles.name}
+                        style={{
+                          display:
+                            (item.width > 64 && item.height > 80) ||
+                            item.height > 140 ||
+                            item.width > 120 ||
+                            scale == maxScale
+                              ? 'block'
+                              : 'none',
+                        }}
+                      >
+                        {item.localName}
                       </div>
+                      {(getSpaceFunc(item.roomFuncType) || item.localName) &&
+                        !(
+                          (getSpaceFunc(item.roomFuncType) &&
+                            item.width > 28 &&
+                            item.height > 50) ||
+                          (item.localName &&
+                            ((item.width > 64 && item.height > 80) ||
+                              item.height > 140 ||
+                              item.width > 120 ||
+                              scale == maxScale))
+                        ) && <div className={mapstyles.pointer}>.</div>}
                     </div>
                   </div>
                 </div>

+ 23 - 32
src/pages/Runtime/index.tsx

@@ -12,6 +12,7 @@ import Icon from '@/tenants-ui/SgIcon';
 import SearchInput from '@/sagacare_components/SearchInput';
 import moment from 'moment';
 import cx from 'classnames';
+import { getMaxScale } from '@/hooks/useMap';
 
 import { getMapList, queryDeviceTimeManage } from '@/services/sagacare_service/environment';
 
@@ -33,6 +34,7 @@ const Runtime: React.FC = () => {
 
   const [mapSize, setMapSize] = useState<any>({});
 
+  const [scale, setScale] = useState<number>(0.8);
   const [maxScale, setMaxScale] = useState<number>(1);
   const [mapCombineList, setMapCombineList] = useState<any[]>([]);
   const [selFloorId, setSelFloorId] = useState<string>();
@@ -80,27 +82,7 @@ const Runtime: React.FC = () => {
             item.top = item.top * scale;
           });
 
-          var maxScaleTemp = 1.1;
-          if (data.length > 0) {
-            //找到合适的最大缩放倍数
-            for (var i = 1; i < 12; i++) {
-              var num = 0;
-              data.forEach((item, index) => {
-                var mwidth = item.width * maxScaleTemp;
-                if (mwidth > 65) {
-                  num = num + 1;
-                }
-              });
-              console.log('width', num, data.length, i);
-
-              if (num / data.length > 0.92) {
-                break;
-              } else {
-                maxScaleTemp = maxScaleTemp + 0.1;
-              }
-            }
-          }
-          console.log('maxScaleTemp', maxScaleTemp);
+          var maxScaleTemp = getMaxScale(data);
           setMaxScale(maxScaleTemp);
 
           setMapList(data);
@@ -116,6 +98,7 @@ const Runtime: React.FC = () => {
 
   const changeMapList = useCallback(
     (scale, moveWidth, moveHeight) => {
+      setScale(scale);
       var mapListTemp = JSON.parse(JSON.stringify(mapListCopy.current));
       var mapListTemp2 = mapListTemp.map((item, index) => {
         if (index == 0) {
@@ -133,13 +116,14 @@ const Runtime: React.FC = () => {
   );
 
   const getDeviceTime = () => {
+    setLoading(true);
     queryDeviceTimeManage({
       floorId: selFloorId,
       //floorId: 'Fl11010802593241ec348ecb4148806b9034c8957454',
       date: selTime,
     })
       .then(function (res) {
-        //setLoading(false);
+        setLoading(false);
         if (!setTimer.current) return;
 
         var resdata = res || {};
@@ -184,7 +168,7 @@ const Runtime: React.FC = () => {
         setSpaceTimeList(resList);
       })
       .catch(() => {
-        //setLoading(false);
+        setLoading(false);
       });
   };
   let setTimer = useRef<Timer>(null);
@@ -201,7 +185,7 @@ const Runtime: React.FC = () => {
       }
       //循环调接口
       setTimer.current = setInterval(() => {
-        getDeviceTime();
+        //getDeviceTime();
       }, 10000);
 
       return () => {
@@ -346,7 +330,7 @@ const Runtime: React.FC = () => {
                       </Popover>
                     )}
                     {item.showTimeList && item.showTimeList.length == 1 && (
-                      <span>{item.showTimeStr}</span>
+                      <span title={item.showTimeStr}>{item.showTimeStr}</span>
                     )}
                   </div>
                   <div className={mapstyles.content}>
@@ -355,25 +339,32 @@ const Runtime: React.FC = () => {
                       type={getSpaceFunc(item.roomFuncType)}
                       style={{
                         fontSize: 18,
-                        display: item.width > 40 && item.height > 40 ? 'block' : 'none',
+                        display: item.width > 28 && item.height > 50 ? 'block' : 'none',
                       }}
                     ></Icon>
                     <div
                       className={mapstyles.name}
                       style={{
                         display:
-                          (item.width > 80 && item.height > 70) ||
-                          item.width > 100 ||
-                          item.height > 90
+                          (item.width > 64 && item.height > 80) ||
+                          item.height > 140 ||
+                          item.width > 120 ||
+                          scale == maxScale
                             ? 'block'
                             : 'none',
                       }}
                     >
                       {item.localName}
                     </div>
-                    {getSpaceFunc(item.roomFuncType) &&
-                      ((item.width < 40 && item.height < 90) ||
-                        (item.height < 40 && item.width < 100)) && <div>.</div>}
+                    {(getSpaceFunc(item.roomFuncType) || item.localName) &&
+                      !(
+                        (getSpaceFunc(item.roomFuncType) && item.width > 28 && item.height > 50) ||
+                        (item.localName &&
+                          ((item.width > 64 && item.height > 80) ||
+                            item.height > 140 ||
+                            item.width > 120 ||
+                            scale == maxScale))
+                      ) && <div className={mapstyles.pointer}>.</div>}
                   </div>
                 </div>
               </div>

+ 5 - 0
src/sagacare_components/map/index.less

@@ -153,6 +153,11 @@
       //   padding: 6px;
       text-align: center;
     }
+    .pointer {
+      display: flex;
+      align-items: center;
+      height: 100%;
+    }
   }
 
   .notclick {

+ 7 - 6
src/sagacare_components/map/index.tsx

@@ -307,12 +307,13 @@ const Map: React.FC<MapProps> = ({
       //console.log('document.querySelector("#map")', mapDom);
       console.log('maxscalemaxscalemaxscale', maxscale);
       //控制板的事件
-      if (maxscale > 1) {
-        mapDom.addEventListener('wheel', function (event) {
-          //debugger;
-          mapWheel(event);
-        });
-      }
+      // if (maxscale > 1) {
+      mapDom.addEventListener('wheel', mapWheel);
+      // }
+      return () => {
+        //console.log('maxscalemaxscalemaxscale------', maxscale);
+        mapDom.removeEventListener('wheel', mapWheel);
+      };
     },
     [maxscale],
   );

+ 17 - 2
src/sagacare_components/topNavigator/index.less

@@ -58,18 +58,33 @@
     white-space: nowrap;
     .firstLine {
       display: flex;
+      height: 28px;
       font-weight: 500;
-      line-height: 1;
+      line-height: 28px;
+      sup {
+        top: 0;
+        line-height: 1;
+      }
+      .line {
+        height: 22px;
+        margin: 0 12px;
+        border-left: 1px solid rgba(196, 196, 196, 0.4);
+      }
+      .level {
+        color: #4d5262;
+        font-size: 14px;
+      }
     }
     .value {
       margin-right: 2px;
       // color: #e5574f;
-      font-size: 30px;
+      font-size: 28px;
     }
     .unit {
       // color: #e5574f;
     }
     .text {
+      margin-top: 2px;
       color: #c4c4c4;
       font-size: 12px;
     }

+ 56 - 2
src/sagacare_components/topNavigator/index.tsx

@@ -1,4 +1,4 @@
-import React, { useState, useEffect, useCallback, useRef } from 'react';
+import React, { useState, useEffect, useCallback, useMemo } from 'react';
 import styles from './index.less';
 import cx from 'classnames';
 import { Select } from 'antd';
@@ -18,6 +18,7 @@ export type topNavigatorProps = {
   changeFloorId?: (data: string) => void;
   changeBuildId?: (data: string) => void;
   selParamObj?: any;
+  seasonType?: any;
 };
 type floorItem = {
   value: string;
@@ -35,6 +36,7 @@ const TopNavigator: React.FC<topNavigatorProps> = ({
   changeFloorId,
   changeBuildId,
   selParamObj,
+  seasonType,
 }) => {
   //存储的 搜索到空间的buildingId floorId
   const { searchBuildId, searchFloorId } = useModel('sagacare_searchInfo');
@@ -62,6 +64,55 @@ const TopNavigator: React.FC<topNavigatorProps> = ({
     }
   }, [searchBuildId, searchFloorId]);
 
+  var levelObj = useMemo(() => {
+    let level = 0;
+    let levelTxt = '';
+
+    if (type === 'enviroment') {
+      var tdbParam = {
+        Cooling: {
+          range: [22, 26],
+          text: ['偏冷', '舒适', '偏热'],
+        },
+        Warm: {
+          range: [18, 24],
+          text: ['偏冷', '舒适', '偏热'],
+        },
+        Transition: {
+          range: [18, 26],
+          text: ['偏冷', '舒适', '偏热'],
+        },
+      };
+
+      let objList = {
+        Tdb: tdbParam[seasonType],
+        RH: {
+          range: [30, 70],
+          text: ['干燥', '健康', '潮湿'],
+        },
+        CO2: {
+          range: [800, 1000, 1500],
+          text: ['健康', '达标', '略高', '超标'],
+        },
+        PM2d5: {
+          range: [35, 75, 115, 150, 250],
+          text: ['健康', '良', '轻度污染', '中度污染', '重度污染', '严重污染'],
+        },
+        HCHO: {
+          range: [0.1],
+          text: ['健康', '超标'],
+        },
+      };
+      let sortArr = [selParamObj.avgValues, ...objList[selParamObj.id].range].sort((a, b) => {
+        return a - b;
+      });
+
+      level = sortArr.findIndex((item) => item === selParamObj.avgValues);
+      levelTxt = objList[selParamObj.id].text[level];
+    }
+    return { level, levelTxt };
+  }, [selParamObj, seasonType]);
+
   //请求建筑的接口
   useEffect(() => {
     var userObj = UserStorage.getInstance();
@@ -213,8 +264,11 @@ const TopNavigator: React.FC<topNavigatorProps> = ({
         <div className={styles.right}>
           <div className={styles.firstLine} style={{ color: selParamObj.color }}>
             <span className={styles.value}>{selParamObj.avgValues}</span>
-            <span className={styles.unit}>{selParamObj.unit}</span>
+            <sup className={styles.unit}>{selParamObj.unit}</sup>
+            <span className={styles.line}></span>
+            <span className={styles.level}>{levelObj.levelTxt}</span>
           </div>
+
           <div className={styles.text}>
             当前楼层平均{selParamObj.name}
             {selParamObj.id == 'CO2' || selParamObj.id == 'PM2d5' || selParamObj.id == 'HCHO'

+ 16 - 0
src/services/sagacare_service/environment.ts

@@ -101,6 +101,22 @@ export async function queryEnvironmentParam(body: any, otherParam: { [key: strin
   );
 }
 
+export async function getSeasonType(params: any, options?: { [key: string]: any }) {
+  return request<API.EnvironmentParam>(
+    `/sgadmin/duoduo-service/custom-service/custom/getSeasonType`,
+    {
+      method: 'GET',
+      headers: {
+        'Content-Type': 'application/json',
+      },
+      ...(options || {}),
+      params: {
+        ...params,
+      },
+    },
+  );
+}
+
 export async function queryEquipStatistics(params: any, options?: { [key: string]: any }) {
   //
   return request<API.EnvironmentParam>(