This commit is contained in:
parent
1b46a95682
commit
0c736932c6
|
@ -5,8 +5,8 @@
|
|||
<script setup>
|
||||
import { onMounted, reactive, nextTick, ref, defineProps, watch } from "vue";
|
||||
// import mapTown from '@/assets/json/330225.json'
|
||||
// import m1 from "@/assets/images/map/m1.png";
|
||||
// import m2 from "@/assets/images/map/m2.png";
|
||||
import m1 from "@/assets/images/map/m1.png";
|
||||
import m2 from "@/assets/images/map/m2.png";
|
||||
import mapTown from '@/assets/json/ly.json'
|
||||
let map = null;
|
||||
// 点位
|
||||
|
|
|
@ -1267,12 +1267,11 @@ const DGcreateCs2 = (polygon, indexx) => {
|
|||
};
|
||||
//创建公共服务圈
|
||||
const addggfwq = () => {
|
||||
// if (!fwqList || !fwqList.value) {
|
||||
if (fwqList.value) {
|
||||
fwqList.value.map((item, index) => {
|
||||
createCustomOverlay(item, index);
|
||||
});
|
||||
// return;
|
||||
// }
|
||||
}
|
||||
};
|
||||
// 添加公共服务圈的图标
|
||||
const createCustomOverlay = (polygon, indexx) => {
|
||||
|
@ -1438,42 +1437,25 @@ const changebq = (id) => {
|
|||
}
|
||||
// choose.value.person = id;
|
||||
};
|
||||
//基本公共服务圈点击
|
||||
const changeFwq = (id, list, center, name, names) => {
|
||||
//点击服务圈村
|
||||
const changeFwq = async (id, list, center, name, names) => {
|
||||
if (choose.value.fwq == id) {
|
||||
// chooseArr.value = chooseArr.value.filter((item) => item !== "fwq");
|
||||
choose.value.fwq = 9999;
|
||||
csh();
|
||||
addPolygonCounty();
|
||||
setTimeout(() => {
|
||||
drawACircle("hide");
|
||||
}, 500);
|
||||
// 清空地图上所有的覆盖物
|
||||
choose.value.fwq = null;
|
||||
csh(); //地图初始化
|
||||
addPolygonCounty(); //添加地区
|
||||
fwq_list_arr.value.forEach((item, index) => {
|
||||
map.removeOverlay(fwq_list_arr.value[index]);
|
||||
map.removeOverlay(fwq_list_arr.value[index]); // 清空服务圈 图标
|
||||
});
|
||||
drawACircle("hide"); //隐藏服务圈 圆
|
||||
} else {
|
||||
getServiceCircle(names, name);
|
||||
console.log(jbfwqTotal.value[4].child[0], "乡镇");
|
||||
await getServiceCircle(names, name);
|
||||
choose.value.fwq = id;
|
||||
fwqList.value = list;
|
||||
// 清空地图上所有的覆盖物
|
||||
console.log(22);
|
||||
|
||||
map.clearOverlays();
|
||||
addggfwq();
|
||||
map.clearOverlays(); //清空地图上所有的覆盖物
|
||||
addggfwq(); //创建公共服务圈
|
||||
setTimeout(() => {
|
||||
goMapCenter(center, 16);
|
||||
}, 600);
|
||||
goMapCenter(center, 16); //中心点缩放
|
||||
}, 500);
|
||||
}
|
||||
|
||||
// choose.value.fwq = id;
|
||||
// removeAllPolygon("fwq");
|
||||
// fwqList.value = list;
|
||||
// goMapCenter(center, 17);
|
||||
// fwqList.value.map((item) => {
|
||||
// createCustomOverlay(item);
|
||||
// });
|
||||
};
|
||||
|
||||
const changeys = (id) => {
|
||||
|
@ -1490,9 +1472,9 @@ const personTotal = ref([
|
|||
},
|
||||
{
|
||||
id: 1,
|
||||
name: "0岁",
|
||||
name: "1岁以下",
|
||||
value: "26737",
|
||||
ages: "0岁",
|
||||
ages: "1岁以下",
|
||||
age: "1000",
|
||||
},
|
||||
{
|
||||
|
@ -2201,29 +2183,32 @@ const buten2 = async (item) => {
|
|||
getDataBqs(cfJd.value, cfCs.value, item.id);
|
||||
};
|
||||
const updateFwqList = (data, townName, communityName) => {
|
||||
let updatedFwqList = [];
|
||||
jbfwqTotal.value.forEach((town) => {
|
||||
if (town.name === townName) {
|
||||
town.child.forEach((community) => {
|
||||
if (community.name === communityName) {
|
||||
community.fwqList = data
|
||||
updatedFwqList = data
|
||||
.filter(
|
||||
(item) => item.xzjd === townName && item.csq === communityName
|
||||
)
|
||||
.map((item) => ({
|
||||
name: item.zyysmc,
|
||||
point: [item.jd, item.wd],
|
||||
bgColor: "#00b050",
|
||||
img: fwqbg1,
|
||||
img2: b2,
|
||||
x: 33,
|
||||
y: 0,
|
||||
textColor: "#fff",
|
||||
img: fwqbg1,
|
||||
img2: b2,
|
||||
name: item.zyysmc,
|
||||
point: [item.jd, item.wd],
|
||||
padding: "4px 8px 10px",
|
||||
textColor: "#fff",
|
||||
bgColor: "#00b050",
|
||||
}));
|
||||
community.fwqList = updatedFwqList;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
fwqList.value = updatedFwqList;
|
||||
// console.log(jbfwqTotal.value[4].child[0], "乡镇");
|
||||
};
|
||||
const getServiceCircle = async (communityName, townName) => {
|
||||
|
|
Loading…
Reference in New Issue