Commit 8ec638b1 authored by 陈龙's avatar 陈龙

feat: 优化文字样式

parent b6b788fb
...@@ -28,7 +28,7 @@ const Demo = () => { ...@@ -28,7 +28,7 @@ const Demo = () => {
},[]) },[])
return ( return (
<div> <div>
<div style={{height: 400}}> <div style={{height: 600}}>
<MobileHistoryChart deviceParams={deviceParams} date={date}/> <MobileHistoryChart deviceParams={deviceParams} date={date}/>
</div> </div>
</div> </div>
......
...@@ -203,5 +203,5 @@ ...@@ -203,5 +203,5 @@
.@{history-view}-item { .@{history-view}-item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 0.3rem;
} }
...@@ -27,6 +27,11 @@ const MobileHistoryChart = ( ...@@ -27,6 +27,11 @@ const MobileHistoryChart = (
curveCenter: true, curveCenter: true,
ignoreOutliers: true ignoreOutliers: true
}); });
const checkboxStyle = {
'--icon-size': handlePx(18, 'px'),
'--font-size': handlePx(14, 'px'),
'--gap': handlePx(6, 'px'),
}
const checkBoxOptions = useMemo(() => { const checkBoxOptions = useMemo(() => {
return Object.keys(options).reduce((final, cur) => { return Object.keys(options).reduce((final, cur) => {
if (options[cur]) final.push(cur); if (options[cur]) final.push(cur);
...@@ -128,7 +133,8 @@ const MobileHistoryChart = ( ...@@ -128,7 +133,8 @@ const MobileHistoryChart = (
useEffect(() => { useEffect(() => {
getDataSource(); getDataSource();
}, [options.ignoreOutliers, date]) }, [options.ignoreOutliers, date])
return deviceAlarmSchemes && chartDataSource ? <div style={{width: '100%'}}> return deviceAlarmSchemes && chartDataSource ?
<div style={{width: '100%', height: '100%', display: 'flex', flexDirection: 'column'}}>
{ {
chartDataSource.length === 1 ? <div className={styles[`${prefixCls}-item`]}> chartDataSource.length === 1 ? <div className={styles[`${prefixCls}-item`]}>
<span style={{fontSize: handlePx(14)}}>曲线形态:</span> <span style={{fontSize: handlePx(14)}}>曲线形态:</span>
...@@ -148,11 +154,6 @@ const MobileHistoryChart = ( ...@@ -148,11 +154,6 @@ const MobileHistoryChart = (
<div className={styles[`${prefixCls}-item`]}> <div className={styles[`${prefixCls}-item`]}>
<span style={{fontSize: handlePx(14)}}>曲线设置:</span> <span style={{fontSize: handlePx(14)}}>曲线设置:</span>
<Checkbox.Group <Checkbox.Group
style={{
'--icon-size': handlePx(18),
'--font-size': handlePx(14),
'--gap': handlePx(6),
}}
value={checkBoxOptions} value={checkBoxOptions}
onChange={val => { onChange={val => {
let _arr = Object.keys(options); let _arr = Object.keys(options);
...@@ -164,12 +165,12 @@ const MobileHistoryChart = ( ...@@ -164,12 +165,12 @@ const MobileHistoryChart = (
}} }}
> >
<Space direction='horizontal'> <Space direction='horizontal'>
<Checkbox value='curveCenter'>曲线居中</Checkbox> <Checkbox style={checkboxStyle} value='curveCenter'>曲线居中</Checkbox>
<Checkbox value='ignoreOutliers'>滤波</Checkbox> <Checkbox style={checkboxStyle} value='ignoreOutliers'>滤波</Checkbox>
</Space> </Space>
</Checkbox.Group> </Checkbox.Group>
</div> </div>
<div style={{height: rest.height || '10rem', width: rest.width || '100%'}}> <div style={{width: '100%', flex: 1}}>
<SimgleChart <SimgleChart
showBoxOption={showBoxOption} showBoxOption={showBoxOption}
curveCenter={options.curveCenter} curveCenter={options.curveCenter}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment