2d24799b by 杨威
2 parents e484a9c9 1f374220
...@@ -23,7 +23,15 @@ ...@@ -23,7 +23,15 @@
23 "color": "#f50325", 23 "color": "#f50325",
24 "width": 1 24 "width": 1
25 } 25 }
26 },
27 "importSymbol": {
28 "type": "simple-fill",
29 "color": [ 245,3, 37, 0.4 ],
30 "style": "none",
31 "outline": {
32 "color": "#006cff",
33 "width": 2
34 }
26 } 35 }
27
28 } 36 }
29 } 37 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -101,7 +101,8 @@ ...@@ -101,7 +101,8 @@
101 <li v-show="zdData.type == 'zdy'" @click="deleteZdy">删除</li> 101 <li v-show="zdData.type == 'zdy'" @click="deleteZdy">删除</li>
102 </ul> 102 </ul>
103 103
104 <el-dialog title="导入图形" :visible.sync="improtDialog"> 104 <!--@close="closeImportDialog"-->
105 <el-dialog title="导入图形" :modal="false" :close-on-click-modal="false" custom-class="importDialog" :visible.sync="improtDialog" width="30%" @close="closeImportDialog">
105 <import-geo :property-info="zdData" :timeLine="new Date().getTime()" :geo-info="currentClickZdGeo" @closeImportDialog="closeImportDialog"></import-geo> 106 <import-geo :property-info="zdData" :timeLine="new Date().getTime()" :geo-info="currentClickZdGeo" @closeImportDialog="closeImportDialog"></import-geo>
106 </el-dialog> 107 </el-dialog>
107 <!-- 添加定着物弹框 --> 108 <!-- 添加定着物弹框 -->
...@@ -432,6 +433,7 @@ export default { ...@@ -432,6 +433,7 @@ export default {
432 }else { 433 }else {
433 BSM = this.zdData.bsm; 434 BSM = this.zdData.bsm;
434 } 435 }
436 //当确定导入图形是 跳转到图形界面
435 this.queryGeoByBsm(BSM,type,function (features){ 437 this.queryGeoByBsm(BSM,type,function (features){
436 if(features && features.length > 0){ 438 if(features && features.length > 0){
437 if(features[0].geometry){ 439 if(features[0].geometry){
...@@ -440,6 +442,7 @@ export default { ...@@ -440,6 +442,7 @@ export default {
440 cancelButtonText: '取消', 442 cancelButtonText: '取消',
441 type: 'warning' 443 type: 'warning'
442 }).then(() => { 444 }).then(() => {
445 self.postionToMap();
443 self.improtDialog = true; 446 self.improtDialog = true;
444 self.currentClickZdGeo = features[0]; 447 self.currentClickZdGeo = features[0];
445 }).catch(() => { 448 }).catch(() => {
...@@ -449,11 +452,13 @@ export default { ...@@ -449,11 +452,13 @@ export default {
449 }); 452 });
450 }); 453 });
451 }else { 454 }else {
455 self.postionToMap();
452 self.currentClickZdGeo = features[0]; 456 self.currentClickZdGeo = features[0];
453 self.improtDialog = true; 457 self.improtDialog = true;
454 } 458 }
455 459
456 }else{ 460 }else{
461 self.postionToMap();
457 self.currentClickZdGeo = null; 462 self.currentClickZdGeo = null;
458 self.improtDialog = true; 463 self.improtDialog = true;
459 } 464 }
...@@ -502,7 +507,6 @@ export default { ...@@ -502,7 +507,6 @@ export default {
502 }).then(res => { 507 }).then(res => {
503 debugger 508 debugger
504 });*/ 509 });*/
505
506 }else{ 510 }else{
507 self.$message.warning("暂无空间信息!!!!"); 511 self.$message.warning("暂无空间信息!!!!");
508 } 512 }
...@@ -576,6 +580,7 @@ export default { ...@@ -576,6 +580,7 @@ export default {
576 //关闭图形弹框 580 //关闭图形弹框
577 closeImportDialog(){ 581 closeImportDialog(){
578 this.improtDialog = false; 582 this.improtDialog = false;
583 this.clearOverLayer();
579 } 584 }
580 585
581 }, 586 },
...@@ -724,4 +729,8 @@ export default { ...@@ -724,4 +729,8 @@ export default {
724 center; 729 center;
725 background-size: contain; 730 background-size: contain;
726 } 731 }
732 /deep/ .importDialog{
733 margin-top: 120px!important;
734 margin-left: 291px;
735 }
727 </style> 736 </style>
......
...@@ -37,20 +37,18 @@ ...@@ -37,20 +37,18 @@
37 MapView, 37 MapView,
38 esriMap 38 esriMap
39 ]) => { 39 ]) => {
40 var map = new esriMap({ 40 //
41 basemap:"hybrid" 41 var map = new esriMap();
42 });
43 //108.95 34.27 42 //108.95 34.27
44 var view = new MapView({ 43 var view = new MapView({
45 container: self.viewId, 44 container: self.viewId,
46 map: map, 45 map: map,
47 zoom:10, 46 zoom:10,
48 zoom:10, 47 center: [-0.154133333770497,0.6138183594020817],
49 center: [-0.154133333770497,0.6138183594020817], 48 spatialReference: {
50 spatialReference: { 49 wkid: 102100
51 wkid: 102100 50 }
52 } 51 });
53 });
54 maps[self.viewId] = view; 52 maps[self.viewId] = view;
55 if(self.afterLoaderFunction && typeof self.afterLoaderFunction == 'function'){ 53 if(self.afterLoaderFunction && typeof self.afterLoaderFunction == 'function'){
56 self.afterLoaderFunction(view); 54 self.afterLoaderFunction(view);
......
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
24 identifyParameters.tolerance = tolerance ? tolerance : 3; 24 identifyParameters.tolerance = tolerance ? tolerance : 3;
25 identifyParameters.mapExtent = mapExtent ? mapExtent : geometry.extent; 25 identifyParameters.mapExtent = mapExtent ? mapExtent : geometry.extent;
26 identifyParameters.returnGeometry = returnGeometry ? returnGeometry : false; 26 identifyParameters.returnGeometry = returnGeometry ? returnGeometry : false;
27 //identifyParameters.returnFieldName = false; 27 //identifyParameters.returnFieldName = true;
28 identifyParameters.spatialReference = geometry.spatialReference; 28 identifyParameters.spatialReference = geometry.spatialReference;
29 identifyTask.execute(identifyParameters).then(result => { 29 identifyTask.execute(identifyParameters).then(result => {
30 if(callBackFunction && typeof callBackFunction == 'function'){ 30 if(callBackFunction && typeof callBackFunction == 'function'){
......
...@@ -22,20 +22,29 @@ export default { ...@@ -22,20 +22,29 @@ export default {
22 var featureLayer = new FeatureLayer({ 22 var featureLayer = new FeatureLayer({
23 url:url 23 url:url
24 }) 24 })
25 var geo = null; 25 var saveGraphics = [];
26 if(graphic.geometry.type == 'point'){ 26 if(!Array.isArray(graphic)){
27 geo = new Point(graphic.geometry); 27 graphic = [graphic];
28 }else if(graphic.geometry.type == 'polyline'){ 28 }
29 geo = new Polyline(graphic.geometry); 29 for(var i = 0;i < graphic.length;i++){
30 }else if(graphic.geometry.type == 'polygon'){ 30 var geo = null;
31 geo = new Polygon(graphic.geometry); 31 if(!graphic[i].geometry){
32 geo = null;
33 }else if(graphic[i].geometry.type == 'point'){
34 geo = new Point(graphic[i].geometry);
35 }else if(graphic[i].geometry.type == 'polyline'){
36 geo = new Polyline(graphic[i].geometry);
37 }else if(graphic[i].geometry.type == 'polygon'){
38 geo = new Polygon(graphic[i].geometry);
39 }
40 var saveGraphic = new Graphic({
41 attributes:graphic[i].attributes,
42 geometry:geo
43 });
44 saveGraphics.push(saveGraphic);
32 } 45 }
33 var saveGraphic = new Graphic({
34 attributes:graphic.attributes,
35 geometry:geo
36 });
37 featureLayer.applyEdits({ 46 featureLayer.applyEdits({
38 addFeatures:[saveGraphic] 47 addFeatures:saveGraphics
39 }).then(function (res){ 48 }).then(function (res){
40 if(callBackFunction && typeof callBackFunction == 'function'){ 49 if(callBackFunction && typeof callBackFunction == 'function'){
41 callBackFunction(res); 50 callBackFunction(res);
...@@ -62,20 +71,30 @@ export default { ...@@ -62,20 +71,30 @@ export default {
62 var featureLayer = new FeatureLayer({ 71 var featureLayer = new FeatureLayer({
63 url:url 72 url:url
64 }) 73 })
65 var geo = null; 74 var updGraphics = [];
66 if(graphic.geometry.type == 'point'){ 75 if(!Array.isArray(graphic)){
67 geo = new Point(graphic.geometry); 76 graphic = [graphic];
68 }else if(graphic.geometry.type == 'polyline'){ 77 }
69 geo = new Polyline(graphic.geometry); 78 for(var i = 0;i < graphic.length;i++){
70 }else if(graphic.geometry.type == 'polygon'){ 79 var geo = null;
71 geo = new Polygon(graphic.geometry); 80 if(!graphic[i].geometry){
81 geo = new Polygon();
82 }else if(graphic[i].geometry.type == 'point'){
83 geo = new Point(graphic[i].geometry);
84 }else if(graphic[i].geometry.type == 'polyline'){
85 geo = new Polyline(graphic[i].geometry);
86 }else if(graphic[i].geometry.type == 'polygon'){
87 geo = new Polygon(graphic[i].geometry);
88 }
89 var updGraphic = new Graphic({
90 attributes:graphic[i].attributes,
91 geometry:geo
92 });
93 updGraphics.push(updGraphic);
72 } 94 }
73 var updGraphic = new Graphic({ 95
74 attributes:graphic.attributes,
75 geometry:geo
76 });
77 featureLayer.applyEdits({ 96 featureLayer.applyEdits({
78 updateFeatures:[updGraphic] 97 updateFeatures:updGraphics
79 }).then(function (res){ 98 }).then(function (res){
80 if(callBackFunction && typeof callBackFunction == 'function'){ 99 if(callBackFunction && typeof callBackFunction == 'function'){
81 callBackFunction(res); 100 callBackFunction(res);
...@@ -102,21 +121,31 @@ export default { ...@@ -102,21 +121,31 @@ export default {
102 var featureLayer = new FeatureLayer({ 121 var featureLayer = new FeatureLayer({
103 url:url 122 url:url
104 }) 123 })
105 var geo = null; 124 var delGraphics = [];
106 if(graphic.geometry.type == 'point'){ 125 if(!Array.isArray(graphic)){
107 geo = new Point(graphic.geometry); 126 graphic = [graphic];
108 }else if(graphic.geometry.type == 'polyline'){ 127 }
109 geo = new Polyline(graphic.geometry); 128 for(var i = 0;i < graphic.length;i++){
110 }else if(graphic.geometry.type == 'polygon'){ 129 var geo = null;
111 geo = new Polygon(graphic.geometry); 130 if(!graphic[i].geometry){
131 geo = null;
132 }else if(graphic[i].geometry.type == 'point'){
133 geo = new Point(graphic[i].geometry);
134 }else if(graphic[i].geometry.type == 'polyline'){
135 geo = new Polyline(graphic[i].geometry);
136 }else if(graphic[i].geometry.type == 'polygon'){
137 geo = new Polygon(graphic[i].geometry);
138 }
139 var delGraphic = new Graphic({
140 attributes:graphic[i].attributes,
141 geometry:geo
142 });
143 delGraphics.push(delGraphic);
112 } 144 }
113 var delGraphic = new Graphic({ 145
114 attributes:graphic.attributes,
115 geometry:geo
116 });
117 146
118 featureLayer.applyEdits({ 147 featureLayer.applyEdits({
119 deleteFeatures:[delGraphic] 148 deleteFeatures:delGraphics
120 }).then(function (res){ 149 }).then(function (res){
121 if(callBackFunction && typeof callBackFunction == 'function'){ 150 if(callBackFunction && typeof callBackFunction == 'function'){
122 callBackFunction(res); 151 callBackFunction(res);
......
...@@ -28,7 +28,7 @@ export default{ ...@@ -28,7 +28,7 @@ export default{
28 where += " and "; 28 where += " and ";
29 } 29 }
30 if(Array.isArray(parames[i].value)){ 30 if(Array.isArray(parames[i].value)){
31 where += parames[i].name + " in (" + parames[i].value.toString + ")"; 31 where += parames[i].name + " in (" + parames[i].value.toString() + ")";
32 }else if(typeof parames[i].value == 'number'){ 32 }else if(typeof parames[i].value == 'number'){
33 where += parames[i].name + " =" + parames[i].value ; 33 where += parames[i].name + " =" + parames[i].value ;
34 }else{ 34 }else{
......
...@@ -169,6 +169,8 @@ export default { ...@@ -169,6 +169,8 @@ export default {
169 this.getRightTreeByZrzbsm(this.$store.state.zrzbsm); 169 this.getRightTreeByZrzbsm(this.$store.state.zrzbsm);
170 }else if(newPath == "/dz"){ 170 }else if(newPath == "/dz"){
171 this.getRightTreeByDzbsm(this.$store.state.dzbsm); 171 this.getRightTreeByDzbsm(this.$store.state.dzbsm);
172 }else if(newPath == "/h"){
173 this.getRightTreeByHbsm(this.$store.state.hbsm);
172 } else if(newPath == "/viewMap"){ 174 } else if(newPath == "/viewMap"){
173 this.isMap = true; 175 this.isMap = true;
174 if(this.$route.query.type == "zd"){ 176 if(this.$route.query.type == "zd"){
...@@ -329,6 +331,14 @@ export default { ...@@ -329,6 +331,14 @@ export default {
329 }); 331 });
330 }, 332 },
331 333
334 getRightTreeByHbsm(bsm) {
335 getTreeByBsm(bsm,"h").then((res) => {
336 if (res.success) {
337 this.pd = res.result;
338 }
339 });
340 },
341
332 sortNavigation(data, selectId) { 342 sortNavigation(data, selectId) {
333 let headTop = this.headTop; 343 let headTop = this.headTop;
334 data.forEach((item, index) => { 344 data.forEach((item, index) => {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
6 :data="tableData" 6 :data="tableData"
7 :height="tableHeight" 7 :height="tableHeight"
8 :row-class-name="tableRowClassName" 8 :row-class-name="tableRowClassName"
9 @row-dblclick="doubleClick"
9 > 10 >
10 <el-table-column type="index" width="80" align="center" label="序号"> 11 <el-table-column type="index" width="80" align="center" label="序号">
11 </el-table-column> 12 </el-table-column>
...@@ -81,6 +82,9 @@ ...@@ -81,6 +82,9 @@
81 methods: { 82 methods: {
82 onSubmit() { 83 onSubmit() {
83 }, 84 },
85 doubleClick(row, column, event){
86 this.handleClick(row);
87 },
84 tableRowClassName({row, rowIndex}) { 88 tableRowClassName({row, rowIndex}) {
85 if (rowIndex % 2 !== 0) { 89 if (rowIndex % 2 !== 0) {
86 return "even-row"; 90 return "even-row";
......
...@@ -76,15 +76,20 @@ export default { ...@@ -76,15 +76,20 @@ export default {
76 }, 76 },
77 mixins:[mapLayerManager,findTask], 77 mixins:[mapLayerManager,findTask],
78 mounted(){ 78 mounted(){
79 var query = this.$route.query; 79
80 if(query && JSON.stringify(query) != "{}"){ 80 var query = this.$route.query
81 //self.addGeoByBsm(query.bsm,query.type,self.viewId); 81 var self = this;
82 if(query.type == 'zd'){ 82 setTimeout(function () {
83 this.getRightTree(query.bsm) 83 if(query && JSON.stringify(query) != "{}"){
84 }else if(query.type == 'zrz'){ 84 //self.addGeoByBsm(query.bsm,query.type,self.viewId);
85 this.getRightTreeByZrzbsm(query.bsm); 85 if(query.type == 'zd'){
86 self.getRightTree(query.bsm)
87 }else if(query.type == 'zrz'){
88 self.getRightTreeByZrzbsm(query.bsm);
89 }
86 } 90 }
87 } 91 },500);
92
88 93
89 }, 94 },
90 methods:{ 95 methods:{
...@@ -94,8 +99,10 @@ export default { ...@@ -94,8 +99,10 @@ export default {
94 view.ui.remove('zoom'); 99 view.ui.remove('zoom');
95 loadModules([ 100 loadModules([
96 "esri/layers/MapImageLayer", 101 "esri/layers/MapImageLayer",
102 "esri/geometry/Extent"
97 ]).then(([ 103 ]).then(([
98 MapImageLayer, 104 MapImageLayer,
105 Extent
99 ])=>{ 106 ])=>{
100 var mapImageLayer = new MapImageLayer({ 107 var mapImageLayer = new MapImageLayer({
101 url:self.layerUrl, 108 url:self.layerUrl,
...@@ -115,6 +122,13 @@ export default { ...@@ -115,6 +122,13 @@ export default {
115 }] 122 }]
116 }); 123 });
117 view.map.add(mapImageLayer,1); 124 view.map.add(mapImageLayer,1);
125 mapImageLayer.when(function () {
126 var extent = new Extent(JSON.parse(JSON.stringify(mapImageLayer.fullExtent)))
127 extent.spatialReference = view.spatialReference;
128 view.center = extent.center;
129 view.zoom = 15;
130 // view.extent = mapImageLayer.fullExtent;
131 });
118 var query = self.$route.query; 132 var query = self.$route.query;
119 if(query && JSON.stringify(query) != "{}"){ 133 if(query && JSON.stringify(query) != "{}"){
120 self.addGeoByBsm(query.bsm,query.type,self.viewId); 134 self.addGeoByBsm(query.bsm,query.type,self.viewId);
...@@ -137,9 +151,11 @@ export default { ...@@ -137,9 +151,11 @@ export default {
137 }, 151 },
138 //图层选择事件 152 //图层选择事件
139 selectLayerChange(){ 153 selectLayerChange(){
154 debugger
140 var self = this; 155 var self = this;
156 this.features = [];
141 var layerAndResult = this.results.filter(function (item) { 157 var layerAndResult = this.results.filter(function (item) {
142 return item.layerId = self.selectResLayerId; 158 return item.layerId == self.selectResLayerId;
143 }) 159 })
144 if(layerAndResult){ 160 if(layerAndResult){
145 this.features = layerAndResult[0].features; 161 this.features = layerAndResult[0].features;
......
...@@ -79,12 +79,12 @@ export default { ...@@ -79,12 +79,12 @@ export default {
79 return; 79 return;
80 } 80 }
81 for(var i = 0;i < searchResult.length;i++){ 81 for(var i = 0;i < searchResult.length;i++){
82 var layer = view.map.findLayerById("searchResult"+searchResult.layerName); 82 var layer = view.map.findLayerById("searchResult"+searchResult[i].layerId);
83 if(layer){ 83 if(layer){
84 layer.removeAll(); 84 layer.removeAll();
85 }else{ 85 }else{
86 layer = new GraphicsLayer({ 86 layer = new GraphicsLayer({
87 id:"searchResult"+searchResult.layerName 87 id:"searchResult"+searchResult[i].layerId
88 }) 88 })
89 view.map.add(layer); 89 view.map.add(layer);
90 } 90 }
......