Browse Source

fix: 插座等跟大方代码同步

zhaojing 1 year ago
parent
commit
eeb10c5db1
34 changed files with 1099 additions and 255 deletions
  1. 7 3
      src/assets/icons/sagacare/iconfont.css
  2. 7 0
      src/assets/icons/sagacare/iconfont.json
  3. BIN
      src/assets/icons/sagacare/iconfont.ttf
  4. BIN
      src/assets/icons/sagacare/iconfont.woff
  5. BIN
      src/assets/icons/sagacare/iconfont.woff2
  6. 73 0
      src/assets/images/page-enviroment/airTemp.svg
  7. BIN
      src/assets/images/page-enviroment/chartTemp.png
  8. 37 0
      src/assets/images/page-enviroment/curtainTemp.svg
  9. 76 0
      src/assets/images/page-enviroment/lampTemp.svg
  10. 6 0
      src/assets/images/page-enviroment/socket.svg
  11. 52 0
      src/assets/images/page-enviroment/waterTemp.svg
  12. BIN
      src/assets/images/page-equipment/socket_close.png
  13. BIN
      src/assets/images/page-equipment/socket_open.png
  14. 59 59
      src/config/sagacare/sagacare_image.js
  15. 4 1
      src/pages/Environment/index.less
  16. 3 2
      src/pages/Environment/index.tsx
  17. 1 1
      src/pages/Equipment/components/deviceModal/anSwitch/index.less
  18. 7 0
      src/pages/Equipment/components/deviceModal/common.less
  19. 1 1
      src/pages/Equipment/components/deviceModal/curtainEq/index.jsx
  20. 9 0
      src/pages/Equipment/components/deviceModal/index.jsx
  21. 142 0
      src/pages/Equipment/components/deviceModal/socketEq/index.jsx
  22. 19 0
      src/pages/Equipment/components/deviceModal/socketEq/index.less
  23. 3 0
      src/pages/Equipment/components/topNavRight/index.less
  24. 94 25
      src/pages/Equipment/components/topNavRight/index.tsx
  25. 186 125
      src/pages/Equipment/equipmentControl.js
  26. 28 1
      src/pages/Equipment/index.less
  27. 168 18
      src/pages/Equipment/index.tsx
  28. 4 2
      src/pages/Runtime/index.less
  29. 2 2
      src/pages/Runtime/index.tsx
  30. 8 8
      src/sagacare_components/map/index.less
  31. 3 1
      src/sagacare_components/map/index.tsx
  32. 1 1
      src/sagacare_components/topNavigator/index.less
  33. 31 1
      src/services/sagacare_service/environment.ts
  34. 68 4
      src/services/sagacare_service/equipment.js

+ 7 - 3
src/assets/icons/sagacare/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
 @font-face {
   font-family: "iconfont"; /* Project id 3184967 */
   font-family: "iconfont"; /* Project id 3184967 */
-  src: url('iconfont.woff2?t=1661310595751') format('woff2'),
-       url('iconfont.woff?t=1661310595751') format('woff'),
-       url('iconfont.ttf?t=1661310595751') format('truetype');
+  src: url('iconfont.woff2?t=1675837581887') format('woff2'),
+       url('iconfont.woff?t=1675837581887') format('woff'),
+       url('iconfont.ttf?t=1675837581887') format('truetype');
 }
 }
 
 
 .iconfont {
 .iconfont {
@@ -13,6 +13,10 @@
   -moz-osx-font-smoothing: grayscale;
   -moz-osx-font-smoothing: grayscale;
 }
 }
 
 
+.icon-managesocket:before {
+  content: "\e637";
+}
+
 .icon-manageyouren:before {
 .icon-manageyouren:before {
   content: "\e630";
   content: "\e630";
 }
 }

+ 7 - 0
src/assets/icons/sagacare/iconfont.json

