123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- import React, { useCallback, useEffect, useRef, useState } from 'react';
- import { history, Link } from 'umi';
- import classNames from 'classnames';
- // import { getPersonList, exportPersonList } from '@/services/person';
- import { PageHeaderWrapper } from '@ant-design/pro-layout';
- import { FullscreenOutlined } from '@ant-design/icons';
- import { Button } from 'antd';
- import ScreenHeader from '@/components/ScreenBox/ScreenHeader';
- import GeoMap from '@/components/GeoMap';
- import StatisCard from '@/components/ScreenBox/StatisCard';
- import SquareBox from '@/components/ScreenBox/SquareBox';
- import { useFullScreen } from './hook';
- import MachineryType from './components/MachineryType';
- import MachineryStatus from './components/MachineryStatus';
-
- import WorkArea from './components/WorkArea';
- import List from './components/List';
- import ColorFont from './components/ColorFont';
- import WorkData from './components/WorkData';
- import Styles from './style.less';
-
- export default (props) => {
- const screenRef = useRef();
- const [height, setHeight] = useState('1080px');
- const { isFullScreen, toggleFullScreen } = useFullScreen(screenRef);
-
- const [machineryTypeData, setMachineryTypeData] = useState([
- { name: '收割机', value: 200 },
- { name: '播种机', value: 100 },
- { name: '农药机', value: 50 },
- ]);
-
- const [machineryStatusData, setMachineryStatusData] = useState([
- { name: '预约', value: 350 },
- { name: '作业', value: 900 },
- { name: '闲置', value: 650 },
- { name: '离线', value: 180 },
- { name: '维修', value: 380 },
- ]);
-
- const [workData, setWorkData] = useState([
- { name: '收割机', value: 35 },
- { name: '播种机', value: 35 },
- { name: '农药机', value: 30 },
- { name: '其他', value: 180 },
- ]);
-
- const [workAreaData, setWorkAreaData] = useState([
- { name: '收割机', value: 350 },
- { name: '播种机', value: 900 },
- { name: '农药机', value: 650 },
- { name: '其他', value: 180 },
- ]);
-
- return (
- <PageHeaderWrapper
- extra={
- <Button icon={<FullscreenOutlined />} onClick={toggleFullScreen}>
- 全屏
- </Button>
- }
- >
- <div
- className={classNames(Styles['screen-page'], Styles['pd-lr-40'], {
- [Styles['full-screen']]: isFullScreen,
- })}
- style={{ height }}
- ref={screenRef}
- >
- <div className={Styles['grail-layout']}>
- <div className={Styles['grail-header']}>
- <ScreenHeader weather="多云 21-28 °C" />
- </div>
- <div className={classNames(Styles['grail-container'], Styles['pd-tp-30'])}>
- <div className={Styles['grail-left']}>
- <div className="flex flex-column full-height">
- <div className="flex-0" style={{ height: '250px' }}>
- <MachineryType source={machineryTypeData} />
- </div>
- <div className="flex-1" style={{ marginTop: '30px' }}>
- <MachineryStatus source={machineryStatusData} />
- </div>
- </div>
- </div>
- <div className={classNames(Styles['grail-content'], Styles['pd-lr-40'])}>
- <div className={Styles['statis-container']}>
- <StatisCard color="#23E8AE" icon="icon1" value={2346} title="农机总数(台)" />
- <StatisCard color="#0BDAFF" icon="icon2" value={528} title="农机使用数(台)" />
- <StatisCard color="#F5CC5C" icon="icon3" value={168} title="总预约数(台)" />
- <StatisCard color="#C579FF" icon="icon4" value={1568} title="总服务数(台)" />
- </div>
- <GeoMap />
- </div>
- <div className={Styles['grail-right']}>
- <div className="flex flex-column full-height">
- <div className="flex-0" style={{ height: '250px' }}>
- <WorkData source={workData} />
- </div>
- <div className="flex-1" style={{ marginTop: '30px' }}>
- <WorkArea source={workAreaData} />
- </div>
- </div>
- </div>
- </div>
- <div className={classNames(Styles['grail-footer'], Styles['pd-tp-30'])}>
- <SquareBox>
- <div className="flex">
- <div className="flex-1">
- <List title="预约订单">
- <div>
- <ColorFont color="#F5CC5C">[快乐每一天]</ColorFont> 32s前预约了一台收割机,
- <ColorFont color="#44F68B">[收割机001]</ColorFont> 接到了此订单!
- </div>
- <div>
- <ColorFont color="#F5CC5C">[幸福人生]</ColorFont> 58分钟前预约了一台收割机,
- <ColorFont color="#44F68B">[播种机008]</ColorFont> 接到了此订单!尽快赶到!
- </div>
- <div>
- <ColorFont color="#F5CC5C">[灿烂人生]</ColorFont> 2个小时前预约了一台收割机,
- <ColorFont color="#44F68B">[收割机007]</ColorFont>{' '}
- 接到了此订单!正在赶往目的地!
- </div>
- </List>
- </div>
- <div className={classNames('flex-0', Styles['footer-middle'])} />
- <div className="flex-1">
- <List title="作业订单" color="green">
- <div>
- <ColorFont color="#44F68B">[收割机001]</ColorFont>
- 32s前接到了一个订单,距离目的地还有3.2公里,请农户耐心等待!
- </div>
- <div>
- <ColorFont color="#44F68B">[播种机008]</ColorFont>{' '}
- 2分钟前接到一个订单,距离目的地还有3.8公里,请农户耐心等待!
- </div>
- <div>
- <ColorFont color="#44F68B">[收割机007]</ColorFont>{' '}
- 2个小时前接到一个订单,距离目的地还有3.8公里,请农户耐心等待!
- </div>
- </List>
- </div>
- </div>
- </SquareBox>
- <div className={Styles['pd-tp-30']} style={{ height: '30px' }} />
- </div>
- </div>
- </div>
- </PageHeaderWrapper>
- );
- };
|