From 7240fc729aef4a65a977a5a4394513eb6010e99f 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 17:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/filter-form/index.vue | 2 +- .../model-custom/components/custom-dialog/index.vue | 8 ++++---- src/components/model-custom/model-custom-content.vue | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/common/filter-form/index.vue b/src/components/common/filter-form/index.vue index cb2e5d52..357d3e08 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 != '' && old_defalut != undefined && ['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; diff --git a/src/components/model-custom/components/custom-dialog/index.vue b/src/components/model-custom/components/custom-dialog/index.vue index 9de4750c..29ff7763 100644 --- a/src/components/model-custom/components/custom-dialog/index.vue +++ b/src/components/model-custom/components/custom-dialog/index.vue @@ -121,7 +121,7 @@ watchEffect(() => { const staging_data : any = {}; pagination_data.value = { page: 1, - page_size: props?.config?.page_size || '', + page_size: props?.config?.page_size || undefined, data_total: 0, } const filter_form_config = props?.config?.filter_form_config || []; @@ -131,11 +131,11 @@ watchEffect(() => { filter_form_config.forEach((item: any) => { let value : number | string | Array = ''; if (item.type == 'checkbox' || item.type == 'select' && +item?.config?.is_multiple == 1) { // 多选 - value = item?.config?.default || []; + value = item?.config?.default ?? []; } else if ((item.type == 'input' && item?.config?.type == 'number') || item.type == 'switch') { // 数字/开关 - value = Number(item?.config?.default || 0); + value = Number(item?.config?.default ?? 0); } else { // 其他 - value = item?.config?.default || ''; + value = item?.config?.default ?? ''; } staging_data[item.form_name] = value; }) diff --git a/src/components/model-custom/model-custom-content.vue b/src/components/model-custom/model-custom-content.vue index 661ae7ef..76f762fa 100644 --- a/src/components/model-custom/model-custom-content.vue +++ b/src/components/model-custom/model-custom-content.vue @@ -325,11 +325,11 @@ const changeDataSource = (key: string) => { default_type_data.value?.filter_config?.filter_form_config.forEach((item: any) => { let value : number | string | Array = ''; if (item.type == 'checkbox' || (item.type == 'select' && +item?.config?.is_multiple == 1)) { // 多选 - value = item?.config?.default || []; + value = item?.config?.default ?? []; } else if ((item.type == 'input' && item?.config?.type == 'number') || item.type == 'switch') { // 数字/开关 - value = Number(item?.config?.default || 0); + value = Number(item?.config?.default ?? 0); } else { - value = item?.config?.default || ''; + value = item?.config?.default ?? ''; } staging_data[item.form_name] = value; })