Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复用例列表中,编辑用例/任务后,会跳回默认列表的问题 #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class CaseLists extends React.Component {
isReName: true,
treeSelect: [],
treeData: [],
expendKeys: [] // 控制用例列表中处于展开状态的行
};
}
componentDidMount() {
Expand Down Expand Up @@ -332,6 +333,7 @@ class CaseLists extends React.Component {
createrFilter={createrFilter}
iterationFilter={iterationFilter}
choiseDate={choiseDate}
expendKeys={this.state.expendKeys}
></List>

{(this.props.type === 'oe' && filterVisble && (
Expand Down Expand Up @@ -362,9 +364,13 @@ class CaseLists extends React.Component {
doneApiPrefix={this.props.doneApiPrefix}
baseUrl={this.props.baseUrl}
onUpdate={() => {
// this.getCaseList(this.state.current || 1, '', '', '', []);
this.getTreeList();
this.setState({ currCase: null, visible: false });
this.setState({
currCase: null,
visible: false,
expendKeys: [] // 强制把处于展开状态的行变为无
});
// 更新完成后回到原页面
this.getCaseList(this.state.current || 1, '', '', '', []);
}}
type={this.props.type}
caseIds={caseIds}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Lists extends React.Component {
taskVisible: false,
record: null,
extRecord: null,
expendKeys: [],
expendKeys: this.props.expendKeys,
titleModeTask: '',
loading: this.props.loading,
extendLoading: new Map(),
Expand All @@ -71,6 +71,7 @@ class Lists extends React.Component {
iterationFilter: this.props.iterationFilter,
createrFilter: this.props.createrFilter,
nameFilter: this.props.nameFilter,
expendKeys: nextProps.expendKeys,
});
});
}
Expand Down