From 06be21e909e2bd681e5604810968cfd31e3aff4c Mon Sep 17 00:00:00 2001 From: liyuchen <791867849@qq.com> Date: Tue, 25 Apr 2023 16:15:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E7=BB=84=E4=BB=B6-liyuchen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/form/index.vue | 13 --- src/components/table/DisasterTable.vue | 120 +++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 13 deletions(-) delete mode 100644 src/components/form/index.vue create mode 100644 src/components/table/DisasterTable.vue diff --git a/src/components/form/index.vue b/src/components/form/index.vue deleted file mode 100644 index c0547b1..0000000 --- a/src/components/form/index.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/table/DisasterTable.vue b/src/components/table/DisasterTable.vue new file mode 100644 index 0000000..17e5fd7 --- /dev/null +++ b/src/components/table/DisasterTable.vue @@ -0,0 +1,120 @@ + + + + + + \ No newline at end of file From f30a3ff7dcfb2ed40d7489c987cd220e4c393aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=97=8B?= <723607471@qq.com> Date: Tue, 25 Apr 2023 17:21:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Map.vue | 15 ++++++++++++- src/utils/request.js | 2 +- .../responseManagement/userResponse/index.vue | 21 ++++++++++++------- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/components/Map.vue b/src/components/Map.vue index 69608f1..0751013 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -59,6 +59,10 @@ onMounted(() => { const mapOperations = { wktParseToMap: (res) => { let layer = omnivore.wkt.parse(res) + if(featureLayerG_area.getLayers().length != 0||featureLayerG_point.getLayers().length != 0){ + + return; + } layer.addTo(featureLayerG_point) let attr = Object.values(layer._layers) @@ -66,9 +70,12 @@ const mapOperations = { // 判断审核的数据类型,如果是点则直接flyTo if (attr[0].feature.geometry.type.indexOf('Polygon') == -1) { homeMap.flyTo([attr[0].feature.geometry.coordinates[1], attr[0].feature.geometry.coordinates[0]], 3) + variableStore.layerGroupPoint=res; + return {'layer':layer,'location':[attr[0].feature.geometry.coordinates[1],attr[0].feature.geometry.coordinates[0]]} } // 判断审核的数据类型,如果是面则计算中心点 然后再fly else { + variableStore.layerGroupPoly=res; let polygons = []; for (let i = 0; i < attr[0].feature.geometry.coordinates.length; i++) { console.log(attr[0].feature.geometry.coordinates[i]) @@ -83,8 +90,9 @@ const mapOperations = { let final_center = turf.center(turf.featureCollection(features)) // console.log(final_center) homeMap.flyTo([final_center.geometry.coordinates[1], final_center.geometry.coordinates[0]], 3) + return {'layer':layer,'location':null} } - return layer + // return layer }, /** 添加点标注 @@ -313,6 +321,11 @@ const mapOperations = { }) e.layer.addTo(featureLayerG_area) polygon = e.layer + let features = featureLayerG_area.toGeoJSON().features + variableStore.layerGroupPoly = features.map(function (feature) { + return WKT.convert(feature.geometry) + }) + variableStore.layerGroupPoly = variableStore.layerGroupPoly.join('\n') }) // featureLayerG_area.clearLayers() // variableStore.layerGroupPoly=null; diff --git a/src/utils/request.js b/src/utils/request.js index 23898cb..68714cd 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -4,7 +4,7 @@ import qs from 'qs'; import { Session } from '/@/utils/storage'; // export const moduleName = 'zqq-biz-vordm'; -export const moduleName = 'biz-vordm'; +export const moduleName = 'glj-biz-vordm'; export const crawlModule = 'vordm-crawl'; // 配置新建一个 axios 实例 const service = axios.create({ diff --git a/src/views/responseManagement/userResponse/index.vue b/src/views/responseManagement/userResponse/index.vue index c44ee4d..d23c27d 100644 --- a/src/views/responseManagement/userResponse/index.vue +++ b/src/views/responseManagement/userResponse/index.vue @@ -111,7 +111,7 @@ - + Point Area @@ -238,7 +238,10 @@ const onOpenEditRole = (type, row) => { if(state.wktPoint_Poly){ mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly) } - state.wktPoint_Poly= mapRef.value.mapOperations.wktParseToMap(row.geometry) + let wkt=mapRef.value.mapOperations.wktParseToMap(row.geometry) + state.wktPoint_Poly= wkt.layer + console.log(wkt.location) + changelatlon(wkt.location[0],wkt.location[1]); // mapRef.value.mapOperations.on("click", (res)=>{ // mapRef.value.mapOperations.clearPolygon() // mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly) @@ -251,7 +254,7 @@ const mapEvents = (ev)=>{ if(ev == '1'){ // mapRef.value.mapOperations.clearPolygon() mapRef.value.mapOperations.on("click", mapClick) - mapRef.value.mapOperations.on("mousemove", changelatlon) + // mapRef.value.mapOperations.on("mousemove", changelatlon) mapRef.value.mapOperations.clearPolygon() }else if(ev == '2'){ @@ -275,8 +278,8 @@ const ClearSubmit = () => { } const mapClick=(res)=>{ mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly ) - changelatlon(res); - state.wktPoint_Poly=mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3)) + changelatlon(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3)); + mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3)) // console.log(state.wktPoint_Poly) } const reviews = (index) => { @@ -307,10 +310,12 @@ const onHandleCurrentChange = (val) => { state.tableData.param.pageNum = val; getTableData(); }; -const changelatlon = (e) => { +const changelatlon = (lat,lon) => { //深拷贝e - state.dislat = e.latlng.lat.toFixed(3); - state.dislon= e.latlng.lng.toFixed(3); + // state.dislat = e.latlng.lat.toFixed(3); + // state.dislon= e.latlng.lng.toFixed(3); + state.dislat = lat; + state.dislon= lon; // if (state.lon < 0) { // state.lon = state.lon + 360; // }