-
+
@@ -73,4 +85,4 @@ class Interface extends Component {
-export default Interface
\ No newline at end of file
+export default Interface
diff --git a/client/containers/Project/Interface/InterfaceCol/InterfaceColMenu.js b/client/containers/Project/Interface/InterfaceCol/InterfaceColMenu.js
index b0c4ccf4..56b7648d 100644
--- a/client/containers/Project/Interface/InterfaceCol/InterfaceColMenu.js
+++ b/client/containers/Project/Interface/InterfaceCol/InterfaceColMenu.js
@@ -10,6 +10,8 @@ import { Input, Icon, Tag, Modal, Row, Col, message, Tooltip, Tree } from 'antd'
const TextArea = Input.TextArea;
const TreeNode = Tree.TreeNode;
+import './InterfaceColMenu.scss'
+
@connect(
state => {
return {
@@ -28,7 +30,8 @@ export default class InterfaceColMenu extends Component {
match: PropTypes.object,
interfaceColList: PropTypes.array,
fetchInterfaceColList: PropTypes.func,
- fetchInterfaceCaseList: PropTypes.func
+ fetchInterfaceCaseList: PropTypes.func,
+ history: PropTypes.object
}
state = {
@@ -41,10 +44,22 @@ export default class InterfaceColMenu extends Component {
super(props)
}
- componentWillMount() {
- this.props.fetchInterfaceColList(this.props.match.params.id)
+ async componentWillMount() {
+ const result = await this.props.fetchInterfaceColList(this.props.match.params.id)
+ let params = this.props.match.params;
+ if(!params.actionId){
+ this.props.history.push('/project/'+params.id + '/interface/col/' + result.payload.data.data[0]._id)
+ }
}
+ // async componentWillReceiveProps(nextProps) {
+ // const result = await nextProps.fetchInterfaceColList(nextProps.match.params.id)
+ // let params = nextProps.match.params;
+ // if(!params.actionId){
+ // nextProps.history.replace('/project/'+params.id + '/interface/col/' + result.payload.data.data[0]._id)
+ // }
+ // }
+
@autobind
async addCol() {
const { addColName: name, addColDesc: desc } = this.state;
@@ -78,6 +93,7 @@ export default class InterfaceColMenu extends Component {
(
diff --git a/client/containers/Project/Interface/InterfaceList/InterfaceContent.js b/client/containers/Project/Interface/InterfaceList/InterfaceContent.js
index e90149c1..b4d57a1e 100644
--- a/client/containers/Project/Interface/InterfaceList/InterfaceContent.js
+++ b/client/containers/Project/Interface/InterfaceList/InterfaceContent.js
@@ -19,7 +19,7 @@ const TabPane = Tabs.TabPane;
}
},
{
- fetchInterfaceData
+ fetchInterfaceData
}
)
class Content extends Component {
@@ -37,6 +37,10 @@ class Content extends Component {
this._actionId = 0;
}
+ componentWillMount() {
+ this.handleRequest(this.props)
+ }
+
componentWillReceiveProps(nextProps){
this.handleRequest(nextProps)
}
@@ -44,7 +48,7 @@ class Content extends Component {
handleRequest(nextProps){
let matchParams = nextProps.match.params;
let _actionId;
- _actionId = matchParams.actionId;
+ _actionId = matchParams.actionId;
_actionId = parseInt(matchParams.actionId, 10);
if(!nextProps.curdata)return;
if(this._actionId !== _actionId){
diff --git a/client/containers/Project/Interface/InterfaceList/InterfaceMenu.js b/client/containers/Project/Interface/InterfaceList/InterfaceMenu.js
index aaca6ccd..f8e45ca3 100644
--- a/client/containers/Project/Interface/InterfaceList/InterfaceMenu.js
+++ b/client/containers/Project/Interface/InterfaceList/InterfaceMenu.js
@@ -58,7 +58,7 @@ class InterfaceMenu extends Component {
delIcon: null,
filter: ''
}
-
+
}
async handleRequest() {
@@ -72,7 +72,11 @@ class InterfaceMenu extends Component {
componentWillMount() {
this.handleRequest()
}
-
+
+ // componentWillReceiveProps() {
+ // this.handleRequest()
+ // }
+
handleAddInterface = (data) => {
data.project_id = this.props.projectId;
axios.post('/api/interface/add', data).then((res) => {
@@ -167,4 +171,4 @@ class InterfaceMenu extends Component {
}
}
-export default withRouter(InterfaceMenu)
\ No newline at end of file
+export default withRouter(InterfaceMenu)