master
lion 3 years ago
parent fdb20d52dc
commit c07b021aec

@ -4,7 +4,7 @@
</template> </template>
<script> <script>
import echarts from 'echarts' import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize' import resize from './mixins/resize'

@ -22,7 +22,8 @@ const CONFIGS = [
// layerType: "TD地图", // layerType: "TD地图",
// opacity: 1, // opacity: 1,
// url: "http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=82526d64e8504a0341f775c087863825" // url: "http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=82526d64e8504a0341f775c087863825"
// }, // },
{ {
title: "水利图", title: "水利图",
id: "S1", id: "S1",
@ -47,12 +48,23 @@ const CONFIGS = [
title: "高清影像", title: "高清影像",
id: "M1", id: "M1",
type: "overlay", type: "overlay",
visible: true, visible: false,
projection: "EPSG:4490", projection: "EPSG:4490",
layerType: "地图", layerType: "地图",
opacity: 1, opacity: 1,
url: "http://192.168.60.22:6080/arcgis/rest/services/szhd/xmqyx4490/MapServer" url: "http://192.168.60.22:6080/arcgis/rest/services/szhd/xmqyx4490/MapServer"
}, },
{
title: "高清影像改版",
id: "M11",
type: "overlay",
visible: true,
projection: "EPSG:4490",
layerType: "地图",
opacity: 1,
url: "http://192.168.60.22:6080/arcgis/rest/services/szhd/yx449010/MapServer"
},
{ {
title: "路网", title: "路网",
id: "L1", id: "L1",

@ -159,7 +159,6 @@
Circle as sCircle Circle as sCircle
} from "ol/style"; } from "ol/style";
import proj4 from 'proj4' import proj4 from 'proj4'
import { import {
@ -204,13 +203,16 @@
id: "H1", id: "H1",
title: "河道图" title: "河道图"
}], }],
checkList: ['M1', 'L1'], checkList: ['M11', 'L1'],
mapCheckList: [{ mapCheckList: [{
id: "M1", id: "M11",
title: "高清影像" title: "高清影像精简"
}, { },{
id: "L1", id: "L1",
title: "路网" title: "路网"
},{
id: "M1",
title: "高清影像"
}], }],
configs: CONFIGS, configs: CONFIGS,
mapConfigs: MAPCONFIGS, mapConfigs: MAPCONFIGS,
@ -241,7 +243,7 @@
code: this.mapConfigs.Map_Code, code: this.mapConfigs.Map_Code,
units: this.mapConfigs.Map_units, units: this.mapConfigs.Map_units,
axisOrientation: this.mapConfigs.Map_axisOrientation, axisOrientation: this.mapConfigs.Map_axisOrientation,
global: this.mapConfigs.Map_global, global: this.mapConfigs.Map_global
}); });
addProjection(this.projection); addProjection(this.projection);
// this.initMap(); // this.initMap();
@ -255,7 +257,7 @@
this.$nextTick(function() { this.$nextTick(function() {
this.showmap = true this.showmap = true
this.showMap = 'M2' this.showMap = 'M2'
this.checkList = ['M1', 'L1'] this.checkList = ['M11', 'L1']
this.showMaps() this.showMaps()
}) })
} }
@ -460,7 +462,6 @@
changeMap(val) { changeMap(val) {
for (var m of this.mapRadioList) { for (var m of this.mapRadioList) {
if (m.id == val) { if (m.id == val) {
console.log("val", val)
this.checkLayers(val, true) this.checkLayers(val, true)
} else { } else {
this.checkLayers(m.id, false) this.checkLayers(m.id, false)
@ -472,32 +473,23 @@
for (var m of this.mapCheckList) { for (var m of this.mapCheckList) {
this.checkLayers(m.id, false) this.checkLayers(m.id, false)
} }
} else if (val.length == this.mapCheckList.length) { } else {
console.log(val) for (var m of this.mapCheckList) {
for (var m of this.mapCheckList) { this.checkLayers(m.id, false)
this.checkLayers(m.id, true) }
} for(var k of val){
} else { this.checkLayers(k, true)
for (var m of this.mapCheckList) { }
if (m.id == val[0]) {
this.checkLayers(m.id, true)
} else {
this.checkLayers(m.id, false)
}
}
} }
}, },
// //
checkLayers(id, bool) { checkLayers(id, bool) {
let layers = this.map.getLayers().getArray(); let layers = this.map.getLayers().getArray();
for (let i = 0; i < layers.length; i++) { for (let i = 0; i < layers.length; i++) {
if (layers[i].get("id") == id) { if (layers[i].get("id") == id) {
if (bool) { if (bool) {
console.log(id)
layers[i].setVisible(true); layers[i].setVisible(true);
} else { } else {
layers[i].setVisible(false); layers[i].setVisible(false);

@ -203,13 +203,16 @@
id: "H1", id: "H1",
title: "河道图" title: "河道图"
}], }],
checkList: ['M1', 'L1'], checkList: ['M11', 'L1'],
mapCheckList: [{ mapCheckList: [{
id: "M1", id: "M11",
title: "高清影像" title: "高清影像精简"
}, { },{
id: "L1", id: "L1",
title: "路网" title: "路网"
},{
id: "M1",
title: "高清影像"
}], }],
configs: CONFIGS, configs: CONFIGS,
mapConfigs: MAPCONFIGS, mapConfigs: MAPCONFIGS,
@ -258,7 +261,7 @@
this.$nextTick(function() { this.$nextTick(function() {
this.showmap = true this.showmap = true
this.showMap = 'M2' this.showMap = 'M2'
this.checkList = ['M1', 'L1'] this.checkList = ['M11', 'L1']
this.showMaps() this.showMaps()
}) })
} }
@ -384,7 +387,8 @@
projection: result.projection projection: result.projection
}), }),
}); });
this.map.addLayer(layer); this.map.addLayer(layer);
} }
} }
@ -489,24 +493,18 @@
} }
}, },
changeCheck(val) { changeCheck(val) {
if (val.length == 0) { if (val.length == 0) {
for (var m of this.mapCheckList) { for (var m of this.mapCheckList) {
this.checkLayers(m.id, false) this.checkLayers(m.id, false)
} }
} else if (val.length == this.mapCheckList.length) { } else {
console.log(val) for (var m of this.mapCheckList) {
for (var m of this.mapCheckList) { this.checkLayers(m.id, false)
this.checkLayers(m.id, true) }
} for(var k of val){
} else { this.checkLayers(k, true)
for (var m of this.mapCheckList) { }
if (m.id == val[0]) { }
this.checkLayers(m.id, true)
} else {
this.checkLayers(m.id, false)
}
}
}
}, },
@ -518,7 +516,6 @@
if (layers[i].get("id") == id) { if (layers[i].get("id") == id) {
if (bool) { if (bool) {
console.log(id)
layers[i].setVisible(true); layers[i].setVisible(true);
} else { } else {
layers[i].setVisible(false); layers[i].setVisible(false);

@ -420,6 +420,8 @@
//reject(error) //reject(error)
}) })
} }
// return
console.log("that.formdetail",that.formdetail)
// return // return
update(that.formdetail).then(response => { update(that.formdetail).then(response => {
this.$Message.success('操作成功'); this.$Message.success('操作成功');

Loading…
Cancel
Save