算法广场和gis广场 传参参数更改

This commit is contained in:
guoyue 2022-10-26 20:28:58 +08:00
parent 5132d3ec60
commit 46ad5e747d
2 changed files with 18 additions and 4 deletions

View File

@ -79,6 +79,7 @@ const params = {
// //
const changeAreaFunction = (val) => { const changeAreaFunction = (val) => {
params.pageNum = 1;
typeName2.value = val typeName2.value = val
params.area = typeName2.value == '全部' ? '' : typeName2.value; params.area = typeName2.value == '全部' ? '' : typeName2.value;
selectFlag2.value = false selectFlag2.value = false
@ -160,7 +161,13 @@ const changeDeptType = (str) => {
break break
} }
params.pageNum = 1; 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 selectFlag.value = false
getData(str) getData(str)
@ -169,7 +176,7 @@ const changeDeptType = (str) => {
const getData = (str) => { const getData = (str) => {
getGisByArea(params).then((res) => { getGisByArea(params).then((res) => {
const resData = res.data.data || {} 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) algorithmclassDom.removeEventListener('scroll', algorithmFunction, true)
} }
dataList.value = resData.list || [] dataList.value = resData.list || []

View File

@ -77,6 +77,7 @@ const params = {
// //
const changeAreaFunction = (val) => { const changeAreaFunction = (val) => {
params.pageNum = 1;
typeName2.value = val typeName2.value = val
params.area = typeName2.value == '全部' ? '' : typeName2.value; params.area = typeName2.value == '全部' ? '' : typeName2.value;
selectFlag2.value = false selectFlag2.value = false
@ -126,7 +127,13 @@ const changeDeptType = (str) => {
break break
} }
params.pageNum = 1; 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 selectFlag.value = false
getData(str) getData(str)
@ -135,7 +142,7 @@ const changeDeptType = (str) => {
const getData = (str) => { const getData = (str) => {
getGisByArea(params).then((res) => { getGisByArea(params).then((res) => {
const resData = res.data.data || {} 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) algorithmclassDom.removeEventListener('scroll', algorithmFunction, true)
} }
dataList.value = resData.list || [] dataList.value = resData.list || []