mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
fix: 修复动态undefine问题
This commit is contained in:
parent
221d10182c
commit
94ae056e0e
@ -240,7 +240,7 @@ class MemberList extends Component {
|
||||
userinfo = [...ownerinfo,...devinfo,...guestinfo];
|
||||
return (
|
||||
<div className="m-panel">
|
||||
<Modal
|
||||
{this.state.visible?<Modal
|
||||
title="添加成员"
|
||||
visible={this.state.visible}
|
||||
onOk={this.handleOk}
|
||||
@ -262,7 +262,7 @@ class MemberList extends Component {
|
||||
</Select>
|
||||
</Col>
|
||||
</Row>
|
||||
</Modal>
|
||||
</Modal>:""}
|
||||
<Table columns={columns} dataSource={userinfo} pagination={false} locale={{emptyText: <ErrMsg type="noMemberInGroup"/>}} />
|
||||
</div>
|
||||
);
|
||||
|
@ -254,7 +254,7 @@ class InterfaceMenu extends Component {
|
||||
const searchBox = <div className="interface-filter">
|
||||
<Input onChange={this.onFilter} value={this.state.filter} placeholder="搜索接口" />
|
||||
<Button type="primary" onClick={() => this.changeModal('add_cat_modal_visible', true)} className="btn-filter" >添加分类</Button>
|
||||
<Modal
|
||||
{this.state.visible?<Modal
|
||||
title="添加接口"
|
||||
visible={this.state.visible}
|
||||
onCancel={() => this.changeModal('visible', false)}
|
||||
@ -262,9 +262,9 @@ class InterfaceMenu extends Component {
|
||||
className="addcatmodal"
|
||||
>
|
||||
<AddInterfaceForm catdata={this.props.curProject.cat} catid={this.state.curCatid} onCancel={() => this.changeModal('visible', false)} onSubmit={this.handleAddInterface} />
|
||||
</Modal>
|
||||
</Modal>:""}
|
||||
|
||||
<Modal
|
||||
{this.state.add_cat_modal_visible?<Modal
|
||||
title="添加分类"
|
||||
visible={this.state.add_cat_modal_visible}
|
||||
onCancel={() => this.changeModal('add_cat_modal_visible', false)}
|
||||
@ -272,9 +272,9 @@ class InterfaceMenu extends Component {
|
||||
className="addcatmodal"
|
||||
>
|
||||
<AddInterfaceCatForm onCancel={() => this.changeModal('add_cat_modal_visible', false)} onSubmit={this.handleAddInterfaceCat} />
|
||||
</Modal>
|
||||
</Modal>:""}
|
||||
|
||||
<Modal
|
||||
{this.state.change_cat_modal_visible?<Modal
|
||||
title="修改分类"
|
||||
visible={this.state.change_cat_modal_visible}
|
||||
onCancel={() => this.changeModal('change_cat_modal_visible', false)}
|
||||
@ -282,7 +282,7 @@ class InterfaceMenu extends Component {
|
||||
className="addcatmodal"
|
||||
>
|
||||
<AddInterfaceCatForm catdata={this.state.curCatdata} onCancel={() => this.changeModal('change_cat_modal_visible', false)} onSubmit={this.handleChangeInterfaceCat} />
|
||||
</Modal>
|
||||
</Modal>:""}
|
||||
</div>
|
||||
if(menuList.length === 0){
|
||||
return searchBox;
|
||||
|
@ -210,7 +210,7 @@ class ProjectMember extends Component {
|
||||
return (
|
||||
<div className="g-row">
|
||||
<div className="m-panel">
|
||||
<Modal
|
||||
{this.state.visible?<Modal
|
||||
title="添加成员"
|
||||
visible={this.state.visible}
|
||||
onOk={this.handleOk}
|
||||
@ -232,7 +232,7 @@ class ProjectMember extends Component {
|
||||
</Select>
|
||||
</Col>
|
||||
</Row>
|
||||
</Modal>
|
||||
</Modal>:""}
|
||||
<Table columns={columns} dataSource={this.state.projectMemberList} pagination={false} locale={{emptyText: <ErrMsg type="noMemberInProject"/>}} className="setting-project-member"/>
|
||||
<Card bordered={false} title={this.state.groupName + ' 分组成员 ' + '(' + this.state.groupMemberList.length + ') 人'} noHovering className="setting-group">
|
||||
{this.state.groupMemberList.length ? this.state.groupMemberList.map((item, index) => {
|
||||
|
@ -482,7 +482,7 @@ class interfaceController extends baseController {
|
||||
if (data.catid) {
|
||||
this.catModel.get(+data.catid).then((cate) => {
|
||||
yapi.commons.saveLog({
|
||||
content: `用户 "${username}" 更新了分类 "${cate.name}" 下的接口 "${data.title}"`,
|
||||
content: `用户 "${username}" 更新了分类 "${cate.name}" 下的接口 "${interfaceData.title}"`,
|
||||
type: 'project',
|
||||
uid: this.getUid(),
|
||||
username: username,
|
||||
@ -494,7 +494,7 @@ class interfaceController extends baseController {
|
||||
let cateid = interfaceData.catid;
|
||||
this.catModel.get(cateid).then((cate) => {
|
||||
yapi.commons.saveLog({
|
||||
content: `用户 "${username}" 更新了分类 "${cate.name}" 下的接口 "${data.title}"`,
|
||||
content: `用户 "${username}" 更新了分类 "${cate.name}" 下的接口 "${interfaceData.title}"`,
|
||||
type: 'project',
|
||||
uid: this.getUid(),
|
||||
username: username,
|
||||
|
Loading…
Reference in New Issue
Block a user