Commit 19c7264d authored by 陈龙's avatar 陈龙

feat: 优化历史曲线

parent 9a26edf0
......@@ -47,10 +47,10 @@ const deviceParams = [
"deviceCode": "LLJ00000001",
"sensors": "出水累计流量",
"deviceType": "流量计"
}
/* {
},/*
{
"deviceCode": "JFJ00000001",
"sensors": "沉淀池投矾量瞬时,是否在线",
"sensors": "沉淀池投矾量瞬时,",
"deviceType": "加矾间"
}*/
];
......
......@@ -64,8 +64,8 @@ const shortcutsForDay = [
value: '近3天'
},
{
label: '近5天',
value: '近5天'
label: '近7天',
value: '近7天'
},
/* {
label: '去年同期',
......@@ -79,8 +79,8 @@ const shortcutsForMonth = [
value: '近3月'
},
{
label: '近5月',
value: '近5月'
label: '近6月',
value: '近6月'
},
/* {
label: '去年同期',
......@@ -442,7 +442,7 @@ const HistoryView = (props) => {
{key: 3, value: moment().subtract(2, 'days')},
]
break;
case '近5天':
case '近7天':
_arr = [
{key: 1, value: moment()},
{key: 2, value: moment().subtract(1, 'days')},
......@@ -450,6 +450,7 @@ const HistoryView = (props) => {
{key: 4, value: moment().subtract(3, 'days')},
{key: 5, value: moment().subtract(4, 'days')},
{key: 6, value: moment().subtract(5, 'days')},
{key: 7, value: moment().subtract(6, 'days')},
]
break;
case '近3月':
......@@ -459,7 +460,7 @@ const HistoryView = (props) => {
{key: 3, value: moment().subtract(2, 'months')},
]
break;
case '近5月':
case '近6月':
_arr = [
{key: 1, value: moment()},
{key: 2, value: moment().subtract(1, 'months')},
......@@ -502,15 +503,18 @@ const HistoryView = (props) => {
<Option value="month"></Option>
</Select>
{/*增加快捷日期*/}
<Radio.Group value={shortcutsValue} onChange={onShortcutsChange}>
{
(contrastOption === 'day' ? shortcutsForDay : shortcutsForMonth).map(item => {
return <Radio.Button value={item.value}>
{item.label}
</Radio.Button>
})
}
</Radio.Group>
{
deviceParams?.length === 1 && deviceParams?.[0]?.sensors?.split(',').length === 1 ?
<Radio.Group value={shortcutsValue} onChange={onShortcutsChange}>
{
(contrastOption === 'day' ? shortcutsForDay : shortcutsForMonth).map(item => {
return <Radio.Button value={item.value}>
{item.label}
</Radio.Button>
})
}
</Radio.Group> : ''
}
{datePickerArr.map((child, index) => (
<div key={child.key} className={classNames(`${prefixCls}-contrast-list`)}>
<div className={classNames(`${prefixCls}-contrast-wrap`)}>
......
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