fix(测试跟踪): 列表自定义字段名称过长缩略显示

This commit is contained in:
song-cc-rock 2023-02-28 19:33:22 +08:00
parent 9bf8109d9a
commit 51dc87d863
2 changed files with 26 additions and 0 deletions

View File

@ -691,6 +691,11 @@ export default {
border-bottom: 1px solid rgba(31, 35, 41, 0.15); border-bottom: 1px solid rgba(31, 35, 41, 0.15);
} }
:deep(.el-table th > .cell) {
word-break: keep-all !important;
white-space: nowrap !important;
}
:deep(.ms-select-all-fixed th:nth-child(2) .table-select-icon) { :deep(.ms-select-all-fixed th:nth-child(2) .table-select-icon) {
position: absolute; position: absolute;
display: inline-block; display: inline-block;

View File

@ -11,6 +11,7 @@
:sortable="sortable" :sortable="sortable"
:filter-method="filterMethod" :filter-method="filterMethod"
:filtered-value="filteredValue " :filtered-value="filteredValue "
:render-header="renderHeader"
:show-overflow-tooltip="showOverflowTooltip"> :show-overflow-tooltip="showOverflowTooltip">
<template v-slot:default="scope"> <template v-slot:default="scope">
@ -89,6 +90,26 @@ export default {
}, },
mounted() { mounted() {
this.active = true; this.active = true;
},
methods: {
renderHeader(h, data) {
if (data.column.label.length > 7) {
return h("span", [
h("el-tooltip", {
attrs: {
class: "item",
effect: "dark",
content: data.column.label,
placement: "top"
}
}, [
h("span", data.column.label)
])
])
} else {
return h("span", data.column.label);
}
}
} }
}; };
</script> </script>