|
@@ -91,16 +91,8 @@
|
|
|
placeholder="请选择"
|
|
|
class="select"
|
|
|
v-model="zycxData.query.layerName"
|
|
|
- @change="
|
|
|
- (v) => {
|
|
|
- zycxData.query.layersData.filter((item) => {
|
|
|
- if (v === item.value) {
|
|
|
- zycxData.query.currLayerConfig = item;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- "
|
|
|
clearable
|
|
|
+ @change="handleSxChange"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in zycxData.query.layersData"
|
|
@@ -518,7 +510,6 @@
|
|
|
<div class="select_box">
|
|
|
<Select
|
|
|
v-model="layIndex"
|
|
|
- clearable
|
|
|
style="width: 200px"
|
|
|
@on-change="selectChange"
|
|
|
>
|
|
@@ -1000,6 +991,7 @@ export default {
|
|
|
this.featureOverlayData.show = true;
|
|
|
//判断图层是否开启
|
|
|
let layerConfing = this.getLayerConfigById(currLayerConfig.serverId);
|
|
|
+
|
|
|
if (!layerConfing.visible) {
|
|
|
this.openLayer(currLayerConfig.serverId);
|
|
|
}
|
|
@@ -1015,7 +1007,9 @@ export default {
|
|
|
},
|
|
|
//属性和空间查询
|
|
|
sxsbSearch() {
|
|
|
+
|
|
|
if (this.zycx == "sx") {
|
|
|
+ this.closeAllLayersExceptBaseLayers(this.zycxData.query.layerName);
|
|
|
let params = new FormData();
|
|
|
if (this.validateField_sxquery()) return;
|
|
|
params.append("tableName", this.zycxData.query.layerName);
|
|
@@ -1062,6 +1056,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
+ this.closeAllLayersExceptBaseLayers(this.zycxData.query.layersName);
|
|
|
let params = new FormData();
|
|
|
if (this.validataField_kj_sx_sxquery()) return;
|
|
|
params.append("tableName", this.zycxData.query.layersName.join(","));
|
|
@@ -1211,6 +1206,14 @@ export default {
|
|
|
this.locationMaskFeatureWhere(id, where, layers);
|
|
|
//this.printMap();
|
|
|
},
|
|
|
+ handleSxChange(v) {
|
|
|
+ this.zycxData.query.layersData.filter((item) => {
|
|
|
+ if (v === item.value) {
|
|
|
+ this.zycxData.query.currLayerConfig = item;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.zycxData.query.layerFieldName = "";
|
|
|
+ },
|
|
|
mapReLoaded() {
|
|
|
let map = null;
|
|
|
if (map) {
|
|
@@ -1533,6 +1536,37 @@ export default {
|
|
|
maxZoom: 17,
|
|
|
});
|
|
|
},
|
|
|
+ closeAllLayersExceptBaseLayers(layerName) {
|
|
|
+ if(!layerName){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let layerGroup = [];
|
|
|
+ if (!Array.isArray(layerName)) {
|
|
|
+ layerGroup.push(layerName);
|
|
|
+ } else {
|
|
|
+ layerGroup = layerName;
|
|
|
+ }
|
|
|
+ let dict = this.zycxData.query.layersData;
|
|
|
+ if(!dict || !layerGroup.length){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let newLayerGroup = layerGroup.map((val) => {
|
|
|
+ let find = dict.find((item) => item.value == val);
|
|
|
+ if (find) {
|
|
|
+ return find.serverId;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ });
|
|
|
+ this.enabledLayersConfig[1].children.forEach((it) => {
|
|
|
+ if (!newLayerGroup.includes(it["id"])) {
|
|
|
+ it.visible = false;
|
|
|
+ } else {
|
|
|
+ if (!it.visible) {
|
|
|
+ it.visible = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* 关闭配置图层 隐藏
|
|
|
* @param id
|