feat: 测试集合页面布局调整

This commit is contained in:
wenbo.dong 2017-09-26 17:14:15 +08:00
parent bb9d313639
commit 5d697ce7ff
2 changed files with 7 additions and 8 deletions

View File

@ -127,9 +127,9 @@ class InterfaceColContent extends Component {
status = 'ok'; status = 'ok';
} else if (result.code === 1) { } else if (result.code === 1) {
status = 'invalid' status = 'invalid'
} }
} catch (e) { } catch (e) {
status = 'error'; status = 'error';
result = e; result = e;
} }
this.reports[curitem._id] = result; this.reports[curitem._id] = result;
@ -177,7 +177,7 @@ class InterfaceColContent extends Component {
headers: that.getHeadersObj(interfaceData.req_headers), headers: that.getHeadersObj(interfaceData.req_headers),
data: interfaceData.req_body_type === 'form' ? that.arrToObj(interfaceData.req_body_form) : interfaceData.req_body_other, data: interfaceData.req_body_type === 'form' ? that.arrToObj(interfaceData.req_body_form) : interfaceData.req_body_other,
success: (res, header) => { success: (res, header) => {
res = json_parse(res); res = json_parse(res);
result.res_header = header; result.res_header = header;
result.res_body = res; result.res_body = res;
if (res && typeof res === 'object') { if (res && typeof res === 'object') {
@ -206,7 +206,7 @@ class InterfaceColContent extends Component {
} catch (e) { } catch (e) {
console.log(e) console.log(e)
} }
err = err || '请求异常'; err = err || '请求异常';
result.code = 400; result.code = 400;
result.res_header = header; result.res_header = header;
@ -442,7 +442,7 @@ class InterfaceColContent extends Component {
return ( return (
<div className="interface-col"> <div className="interface-col">
<h2 style={{ marginBottom: '10px', display: 'inline-block' }}>测试集合&nbsp;<a target="_blank" rel="noopener noreferrer" href="https://yapi.ymfe.org/case.html" > <h2 className="interface-title" style={{ display: 'inline-block', margin: 0, marginBottom: '16px' }}>测试集合&nbsp;<a target="_blank" rel="noopener noreferrer" href="https://yapi.ymfe.org/case.html" >
<Tooltip title="点击查看文档"><Icon type="question-circle-o" /></Tooltip> <Tooltip title="点击查看文档"><Icon type="question-circle-o" /></Tooltip>
</a></h2> </a></h2>
<Button type="primary" style={{ float: 'right' }} onClick={this.executeTests}>开始测试</Button> <Button type="primary" style={{ float: 'right' }} onClick={this.executeTests}>开始测试</Button>
@ -478,4 +478,4 @@ class InterfaceColContent extends Component {
} }
} }
export default InterfaceColContent export default InterfaceColContent

View File

@ -89,12 +89,11 @@
} }
.interface-col{ .interface-col{
padding: 16px; padding: 24px;
.interface-col-table-header{ .interface-col-table-header{
background-color: rgb(238, 238, 238); background-color: rgb(238, 238, 238);
height: 50px; height: 50px;
line-height: 50px; line-height: 50px;
font-size:14px;
text-align: left; text-align: left;
} }