From 1ac91dc80d95f6293586703d278e3e6b1c68301e Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Fri, 11 Jul 2025 17:10:16 +0800 Subject: [PATCH] =?UTF-8?q?radio=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=98=BE=E7=A4=BA=E3=80=81=E5=A2=9E=E5=8A=A0=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E6=A8=AA=E5=90=91=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/GuipRadio.vue | 12 +++++++++++- src/style/theme/common.scss | 15 ++++++++++++++- src/views/elementGroups.vue | 10 +++++----- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/components/GuipRadio.vue b/src/components/GuipRadio.vue index 8e1792e..5249497 100644 --- a/src/components/GuipRadio.vue +++ b/src/components/GuipRadio.vue @@ -23,6 +23,10 @@ export default { type: Boolean, default: false }, + selectedLabelKey: { + type: String, + default: '' + }, // 选项列表,支持多种格式: // 1. 数组格式: [{ label: '显示文本', value: '值', disabled: false }] // 2. 对象格式: { key1: 'value1', key2: 'value2' } @@ -131,7 +135,13 @@ export default { return option.value; } - return option[this.labelKey] || option; + // 当前选项是否选中 + const isSelected = this.getValue(option) === this.selectedValue; + + // 选中状态下优先返回selectedLabel,其次返回labelKey指定的属性 + return isSelected && option[this.selectedLabelKey] + ? option[this.selectedLabelKey] + : option[this.labelKey] || option; }, getValue(option) { // 处理对象格式的选项 diff --git a/src/style/theme/common.scss b/src/style/theme/common.scss index 959fb4b..0c857a4 100644 --- a/src/style/theme/common.scss +++ b/src/style/theme/common.scss @@ -40,9 +40,11 @@ body { text-align: left; } /* 隐藏全局滚动条 */ -::-webkit-scrollbar { +/* 全局隐藏滚动条但排除el-table */ +*:not(.el-table)::-webkit-scrollbar { display: none; } + body { scrollbar-width: none; -ms-overflow-style: none; @@ -56,6 +58,17 @@ body { .element::-webkit-scrollbar { display: none; /* Chrome, Safari, Edge */ } + +.el-table__body-wrapper::-webkit-scrollbar { + display: block !important; + width: 6px; + height: 6px; + } + .el-table__body-wrapper::-webkit-scrollbar-thumb { + background: #c1c1c1; + border-radius: 3px; + } + .common_title{ font-weight: bold; letter-spacing: 0.08em; diff --git a/src/views/elementGroups.vue b/src/views/elementGroups.vue index 9c7f618..7d0c8bb 100644 --- a/src/views/elementGroups.vue +++ b/src/views/elementGroups.vue @@ -70,7 +70,7 @@