fix(测试跟踪): 批量关联需求显示优化

--bug=1023497 --user=陈建星 【测试跟踪】功能用例,批量关联需求,需求列表左侧的标签没显示需求平台 https://www.tapd.cn/55049933/s/1339111
This commit is contained in:
chenjianxing 2023-02-20 21:41:07 +08:00 committed by jianxing
parent 47dc751fda
commit d30cea995c
1 changed files with 25 additions and 2 deletions

View File

@ -19,11 +19,11 @@
clearable filterable :filter-method="filterDemand" style="width: 100%;"> clearable filterable :filter-method="filterDemand" style="width: 100%;">
<template slot-scope="{ data }"> <template slot-scope="{ data }">
<div class="story-box"> <div class="story-box">
<div class="story-platform">{{ data.platform }}</div> <div class="story-platform">{{ handleDemandOptionPlatform(data) }}</div>
<div class="story-label" v-if="data.value === 'other'"> <div class="story-label" v-if="data.value === 'other'">
{{ $t("test_track.case.other") }} {{ $t("test_track.case.other") }}
</div> </div>
<div class="story-label" v-else>{{ data.label }}</div> <div class="story-label text-ellipsis" v-else>{{ handleDemandOptionLabel(data) }}</div>
</div> </div>
</template> </template>
</el-cascader> </el-cascader>
@ -121,6 +121,28 @@ export default {
}) })
} }
}, },
handleDemandOptionPlatform(data){
if(data.platform){
return data.platform
}
if(data.label){
let arr = data.label.split(": ")
if(arr && arr.length > 1){
return arr[0];
}
}
return "";
},
handleDemandOptionLabel(data){
if(data.label){
let arr = data.label.split(": ")
if(arr && arr.length > 1){
return arr[1];
}
return data.label;
}
return "";
},
buildDemandCascaderOptions(data, options, pathArray) { buildDemandCascaderOptions(data, options, pathArray) {
data.forEach(item => { data.forEach(item => {
let option = { let option = {
@ -236,5 +258,6 @@ export default {
.story-label { .story-label {
line-height: 22px; line-height: 22px;
color: #1f2329; color: #1f2329;
max-width: 300px;
} }
</style> </style>