Browse Source

feat: 添加中值滤波算法设置,优化样式和滚动条样式

master
cles 2 months ago
parent
commit
42ac220239
  1. 29
      src/renderer/src/components/SystemSettings/SystemSettings.jsx
  2. 18
      src/renderer/src/components/SystemSettings/SystemSettings.module.css

29
src/renderer/src/components/SystemSettings/SystemSettings.jsx

@ -1,5 +1,5 @@
import styles from './SystemSettings.module.css' import styles from './SystemSettings.module.css'
import { Flex, InputNumber, Select, Button, Input, Checkbox, message } from 'antd' import { Flex, InputNumber, Select, Button, Input, Checkbox, message, Switch } from 'antd'
import { import {
SettingFilled, SettingFilled,
InfoCircleFilled, InfoCircleFilled,
@ -22,9 +22,12 @@ function SystemSettings() {
const [clearZeroLoading, setClearZeroLoading] = useState(false) const [clearZeroLoading, setClearZeroLoading] = useState(false)
const [storagePath, setStoragePath] = useState('') const [storagePath, setStoragePath] = useState('')
// //
const [realtimeDataEnabled, setRealtimeDataEnabled] = useState(false) const [realtimeDataEnabled, setRealtimeDataEnabled] = useState(false)
const [alarmDataEnabled, setAlarmDataEnabled] = useState(false) const [alarmDataEnabled, setAlarmDataEnabled] = useState(false)
//
const [medianFilterEnabled, setMedianFilterEnabled] = useState(false) //
const [medianFilterParam, setMedianFilterParam] = useState('') //
// //
const connectedDevice = useDeviceStore((state) => state.connectedDevice) const connectedDevice = useDeviceStore((state) => state.connectedDevice)
@ -866,6 +869,28 @@ function SystemSettings() {
报警数据 报警数据
</Checkbox> </Checkbox>
</div> </div>
{/* 算法设置 */}
<div className={styles.subSection}>
<div className={styles.subSectionTitle}>算法设置</div>
<Flex vertical gap={8}>
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
<div>是否启用中值滤波算法</div>
<Switch
checked={medianFilterEnabled}
onChange={(checked) => setMedianFilterEnabled(checked)}
/>
</div>
<Flex align="center" gap={8}>
<Input
addonBefore={'算法参数值'}
value={medianFilterParam}
onChange={(e) => setMedianFilterParam(e.target.value)}
placeholder="请输入算法参数值"
style={{ width: '100%' }}
/>
</Flex>
</Flex>
</div>
</Flex> </Flex>
) )
} }

18
src/renderer/src/components/SystemSettings/SystemSettings.module.css

@ -1,8 +1,22 @@
/* SystemSettings component styles */ /* SystemSettings component styles */
.container { .container {
flex: 1; flex: 1;
overflow: auto; overflow: auto; /* 保持兼容 */
overflow-y: auto;
height: 100%;
max-height: calc(100vh - 160px);
-webkit-overflow-scrolling: touch;
}
/* 滚动条样式 */
.container::-webkit-scrollbar {
width: 5px;
}
.container::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 5px;
}
.container::-webkit-scrollbar-track {
background-color: rgba(0, 0, 0, 0.05);
} }
.header { .header {

Loading…
Cancel
Save