Merge remote-tracking branch 'origin/master'
Showing
4 changed files
with
73 additions
and
54 deletions
| ... | @@ -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,36 +796,7 @@ | ... | @@ -793,36 +796,7 @@ | 
| 793 | type: "error", | 796 | type: "error", | 
| 794 | }); | 797 | }); | 
| 795 | }); | 798 | }); | 
| 796 | //保存到空间库里面 | 799 | this.saveZdGraphicAtrributes(); | 
| 797 | var self = this; | ||
| 798 | for (var key in this.geoAttributes) { | ||
| 799 | if (key == "BSM") { | ||
| 800 | self.geoAttributes[key] = this.$store.state.zdbsm | ||
| 801 | } else if (key == 'QLSDFS') { | ||
| 802 | var qlsdfsList = self.$store.state.qlsdfsList, value = self.formData.qlsdfs; | ||
| 803 | var qlsdfs = qlsdfsList.filter(item => { | ||
| 804 | return item.bsm == value; | ||
| 805 | }) | ||
| 806 | self.geoAttributes[key] = qlsdfs[0] ? qlsdfs[0].mc : ""; | ||
| 807 | } else if(key == 'QLR'){ | ||
| 808 | var qlrTableData = this.$refs.qlrxxModule.tableData; | ||
| 809 | if(qlrTableData.length > 0){ | ||
| 810 | for(var i = 0;i < qlrTableData.length;i++){ | ||
| 811 | if(i = 0){ | ||
| 812 | self.geoAttributes[key] = qlrTableData[i].qlrmc; | ||
| 813 | }else{ | ||
| 814 | self.geoAttributes[key] += ','+ qlrTableData[i].qlrmc; | ||
| 815 | } | ||
| 816 | } | ||
| 817 | } | ||
| 818 | } else { | ||
| 819 | var formKay = key.toLowerCase(); | ||
| 820 | self.geoAttributes[key] = self.formData[formKay]; | ||
| 821 | } | ||
| 822 | } | ||
| 823 | self.updAttributes(this.$store.state.zdbsm, 'zd', this.geoAttributes, function (res) { | ||
| 824 | |||
| 825 | }); | ||
| 826 | } | 800 | } | 
| 827 | } | 801 | } | 
| 828 | } else { | 802 | } else { | 
| ... | @@ -835,6 +809,43 @@ | ... | @@ -835,6 +809,43 @@ | 
| 835 | }) | 809 | }) | 
| 836 | 810 | ||
| 837 | }, | 811 | }, | 
| 812 | //保存空间图形 | ||
| 813 | saveZdGraphicAtrributes(ybsm){ | ||
| 814 | //保存到空间库里面 | ||
| 815 | var self = this; | ||
| 816 | /* var ybsm = null; | ||
| 817 | if(this.ydybsm){ | ||
| 818 | ybsm = this.ydybsm; | ||
| 819 | } */ | ||
| 820 | for (var key in this.geoAttributes) { | ||
| 821 | if (key == "BSM") { | ||
| 822 | self.geoAttributes[key] = this.$store.state.zdbsm | ||
| 823 | } else if (key == 'QLSDFS') { | ||
| 824 | var qlsdfsList = self.$store.state.qlsdfsList, value = self.formData.qlsdfs; | ||
| 825 | var qlsdfs = qlsdfsList.filter(item => { | ||
| 826 | return item.bsm == value; | ||
| 827 | }) | ||
| 828 | self.geoAttributes[key] = qlsdfs[0] ? qlsdfs[0].mc : ""; | ||
| 829 | } else if(key == 'QLR'){ | ||
| 830 | var qlrTableData = this.$refs.qlrxxModule.tableData; | ||
| 831 | if(qlrTableData.length > 0){ | ||
| 832 | for(var i = 0;i < qlrTableData.length;i++){ | ||
| 833 | if(i = 0){ | ||
| 834 | self.geoAttributes[key] = qlrTableData[i].qlrmc; | ||
| 835 | }else{ | ||
| 836 | self.geoAttributes[key] += ','+ qlrTableData[i].qlrmc; | ||
| 837 | } | ||
| 838 | } | ||
| 839 | } | ||
| 840 | } else { | ||
| 841 | var formKay = key.toLowerCase(); | ||
| 842 | self.geoAttributes[key] = self.formData[formKay]; | ||
| 843 | } | ||
| 844 | } | ||
| 845 | self.updAttributes(this.$store.state.zdbsm, 'zd', this.geoAttributes, function (res) { | ||
| 846 | |||
| 847 | },ybsm); | ||
| 848 | }, | ||
| 838 | inputBlur(e) { | 849 | inputBlur(e) { | 
| 839 | if (e.target.value != '') { | 850 | if (e.target.value != '') { | 
| 840 | e.target.style.border = "" | 851 | e.target.style.border = "" | ... | ... | 
| ... | @@ -567,24 +567,7 @@ | ... | @@ -567,24 +567,7 @@ | 
| 567 | this.loading=false; | 567 | this.loading=false; | 
| 568 | }) | 568 | }) | 
| 569 | this.loading=false; | 569 | this.loading=false; | 
| 570 | 570 | this.saveGraphicAttributes(); } | |
| 571 | //保存到空间库里面 | ||
| 572 | var self = this; | ||
| 573 | for(var key in this.geoAttributes){ | ||
| 574 | if(key == "BSM"){ | ||
| 575 | self.geoAttributes[key] = this.bsm | ||
| 576 | }else if(key == 'JGRQ'){ | ||
| 577 | var formKay = key.toLowerCase(); | ||
| 578 | self.geoAttributes[key] = new Date(self.form[formKay]).getTime(); | ||
| 579 | }else { | ||
| 580 | var formKay = key.toLowerCase(); | ||
| 581 | self.geoAttributes[key] = self.form[formKay]; | ||
| 582 | } | ||
| 583 | } | ||
| 584 | self.updAttributes(this.bsm,'zrz',this.geoAttributes,function (res) { | ||
| 585 | console.log("属性保存完成!!"); | ||
| 586 | }); | ||
| 587 | } | ||
| 588 | }else{ | 571 | }else{ | 
| 589 | this.$message({ | 572 | this.$message({ | 
| 590 | // message: item.name+'不能为空', | 573 | // message: item.name+'不能为空', | 
| ... | @@ -594,6 +577,25 @@ | ... | @@ -594,6 +577,25 @@ | 
| 594 | } | 577 | } | 
| 595 | }) | 578 | }) | 
| 596 | }, | 579 | }, | 
| 580 | //保存空间信息 | ||
| 581 | saveGraphicAttributes(ybsm){ | ||
| 582 | //保存到空间库里面 | ||
| 583 | var self = this; | ||
| 584 | for(var key in this.geoAttributes){ | ||
| 585 | if(key == "BSM"){ | ||
| 586 | self.geoAttributes[key] = this.bsm | ||
| 587 | }else if(key == 'JGRQ'){ | ||
| 588 | var formKay = key.toLowerCase(); | ||
| 589 | self.geoAttributes[key] = new Date(self.form[formKay]).getTime(); | ||
| 590 | }else { | ||
| 591 | var formKay = key.toLowerCase(); | ||
| 592 | self.geoAttributes[key] = self.form[formKay]; | ||
| 593 | } | ||
| 594 | } | ||
| 595 | self.updAttributes(this.bsm,'zrz',this.geoAttributes,function (res) { | ||
| 596 | console.log("属性保存完成!!"); | ||
| 597 | },ybsm); | ||
| 598 | }, | ||
| 597 | onSubmit(){ | 599 | onSubmit(){ | 
| 598 | let data={ | 600 | let data={ | 
| 599 | glbsm:this.bsm, | 601 | glbsm:this.bsm, | 
| ... | @@ -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 | } | ... | ... | 
- 
Please register or sign in to post a comment