From d4ecfc74a448c1b0049f59b5cbd1b142e8589cbe Mon Sep 17 00:00:00 2001 From: "851673013@qq.com" <851673013@qq.com> Date: Mon, 4 Jul 2022 11:24:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E7=BB=84=E4=BB=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/detailsAll/ApplicationDetails.vue | 11 +++++- .../ApplicationAssociatedAbility.vue | 37 +++++++++++++------ 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/front/src/views/detailsAll/ApplicationDetails.vue b/front/src/views/detailsAll/ApplicationDetails.vue index 904c5c29..5589ab37 100644 --- a/front/src/views/detailsAll/ApplicationDetails.vue +++ b/front/src/views/detailsAll/ApplicationDetails.vue @@ -33,7 +33,7 @@ > @@ -172,6 +172,15 @@ console.log('预览==============', obj) } } + const associatedComponentsFunction = () => { + if ( + associatedComponents.value[0].dataList.length > 0 || + associatedComponents.value[1].dataList.length > 0 || + associatedComponents.value[2].dataList.length > 0 + ) { + return associatedComponents.value + } + } init(id) onBeforeUnmount(() => { mybus.off('flyToView') diff --git a/front/src/views/detailsAll/components/Application/ApplicationAssociatedAbility.vue b/front/src/views/detailsAll/components/Application/ApplicationAssociatedAbility.vue index d2c19f96..e73ed586 100644 --- a/front/src/views/detailsAll/components/Application/ApplicationAssociatedAbility.vue +++ b/front/src/views/detailsAll/components/Application/ApplicationAssociatedAbility.vue @@ -46,24 +46,37 @@ }, }) } - if ( - props.associatedComponents[0].dataList.length > 0 || - props.associatedComponents[1].dataList.length > 0 || - props.associatedComponents[2].dataList.length > 0 - ) { - flag.value = true - dataFrom.value = props.associatedComponents - console.log('dataFrom.value', dataFrom.value) + if (props.associatedComponents) { + if ( + props.associatedComponents[0].dataList.length > 0 || + props.associatedComponents[1].dataList.length > 0 || + props.associatedComponents[2].dataList.length > 0 + ) { + flag.value = true + dataFrom.value = props.associatedComponents + console.log('dataFrom.value', dataFrom.value) + } else { + flag.value = false + } } else { flag.value = false } + watch( () => props.associatedComponents, (val) => { - if (val) { - flag.value = true - dataFrom.value = props.associatedComponents - console.log('dataFrom.value', dataFrom.value) + if (props.associatedComponents) { + if ( + val[0].dataList.length > 0 || + val[1].dataList.length > 0 || + val[2].dataList.length > 0 + ) { + flag.value = true + dataFrom.value = props.associatedComponents + // console.log('dataFrom.value', dataFrom.value) + } else { + flag.value = false + } } else { flag.value = false }