Commit be64a216 by zhaochengxiang

方块图滚动问题

parent ecc353d7
...@@ -174,35 +174,54 @@ class MapContent extends React.Component { ...@@ -174,35 +174,54 @@ class MapContent extends React.Component {
isRowLoaded = ({ index }) => !!this.loadedRowsMap[index]; isRowLoaded = ({ index }) => !!this.loadedRowsMap[index];
onSquareItemClick = (item) => { onSquareItemClick = (item) => {
dispatchLatest({ const { breadcrumbContents } = this.state;
type: 'map.getTableModelByDirIid',
payload: { dirId: item.dirId }, this.loadedRowsMap = {};
callback: data => {
this.setState({ breadcrumbContents: [...breadcrumbContents, { name: item.dirName || '', data: item }] }, () => {
dispatchLatest({
type: 'map.getTableModelByDirIid',
payload: {
dirId: item.dirId,
topNum: defaultLoadCount
},
callback: data => {
this.convertRemoteData(data || [], item.id, item.dirId);
item.children = (data || []).filter(item => item.dbType!=='More');
this.setState({
curTableModelData: item.children || [],
haveMoreData: (item.children||[]).length===defaultLoadCount,
});
}
})
this.convertRemoteData(data || [], item.id, item.dirId);
item.children = (data || []).filter(item => item.dbType!=='More');
this.setSquareGraphState(item);
}
}) })
} }
onBreadcrumbItemClick = (content, index) => { onBreadcrumbItemClick = (content, index) => {
const { breadcrumbContents } = this.state; const { breadcrumbContents } = this.state;
this.loadedRowsMap = {};
this.setState({ this.setState({
breadcrumbContents: breadcrumbContents.splice(0, index === 0 ? 1 : (index + 1)), breadcrumbContents: breadcrumbContents.splice(0, index === 0 ? 1 : (index + 1)),
}, () => { }, () => {
const item = content.data; const item = content.data;
dispatchLatest({ dispatchLatest({
type: 'map.getTableModelByDirIid', type: 'map.getTableModelByDirIid',
payload: { dirId: item.dirId }, payload: {
dirId: item.dirId,
topNum: defaultLoadCount
},
callback: data => { callback: data => {
this.convertRemoteData(data || [], item.id, item.dirId); this.convertRemoteData(data || [], item.id, item.dirId);
item.children = (data || []).filter(item => item.dbType!=='More'); item.children = (data || []).filter(item => item.dbType!=='More');
this.loadedRowsMap = {};
this.setState({ this.setState({
curTableModelData: item.children || [], curTableModelData: item.children || [],
haveMoreData: (item.children||[]).length===defaultLoadCount,
}); });
} }
}) })
......
...@@ -239,7 +239,7 @@ class Model extends React.Component { ...@@ -239,7 +239,7 @@ class Model extends React.Component {
<Space> <Space>
<span>模型搜索:</span> <span>模型搜索:</span>
<Input <Input
placeholder="请输入模型名称或者文名称" placeholder="请输入模型名称或者文名称"
allowClear allowClear
value={keyword} value={keyword}
onChange={this.onSearchInputChange} onChange={this.onSearchInputChange}
......
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