Browse Source

时间控制

zhaojijng 3 years ago
parent
commit
693f56fc35

+ 1 - 1
src/components/SearchInput/index.tsx

@@ -41,7 +41,7 @@ const SearchInput: React.FC<SearchInputProps> = ({ onSearch, mapList }) => {
 
   //这是搜索的下拉列表的点击
   const handleChange = (sel: string) => {
-    debugger;
+    //debugger;
     setValue(null); //清空输入的值
     setMatchData([]); //清空搜索匹配列表
     onSearch(sel);

+ 1 - 1
src/components/map/index.tsx

@@ -80,7 +80,7 @@ const Map: React.FC<MapProps> = ({ type, searchText, selFloorId, render, mapList
           top = -(item.top || 0);
         }
       });
-      debugger;
+      //debugger;
       setTranslateX(left);
       setTranslateY(top);
     }

+ 1 - 1
src/hooks/useMapList.ts

@@ -11,7 +11,7 @@ function useMapList(selFloorId: string) {
   //当selFloorId 改变时调用
   useEffect(() => {
     if (selFloorId) {
-      debugger;
+      //debugger;
       getMapList({ floorId: selFloorId, projectId: '' }).then((res) => {
         var data: API.MapInfo[] = (res.data || {}).spaceList || [];
         mapListData = data;

+ 1 - 1
src/models/map.ts

@@ -6,7 +6,7 @@ export default function () {
 
   const getMapListData = useCallback((selFloorId) => {
     if (selFloorId) {
-      debugger;
+      //debugger;
       getMapList({ floorId: selFloorId, projectId: '' }).then((res) => {
         var data: API.MapInfo[] = (res.data || {}).spaceList || [];
         setMapList(data);

+ 1 - 1
src/pages/Environment/index.tsx

@@ -90,7 +90,7 @@ const Environment: React.FC = () => {
   ]);
   const [selNav, setSelNav] = useState<navigatorItem>(navigatorList[0]);
   const changeFloorId = (data: string) => {
-    debugger;
+    //debugger;
     setSelFloorId(data);
   };
   //导航切换时

+ 1 - 1
src/pages/Equipment/index.tsx

@@ -69,7 +69,7 @@ const Environment: React.FC = () => {
   const [selNav, setSelNav] = useState<navigatorItem>(navigatorList[0]);
   const [selFloorId, setSelFloorId] = useState<string>();
   const changeFloorId = (data: string) => {
-    debugger;
+    //debugger;
     setSelFloorId(data);
   };
   const navigatorChange = (item: navigatorItem) => {

+ 15 - 16
src/pages/Runtime/index.tsx

@@ -32,7 +32,7 @@ const Runtime: React.FC = () => {
 
   //楼层切换的回调
   const changeFloorId = (data: string) => {
-    debugger;
+    //debugger;
     setSelFloorId(data);
   };
   const checkRecord = () => {
@@ -41,7 +41,7 @@ const Runtime: React.FC = () => {
   };
   //时间切换的回调
   const changeTime = (time) => {
-    debugger;
+    //debugger;
     var timeStr = time.format('YYYYMMDD');
     setSelTime(timeStr);
   };
@@ -50,7 +50,7 @@ const Runtime: React.FC = () => {
     if (selFloorId) {
       getMapList({ floorId: 'Fl11010802593241ec348ecb4148806b9034c8957454', projectId: '' }).then(
         (res) => {
-          debugger;
+          //debugger;
           var data: API.MapInfo[] = (res.data || {}).spaceList || [];
           setMapList(data);
         },
@@ -106,21 +106,20 @@ const Runtime: React.FC = () => {
 
   useEffect(() => {
     //mapList,spaceTimeList 这两个数据的结合
-    debugger;
     console.log('dfsd-------', mapList, spaceTimeList);
-    if (mapList && mapList.length > 0 && spaceTimeList && spaceTimeList.length > 0) {
-      var combineList = [];
-      mapList.map(function (mitem) {
-        var spaceId = mitem.spaceId;
-        var filterSpace = spaceTimeList.filter((ele) => {
-          return ele.id == spaceId;
-        });
-
-        var combine = Object.assign({}, mitem, filterSpace[0]);
-        combineList.push(combine);
+    // if (mapList && mapList.length > 0 && spaceTimeList && spaceTimeList.length > 0) {
+    var combineList = [];
+    mapList.map(function (mitem) {
+      var spaceId = mitem.spaceId;
+      var filterSpace = spaceTimeList.filter((ele) => {
+        return ele.id == spaceId;
       });
-      setMapCombineList(combineList);
-    }
+
+      var combine = Object.assign({}, mitem, filterSpace[0]);
+      combineList.push(combine);
+    });
+    setMapCombineList(combineList);
+    //  }
   }, [mapList, spaceTimeList]);
 
   return (