feature/2.15.1.2407.01-权限

This commit is contained in:
黎永顺 2024-09-27 16:45:47 +08:00
parent 6c99d5fbad
commit ce711f9c97
1 changed files with 8 additions and 3 deletions

View File

@ -29,7 +29,9 @@ class DetailDialog extends Component {
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getData(nextProps);
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({ query: { username: "" } });
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.setState({
query: { username: "" }, pageInfo: { current: 1, pageSize: 10, total: 0 }
});
}
getData = (props) => {
@ -39,7 +41,10 @@ class DetailDialog extends Component {
APIFOX[selectedKey](payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
console.log(data);
const { columns, list: dataSource, pageNum: current, pageSize, total } = data;
this.setState({
columns, dataSource, pageInfo: { ...pageInfo, current, pageSize, total }
});
}
});
};
@ -55,7 +60,7 @@ class DetailDialog extends Component {
render() {
const { loading, dataSource, pageInfo, columns } = this.state;
const sheight = this.dialog ? this.dialog.state.height - 16 : 260;
const sheight = this.dialog ? this.dialog.state.height - 120 : 260;
const pagination = {
...pageInfo,