From 0185a0ade6bdda3e2b7db654b2e4c8cb093f6af2 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 21 Mar 2023 17:34:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layout/containers/layout/index.js | 1 - .../src/layout/containers/layout/index.less | 2 - .../src/layout/containers/no-match/index.js | 4 +- console/client/src/layout/index.js | 13 ++-- console/client/src/layout/index.less | 5 ++ .../src/sections/console/containers/index.js | 39 +++++++++-- .../src/sections/console/containers/setUp.js | 69 +++++++++++++++++++ console/client/src/sections/console/routes.js | 21 +++++- .../client/src/sections/console/style.less | 6 ++ console/client/src/styles/antd.less | 10 --- console/client/src/styles/theme.less | 16 ----- 11 files changed, 141 insertions(+), 45 deletions(-) delete mode 100644 console/client/src/layout/containers/layout/index.less create mode 100644 console/client/src/layout/index.less create mode 100644 console/client/src/sections/console/containers/setUp.js delete mode 100644 console/client/src/styles/antd.less delete mode 100644 console/client/src/styles/theme.less diff --git a/console/client/src/layout/containers/layout/index.js b/console/client/src/layout/containers/layout/index.js index 5e58ad2..3d7c87e 100644 --- a/console/client/src/layout/containers/layout/index.js +++ b/console/client/src/layout/containers/layout/index.js @@ -1,6 +1,5 @@ 'use strict'; -import './index.less'; import React, { useState, useEffect } from 'react'; import { connect } from 'react-redux'; import { message, Layout } from 'antd'; diff --git a/console/client/src/layout/containers/layout/index.less b/console/client/src/layout/containers/layout/index.less deleted file mode 100644 index d55219a..0000000 --- a/console/client/src/layout/containers/layout/index.less +++ /dev/null @@ -1,2 +0,0 @@ -@import '~perfect-scrollbar/css/perfect-scrollbar.css'; -@import '~nprogress/nprogress.css'; \ No newline at end of file diff --git a/console/client/src/layout/containers/no-match/index.js b/console/client/src/layout/containers/no-match/index.js index c0437a5..e717d08 100644 --- a/console/client/src/layout/containers/no-match/index.js +++ b/console/client/src/layout/containers/no-match/index.js @@ -8,8 +8,8 @@ const NoMatch = props => {

404

PAGE NOT FOUND

-

很遗憾,您暂时无法访问该页面。

-

请检查您访问的链接地址是否正确。

+

很遗憾,您暂时无法访问该页面.

+

请检查您访问的链接地址是否正确.

Copyright © {moment().year()} 飞尚

) diff --git a/console/client/src/layout/index.js b/console/client/src/layout/index.js index a59df43..a6878eb 100644 --- a/console/client/src/layout/index.js +++ b/console/client/src/layout/index.js @@ -12,7 +12,8 @@ import * as layoutActions from './actions/global'; import zhCN from 'antd/lib/locale/zh_CN'; import { basicReducer } from '@peace/utils'; import 'moment/locale/zh-cn'; -import 'antd/dist/antd.less'; +// import 'antd/dist/antd.less'; +import './index.less'; moment.locale('zh-cn'); @@ -29,7 +30,7 @@ const Root = props => { const flatRoutes = (routes) => { const combineRoutes = []; - function flat(routes, parentRoute) { + function flat (routes, parentRoute) { routes.forEach((route, i) => { let obj = { path: route.path, @@ -39,10 +40,10 @@ const Root = props => { key: route.key } if (!route.path.startsWith("/")) { - console.error('路由配置需以 "/" 开始:' + route.path); + console.error('路由配置需以 "/" 开始:' + route.path); } if (route.path.length > 1 && route.path[route.path.length] == '/') { - console.error('除根路由路由配置不可以以 "/" 结束:' + route.path); + console.error('除根路由路由配置不可以以 "/" 结束:' + route.path); } if (parentRoute && parentRoute != '/') { obj.path = parentRoute + route.path; @@ -90,9 +91,9 @@ const Root = props => { let actions = { layout: layoutActions } - + for (let s of sections) { - if (!s.key) console.warn('请给你的section添加一个key值,section name:' + s.name); + if (!s.key) console.warn('请给你的section添加一个key值,section name:' + s.name); for (let r of s.routes) { if (r.type == 'inner' || r.type == 'home') { innerRoutes.push(r.route) diff --git a/console/client/src/layout/index.less b/console/client/src/layout/index.less new file mode 100644 index 0000000..74fcbb5 --- /dev/null +++ b/console/client/src/layout/index.less @@ -0,0 +1,5 @@ +@import '~perfect-scrollbar/css/perfect-scrollbar.css'; +@import '~nprogress/nprogress.css'; + +@import '~antd/dist/antd.dark.less'; +@primary-color: rgb(249,179,45); // 全局主色 \ 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 da1eb43..668fe77 100644 --- a/console/client/src/sections/console/containers/index.js +++ b/console/client/src/sections/console/containers/index.js @@ -1,5 +1,10 @@ import React, { useEffect, useState, useRef } from 'react' -import { Col, Row } from 'antd'; +import { push } from 'react-router-redux'; +import { connect } from 'react-redux'; +import { + SettingOutlined +} from '@ant-design/icons'; +import { Col, Row, Button, Modal, Input } from 'antd'; import '../style.less' function calculateIntersection (cx, cy, d, angle) { @@ -33,6 +38,7 @@ function calculateIntersection (cx, cy, d, angle) { function Index (props) { + const { dispatch } = props const xyCvs = useRef() const xzCvs = useRef() const [darkModde] = useState(true) @@ -42,7 +48,8 @@ function Index (props) { subTextColor: '#D3D3D3', shadow: '#303030' }) - + const [isModalOpen, setIsModalOpen] = useState(false); + useEffect(() => { console.log(FS_API_ROOT, window.FS_API_ROOT); const canvasArea = document.getElementById('canvasArea') @@ -411,13 +418,20 @@ function Index (props) { boxShadow: `0 0 10px ${darkModde ? darkColor.shadow : 'rgba(0, 0, 0, 0.2)'}`, color: darkModde ? darkColor.textColor : 'auto' } + return (
-
+
+ +
+ +
@@ -493,11 +507,24 @@ function Index (props) { }) } - -
+ { + dispatch(push('/setup')); + }} + onCancel={() => { + setIsModalOpen(false) + }} + > + +
) } -export default Index \ No newline at end of file +function mapStateToProps (state) { + const { auth } = state; + return {} +} + +export default connect(mapStateToProps)(Index); \ No newline at end of file diff --git a/console/client/src/sections/console/containers/setUp.js b/console/client/src/sections/console/containers/setUp.js new file mode 100644 index 0000000..df598b6 --- /dev/null +++ b/console/client/src/sections/console/containers/setUp.js @@ -0,0 +1,69 @@ +import React, { useEffect, useState, useRef } from 'react' +import { push } from 'react-router-redux'; +import { connect } from 'react-redux'; +import { + BorderlessTableOutlined, BlockOutlined, RollbackOutlined +} from '@ant-design/icons'; +import { Col, Row, Button, Modal, Input } from 'antd'; +import '../style.less' + +function SetUp ({ dispatch }) { + const [renderMenu, setRenderMenu] = useState([]) + const [levelOneMenu] = useState([{ + n: '参数标定', + ic: , + child: [ + { + n: '塔机参数', + ic: + }, { + n: '返回', + ic: , + click: () => { + dispatch(push('/')); + } + }, + ] + }, { + n: '限位告警参数', + ic: + }, { + n: '返回', + ic: , + click: () => { + dispatch(push('/')); + } + },]) + + useEffect(() => { + setRenderMenu(levelOneMenu) + }, []) + + + return ( +
+
+ { + renderMenu.map((item, index) => { + return ( +
+ {item.ic} +
+ {item.n} +
+
+ ) + }) + } +
+ +
+ ) +} + +function mapStateToProps (state) { + const { auth } = state; + return {} +} + +export default connect(mapStateToProps)(SetUp); \ No newline at end of file diff --git a/console/client/src/sections/console/routes.js b/console/client/src/sections/console/routes.js index cbecec2..4bf8cef 100644 --- a/console/client/src/sections/console/routes.js +++ b/console/client/src/sections/console/routes.js @@ -1,5 +1,6 @@ 'use strict'; import Console from './containers/index'; +import SetUp from './containers/setUp'; export default [{ type: 'outer', @@ -8,6 +9,22 @@ export default [{ key: 'console', breadcrumb: '控制台', // 不设置 component 则面包屑禁止跳转 - component: Console - } + component: Console, + childRoutes: [{ + type: 'outer', + path: '/setup', + key: 'setup', + component: SetUp, + breadcrumb: '设置', + }] + }, + +}, { + type: 'outer', + route: { + path: '/setup', + key: 'setup', + component: SetUp, + breadcrumb: '设置', + }, }]; \ No newline at end of file diff --git a/console/client/src/sections/console/style.less b/console/client/src/sections/console/style.less index 2a9f98d..ad39237 100644 --- a/console/client/src/sections/console/style.less +++ b/console/client/src/sections/console/style.less @@ -27,4 +27,10 @@ font-size: 14px; text-transform: uppercase; text-align: right; +} + +// +.setup-icon { + font-size: 128px; + display: block; } \ No newline at end of file diff --git a/console/client/src/styles/antd.less b/console/client/src/styles/antd.less deleted file mode 100644 index f4c73e8..0000000 --- a/console/client/src/styles/antd.less +++ /dev/null @@ -1,10 +0,0 @@ - -@icon-url: "/assets/fonticon/iconfont"; - -.tree-transfer .ant-transfer-list-body { - overflow: auto !important; -} - -.ant-pro-table-search { - background-color: @component-background !important; -} \ No newline at end of file diff --git a/console/client/src/styles/theme.less b/console/client/src/styles/theme.less deleted file mode 100644 index 574643a..0000000 --- a/console/client/src/styles/theme.less +++ /dev/null @@ -1,16 +0,0 @@ -@import "~antd/lib/style/themes/default.less"; -@primary-color : @blue-6; -@link-color : @primary-color; -@secondary-color : fade(@primary-color, 20%); -@btn-primary-bg : @primary-color; -@select-item-selected-option-color: @primary-color; -@processing-color : @primary-color; -@select-item-selected-bg : @background-color-base; -@skeleton-color : @primary-color; -@btn-primary-bg : @primary-color; - -@component-background: transparent; - -:root { - --PC: @primary-color; -} \ No newline at end of file