2aac5d3d by 杨威
2 parents e8a7d7e8 f142be6b
......@@ -608,7 +608,7 @@ export default {
exportText(){
var self = this;
var type = this.zdData.type;
var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm;
var BSM = type == 'zd'? this.zdData.zdbsm : this.zdData.bsm;
this.queryGeoByBsm(BSM,type,function (features){
if(features && features.length > 0 && features[0].geometry.rings.length > 0){
var data = features[0];
......@@ -637,7 +637,7 @@ export default {
exportToShp(){
var self = this;
var type = this.zdData.type;
var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm;
var BSM = type == 'zd'? this.zdData.zdbsm : this.zdData.bsm;
this.queryGeoByBsm(BSM,type,function (features){
if(features && features.length > 0 && features[0].geometry.rings.length > 0) {
var data = JSON.stringify(features[0]);
......@@ -656,7 +656,7 @@ export default {
exportExcel(){
var self = this;
var type = this.zdData.type;
var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm;
var BSM = type == 'zd'? this.zdData.zdbsm : this.zdData.bsm;
this.queryGeoByBsm(BSM,type,function (features) {
if (features && features.length > 0 && features[0].geometry.rings.length > 0) {
var data = features[0];
......@@ -696,7 +696,7 @@ export default {
//图形定位
postionToMap(){
var type = this.zdData.type;
var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm;
var BSM = type == 'zd'? this.zdData.zdbsm : this.zdData.bsm;
if(this.$route.path == "/viewMap"){
//定位到当前空间位置
// TODO 这个方法只是为了支撑功能
......
......@@ -223,7 +223,7 @@ export default {
})
},
//保存或者编辑属性信息
updAttributes(bsm,type,attributes,callBackFunction){
updAttributes(bsm,type,attributes,callBackFunction,ydybsm){
var layer = null;
if(type == 'zd'){
layer = this.getLayerByName("ZDJBXX");
......@@ -232,7 +232,7 @@ export default {
}
var featureUrl = layer.layerUrl.replace("MapServer","FeatureServer");
featureUrl += "/"+layer.id;
this.queryGeoByBsm(bsm,type,function (features) {
this.queryGeoByBsm(ydybsm ? ydybsm:bsm,type,function (features) {
if(features && features.length > 0){
attributes.OBJECTID = features[0].attributes.OBJECTID;
features[0].attributes = attributes;
......@@ -240,6 +240,9 @@ export default {
features[0].geometry.spatialReference = {
wkt:wkt
}*/
if(ydybsm){
features[0].attributes.BSM = ydybsm;
}
featureUpdate.methods.updateGraphic(featureUrl,features[0],callBackFunction);
}else{
var graphic = {
......
......@@ -183,25 +183,25 @@
switch (row.dylx) {
case "zd":
this.$store.state.zdbsm = row.glbsm;
this.getRightTree(row.glbsm,'1');
this.getRightTree(row.glbsm,'0,1,2');
break;
case "zrz":
this.$store.state.zrzbsm = row.glbsm;
this.getTreeByBsm(row.glbsm,row.dylx,'1');
this.getTreeByBsm(row.glbsm,row.dylx,'0,1,2');
break;
case "h":
case "h0":
case "h1":
this.$store.state.hbsm = row.glbsm;
this.getTreeByBsm(row.glbsm,'h','1');
this.getTreeByBsm(row.glbsm,'h','0,1,2');
break;
case "dz":
this.$store.state.dzbsm = row.glbsm;
this.getTreeByBsm(row.glbsm,row.dylx,'1');
this.getTreeByBsm(row.glbsm,row.dylx,'0,1,2');
break;
case "gzw":
this.$store.state.dzbsm = row.glbsm;
this.getTreeByBsm(row.glbsm,row.dylx,'1');
this.getTreeByBsm(row.glbsm,row.dylx,'0,1,2');
break;
default:
......
......@@ -556,6 +556,9 @@
//权利性质数据传给子组件
this.$refs.qlxzModule.countList = res.result.list;
})
if(res.result.ydybsm){
this.saveZdGraphicAtrributes(res.result.ydybsm);
}
} else {
this.$nextTick(() => {
//权利性质数据传给子组件
......@@ -790,8 +793,27 @@
vm.loadingHide();
console.log(error);
});
this.saveZdGraphicAtrributes();
}
}
} else {
this.$message({
// message: item.name+'不能为空',
message: '请完善表单后再继续操作',
type: "warning",
});
}
})
},
//保存空间图形
saveZdGraphicAtrributes(ybsm){
//保存到空间库里面
var self = this;
/* var ybsm = null;
if(this.ydybsm){
ybsm = this.ydybsm;
} */
for (var key in this.geoAttributes) {
if (key == "BSM") {
self.geoAttributes[key] = this.$store.state.zdbsm
......@@ -819,18 +841,7 @@
}
self.updAttributes(this.$store.state.zdbsm, 'zd', this.geoAttributes, function (res) {
});
}
}
} else {
this.$message({
// message: item.name+'不能为空',
message: '请完善表单后再继续操作',
type: "warning",
});
}
})
},ybsm);
},
inputBlur(e) {
if (e.target.value != '') {
......
......@@ -567,7 +567,18 @@
this.loading=false;
})
this.loading=false;
this.saveGraphicAttributes(); }
}else{
this.$message({
// message: item.name+'不能为空',
message: '请完善表单后再继续操作',
type: "warning",
});
}
})
},
//保存空间信息
saveGraphicAttributes(ybsm){
//保存到空间库里面
var self = this;
for(var key in this.geoAttributes){
......@@ -583,16 +594,7 @@
}
self.updAttributes(this.bsm,'zrz',this.geoAttributes,function (res) {
console.log("属性保存完成!!");
});
}
}else{
this.$message({
// message: item.name+'不能为空',
message: '请完善表单后再继续操作',
type: "warning",
});
}
})
},ybsm);
},
onSubmit(){
let data={
......@@ -664,6 +666,9 @@
getZrzDetailByBsm(data).then((res)=>{
if(res.code===200){
this.form=res.result;
if(res.result.ydybsm){
this.saveGraphicAttributes(res.result.ydybsm);
}
if(res.result.gygyqlrqk!=null){
this.$refs.qlrxxModule.changeGyfs(res.result.gygyqlrqk);
}
......