ffe684e2 by 杨威
2 parents 98fe80fa b588a832
......@@ -7,5 +7,20 @@
"layerName": "ZRZ",
"layerUrl": "http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id": "10"
},
{
"layerName": "DJQ",
"layerUrl": "http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id": "13"
},
{
"layerName": "DJZQ",
"layerUrl": "http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id": "14"
},
{
"layerName": "XJZQ",
"layerUrl": "http://192.168.2.201:6080/arcgis/rest/services/%E4%BA%92%E8%81%94%E7%BD%91%E5%8A%A0%E4%B8%8D%E5%8A%A8%E4%BA%A7/XA_%E4%B8%8D%E5%8A%A8%E4%BA%A7/MapServer",
"id": "19"
}
]
\ No newline at end of file
......
......@@ -196,11 +196,19 @@ export default {
attributes:self.currentClickZd,
geometry:geometry
}
self.geoJoint(geometry,function (isJoint,message) {
if(isJoint){
self.$message.warning(message)
return;
}else {
if(self.propertyInfo.type == "zd"){
self.saveZd(graphic);
}else{
self.saveZRZ(graphic);
}
}
});
} else {
console.log('error submit!!');
return false;
......
......@@ -4,6 +4,7 @@
import layers from '@/assets/json/layers.json'
import queryUtils from "@libs/map/queryUtils";
import identifyUtils from '@/libs/map/IdentifyUtils'
import {loadModules} from "esri-loader"
import arcgisParser from 'terraformer-arcgis-parser'
import wktParse from 'terraformer-wkt-parser'
......@@ -155,6 +156,54 @@ export default {
primitive.type = "Polygon"
}*/
return arcgisParser.convert(primitive)
},
//导入空间图形是 先判断数据是否跨界
geoJoint(geometry,callBacFunction){
var self = this;
loadModules([
"esri/geometry/geometryEngine",
"esri/geometry/Polygon"
]).then(([
geometryEngine,
Polygon
]) => {
var djqLayer = null,djzqLayer = null,xjzqLayer = null;
djqLayer = self.getLayerByName("DJQ");
djzqLayer = self.getLayerByName("DJZQ");
xjzqLayer = self.getLayerByName("XJZQ");
var layerIds = [];
layerIds.push(djqLayer.id);
layerIds.push(djzqLayer.id);
layerIds.push(xjzqLayer.id);
var polygon = new Polygon(geometry);
identifyUtils.methods.identify(djqLayer.layerUrl,layerIds,polygon,function (res) {
var results = res.results;
var isJoint = false,layerName = "",message="";
if(!results || results.length == 0){
callBacFunction(true,"不在行政区内,请检查空间位置信息!!!");
}
for(var i = 0;i < results.length;i++){
var feature = results[i].feature;
var flag = geometryEngine.disjoint(polygon,feature.geometry);
if(flag){
isJoint = true;
layerName = results[i].layerName;
switch (layerName) {
case 'DJQ':message = "地块跨越地籍区,数据不合法!!!";break;
case 'DJZQ':message = "地块跨越地籍子区,数据不合法!!!";break;
case 'XJZQ':message = "地块跨越行政区,数据不合法!!!";break;
}
break
}
}
if(callBacFunction && typeof callBacFunction == "function"){
callBacFunction(isJoint,message);
}
})
}).catch(err => {
console.log(err);
throw (err);
})
}
}
......
......@@ -15,12 +15,15 @@ export default {
var identifyTask = new IdentifyTask({
url:url
}),
identifyParameters = new identifyParameters();
identifyParameters = new IdentifyParameters();
identifyParameters.geometry = geometry;
if(layerIds){
identifyParameters.layerIds = layerIds;
}
identifyParameters.layerOption = "all";
identifyParameters.tolerance = 3;
identifyParameters.mapExtent = geometry.extent;
identifyParameters.returnGeometry = true;
identifyParameters.spatialReference = geometry.spatialReference;
identifyTask.execute(identifyParameters).then(result => {
if(callBackFunction && typeof callBackFunction == 'function'){
......
......@@ -135,7 +135,13 @@
default:
break;
}
this.$router.push(path);
this.$router.push({
path: path,
query: {
bsm: row.glbsm,
source: 2
}
});
},
},
computed: {},
......
......@@ -372,7 +372,7 @@
return {
tabName: 'zd',
centerDialogVisible: false,
bgqData: [],
zdFgqData: [],
hbhData: {},
fgBoxWidth: 0,
xzq: [],
......@@ -462,10 +462,10 @@
},
addData: function (val) {
this.centerDialogVisible = false;
this.bgqData.push(val)
this.zdFgqData.push(val)
},
getData: function (data) {
this.bgqData.push(data)
this.zdFgqData.push(data)
},
},
computed: {},
......
......@@ -8,6 +8,7 @@
:before-remove="beforeRemove"
:on-success="uploadSuccess"
:on-error="uploadError"
:show-file-list="false"
multiple
:limit="3"
:on-exceed="handleExceed"
......@@ -107,7 +108,6 @@
},
uploadSuccess(res, file, fileList) {
this.filesData.list = res.result;
console.log(res, "res=========")
insertFile(this.filesData).then(res => {
if (res.success) {
Message.success("上传成功")
......