This commit is contained in:
duanxiaohai 2024-08-07 15:13:06 +08:00
commit 77db1c9331
2 changed files with 87 additions and 29 deletions

View File

@ -8,14 +8,6 @@
<router-view />
<!-- <router-view v-slot="{ Component }">
<keep-alive>
<component :is="Component" />
</keep-alive>
</router-view> -->
<!-- <keep-alive :max="1" :include="['首页地图']">
<router-view />
</keep-alive> -->
</div>
</div>
</template>

View File

@ -119,15 +119,15 @@
v-for="(item, index) in jbfwqTotal"
:key="index"
>
<div class="jbggfwq_content_item_left">{{ item.name }}</div>
<div class="jbggfwq_content_item_left">{{ item.xzjd }}</div>
<div class="jbggfwq_content_item_right">
<div
class="jbggfwq_content_item_right_item"
v-for="itemm in item.child"
:class="{ choose: itemm.name == choose.fwq }"
@click="changeFwq(itemm.name, item.name, itemm.name)"
v-for="itemm in item.jcs"
:class="{ choose: itemm.jc == choose.fwq }"
@click="changeFwq(itemm.jc, item.xzjd, itemm.jc)"
>
{{ itemm.name }}
{{ itemm.jc }}
</div>
</div>
</div>
@ -141,8 +141,11 @@
<div
class="zyys_content_item"
v-for="(item, index) in yaosuTotal"
:class="{ choose: item.id == choose.yaosu, wz: item.wz == true }"
@click="changeys(item.id)"
:class="{
choose: yaosuList.includes(item.name),
wz: item.wz == true,
}"
@click="changeys(item.name)"
:key="index"
>
<img :src="item.img" class="zyys_content_item_left" />
@ -960,6 +963,24 @@ const yaosuTotal = ref([
wz: true,
},
]);
//
const yaosuList = ref([]);
//
const yaosuIcon = ref({
体育场所: {
sj: [],
},
幼儿园: { sj: [] },
小学: { sj: [] },
初中: { sj: [] },
高中: { sj: [] },
医院: { sj: [] },
南孔书院: { sj: [] },
养老机构: { sj: [] },
汽车充电桩: { sj: [] },
卫生服务中心: { sj: [] },
AED: { sj: [] },
});
//
let currentMarker = null; //
//
@ -1790,9 +1811,58 @@ const changeRs2 = (id) => {
addJd2();
}
};
const changeys = (id) => {
choose.value.yaosu = id;
//----------------------
//
const removeCharFromArray = (arr, charToRemove) => {
//
if (arr.includes(charToRemove)) {
return arr.filter((ch) => ch !== charToRemove);
} else {
arr.push(charToRemove);
return arr;
}
};
const changeys = (name) => {
if (yaosuList.value.includes(name)) {
yaosuList.value = yaosuList.value.filter((ch) => ch !== name);
} else {
yaosuList.value.push(name);
yaosuIcon.value.forEach((item,index)=>{
createZyys()
})
}
// yaosuList.value = removeCharFromArray(yaosuList.value, name);
};
//
const createZyys = (polygon, indexx) => {
// data.fwqCoordinates = polygon.point;
function createLabelDOM() {
var content = document.createElement("div");
content.style.display = "flex";
content.style.flexDirection = "column";
content.style.alignItems = "center";
content.style.height = "40px";
content.style.width = "40px";
content.style.zIndex = BMapGL.Overlay.getZIndex(this.point.lat);
let img2 = document.createElement("img");
img2.style.width = "20px";
img2.style.height = "20px";
img2.src = this.properties.imgSrc2;
content.appendChild(img2);
return content;
}
fwq_list_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.point),
opacity: 0.5,
offsetY: -10,
properties: {
imgSrc2: polygon.img2,
type: "customOverlay",
},
});
map.addOverlay(fwq_list_arr.value[indexx]);
};
//----------------------
//
const to_jd = (item_name) => {
clear();
@ -2316,10 +2386,6 @@ const addPolygonCounty = () => {
// townName.value = item.name;
if (item.name == cfJd.value) {
} else {
// cs_qk_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_qk_arr.value[index]);
// });
// cs_qk_arr.value.length=0;
clear();
xkzDk.length = 0;
cfJd.value = item.name;
@ -2450,8 +2516,8 @@ const createCustomOverlayJd2 = (polygon, indexx) => {
content.style.flexDirection = "column";
content.style.alignItems = "center";
content.style.zIndex = BMapGL.Overlay.getZIndex(this.point.lat);
content.style.height = "30px";
content.style.width = "30px";
content.style.height = "20px";
content.style.width = "20px";
var div = document.createElement("div");
div.style.color = "#333";
div.style.whiteSpace = "nowrap";
@ -2514,7 +2580,7 @@ const createCustomOverlayJd2 = (polygon, indexx) => {
jdm_number_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetY: 0,
offsetY: -10,
properties: {
title: polygon.name,
number: polygon[`${num}`],
@ -2828,7 +2894,7 @@ const createCs = (polygon, indexx) => {
cs_name_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetY: 0,
offsetY: -10,
properties: {
title: polygon.name,
imgSrc2: dwd,
@ -2904,7 +2970,7 @@ const createCs2 = (polygon, indexx) => {
cs_number_name_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetY: 0,
offsetY: -10,
properties: {
title: polygon.name,
number: polygon[`${num}`],
@ -2973,7 +3039,7 @@ const DGcreateCs = (polygon, indexx) => {
cs_dd_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetY: 0,
offsetY: -10,
properties: {
title: polygon.name,
imgSrc2: dwd,
@ -3054,7 +3120,7 @@ const DGcreateCs2 = (polygon, indexx) => {
cs_dd_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetY: 0,
offsetY: -10,
properties: {
title: polygon.name,
number: polygon[`${num}`],