From e50dc1ad1f0a931150483e088c064c17bf7315d5 Mon Sep 17 00:00:00 2001 From: a0049873 <79py69t9wb@privaterelay.appleid.com> Date: Mon, 15 Aug 2022 16:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=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 | 59 +++++++++++++++++++- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/front/src/views/home/DetailsPageconetent.vue b/front/src/views/home/DetailsPageconetent.vue index 4bb4e92b..34137e00 100644 --- a/front/src/views/home/DetailsPageconetent.vue +++ b/front/src/views/home/DetailsPageconetent.vue @@ -843,7 +843,7 @@ const currentPageSize = ref(5) const pageSizeOptions = ref(['5', '10', '20', '50']) const router = useRouter() - const select = router.currentRoute.value.query.select || '组件服务' + let select = router.currentRoute.value.query.select || '组件服务' const select2 = router.currentRoute.value.query.select const str = router.currentRoute.value.query.str const searchValue = ref(str) @@ -868,7 +868,7 @@ type: Cardsname.value, name: '', infoList: [], - orderField: 'visits', // total 综合 visits 访问量 applyCount 申请量 score 评分 collectCount 收藏量 + orderField: '', // 传空为默认排序 total 综合 visits 访问量 applyCount 申请量 score 评分 collectCount 收藏量 orderType: 'DESC', // ASC 升序 DESC 降序 } //西海岸查询参数 @@ -973,7 +973,7 @@ paramsGetResources.name = '' paramsGetResources.shareCondition = '' paramsGetResources.infoList = [] - paramsGetResources.orderField = 'total' + paramsGetResources.orderField = '' paramsGetResources.orderType = 'DESC' mybus.emit('chongzhi') getAppResources() @@ -1129,6 +1129,59 @@ if (!globalFlag.value) { globalData.data = [] } + select = router.currentRoute.value.query.select + console.log( + 'url中的select', + router.currentRoute.value.query.select, + select == '应用资源' && + (paramsGetResources.orderField == '' || + paramsGetResources.orderField == 'deptSort' || + paramsGetResources.orderField == 'pin_top'), + paramsGetResources.infoList.filter( + (val) => val.attrType == '组件类型' + )[0] && + paramsGetResources.infoList.filter( + (val) => val.attrType == '组件类型' + )[0].attrValue == '图层服务' && + (paramsGetResources.orderField == '' || + paramsGetResources.orderField == 'deptSort' || + paramsGetResources.orderField == 'pin_top') + ) + if ( + (select == '应用资源' && + (paramsGetResources.orderField == '' || + paramsGetResources.orderField == 'deptSort' || + paramsGetResources.orderField == 'pin_top')) || + (paramsGetResources.infoList.filter( + (val) => val.attrType == '组件类型' + )[0] && + paramsGetResources.infoList.filter( + (val) => val.attrType == '组件类型' + )[0].attrValue == '图层服务' && + (paramsGetResources.orderField == '' || + paramsGetResources.orderField == 'deptSort' || + paramsGetResources.orderField == 'pin_top')) + ) { + paramsGetResources.orderField = 'deptSort' + } else if ( + paramsGetResources.infoList.filter( + (val) => val.attrType == '组件类型' + )[0] && + paramsGetResources.infoList.filter( + (val) => val.attrType == '组件类型' + )[0].attrValue == '智能算法' && + (paramsGetResources.orderField == '' || + paramsGetResources.orderField == 'deptSort' || + paramsGetResources.orderField == 'pin_top') + ) { + paramsGetResources.orderField = 'pin_top' + } else if ( + paramsGetResources.orderField == '' || + paramsGetResources.orderField == 'deptSort' || + paramsGetResources.orderField == 'pin_top' + ) { + paramsGetResources.orderField = '' + } if (searchValue.value) { let str = '' let r = null