feature/2.15.1.2407.01-权限
This commit is contained in:
parent
6c99d5fbad
commit
ce711f9c97
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue