|
@@ -15,6 +15,7 @@ import * as proj from "ol/proj";
|
|
|
import proj4 from "proj4";
|
|
|
import { register } from "ol/proj/proj4";
|
|
|
import GeometryCollection from 'ol/geom/GeometryCollection.js';
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
proj4.defs(
|
|
|
"EPSG:38572",
|
|
|
"+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs +type=crs"
|
|
@@ -27,6 +28,7 @@ export let mapData = reactive({
|
|
|
point: null,
|
|
|
selectPointArr: [],
|
|
|
isPointHide: null,
|
|
|
+ disabledForm : false
|
|
|
});
|
|
|
|
|
|
function resetMapData(){
|
|
@@ -36,6 +38,7 @@ function resetMapData(){
|
|
|
mapData.point= null
|
|
|
mapData.selectPointArr= []
|
|
|
mapData.isPointHide= null
|
|
|
+ mapData.disabledForm= false
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -109,8 +112,22 @@ class AuthenticMap {
|
|
|
}
|
|
|
});
|
|
|
this.kmap.modifyDraw((e) => {
|
|
|
- mapData.isEditArea = false;
|
|
|
- mapData.isEditArea = true;
|
|
|
+ if(e.type === "pointerdown"){
|
|
|
+ let f = null
|
|
|
+ this.kmap.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
|
|
|
+ f= feature
|
|
|
+ });
|
|
|
+ let res = f.get("id") === mapData.curPointData.id || !f.get("id")
|
|
|
+ if(!res){
|
|
|
+ ElMessage.warning("编辑中")
|
|
|
+ }
|
|
|
+ return res
|
|
|
+ }
|
|
|
+
|
|
|
+ if(e.type === "modifyend"){
|
|
|
+ mapData.isEditArea = false;
|
|
|
+ mapData.isEditArea = true;
|
|
|
+ }
|
|
|
});
|
|
|
this.kmap.addLayer(this.clickPointLayer.layer);
|
|
|
this.kmap.addLayer(this.locationLayer.layer);
|
|
@@ -255,6 +272,14 @@ class AuthenticMap {
|
|
|
addMapSingerClick() {
|
|
|
let that = this;
|
|
|
that.kmap.on("singleclick", (evt) => {
|
|
|
+ if(mapData.curPointData.id && !mapData.disabledForm){
|
|
|
+ ElMessage.warning("编辑中")
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!mapData.curPointData.id && mapData.isEdit){
|
|
|
+ ElMessage.warning("编辑中")
|
|
|
+ return;
|
|
|
+ }
|
|
|
let num = 0;
|
|
|
that.kmap.map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) {
|
|
|
// 点击的图层是否是VectorLayer
|