diff --git a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue index 1e8f2b6..6900505 100644 --- a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue +++ b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue @@ -52,6 +52,7 @@ default: '', }, }, + setup(props, event) { const allData = reactive({ inputText: '', @@ -107,10 +108,6 @@ addWaterLabel(); props.loadCallback && props.loadCallback(); - let { pitch, center } = config.params.init; - pitch && mapBoxSelectPositionMap.map.setPitch(pitch); - center && mapBoxSelectPositionMap.map.setCenter(center); - mapBoxSelectPositionMap.map.load = true; }); }, 200); @@ -268,6 +265,7 @@ watch( () => [props.previousPoint, props.previousPointName], val => { + console.log('val----', val); if (!!val.length) { let initeTimeout = setTimeout(() => { let drewPoint = turf.featureCollection([turf.point(val[0].split(',').map(Number))]); @@ -280,7 +278,8 @@ clearTimeout(initeTimeout); }, 1000); } - } + }, + { immediate: true } ); onMounted(() => { initeMap(); diff --git a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue index 1e8f2b6..6900505 100644 --- a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue +++ b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue @@ -52,6 +52,7 @@ default: '', }, }, + setup(props, event) { const allData = reactive({ inputText: '', @@ -107,10 +108,6 @@ addWaterLabel(); props.loadCallback && props.loadCallback(); - let { pitch, center } = config.params.init; - pitch && mapBoxSelectPositionMap.map.setPitch(pitch); - center && mapBoxSelectPositionMap.map.setCenter(center); - mapBoxSelectPositionMap.map.load = true; }); }, 200); @@ -268,6 +265,7 @@ watch( () => [props.previousPoint, props.previousPointName], val => { + console.log('val----', val); if (!!val.length) { let initeTimeout = setTimeout(() => { let drewPoint = turf.featureCollection([turf.point(val[0].split(',').map(Number))]); @@ -280,7 +278,8 @@ clearTimeout(initeTimeout); }, 1000); } - } + }, + { immediate: true } ); onMounted(() => { initeMap(); diff --git a/src/views/project/projectInformation/index.vue b/src/views/project/projectInformation/index.vue index 793398e..d4fd617 100644 --- a/src/views/project/projectInformation/index.vue +++ b/src/views/project/projectInformation/index.vue @@ -288,7 +288,6 @@ opts.text = optTextMap.get(type); curRow.value = data; curRow.value.analysisUsers1 = data.drainagePartition ? data.drainagePartition.split(',') : []; - bus.emit('getProjectRowData', data); }; const close = type => { diff --git a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue index 1e8f2b6..6900505 100644 --- a/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue +++ b/src/components/mapBoxSelectPosition/mapBoxSelectPosition.vue @@ -52,6 +52,7 @@ default: '', }, }, + setup(props, event) { const allData = reactive({ inputText: '', @@ -107,10 +108,6 @@ addWaterLabel(); props.loadCallback && props.loadCallback(); - let { pitch, center } = config.params.init; - pitch && mapBoxSelectPositionMap.map.setPitch(pitch); - center && mapBoxSelectPositionMap.map.setCenter(center); - mapBoxSelectPositionMap.map.load = true; }); }, 200); @@ -268,6 +265,7 @@ watch( () => [props.previousPoint, props.previousPointName], val => { + console.log('val----', val); if (!!val.length) { let initeTimeout = setTimeout(() => { let drewPoint = turf.featureCollection([turf.point(val[0].split(',').map(Number))]); @@ -280,7 +278,8 @@ clearTimeout(initeTimeout); }, 1000); } - } + }, + { immediate: true } ); onMounted(() => { initeMap(); diff --git a/src/views/project/projectInformation/index.vue b/src/views/project/projectInformation/index.vue index 793398e..d4fd617 100644 --- a/src/views/project/projectInformation/index.vue +++ b/src/views/project/projectInformation/index.vue @@ -288,7 +288,6 @@ opts.text = optTextMap.get(type); curRow.value = data; curRow.value.analysisUsers1 = data.drainagePartition ? data.drainagePartition.split(',') : []; - bus.emit('getProjectRowData', data); }; const close = type => { diff --git a/src/views/project/projectInformation/operate.vue b/src/views/project/projectInformation/operate.vue index 5c6a5d9..ffac2e7 100644 --- a/src/views/project/projectInformation/operate.vue +++ b/src/views/project/projectInformation/operate.vue @@ -655,7 +655,7 @@ const getDetail = async () => { const res = await projectInfoNewById(curRow.id); if (res?.code !== 200) return; - console.log(res.data, 'ressssss'); + console.log(res.data, 'ressssss---------'); previousPoint.value = res.data.projectLocation; previousPointName.value = res.data.projectName; form.time = [res.data.startTime, res.data.endTime]; @@ -869,11 +869,6 @@ getPointPosition.value = e[0]; getPointAddress.value = e[1]; }); - bus.on('getProjectRowData', data => { - form.projectLocation = data.projectLocation; - form.projectAbbreviation = data.projectAbbreviation; - form.projectrange = data.projectrange; - }); }); onBeforeUnmount(() => {