|
@ -2,11 +2,11 @@ import React, { useEffect, useState, useRef } from 'react' |
|
|
import { push } from 'react-router-redux'; |
|
|
import { push } from 'react-router-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
import request from 'superagent'; |
|
|
import request from 'superagent'; |
|
|
import { getCrane } from '../actions' |
|
|
import { getCrane, logoutApp } from '../actions' |
|
|
import { ApiTable } from '$utils' |
|
|
import { ApiTable } from '$utils' |
|
|
import { Colors } from '@peace/utils' |
|
|
import { Colors } from '@peace/utils' |
|
|
import { |
|
|
import { |
|
|
SettingOutlined, VideoCameraOutlined |
|
|
SettingOutlined, VideoCameraOutlined, LogoutOutlined |
|
|
} from '@ant-design/icons'; |
|
|
} from '@ant-design/icons'; |
|
|
import VideoModal from '../components/videoModal' |
|
|
import VideoModal from '../components/videoModal' |
|
|
import { Col, Row, Button, Modal, Input, Space } from 'antd'; |
|
|
import { Col, Row, Button, Modal, Input, Space } from 'antd'; |
|
@ -57,6 +57,7 @@ function Index (props) { |
|
|
}) |
|
|
}) |
|
|
const [isModalOpen, setIsModalOpen] = useState(false); |
|
|
const [isModalOpen, setIsModalOpen] = useState(false); |
|
|
const [videoVis, setVideoVis] = useState(false) |
|
|
const [videoVis, setVideoVis] = useState(false) |
|
|
|
|
|
const [isOutModalOpen, setIsOutModalOpen] = useState(false) |
|
|
|
|
|
|
|
|
const draw = (type, params = {}) => { |
|
|
const draw = (type, params = {}) => { |
|
|
const canvasArea = document.getElementById('canvasArea') |
|
|
const canvasArea = document.getElementById('canvasArea') |
|
@ -475,8 +476,13 @@ function Index (props) { |
|
|
color: darkModde ? darkColor.textColor : 'auto', |
|
|
color: darkModde ? darkColor.textColor : 'auto', |
|
|
background: darkModde ? darkColor.background : 'auto' |
|
|
background: darkModde ? darkColor.background : 'auto' |
|
|
}}> |
|
|
}}> |
|
|
<div style={{ padding: '0 8px 8px', textAlign: 'right' }}> |
|
|
<div style={{ padding: '0 8px 8px', }}> |
|
|
<Space> |
|
|
<Space> |
|
|
|
|
|
<Button type="danger" size={'large'} style={{}} icon={<LogoutOutlined />} onClick={() => { setIsOutModalOpen(true) }}> |
|
|
|
|
|
退出 |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Space> |
|
|
|
|
|
<Space style={{ float: 'right' }}> |
|
|
<Button type="primary" size={'large'} style={{}} icon={<VideoCameraOutlined />} onClick={() => { setVideoVis(true) }}> |
|
|
<Button type="primary" size={'large'} style={{}} icon={<VideoCameraOutlined />} onClick={() => { setVideoVis(true) }}> |
|
|
监控视频 |
|
|
监控视频 |
|
|
</Button> |
|
|
</Button> |
|
@ -508,29 +514,11 @@ function Index (props) { |
|
|
<Row style={{ height: '100%' }}> |
|
|
<Row style={{ height: '100%' }}> |
|
|
{ |
|
|
{ |
|
|
[{ |
|
|
[{ |
|
|
k: '高度', |
|
|
|
|
|
v: 'tower_height', |
|
|
|
|
|
s: '-', |
|
|
|
|
|
unit: 'm' |
|
|
|
|
|
}, { |
|
|
|
|
|
k: '幅度', |
|
|
|
|
|
v: 'max_amp', |
|
|
|
|
|
s: '-', |
|
|
|
|
|
}, { |
|
|
|
|
|
k: '回转角', |
|
|
k: '回转角', |
|
|
v: 'rotation', |
|
|
v: 'rotation', |
|
|
s: '-', |
|
|
s: '-', |
|
|
unit: '°', |
|
|
unit: '°', |
|
|
dataFrom: 'live', |
|
|
dataFrom: 'live', |
|
|
}, { |
|
|
|
|
|
k: '重量', |
|
|
|
|
|
v: 'x', |
|
|
|
|
|
s: '-', |
|
|
|
|
|
}, { |
|
|
|
|
|
k: '力矩', |
|
|
|
|
|
v: 'max_torque', |
|
|
|
|
|
s: '-', |
|
|
|
|
|
unit: 'KN*m' |
|
|
|
|
|
}, { |
|
|
}, { |
|
|
k: '俯仰角', |
|
|
k: '俯仰角', |
|
|
v: 'pitch', |
|
|
v: 'pitch', |
|
@ -538,11 +526,29 @@ function Index (props) { |
|
|
unit: '°', |
|
|
unit: '°', |
|
|
dataFrom: 'live', |
|
|
dataFrom: 'live', |
|
|
}, { |
|
|
}, { |
|
|
k: '倾斜角', |
|
|
// k: '高度',
|
|
|
v: 'inclination', |
|
|
// v: 'tower_height',
|
|
|
s: '-', |
|
|
// s: '-',
|
|
|
unit: '°', |
|
|
// unit: 'm'
|
|
|
dataFrom: 'live', |
|
|
}, { |
|
|
|
|
|
// k: '幅度',
|
|
|
|
|
|
// v: 'max_amp',
|
|
|
|
|
|
// s: '-',
|
|
|
|
|
|
}, { |
|
|
|
|
|
// k: '重量',
|
|
|
|
|
|
// v: 'x',
|
|
|
|
|
|
// s: '-',
|
|
|
|
|
|
}, { |
|
|
|
|
|
// k: '力矩',
|
|
|
|
|
|
// v: 'max_torque',
|
|
|
|
|
|
// s: '-',
|
|
|
|
|
|
// unit: 'KN*m'
|
|
|
|
|
|
}, { |
|
|
|
|
|
// k: '倾斜角',
|
|
|
|
|
|
// v: 'inclination',
|
|
|
|
|
|
// s: '-',
|
|
|
|
|
|
// unit: '°',
|
|
|
|
|
|
// dataFrom: 'live',
|
|
|
}, { |
|
|
}, { |
|
|
k: '', |
|
|
k: '', |
|
|
v: '', |
|
|
v: '', |
|
@ -609,6 +615,16 @@ function Index (props) { |
|
|
> |
|
|
> |
|
|
<Input.Password size="large" placeholder="请输入密码" /> |
|
|
<Input.Password size="large" placeholder="请输入密码" /> |
|
|
</Modal> |
|
|
</Modal> |
|
|
|
|
|
<Modal title="退出应用" open={isOutModalOpen} |
|
|
|
|
|
onOk={() => { |
|
|
|
|
|
dispatch(logoutApp()); |
|
|
|
|
|
}} |
|
|
|
|
|
onCancel={() => { |
|
|
|
|
|
setIsOutModalOpen(false) |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
<span style={{ fontSize: 'large', fontWeight: 'bolder' }}>确定退出应用吗?</span> |
|
|
|
|
|
</Modal> |
|
|
{ |
|
|
{ |
|
|
videoVis ? |
|
|
videoVis ? |
|
|
<VideoModal onCancel={() => { setVideoVis(false) }} /> : '' |
|
|
<VideoModal onCancel={() => { setVideoVis(false) }} /> : '' |
|
|