7d247661 by 杨威
2 parents 1d7a8d7d f326cbb9
......@@ -460,8 +460,8 @@ export default {
//导出文本文件
exportText(){
var self = this;
var BSM = this.zdData.zdbsm;
var type = this.zdData.type;
var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm;
this.queryGeoByBsm(BSM,type,function (features){
if(features && features.length > 0){
var data = features[0];
......@@ -489,8 +489,8 @@ export default {
//导出shp文件
exportToShp(){
var self = this;
var BSM = this.zdData.zdbsm;
var type = this.zdData.type;
var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm;
this.queryGeoByBsm(BSM,type,function (features){
if(features && features.length > 0){
var data = JSON.stringify(features[0]);
......@@ -509,8 +509,8 @@ export default {
//导出excel
exportExcel(){
var self = this;
var BSM = this.zdData.zdbsm;
var type = this.zdData.type;
var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm;
this.queryGeoByBsm(BSM,type,function (features) {
if (features && features.length > 0) {
var data = features[0];
......@@ -549,6 +549,14 @@ export default {
},
//图形定位
postionToMap(){
var type = this.zdData.type;
var BSM = type == 'zdt'? this.zdData.zdbsm : this.zdData.bsm;
if(this.$route.path == "/viewMap"){
//定位到当前空间位置
// TODO 这个方法只是为了支撑功能
this.postionToThisGeo(BSM,type);
return;
}
var curretRouterInfo = {
path:this.$route.path,
query:this.$route.query
......@@ -557,8 +565,8 @@ export default {
this.$router.push({
path: "/viewMap",
query: {
bsm: this.zdData.zdbsm,
type: this.zdData.type ? 'zd' : 'zrz'
bsm: BSM,
type: type
}
});
},
......
......@@ -9,7 +9,7 @@ import {loadModules} from "esri-loader"
import featureUpdate from "@libs/map/featureUpdate";
import arcgisParser from 'terraformer-arcgis-parser'
import wktParse from 'terraformer-wkt-parser'
import {maps} from '@/libs/map/mapUtils'
export default {
data(){
......@@ -158,6 +158,18 @@ export default {
}*/
return arcgisParser.convert(primitive)
},
postionToThisGeo(bsm,type){
var view = maps["testMap"];
var layer = view.map.findLayerById("highlightLayer");
if(layer){
var graphics = layer.graphics;
if(graphics.length > 0 && graphics.items[0].attributes.BSM == bsm){
view.extent = graphics.items[0].geometry.extent;
}
}else {
this.$message.warning("暂无图形信息!!!");
}
},
//导入空间图形是 先判断数据是否跨界
geoJoint(geometry,callBacFunction){
var self = this;
......
......@@ -68,7 +68,8 @@ export default {
},
provide(){
return{
getRightTree: this.getRightTree
getRightTree: this.getRightTree,
getRightTreeByZrzbsm:this.getRightTreeByZrzbsm
}
},
data() {
......
......@@ -56,6 +56,7 @@ import layers from '@/assets/json/layers.json'
import findTask from '@/libs/map/findTask'
export default {
inject:['getRightTree','getRightTreeByZrzbsm'],
components:{
EsriMap,
MapTools
......@@ -75,10 +76,16 @@ export default {
},
mixins:[mapLayerManager,findTask],
mounted(){
var query = this.$route.query;
if(query && JSON.stringify(query) != "{}"){
this.addGeoByBsm(query.bsm,query.type,this.viewId);
}
var query = this.$route.query;
if(query && JSON.stringify(query) != "{}"){
//self.addGeoByBsm(query.bsm,query.type,self.viewId);
if(query.type == 'zd'){
this.getRightTree(query.bsm)
}else if(query.type == 'zrz'){
this.getRightTreeByZrzbsm(query.bsm);
}
}
},
methods:{
addLayer(){
......@@ -108,6 +115,10 @@ export default {
}]
});
view.map.add(mapImageLayer,1);
var query = self.$route.query;
if(query && JSON.stringify(query) != "{}"){
self.addGeoByBsm(query.bsm,query.type,self.viewId);
}
}).catch(err => {
throw(err);
})
......@@ -115,9 +126,14 @@ export default {
//缩放至
toMap(attr){
var self = this;
this.extentToGraphic(attr,this.heighGraphic,this.viewId,function () {
self.heighGraphic = attr;
});
if(attr.geometry){
this.extentToGraphic(attr,this.heighGraphic,this.viewId,function () {
self.heighGraphic = attr;
});
}else {
this.$message.warning("没有图形信息!!")
}
},
//图层选择事件
selectLayerChange(){
......@@ -186,7 +202,7 @@ export default {
delete feature.attributes[key]
}
}
layerResult.features.push(feature);
layerResult[0].features.push(feature);
}else{
if(layer){
this.resultLayers.push({
......
......@@ -56,7 +56,7 @@ export default {
var graphic = features[0];
graphic.symbol = symbol;
layer.add(graphic);
view.center = graphic.geometry.extent.center;
view.extent = graphic.geometry.extent;
}).catch( err => {
thow(err);
})
......@@ -91,8 +91,11 @@ export default {
var symbol = graphicSymbol.fillSymbol.highlightSymbol;
var features = searchResult[i].features;
for(var j = 0;j < features.length;j++){
features[j].symbol = symbol;
layer.add(features[j]);
if(features[j].geometry){
features[j].symbol = symbol;
layer.add(features[j]);
}
}
}
}).catch(err=>{
......@@ -108,7 +111,7 @@ export default {
}
feature.symbol = highlightSymbol;
var view = maps[viewId];
view.center = feature.geometry.type == 'point' ? feature.geometry : feature.geometry.extent.center;
feature.geometry.type == 'point' ?view.center = feature.geometry :view.extent = feature.geometry.extent;
if(callBackFunction && typeof callBackFunction == 'function'){
callBackFunction();
}
......
......@@ -10,7 +10,6 @@
:on-error="uploadError"
:show-file-list="false"
multiple
:limit="3"
:on-exceed="handleExceed"
>
<el-button size="small" type="primary">上传</el-button>
......@@ -157,7 +156,8 @@
},
handleExceed(files, fileList) {
console.log(fileList)
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
// this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
this.$message.warning("上传失败")
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
......