mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
feat: loading and page
This commit is contained in:
parent
7322e3fc89
commit
5064edfe11
@ -1,9 +1,15 @@
|
||||
### v1.3.4
|
||||
|
||||
#### Feature
|
||||
|
||||
* 进入project页面加入loading
|
||||
* 接口list页table中加入分页
|
||||
|
||||
#### Bug Fixed
|
||||
* 修复无权限进入项目bug
|
||||
|
||||
|
||||
|
||||
### v1.3.3
|
||||
|
||||
#### Feature
|
||||
|
@ -2,7 +2,7 @@ import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import './Loading.scss'
|
||||
|
||||
export default class Loading extends React.PureComponent{
|
||||
export default class Loading extends React.PureComponent {
|
||||
static defaultProps = {
|
||||
visible: false
|
||||
}
|
||||
@ -11,16 +11,16 @@ export default class Loading extends React.PureComponent{
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = { show:props.visible };
|
||||
this.state = { show: props.visible };
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
this.setState({ show : nextProps.visible });
|
||||
this.setState({ show: nextProps.visible });
|
||||
}
|
||||
render(){
|
||||
return(
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
className="loading-box"
|
||||
style={{ display: this.state.show ? 'flex' : 'none'}}
|
||||
style={{ display: this.state.show ? 'flex' : 'none' }}
|
||||
>
|
||||
<div className="loading-box-bg"></div>
|
||||
<div className="loading-box-inner">
|
||||
|
@ -61,7 +61,7 @@ class InterfaceList extends Component {
|
||||
this.setState({
|
||||
data: JSON.parse(JSON.stringify(r.payload.data.data))
|
||||
})
|
||||
|
||||
|
||||
} else if (isNaN(params.actionId)) {
|
||||
let catid = params.actionId.substr(4)
|
||||
this.setState({ catid: +catid })
|
||||
@ -218,7 +218,13 @@ class InterfaceList extends Component {
|
||||
<p style={{ marginTop: '10px' }}>{desc} </p>
|
||||
}
|
||||
</div>
|
||||
<Table className="table-interfacelist" pagination={false} columns={columns} onChange={this.handleChange} dataSource={data} />
|
||||
<Table
|
||||
className="table-interfacelist"
|
||||
// pagination={false}
|
||||
columns={columns}
|
||||
onChange={this.handleChange}
|
||||
dataSource={data}
|
||||
/>
|
||||
<Modal
|
||||
title="添加接口"
|
||||
visible={this.state.visible}
|
||||
|
@ -9,6 +9,7 @@ import { getProject } from '../../reducer/modules/project';
|
||||
import Interface from './Interface/Interface.js'
|
||||
import Activity from './Activity/Activity.js'
|
||||
import Setting from './Setting/Setting.js'
|
||||
import Loading from '../../components/Loading/Loading';
|
||||
import ProjectMember from './Setting/ProjectMember/ProjectMember.js';
|
||||
import ProjectData from './Setting/ProjectData/ProjectData.js';
|
||||
|
||||
@ -100,6 +101,10 @@ export default class Project extends Component {
|
||||
})
|
||||
}
|
||||
|
||||
if (Object.keys(this.props.curProject).length === 0) {
|
||||
return <Loading visible />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Subnav
|
||||
|
@ -157,7 +157,7 @@ class ProjectMember extends Component {
|
||||
|
||||
async componentWillMount() {
|
||||
// console.log('projectMsg', this.props.projectMsg)
|
||||
await this.props.getProject(this.props.match.params.id)
|
||||
// await this.props.getProject(this.props.match.params.id)
|
||||
const groupMemberList = await this.props.fetchGroupMemberList(this.props.projectMsg.group_id);
|
||||
const groupMsg = await this.props.fetchGroupMsg(this.props.projectMsg.group_id);
|
||||
// const rojectMsg = await this.props.getProjectMsg(this.props.match.params.id);
|
||||
|
Loading…
Reference in New Issue
Block a user