From d661e8e11eb48965aad0ffb0c2e4b391044b1f21 Mon Sep 17 00:00:00 2001 From: cles <208023732@qq.com> Date: Mon, 1 Sep 2025 13:47:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=9E=84=20App=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E5=B8=83=E5=B1=80=E5=92=8C=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?;=E6=B7=BB=E5=8A=A0=20SiderHeader=20=E5=92=8C=20SystemSettings?= =?UTF-8?q?=20=E7=BB=84=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/App.jsx | 27 +--- src/renderer/src/App.module.css | 16 ++ src/renderer/src/assets/base.css | 4 + .../components/SiderHeader/SiderHeader.jsx | 48 ++++++ .../SiderHeader/SiderHeader.module.css | 40 +++++ .../SystemSettings/SystemSettings.jsx | 138 ++++++++++++++++++ .../SystemSettings/SystemSettings.module.css | 129 ++++++++++++++++ 7 files changed, 381 insertions(+), 21 deletions(-) create mode 100644 src/renderer/src/App.module.css create mode 100644 src/renderer/src/components/SiderHeader/SiderHeader.jsx create mode 100644 src/renderer/src/components/SiderHeader/SiderHeader.module.css create mode 100644 src/renderer/src/components/SystemSettings/SystemSettings.jsx create mode 100644 src/renderer/src/components/SystemSettings/SystemSettings.module.css diff --git a/src/renderer/src/App.jsx b/src/renderer/src/App.jsx index 587eb3f..a4803cd 100644 --- a/src/renderer/src/App.jsx +++ b/src/renderer/src/App.jsx @@ -1,29 +1,14 @@ import { Layout } from 'antd' +import styles from './App.module.css' const { Sider, Content } = Layout -const contentStyle = { - textAlign: 'center', - minHeight: 'calc(100vh - 20px)', - color: '#fff', - backgroundColor: '#0958d9' -} -const siderStyle = { - textAlign: 'center', - color: '#fff', - backgroundColor: '#1677ff' -} -const layoutStyle = { - borderRadius: 8, - overflow: 'hidden', - width: 'calc(100% - 8px)', - maxWidth: 'calc(100% - 8px)' -} +import SiderHeader from './components/SiderHeader/SiderHeader' const App = () => ( - - - Sider + + + - Content + Content ) diff --git a/src/renderer/src/App.module.css b/src/renderer/src/App.module.css new file mode 100644 index 0000000..a3450aa --- /dev/null +++ b/src/renderer/src/App.module.css @@ -0,0 +1,16 @@ +.contentStyle { + text-align: center; + min-height: calc(100vh - 20px); + background-color: #fff; +} + +.siderStyle { + background-color: #fff; + border-right: 1px solid var(--border-color); +} + +.layoutStyle { + border-radius: 4px; + overflow: hidden; + width: calc(100% - 8px); +} diff --git a/src/renderer/src/assets/base.css b/src/renderer/src/assets/base.css index a2f901c..bd21df9 100644 --- a/src/renderer/src/assets/base.css +++ b/src/renderer/src/assets/base.css @@ -1,3 +1,7 @@ +:root{ + --bg-color: #ebe9e9; + --border-color: #c4c2c2; +} *, *::before, *::after { diff --git a/src/renderer/src/components/SiderHeader/SiderHeader.jsx b/src/renderer/src/components/SiderHeader/SiderHeader.jsx new file mode 100644 index 0000000..ec66919 --- /dev/null +++ b/src/renderer/src/components/SiderHeader/SiderHeader.jsx @@ -0,0 +1,48 @@ +import styles from './SiderHeader.module.css' +import { Flex } from 'antd' +import { Select, Button, Input } from 'antd' +import { + VideoCameraFilled, + GoldFilled, + ApiFilled, + SecurityScanFilled, + SlidersFilled +} from '@ant-design/icons' +import SystemSettings from '../SystemSettings/SystemSettings' +function SiderHeader() { + return ( + + +
+ 挠度仪控制面板 + +
+ + + + 设备列表: + + + + + + + +
+ +
+ ) +} + +export default SiderHeader diff --git a/src/renderer/src/components/SiderHeader/SiderHeader.module.css b/src/renderer/src/components/SiderHeader/SiderHeader.module.css new file mode 100644 index 0000000..fba8954 --- /dev/null +++ b/src/renderer/src/components/SiderHeader/SiderHeader.module.css @@ -0,0 +1,40 @@ +/* SiderHeader component styles */ + +.header { + border-bottom: 1px solid var(--bg-color); +} + +.titlePanel { + writing-mode: vertical-rl; + text-align: center; + user-select: none; + font-size: 14px; + margin-top: 8px; +} + +.contentPanel { + flex: 1; + padding: 4px; +} + +.icon { + padding: 4px; +} + +.label { + margin-right: 8px; +} + +.deviceSelect { + flex: 1; + height: 26px; +} + +.deviceInput { + flex: 1; + height: 26px; +} + +.actionButton { + flex: 1; +} diff --git a/src/renderer/src/components/SystemSettings/SystemSettings.jsx b/src/renderer/src/components/SystemSettings/SystemSettings.jsx new file mode 100644 index 0000000..aeeab13 --- /dev/null +++ b/src/renderer/src/components/SystemSettings/SystemSettings.jsx @@ -0,0 +1,138 @@ +import styles from './SystemSettings.module.css' +import { Flex, InputNumber, Select, Button, Input, Checkbox } from 'antd' +import { + SettingFilled, + InfoCircleFilled, + ControlFilled, + FolderFilled, + EyeOutlined, + EditOutlined +} from '@ant-design/icons' + +function SystemSettings() { + return ( + +
+ + + 系统设置 + +
+ + {/* 基本参数 */} +
+
基本参数
+ + + + + +
+ + {/* 应用参数 */} +
+
应用参数
+ + {/* 系统功能 */} +
+
系统功能
+ + + + + +
+ + {/* 重连功能 */} +
+
重连功能
+ 是否使能重连功能 +
+ +
+
+ + {/* 报警功能 */} +
+
报警功能
+ 是否使能报警功能 + + + + + + + + + +
+
+ + {/* 存储设置 */} +
+ 存储设置 + +
+ + 存储目录 +
+
+ + +
+
+ + + + + 实时数据 + 报警数据 +
+
+ ) +} + +export default SystemSettings diff --git a/src/renderer/src/components/SystemSettings/SystemSettings.module.css b/src/renderer/src/components/SystemSettings/SystemSettings.module.css new file mode 100644 index 0000000..7d7ae0d --- /dev/null +++ b/src/renderer/src/components/SystemSettings/SystemSettings.module.css @@ -0,0 +1,129 @@ +/* SystemSettings component styles */ + +.container { + flex: 1; + overflow: auto; +} + +.header { + padding: 4px; + padding-bottom: 0; +} + +.title { + font-weight: bold; +} + +.titleIcon { + margin-right: 4px; +} + +.section { + border: 1px solid #eee; + border-radius: 6px; + margin: 4px; + padding: 4px; +} + +.sectionTitle { + font-weight: bold; +} + +.basicParamsSection { + border: 1px solid #eee; + border-radius: 6px; + margin: 4px; + padding: 4px; +} + +.paramSelect { + width: 100%; + margin-bottom: 6px; + height: 26px; +} + +.paramInput { + flex: 1; + height: 26px; + margin-bottom: 6px; +} + +.paramButton { + flex: 1; + height: 28px; +} + +.appParamsSection { + border: 1px solid #eee; + border-radius: 6px; + margin: 4px; +} + +.subSection { + margin-bottom: 6px; + border: 1px solid #eee; + padding: 4px; +} + +.subSectionTitle { + font-weight: bold; + margin-bottom: 6px; +} + +.systemButton { + height: 28px; +} + +.checkbox { + margin-bottom: 4px; +} + +.checkboxLarge { + margin-bottom: 6px; +} + +.reconnectInterval { + margin-bottom: 8px; +} + +.inputNumber { + height: 18px; + margin-bottom: 4px; +} + +.inputNumberLast { + height: 18px; + margin-bottom: 8px; +} + +.alarmInputs { + margin-bottom: 6px; +} + +.storageSection { + border: 1px solid #eee; + border-radius: 6px; + margin: 4px; + padding: 4px; +} + +.storageTitle { + font-weight: bold; +} + +.storageIcon { + padding: 4px; +} + +.storageInputRow { + margin-bottom: 6px; +} + +.storageInput { + height: 26px; + flex: 1; +} + +.checkboxRight { + margin-right: 8px; +}