refactor(接口测试): 优化接口列表标签样式
This commit is contained in:
parent
791a2418bd
commit
fee36168e5
|
@ -134,13 +134,20 @@
|
|||
min-width="180px"
|
||||
:field="item"
|
||||
:fields-width="fieldsWidth"
|
||||
:show-overflow-tooltip=false
|
||||
:label="'API'+ $t('api_test.definition.api_path')"/>
|
||||
|
||||
<ms-table-column v-if="item.id=='tags'" prop="tags" width="120px" :label="$t('commons.tag')">
|
||||
<ms-table-column v-if="item.id=='tags'" prop="tags" width="120px" :label="$t('commons.tag')"
|
||||
:show-overflow-tooltip=false>
|
||||
<template v-slot:default="scope">
|
||||
<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<=120"
|
||||
:content="itemName" style="margin-left: 0px; margin-right: 2px"/>
|
||||
<el-tooltip class="item" effect="dark" placement="top">
|
||||
<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>
|
||||
<span/>
|
||||
</template>
|
||||
</ms-table-column>
|
||||
|
@ -1255,6 +1262,17 @@ export default {
|
|||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
getTagToolTips(tags) {
|
||||
try {
|
||||
let showTips = "";
|
||||
tags.forEach(item => {
|
||||
showTips += item + ",";
|
||||
})
|
||||
return showTips.substr(0, showTips.length - 1);
|
||||
} catch (e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -1306,6 +1324,12 @@ export default {
|
|||
color: #6D317C;
|
||||
}
|
||||
|
||||
.oneLine {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.ms-unexecute {
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -956,7 +956,7 @@ export default {
|
|||
tags.forEach( item => {
|
||||
showTips += item + ",";
|
||||
})
|
||||
return showTips;
|
||||
return showTips.substr(0, showTips.length - 1);
|
||||
}catch (e){
|
||||
return "";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue