style(button): 优化按钮样式和布局

- 调整了多个组件中的按钮样式,包括禁用状态的样式
- 优化了按钮的排列和间距
- 统一了按钮的样式类和属性
- 移除了部分冗余的代码
This commit is contained in:
陈昱达
2025-05-14 15:36:34 +08:00
parent 2c9ac917fe
commit 6d86c3e447
6 changed files with 83 additions and 75 deletions

View File

@@ -60,6 +60,14 @@
} }
} }
.el-table {
& .el-button {
&.is-disabled {
background: unset;
color: #cecece;
}
}
}
//.el-pagination.is-background .el-pager li:not(.disabled).active { //.el-pagination.is-background .el-pager li:not(.disabled).active {
// //
//} //}

View File

@@ -61,33 +61,33 @@ const RenderSlot = {
if (params.column.isRedraw) { if (params.column.isRedraw) {
let content = data.props.render(h, params) let content = data.props.render(h, params)
let contentDiv = content.children let contentDiv = content.children
if (contentDiv.length > 2) { // if (contentDiv.length > 2) {
// 切割掉第一个div // 切割掉第一个div
const first = contentDiv.splice(0, 1) // const first = contentDiv.splice(0, 1)
const other = contentDiv.splice(0, contentDiv.length) // const other = contentDiv.splice(0, contentDiv.length)
first[0].data.class = 'normal-button' // first[0].data.class = 'normal-button'
first[0].data.props.type = null // first[0].data.props.type = null
first[0].data.props.size = null // first[0].data.props.size = null
other.forEach(item => { // other.forEach(item => {
// item.data.class = 'normal-button ' // // item.data.class = 'normal-button '
item.data.class = 'normal-button popver-button' // item.data.class = 'normal-button popver-button'
}) // })
//
// content.children = [renderTooltip(first), renderPopver(other)]
// // content.children = [renderTooltip(first), ...other]
// return content
// } else {
// const first = contentDiv.splice(0, contentDiv)
content.children = [renderTooltip(first), renderPopver(other)] contentDiv = contentDiv.map(item => {
// content.children = [renderTooltip(first), ...other] item.data.class = 'normal-button'
return content item.data.props.type = null
} else { item.data.props.size = null
// const first = contentDiv.splice(0, contentDiv) return renderTooltip([item])
})
contentDiv = contentDiv.map(item => { content.children = contentDiv
item.data.class = 'normal-button' return content
item.data.props.type = null // }
item.data.props.size = null
return renderTooltip([item])
})
content.children = contentDiv
return content
}
// let div = // let div =
} else { } else {
return data.props.render(h, params) return data.props.render(h, params)

View File

@@ -62,6 +62,7 @@
size="medium" size="medium"
icon="el-icon-plus" icon="el-icon-plus"
class="primary-button" class="primary-button"
disbaled
@click="jumpAddKnowledge" @click="jumpAddKnowledge"
>上传知识 >上传知识
</el-button> </el-button>
@@ -91,7 +92,7 @@
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-edit-outline" icon="el-icon-help"
size="medium" size="medium"
class="line-button" class="line-button"
@click="handleMetaData" @click="handleMetaData"
@@ -699,8 +700,8 @@ export default {
on: { on: {
click: () => this.deleteKnowledge(params.row) click: () => this.deleteKnowledge(params.row)
} }
}, }
'删除' // '删除'
), ),
// h( // h(
// 'el-button', // 'el-button',
@@ -725,15 +726,15 @@ export default {
props: { props: {
type: 'primary', type: 'primary',
size: 'mini', size: 'mini',
icon: 'el-icon-tickets', icon: 'el-icon-help',
title: '添加元数据', title: '添加元数据',
disabled: params.row.documentStatus !== 1 disabled: params.row.documentStatus !== 1
}, },
on: { on: {
click: () => this.handleAddMetadata(params.row) click: () => this.handleAddMetadata(params.row)
} }
}, }
'标注元数据' // '标注元数据'
), ),
params.row.optStatus < 4 params.row.optStatus < 4
? h( ? h(
@@ -743,14 +744,14 @@ export default {
props: { props: {
type: 'primary', type: 'primary',
size: 'mini', size: 'mini',
icon: 'el-icon-tickets', icon: 'el-icon-video-play',
title: '添加元数据' title: '继续处理'
}, },
on: { on: {
click: () => this.jumpToUpload(params) click: () => this.jumpToUpload(params)
} }
}, }
'文件拆分处理' // '文件拆分处理'
) )
: '' : ''
]) ])

View File

@@ -54,8 +54,8 @@ export default {
}, },
class: 'normal-button', class: 'normal-button',
on: { click: () => this.handleEdit(params.row) } on: { click: () => this.handleEdit(params.row) }
}, }
'修改' // '修改'
), ),
h( h(
'el-button', 'el-button',
@@ -70,8 +70,8 @@ export default {
on: { on: {
click: () => this.handleDelete(params.row, params.index) click: () => this.handleDelete(params.row, params.index)
} }
}, }
'删除' // '删除'
) )
]) ])
} }

View File

@@ -179,8 +179,8 @@ export default {
}, },
class: 'normal-button', class: 'normal-button',
on: { click: () => this.handleDelete(params.row) } on: { click: () => this.handleDelete(params.row) }
}, }
'删除' // '删除'
), ),
h( h(
'el-button', 'el-button',
@@ -195,8 +195,8 @@ export default {
on: { on: {
click: () => this.handlePermissionVisible(params.row) click: () => this.handlePermissionVisible(params.row)
} }
}, }
'设置权限' // '设置权限'
) )
]) ])
} }

View File

@@ -177,43 +177,42 @@ export default {
props: { props: {
type: 'text', type: 'text',
size: 'mini', size: 'mini',
icon: 'el-icon-remove-outline', icon:
style:
params.row.status === 0 params.row.status === 0
? 'color: #F56C6C' ? 'el-icon-remove-outline'
: 'color: #67C23A' : 'el-icon-circle-check',
title: params.row.status === 0 ? '停用' : '启用'
}, },
// style:
// params.row.status === 0
// ? 'color: #F56C6C'
// : 'color: #67C23A',
on: { click: () => this.handleToggleStatus(params.row) } on: { click: () => this.handleToggleStatus(params.row) }
}, }
params.row.status === 0 ? '停用' : '启用' // params.row.status === 0 ? '停用' : '启用'
), ),
h( h('el-button', {
'el-button', props: {
{ type: 'text',
props: { size: 'mini',
type: 'text', style: 'color: #409EFF',
size: 'mini', icon: 'el-icon-refresh-right',
style: 'color: #409EFF', title: '重置密码'
icon: 'el-icon-refresh-right'
},
class: 'normal-button',
on: { click: () => this.handleResetPassword(params.row) }
}, },
'重置密码' class: 'normal-button',
), on: { click: () => this.handleResetPassword(params.row) }
h( }),
'el-button', h('el-button', {
{ props: {
props: { type: 'text',
type: 'text', size: 'mini',
size: 'mini', style: 'color: #F56C6C',
style: 'color: #F56C6C', icon: 'el-icon-delete',
icon: 'el-icon-delete' title: '删除'
},
on: { click: () => this.handleDelete(params.row) }
}, },
'删除' on: { click: () => this.handleDelete(params.row) }
) })
]) ])
} }
} }