perf: 优化 labels 宽度

This commit is contained in:
ibuler
2024-04-17 20:01:42 +08:00
parent 1be5f23204
commit 373661d35a
7 changed files with 13 additions and 5 deletions

View File

@@ -2,7 +2,7 @@
<div ref="drawer" :class="{show: show}" class="drawer">
<div v-if="modal" :style="{'background-color': modal ? 'rgba(0, 0, 0, .3)' : 'transparent'}" class="modal" />
<div ref="panel" :style="{width: width, height: height }" class="drawer-panel">
<div ref="dragBox" class="handle-button">
<div v-show="!show" ref="dragBox" class="handle-button">
<i v-if="icon.startsWith('fa') || icon.startsWith('el')" :class="show ? 'el-icon-close': icon" />
<img v-else :src="icon" alt="">
</div>

View File

@@ -112,8 +112,9 @@ export default {
prop: 'actions',
label: i18n.t('Actions'),
align: 'center',
width: '150px',
width: '100px',
formatter: ActionsFormatter,
fixed: 'right',
formatterArgs: {}
}
break
@@ -144,6 +145,7 @@ export default {
break
case 'labels':
col.formatter = LabelsFormatter
col.width = '200px'
break
case 'comment':
col.showOverflowTooltip = true

View File

@@ -7,7 +7,6 @@
@click="showSearchSelect"
>
<svg-icon icon-class="tag" />
<span style="padding-left: 2px">{{ $t('Label') }}</span>
</el-button>
<el-cascader
v-else

View File

@@ -137,7 +137,6 @@ export default {
this.searchTable({ labels: val })
},
handleLabelSearchShowChange(val) {
console.log('handleLabelSearchShowChange', val)
this.foldSearch = val
}
}

View File

@@ -12,6 +12,7 @@
:key="label"
>
<el-tag
:title="getKey(label) + getValue(label)"
:type="getLabelType(label)"
class="tag-formatter"
disable-transitions
@@ -255,6 +256,10 @@ export default {
.tag-formatter {
margin: 2px 0;
max-width: 180px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
//display: table;
}

View File

@@ -179,6 +179,9 @@ export default {
.collapsed {
text-align: left;
.nav-title {
&:hover {
background-color: var(--menu-hover);
}
.switch-view .icon {
margin-left: 0;
}

View File

@@ -43,7 +43,7 @@
&.has-logo {
.el-scrollbar {
height: calc(100% - #{$headerHeight} - 38px - 52px); // header-height, view-header, footer-height
height: calc(100% - #{$headerHeight} - 40px - 52px); // header-height, view-header, footer-height
}
}