Commit 514a0658 by zhaochengxiang

无数据提示

parent 1fd7db5f
......@@ -3,13 +3,14 @@ import * as echarts from 'echarts';
import { Empty } from 'antd';
import emptyImg from '../assets/empty.png';
//https://echarts.apache.org/examples/zh/editor.html?c=treemap-show-parent&lang=js
class Thermodynamic extends React.Component {
componentDidMount() {
const { data, onClick } = this.props;
console.log('componentDidMount');
if (data && data.length>0 && (data[0].children||[]).length>0) {
this.graph = init(this)(this.elem, data, onClick);
}
......@@ -38,7 +39,7 @@ class Thermodynamic extends React.Component {
return (
<div ref={ref => this.elem = ref} style={{ position: 'relative', width: '100%', height: '100%' }}>
{
data && data.length>0 && (data[0].children||[]).length===0 && <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description='当前已是最底层' style={{ position: 'absolute', top: 100, display: 'flex', flexDirection: 'column', alignItems: 'center', width: '100%' }} />
data && data.length>0 && (data[0].children||[]).length===0 && <Empty image={<img src={emptyImg} />} imageStyle={{ width: 100, height: 100, marginBottom: 0 }} description='当前已是最底层' style={{ position: 'absolute', top: 100, display: 'flex', flexDirection: 'column', alignItems: 'center', width: '100%' }} />
}
</div>
);
......
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