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

feat: 修改月份图表的显示

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