|
@@ -1,20 +1,19 @@
|
|
import React, { useState, useEffect, useCallback } from 'react';
|
|
import React, { useState, useEffect, useCallback } from 'react';
|
|
import PageHeader from '@/components/PageHeader';
|
|
import PageHeader from '@/components/PageHeader';
|
|
import Map from '@/components/map';
|
|
import Map from '@/components/map';
|
|
-import TopNavigator from '../Environment/components/topNavigator';
|
|
|
|
|
|
+import TopNavigator from '@/components/topNavigator';
|
|
import RunNavRight from './components/topNavRight';
|
|
import RunNavRight from './components/topNavRight';
|
|
import { FormattedMessage, history } from 'umi';
|
|
import { FormattedMessage, history } from 'umi';
|
|
-import { Input } from 'antd';
|
|
|
|
import styles from './index.less';
|
|
import styles from './index.less';
|
|
import mapstyles from '@/assets/css/map.less';
|
|
import mapstyles from '@/assets/css/map.less';
|
|
import Icon from '@/tenants-ui/Icon';
|
|
import Icon from '@/tenants-ui/Icon';
|
|
import SearchInput from '@/components/SearchInput';
|
|
import SearchInput from '@/components/SearchInput';
|
|
|
|
+import moment from 'moment';
|
|
|
|
|
|
-//import { equipImageMap } from '@/config/image.js';
|
|
|
|
-//import { getMapList } from '@/services/ant-design-pro/environment';
|
|
|
|
|
|
+import { queryDeviceTimeManage } from '@/services/ant-design-pro/environment';
|
|
|
|
|
|
type runtimeNavType = {
|
|
type runtimeNavType = {
|
|
- normalRun: number;
|
|
|
|
|
|
+ normalRun: any;
|
|
overtimeWork: number;
|
|
overtimeWork: number;
|
|
overtimeBook: number;
|
|
overtimeBook: number;
|
|
};
|
|
};
|
|
@@ -23,24 +22,54 @@ const Runtime: React.FC = () => {
|
|
// const { maptemp6 } = equipImageMap;
|
|
// const { maptemp6 } = equipImageMap;
|
|
|
|
|
|
const [searchText, setSearchText] = useState<string>();
|
|
const [searchText, setSearchText] = useState<string>();
|
|
- const [runtimeNav] = useState<runtimeNavType>({
|
|
|
|
- normalRun: 22,
|
|
|
|
- overtimeWork: 22,
|
|
|
|
- overtimeBook: 22,
|
|
|
|
- });
|
|
|
|
|
|
+ const [runtimeNav, setRuntimeNav] = useState<runtimeNavType>({});
|
|
//const [mapList, setMapList] = useState<API.MapInfo[]>([]);
|
|
//const [mapList, setMapList] = useState<API.MapInfo[]>([]);
|
|
-
|
|
|
|
|
|
+ const [selFloorId, setSelFloorId] = useState<string>();
|
|
|
|
+ const [selTime, setSelTime] = useState<string>(moment().format('YYYYMMDD'));
|
|
|
|
+ const changeFloorId = (data: string) => {
|
|
|
|
+ debugger;
|
|
|
|
+ setSelFloorId(data);
|
|
|
|
+ };
|
|
const checkRecord = () => {
|
|
const checkRecord = () => {
|
|
history.push('/runtime/recordList');
|
|
history.push('/runtime/recordList');
|
|
console.log('showR');
|
|
console.log('showR');
|
|
};
|
|
};
|
|
- // useEffect(() => {
|
|
|
|
- // getMapList({ floorId: 'sffsdfdsfdf', floorNumber: 22 }).then(function (res) {
|
|
|
|
- // var data: API.MapInfo[] = res.data || [];
|
|
|
|
- // data.forEach((item, index) => {});
|
|
|
|
- // setMapList(data);
|
|
|
|
- // });
|
|
|
|
- // }, []);
|
|
|
|
|
|
+ const changeTime = (time) => {
|
|
|
|
+ debugger;
|
|
|
|
+ var timeStr = time.format('YYYYDMMDD');
|
|
|
|
+ setSelTime(timeStr);
|
|
|
|
+ };
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ if (selFloorId && selTime) {
|
|
|
|
+ debugger;
|
|
|
|
+ queryDeviceTimeManage({
|
|
|
|
+ //floorId: selFloorId,
|
|
|
|
+ floorId: 'Fl11010802593241ec348ecb4148806b9034c8957454',
|
|
|
|
+ date: selTime,
|
|
|
|
+ //date: 20220212,
|
|
|
|
+ }).then(function (res) {
|
|
|
|
+ debugger;
|
|
|
|
+ var resdata = res || {};
|
|
|
|
+ setRuntimeNav({
|
|
|
|
+ normalRun: resdata.workTimeNum,
|
|
|
|
+ overtimeWork: resdata.overTimeNum,
|
|
|
|
+ overtimeBook: resdata.meetTimeNum,
|
|
|
|
+ });
|
|
|
|
+ var resList = res.content || [];
|
|
|
|
+ resList.forEach((item) => {
|
|
|
|
+ item.runTimeStatus = 'normalRun';
|
|
|
|
+ if (item.hasOwnProperty('meetTime')) {
|
|
|
|
+ debugger;
|
|
|
|
+ item.runTimeStatus = 'overtimeBook';
|
|
|
|
+ }
|
|
|
|
+ if (item.hasOwnProperty('overTimeStartTime')) {
|
|
|
|
+ debugger;
|
|
|
|
+ item.runTimeStatus = 'overtimeWork';
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }, [selFloorId, selTime]);
|
|
return (
|
|
return (
|
|
<>
|
|
<>
|
|
<PageHeader
|
|
<PageHeader
|
|
@@ -61,7 +90,8 @@ const Runtime: React.FC = () => {
|
|
/>
|
|
/>
|
|
<TopNavigator
|
|
<TopNavigator
|
|
type={'runtime'}
|
|
type={'runtime'}
|
|
- action={<RunNavRight runtimeNav={runtimeNav}></RunNavRight>}
|
|
|
|
|
|
+ action={<RunNavRight runtimeNav={runtimeNav} changeTime={changeTime}></RunNavRight>}
|
|
|
|
+ changeFloorId={changeFloorId}
|
|
></TopNavigator>
|
|
></TopNavigator>
|
|
<div className={styles.maptop}>
|
|
<div className={styles.maptop}>
|
|
<div className={styles.right}></div>
|
|
<div className={styles.right}></div>
|
|
@@ -85,6 +115,7 @@ const Runtime: React.FC = () => {
|
|
</div> */}
|
|
</div> */}
|
|
<Map
|
|
<Map
|
|
searchText={searchText}
|
|
searchText={searchText}
|
|
|
|
+ selFloorId={selFloorId}
|
|
type={'runtime'}
|
|
type={'runtime'}
|
|
render={(item, index) => {
|
|
render={(item, index) => {
|
|
return (
|
|
return (
|