From 4e09c9cb0b6347d19cfd2b7949f712c093e35bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 14 Nov 2024 16:14:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/custom-module/model-icon/index.vue | 6 +- .../model-icon/model-icon-style.vue | 2 +- .../custom-module/model-image/index.vue | 12 ++-- .../model-image/model-image-style.vue | 2 +- .../common/custom-module/model-text/index.vue | 14 ++--- .../model-text/model-text-style.vue | 2 +- src/components/common/data-filter/index.vue | 34 +++++++---- src/components/model-article-list/index.vue | 8 +-- src/components/model-article-tabs/index.vue | 1 + .../model-custom/model-custom-content.vue | 56 +++++++++++++++---- .../components/custom/index.vue | 7 ++- src/components/model-goods-list/index.vue | 8 +-- src/components/model-goods-tabs/index.vue | 1 + src/config/const/article-list.ts | 2 + src/config/const/article-tabs.ts | 13 +++-- src/config/const/goods-list.ts | 3 + src/config/const/goods-tabs.ts | 9 +-- 17 files changed, 118 insertions(+), 62 deletions(-) diff --git a/src/components/common/custom-module/model-icon/index.vue b/src/components/common/custom-module/model-icon/index.vue index b67d9074..62870ce1 100644 --- a/src/components/common/custom-module/model-icon/index.vue +++ b/src/components/common/custom-module/model-icon/index.vue @@ -48,10 +48,8 @@ const icon_class = computed(() => { // 不输入商品, 文章和品牌时,从外层处理数据 let icon = props.sourceList[form.data_source_id]; // 如果是商品,品牌,文章的图片, 其他的切换为从data中取数据 - if (['goods', 'article', 'brand'].includes(props.sourceType)) { - if (!isEmpty(props.sourceList.data)) { - icon = props.sourceList.data[form.data_source_id]; - } + if (['goods', 'article', 'brand'].includes(props.sourceType) && !isEmpty(props.sourceList.data)) { + icon = props.sourceList.data[form.data_source_id]; } return icon; } else { diff --git a/src/components/common/custom-module/model-icon/model-icon-style.vue b/src/components/common/custom-module/model-icon/model-icon-style.vue index 27ce1630..a0ef26a2 100644 --- a/src/components/common/custom-module/model-icon/model-icon-style.vue +++ b/src/components/common/custom-module/model-icon/model-icon-style.vue @@ -26,7 +26,7 @@ - + diff --git a/src/components/common/custom-module/model-image/index.vue b/src/components/common/custom-module/model-image/index.vue index e11e4318..5c7bad63 100644 --- a/src/components/common/custom-module/model-image/index.vue +++ b/src/components/common/custom-module/model-image/index.vue @@ -50,13 +50,11 @@ const img = computed(() => { // 不输入商品, 文章和品牌时,从外层处理数据 let image_url = props.sourceList[form.data_source_id]; // 如果是商品,品牌,文章的图片, 其他的切换为从data中取数据 - if (['goods', 'article', 'brand'].includes(props.sourceType)) { - if (!isEmpty(props.sourceList.data)) { - if (form.data_source_id == keyMap[props.sourceType]) { - image_url = !isEmpty(props.sourceList.new_cover)? props.sourceList.new_cover[0]?.url || '' : props.sourceList.data[keyMap[props.sourceType]]; - } else { - image_url = props.sourceList.data[form.data_source_id]; - } + if (['goods', 'article', 'brand'].includes(props.sourceType) && !isEmpty(props.sourceList.data)) { + if (form.data_source_id == keyMap[props.sourceType]) { + image_url = !isEmpty(props.sourceList.new_cover)? props.sourceList.new_cover[0]?.url || '' : props.sourceList.data[keyMap[props.sourceType]]; + } else { + image_url = props.sourceList.data[form.data_source_id]; } } return image_url; diff --git a/src/components/common/custom-module/model-image/model-image-style.vue b/src/components/common/custom-module/model-image/model-image-style.vue index 6c0f0a16..4c84de3c 100644 --- a/src/components/common/custom-module/model-image/model-image-style.vue +++ b/src/components/common/custom-module/model-image/model-image-style.vue @@ -26,7 +26,7 @@ - + diff --git a/src/components/common/custom-module/model-text/index.vue b/src/components/common/custom-module/model-text/index.vue index a95613ee..4b1e4c6f 100644 --- a/src/components/common/custom-module/model-text/index.vue +++ b/src/components/common/custom-module/model-text/index.vue @@ -52,14 +52,12 @@ const text_title = computed(() => { let text = ''; let text_title = props.sourceList[form.data_source_id]; // 如果是商品的标题或者是品牌的名称,需要判断是否有新的标题,没有的话就取原来的标题 - if (['goods', 'article', 'brand'].includes(props.sourceType)) { - if (!isEmpty(props.sourceList.data)) { - // 其他的切换为从data中取数据 - if (form.data_source_id == keyMap[props.sourceType]) { - text_title = !isEmpty(props.sourceList.new_title) ? props.sourceList.new_title : props.sourceList.data[keyMap[props.sourceType]]; - } else { - text_title = props.sourceList.data[form.data_source_id]; - } + if (['goods', 'article', 'brand'].includes(props.sourceType) && !isEmpty(props.sourceList.data)) { + // 其他的切换为从data中取数据 + if (form.data_source_id == keyMap[props.sourceType]) { + text_title = !isEmpty(props.sourceList.new_title) ? props.sourceList.new_title : props.sourceList.data[keyMap[props.sourceType]]; + } else { + text_title = props.sourceList.data[form.data_source_id]; } } if (!isEmpty(form.text_title)) { diff --git a/src/components/common/custom-module/model-text/model-text-style.vue b/src/components/common/custom-module/model-text/model-text-style.vue index 0a3cf66d..4c6662de 100644 --- a/src/components/common/custom-module/model-text/model-text-style.vue +++ b/src/components/common/custom-module/model-text/model-text-style.vue @@ -26,7 +26,7 @@ - + diff --git a/src/components/common/data-filter/index.vue b/src/components/common/data-filter/index.vue index 2d3c832d..c0a8c5c0 100644 --- a/src/components/common/data-filter/index.vue +++ b/src/components/common/data-filter/index.vue @@ -12,6 +12,9 @@