From 46ad5e747d79730648c889cdb4a45cc268595950 Mon Sep 17 00:00:00 2001 From: guoyue Date: Wed, 26 Oct 2022 20:28:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=97=E6=B3=95=E5=B9=BF=E5=9C=BA=E5=92=8Cgi?= =?UTF-8?q?s=E5=B9=BF=E5=9C=BA=20=E4=BC=A0=E5=8F=82=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/capacitySquare/components/algorithm.vue | 11 +++++++++-- front/src/views/capacitySquare/components/layer.vue | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) 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 || []