diff --git a/src/views/pictureOnMap/LayerControl.vue b/src/views/pictureOnMap/LayerControl.vue index 3bc3b6e..cf0c595 100644 --- a/src/views/pictureOnMap/LayerControl.vue +++ b/src/views/pictureOnMap/LayerControl.vue @@ -278,7 +278,8 @@ }); } function filterTX(value, data, node) { - console.log("12121", value, data, node); + if (!value) return true; + return !data.label.includes(value); } onMounted(() => { nextTick(() => { @@ -317,8 +318,25 @@ (newValue, oldValue) => { TXtYPE.value = newValue; console.log("图层控制中的雨污水状态", TXtYPE.value); - dataSource.value = JSON.parse(JSON.stringify(dataSource.value)); - console.log(dataSource.value); + let data = ""; //用来筛选不展示的图例,雨水专题不展示 污 相关的图层 + if (newValue == "rain") { + data = "污"; + } else if (newValue == "sewage") { + data = "雨"; + } else { + data = ""; + } + proxy.$refs.layertree.filter(data); + console.log("mmm", dataSource.value); + // 清除当前专题下的所有已勾选的图层 + const AllArray = []; + dataSource.value.forEach((element) => { + element.children.forEach((element2) => { + if (element2.VShow == TXtYPE.value) AllArray.push(element2.value); + }); + }); + console.log(AllArray); + setLayerVisible([], AllArray); }, { deep: true, once: true } ); diff --git a/src/views/pictureOnMap/LayerControl.vue b/src/views/pictureOnMap/LayerControl.vue index 3bc3b6e..cf0c595 100644 --- a/src/views/pictureOnMap/LayerControl.vue +++ b/src/views/pictureOnMap/LayerControl.vue @@ -278,7 +278,8 @@ }); } function filterTX(value, data, node) { - console.log("12121", value, data, node); + if (!value) return true; + return !data.label.includes(value); } onMounted(() => { nextTick(() => { @@ -317,8 +318,25 @@ (newValue, oldValue) => { TXtYPE.value = newValue; console.log("图层控制中的雨污水状态", TXtYPE.value); - dataSource.value = JSON.parse(JSON.stringify(dataSource.value)); - console.log(dataSource.value); + let data = ""; //用来筛选不展示的图例,雨水专题不展示 污 相关的图层 + if (newValue == "rain") { + data = "污"; + } else if (newValue == "sewage") { + data = "雨"; + } else { + data = ""; + } + proxy.$refs.layertree.filter(data); + console.log("mmm", dataSource.value); + // 清除当前专题下的所有已勾选的图层 + const AllArray = []; + dataSource.value.forEach((element) => { + element.children.forEach((element2) => { + if (element2.VShow == TXtYPE.value) AllArray.push(element2.value); + }); + }); + console.log(AllArray); + setLayerVisible([], AllArray); }, { deep: true, once: true } ); diff --git a/src/views/pictureOnMap/TopTab/index.vue b/src/views/pictureOnMap/TopTab/index.vue index 536e3ec..da0d4ac 100644 --- a/src/views/pictureOnMap/TopTab/index.vue +++ b/src/views/pictureOnMap/TopTab/index.vue @@ -59,6 +59,8 @@ import moment from "moment"; import { getImageUrl } from "@/utils/ruoyi"; import ModelRongYun from "@/views/RongyunCommunication/ModelRongYun/index.vue"; //融云调用 +import useUserStore from "@/store/modules/user"; +const appStore = useUserStore(); import { getweather } from "@/api/MonitorAssetsOnMap"; import { useRouter } from "vue-router"; @@ -113,6 +115,7 @@ const TabClick = (item) => { console.log("itemitemitem2", item); + appStore.Set_TiXiType(""); newfiberMap.map.easeTo(newfiberMap.config_.params.init); bus.emit("clearTemporaryData"); if (item.link == "/WaterAssets") { diff --git a/src/views/pictureOnMap/LayerControl.vue b/src/views/pictureOnMap/LayerControl.vue index 3bc3b6e..cf0c595 100644 --- a/src/views/pictureOnMap/LayerControl.vue +++ b/src/views/pictureOnMap/LayerControl.vue @@ -278,7 +278,8 @@ }); } function filterTX(value, data, node) { - console.log("12121", value, data, node); + if (!value) return true; + return !data.label.includes(value); } onMounted(() => { nextTick(() => { @@ -317,8 +318,25 @@ (newValue, oldValue) => { TXtYPE.value = newValue; console.log("图层控制中的雨污水状态", TXtYPE.value); - dataSource.value = JSON.parse(JSON.stringify(dataSource.value)); - console.log(dataSource.value); + let data = ""; //用来筛选不展示的图例,雨水专题不展示 污 相关的图层 + if (newValue == "rain") { + data = "污"; + } else if (newValue == "sewage") { + data = "雨"; + } else { + data = ""; + } + proxy.$refs.layertree.filter(data); + console.log("mmm", dataSource.value); + // 清除当前专题下的所有已勾选的图层 + const AllArray = []; + dataSource.value.forEach((element) => { + element.children.forEach((element2) => { + if (element2.VShow == TXtYPE.value) AllArray.push(element2.value); + }); + }); + console.log(AllArray); + setLayerVisible([], AllArray); }, { deep: true, once: true } ); diff --git a/src/views/pictureOnMap/TopTab/index.vue b/src/views/pictureOnMap/TopTab/index.vue index 536e3ec..da0d4ac 100644 --- a/src/views/pictureOnMap/TopTab/index.vue +++ b/src/views/pictureOnMap/TopTab/index.vue @@ -59,6 +59,8 @@ import moment from "moment"; import { getImageUrl } from "@/utils/ruoyi"; import ModelRongYun from "@/views/RongyunCommunication/ModelRongYun/index.vue"; //融云调用 +import useUserStore from "@/store/modules/user"; +const appStore = useUserStore(); import { getweather } from "@/api/MonitorAssetsOnMap"; import { useRouter } from "vue-router"; @@ -113,6 +115,7 @@ const TabClick = (item) => { console.log("itemitemitem2", item); + appStore.Set_TiXiType(""); newfiberMap.map.easeTo(newfiberMap.config_.params.init); bus.emit("clearTemporaryData"); if (item.link == "/WaterAssets") { diff --git a/src/views/pictureOnMap/page/DrainageSystem/index.vue b/src/views/pictureOnMap/page/DrainageSystem/index.vue index dae250c..ca71fae 100644 --- a/src/views/pictureOnMap/page/DrainageSystem/index.vue +++ b/src/views/pictureOnMap/page/DrainageSystem/index.vue @@ -56,9 +56,9 @@ }); const TypeClick = (item) => { - TypeClick_(item); AllData.TypeID = item.key; appStore.Set_TiXiType(AllData.TypeID); + TypeClick_(item); }; const TypeClick_ = (item) => { const { setLayerVisible, clearTemporaryData, wsRouteToMapByName } = events_params;