新排序

This commit is contained in:
a0049873 2022-08-15 16:47:33 +08:00
parent 0b972d7bb9
commit e50dc1ad1f
1 changed files with 56 additions and 3 deletions

View File

@ -843,7 +843,7 @@
const currentPageSize = ref(5) const currentPageSize = ref(5)
const pageSizeOptions = ref(['5', '10', '20', '50']) const pageSizeOptions = ref(['5', '10', '20', '50'])
const router = useRouter() 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 select2 = router.currentRoute.value.query.select
const str = router.currentRoute.value.query.str const str = router.currentRoute.value.query.str
const searchValue = ref(str) const searchValue = ref(str)
@ -868,7 +868,7 @@
type: Cardsname.value, type: Cardsname.value,
name: '', name: '',
infoList: [], infoList: [],
orderField: 'visits', // total visits 访 applyCount score collectCount orderField: '', // total visits 访 applyCount score collectCount
orderType: 'DESC', // ASC DESC orderType: 'DESC', // ASC DESC
} }
//西 //西
@ -973,7 +973,7 @@
paramsGetResources.name = '' paramsGetResources.name = ''
paramsGetResources.shareCondition = '' paramsGetResources.shareCondition = ''
paramsGetResources.infoList = [] paramsGetResources.infoList = []
paramsGetResources.orderField = 'total' paramsGetResources.orderField = ''
paramsGetResources.orderType = 'DESC' paramsGetResources.orderType = 'DESC'
mybus.emit('chongzhi') mybus.emit('chongzhi')
getAppResources() getAppResources()
@ -1129,6 +1129,59 @@
if (!globalFlag.value) { if (!globalFlag.value) {
globalData.data = [] 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) { if (searchValue.value) {
let str = '' let str = ''
let r = null let r = null