From 0611526d9eb83da2f6dbce57effd3a1bef0cc1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Fri, 6 Dec 2024 14:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=86=85=E5=AE=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/filter-form/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/filter-form/index.vue b/src/components/common/filter-form/index.vue index 87249472..12053d74 100644 --- a/src/components/common/filter-form/index.vue +++ b/src/components/common/filter-form/index.vue @@ -100,7 +100,7 @@ onBeforeMount(() => { // 获取到默认值 const old_defalut = new_dataInterface.value[item.form_name]; // 默认值不为空的时候,进行处理查看当前数据是否存在默认值数据 - if (old_defalut && ['select', 'radio', 'checkout'].includes(item.type)) { + if (old_defalut != '' && old_defalut != undefined && ['select', 'radio', 'checkout'].includes(item.type)) { if (item.type == 'select' && +item?.config?.is_level == 1) { // 如果是级联的效果 const result = contains_value(options_list, item, [], item?.config?.children || ''); new_dataInterface.value[item.form_name] = result; @@ -114,7 +114,7 @@ onBeforeMount(() => { } } else { // 单选的处理逻辑 - const list = options_list.filter((item1: any) => item1[item?.data_key || 'id'] === old_defalut ); + const list = options_list.filter((item1: any) => item1[item?.data_key || 'id'] === old_defalut); if (list.length > 0) { new_dataInterface.value[item.form_name] = list[0][item?.data_key || 'id']; } else {