@@ -6,6 +6,13 @@
   "description": "行政管理所用图片",
   "description": "行政管理所用图片",
   "glyphs": [
   "glyphs": [
     {
     {
+      "icon_id": "34017963",
+      "name": "插座-白色",
+      "font_class": "socket",
+      "unicode": "e637",
+      "unicode_decimal": 58935
+    },
+    {
       "icon_id": "31441833",
       "icon_id": "31441833",
       "name": "youren",
       "name": "youren",
       "font_class": "youren",
       "font_class": "youren",

BIN
src/assets/icons/sagacare/iconfont.ttf


BIN
src/assets/icons/sagacare/iconfont.woff


BIN
src/assets/icons/sagacare/iconfont.woff2


File diff suppressed because it is too large
+ 73 - 0
src/assets/images/page-enviroment/airTemp.svg


BIN
src/assets/images/page-enviroment/chartTemp.png


File diff suppressed because it is too large
+ 37 - 0
src/assets/images/page-enviroment/curtainTemp.svg


File diff suppressed because it is too large
+ 76 - 0
src/assets/images/page-enviroment/lampTemp.svg


+ 6 - 0
src/assets/images/page-enviroment/socket.svg

@@ -0,0 +1,6 @@
+<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="0.65" y="0.65" width="16.7" height="16.7" rx="2.35" stroke="#8CA5BD" stroke-width="1.3"/>
+<rect x="6.2998" y="4.98975" width="1.3" height="4" rx="0.65" transform="rotate(36 6.2998 4.98975)" fill="#8CA5BD"/>
+<rect width="1.3" height="4" rx="0.65" transform="matrix(0.809017 -0.587785 -0.587785 -0.809017 13 8.99023)" fill="#8CA5BD"/>
+<rect width="1.3" height="3.2" rx="0.65" transform="matrix(1 0 0 -1 8.40039 13)" fill="#8CA5BD"/>
+</svg>

File diff suppressed because it is too large
+ 52 - 0
src/assets/images/page-enviroment/waterTemp.svg


BIN
src/assets/images/page-equipment/socket_close.png


BIN
src/assets/images/page-equipment/socket_open.png


+ 59 - 59
src/config/sagacare/sagacare_image.js

@@ -5,70 +5,70 @@ import envir_pm25 from '@/assets/images/page-enviroment/pm25.svg';
 import envir_jiaquan from '@/assets/images/page-enviroment/jiaquan.svg';
 import envir_jiaquan from '@/assets/images/page-enviroment/jiaquan.svg';
 import envir_tvoc from '@/assets/images/page-enviroment/tvoc.svg';
 import envir_tvoc from '@/assets/images/page-enviroment/tvoc.svg';
 export const equipImageMap = {
 export const equipImageMap = {
-    //   temperMapTop: require('@/assets/images/page-enviroment/temperMapTop.png'),
-    //   co2MapTop: require('@/assets/images/page-enviroment/co2MapTop.png'),
-    //   maptemp1: require('@/assets/images/page-enviroment/maptemp1.png'),
-    //   maptemp2: require('@/assets/images/page-enviroment/maptemp2.png'),
-    envir_temperature: envir_temperature,
-    envir_wet: envir_wet,
-    envir_co2: envir_co2,
-    envir_pm25: envir_pm25,
-    envir_jiaquan: envir_jiaquan,
-    envir_tvoc: envir_tvoc,
+  //   temperMapTop: require('@/assets/images/page-enviroment/temperMapTop.png'),
+  //   co2MapTop: require('@/assets/images/page-enviroment/co2MapTop.png'),
+  //   maptemp1: require('@/assets/images/page-enviroment/maptemp1.png'),
+  //   maptemp2: require('@/assets/images/page-enviroment/maptemp2.png'),
+  envir_temperature: envir_temperature,
+  envir_wet: envir_wet,
+  envir_co2: envir_co2,
+  envir_pm25: envir_pm25,
+  envir_jiaquan: envir_jiaquan,
+  envir_tvoc: envir_tvoc,
 
 
-    officeImg: require('@/assets/images/page-enviroment/office.svg'),
-    //   airMapTop: require('@/assets/images/page-enviroment/airMapTop.svg'),
-    //   lampMapTop: require('@/assets/images/page-enviroment/lampMapTop.svg'),
-    //   maptemp3: require('@/assets/images/page-enviroment/maptemp3.png'),
-    //   maptemp4: require('@/assets/images/page-enviroment/maptemp4.png'),
-    //   maptemp5: require('@/assets/images/page-enviroment/maptemp5.png'),
+  officeImg: require('@/assets/images/page-enviroment/office.svg'),
+  //   airMapTop: require('@/assets/images/page-enviroment/airMapTop.svg'),
+  //   lampMapTop: require('@/assets/images/page-enviroment/lampMapTop.svg'),
+  //   maptemp3: require('@/assets/images/page-enviroment/maptemp3.png'),
+  //   maptemp4: require('@/assets/images/page-enviroment/maptemp4.png'),
+  //   maptemp5: require('@/assets/images/page-enviroment/maptemp5.png'),
 
 
-    envir_all: require('@/assets/images/page-enviroment/all.svg'),
-    equip_air: require('@/assets/images/page-enviroment/air.svg'),
-    equip_lamp: require('@/assets/images/page-enviroment/lamp.svg'),
-    equip_water: require('@/assets/images/page-enviroment/water.svg'),
-    envir_curtain: require('@/assets/images/page-enviroment/curtain.svg'),
-    envir_humidification: require('@/assets/images/page-enviroment/humidification.svg'),
+  envir_all: require('@/assets/images/page-enviroment/all.svg'),
+  equip_air: require('@/assets/images/page-enviroment/air.svg'),
+  equip_lamp: require('@/assets/images/page-enviroment/lamp.svg'),
+  equip_water: require('@/assets/images/page-enviroment/water.svg'),
+  envir_curtain: require('@/assets/images/page-enviroment/curtain.svg'),
+  envir_socket: require('@/assets/images/page-enviroment/socket.svg'),
+  envir_humidification: require('@/assets/images/page-enviroment/humidification.svg'),
 
 
-    //   maptemp6: require('@/assets/images/page-enviroment/maptemp6.png'),
+  //   maptemp6: require('@/assets/images/page-enviroment/maptemp6.png'),
 
 
-    // 环境指数说明
-    ruleCo2: require('@/assets/images/page-enviroment/rule-co2.png'),
-    ruleHcho: require('@/assets/images/page-enviroment/rule-hcho.png'),
-    rulePm25: require('@/assets/images/page-enviroment/rule-pm25.png'),
+  // 环境指数说明
+  ruleCo2: require('@/assets/images/page-enviroment/rule-co2.png'),
+  ruleHcho: require('@/assets/images/page-enviroment/rule-hcho.png'),
+  rulePm25: require('@/assets/images/page-enviroment/rule-pm25.png'),
 
 
-    // 设备
-    airClose: require('@/assets/images/page-equipment/airClose.png'),
-    airOpen: require('@/assets/images/page-equipment/airOpen.png'),
-    temp_down: require('@/assets/images/page-equipment/temp-down.svg'),
-    temp_up: require('@/assets/images/page-equipment/temp-up.svg'),
-    temp_keep: require('@/assets/images/page-equipment/temp-keep.png'),
-    arrow_down: require('@/assets/images/page-equipment/arrow-down.svg'),
-    arrow_up: require('@/assets/images/page-equipment/arrow-up.svg'),
-    wind_up: require('@/assets/images/page-equipment/wind-up.svg'),
-    wind_down: require('@/assets/images/page-equipment/wind-down.svg'),
-    lamp_open: require('@/assets/images/page-equipment/lamp-open.png'),
-    lamp_close: require('@/assets/images/page-equipment/lamp-close.png'),
-    expend_down: require('@/assets/images/page-equipment/expend-down.svg'),
-    expend_up: require('@/assets/images/page-equipment/expend-up.svg'),
-    curtain_open_row: require('@/assets/images/page-equipment/curtain-open-row.png'),
-    curtain_open_icon_row: require('@/assets/images/page-equipment/curtain-open-icon-row.svg'),
-    curtain_close_icon_row: require('@/assets/images/page-equipment/curtain-close-icon-row.svg'),
+  // 设备
+  airClose: require('@/assets/images/page-equipment/airClose.png'),
+  airOpen: require('@/assets/images/page-equipment/airOpen.png'),
+  temp_down: require('@/assets/images/page-equipment/temp-down.svg'),
+  temp_up: require('@/assets/images/page-equipment/temp-up.svg'),
+  temp_keep: require('@/assets/images/page-equipment/temp-keep.png'),
+  arrow_down: require('@/assets/images/page-equipment/arrow-down.svg'),
+  arrow_up: require('@/assets/images/page-equipment/arrow-up.svg'),
+  wind_up: require('@/assets/images/page-equipment/wind-up.svg'),
+  wind_down: require('@/assets/images/page-equipment/wind-down.svg'),
+  lamp_open: require('@/assets/images/page-equipment/lamp-open.png'),
+  lamp_close: require('@/assets/images/page-equipment/lamp-close.png'),
+  expend_down: require('@/assets/images/page-equipment/expend-down.svg'),
+  expend_up: require('@/assets/images/page-equipment/expend-up.svg'),
+  curtain_open_row: require('@/assets/images/page-equipment/curtain-open-row.png'),
+  curtain_open_icon_row: require('@/assets/images/page-equipment/curtain-open-icon-row.svg'),
+  curtain_close_icon_row: require('@/assets/images/page-equipment/curtain-close-icon-row.svg'),
+  socket_close: require('@/assets/images/page-equipment/socket_close.png'),
+  socket_open: require('@/assets/images/page-equipment/socket_open.png'),
 
 
+  up_Arrow: require('@/assets/images/page-equipment/up_Arrow.svg'),
+  down_Arrow: require('@/assets/images/page-equipment/down_Arrow.svg'),
+  openair: require('@/assets/images/page-equipment/openair.png'),
+  air_close: require('@/assets/images/page-equipment/air_close.png'),
 
 
-
-    up_Arrow: require('@/assets/images/page-equipment/up_Arrow.svg'),
-    down_Arrow: require('@/assets/images/page-equipment/down_Arrow.svg'),
-    openair: require('@/assets/images/page-equipment/openair.png'),
-    air_close: require('@/assets/images/page-equipment/air_close.png'),
-
-    wind_small: require('@/assets/images/page-equipment/wind_small.png'),
-    wind_big: require('@/assets/images/page-equipment/wind_big.png'),
-    airsunred: require('@/assets/images/page-equipment/airsunred.svg'),
-    airsunblack: require('@/assets/images/page-equipment/airsunblack.svg'),
-    aircoldblue: require('@/assets/images/page-equipment/aircoldblue.svg'),
-    aircoldblack: require('@/assets/images/page-equipment/aircoldblack.svg'),
-    aircloudgreen: require('@/assets/images/page-equipment/aircloudgreen.svg'),
-    aircloudblack: require('@/assets/images/page-equipment/aircloudblack.svg'),
-
+  wind_small: require('@/assets/images/page-equipment/wind_small.png'),
+  wind_big: require('@/assets/images/page-equipment/wind_big.png'),
+  airsunred: require('@/assets/images/page-equipment/airsunred.svg'),
+  airsunblack: require('@/assets/images/page-equipment/airsunblack.svg'),
+  aircoldblue: require('@/assets/images/page-equipment/aircoldblue.svg'),
+  aircoldblack: require('@/assets/images/page-equipment/aircoldblack.svg'),
+  aircloudgreen: require('@/assets/images/page-equipment/aircloudgreen.svg'),
+  aircloudblack: require('@/assets/images/page-equipment/aircloudblack.svg'),
 };
 };

+ 4 - 1
src/pages/Environment/index.less

@@ -1,9 +1,12 @@
 .label {
 .label {
   color: #c4c4c4;
   color: #c4c4c4;
 }
 }
+.sagawrap{
+    position:relative;
+}
 .maptop {
 .maptop {
   position: absolute;
   position: absolute;
-  top: 228px;
+  top: 128px;
   left: 0;
   left: 0;
   z-index: 1;
   z-index: 1;
   box-sizing: border-box;
   box-sizing: border-box;

+ 3 - 2
src/pages/Environment/index.tsx

@@ -245,6 +245,7 @@ const Environment: React.FC = () => {
         startTime: startStr,
         startTime: startStr,
         param: selNavId,
         param: selNavId,
       });
       });
+      //console.log('mapCombineList', mapCombineList);
 
 
       Promise.all([p1, p2])
       Promise.all([p1, p2])
         .then(function (result) {
         .then(function (result) {
@@ -287,7 +288,7 @@ const Environment: React.FC = () => {
   let firtTime: number = 0;
   let firtTime: number = 0;
   let lastTime: number = 0;
   let lastTime: number = 0;
   return (
   return (
-    <>
+    <div className={styles.sagawrap}>
       <PageHeader
       <PageHeader
         title={<FormattedMessage id="menu.environment" />}
         title={<FormattedMessage id="menu.environment" />}
         action={
         action={
@@ -469,7 +470,7 @@ const Environment: React.FC = () => {
           }}
           }}
         ></ChartModal>
         ></ChartModal>
       )}
       )}
-    </>
+    </div>
   );
   );
 };
 };
 
 

+ 1 - 1
src/pages/Equipment/components/deviceModal/anSwitch/index.less

@@ -27,7 +27,7 @@
     cursor: pointer;
     cursor: pointer;
     transition: background-color 0.3s;
     transition: background-color 0.3s;
     &:hover {
     &:hover {
-      background: rgba(255, 232, 35, 0.8);
+      background: rgba(255, 232, 35, 0.7);
     }
     }
     &.closeBg {
     &.closeBg {
       background: rgba(196, 196, 196, 0.2);
       background: rgba(196, 196, 196, 0.2);

+ 7 - 0
src/pages/Equipment/components/deviceModal/common.less

@@ -90,6 +90,13 @@
   right: 15px;
   right: 15px;
   display: flex;
   display: flex;
 }
 }
+.eqSocketBtn {
+  position: absolute;
+  top: 103px;
+  right: 15px;
+  display: flex;
+}
+
 
 
 .mgr20 {
 .mgr20 {
   margin-right: 20px;
   margin-right: 20px;

+ 1 - 1
src/pages/Equipment/components/deviceModal/curtainEq/index.jsx

@@ -36,7 +36,7 @@ export default ({ spaceId, projectId }) => {
       orders: [{ column: 'sortNum', asc: true }],
       orders: [{ column: 'sortNum', asc: true }],
     };
     };
     getObjectDataEqpGroupHttp(params).then((res) => {
     getObjectDataEqpGroupHttp(params).then((res) => {
-      let arr = res.content;
+      let arr = res.content || [];
       if (arr.length > 1) {
       if (arr.length > 1) {
         setIsMore(true);
         setIsMore(true);
       } else {
       } else {

+ 9 - 0
src/pages/Equipment/components/deviceModal/index.jsx

@@ -7,6 +7,7 @@ import { equipImageMap } from '@/config/sagacare/sagacare_image.js';
 import AirEq from './airEq';
 import AirEq from './airEq';
 import AirEqHand from './airEqHand';
 import AirEqHand from './airEqHand';
 import LampEq from './lampEq';
 import LampEq from './lampEq';
+import SocketEq from './socketEq';
 import CurtainEq from './curtainEq';
 import CurtainEq from './curtainEq';
 import { getSpaceAdjustList } from '@/services/sagacare_service/equipment';
 import { getSpaceAdjustList } from '@/services/sagacare_service/equipment';
 import { useRef } from 'react';
 import { useRef } from 'react';
@@ -385,6 +386,14 @@ export default ({ onClose, showSpace }) => {
                     ></CurtainEq>
                     ></CurtainEq>
                   </Col>
                   </Col>
                 )}
                 )}
+                {showEqCard('socket') && (
+                  <Col span={12}>
+                    <SocketEq
+                      spaceId={showSpace.spaceId}
+                      projectId={projectObj.projectId}
+                    ></SocketEq>
+                  </Col>
+                )}
               </Row>
               </Row>
             </div>
             </div>
           </div>
           </div>

+ 142 - 0
src/pages/Equipment/components/deviceModal/socketEq/index.jsx

@@ -0,0 +1,142 @@
+import React, { useState, useEffect, useRef } from 'react';
+import styles from './index.less';
+import commonStyles from '../common.less';
+import { equipImageMap } from '@/config/sagacare/sagacare_image.js';
+import AnSwitch from '../anSwitch';
+import { getSocketHttp, setSocketHttp } from '@/services/sagacare_service/equipment';
+
+const { socket_close, socket_open, expend_down, expend_up } = equipImageMap;
+
+export default ({ spaceId, projectId }) => {
+  const [isMore, setIsMore] = useState(false); // 可以展开
+  const [flagSvg, setFlagSvg] = useState(false); // 箭头方向
+  const [socketArr, setsocketArr] = useState([]); // 窗帘数据
+  const [isOpen, setIsOpen] = useState(false); // 1 开, 10关
+  const [isLoading, setIsLoading] = useState(false);
+  let timer = useRef(null);
+
+  function handleExpend() {
+    setFlagSvg(!flagSvg);
+  }
+
+  function changeSwitch(val, type, childItem) {
+    let paramsArr = [];
+    if (type === 'total') {
+      setIsLoading(true);
+      paramsArr = JSON.parse(JSON.stringify(socketArr));
+      paramsArr.map((item) => {
+        item.value = val ? 1 : 0;
+        item.code = item.switchCode;
+      });
+    } else {
+      paramsArr = [
+        {
+          value: val ? 1 : 0,
+          code: childItem.switchCode,
+          id: childItem.id,
+        },
+      ];
+    }
+    setSocketHttp(paramsArr).then((res) => {
+      setIsLoading(false);
+      timerGet();
+    });
+  }
+
+  function getData() {
+    const params = {
+      spaceId: spaceId,
+      equipType: 'socket',
+    };
+    setIsLoading(false);
+    getSocketHttp(params).then((res) => {
+      let arr = res.data.equipList || [];
+      let flag = false;
+      for(let i=0;i<arr.length;i++){
+        const item = arr[i];
+        // 有开 则总开
+        if (item.runStatus) {
+            setIsOpen(true);
+            flag = true;
+        };
+      }
+      if (arr.length > 1) {
+        setIsMore(true);
+      }else{
+        setIsMore(false); 
+      }
+      // 都没有开 则总关
+      if (!flag) setIsOpen(false);
+      setsocketArr(arr);
+    });
+  }
+
+  function timerGet(params) {
+    getData();
+    clearInterval(timer.current);
+    timer.current = null;
+    timer.current = setInterval(() => {
+      getData();
+    }, 1000 * 8);
+  }
+  useEffect(() => {
+    timerGet();
+    return () => {
+      clearInterval(timer.current);
+      timer.current = null;
+    };
+  }, []);
+
+  return (
+    <div className={commonStyles.box}>
+      <div className={commonStyles.content}>
+        <div className={commonStyles.env}>
+          <div className={commonStyles.envLeft}>
+            <span className={commonStyles.eqTitle}>
+              {isMore ? '智能插座' : socketArr[0]?.localName}
+            </span>
+            <div className={`${commonStyles.eqStatus} ${commonStyles.pdt10}`}>
+              <span>{isOpen ? '插座已开启' : '插座已关闭'}</span>
+            </div>
+            {isMore && (
+              <div className={commonStyles.showAll} onClick={handleExpend}>
+                <img className={commonStyles.showImg} src={flagSvg ? expend_up : expend_down}></img>
+                <div className={commonStyles.showAllText}>显示全部</div>
+              </div>
+            )}
+          </div>
+          <div className={styles.imgPos}>
+            <img className={styles.roomEqImg} src={isOpen ? socket_open : socket_close} />
+          </div>
+          {!flagSvg && (
+            <div
+              className={commonStyles.eqSocketBtn}
+              onClick={() => {
+                changeSwitch(!isOpen, 'total');
+              }}
+            >
+              <AnSwitch isAir={true} isLoading={isLoading} isOpen={isOpen}></AnSwitch>
+            </div>
+          )}
+        </div>
+      </div>
+      {socketArr.map((item, idx) => {
+        if (flagSvg) {
+          return (
+            <div className={`${styles.lampChild} ${commonStyles.flexBetween}`} key={item.id}>
+              <div className={commonStyles.eqTitle}>{item.localName}</div>
+              <div
+                className={commonStyles.dsflex}
+                onClick={() => {
+                  changeSwitch(!item.runStatus, 'child', item);
+                }}
+              >
+                <AnSwitch isOpen={item.runStatus}></AnSwitch>
+              </div>
+            </div>
+          );
+        }
+      })}
+    </div>
+  );
+};

+ 19 - 0
src/pages/Equipment/components/deviceModal/socketEq/index.less

@@ -0,0 +1,19 @@
+.lampChild {
+  height: 60px;
+  padding-right: 12px;
+  padding-left: 30px;
+  border-top: 1px solid rgba(196, 196, 196, 0.4);
+}
+
+.imgPos {
+  position: relative;
+  width: 165px;
+  height: 100px;
+  top: 0px;
+  right: 0px;
+
+}
+.roomEqImg {
+  width: 100%;
+  height: 100%;
+}

+ 3 - 0
src/pages/Equipment/components/topNavRight/index.less

@@ -22,13 +22,16 @@
         color: #000;
         color: #000;
         font-size: 28px;
         font-size: 28px;
         line-height: 1;
         line-height: 1;
+        font-family: Montserrat;
       }
       }
     }
     }
   }
   }
   .onlyNum {
   .onlyNum {
+    font-family: Montserrat;
     margin-left: 10px;
     margin-left: 10px;
     color: #000;
     color: #000;
     font-size: 28px;
     font-size: 28px;
+    width:30px;
   }
   }
   .moreWrap {
   .moreWrap {
     display: flex;
     display: flex;

+ 94 - 25
src/pages/Equipment/components/topNavRight/index.tsx

@@ -1,29 +1,59 @@
 // 设备管理 导航条的右侧
 // 设备管理 导航条的右侧
-import React, { useState, useEffect } from 'react';
+import React, { useState, useEffect, useMemo } from 'react';
 import { Dropdown, Menu, Modal, message } from 'antd';
 import { Dropdown, Menu, Modal, message } from 'antd';
 import Icon from '@/tenants-ui/SgIcon';
 import Icon from '@/tenants-ui/SgIcon';
 import { EllipsisOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
 import { EllipsisOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
 import styles from './index.less';
 import styles from './index.less';
 //import { equipImageMap } from '@/config/sagacare/sagacare_image.js';
 //import { equipImageMap } from '@/config/sagacare/sagacare_image.js';
 import type { navigatorItem } from '@/pages/Environment/index';
 import type { navigatorItem } from '@/pages/Environment/index';
+import { socketType } from '@/pages/Equipment/index';
+
 import { projectObj } from '@/config/api.js';
 import { projectObj } from '@/config/api.js';
 
 
-import { changeCurtain, changeAllAir, changeLight } from '@/pages/Equipment/equipmentControl';
+import {
+  changeCurtain,
+  changeAllAir,
+  changeLight,
+  changeSocket,
+} from '@/pages/Equipment/equipmentControl';
 
 
 export type topNavRightProps = {
 export type topNavRightProps = {
   selNavObj: navigatorItem;
   selNavObj: navigatorItem;
   navigatorList: navigatorItem[];
   navigatorList: navigatorItem[];
   mapList: API.MapInfo[];
   mapList: API.MapInfo[];
+  selSocketType: socketType;
+  socketTypeArr: socketType[];
   //queryDeviceManage: () => Promise<any>;
   //queryDeviceManage: () => Promise<any>;
 };
 };
 
 
-const TopNavRight: React.FC<topNavRightProps> = ({ selNavObj, navigatorList, mapList }) => {
+const TopNavRight: React.FC<topNavRightProps> = ({
+  selNavObj,
+  navigatorList,
+  mapList,
+  selSocketType,
+  socketTypeArr,
+}) => {
   //const [modalvisible, setModalvisible] = useState<boolean>(false);
   //const [modalvisible, setModalvisible] = useState<boolean>(false);
   //去掉全部设备的 设备列表
   //去掉全部设备的 设备列表
   const [deviceList, setDeviceList] = useState<navigatorItem[]>([]);
   const [deviceList, setDeviceList] = useState<navigatorItem[]>([]);
   useEffect(() => {
   useEffect(() => {
-    setDeviceList(navigatorList.slice(1));
-  }, []);
+    var navigatorListCopy:navigatorItem[] = [];
+    navigatorList.forEach((item)=>{
+      if(item.id!=='all'&&item.id!=='curtain'){
+        navigatorListCopy.push(item);
+      }
+    })
+    //console.log('navigatorListCopy', navigatorListCopy, navigatorList);
+    setDeviceList(navigatorListCopy);
+  }, [navigatorList]);
+
+  // const deviceList = useMemo(() => {
+  //   debugger;
+  //   var navigatorListCopy=JSON.parse(JSON.stringify(navigatorList));
+  //   navigatorListCopy.splice(3,1);
+  //   navigatorListCopy.splice(0,1);
+  //   return navigatorListCopy;
+  // }, [navigatorList]);
 
 
   const allOpenClick = (key) => {
   const allOpenClick = (key) => {
     //debugger;
     //debugger;
@@ -31,21 +61,28 @@ const TopNavRight: React.FC<topNavRightProps> = ({ selNavObj, navigatorList, map
     confirm({
     confirm({
       title: '请确认',
       title: '请确认',
       icon: <ExclamationCircleOutlined />,
       icon: <ExclamationCircleOutlined />,
-      content: `确认要全部开启${selNavObj.name}吗?`,
+      //content: `确定要全部开启${selNavObj.name}吗?`,
+      content:
+        selNavObj.id == 'socket' && selSocketType.code !== 'all'
+          ? `确定要全部开启${selSocketType.name}吗?`
+          : `确定要全部开启${selNavObj.name}吗?`,
       okText: '确认',
       okText: '确认',
       cancelText: '取消',
       cancelText: '取消',
       onOk() {
       onOk() {
-        console.log('mapListmapList', mapList);
+        //console.log('mapListmapList', mapList,selNavObj);
         //筛选 没有开启的空间
         //筛选 没有开启的空间
-        var filterSpaceArr = mapList.filter((item) => {
-          return item[selNavObj.id] == 0 || item[selNavObj.id] == 2;
-        });
-        var filterSpaceArr2 = mapList.filter((item) => {
-          return item.localName == '上格云3' || item.localName == '上格云休闲区';
-        });
-        console.log('开启filterSpaceArr', filterSpaceArr2);
+        if (selNavObj.id == 'light'||selNavObj.id == 'socket') {
+          var filterSpaceArr = mapList.filter((item) => {
+            return (item[selNavObj.id] == 0 || item[selNavObj.id] == 2) && item.spaceId;
+          });
+        } else {
+          var filterSpaceArr = mapList.filter((item) => {
+            return item.spaceId;
+          });
+        }
+
         var flag = 1;
         var flag = 1;
-        //现在加上循环调用 所以把查询关了
+        //现在加上循环调用 所以把查询关了F
         function getDeviceStatus() {
         function getDeviceStatus() {
           //   flag = flag + 1;
           //   flag = flag + 1;
           //   queryDeviceManage().then((res) => {
           //   queryDeviceManage().then((res) => {
@@ -66,6 +103,9 @@ const TopNavRight: React.FC<topNavRightProps> = ({ selNavObj, navigatorList, map
         if (selNavObj.id == 'light') {
         if (selNavObj.id == 'light') {
           changeLight('all', filterSpaceArr, getDeviceStatus, '打开');
           changeLight('all', filterSpaceArr, getDeviceStatus, '打开');
         }
         }
+        if (selNavObj.id == 'socket') {
+          changeSocket('all', filterSpaceArr, '打开', selSocketType);
+        }
         if (selNavObj.id == 'curtain') {
         if (selNavObj.id == 'curtain') {
           changeCurtain('all', filterSpaceArr, getDeviceStatus, '打开'); // '关闭' : '打开';
           changeCurtain('all', filterSpaceArr, getDeviceStatus, '打开'); // '关闭' : '打开';
         }
         }
@@ -82,19 +122,24 @@ const TopNavRight: React.FC<topNavRightProps> = ({ selNavObj, navigatorList, map
     confirm({
     confirm({
       title: '请确认',
       title: '请确认',
       icon: <ExclamationCircleOutlined />,
       icon: <ExclamationCircleOutlined />,
-      content: `确认要全部关闭${selNavObj.name}吗?`,
+      content:
+        selNavObj.id == 'socket' && selSocketType.code !== 'all'
+          ? `确定要全部关闭${selSocketType.name}吗?`
+          : `确定要全部关闭${selNavObj.name}吗?`,
       okText: '确认',
       okText: '确认',
       cancelText: '取消',
       cancelText: '取消',
       onOk() {
       onOk() {
-        var filterSpaceArr = mapList.filter((item) => {
-          return item[selNavObj.id] == 1 || item[selNavObj.id] == 2;
-        });
-        var filterSpaceArr2 = mapList.filter((item) => {
-          return item.localName == '上格云3' || item.localName == '上格云休闲区';
-        });
-        console.log('关闭filterSpaceArr', filterSpaceArr);
-        var flag = 1;
+        if (selNavObj.id == 'light'||selNavObj.id == 'socket') {
+          var filterSpaceArr = mapList.filter((item) => {
+            return (item[selNavObj.id] == 1 || item[selNavObj.id] == 2) && item.spaceId;
+          });
+        } else {
+          var filterSpaceArr = mapList.filter((item) => {
+            return item.spaceId;
+          });
+        }
 
 
+        var flag = 1;
         function getDeviceStatus() {
         function getDeviceStatus() {
           //   flag = flag + 1;
           //   flag = flag + 1;
           //   queryDeviceManage().then((res) => {
           //   queryDeviceManage().then((res) => {
@@ -115,6 +160,9 @@ const TopNavRight: React.FC<topNavRightProps> = ({ selNavObj, navigatorList, map
         if (selNavObj.id == 'light') {
         if (selNavObj.id == 'light') {
           changeLight('all', filterSpaceArr, getDeviceStatus, '关闭');
           changeLight('all', filterSpaceArr, getDeviceStatus, '关闭');
         }
         }
+        if (selNavObj.id == 'socket') {
+          changeSocket('all', filterSpaceArr, '关闭', selSocketType);
+        }
         if (selNavObj.id == 'curtain') {
         if (selNavObj.id == 'curtain') {
           changeCurtain('all', filterSpaceArr, getDeviceStatus, '关闭');
           changeCurtain('all', filterSpaceArr, getDeviceStatus, '关闭');
         }
         }
@@ -147,7 +195,28 @@ const TopNavRight: React.FC<topNavRightProps> = ({ selNavObj, navigatorList, map
       {selNavObj.id !== 'all' && (
       {selNavObj.id !== 'all' && (
         <div className={styles.right}>
         <div className={styles.right}>
           {selNavObj.id !== 'curtain' && <div className={styles.title}>运行中的设备</div>}
           {selNavObj.id !== 'curtain' && <div className={styles.title}>运行中的设备</div>}
-          {selNavObj.id !== 'curtain' && <div className={styles.onlyNum}>{selNavObj.num}</div>}
+          {selNavObj.id !== 'curtain' &&
+            (selNavObj.id == 'socket' && selSocketType.code !== 'all' ? (
+              <div className={styles.onlyNum}>
+                {socketTypeArr.map(function (sitem, sindex) {
+                  if (sitem.code == selSocketType.code) {
+                    return <span key={'snum' + sindex}>{sitem.openNum}</span>;
+                  } else {
+                    return;
+                  }
+                })}
+              </div>
+            ) : (
+              <div className={styles.onlyNum}>
+                {deviceList.map(function (ditem, dindex) {
+                  if (ditem.id == selNavObj.id) {
+                    return <span key={'dnum' + dindex}>{ditem.num}</span>;
+                  } else {
+                    return;
+                  }
+                })}
+              </div>
+            ))}
           <div
           <div
             className={styles.closeButton}
             className={styles.closeButton}
             onClick={allCloseClick}
             onClick={allCloseClick}

+ 186 - 125
src/pages/Equipment/equipmentControl.js

@@ -1,156 +1,217 @@
 import { FormattedMessage, useModel } from 'umi';
 import { FormattedMessage, useModel } from 'umi';
 
 
 import {
 import {
-    changeAllAirHttp,
-    changeAirHttp,
-    setEquipeHttp,
-    setallLampHttp,
-    getStatusHttp,
-    getLampHttp,
-    getFeedbackDocumentsHttp
+  changeAllAirHttp,
+  changeAirHttp,
+  setEquipeHttp,
+  setallSocketHttp,
+  getLampHttp,
+  getFeedbackDocumentsHttp,
 } from '@/services/sagacare_service/equipment';
 } from '@/services/sagacare_service/equipment';
 
 
 import { Spin, Modal, message } from 'antd';
 import { Spin, Modal, message } from 'antd';
 import { setallLamps } from '@/pages/Equipment/checLampStatus.js';
 import { setallLamps } from '@/pages/Equipment/checLampStatus.js';
 
 
+//开关 单个或者全部插座
+export const changeSocket = (type, itemarr, status, selSocketType) => {
+  //const { initialState } = useModel('@@initialState');//这里面不能这么用
+  //debugger;
+  const setType = status === '打开' ? 1 : 0; // 10关闭 12开启
+  var paramsArr = [];
+
+  itemarr.forEach((citem) => {
+    (citem.equipList || []).forEach((item) => {
+      //debugger;
+      if (
+        item.equipType == 'socket' &&
+        (selSocketType.code == 'all' || item.infos.SocketType == selSocketType.code)
+      ) {
+        paramsArr.push({
+          id: item.id,
+          code: 'EquipSwitchSet',
+          value: setType,
+        });
+      }
+    });
+  });
+
+  if (type == 'all') {
+    setTimeout(() => {
+      message.success({
+        content: `指令已经下发,设备会逐步${
+          status === '打开' ? '开启' : '关闭'
+        },请耐心等待,勿频繁操作`,
+        duration: 4,
+      });
+    }, 3000);
+  }
+  setallSocketHttp(paramsArr).then((res) => {
+  
+  });
+};
 //开关 单个或者全部灯
 //开关 单个或者全部灯
 export const changeLight = (type, itemarr, getDeviceStatus, status) => {
 export const changeLight = (type, itemarr, getDeviceStatus, status) => {
-    //const { initialState } = useModel('@@initialState');//这里面不能这么用
-    //debugger;
-    const setType = status === '打开' ? true : false; // 10关闭 12开启
-    var paramsArr = [];
-    itemarr.forEach((citem) => {
-        (citem.equipList||[]).forEach((item) => {
-            if (item.equipType == 'light') {
-                paramsArr.push({
-                    id: item.id,
-                    switch: setType,
-                });
-            }
+  //const { initialState } = useModel('@@initialState');//这里面不能这么用
+  //debugger;
+  const setType = status === '打开' ? true : false; // 10关闭 12开启
+  var paramsArr = [];
+
+  itemarr.forEach((citem) => {
+    (citem.equipList || []).forEach((item) => {
+      if (item.equipType == 'light') {
+        paramsArr.push({
+          id: item.id,
+          switch: setType,
         });
         });
+      }
     });
     });
-
-    setallLamps(paramsArr, getDeviceStatus);
+  });
+
+  if (type == 'all') {
+    setTimeout(() => {
+      message.success({
+        content: `指令已经下发,设备会逐步${
+          status === '打开' ? '开启' : '关闭'
+        },请耐心等待,勿频繁操作`,
+        duration: 4,
+      });
+    }, 3000);
+  }
+
+  setallLamps(paramsArr);
 };
 };
 
 
 //开关 单个或者全部窗帘      0是关闭 1 是开启  2 是部分开启
 //开关 单个或者全部窗帘      0是关闭 1 是开启  2 是部分开启
 export const changeCurtain = (type, itemarr, getDeviceStatus, status) => {
 export const changeCurtain = (type, itemarr, getDeviceStatus, status) => {
-    const setType = status === '打开' ? 'EquipOnSet' : 'EquipOffSet';
-    var paramsArr = [];
-    itemarr.forEach((citem) => {
-        (citem.equipList||[]).forEach((item) => {
-            if (item.equipType == 'curtain') {
-                paramsArr.push({
-                    equipmentCategory: 'CFSSES',
-                    infoCode: setType,
-                    value: 1,
-                    objectId: item.id,
-                });
-            }
+  const setType = status === '打开' ? 'EquipOnSet' : 'EquipOffSet';
+  var paramsArr = [];
+  itemarr.forEach((citem) => {
+    (citem.equipList || []).forEach((item) => {
+      if (item.equipType == 'curtain') {
+        paramsArr.push({
+          equipmentCategory: 'CFSSES',
+          infoCode: setType,
+          value: 1,
+          objectId: item.id,
         });
         });
+      }
     });
     });
+  });
 
 
-    //发送指令
-    setEquipeHttp(paramsArr);
-    message.success('指令下发成功');
-    //这是在手动改变状态
-    getDeviceStatus && getDeviceStatus();
+  //发送指令
+  setEquipeHttp(paramsArr);
+  message.success('指令已经下发');
+  //这是在手动改变状态
+  getDeviceStatus && getDeviceStatus();
 };
 };
 
 
 //开关单个空调      0是关闭 1 是开启  2 是部分开启
 //开关单个空调      0是关闭 1 是开启  2 是部分开启
 export const changeAir = (sitem, index, getDeviceStatus) => {
 export const changeAir = (sitem, index, getDeviceStatus) => {
-    const itemId = sitem.airConditioner === 0 ? 12 : 10; // 10关闭 12开启
-    const paramsObj = {
-        objectId: sitem.spaceId, // 空间id
-        valueType: 1, // 固定为1 1
-        itemId: itemId,
-    };
-    changeAirHttp(paramsObj).then((res) => {
-        if (res.result == 'success') {
-            message.success('指令下发成功');
-            // // sitem.airConditioner = res.isClose ? 0 : 1; //改变某空间空调的状态
-            // //mapCombineList[index]['airConditioner'] = res.isClose ? 0 : 1;
-            // var mapCopy = JSON.parse(JSON.stringify(mapCombineList));
-            // mapCopy[index]['airConditioner'] = res.isClose ? 0 : 1;
-            // setMapCombineList(mapCopy);
-            getDeviceStatus && getDeviceStatus();
-        } else {
-            message.error('操作失败,请重试');
-        }
-    });
+  const itemId = sitem.airConditioner === 0 ? 12 : 10; // 10关闭 12开启
+  const paramsObj = {
+    objectId: sitem.spaceId, // 空间id
+    valueType: 1, // 固定为1 1
+    itemId: itemId,
+  };
+  changeAirHttp(paramsObj)
+    .then((res) => {
+      if (res.result == 'success') {
+        message.success('指令已经下发');
+        // // sitem.airConditioner = res.isClose ? 0 : 1; //改变某空间空调的状态
+        // //mapCombineList[index]['airConditioner'] = res.isClose ? 0 : 1;
+        // var mapCopy = JSON.parse(JSON.stringify(mapCombineList));
+        // mapCopy[index]['airConditioner'] = res.isClose ? 0 : 1;
+        // setMapCombineList(mapCopy);
+        getDeviceStatus && getDeviceStatus();
+      } else {
+        message.error('操作失败,请重试');
+      }
+    })
+    .catch((err) => {});
 };
 };
 
 
-//开关全部空调 
+//开关全部空调
 export const changeAllAir = (itemarr, getDeviceStatus, status, projectId) => {
 export const changeAllAir = (itemarr, getDeviceStatus, status, projectId) => {
-    let paramsArr = [];
-    itemarr.forEach((sitem) => {
-        const itemId = status === '打开' ? 12 : 10; // 10关闭 12开启
-        paramsArr.push({
-            projectId: projectId,
-            objectId: sitem.id, // 空间id
-            valueType: 1, // 固定为1 1
-            itemId: itemId,
-        });
+  let paramsArr = [];
+  itemarr.forEach((sitem) => {
+    const itemId = status === '打开' ? 12 : 10; // 10关闭 12开启
+    paramsArr.push({
+      projectId: projectId,
+      objectId: sitem.spaceId, // 空间id
+      valueType: 1, // 固定为1 1
+      itemId: itemId,
     });
     });
-
-    changeAllAirHttp(paramsArr).then((res) => {
-        if (res.result == 'success') {
-            message.success('指令下发成功');
-            getDeviceStatus && getDeviceStatus();
-        } else {
-            message.error('操作失败,请重试');
-        }
+  });
+  setTimeout(() => {
+    message.success({
+      content: `指令已经下发,设备会逐步${
+        status === '打开' ? '开启' : '关闭'
+      },请耐心等待,勿频繁操作`,
+      duration: 4,
     });
     });
-};
-//查询 单个灯的状态
-export const getLamp = (sitem, callback, num) => {
-    num = num - 1;
-    getLampHttp(sitem.id).then((res) => {
-
-        if (res.result != 'success') return;
-        const arr = res.content || [];
-        //1开 0 关
-        let totalIsOpen = 0;
-        arr.forEach((item) => {
-            if (item.runStatus) {
-                totalIsOpen = 1;
-            }
-
-        });
-        //说明状态改变
-        if (sitem.light !== totalIsOpen) {
-            callback && callback(totalIsOpen);
-            return;
-        } else if (num == 0) {
-            return;
-        }
-
-        getLamp(sitem, callback, num);
-
+  }, 3000);
+  changeAllAirHttp(paramsArr)
+    .then((res) => {
+      if (res.result == 'success') {
+        //message.success('指令已经下发');
+        getDeviceStatus && getDeviceStatus();
+      } else {
+        //message.error('操作失败,请重试');
+      }
+    })
+    .catch((err) => {
+      console.log('err', err);
     });
     });
 };
 };
+// //查询 单个灯的状态
+// export const getLamp = (sitem, callback, num) => {
+//     num = num - 1;
+//     getLampHttp(sitem.id).then((res) => {
+
+//         if (res.result != 'success') return;
+//         const arr = res.content || [];
+//         //1开 0 关
+//         let totalIsOpen = 0;
+//         arr.forEach((item) => {
+//             if (item.runStatus) {
+//                 totalIsOpen = 1;
+//             }
+
+//         });
+//         //说明状态改变
+//         if (sitem.light !== totalIsOpen) {
+//             callback && callback(totalIsOpen);
+//             return;
+//         } else if (num == 0) {
+//             return;
+//         }
+
+//         getLamp(sitem, callback, num);
+
+//     });
+// };
 //查询 单个空调的状态
 //查询 单个空调的状态
-export const getAirInfo = (sitem, callback, num, projectId) => {
-
-    num = num - 1;
-    const paramsObj = {
-        objectId: sitem.id,
-        projectId: projectId,
-    };
-    getFeedbackDocumentsHttp(paramsObj).then((res) => {
-        //1开 0 关
-        const totalIsOpen = res.icon == 7 ? 0 : 1;
-
-        //说明状态改变
-        if (sitem.airConditioner !== totalIsOpen) {
-            callback && callback(totalIsOpen);
-            //debugger;
-            return;
-        } else if (num == 0) {
-            return;
-        }
-        // debugger;
-        //getAirInfo(sitem, callback, num, projectId);
-
-    });
-};
+// export const getAirInfo = (sitem, callback, num, projectId) => {
+
+//     num = num - 1;
+//     const paramsObj = {
+//         objectId: sitem.id,
+//         projectId: projectId,
+//     };
+//     getFeedbackDocumentsHttp(paramsObj).then((res) => {
+//         //1开 0 关
+//         const totalIsOpen = res.icon == 7 ? 0 : 1;
+
+//         //说明状态改变
+//         if (sitem.airConditioner !== totalIsOpen) {
+//             callback && callback(totalIsOpen);
+//             //debugger;
+//             return;
+//         } else if (num == 0) {
+//             return;
+//         }
+//         // debugger;
+//         //getAirInfo(sitem, callback, num, projectId);
+
+//     });
+// };

+ 28 - 1
src/pages/Equipment/index.less

@@ -1,9 +1,12 @@
 .label {
 .label {
   color: #c4c4c4;
   color: #c4c4c4;
 }
 }
+.sagawrap {
+  position: relative;
+}
 .maptop {
 .maptop {
   position: absolute;
   position: absolute;
-  top: 228px;
+  top: 128px;
   left: 0;
   left: 0;
   z-index: 1;
   z-index: 1;
   box-sizing: border-box;
   box-sizing: border-box;
@@ -12,10 +15,34 @@
   padding-top: 10px;
   padding-top: 10px;
   .left {
   .left {
     display: flex;
     display: flex;
+    align-items: center;
     float: left;
     float: left;
     span {
     span {
       margin-right: 6px;
       margin-right: 6px;
     }
     }
+    .stItem {
+      height: 28px;
+      padding: 0 15px;
+      color: #1b2129;
+      line-height: 28px;
+      text-align: center;
+      cursor: pointer;
+      &:hover {
+        background: #fff;
+        border-radius: 4px;
+      }
+      &.sel {
+        color: #246fe5;
+        font-weight: 700;
+        background: #fff;
+        border-radius: 4px;
+      }
+    }
+  }
+  .stBox {
+    padding: 3px;
+    background: #e1e5eb;
+    border-radius: 4px;
   }
   }
   .right {
   .right {
     display: flex;
     display: flex;

+ 168 - 18
src/pages/Equipment/index.tsx

@@ -30,6 +30,7 @@ import {
   changeCurtain,
   changeCurtain,
   changeAir,
   changeAir,
   changeLight,
   changeLight,
+  changeSocket,
   getLamp,
   getLamp,
   getAirInfo,
   getAirInfo,
 } from '@/pages/Equipment/equipmentControl';
 } from '@/pages/Equipment/equipmentControl';
@@ -44,13 +45,19 @@ type statistics = {
   equipType: string;
   equipType: string;
   runCount: number;
   runCount: number;
 };
 };
+
+export type socketType = {
+  scode: string;
+  code: string;
+  name: string;
+  openNum: number;
+};
 const Environment: React.FC = () => {
 const Environment: React.FC = () => {
   const { hasPersonList, querySpaceAdjustList } = useModel('sagacare_spaceFunc');
   const { hasPersonList, querySpaceAdjustList } = useModel('sagacare_spaceFunc');
-
   const { changeLastFloorId } = useModel('sagacare_buildFloor');
   const { changeLastFloorId } = useModel('sagacare_buildFloor');
   const { searchSpace } = useModel('sagacare_searchInfo');
   const { searchSpace } = useModel('sagacare_searchInfo');
   const { getSpaceFunc } = useModel('sagacare_spaceFunc');
   const { getSpaceFunc } = useModel('sagacare_spaceFunc');
-  const { envir_all, equip_air, equip_lamp, envir_curtain } = equipImageMap;
+  const { envir_all, equip_air, equip_lamp, envir_curtain, envir_socket } = equipImageMap;
 
 
   const [showModal, setShowModal] = useState<boolean>(false);
   const [showModal, setShowModal] = useState<boolean>(false);
   const [showSpace, setShowSpace] = useState<API.MapInfo>({}); //当前弹框选中的空间
   const [showSpace, setShowSpace] = useState<API.MapInfo>({}); //当前弹框选中的空间
@@ -67,7 +74,7 @@ const Environment: React.FC = () => {
       name: '空调',
       name: '空调',
       id: 'airConditioner',
       id: 'airConditioner',
       src: equip_air,
       src: equip_air,
-      num: 0,
+      num: '--',
       color: '#5E8BCF',
       color: '#5E8BCF',
       colorStr: '94,139,207,',
       colorStr: '94,139,207,',
     },
     },
@@ -75,7 +82,7 @@ const Environment: React.FC = () => {
       name: '照明',
       name: '照明',
       id: 'light',
       id: 'light',
       src: equip_lamp,
       src: equip_lamp,
-      num: 0,
+      num: '--',
       color: '#FFE823',
       color: '#FFE823',
       colorStr: '255,232,35,',
       colorStr: '255,232,35,',
     },
     },
@@ -83,11 +90,33 @@ const Environment: React.FC = () => {
       name: '窗帘',
       name: '窗帘',
       id: 'curtain',
       id: 'curtain',
       src: envir_curtain,
       src: envir_curtain,
-      num: 0,
+      num: '--',
       color: '#E89E32',
       color: '#E89E32',
       colorStr: '232, 158, 50,',
       colorStr: '232, 158, 50,',
     },
     },
+    {
+      name: '插座',
+      id: 'socket',
+      src: envir_socket,
+      num: '--',
+      color: '#9FB7CD',
+      colorStr: '159, 183, 205,',
+    },
   ];
   ];
+  const socketTypeObj = {
+    socket_1: '民用插座',
+    socket_2: '工业用插座',
+    socket_3: '防水插座',
+    socket_4: '普通插座',
+    socket_5: '电源插座',
+    socket_6: '电脑插座',
+    socket_7: '电话插座',
+    socket_8: '视频、音频插座',
+    socket_9: '移动插座',
+    socket_10: 'USB插座',
+    socket_11: '饮水设备插座',
+    socket_99: '其他',
+  };
   const [navigatorList, setNavigatorList] = useState<any[]>([]);
   const [navigatorList, setNavigatorList] = useState<any[]>([]);
   const [scale, setScale] = useState<number>(0.8);
   const [scale, setScale] = useState<number>(0.8);
   const [maxScale, setMaxScale] = useState<number>(1);
   const [maxScale, setMaxScale] = useState<number>(1);
@@ -104,7 +133,13 @@ const Environment: React.FC = () => {
   const [selFloorId, setSelFloorId] = useState<string>();
   const [selFloorId, setSelFloorId] = useState<string>();
   const [mapCombineList, setMapCombineList] = useState<any[]>([]);
   const [mapCombineList, setMapCombineList] = useState<any[]>([]);
   const [loading, setLoading] = useState<boolean>(false);
   const [loading, setLoading] = useState<boolean>(false);
-
+  const [socketTypeArr, setSocketTypeArr] = useState<socketType[]>([]);
+  const [selSocketType, setSelSocketType] = useState<socketType>({
+    name: '全部',
+    scode: 'all',
+    code: 'all',
+    openNum: 0,
+  });
   const changeFloorId = (data: string) => {
   const changeFloorId = (data: string) => {
     //debugger;
     //debugger;
     setSelFloorId(data);
     setSelFloorId(data);
@@ -113,6 +148,16 @@ const Environment: React.FC = () => {
   const navigatorChange = (item: navigatorItem) => {
   const navigatorChange = (item: navigatorItem) => {
     setSelNav(item);
     setSelNav(item);
   };
   };
+  //插座的二级菜单
+  const socketTypeChange = (item: socketType) => {
+    setSelSocketType(item);
+    // navigatorList.forEach(function (nItem) {
+    //   if (nItem.id == 'socket') {
+    //     nItem.num = selSocketType;
+    //   }
+    // });
+    // setNavigatorList(navigatorList);
+  };
   const showModalClick = (item) => {
   const showModalClick = (item) => {
     // console.log('showChart', item);
     // console.log('showChart', item);
     setShowModal(true);
     setShowModal(true);
@@ -134,7 +179,8 @@ const Environment: React.FC = () => {
       colorStr = selNav.colorStr;
       colorStr = selNav.colorStr;
     }
     }
     if (selNav.id == 'curtain' || type == 'curtain') {
     if (selNav.id == 'curtain' || type == 'curtain') {
-      if (value == 'noHave') {
+      //console.log('valuevaluevaluevalue', value);
+      if (value == 'noHave' || !value) {
         //没有
         //没有
         return 'rgba(196, 196, 196, 0)';
         return 'rgba(196, 196, 196, 0)';
       } else {
       } else {
@@ -160,7 +206,11 @@ const Environment: React.FC = () => {
     //全部设备 或者没有房间类型 则不可以点击
     //全部设备 或者没有房间类型 则不可以点击
     if (selNav.id == 'all' || !item.canClick) return;
     if (selNav.id == 'all' || !item.canClick) return;
     //没有设备时
     //没有设备时
-    if (item[selNav.id] == 'noHave') return;
+    if (
+      item[selNav.id] == 'noHave' ||
+      (selNav.id == 'socket' && item[selSocketType.scode] == 'noHave')
+    )
+      return;
     if (item[selNav.id] == 'nostatus') {
     if (item[selNav.id] == 'nostatus') {
       message.success('该空间设备离线');
       message.success('该空间设备离线');
       return;
       return;
@@ -187,7 +237,10 @@ const Environment: React.FC = () => {
     confirm({
     confirm({
       title: '请确认',
       title: '请确认',
       icon: <ExclamationCircleOutlined />,
       icon: <ExclamationCircleOutlined />,
-      content: `确认${status}该${selNav.name}吗?`,
+      content:
+        selNav.id == 'socket' && selSocketType.code !== 'all'
+          ? `确认${status}${selSocketType.name}吗?`
+          : `确认${status}该${selNav.name}吗?`,
       okText: '确认',
       okText: '确认',
       cancelText: '取消',
       cancelText: '取消',
       onOk() {
       onOk() {
@@ -209,6 +262,9 @@ const Environment: React.FC = () => {
         if (selNav.id == 'curtain') {
         if (selNav.id == 'curtain') {
           changeCurtain('one', [item], callback, status);
           changeCurtain('one', [item], callback, status);
         }
         }
+        if (selNav.id == 'socket') {
+          changeSocket('one', [item], status, selSocketType);
+        }
       },
       },
       onCancel() {
       onCancel() {
         //console.log('Cancel');
         //console.log('Cancel');
@@ -271,7 +327,7 @@ const Environment: React.FC = () => {
   const changeMapList = useCallback(
   const changeMapList = useCallback(
     (mscale, moveWidth, moveHeight) => {
     (mscale, moveWidth, moveHeight) => {
       setScale(mscale);
       setScale(mscale);
-      console.log('mscale', mscale);
+      //console.log('mscale', mscale);
       var mapListTemp = JSON.parse(JSON.stringify(mapListCopy.current));
       var mapListTemp = JSON.parse(JSON.stringify(mapListCopy.current));
       var mapListTemp2 = mapListTemp.map((item, index) => {
       var mapListTemp2 = mapListTemp.map((item, index) => {
         if (index == 0) {
         if (index == 0) {
@@ -299,7 +355,6 @@ const Environment: React.FC = () => {
         //if (!setTimer.current) return;
         //if (!setTimer.current) return;
         var statistics = res.data.statistics || [];
         var statistics = res.data.statistics || [];
         //赋值 运行中的设备数量
         //赋值 运行中的设备数量
-
         equiptTypeArr.forEach(function (nItem) {
         equiptTypeArr.forEach(function (nItem) {
           var fres = statistics.filter((sItem: statistics) => {
           var fres = statistics.filter((sItem: statistics) => {
             return sItem.equipType == nItem.id;
             return sItem.equipType == nItem.id;
@@ -308,11 +363,68 @@ const Environment: React.FC = () => {
         });
         });
         //console.log('queryDeviceManage333-arr', equiptTypeArr);
         //console.log('queryDeviceManage333-arr', equiptTypeArr);
         setNavigatorList(equiptTypeArr);
         setNavigatorList(equiptTypeArr);
+        var socketTypeArray: socketType[] = [];
         //设备空间信息
         //设备空间信息
         var spaceList = res.data.spaceList || [];
         var spaceList = res.data.spaceList || [];
         spaceList.forEach((item: any) => {
         spaceList.forEach((item: any) => {
-          var allType = ['airConditioner', 'light', 'curtain'];
+          (item.equipList || []).forEach((eItem: any) => {
+            if (eItem?.equipType == 'socket') {
+              var scode = eItem?.infos?.SocketType;
+              scode = scode ? 'socket_' + scode : scode;
+              var stIndex = socketTypeArray.findIndex((ele) => {
+                return ele.scode == scode;
+              });
+              //存在code,并且数组中没有 就放入数组
+              if (scode && stIndex == -1) {
+                socketTypeArray.push({
+                  name: socketTypeObj[scode],
+                  scode: scode,
+                  code: eItem?.infos?.SocketType,
+                  openNum: 0,
+                });
+              }
+            }
+          });
+        });
+        //console.log('socketTypeArray', socketTypeArray);
+        const openEquipIds: string[] = [];
+        spaceList.forEach((item: any) => {
+          socketTypeArray.forEach((stItem: socketType) => {
+            var code = stItem.code;
+            var scode = stItem.scode;
+            //寻找对应类型的插座
+            var stEquip = (item.equipList || []).filter((ele: any) => {
+              return ele?.infos?.SocketType == code;
+            });
+            if (stEquip.length > 0) {
+              //寻找对应类型的 开启状态的插座
+              var openStEquip = stEquip.filter((ele: any) => {
+                return ele.runStatus == 1;
+              });
+              //如果有重复的设备 则不重复计算 运行设备数量
+              var openStEquip2 = stEquip.filter((ele: any) => {
+                if (openEquipIds.includes(ele.id)) {
+                  return false;
+                } else {
+                  openEquipIds.push(ele.id);
+                  return ele.runStatus == 1;
+                }
+              });
+              //如果某种类型的插座都开启 则为1,部分开启则为2
+              openStEquip.length == stEquip.length
+                ? (item[scode] = 1)
+                : openStEquip.length > 0
+                ? (item[scode] = 2)
+                : (item[scode] = 0);
+              stItem.openNum = stItem.openNum + openStEquip2.length; //累加对应类型插座开启数量 运行中的数量
+            } else {
+              item[scode] = 'noHave';
+            }
+          });
+        });
 
 
+        spaceList.forEach((item: any) => {
+          var allType = ['airConditioner', 'light', 'curtain', 'socket'];
           allType.forEach((etype) => {
           allType.forEach((etype) => {
             var filterEquip = (item.equipList || []).filter((eItem: any) => {
             var filterEquip = (item.equipList || []).filter((eItem: any) => {
               return eItem.equipType == etype;
               return eItem.equipType == etype;
@@ -338,13 +450,20 @@ const Environment: React.FC = () => {
             }
             }
           });
           });
         });
         });
-        //console.log('spaceList', spaceList);
+        //console.log('spaceList', spaceList, socketTypeArray);
         //debugger;
         //debugger;
         setEquipMapList(spaceList);
         setEquipMapList(spaceList);
+        socketTypeArray.splice(0, 0, {
+          name: '全部',
+          scode: 'all',
+          code: 'all',
+          openNum: 0,
+        });
+        setSocketTypeArr(socketTypeArray);
         return 'next';
         return 'next';
       })
       })
       .catch(() => {
       .catch(() => {
-        setNavigatorList(equiptTypeArr);
+        //setNavigatorList(equiptTypeArr);
         // setLoading(false);
         // setLoading(false);
       });
       });
   };
   };
@@ -382,7 +501,7 @@ const Environment: React.FC = () => {
         }
         }
       });
       });
       //console.log('setNavigatorList-arr1111', arr);
       //console.log('setNavigatorList-arr1111', arr);
-      //setNavigatorList(arr);
+      setNavigatorList(arr);
       return arr;
       return arr;
     });
     });
   }
   }
@@ -471,6 +590,8 @@ const Environment: React.FC = () => {
             <TopNavRight
             <TopNavRight
               selNavObj={selNav}
               selNavObj={selNav}
               navigatorList={navigatorList}
               navigatorList={navigatorList}
+              selSocketType={selSocketType}
+              socketTypeArr={socketTypeArr}
               mapList={mapCombineList}
               mapList={mapCombineList}
             ></TopNavRight>
             ></TopNavRight>
           )
           )
@@ -479,7 +600,27 @@ const Environment: React.FC = () => {
         selParamObj={selNav}
         selParamObj={selNav}
       ></TopNavigator>
       ></TopNavigator>
       <div className={styles.maptop}>
       <div className={styles.maptop}>
-        {selNav.id !== 'all' && selNav.id !== 'curtain' && (
+        {selNav.id == 'socket' && (
+          <div className={cx(styles.left, styles.stBox)}>
+            {socketTypeArr.map((stItem, stIndex) => {
+              return (
+                <div
+                  className={cx(styles.stItem, {
+                    [styles.sel]: selSocketType.scode == stItem.scode,
+                  })}
+                  key={stIndex + 'socket'}
+                  onClick={(event) => {
+                    event.stopPropagation();
+                    socketTypeChange(stItem);
+                  }}
+                >
+                  {stItem.name}
+                </div>
+              );
+            })}
+          </div>
+        )}
+        {selNav.id !== 'all' && selNav.id !== 'curtain' && selNav.id !== 'socket' && (
           <div className={styles.left}>
           <div className={styles.left}>
             <span>
             <span>
               <Icon
               <Icon
@@ -569,11 +710,16 @@ const Environment: React.FC = () => {
                       backgroundColor: item.canClick
                       backgroundColor: item.canClick
                         ? selNav.id == 'all'
                         ? selNav.id == 'all'
                           ? 'rgba(196, 196, 196, 0.4)'
                           ? 'rgba(196, 196, 196, 0.4)'
+                          : selNav.id == 'socket' && selSocketType.scode !== 'all'
+                          ? getColorOpacity(item[selSocketType.scode])
                           : getColorOpacity(item[selNav.id])
                           : getColorOpacity(item[selNav.id])
                         : '',
                         : '',
                     }}
                     }}
                     className={cx(mapstyles.house, {
                     className={cx(mapstyles.house, {
-                      [mapstyles.notclick]: !item.canClick || item[selNav.id] == 'noHave',
+                      [mapstyles.notclick]:
+                        !item.canClick ||
+                        item[selNav.id] == 'noHave' ||
+                        (selNav.id == 'socket' && item[selSocketType.scode] == 'noHave'),
                       [mapstyles.searchSel]: item.spaceId && item.spaceId === searchSpace.spaceId,
                       [mapstyles.searchSel]: item.spaceId && item.spaceId === searchSpace.spaceId,
                     })}
                     })}
                     onClick={(event) => {
                     onClick={(event) => {
@@ -673,7 +819,11 @@ const Environment: React.FC = () => {
                           ></Icon>
                           ></Icon>
                         </div>
                         </div>
                       )}
                       )}
-                    {item.canClick && item[selNav.id] != 'noHave' && (
+                    {!(
+                      !item.canClick ||
+                      item[selNav.id] == 'noHave' ||
+                      (selNav.id == 'socket' && item[selSocketType.scode] == 'noHave')
+                    ) && (
                       <div
                       <div
                         className={mapstyles.showModal}
                         className={mapstyles.showModal}
                         onClick={(event) => {
                         onClick={(event) => {

+ 4 - 2
src/pages/Runtime/index.less

@@ -6,10 +6,12 @@
     cursor: pointer;
     cursor: pointer;
   }
   }
 }
 }
-
+.sagawrap{
+    position:relative;
+}
 .maptop {
 .maptop {
   position: absolute;
   position: absolute;
-  top: 228px;
+  top: 128px;
   left: 0;
   left: 0;
   z-index: 1;
   z-index: 1;
   box-sizing: border-box;
   box-sizing: border-box;

+ 2 - 2
src/pages/Runtime/index.tsx

@@ -235,7 +235,7 @@ const Runtime: React.FC = () => {
   }, [mapList, spaceTimeList]);
   }, [mapList, spaceTimeList]);
 
 
   return (
   return (
-    <>
+    <div className={styles.sagawrap}>
       <PageHeader
       <PageHeader
         title={<FormattedMessage id="menu.runtime" />}
         title={<FormattedMessage id="menu.runtime" />}
         action={
         action={
@@ -396,7 +396,7 @@ const Runtime: React.FC = () => {
           }}
           }}
         ></Map>
         ></Map>
       </Spin>
       </Spin>
-    </>
+    </div>
   );
   );
 };
 };
 export default Runtime;
 export default Runtime;

+ 8 - 8
src/sagacare_components/map/index.less

@@ -17,6 +17,7 @@
   user-select: none;
   user-select: none;
   tap-highlight-color: rgba(0, 0, 0, 0);
   tap-highlight-color: rgba(0, 0, 0, 0);
   .controlBar {
   .controlBar {
+    display: none;
     margin-bottom: 15px;
     margin-bottom: 15px;
   }
   }
   .mapControl {
   .mapControl {
@@ -73,7 +74,7 @@
   .houseWrap {
   .houseWrap {
     position: absolute;
     position: absolute;
     box-sizing: border-box;
     box-sizing: border-box;
-    padding: 3px;
+    //padding: 3px;
   }
   }
   .house {
   .house {
     position: relative;
     position: relative;
@@ -127,16 +128,16 @@
       top: 4px;
       top: 4px;
       left: 4px;
       left: 4px;
       z-index: 1;
       z-index: 1;
-      //   display: flex;
+    // display: flex;
       box-sizing: border-box;
       box-sizing: border-box;
       width: 100%;
       width: 100%;
+
       padding-right: 4px;
       padding-right: 4px;
       overflow: hidden;
       overflow: hidden;
       color: #4d5262;
       color: #4d5262;
       font-size: 10px;
       font-size: 10px;
       white-space: nowrap;
       white-space: nowrap;
       text-overflow: ellipsis;
       text-overflow: ellipsis;
-
       text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
       text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white;
       .overworkTime {
       .overworkTime {
         color: #5e8bcf;
         color: #5e8bcf;
@@ -202,12 +203,11 @@
       display: none;
       display: none;
       align-items: center;
       align-items: center;
       justify-content: center;
       justify-content: center;
-      width: 20px;
-      height: 20px;
-      font-size: 10px;
-      line-height: 20px;
+      width: 22px;
+      height: 22px;
+      font-size: 12px;
       background: #fff;
       background: #fff;
-      border-radius: 20px;
+      border-radius: 22px;
       transform-origin: 100% 100%;
       transform-origin: 100% 100%;
     }
     }
     &:hover .showModal {
     &:hover .showModal {

+ 3 - 1
src/sagacare_components/map/index.tsx

@@ -211,7 +211,7 @@ const Map: React.FC<MapProps> = ({
       changeSearchBuildId(''); //清空搜索记录  以防两次搜索一样的建筑的 没反应
       changeSearchBuildId(''); //清空搜索记录  以防两次搜索一样的建筑的 没反应
       changeSearchFloorId(''); //清空搜索记录 以防两次搜索一样的楼层时 没反应 要不要换位置
       changeSearchFloorId(''); //清空搜索记录 以防两次搜索一样的楼层时 没反应 要不要换位置
       changeSearchText({}); //清空搜索记录 好进行一些操作
       changeSearchText({}); //清空搜索记录 好进行一些操作
-    } else if (currentFloorId.current != selFloorId) {
+    } else if (currentFloorId.current && currentFloorId.current != selFloorId) {
       //如果两次的selFloorId 不一样 才会更改地图的位置为0 0
       //如果两次的selFloorId 不一样 才会更改地图的位置为0 0
       setTranslateX(transXInit);
       setTranslateX(transXInit);
       setTranslateY(120);
       setTranslateY(120);
@@ -303,6 +303,7 @@ const Map: React.FC<MapProps> = ({
     );
     );
   }, []);
   }, []);
   useEffect(() => {
   useEffect(() => {
+      //赋值传过来的初始 translateX 为了横向局中
     setTranslateX(transXInit);
     setTranslateX(transXInit);
   }, [transXInit]);
   }, [transXInit]);
 
 
@@ -330,6 +331,7 @@ const Map: React.FC<MapProps> = ({
   useEffect(() => {
   useEffect(() => {
     //console.log('document', document.body.offsetHeight);
     //console.log('document', document.body.offsetHeight);
     var bodyHeight = document.body.offsetHeight;
     var bodyHeight = document.body.offsetHeight;
+
     setMapHeight(bodyHeight - 190);
     setMapHeight(bodyHeight - 190);
     var bodyWidth = document.body.offsetWidth;
     var bodyWidth = document.body.offsetWidth;
     setMapWidth(bodyWidth);
     setMapWidth(bodyWidth);

+ 1 - 1
src/sagacare_components/topNavigator/index.less

@@ -4,7 +4,7 @@
 .topnavigator {
 .topnavigator {
   //   margin-top: 18px;
   //   margin-top: 18px;
   position: absolute;
   position: absolute;
-  top: 165px;
+  top: 65px;
   left: 0;
   left: 0;
   z-index: 1;
   z-index: 1;
   box-sizing: border-box;
   box-sizing: border-box;

+ 31 - 1
src/services/sagacare_service/environment.ts

@@ -25,6 +25,7 @@ export async function getMapList(body: any, options?: { [key: string]: any }) {
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
       },
       },
+      from: 'sagacare',
       ...(options || {}),
       ...(options || {}),
       data: body,
       data: body,
     },
     },
@@ -39,6 +40,7 @@ export async function getBuildingList(body: any, options?: { [key: string]: any
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
       },
       },
+      from: 'sagacare',
       ...(options || {}),
       ...(options || {}),
       data: body,
       data: body,
     },
     },
@@ -53,6 +55,7 @@ export async function getFloorList(body: any, options?: { [key: string]: any })
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
       },
       },
+      from: 'sagacare',
       ...(options || {}),
       ...(options || {}),
       data: body,
       data: body,
     },
     },
@@ -64,6 +67,7 @@ export async function queryDeviceTimeManage(params: any, options?: { [key: strin
     `/sgadmin/duoduo-service/setup-service/deviceManage/getDeviceTimeManageData?${commonParams()}`,
     `/sgadmin/duoduo-service/setup-service/deviceManage/getDeviceTimeManageData?${commonParams()}`,
     {
     {
       method: 'GET',
       method: 'GET',
+      from: 'sagacare',
       params: {
       params: {
         ...params,
         ...params,
       },
       },
@@ -78,6 +82,7 @@ export async function queryPropertyData(params: any, options?: { [key: string]:
     `/sgadmin/duoduo-service/duoduoenv-service/spaceAdjust/queryPropertyData?${commonParams()}`,
     `/sgadmin/duoduo-service/duoduoenv-service/spaceAdjust/queryPropertyData?${commonParams()}`,
     {
     {
       method: 'GET',
       method: 'GET',
+      from: 'sagacare',
       params: params,
       params: params,
       ...(options || {}),
       ...(options || {}),
     },
     },
@@ -90,6 +95,7 @@ export async function getSpaceAdjustArray(params: any) {
       params.floorId
       params.floorId
     }&equipType=bodySensor&booleanInfoCode=isPassengerPass&expireTime=5`,
     }&equipType=bodySensor&booleanInfoCode=isPassengerPass&expireTime=5`,
     {
     {
+      from: 'sagacare',
       method: 'GET',
       method: 'GET',
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
@@ -103,6 +109,7 @@ export async function queryEnvironmentParam(body: any, otherParam: { [key: strin
     `/sgadmin/duoduo-service/object-service/object/floor/queryParam?endTime=${otherParam.endTime}&startTime=${otherParam.startTime}&param=${otherParam.param}`,
     `/sgadmin/duoduo-service/object-service/object/floor/queryParam?endTime=${otherParam.endTime}&startTime=${otherParam.startTime}&param=${otherParam.param}`,
     {
     {
       method: 'POST',
       method: 'POST',
+      from: 'sagacare',
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
       },
       },
@@ -116,6 +123,7 @@ export async function getSeasonType(params: any, options?: { [key: string]: any
     `/sgadmin/duoduo-service/custom-service/custom/getSeasonType`,
     `/sgadmin/duoduo-service/custom-service/custom/getSeasonType`,
     {
     {
       method: 'GET',
       method: 'GET',
+      from: 'sagacare',
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
       },
       },
@@ -128,11 +136,12 @@ export async function getSeasonType(params: any, options?: { [key: string]: any
 }
 }
 
 
 export async function queryEquipStatistics(params: any, options?: { [key: string]: any }) {
 export async function queryEquipStatistics(params: any, options?: { [key: string]: any }) {
-  //
+  ///sgadmin/duoduo-service/object-service/object/equipment/queryEquipStatistics
   return request<API.EnvironmentParam>(
   return request<API.EnvironmentParam>(
     `/sgadmin/duoduo-service/object-service/object/equipment/queryEquipStatistics`,
     `/sgadmin/duoduo-service/object-service/object/equipment/queryEquipStatistics`,
     {
     {
       method: 'GET',
       method: 'GET',
+      from: 'sagacare',
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
       },
       },
@@ -150,6 +159,7 @@ export async function querySpace(body: any, options?: { [key: string]: any }) {
     `/sgadmin/duoduo-service/object-service/object/space/query?${commonParams()}`,
     `/sgadmin/duoduo-service/object-service/object/space/query?${commonParams()}`,
     {
     {
       method: 'POST',
       method: 'POST',
+      from: 'sagacare',
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
       },
       },
@@ -162,6 +172,7 @@ export async function querySpace(body: any, options?: { [key: string]: any }) {
 export async function checkToken(header: any, options?: { [key: string]: any }) {
 export async function checkToken(header: any, options?: { [key: string]: any }) {
   return request<API.EnvironmentParam>(`/sgadmin/duoduo-service/setup-service/user/zjCheckToken`, {
   return request<API.EnvironmentParam>(`/sgadmin/duoduo-service/setup-service/user/zjCheckToken`, {
     method: 'GET',
     method: 'GET',
+    from: 'sagacare',
     headers: {
     headers: {
       'Content-Type': 'application/json',
       'Content-Type': 'application/json',
       ...header,
       ...header,
@@ -173,6 +184,7 @@ export async function checkToken(header: any, options?: { [key: string]: any })
 export async function reFreshCheckToken(header: any, options?: { [key: string]: any }) {
 export async function reFreshCheckToken(header: any, options?: { [key: string]: any }) {
   return request<API.EnvironmentParam>(`/sgadmin/sso/auth/zjFreshCheckToken`, {
   return request<API.EnvironmentParam>(`/sgadmin/sso/auth/zjFreshCheckToken`, {
     method: 'GET',
     method: 'GET',
+    from: 'sagacare',
     headers: {
     headers: {
       'Content-Type': 'application/json',
       'Content-Type': 'application/json',
       ...header,
       ...header,
@@ -181,11 +193,23 @@ export async function reFreshCheckToken(header: any, options?: { [key: string]:
   });
   });
 }
 }
 
 
+export async function queryProjectId(body: any, options?: { [key: string]: any }) {
+  return request<API.EnvironmentParam>(`/sgadmin/duoduo-service/setup-service/pjSet/query`, {
+    method: 'POST',
+    from: 'sagacare',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+    ...(options || {}),
+    data: body,
+  });
+}
 // 项目拥有的设备
 // 项目拥有的设备
 export async function queryProjectEquipType() {
 export async function queryProjectEquipType() {
   return request<API.EnvironmentParam>(
   return request<API.EnvironmentParam>(
     `/sgadmin/duoduo-service/object-service/object/equipment/queryProjectEquipType?${commonParams()}`,
     `/sgadmin/duoduo-service/object-service/object/equipment/queryProjectEquipType?${commonParams()}`,
     {
     {
+      from: 'sagacare',
       method: 'GET',
       method: 'GET',
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
@@ -193,3 +217,9 @@ export async function queryProjectEquipType() {
     },
     },
   );
   );
 }
 }
+
+export const getUserInfo = (uid: string) => {
+  return request(`/user/${uid}`, {
+    method: 'get',
+  });
+};

+ 68 - 4
src/services/sagacare_service/equipment.js

@@ -28,6 +28,7 @@ export const setEquipeHttp = (params) => {
     `/sgadmin/duoduo-service/duoduoenv-service/object/eqp/infocode/set?${commonParams()}`,
     `/sgadmin/duoduo-service/duoduoenv-service/object/eqp/infocode/set?${commonParams()}`,
     {
     {
       method: 'POST',
       method: 'POST',
+      from: 'sagacare',
       isNotShowErrorToast: true,
       isNotShowErrorToast: true,
       errorSave: true,
       errorSave: true,
       data: JSON.stringify(params),
       data: JSON.stringify(params),
@@ -44,6 +45,7 @@ export const getObjectDataEqpGroupHttp = (params) => {
     `/sgadmin/duoduo-service/duoduoenv-service/object/objectDataEqpGroup/query?${commonParams()}`,
     `/sgadmin/duoduo-service/duoduoenv-service/object/objectDataEqpGroup/query?${commonParams()}`,
     {
     {
       method: 'POST',
       method: 'POST',
+      from: 'sagacare',
       isNotShowErrorToast: true,
       isNotShowErrorToast: true,
       errorSave: true,
       errorSave: true,
       data: JSON.stringify(params),
       data: JSON.stringify(params),
@@ -54,20 +56,64 @@ export const getObjectDataEqpGroupHttp = (params) => {
   );
   );
 };
 };
 
 
+// 插座的状态
+export const getSocketHttp = (params) => {
+  return request(
+    `/sgadmin/duoduo-service/duoduoenv-service/ctrl/queryEquipmentStatusInfo?${commonParams()}&spaceId=${
+      params.spaceId
+    }&equipType=${params.equipType}`,
+    {
+      //timeout: 1000,
+      skipErrorHandler: true,
+      method: 'GET',
+      from: 'sagacare',
+      headers: {
+        'Content-Type': 'application/json',
+      },
+    },
+  );
+};
+//设置插座
+export const setSocketHttp = (params) => {
+  return request(`/sgadmin/duoduo-service/duoduoenv-service/ctrl/set?${commonParams()}`, {
+    method: 'POST',
+    from: 'sagacare',
+    isNotShowErrorToast: true,
+    errorSave: true,
+    data: JSON.stringify(params),
+    headers: {
+      'Content-Type': 'application/json',
+    },
+  });
+};
 // 灯的状态
 // 灯的状态
 export const getLampHttp = (params) => {
 export const getLampHttp = (params) => {
   return request(
   return request(
     `/sgadmin/duoduo-service/duoduoenv-service/light/status/query?${commonParams()}&spaceId=${params}`,
     `/sgadmin/duoduo-service/duoduoenv-service/light/status/query?${commonParams()}&spaceId=${params}`,
     {
     {
-      timeout: 1000,
+      //timeout: 1000,
       skipErrorHandler: true,
       skipErrorHandler: true,
       method: 'GET',
       method: 'GET',
+      from: 'sagacare',
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
       },
       },
     },
     },
   );
   );
 };
 };
+// 批量 开关插座
+export const setallSocketHttp = (params) => {
+  return request(`/sgadmin/duoduo-service/duoduoenv-service/ctrl/set?${commonParams()}`, {
+    method: 'POST',
+    isNotShowErrorToast: true,
+    errorSave: true,
+    from: 'sagacare',
+    data: JSON.stringify(params),
+    headers: {
+      'Content-Type': 'application/json',
+    },
+  });
+};
 
 
 // 批量 开关灯
 // 批量 开关灯
 export const setallLampHttp = (params) => {
 export const setallLampHttp = (params) => {
@@ -75,6 +121,7 @@ export const setallLampHttp = (params) => {
     method: 'POST',
     method: 'POST',
     isNotShowErrorToast: true,
     isNotShowErrorToast: true,
     errorSave: true,
     errorSave: true,
+    from: 'sagacare',
     data: JSON.stringify(params),
     data: JSON.stringify(params),
     headers: {
     headers: {
       'Content-Type': 'application/json',
       'Content-Type': 'application/json',
@@ -90,6 +137,7 @@ export const getStatusHttp = (params) => {
       method: 'POST',
       method: 'POST',
       isNotShowErrorToast: true,
       isNotShowErrorToast: true,
       errorSave: true,
       errorSave: true,
+      from: 'sagacare',
       data: JSON.stringify(params),
       data: JSON.stringify(params),
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
@@ -105,6 +153,7 @@ export const getFeedbackDocumentsHttp = (params) => {
     {
     {
       isNotShowErrorToast: true,
       isNotShowErrorToast: true,
       errorSave: true,
       errorSave: true,
+      from: 'sagacare',
       method: 'POST',
       method: 'POST',
       data: JSON.stringify(params),
       data: JSON.stringify(params),
       headers: {
       headers: {
@@ -120,6 +169,7 @@ export const changeAirHttp = (params) => {
     `/sgadmin/duoduo-service/duoduoenv-service/custom/feedbackCreate/v2?${commonParams()}`,
     `/sgadmin/duoduo-service/duoduoenv-service/custom/feedbackCreate/v2?${commonParams()}`,
     {
     {
       method: 'POST',
       method: 'POST',
+      from: 'sagacare',
       isNotShowErrorToast: true,
       isNotShowErrorToast: true,
       errorSave: true,
       errorSave: true,
       data: JSON.stringify({ ...params, projectId: getProjectId() }),
       data: JSON.stringify({ ...params, projectId: getProjectId() }),
@@ -134,8 +184,8 @@ export const changeAirHttp = (params) => {
 export const getSpaceAdjustList = (params) => {
 export const getSpaceAdjustList = (params) => {
   return request(`/sgadmin/duoduo-service/duoduoenv-service/space/property?${commonParams()}`, {
   return request(`/sgadmin/duoduo-service/duoduoenv-service/space/property?${commonParams()}`, {
     method: 'POST',
     method: 'POST',
+    from: 'sagacare',
     isNotShowErrorToast: true,
     isNotShowErrorToast: true,
-    errorSave: true,
     data: params,
     data: params,
     headers: {
     headers: {
       'Content-Type': 'application/json',
       'Content-Type': 'application/json',
@@ -148,8 +198,10 @@ export const changeAllAirHttp = (body) => {
     `/sgadmin/duoduo-service/duoduoenv-service/custom/feedbackCreate/v2Batch?${commonParams()}`,
     `/sgadmin/duoduo-service/duoduoenv-service/custom/feedbackCreate/v2Batch?${commonParams()}`,
     {
     {
       method: 'POST',
       method: 'POST',
-      isNotShowErrorToast: true,
-      errorSave: true,
+      //timeout:100000,
+      skipErrorHandler: true,
+      from: 'sagacare',
+      isNotShowErrorToast: false,
       data: body,
       data: body,
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
@@ -160,11 +212,17 @@ export const changeAllAirHttp = (body) => {
 
 
 // 查询空间空调信息
 // 查询空间空调信息
 export const querySpaceConditioners = (params) => {
 export const querySpaceConditioners = (params) => {
+  var userObj = UserStorage.getInstance();
+  const user = userObj.getUser();
+  var pubname = 'sgadmin';
+  var paramsss = `openid=${user.id}&pubname=${pubname}&projectId=Pj1101080255&userId=${user.id}&userName=${user.name}&userPhone=${user.phone}`;
+
   return request(
   return request(
     `/sgadmin/duoduo-service/duoduoenv-service/ctrl/querySpaceConditioners?${commonParams()}&spaceId=${
     `/sgadmin/duoduo-service/duoduoenv-service/ctrl/querySpaceConditioners?${commonParams()}&spaceId=${
       params.spaceId
       params.spaceId
     }`,
     }`,
     {
     {
+      from: 'sagacare',
       method: 'GET',
       method: 'GET',
       headers: {
       headers: {
         'Content-Type': 'application/json',
         'Content-Type': 'application/json',
@@ -175,8 +233,14 @@ export const querySpaceConditioners = (params) => {
 
 
 //  手动控制 下发指令
 //  手动控制 下发指令
 export const changeManualTempHttp = (params) => {
 export const changeManualTempHttp = (params) => {
+  var userObj = UserStorage.getInstance();
+  const user = userObj.getUser();
+  var pubname = 'sgadmin';
+  var paramsss = `openid=${user.id}&pubname=${pubname}&projectId=Pj1101080255&userId=${user.id}&userName=${user.name}&userPhone=${user.phone}`;
+
   return request(`/sgadmin/duoduo-service/duoduoenv-service/ctrl/set?${commonParams()}`, {
   return request(`/sgadmin/duoduo-service/duoduoenv-service/ctrl/set?${commonParams()}`, {
     method: 'POST',
     method: 'POST',
+    from: 'sagacare',
     data: params,
     data: params,
     headers: {
     headers: {
       'Content-Type': 'application/json',
       'Content-Type': 'application/json',