Commit 7f08ee1a authored by 陈龙's avatar 陈龙

feat: 修改月份图表的显示

parent e12c8750
...@@ -40,7 +40,7 @@ const deviceParams = [ ...@@ -40,7 +40,7 @@ const deviceParams = [
// 邳州张楼水厂 // 邳州张楼水厂
{ {
"deviceCode": "LLJ00000004", "deviceCode": "LLJ00000004",
"sensors": "瞬时流量,是否在线", "sensors": "瞬时流量",
"deviceType": "流量计" "deviceType": "流量计"
} }
]; ];
......
...@@ -11,6 +11,7 @@ import { ...@@ -11,6 +11,7 @@ import {
Tabs, Tabs,
Tooltip, Tooltip,
Button, Button,
message
} from 'antd'; } from 'antd';
import { import {
CloseCircleFilled, CloseCircleFilled,
...@@ -782,6 +783,7 @@ const HistoryView = (props) => { ...@@ -782,6 +783,7 @@ const HistoryView = (props) => {
setChartDataSource(data); setChartDataSource(data);
} }
}).catch(err => { }).catch(err => {
message.error('数据请求失败,请重试~')
setLoading(false) setLoading(false)
}); });
}; };
...@@ -886,7 +888,7 @@ const HistoryView = (props) => { ...@@ -886,7 +888,7 @@ const HistoryView = (props) => {
}; };
return ( return (
<div className={classNames(prefixCls)}> <div className={classNames(prefixCls,'wkt-scroll-light')}>
<Spin spinning={loading} wrapperClassName={classNames(`${prefixCls}-spin`)}> <Spin spinning={loading} wrapperClassName={classNames(`${prefixCls}-spin`)}>
{showModels.length === 1 && ( {showModels.length === 1 && (
<div className={`${prefixCls}-single-panel`}>{renderPanel(showModels[0])}</div> <div className={`${prefixCls}-single-panel`}>{renderPanel(showModels[0])}</div>
......
...@@ -305,7 +305,7 @@ export const buildDefaultLegend = (option) => { ...@@ -305,7 +305,7 @@ export const buildDefaultLegend = (option) => {
const headTemplate = (param, opt) => { const headTemplate = (param, opt) => {
if (!param) return ''; if (!param) return '';
const {name, axisValueLabel, axisType, axisValue} = param; const {name, axisValueLabel, axisType, axisValue} = param;
const timeFormat = opt && opt.contrast ? (opt.contrastOption === 'day' ? 'HH:mm:ss' : 'YYYY-MM-DD') : 'YYYY-MM-DD HH:mm:ss'; const timeFormat = opt && opt.contrast ? (opt.contrastOption === 'day' ? 'HH:mm:ss' : 'DD日') : 'YYYY-MM-DD HH:mm:ss';
const text = const text =
axisType === 'xAxis.time' ? moment(axisValue).format(timeFormat) : name || axisValueLabel; axisType === 'xAxis.time' ? moment(axisValue).format(timeFormat) : name || axisValueLabel;
return `<div style="border-bottom: 1px solid #F0F0F0; color: #808080; margin-bottom:${handlePx(5, 'px')}; padding-bottom: ${handlePx(5, 'px')};">${text}</div>`; return `<div style="border-bottom: 1px solid #F0F0F0; color: #808080; margin-bottom:${handlePx(5, 'px')}; padding-bottom: ${handlePx(5, 'px')};">${text}</div>`;
...@@ -591,8 +591,8 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth ...@@ -591,8 +591,8 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
const grid = { const grid = {
top: needUnit ? 80 : 60, top: needUnit ? 80 : 60,
// top: 200, // top: 200,
left: 10 + leftNum * AXIS_WIDTH, left: 30 + leftNum * AXIS_WIDTH,
right: rightNum === 0 ? 20 : rightNum * AXIS_WIDTH, right: rightNum === 0 ? 40 : rightNum * AXIS_WIDTH,
bottom: 60, bottom: 60,
}; };
......
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