refactor(接口测试): 优化接口列表标签样式
This commit is contained in:
parent
d65ba6a9cd
commit
438e7ae94b
|
@ -136,13 +136,20 @@
|
||||||
min-width="180px"
|
min-width="180px"
|
||||||
:field="item"
|
:field="item"
|
||||||
:fields-width="fieldsWidth"
|
:fields-width="fieldsWidth"
|
||||||
|
:show-overflow-tooltip=false
|
||||||
:label="'API'+ $t('api_test.definition.api_path')"/>
|
: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">
|
<template v-slot:default="scope">
|
||||||
<ms-tag v-for="(itemName,index) in scope.row.tags" :key="index" type="success" effect="plain"
|
<el-tooltip class="item" effect="dark" placement="top">
|
||||||
:show-tooltip="scope.row.tags.length===1&&itemName.length*12<=120"
|
<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>
|
||||||
<span/>
|
<span/>
|
||||||
</template>
|
</template>
|
||||||
</ms-table-column>
|
</ms-table-column>
|
||||||
|
@ -1264,6 +1271,17 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
getTagToolTips(tags) {
|
||||||
|
try {
|
||||||
|
let showTips = "";
|
||||||
|
tags.forEach(item => {
|
||||||
|
showTips += item + ",";
|
||||||
|
})
|
||||||
|
return showTips.substr(0, showTips.length - 1);
|
||||||
|
} catch (e) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1315,6 +1333,12 @@ export default {
|
||||||
color: #6D317C;
|
color: #6D317C;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.oneLine {
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
.ms-unexecute {
|
.ms-unexecute {
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -965,7 +965,7 @@ export default {
|
||||||
tags.forEach( item => {
|
tags.forEach( item => {
|
||||||
showTips += item + ",";
|
showTips += item + ",";
|
||||||
})
|
})
|
||||||
return showTips;
|
return showTips.substr(0, showTips.length - 1);
|
||||||
}catch (e){
|
}catch (e){
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue