diff --git a/client/containers/AddInterface/AddInterface.js b/client/containers/AddInterface/AddInterface.js index 9f5a0060..5c41e29e 100644 --- a/client/containers/AddInterface/AddInterface.js +++ b/client/containers/AddInterface/AddInterface.js @@ -77,7 +77,9 @@ class AddInterface extends Component { isSave: false, mockJson: '', mockURL: '', - projectData: {} + projectData: {}, + tagName: '创建接口', + showMock: '' } } @@ -92,6 +94,8 @@ class AddInterface extends Component { if (ifTrue) { interfaceId = this.getInterfaceId() this.initInterfaceData(interfaceId) + this.modifyTagName('编辑接口') + this.setState({showMock: 'show-mock'}) } else { const props = this.props props.pushInputValue('') @@ -114,6 +118,12 @@ class AddInterface extends Component { } } + modifyTagName (tagName) { + this.setState({ + tagName + }) + } + verificationURL () { const dir = 'AddInterface/edit' const url = location.href @@ -247,26 +257,27 @@ class AddInterface extends Component { render () { const TabPane = Tabs.TabPane const { server_ip } = this.props - const { isLoading, isSave, mockJson='', mockURL } = this.state - + const { isLoading, isSave, mockJson='', mockURL, tagName, showMock } = this.state + let Pane = '' + if (showMock) { + Pane = + } return (
- +

请求部分

- +

返回部分

- - - + {Pane}
diff --git a/client/containers/AddInterface/AddInterface.scss b/client/containers/AddInterface/AddInterface.scss index 5402c751..1374d8de 100644 --- a/client/containers/AddInterface/AddInterface.scss +++ b/client/containers/AddInterface/AddInterface.scss @@ -16,6 +16,10 @@ background: #FFF; padding: 10px 20px 50px 20px; margin: 0 auto; + + .ant-tabs { + padding: 0 0 50px 0; + } .ant-tabs-content { padding: 0 0 50px 0; @@ -212,6 +216,7 @@ margin: 10px 0 0 90px; zoom: 1; overflow: hidden; + display: none; .title { float: left; line-height: 35px; @@ -234,6 +239,10 @@ } } + .show-mock { + display: block; + } + .loading { display: none; width: 100%; diff --git a/client/containers/AddInterface/MockUrl/MockUrl.js b/client/containers/AddInterface/MockUrl/MockUrl.js index e8fed4f5..e114b744 100644 --- a/client/containers/AddInterface/MockUrl/MockUrl.js +++ b/client/containers/AddInterface/MockUrl/MockUrl.js @@ -13,6 +13,7 @@ class MockUrl extends Component { mockURL: PropTypes.string, serverIp: PropTypes.string, mockData: PropTypes.string, + showMock: PropTypes.string, projectData: PropTypes.object } @@ -37,10 +38,9 @@ class MockUrl extends Component { } render () { - console.log(this.props) - const { serverIp } = this.props + const { serverIp, showMock } = this.props return ( -
+
mock地址 :

{this.props.mockURL}

@@ -50,4 +50,4 @@ class MockUrl extends Component { } } -export default MockUrl \ No newline at end of file +export default MockUrl