fix(接口测试): 修复测试报告查看报告详情页面报错问题

--user=郭雨琦 修复测试报告查看报告详情页面报错问题
This commit is contained in:
guoyuqi 2022-03-01 14:12:45 +08:00 committed by 刘瑞斌
parent ede0559f5e
commit dbe1546fdf
2 changed files with 15 additions and 8 deletions

View File

@ -17,7 +17,10 @@
props: { props: {
height: [String, Number], height: [String, Number],
data: { data: {
type: String type: String,
default() {
return ''
}
}, },
theme: { theme: {
type: String, type: String,

View File

@ -8,19 +8,19 @@
:content="responseResult.responseCode" :content="responseResult.responseCode"
placement="top"> placement="top">
<div v-if="response.attachInfoMap && response.attachInfoMap.errorReportResult" class="node-title" :class="'ms-req-error-report-result'"> <div v-if="responseData.attachInfoMap && responseData.attachInfoMap.errorReportResult" class="node-title" :class="'ms-req-error-report-result'">
{{ responseResult && responseResult.responseCode ? responseResult.responseCode : '0' }} {{ responseResult && responseResult.responseCode ? responseResult.responseCode : '0' }}
</div> </div>
<div v-else class="node-title" :class="response && response.success ?'ms-req-success':'ms-req-error'"> <div v-else class="node-title" :class="responseData && responseData.success ?'ms-req-success':'ms-req-error'">
{{ responseResult && responseResult.responseCode ? responseResult.responseCode : '0' }} {{ responseResult && responseResult.responseCode ? responseResult.responseCode : '0' }}
</div> </div>
</el-tooltip> </el-tooltip>
<div v-else class="node-title" :class="response && response.success ?'ms-req-success':'ms-req-error'"> <div v-else class="node-title" :class="responseData && responseData.success ?'ms-req-success':'ms-req-error'">
{{ responseResult && responseResult.responseCode ? responseResult.responseCode : '0' }} {{ responseResult && responseResult.responseCode ? responseResult.responseCode : '0' }}
</div> </div>
<div v-if="response.attachInfoMap && response.attachInfoMap.errorReportResult"> <div v-if="responseData.attachInfoMap && responseData.attachInfoMap.errorReportResult">
<div class="ms-req-error-report-result"> <div class="ms-req-error-report-result">
{{ response.attachInfoMap.errorReportResult }} {{ responseData.attachInfoMap.errorReportResult }}
</div> </div>
</div> </div>
</el-col> </el-col>
@ -39,7 +39,6 @@
<script> <script>
export default { export default {
name: "MsRequestMetric", name: "MsRequestMetric",
props: { props: {
response: { response: {
type: Object, type: Object,
@ -48,6 +47,11 @@ export default {
} }
} }
}, },
data() {
return {
responseData: this.response ? this.response : {}
}
},
computed: { computed: {
responseResult() { responseResult() {
return this.response && this.response.responseResult ? this.response.responseResult : {}; return this.response && this.response.responseResult ? this.response.responseResult : {};
@ -55,7 +59,7 @@ export default {
error() { error() {
return this.response && this.response.responseCode && this.response.responseCode >= 400; return this.response && this.response.responseCode && this.response.responseCode >= 400;
} }
} },
} }
</script> </script>