This commit is contained in:
duanxiaohai 2024-08-07 15:12:34 +08:00
parent 87323e6cc4
commit 2a41980329
1 changed files with 13 additions and 9 deletions

View File

@ -1948,10 +1948,10 @@ const getFwq = () => {
name: item.xzjd, name: item.xzjd,
child: [], child: [],
}); });
item.csqs.forEach((item2) => { item.jcs.forEach((item2) => {
jbfwqTotal.value[index].child.push({ jbfwqTotal.value[index].child.push({
name: item2.csq, name: item2.jc,
jc: item2.jc, // jc: item2.jc,
}); });
}); });
}); });
@ -1984,9 +1984,13 @@ const changeFwq = async (id, name, names) => {
map.clearOverlays(); // map.clearOverlays(); //
addggfwq(); // addggfwq(); //
setTimeout(() => { setTimeout(() => {
goMapCenter([data.fwqCoordinates1, data.fwqCoordinates2], data.zoomLevel); // goMapCenter(
[data.fwqCoordinates1, data.fwqCoordinates2],
data.zoomLevel
); //
}, 500); }, 500);
} else { } else {
console.log('无数据11');
ElMessage.warning("无数据"); ElMessage.warning("无数据");
} }
} }
@ -1995,7 +1999,7 @@ const changeFwq = async (id, name, names) => {
const getServiceCircle = async (communityName, townName) => { const getServiceCircle = async (communityName, townName) => {
try { try {
const response = await http.get( const response = await http.get(
`/api/ggfwyth/ysyzt/zyysxx?csq=${communityName}&xzjd=${townName}` `/api/ggfwyth/ysyzt/zyysxx?jc=${communityName}&xzjd=${townName}`
); );
if (response.code === 200) { if (response.code === 200) {
updateFwqList(response.data, townName, communityName); updateFwqList(response.data, townName, communityName);
@ -2052,7 +2056,6 @@ const calculateAverage = (coordinates) => {
}; };
// //
const calculateZoomLevel = (maxDistance) => { const calculateZoomLevel = (maxDistance) => {
//
if (maxDistance < 151) return 18; if (maxDistance < 151) return 18;
if (maxDistance < 400) return 17; if (maxDistance < 400) return 17;
if (maxDistance < 600) return 17.5; if (maxDistance < 600) return 17.5;
@ -2076,9 +2079,9 @@ const addggfwq = () => {
}); });
const centerPoint = calculateCenterPoint(data.fwqCoordinates); const centerPoint = calculateCenterPoint(data.fwqCoordinates);
data.fwqCoordinates1 = centerPoint[0]; data.fwqCoordinates1 = centerPoint[0];
data.fwqCoordinates2 = centerPoint[1]; data.fwqCoordinates2 = centerPoint[1];
// data.fwqCoordinates1 = calculateAverage(data.fwqCoordinates1); // data.fwqCoordinates1 = calculateAverage(data.fwqCoordinates1);
// data.fwqCoordinates2 = calculateAverage(data.fwqCoordinates2); // data.fwqCoordinates2 = calculateAverage(data.fwqCoordinates2);
// console.log(centerPoint); // // console.log(centerPoint); //
@ -2237,6 +2240,7 @@ const createCustomOverlay = (polygon, indexx) => {
map.addOverlay(fwq_list_arr.value[indexx]); map.addOverlay(fwq_list_arr.value[indexx]);
}; };
const updateFwqList = (data, townName, communityName) => { const updateFwqList = (data, townName, communityName) => {
// console.log(data, townName, communityName,'');
let updatedFwqList = []; let updatedFwqList = [];
jbfwqTotal.value.forEach((town) => { jbfwqTotal.value.forEach((town) => {
if (town.name === townName) { if (town.name === townName) {
@ -2244,7 +2248,7 @@ const updateFwqList = (data, townName, communityName) => {
if (community.name === communityName) { if (community.name === communityName) {
updatedFwqList = data updatedFwqList = data
.filter( .filter(
(item) => item.xzjd === townName && item.csq === communityName (item) => item.xzjd === townName && item.jc === communityName
) )
.map((item) => ({ .map((item) => ({
x: 53, x: 53,