Merge "feat: update refresh tab data"
This commit is contained in:
commit
027898907f
@ -145,6 +145,11 @@ export default class BaseList extends React.Component {
|
|||||||
return !!detail;
|
return !!detail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get inDetailAction() {
|
||||||
|
const { inAction } = this.props;
|
||||||
|
return !!inAction;
|
||||||
|
}
|
||||||
|
|
||||||
get detailName() {
|
get detailName() {
|
||||||
if (!this.inDetailPage) {
|
if (!this.inDetailPage) {
|
||||||
return '';
|
return '';
|
||||||
@ -939,6 +944,9 @@ export default class BaseList extends React.Component {
|
|||||||
|
|
||||||
handleRefresh = (force) => {
|
handleRefresh = (force) => {
|
||||||
const { inAction, inSelect } = this;
|
const { inAction, inSelect } = this;
|
||||||
|
if (this.inDetailPage && this.inDetailAction) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (inAction || (inSelect && !force)) {
|
if (inAction || (inSelect && !force)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -346,6 +346,21 @@ export default class DetailBase extends React.Component {
|
|||||||
const silence = !this.forceLoadingTabs.includes(this.tab.key);
|
const silence = !this.forceLoadingTabs.includes(this.tab.key);
|
||||||
this.refreshDetailByAction(silence);
|
this.refreshDetailByAction(silence);
|
||||||
}
|
}
|
||||||
|
this.setState({
|
||||||
|
inAction: false,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
onClickAction = () => {
|
||||||
|
this.setState({
|
||||||
|
inAction: true,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
onCancelAction = () => {
|
||||||
|
this.setState({
|
||||||
|
inAction: false,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
@ -412,6 +427,7 @@ export default class DetailBase extends React.Component {
|
|||||||
|
|
||||||
renderTabComponent(tabItem) {
|
renderTabComponent(tabItem) {
|
||||||
const { component, key, render } = tabItem;
|
const { component, key, render } = tabItem;
|
||||||
|
const { inAction } = this.state;
|
||||||
if (render) {
|
if (render) {
|
||||||
return render;
|
return render;
|
||||||
}
|
}
|
||||||
@ -421,6 +437,7 @@ export default class DetailBase extends React.Component {
|
|||||||
detail={this.detailData}
|
detail={this.detailData}
|
||||||
detailName={`${this.name}-${this.id}`}
|
detailName={`${this.name}-${this.id}`}
|
||||||
refreshDetail={this.refreshDetailByTab}
|
refreshDetail={this.refreshDetailByTab}
|
||||||
|
inAction={inAction}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<span>{key}</span>
|
<span>{key}</span>
|
||||||
@ -467,6 +484,8 @@ export default class DetailBase extends React.Component {
|
|||||||
item={this.getActionData()}
|
item={this.getActionData()}
|
||||||
containerProps={{ isAdminPage: this.isAdminPage }}
|
containerProps={{ isAdminPage: this.isAdminPage }}
|
||||||
isAdminPage={this.isAdminPage}
|
isAdminPage={this.isAdminPage}
|
||||||
|
onClickAction={this.onClickAction}
|
||||||
|
onCancelAction={this.onCancelAction}
|
||||||
// firstActionClassName={styles['attach-btn']}
|
// firstActionClassName={styles['attach-btn']}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user