diff --git a/front/src/views/capacitySquare/components/algorithm.vue b/front/src/views/capacitySquare/components/algorithm.vue index 9a63f367..e4ef303a 100644 --- a/front/src/views/capacitySquare/components/algorithm.vue +++ b/front/src/views/capacitySquare/components/algorithm.vue @@ -79,6 +79,7 @@ const params = { // 切换领域 const changeAreaFunction = (val) => { + params.pageNum = 1; typeName2.value = val params.area = typeName2.value == '全部' ? '' : typeName2.value; selectFlag2.value = false @@ -160,7 +161,13 @@ const changeDeptType = (str) => { break } params.pageNum = 1; - params.deptType = deptType.value; + if(deptType.value !== null && deptType.value !== undefined) { + params.deptType = deptType.value; + }else { + if(Object.keys(params).includes('deptType')) { + delete params.deptType + } + } } selectFlag.value = false getData(str) @@ -169,7 +176,7 @@ const changeDeptType = (str) => { const getData = (str) => { getGisByArea(params).then((res) => { const resData = res.data.data || {} - if (resData.list.length > 0 && resData.list.length < 9) { + if (resData.list.length > 0 && resData.list.length < 9 && algorithmclassDom) { algorithmclassDom.removeEventListener('scroll', algorithmFunction, true) } dataList.value = resData.list || [] diff --git a/front/src/views/capacitySquare/components/layer.vue b/front/src/views/capacitySquare/components/layer.vue index f7facca0..d7b03a79 100644 --- a/front/src/views/capacitySquare/components/layer.vue +++ b/front/src/views/capacitySquare/components/layer.vue @@ -77,6 +77,7 @@ const params = { // 切换领域 const changeAreaFunction = (val) => { + params.pageNum = 1; typeName2.value = val params.area = typeName2.value == '全部' ? '' : typeName2.value; selectFlag2.value = false @@ -126,7 +127,13 @@ const changeDeptType = (str) => { break } params.pageNum = 1; - params.deptType = deptType.value; + if(deptType.value !== null && deptType.value !== undefined) { + params.deptType = deptType.value; + }else { + if(Object.keys(params).includes('deptType')) { + delete params.deptType + } + } } selectFlag.value = false getData(str) @@ -135,7 +142,7 @@ const changeDeptType = (str) => { const getData = (str) => { getGisByArea(params).then((res) => { const resData = res.data.data || {} - if (resData.list.length > 0 && resData.list.length < 9) { + if (resData.list.length > 0 && resData.list.length < 9 && algorithmclassDom) { algorithmclassDom.removeEventListener('scroll', algorithmFunction, true) } dataList.value = resData.list || []