fix(接口测试): 接口测试首页饼状图优化
--bug=1020519 --user=宋天阳 【接口测试】接口首页 - 接口数量统计,0个的接口类型在环形统计图里也有颜色占比 https://www.tapd.cn/55049933/s/1314092
This commit is contained in:
parent
b5b4c510c6
commit
d5adce88da
|
@ -3,7 +3,6 @@
|
|||
<slot name="version"></slot>
|
||||
<ms-search :condition.sync="condition" :base-search-tip="$t('commons.search_by_id_name_tag')" @search="search">
|
||||
</ms-search>
|
||||
|
||||
<ms-table
|
||||
:data="tableData"
|
||||
:screen-height="isRelate ? 'calc(100vh - 400px)' : screenHeight"
|
||||
|
|
|
@ -95,10 +95,10 @@ export default {
|
|||
borderWidth = 3;
|
||||
dataIsNotEmpty = true;
|
||||
protocolData = [
|
||||
{ value: this.apiData.httpCount, name: 'HTTP' },
|
||||
{ value: this.apiData.rpcCount, name: 'RPC' },
|
||||
{ value: this.apiData.tcpCount, name: 'TCP' },
|
||||
{ value: this.apiData.sqlCount, name: 'SQL' },
|
||||
{ value: this.apiData.httpCount > 0 ? this.apiData.httpCount : '-', name: 'HTTP' },
|
||||
{ value: this.apiData.rpcCount > 0 ? this.apiData.rpcCount : '-', name: 'RPC' },
|
||||
{ value: this.apiData.tcpCount > 0 ? this.apiData.tcpCount : '-', name: 'TCP' },
|
||||
{ value: this.apiData.sqlCount > 0 ? this.apiData.sqlCount : '-', name: 'SQL' },
|
||||
];
|
||||
}
|
||||
let optionData = {
|
||||
|
@ -142,12 +142,14 @@ export default {
|
|||
},
|
||||
data: protocolData,
|
||||
formatter: function (name) {
|
||||
//通过name获取到数组对象中的单个对象
|
||||
let singleData = protocolData.filter(function (item) {
|
||||
return item.name === name;
|
||||
});
|
||||
let value = singleData[0].value;
|
||||
return [`{protocol|${name}}`, `{num|${value}}`].join('');
|
||||
let showValue = singleData[0].value;
|
||||
if (showValue === '-') {
|
||||
showValue = 0;
|
||||
}
|
||||
return [`{protocol|${name}}`, `{num|${showValue}}`].join('');
|
||||
},
|
||||
},
|
||||
title: {
|
||||
|
|
Loading…
Reference in New Issue