新增分组的hook模板配置
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { PureComponent as Component } from 'react';
|
||||
import React, {PureComponent as Component} from 'react';
|
||||
import GroupList from './GroupList/GroupList.js';
|
||||
import ProjectList from './ProjectList/ProjectList.js';
|
||||
import MemberList from './MemberList/MemberList.js';
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
} from '../../reducer/modules/group';
|
||||
import './Group.scss';
|
||||
import axios from 'axios'
|
||||
import plugin from "../../plugin";
|
||||
|
||||
@connect(
|
||||
state => {
|
||||
@@ -67,6 +68,11 @@ export default class Group extends Component {
|
||||
// // }
|
||||
// }
|
||||
render() {
|
||||
let panes = []
|
||||
plugin.emitHook('add_group_tab', panes);
|
||||
|
||||
let filterPanes = panes.filter(it => it.roles.indexOf(this.props.curUserRoleInGroup) > -1 ||
|
||||
this.props.curUserRole === 'admin');
|
||||
if(this.state.groupId === -1)return <Spin />
|
||||
const GroupContent = (
|
||||
<Layout style={{ minHeight: 'calc(100vh - 100px)', marginLeft: '24px', marginTop: '24px' }}>
|
||||
@@ -106,6 +112,14 @@ export default class Group extends Component {
|
||||
<GroupSetting />
|
||||
</TabPane>
|
||||
) : null}
|
||||
{ filterPanes.map(it =>{
|
||||
let Com = it.component
|
||||
return (
|
||||
<TabPane tab={it.title} key={it.key}>
|
||||
<Com groupId={this.props.curGroupId}/>
|
||||
</TabPane>
|
||||
)
|
||||
}) }
|
||||
</Tabs>
|
||||
</Content>
|
||||
</Layout>
|
||||
|
||||
@@ -82,7 +82,7 @@ hooks = {
|
||||
},
|
||||
/**
|
||||
* 在运行页面或单个测试也里每次发送完成后调用
|
||||
* 返回值为响应原始值 +
|
||||
* 返回值为响应原始值 +
|
||||
* {
|
||||
* type: 'inter' | 'case',
|
||||
* projectId: string,
|
||||
@@ -104,7 +104,7 @@ hooks = {
|
||||
},
|
||||
/**
|
||||
* 在测试集里运行每次发送请求后调用
|
||||
* 返回值为响应原始值 +
|
||||
* 返回值为响应原始值 +
|
||||
* {
|
||||
* type: 'col',
|
||||
* caseId: string,
|
||||
@@ -204,9 +204,9 @@ hooks = {
|
||||
/*
|
||||
* 添加 reducer
|
||||
* @param Object reducerModules
|
||||
*
|
||||
*
|
||||
* @info
|
||||
* importDataModule = {};
|
||||
* importDataModule = {};
|
||||
*/
|
||||
|
||||
add_reducer: {
|
||||
@@ -218,7 +218,7 @@ hooks = {
|
||||
/*
|
||||
* 添加 subnav 钩子
|
||||
* @param Object reducerModules
|
||||
*
|
||||
*
|
||||
* let routers = {
|
||||
interface: { name: '接口', path: "/project/:id/interface/:action", component:Interface },
|
||||
activity: { name: '动态', path: "/project/:id/activity", component: Activity},
|
||||
@@ -235,7 +235,7 @@ hooks = {
|
||||
/*
|
||||
* 添加项目设置 nav
|
||||
* @param Object routers
|
||||
*
|
||||
*
|
||||
* let routers = {
|
||||
interface: { name: 'xxx', component: Xxx },
|
||||
}
|
||||
@@ -244,6 +244,11 @@ hooks = {
|
||||
type: 'listener',
|
||||
mulit: true,
|
||||
listener: []
|
||||
},
|
||||
add_group_tab:{
|
||||
type: 'listener',
|
||||
mulit: true,
|
||||
listener: []
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user