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 }