fix(接口管理):修复接口管理页面显示的问题

--bug=1037824 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037824
--bug=1037926 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037926
This commit is contained in:
guoyuqi 2024-04-03 17:48:33 +08:00 committed by 刘瑞斌
parent ecac585d31
commit 33b110cd22
2 changed files with 20 additions and 2 deletions

View File

@ -315,7 +315,7 @@
case ResponseAssertionType.RESPONSE_TIME:
assertions.value.push({
...tmpObj,
expectedValue: 100,
expectedValue: 200,
});
break;
case ResponseAssertionType.VARIABLE:

View File

@ -10,7 +10,15 @@
<template #label="{ tab }">
<div class="response-tab">
<div v-if="tab.defaultFlag" class="response-tab-default-icon"></div>
{{ t(tab.name || tab.label) }}({{ tab.statusCode }})
<a-tooltip
v-if="getTextWidth(t(tab.name || tab.label)) > 200"
:content="t(tab.name || tab.label) + '(' + tab.statusCode + ')'"
>
<span class="one-line-text" style="max-width: 200px"
>{{ t(tab.name || tab.label) }}({{ tab.statusCode }})</span
>
</a-tooltip>
<span v-else>{{ t(tab.name || tab.label) }}({{ tab.statusCode }})</span>
<MsMoreAction
:list="
tab.defaultFlag
@ -309,6 +317,16 @@
emit('change');
}
function getTextWidth(text: string) {
const canvas = document.createElement('canvas');
const context = canvas.getContext('2d');
if (context != null) {
const metrics = context.measureText(text);
return metrics.width;
}
return 0;
}
// const jsonSchemaColumns: FormTableColumn[] = [
// {
// title: 'apiTestManagement.paramName',