Commit 863ce357 authored by 崔佳豪's avatar 崔佳豪

fix(EC_HistoryView): 优化历史曲线多图表标题

parent af793980
......@@ -4,12 +4,12 @@ import { BasicChart } from '@wisdom-components/basicchart';
import PandaEmpty from '@wisdom-components/empty';
import optionGenerator from './utils';
const ChartTitle = ({ prefixCls }) => {
const ChartTitle = ({ prefixCls, title, unit }) => {
const cls = `${prefixCls}-grid-item-title`;
return (
<div className={cls}>
<span className={`${cls}_text`}>进水压力</span>
<span className={`${cls}_unit`}>(单位:MPa</span>
<span className={`${cls}_text`}>{title}</span>
{unit && <span className={`${cls}_unit`}>(单位:{unit}</span>}
</div>
);
};
......@@ -80,14 +80,15 @@ const GridChart = memo((props) => {
return (
<div className={`${prefixCls}-grid`}>
{options.map((item) => {
{options.map((item, index) => {
const { sensorName, unit } = gridData[index];
const isEmpty =
!item.option.series.length ||
!item.option.series.find((e) => e.data && e.data.length > 0);
return (
<div key={item.key} className={`${prefixCls}-grid-item`}>
<div className={`${prefixCls}-grid-item-wrap`}>
<ChartTitle prefixCls={prefixCls} />
<ChartTitle prefixCls={prefixCls} title={sensorName} unit={unit} />
{isEmpty ? (
<PandaEmpty />
) : (
......
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