From 9475ded9225ddf66e03f46e8efcca7ac8865f47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=85=86=E7=90=A6?= <1361001127@qq.com> Date: Wed, 14 Aug 2024 09:41:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=95=86=E5=93=81=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E5=80=BC=E6=B7=BB=E5=8A=A0=E6=9A=82=E6=97=B6=E6=81=A2=E5=A4=8D?= =?UTF-8?q?name=E5=90=8C=E5=90=8D=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/product/spu/form/ProductAttributes.vue | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/views/mall/product/spu/form/ProductAttributes.vue b/src/views/mall/product/spu/form/ProductAttributes.vue index eaec16cc..e632a1f2 100644 --- a/src/views/mall/product/spu/form/ProductAttributes.vue +++ b/src/views/mall/product/spu/form/ProductAttributes.vue @@ -37,7 +37,7 @@ v-for="item2 in item.propertyOpts" :key="item2.id" :label="item2.name" - :value="item2.id" + :value="item2.name" /> { if (inputValue.value) { // 重复添加校验 // TODO @芋艿:需要测试下 - if (isNumber(inputValue.value)) { - if (attributeList.value[index].values?.some((item) => item.id === inputValue.value)) { - message.warning('已存在相同属性值,请重试') - attributeIndex.value = null - inputValue.value = '' - return - } + if (attributeList.value[index].values.find((item) => item.name === inputValue.value)) { + message.warning('已存在相同属性值,请重试') + attributeIndex.value = null + inputValue.value = '' + return } // 保存属性值 try {