fix(测试跟踪): 测试计划关联UI测试用例标签为空显示[]

--bug=1023762 --user=李玉号 【测试跟踪】测试计划-关联接口测试用例-case列表-标签为空显示[]
https://www.tapd.cn/55049933/s/1351766
This commit is contained in:
shiziyuan9527 2023-03-17 10:00:51 +08:00 committed by wxg0103
parent 2b88a700cc
commit 90f75d204f
2 changed files with 63 additions and 8 deletions

View File

@ -55,10 +55,21 @@
</template> </template>
</ms-table-column> </ms-table-column>
<ms-table-column prop="tagNames" :label="$t('api_test.automation.tag')" min-width="100"> <ms-table-column prop="tagNames" :label="$t('commons.tag')" width="120px" :show-overflow-tooltip="false">
<template v-slot:default="scope"> <template v-slot:default="scope">
<ms-tag v-for="itemName in scope.row.tags" :key="itemName" type="success" effect="plain" :content="itemName" <el-tooltip class="item" effect="dark" placement="top">
style="margin-left: 0px; margin-right: 2px"/> <div v-html="getTagToolTips(scope.row.tags)" slot="content"></div>
<div class="oneLine">
<ms-tag
v-for="(itemName, index) in scope.row.tags"
:key="index"
type="success"
effect="plain"
:show-tooltip="scope.row.tags.length === 1 && itemName.length * 12 <= 100"
:content="itemName"
style="margin-left: 0px; margin-right: 2px"/>
</div>
</el-tooltip>
</template> </template>
</ms-table-column> </ms-table-column>
<ms-table-column prop="userId" :label="$t('api_test.automation.creator')" show-overflow-tooltip sortable="custom" <ms-table-column prop="userId" :label="$t('api_test.automation.creator')" show-overflow-tooltip sortable="custom"
@ -194,6 +205,17 @@ export default {
this.getVersionOptions(); this.getVersionOptions();
}, },
methods: { methods: {
getTagToolTips(tags) {
try {
let showTips = '';
tags.forEach((item) => {
showTips += item + ',';
});
return showTips.substr(0, showTips.length - 1);
} catch (e) {
return '';
}
},
filterSearch() { filterSearch() {
this.currentPage = 1; this.currentPage = 1;
this.search(); this.search();
@ -313,4 +335,10 @@ export default {
margin-top: 15px; margin-top: 15px;
margin-right: 10px; margin-right: 10px;
} }
.oneLine {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style> </style>

View File

@ -96,11 +96,21 @@
<ms-table-column :field="item" <ms-table-column :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
prop="tagNames" :label="$t('api_test.automation.tag')" prop="tagNames" :label="$t('commons.tag')" width="120px" :show-overflow-tooltip="false">
min-width="100px"> <template v-slot:default="scope">
<template v-slot:default="scope"> <el-tooltip class="item" effect="dark" placement="top">
<ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain" <div v-html="getTagToolTips(scope.row.tags)" slot="content"></div>
:content="itemName" style="margin-left: 0px; margin-right: 2px"/> <div class="oneLine">
<ms-tag
v-for="(itemName, index) in scope.row.tags"
:key="index"
type="success"
effect="plain"
:show-tooltip="scope.row.tags.length === 1 && itemName.length * 12 <= 100"
:content="itemName"
style="margin-left: 0px; margin-right: 2px"/>
</div>
</el-tooltip>
</template> </template>
</ms-table-column> </ms-table-column>
@ -361,6 +371,17 @@ export default {
} }
}, },
methods: { methods: {
getTagToolTips(tags) {
try {
let showTips = '';
tags.forEach((item) => {
showTips += item + ',';
});
return showTips.substr(0, showTips.length - 1);
} catch (e) {
return '';
}
},
initWebSocket() { initWebSocket() {
this.websocket = baseSocket("/plan/ui/" + this.planId); this.websocket = baseSocket("/plan/ui/" + this.planId);
this.websocket.onmessage = this.onMessage; this.websocket.onmessage = this.onMessage;
@ -737,4 +758,10 @@ export default {
z-index: 2000; z-index: 2000;
} }
.oneLine {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
</style> </style>