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 />
<!-- <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>
</div> </div>
</template> </template>

View File

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