From 6d86c3e447de116a51661aad9adb6b286d539eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=B1=E8=BE=BE?= Date: Wed, 14 May 2025 15:36:34 +0800 Subject: [PATCH] =?UTF-8?q?style(button):=20=E4=BC=98=E5=8C=96=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=A0=B7=E5=BC=8F=E5=92=8C=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整了多个组件中的按钮样式,包括禁用状态的样式 - 优化了按钮的排列和间距 - 统一了按钮的样式类和属性 - 移除了部分冗余的代码 --- src/assets/sass/renderSass/table.scss | 8 +++ .../RenderTable/component/bodySlot/index.vue | 52 ++++++++-------- src/views/knowledge/detail/index.vue | 21 ++++--- src/views/rules/Index.vue | 8 +-- src/views/system/role/index.vue | 8 +-- src/views/system/user/index.vue | 61 +++++++++---------- 6 files changed, 83 insertions(+), 75 deletions(-) diff --git a/src/assets/sass/renderSass/table.scss b/src/assets/sass/renderSass/table.scss index 71602e8..f52a3ea 100644 --- a/src/assets/sass/renderSass/table.scss +++ b/src/assets/sass/renderSass/table.scss @@ -60,6 +60,14 @@ } } +.el-table { + & .el-button { + &.is-disabled { + background: unset; + color: #cecece; + } + } +} //.el-pagination.is-background .el-pager li:not(.disabled).active { // //} diff --git a/src/components/RenderTable/component/bodySlot/index.vue b/src/components/RenderTable/component/bodySlot/index.vue index a2401ae..c0fd7cb 100644 --- a/src/components/RenderTable/component/bodySlot/index.vue +++ b/src/components/RenderTable/component/bodySlot/index.vue @@ -61,33 +61,33 @@ const RenderSlot = { if (params.column.isRedraw) { let content = data.props.render(h, params) let contentDiv = content.children - if (contentDiv.length > 2) { - // 切割掉第一个div - const first = contentDiv.splice(0, 1) - const other = contentDiv.splice(0, contentDiv.length) - first[0].data.class = 'normal-button' - first[0].data.props.type = null - first[0].data.props.size = null - other.forEach(item => { - // item.data.class = 'normal-button ' - item.data.class = 'normal-button popver-button' - }) + // if (contentDiv.length > 2) { + // 切割掉第一个div + // const first = contentDiv.splice(0, 1) + // const other = contentDiv.splice(0, contentDiv.length) + // first[0].data.class = 'normal-button' + // first[0].data.props.type = null + // first[0].data.props.size = null + // other.forEach(item => { + // // item.data.class = 'normal-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)] - // content.children = [renderTooltip(first), ...other] - return content - } else { - // const first = contentDiv.splice(0, contentDiv) - - contentDiv = contentDiv.map(item => { - item.data.class = 'normal-button' - item.data.props.type = null - item.data.props.size = null - return renderTooltip([item]) - }) - content.children = contentDiv - return content - } + contentDiv = contentDiv.map(item => { + item.data.class = 'normal-button' + item.data.props.type = null + item.data.props.size = null + return renderTooltip([item]) + }) + content.children = contentDiv + return content + // } // let div = } else { return data.props.render(h, params) diff --git a/src/views/knowledge/detail/index.vue b/src/views/knowledge/detail/index.vue index 6fa13ba..243f105 100644 --- a/src/views/knowledge/detail/index.vue +++ b/src/views/knowledge/detail/index.vue @@ -62,6 +62,7 @@ size="medium" icon="el-icon-plus" class="primary-button" + disbaled @click="jumpAddKnowledge" >上传知识 @@ -91,7 +92,7 @@ this.deleteKnowledge(params.row) } - }, - '删除' + } + // '删除' ), // h( // 'el-button', @@ -725,15 +726,15 @@ export default { props: { type: 'primary', size: 'mini', - icon: 'el-icon-tickets', + icon: 'el-icon-help', title: '添加元数据', disabled: params.row.documentStatus !== 1 }, on: { click: () => this.handleAddMetadata(params.row) } - }, - '标注元数据' + } + // '标注元数据' ), params.row.optStatus < 4 ? h( @@ -743,14 +744,14 @@ export default { props: { type: 'primary', size: 'mini', - icon: 'el-icon-tickets', - title: '添加元数据' + icon: 'el-icon-video-play', + title: '继续处理' }, on: { click: () => this.jumpToUpload(params) } - }, - '文件拆分处理' + } + // '文件拆分处理' ) : '' ]) diff --git a/src/views/rules/Index.vue b/src/views/rules/Index.vue index d8ad308..4bb84f8 100644 --- a/src/views/rules/Index.vue +++ b/src/views/rules/Index.vue @@ -54,8 +54,8 @@ export default { }, class: 'normal-button', on: { click: () => this.handleEdit(params.row) } - }, - '修改' + } + // '修改' ), h( 'el-button', @@ -70,8 +70,8 @@ export default { on: { click: () => this.handleDelete(params.row, params.index) } - }, - '删除' + } + // '删除' ) ]) } diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 4b8c416..ef66a37 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -179,8 +179,8 @@ export default { }, class: 'normal-button', on: { click: () => this.handleDelete(params.row) } - }, - '删除' + } + // '删除' ), h( 'el-button', @@ -195,8 +195,8 @@ export default { on: { click: () => this.handlePermissionVisible(params.row) } - }, - '设置权限' + } + // '设置权限' ) ]) } diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 0cd652e..dd28b1a 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -177,43 +177,42 @@ export default { props: { type: 'text', size: 'mini', - icon: 'el-icon-remove-outline', - style: + icon: params.row.status === 0 - ? 'color: #F56C6C' - : 'color: #67C23A' + ? 'el-icon-remove-outline' + : 'el-icon-circle-check', + title: params.row.status === 0 ? '停用' : '启用' }, + // style: + // params.row.status === 0 + // ? 'color: #F56C6C' + // : 'color: #67C23A', + on: { click: () => this.handleToggleStatus(params.row) } - }, - params.row.status === 0 ? '停用' : '启用' + } + // params.row.status === 0 ? '停用' : '启用' ), - h( - 'el-button', - { - props: { - type: 'text', - size: 'mini', - style: 'color: #409EFF', - icon: 'el-icon-refresh-right' - }, - class: 'normal-button', - on: { click: () => this.handleResetPassword(params.row) } + h('el-button', { + props: { + type: 'text', + size: 'mini', + style: 'color: #409EFF', + icon: 'el-icon-refresh-right', + title: '重置密码' }, - '重置密码' - ), - h( - 'el-button', - { - props: { - type: 'text', - size: 'mini', - style: 'color: #F56C6C', - icon: 'el-icon-delete' - }, - on: { click: () => this.handleDelete(params.row) } + class: 'normal-button', + on: { click: () => this.handleResetPassword(params.row) } + }), + h('el-button', { + props: { + type: 'text', + size: 'mini', + style: 'color: #F56C6C', + icon: 'el-icon-delete', + title: '删除' }, - '删除' - ) + on: { click: () => this.handleDelete(params.row) } + }) ]) } }