MachineryInfo.jsx 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import React from 'react';
  2. import { Col, Row } from 'antd';
  3. import { Link } from 'umi';
  4. import Styles from './style.less';
  5. export default React.forwardRef((props, ref) => {
  6. const { data = {}, onClose } = props;
  7. return (
  8. <div ref={ref} className={Styles['info-window']}>
  9. <div style={{ textAlign: 'right', fontSize: '24px' }} onClick={onClose}>
  10. ×
  11. </div>
  12. <Row gutter={16}>
  13. <Col span={8}>农机名称</Col>
  14. <Col span={16}>
  15. <Link
  16. to={`/Machinery/OperationStatistics/detail?machineryId=${data.machineryId}`}
  17. target="_blank"
  18. >
  19. {data.machineryName || ''}
  20. </Link>
  21. </Col>
  22. </Row>
  23. <Row gutter={16}>
  24. <Col span={8}>设备编号</Col>
  25. <Col span={16}>{data.deviceNo || ''}</Col>
  26. </Row>
  27. <Row gutter={16}>
  28. <Col span={8}>设备类型</Col>
  29. <Col span={16}>{data.deviceType === 'shensong' ? '深松' : '飞防'}</Col>
  30. </Row>
  31. <Row gutter={16}>
  32. <Col span={8}>当前状态</Col>
  33. <Col span={16}>{data.onlineStatus === 1 ? '在线' : '下线'}</Col>
  34. </Row>
  35. <Row gutter={16}>
  36. <Col span={8}>位置信息</Col>
  37. <Col span={16}>{data.loc || ''}</Col>
  38. </Row>
  39. </div>
  40. );
  41. });