2aac5d3d by 杨威
2 parents e8a7d7e8 f142be6b
...@@ -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 = {
......
...@@ -183,25 +183,25 @@ ...@@ -183,25 +183,25 @@
183 switch (row.dylx) { 183 switch (row.dylx) {
184 case "zd": 184 case "zd":
185 this.$store.state.zdbsm = row.glbsm; 185 this.$store.state.zdbsm = row.glbsm;
186 this.getRightTree(row.glbsm,'1'); 186 this.getRightTree(row.glbsm,'0,1,2');
187 break; 187 break;
188 case "zrz": 188 case "zrz":
189 this.$store.state.zrzbsm = row.glbsm; 189 this.$store.state.zrzbsm = row.glbsm;
190 this.getTreeByBsm(row.glbsm,row.dylx,'1'); 190 this.getTreeByBsm(row.glbsm,row.dylx,'0,1,2');
191 break; 191 break;
192 case "h": 192 case "h":
193 case "h0": 193 case "h0":
194 case "h1": 194 case "h1":
195 this.$store.state.hbsm = row.glbsm; 195 this.$store.state.hbsm = row.glbsm;
196 this.getTreeByBsm(row.glbsm,'h','1'); 196 this.getTreeByBsm(row.glbsm,'h','0,1,2');
197 break; 197 break;
198 case "dz": 198 case "dz":
199 this.$store.state.dzbsm = row.glbsm; 199 this.$store.state.dzbsm = row.glbsm;
200 this.getTreeByBsm(row.glbsm,row.dylx,'1'); 200 this.getTreeByBsm(row.glbsm,row.dylx,'0,1,2');
201 break; 201 break;
202 case "gzw": 202 case "gzw":
203 this.$store.state.dzbsm = row.glbsm; 203 this.$store.state.dzbsm = row.glbsm;
204 this.getTreeByBsm(row.glbsm,row.dylx,'1'); 204 this.getTreeByBsm(row.glbsm,row.dylx,'0,1,2');
205 break; 205 break;
206 206
207 default: 207 default:
......
...@@ -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 //权利性质数据传给子组件
...@@ -790,36 +793,7 @@ ...@@ -790,36 +793,7 @@
790 vm.loadingHide(); 793 vm.loadingHide();
791 console.log(error); 794 console.log(error);
792 }); 795 });
793 //保存到空间库里面 796 this.saveZdGraphicAtrributes();
794 var self = this;
795 for (var key in this.geoAttributes) {
796 if (key == "BSM") {
797 self.geoAttributes[key] = this.$store.state.zdbsm
798 } else if (key == 'QLSDFS') {
799 var qlsdfsList = self.$store.state.qlsdfsList, value = self.formData.qlsdfs;
800 var qlsdfs = qlsdfsList.filter(item => {
801 return item.bsm == value;
802 })
803 self.geoAttributes[key] = qlsdfs[0] ? qlsdfs[0].mc : "";
804 } else if(key == 'QLR'){
805 var qlrTableData = this.$refs.qlrxxModule.tableData;
806 if(qlrTableData.length > 0){
807 for(var i = 0;i < qlrTableData.length;i++){
808 if(i = 0){
809 self.geoAttributes[key] = qlrTableData[i].qlrmc;
810 }else{
811 self.geoAttributes[key] += ','+ qlrTableData[i].qlrmc;
812 }
813 }
814 }
815 } else {
816 var formKay = key.toLowerCase();
817 self.geoAttributes[key] = self.formData[formKay];
818 }
819 }
820 self.updAttributes(this.$store.state.zdbsm, 'zd', this.geoAttributes, function (res) {
821
822 });
823 } 797 }
824 } 798 }
825 } else { 799 } else {
...@@ -832,6 +806,43 @@ ...@@ -832,6 +806,43 @@
832 }) 806 })
833 807
834 }, 808 },
809 //保存空间图形
810 saveZdGraphicAtrributes(ybsm){
811 //保存到空间库里面
812 var self = this;
813 /* var ybsm = null;
814 if(this.ydybsm){
815 ybsm = this.ydybsm;
816 } */
817 for (var key in this.geoAttributes) {
818 if (key == "BSM") {
819 self.geoAttributes[key] = this.$store.state.zdbsm
820 } else if (key == 'QLSDFS') {
821 var qlsdfsList = self.$store.state.qlsdfsList, value = self.formData.qlsdfs;
822 var qlsdfs = qlsdfsList.filter(item => {
823 return item.bsm == value;
824 })
825 self.geoAttributes[key] = qlsdfs[0] ? qlsdfs[0].mc : "";
826 } else if(key == 'QLR'){
827 var qlrTableData = this.$refs.qlrxxModule.tableData;
828 if(qlrTableData.length > 0){
829 for(var i = 0;i < qlrTableData.length;i++){
830 if(i = 0){
831 self.geoAttributes[key] = qlrTableData[i].qlrmc;
832 }else{
833 self.geoAttributes[key] += ','+ qlrTableData[i].qlrmc;
834 }
835 }
836 }
837 } else {
838 var formKay = key.toLowerCase();
839 self.geoAttributes[key] = self.formData[formKay];
840 }
841 }
842 self.updAttributes(this.$store.state.zdbsm, 'zd', this.geoAttributes, function (res) {
843
844 },ybsm);
845 },
835 inputBlur(e) { 846 inputBlur(e) {
836 if (e.target.value != '') { 847 if (e.target.value != '') {
837 e.target.style.border = "" 848 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 }
......