diff --git a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue index 9facb6d..1e8f2b6 100644 --- a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue +++ b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue @@ -106,22 +106,10 @@ addWaterLabel(); props.loadCallback && props.loadCallback(); - if (props.previousPoint && props.previousPointName) { - let drewPoint = turf.featureCollection([turf.point(props.previousPoint.split(',').map(Number))]); - drewPoint.features[0].properties.name = props.previousPointName; - addPointToMap(drewPoint); - map.easeTo({ - center: props.previousPoint.split(',').map(Number), - zoom: 14, - }); - } else { - let timeout = setTimeout(() => { - let { pitch, center } = config.params.init; - pitch && mapBoxSelectPositionMap.map.setPitch(pitch); - center && mapBoxSelectPositionMap.map.setCenter(center); - clearTimeout(timeout); - }, 1000); - } + + let { pitch, center } = config.params.init; + pitch && mapBoxSelectPositionMap.map.setPitch(pitch); + center && mapBoxSelectPositionMap.map.setCenter(center); mapBoxSelectPositionMap.map.load = true; }); @@ -277,12 +265,28 @@ map.getSource('drewPoint').setData(geojson); } }; + watch( + () => [props.previousPoint, props.previousPointName], + val => { + if (!!val.length) { + let initeTimeout = setTimeout(() => { + let drewPoint = turf.featureCollection([turf.point(val[0].split(',').map(Number))]); + drewPoint.features[0].properties.name = val[1]; + addPointToMap(drewPoint); + map.easeTo({ + center: val[0].split(',').map(Number), + zoom: 14, + }); + clearTimeout(initeTimeout); + }, 1000); + } + } + ); onMounted(() => { initeMap(); nextTick(() => { allData.inputShow = props.isNeedInput; }); - console.log(props.previousPoint, props.previousPointName); }); onBeforeUnmount(() => { diff --git a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue index 9facb6d..1e8f2b6 100644 --- a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue +++ b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue @@ -106,22 +106,10 @@ addWaterLabel(); props.loadCallback && props.loadCallback(); - if (props.previousPoint && props.previousPointName) { - let drewPoint = turf.featureCollection([turf.point(props.previousPoint.split(',').map(Number))]); - drewPoint.features[0].properties.name = props.previousPointName; - addPointToMap(drewPoint); - map.easeTo({ - center: props.previousPoint.split(',').map(Number), - zoom: 14, - }); - } else { - let timeout = setTimeout(() => { - let { pitch, center } = config.params.init; - pitch && mapBoxSelectPositionMap.map.setPitch(pitch); - center && mapBoxSelectPositionMap.map.setCenter(center); - clearTimeout(timeout); - }, 1000); - } + + let { pitch, center } = config.params.init; + pitch && mapBoxSelectPositionMap.map.setPitch(pitch); + center && mapBoxSelectPositionMap.map.setCenter(center); mapBoxSelectPositionMap.map.load = true; }); @@ -277,12 +265,28 @@ map.getSource('drewPoint').setData(geojson); } }; + watch( + () => [props.previousPoint, props.previousPointName], + val => { + if (!!val.length) { + let initeTimeout = setTimeout(() => { + let drewPoint = turf.featureCollection([turf.point(val[0].split(',').map(Number))]); + drewPoint.features[0].properties.name = val[1]; + addPointToMap(drewPoint); + map.easeTo({ + center: val[0].split(',').map(Number), + zoom: 14, + }); + clearTimeout(initeTimeout); + }, 1000); + } + } + ); onMounted(() => { initeMap(); nextTick(() => { allData.inputShow = props.isNeedInput; }); - console.log(props.previousPoint, props.previousPointName); }); onBeforeUnmount(() => { diff --git a/src/views/autoLogin/index.vue b/src/views/autoLogin/index.vue index 298085d..ab472df 100644 --- a/src/views/autoLogin/index.vue +++ b/src/views/autoLogin/index.vue @@ -23,10 +23,10 @@ permissionStore.generateRoutes(); router.push({ path: '/chengguanweiScreen' }); } else { - router.push('/door'); + router.push('/chengguanweiScreen'); } } else { - router.push('/door'); + router.push('/chengguanweiScreen'); } }) .catch(error => { diff --git a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue index 9facb6d..1e8f2b6 100644 --- a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue +++ b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue @@ -106,22 +106,10 @@ addWaterLabel(); props.loadCallback && props.loadCallback(); - if (props.previousPoint && props.previousPointName) { - let drewPoint = turf.featureCollection([turf.point(props.previousPoint.split(',').map(Number))]); - drewPoint.features[0].properties.name = props.previousPointName; - addPointToMap(drewPoint); - map.easeTo({ - center: props.previousPoint.split(',').map(Number), - zoom: 14, - }); - } else { - let timeout = setTimeout(() => { - let { pitch, center } = config.params.init; - pitch && mapBoxSelectPositionMap.map.setPitch(pitch); - center && mapBoxSelectPositionMap.map.setCenter(center); - clearTimeout(timeout); - }, 1000); - } + + let { pitch, center } = config.params.init; + pitch && mapBoxSelectPositionMap.map.setPitch(pitch); + center && mapBoxSelectPositionMap.map.setCenter(center); mapBoxSelectPositionMap.map.load = true; }); @@ -277,12 +265,28 @@ map.getSource('drewPoint').setData(geojson); } }; + watch( + () => [props.previousPoint, props.previousPointName], + val => { + if (!!val.length) { + let initeTimeout = setTimeout(() => { + let drewPoint = turf.featureCollection([turf.point(val[0].split(',').map(Number))]); + drewPoint.features[0].properties.name = val[1]; + addPointToMap(drewPoint); + map.easeTo({ + center: val[0].split(',').map(Number), + zoom: 14, + }); + clearTimeout(initeTimeout); + }, 1000); + } + } + ); onMounted(() => { initeMap(); nextTick(() => { allData.inputShow = props.isNeedInput; }); - console.log(props.previousPoint, props.previousPointName); }); onBeforeUnmount(() => { diff --git a/src/views/autoLogin/index.vue b/src/views/autoLogin/index.vue index 298085d..ab472df 100644 --- a/src/views/autoLogin/index.vue +++ b/src/views/autoLogin/index.vue @@ -23,10 +23,10 @@ permissionStore.generateRoutes(); router.push({ path: '/chengguanweiScreen' }); } else { - router.push('/door'); + router.push('/chengguanweiScreen'); } } else { - router.push('/door'); + router.push('/chengguanweiScreen'); } }) .catch(error => { diff --git a/src/views/longoPeration/Patrolmanagement/inspectiontasks.vue b/src/views/longoPeration/Patrolmanagement/inspectiontasks.vue index a715836..e980b33 100644 --- a/src/views/longoPeration/Patrolmanagement/inspectiontasks.vue +++ b/src/views/longoPeration/Patrolmanagement/inspectiontasks.vue @@ -115,7 +115,7 @@ - + - + + +