From 6abc05dcf65bcea395f75db79caf3ddd2ae2686a Mon Sep 17 00:00:00 2001 From: a0049873 <79py69t9wb@privaterelay.appleid.com> Date: Thu, 10 Nov 2022 15:12:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=90=9C=E7=B4=A2=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/views/home/DetailsPageconetent.vue | 25 +++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/front/src/views/home/DetailsPageconetent.vue b/front/src/views/home/DetailsPageconetent.vue index 0f6c6e6e..51ad9bae 100644 --- a/front/src/views/home/DetailsPageconetent.vue +++ b/front/src/views/home/DetailsPageconetent.vue @@ -1179,18 +1179,31 @@ } getCountByFuzzyQuery(searchValue.value || '', flag).then((res) => { console.log('全局搜索==========》', res.data.data) + const arr = [] + const sortArr = [ + '应用资源', + '组件服务', + '基础设施', + '数据资源', + '知识库', + ] globalData.data = res.data.data let mapFlag = true res.data.data.map((val) => { - if (mapFlag && val.count != 0) { + if (val.count != 0) { mapFlag = false - if (Cardsname.value === val.type) { - getAppResources2() - } else { - changeCards(val.type) - } + arr.push(val.type) } }) + arr.sort((a, b) => { + return sortArr.indexOf(a) - sortArr.indexOf(b) + }) + console.log('arr', arr) + if (Cardsname.value === arr[0]) { + getAppResources2() + } else { + changeCards(arr[0]) + } if (!mapFlag) { return }