f8ad8093 by 杨威

范围属性变更后 宗地 自然幢空间信息更新

1 parent a1edea74
...@@ -608,7 +608,7 @@ export default { ...@@ -608,7 +608,7 @@ export default {
608 exportText(){ 608 exportText(){
609 var self = this; 609 var self = this;
610 var type = this.zdData.type; 610 var type = this.zdData.type;
611 var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm; 611 var BSM = type == 'zd'? this.zdData.zdbsm : this.zdData.bsm;
612 this.queryGeoByBsm(BSM,type,function (features){ 612 this.queryGeoByBsm(BSM,type,function (features){
613 if(features && features.length > 0 && features[0].geometry.rings.length > 0){ 613 if(features && features.length > 0 && features[0].geometry.rings.length > 0){
614 var data = features[0]; 614 var data = features[0];
...@@ -637,7 +637,7 @@ export default { ...@@ -637,7 +637,7 @@ export default {
637 exportToShp(){ 637 exportToShp(){
638 var self = this; 638 var self = this;
639 var type = this.zdData.type; 639 var type = this.zdData.type;
640 var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm; 640 var BSM = type == 'zd'? this.zdData.zdbsm : this.zdData.bsm;
641 this.queryGeoByBsm(BSM,type,function (features){ 641 this.queryGeoByBsm(BSM,type,function (features){
642 if(features && features.length > 0 && features[0].geometry.rings.length > 0) { 642 if(features && features.length > 0 && features[0].geometry.rings.length > 0) {
643 var data = JSON.stringify(features[0]); 643 var data = JSON.stringify(features[0]);
...@@ -656,7 +656,7 @@ export default { ...@@ -656,7 +656,7 @@ export default {
656 exportExcel(){ 656 exportExcel(){
657 var self = this; 657 var self = this;
658 var type = this.zdData.type; 658 var type = this.zdData.type;
659 var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm; 659 var BSM = type == 'zd'? this.zdData.zdbsm : this.zdData.bsm;
660 this.queryGeoByBsm(BSM,type,function (features) { 660 this.queryGeoByBsm(BSM,type,function (features) {
661 if (features && features.length > 0 && features[0].geometry.rings.length > 0) { 661 if (features && features.length > 0 && features[0].geometry.rings.length > 0) {
662 var data = features[0]; 662 var data = features[0];
...@@ -696,7 +696,7 @@ export default { ...@@ -696,7 +696,7 @@ export default {
696 //图形定位 696 //图形定位
697 postionToMap(){ 697 postionToMap(){
698 var type = this.zdData.type; 698 var type = this.zdData.type;
699 var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm; 699 var BSM = type == 'zd'? this.zdData.zdbsm : this.zdData.bsm;
700 if(this.$route.path == "/viewMap"){ 700 if(this.$route.path == "/viewMap"){
701 //定位到当前空间位置 701 //定位到当前空间位置
702 // TODO 这个方法只是为了支撑功能 702 // TODO 这个方法只是为了支撑功能
......
...@@ -223,7 +223,7 @@ export default { ...@@ -223,7 +223,7 @@ export default {
223 }) 223 })
224 }, 224 },
225 //保存或者编辑属性信息 225 //保存或者编辑属性信息
226 updAttributes(bsm,type,attributes,callBackFunction){ 226 updAttributes(bsm,type,attributes,callBackFunction,ydybsm){
227 var layer = null; 227 var layer = null;
228 if(type == 'zd'){ 228 if(type == 'zd'){
229 layer = this.getLayerByName("ZDJBXX"); 229 layer = this.getLayerByName("ZDJBXX");
...@@ -232,7 +232,7 @@ export default { ...@@ -232,7 +232,7 @@ export default {
232 } 232 }
233 var featureUrl = layer.layerUrl.replace("MapServer","FeatureServer"); 233 var featureUrl = layer.layerUrl.replace("MapServer","FeatureServer");
234 featureUrl += "/"+layer.id; 234 featureUrl += "/"+layer.id;
235 this.queryGeoByBsm(bsm,type,function (features) { 235 this.queryGeoByBsm(ydybsm ? ydybsm:bsm,type,function (features) {
236 if(features && features.length > 0){ 236 if(features && features.length > 0){
237 attributes.OBJECTID = features[0].attributes.OBJECTID; 237 attributes.OBJECTID = features[0].attributes.OBJECTID;
238 features[0].attributes = attributes; 238 features[0].attributes = attributes;
...@@ -240,6 +240,9 @@ export default { ...@@ -240,6 +240,9 @@ export default {
240 features[0].geometry.spatialReference = { 240 features[0].geometry.spatialReference = {
241 wkt:wkt 241 wkt:wkt
242 }*/ 242 }*/
243 if(ydybsm){
244 features[0].attributes.BSM = ydybsm;
245 }
243 featureUpdate.methods.updateGraphic(featureUrl,features[0],callBackFunction); 246 featureUpdate.methods.updateGraphic(featureUrl,features[0],callBackFunction);
244 }else{ 247 }else{
245 var graphic = { 248 var graphic = {
......
...@@ -556,6 +556,9 @@ ...@@ -556,6 +556,9 @@
556 //权利性质数据传给子组件 556 //权利性质数据传给子组件
557 this.$refs.qlxzModule.countList = res.result.list; 557 this.$refs.qlxzModule.countList = res.result.list;
558 }) 558 })
559 if(res.result.ydybsm){
560 this.saveZdGraphicAtrributes(res.result.ydybsm);
561 }
559 } else { 562 } else {
560 this.$nextTick(() => { 563 this.$nextTick(() => {
561 //权利性质数据传给子组件 564 //权利性质数据传给子组件
...@@ -793,8 +796,27 @@ ...@@ -793,8 +796,27 @@
793 type: "error", 796 type: "error",
794 }); 797 });
795 }); 798 });
799 this.saveZdGraphicAtrributes();
800 }
801 }
802 } else {
803 this.$message({
804 // message: item.name+'不能为空',
805 message: '请完善表单后再继续操作',
806 type: "warning",
807 });
808 }
809 })
810
811 },
812 //保存空间图形
813 saveZdGraphicAtrributes(ybsm){
796 //保存到空间库里面 814 //保存到空间库里面
797 var self = this; 815 var self = this;
816 /* var ybsm = null;
817 if(this.ydybsm){
818 ybsm = this.ydybsm;
819 } */
798 for (var key in this.geoAttributes) { 820 for (var key in this.geoAttributes) {
799 if (key == "BSM") { 821 if (key == "BSM") {
800 self.geoAttributes[key] = this.$store.state.zdbsm 822 self.geoAttributes[key] = this.$store.state.zdbsm
...@@ -822,18 +844,7 @@ ...@@ -822,18 +844,7 @@
822 } 844 }
823 self.updAttributes(this.$store.state.zdbsm, 'zd', this.geoAttributes, function (res) { 845 self.updAttributes(this.$store.state.zdbsm, 'zd', this.geoAttributes, function (res) {
824 846
825 }); 847 },ybsm);
826 }
827 }
828 } else {
829 this.$message({
830 // message: item.name+'不能为空',
831 message: '请完善表单后再继续操作',
832 type: "warning",
833 });
834 }
835 })
836
837 }, 848 },
838 inputBlur(e) { 849 inputBlur(e) {
839 if (e.target.value != '') { 850 if (e.target.value != '') {
......
...@@ -567,7 +567,18 @@ ...@@ -567,7 +567,18 @@
567 this.loading=false; 567 this.loading=false;
568 }) 568 })
569 this.loading=false; 569 this.loading=false;
570 570 this.saveGraphicAttributes(); }
571 }else{
572 this.$message({
573 // message: item.name+'不能为空',
574 message: '请完善表单后再继续操作',
575 type: "warning",
576 });
577 }
578 })
579 },
580 //保存空间信息
581 saveGraphicAttributes(ybsm){
571 //保存到空间库里面 582 //保存到空间库里面
572 var self = this; 583 var self = this;
573 for(var key in this.geoAttributes){ 584 for(var key in this.geoAttributes){
...@@ -583,16 +594,7 @@ ...@@ -583,16 +594,7 @@
583 } 594 }
584 self.updAttributes(this.bsm,'zrz',this.geoAttributes,function (res) { 595 self.updAttributes(this.bsm,'zrz',this.geoAttributes,function (res) {
585 console.log("属性保存完成!!"); 596 console.log("属性保存完成!!");
586 }); 597 },ybsm);
587 }
588 }else{
589 this.$message({
590 // message: item.name+'不能为空',
591 message: '请完善表单后再继续操作',
592 type: "warning",
593 });
594 }
595 })
596 }, 598 },
597 onSubmit(){ 599 onSubmit(){
598 let data={ 600 let data={
...@@ -664,6 +666,9 @@ ...@@ -664,6 +666,9 @@
664 getZrzDetailByBsm(data).then((res)=>{ 666 getZrzDetailByBsm(data).then((res)=>{
665 if(res.code===200){ 667 if(res.code===200){
666 this.form=res.result; 668 this.form=res.result;
669 if(res.result.ydybsm){
670 this.saveGraphicAttributes(res.result.ydybsm);
671 }
667 if(res.result.gygyqlrqk!=null){ 672 if(res.result.gygyqlrqk!=null){
668 this.$refs.qlrxxModule.changeGyfs(res.result.gygyqlrqk); 673 this.$refs.qlrxxModule.changeGyfs(res.result.gygyqlrqk);
669 } 674 }
......