diff --git a/console/client/src/sections/console/actions/index.js b/console/client/src/sections/console/actions/index.js index 521e5bd..88704fe 100644 --- a/console/client/src/sections/console/actions/index.js +++ b/console/client/src/sections/console/actions/index.js @@ -38,9 +38,21 @@ export function getVideo (params) { }); } +export function logoutApp (params) { + return dispatch => basicAction({ + type: 'get', + query: params, + dispatch: dispatch, + actionType: 'LOGOUT_APP', + url: ApiTable.logoutApp, + msg: { error: '退出应用失败' }, + }); +} + export default { editCrane, getCrane, getVideo, + logoutApp, } \ No newline at end of file diff --git a/console/client/src/sections/console/containers/index.js b/console/client/src/sections/console/containers/index.js index 1ca5aa6..3635c29 100644 --- a/console/client/src/sections/console/containers/index.js +++ b/console/client/src/sections/console/containers/index.js @@ -2,11 +2,11 @@ import React, { useEffect, useState, useRef } from 'react' import { push } from 'react-router-redux'; import { connect } from 'react-redux'; import request from 'superagent'; -import { getCrane } from '../actions' +import { getCrane, logoutApp } from '../actions' import { ApiTable } from '$utils' import { Colors } from '@peace/utils' import { - SettingOutlined, VideoCameraOutlined + SettingOutlined, VideoCameraOutlined, LogoutOutlined } from '@ant-design/icons'; import VideoModal from '../components/videoModal' import { Col, Row, Button, Modal, Input, Space } from 'antd'; @@ -57,6 +57,7 @@ function Index (props) { }) const [isModalOpen, setIsModalOpen] = useState(false); const [videoVis, setVideoVis] = useState(false) + const [isOutModalOpen, setIsOutModalOpen] = useState(false) const draw = (type, params = {}) => { const canvasArea = document.getElementById('canvasArea') @@ -475,8 +476,13 @@ function Index (props) { color: darkModde ? darkColor.textColor : 'auto', background: darkModde ? darkColor.background : 'auto' }}> -
+
+ + + @@ -508,29 +514,11 @@ function Index (props) { { [{ - k: '高度', - v: 'tower_height', - s: '-', - unit: 'm' - }, { - k: '幅度', - v: 'max_amp', - s: '-', - }, { k: '回转角', v: 'rotation', s: '-', unit: '°', dataFrom: 'live', - }, { - k: '重量', - v: 'x', - s: '-', - }, { - k: '力矩', - v: 'max_torque', - s: '-', - unit: 'KN*m' }, { k: '俯仰角', v: 'pitch', @@ -538,11 +526,29 @@ function Index (props) { unit: '°', dataFrom: 'live', }, { - k: '倾斜角', - v: 'inclination', - s: '-', - unit: '°', - dataFrom: 'live', + // k: '高度', + // v: 'tower_height', + // s: '-', + // unit: 'm' + }, { + // 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: '', v: '', @@ -609,6 +615,16 @@ function Index (props) { > + { + dispatch(logoutApp()); + }} + onCancel={() => { + setIsOutModalOpen(false) + }} + > + 确定退出应用吗? + { videoVis ? { setVideoVis(false) }} /> : '' diff --git a/console/client/src/utils/webapi.js b/console/client/src/utils/webapi.js index 92e00fd..7a652db 100644 --- a/console/client/src/utils/webapi.js +++ b/console/client/src/utils/webapi.js @@ -11,6 +11,7 @@ export const ApiTable = { craneSetting: 'v1/settings', dataLive: 'v1/data/live', videoGet: 'v1/video/get', + logoutApp: 'v1/', }; export const RouteTable = {