From af16450eb69622f2d7ee2cb9ee6443090402d573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=88=90?= Date: Wed, 19 Nov 2025 15:43:45 +0800 Subject: [PATCH] 1 --- src/components/tables/fieldRenderer.vue | 50 ++----------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/src/components/tables/fieldRenderer.vue b/src/components/tables/fieldRenderer.vue index f9a72f6..7d8b099 100644 --- a/src/components/tables/fieldRenderer.vue +++ b/src/components/tables/fieldRenderer.vue @@ -93,24 +93,8 @@ export default { } }, computed: { - // 确保 Radio 的值类型正确 + // 直接返回原始值,不进行类型转换 radioValue() { - - if (this.col.com === 'Radio') { - const source = this.getRadioSource(this.col) - if (source.length > 0 && this.value !== undefined && this.value !== null) { - const firstItem = source[0] - const firstValue = this.getRadioValue(firstItem) - // 如果第一个选项的值是数字类型,确保 value 也是数字 - if (typeof firstValue === 'number') { - return Number(this.value) - } - // 如果第一个选项的值是字符串类型,确保 value 也是字符串 - if (typeof firstValue === 'string') { - return String(this.value) - } - } - } return this.value } }, @@ -264,21 +248,7 @@ export default { if (value && typeof value === 'object' && value.target) { value = value.target.value } - - // 确保 Radio 的值类型正确 - if (this.col.com === 'Radio') { - const source = this.getRadioSource(this.col) - if (source.length > 0) { - const firstItem = source[0] - // 如果第一个选项的值是数字类型,确保 value 也是数字 - const firstValue = this.getRadioValue(firstItem) - if (typeof firstValue === 'number' && typeof value === 'string') { - value = Number(value) - } else if (typeof firstValue === 'string' && typeof value === 'number') { - value = String(value) - } - } - } + // 直接传递值,不进行类型转换 this.$emit('input', value) }, @@ -288,21 +258,7 @@ export default { if (value && typeof value === 'object' && value.target) { value = value.target.value } - - // 确保 Radio 的值类型正确 - if (this.col.com === 'Radio') { - const source = this.getRadioSource(this.col) - if (source.length > 0) { - const firstItem = source[0] - // 如果第一个选项的值是数字类型,确保 value 也是数字 - const firstValue = this.getRadioValue(firstItem) - if (typeof firstValue === 'number' && typeof value === 'string') { - value = Number(value) - } else if (typeof firstValue === 'string' && typeof value === 'number') { - value = String(value) - } - } - } + // 直接传递值,不进行类型转换 this.$emit('change', value) } }