1.优化后台菜单页面

This commit is contained in:
2026-06-24 17:00:46 +08:00
parent 58b22cfb64
commit e40de47b8b
3 changed files with 11 additions and 39 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div v-memo="[field]" class="ba-table-operate-buttons">
<div v-memo="[field]">
<template v-for="(btn, idx) in field.buttons" :key="idx">
<template v-if="btn.display ? btn.display(row, field) : true">
<!-- 常规按钮 -->
@@ -147,34 +147,16 @@ const getTranslation = (key?: string) => {
</script>
<style scoped lang="scss">
.ba-table-operate-buttons {
display: inline-flex;
align-items: center;
justify-content: center;
flex-wrap: nowrap;
width: 100%;
gap: 0;
vertical-align: middle;
}
.ba-table-render-buttons-item {
width: 40px;
min-width: 40px;
height: 32px;
padding: 0 !important;
margin: 0 !important;
display: inline-flex;
align-items: center;
justify-content: center;
.text {
font-size: 12px;
line-height: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
font-size: 14px;
}
.icon + .text {
padding-left: 2px;
padding-left: 5px;
}
&.el-button--small {
padding: 4px 5px;
height: auto;
}
}
.ba-table-render-buttons-move {
@@ -182,10 +164,9 @@ const getTranslation = (key?: string) => {
}
.buttons-popconfirm-reference-box {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
min-width: 40px;
vertical-align: middle;
}
.buttons-ml-6 + .buttons-ml-6 {
margin-left: 6px;
}
</style>

View File

@@ -152,17 +152,15 @@ export const getButtonsColumnWidth = (buttons?: OptButton[]): number => {
}
/**
* 统一操作列:右侧固定,宽度 = 按钮数 × OPERATE_BUTTON_WIDTH
* 统一操作列宽度:按钮数 × OPERATE_BUTTON_WIDTH
*/
export const normalizeButtonsColumn = (column: TableColumn): TableColumn => {
if (column.render !== 'buttons') {
return column
}
const className = column.className ? `${column.className} ba-table-operate-column` : 'ba-table-operate-column'
return {
...column,
fixed: 'right',
width: getButtonsColumnWidth(column.buttons),
className,
}
}

View File

@@ -239,13 +239,6 @@ defineExpose({
text-overflow: ellipsis;
white-space: nowrap;
}
.ba-data-table :deep(.ba-table-operate-column) {
.cell {
padding-left: 0;
padding-right: 0;
overflow: visible;
}
}
.table-pagination {
box-sizing: border-box;
width: 100%;