gis前端excel上传图形功能
Showing
2 changed files
with
26 additions
and
2 deletions
... | @@ -149,9 +149,33 @@ export default { | ... | @@ -149,9 +149,33 @@ export default { |
149 | debugger | 149 | debugger |
150 | }, | 150 | }, |
151 | excelFileSuccess(response, file, fileList){ | 151 | excelFileSuccess(response, file, fileList){ |
152 | var self = this; | ||
152 | if(response.success){ | 153 | if(response.success){ |
153 | var result = response.result; | 154 | var result = response.result; |
154 | 155 | var points = []; | |
156 | for(var i = 0;i < result.length;i++){ | ||
157 | var point = []; | ||
158 | point[0] = parseFloat(result[i].x); | ||
159 | point[1] = parseFloat(result[i].y); | ||
160 | points.push(point); | ||
161 | } | ||
162 | var wkt = "PROJCS[\"XADFZBX\",GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",0.0],PARAMETER[\"False_Northing\",0.0],PARAMETER[\"Central_Meridian\",0.0],PARAMETER[\"Scale_Factor\",1.0],PARAMETER[\"Latitude_Of_Origin\",0.0],UNIT[\"Meter\",1.0]]"; | ||
163 | var geometry = { | ||
164 | rings:[[points]], | ||
165 | spatialReference:{ | ||
166 | wkt:wkt | ||
167 | }, | ||
168 | type:"polygon" | ||
169 | } | ||
170 | var graphic = { | ||
171 | attributes:null, | ||
172 | geometry:geometry | ||
173 | } | ||
174 | if(self.propertyInfo.type == "zd"){ | ||
175 | self.saveZd(graphic); | ||
176 | }else{ | ||
177 | self.saveZRZ(graphic); | ||
178 | } | ||
155 | }else{ | 179 | }else{ |
156 | this.$message.warning(response.message); | 180 | this.$message.warning(response.message); |
157 | } | 181 | } | ... | ... |
... | @@ -171,7 +171,7 @@ | ... | @@ -171,7 +171,7 @@ |
171 | }, | 171 | }, |
172 | methods: { | 172 | methods: { |
173 | getData(bsm) { | 173 | getData(bsm) { |
174 | queryjzd(bsm).then(res => { | 174 | queryjzd({glBsm:bsm}).then(res => { |
175 | for (let i = 0; i < res.result.length; i++) { | 175 | for (let i = 0; i < res.result.length; i++) { |
176 | res.result[i]['isCheck'] = false; | 176 | res.result[i]['isCheck'] = false; |
177 | res.result[i]['iszb'] = 'readonly'; | 177 | res.result[i]['iszb'] = 'readonly'; | ... | ... |
-
Please register or sign in to post a comment