mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-24 13:14:16 +08:00
Merge branch 'dev' into dev-1.3.0
This commit is contained in:
commit
155c1adb5d
@ -45,7 +45,9 @@ YApi 是<strong>高效</strong>、<strong>易用</strong>、<strong>功能强大
|
||||
密码: ymfe.org
|
||||
```
|
||||
### YApi 资源
|
||||
* [yapi docker](https://github.com/branchzero/yapi-docker) By branchzero
|
||||
* [yapi sso 登录插件](https://github.com/YMFE/yapi-plugin-qsso)
|
||||
* [yapi docker 部署](https://github.com/branchzero/yapi-docker) By branchzero
|
||||
|
||||
|
||||
|
||||
### YApi 的一些客户
|
||||
|
@ -5,7 +5,7 @@ import PropTypes from 'prop-types'
|
||||
/**
|
||||
* @author suxiaoxin
|
||||
* @demo
|
||||
* <EasyDragSort data={this.state.list} onChange={this.handleChange} >
|
||||
* <EasyDragSort data={()=>this.state.list} onChange={this.handleChange} >
|
||||
* {list}
|
||||
* </EasyDragSot>
|
||||
*/
|
||||
@ -13,16 +13,19 @@ let curDragIndex = null;
|
||||
|
||||
EasyDragSort.propTypes = {
|
||||
children: PropTypes.array,
|
||||
data: PropTypes.array,
|
||||
onChange: PropTypes.func,
|
||||
onDragEnd: PropTypes.func
|
||||
onDragEnd: PropTypes.func,
|
||||
data: PropTypes.func
|
||||
}
|
||||
|
||||
export default function EasyDragSort(props){
|
||||
let container = props.children;
|
||||
function onChange(from, to){
|
||||
const onChange = (from, to)=>{
|
||||
if(from === to ) return ;
|
||||
let curValue = props.data;
|
||||
let curValue;
|
||||
|
||||
curValue = props.data();
|
||||
|
||||
let newValue = arrMove(curValue, from, to);
|
||||
if(typeof props.onChange === 'function'){
|
||||
return props.onChange(newValue, from ,to);
|
||||
|
@ -408,7 +408,7 @@ export default class InterfaceColMenu extends Component {
|
||||
<div className="btns">
|
||||
|
||||
<Tooltip title="删除集合">
|
||||
<Icon type='delete' className="interface-delete-icon" onClick={(e) => { e.stopPropagation(); list.length > 1 ? this.showDelColConfirm(col._id) : this.showNoDelColConfirm() }} />
|
||||
<Icon type='delete' style={{display:list.length > 1 ? '': 'none' }} className="interface-delete-icon" onClick={() => { this.showDelColConfirm(col._id) }} />
|
||||
</Tooltip>
|
||||
<Tooltip title="编辑集合">
|
||||
<Icon type='edit' className="interface-delete-icon" onClick={(e) => { e.stopPropagation(); this.showColModal('edit', col) }} />
|
||||
|
@ -50,7 +50,6 @@ class InterfaceEdit extends Component {
|
||||
if (result.data.errcode === 0) {
|
||||
this.props.updateInterfaceData(params);
|
||||
message.success('保存成功');
|
||||
this.props.switchToView()
|
||||
} else {
|
||||
message.error(result.data.errmsg)
|
||||
}
|
||||
|
@ -214,6 +214,7 @@ class InterfaceEditForm extends Component {
|
||||
values.req_body_form = []
|
||||
}
|
||||
this.props.onSubmit(values)
|
||||
EditFormContext.props.changeEditStatus(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -725,7 +726,7 @@ class InterfaceEditForm extends Component {
|
||||
|
||||
<Row className={'interface-edit-item ' + this.state.hideTabs.req.query}>
|
||||
<Col>
|
||||
<EasyDragSort data={this.props.form.getFieldValue('req_query')} onChange={this.handleDragMove('req_query')} >
|
||||
<EasyDragSort data={()=>this.props.form.getFieldValue('req_query')} onChange={this.handleDragMove('req_query')} >
|
||||
{QueryList}
|
||||
</EasyDragSort>
|
||||
</Col>
|
||||
@ -740,7 +741,7 @@ class InterfaceEditForm extends Component {
|
||||
|
||||
<Row className={'interface-edit-item ' + this.state.hideTabs.req.headers}>
|
||||
<Col>
|
||||
<EasyDragSort data={this.props.form.getFieldValue('req_headers')} onChange={this.handleDragMove('req_headers')} >
|
||||
<EasyDragSort data={()=>this.props.form.getFieldValue('req_headers')} onChange={this.handleDragMove('req_headers')} >
|
||||
{headerList}
|
||||
</EasyDragSort>
|
||||
</Col>
|
||||
@ -773,7 +774,7 @@ class InterfaceEditForm extends Component {
|
||||
</Col>
|
||||
|
||||
</Row>
|
||||
<EasyDragSort data={this.props.form.getFieldValue('req_body_form')} onChange={this.handleDragMove('req_body_form')} >
|
||||
<EasyDragSort data={() => this.props.form.getFieldValue('req_body_form')} onChange={this.handleDragMove('req_body_form')} >
|
||||
{requestBodyList}
|
||||
</EasyDragSort>
|
||||
|
||||
@ -798,7 +799,7 @@ class InterfaceEditForm extends Component {
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
{this.props.form.getFieldValue('req_body_type') === 'file' ?
|
||||
{this.props.form.getFieldValue('req_body_type') === 'file' && this.state.hideTabs.req.body !== 'hide' ?
|
||||
<Row className="interface-edit-item" >
|
||||
<Col className="interface-edit-item-other-body">
|
||||
{getFieldDecorator('req_body_other', { initialValue: this.state.req_body_other })(
|
||||
@ -811,7 +812,7 @@ class InterfaceEditForm extends Component {
|
||||
:
|
||||
null
|
||||
}
|
||||
{this.props.form.getFieldValue('req_body_type') === 'raw' ?
|
||||
{this.props.form.getFieldValue('req_body_type') === 'raw' && this.state.hideTabs.req.body !== 'hide'?
|
||||
<Row>
|
||||
<Col>
|
||||
{getFieldDecorator('req_body_other', { initialValue: this.state.req_body_other })(
|
||||
|
Loading…
Reference in New Issue
Block a user