From f8cdbebca60fef983961e4e9f75d0d9618c989fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=BB=E5=B8=8C=E9=87=8C?= Date: Tue, 5 Sep 2017 13:17:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0footer=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF=E3=80=81mockEditor=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E8=87=AA=E9=80=82=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Footer/Footer.js | 3 ++- .../Project/Interface/InterfaceList/View.js | 18 +++++++++++++++--- .../Project/Interface/InterfaceList/View.scss | 5 +++++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/client/components/Footer/Footer.js b/client/components/Footer/Footer.js index a35bf30e..13a628ea 100644 --- a/client/components/Footer/Footer.js +++ b/client/components/Footer/Footer.js @@ -3,6 +3,7 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' import { Row, Col } from 'antd'; import { Icon } from 'antd' +import packageJson from '../../../package.json'; class Footer extends Component { constructor(props) { super(props) @@ -100,7 +101,7 @@ Footer.defaultProps = { iconType: 'layout', linkList: [ { - itemTitle: '版本: 1.0', + itemTitle: '版本: '+packageJson.version, itemLink: 'javascript:' } ] diff --git a/client/containers/Project/Interface/InterfaceList/View.js b/client/containers/Project/Interface/InterfaceList/View.js index 10b7b41b..cba4726e 100644 --- a/client/containers/Project/Interface/InterfaceList/View.js +++ b/client/containers/Project/Interface/InterfaceList/View.js @@ -31,9 +31,10 @@ class View extends Component { req_body_form(req_body_type,req_body_form){ if(req_body_type === 'json'){ + let h = this.countEnter(this.props.curData.req_body_other); return
请求Body: -
+
}else if(req_body_type === 'form'){ @@ -92,9 +93,10 @@ class View extends Component { } res_body(res_body_type,res_body){ if(res_body_type === 'json'){ + let h = this.countEnter(this.props.curData.req_body_other); return
返回Body: -
+
}else if(res_body_type === 'raw'){ return
@@ -135,9 +137,19 @@ class View extends Component { return ; } - + countEnter(str){ + let i = 0; + let c = 0; + if(!str||!str.indexOf) return 0; + while(str.indexOf('\n',i)>-1){ + i = str.indexOf('\n',i) + 2; + c++; + } + return c; + } bindAceEditor(){ if(this.props.curData.req_body_type === "json"&&this.props.curData.title){ + // console.log(this.props.curData.req_body_other.indexOf("\n")); mockEditor({ container: 'vreq_body_json', data: this.props.curData.req_body_other, diff --git a/client/containers/Project/Interface/InterfaceList/View.scss b/client/containers/Project/Interface/InterfaceList/View.scss index 718922dc..c78bc3a4 100644 --- a/client/containers/Project/Interface/InterfaceList/View.scss +++ b/client/containers/Project/Interface/InterfaceList/View.scss @@ -93,4 +93,9 @@ text-indent: 2em; } } + // .ace_scroller{ + // position: relative; + // margin-left: 50px; + // overflow:visible; + // } } \ No newline at end of file