Compare commits

..

No commits in common. "5a8bfbff49d5099c57dd3645ee49b1abcf7a8794" and "7ddc313d8ac9a178e2a04c55644a49012c98bb2a" have entirely different histories.

2 changed files with 59 additions and 204 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -164,13 +164,6 @@
>
修改村名
</div>
<div
class="btnopen"
@click="centerEdit"
v-if="!add_mode && !edit_mode && !move_mode"
>
修改村社中心点
</div>
<div
class="btnsave"
@click="addmode"
@ -283,7 +276,6 @@
<div class="text">加载中...</div>
</div>
</div>
<!-- 修改村名 -->
<el-dialog v-model="dialogVisible" title="修改村名" width="500">
<el-input
v-model="input1"
@ -296,14 +288,6 @@
</div>
</template>
</el-dialog>
<el-dialog v-model="dialogVisible3" title="修改村社中心点" width="500">
<el-input v-model="input2" placeholder="请选择" disabled />
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="csCenter()"> 确认修改 </el-button>
</div>
</template>
</el-dialog>
<el-dialog v-model="dialogVisible2" title="新村社列表" width="500">
<el-form
:model="add_new_cs"
@ -363,7 +347,6 @@ import j8 from "@/assets/images/map/j8.png";
import j9 from "@/assets/images/map/j9.png";
import j10 from "@/assets/images/map/j10.png";
import j11 from "@/assets/images/map/j11.png";
import j10_map from "@/assets/images/map/j10_map.png";
import j11_map from "@/assets/images/map/j11_map.png";
import dwd from "@/assets/images/map/dwd.png";
import fwqbg1 from "@/assets/images/map/qlv.png";
@ -417,10 +400,8 @@ const addPd = computed(() => {
});
//
const input1 = ref("");
const input2 = ref([]);
const dialogVisible = ref(false);
const dialogVisible2 = ref(false);
const dialogVisible3 = ref(false);
//
const loadingss = ref(false);
const loadTable = ref(false);
@ -812,10 +793,8 @@ const yaosuTotal = ref([
{
id: 10,
name: "AED",
img_map: j10_map,
img: j10,
wz: true,
url: "/api/ggfwyth/ysyzt/getAeds",
},
{
id: 11,
@ -939,6 +918,7 @@ const getCssj = async () => {
await http.get("/api/ggfwyth/regionalDivision/getDetails").then((res) => {
if (res.code == 200) {
cssj = JSON.parse(res.data);
console.log(4444);
}
});
};
@ -1067,11 +1047,13 @@ const moveBack = () => {
//
const moveDK = async () => {
loadingss.value = true;
let sj = {
id: changeCsqkId.value,
data: JSON.stringify(arrJWD),
};
await http.post(`/api/ggfwyth/regionalDivision/edit`, sj).then((res) => {
await http
.post(
`/api/ggfwyth/regionalDivision/edit?id=${
changeCsqkId.value
}&data=${JSON.stringify(arrJWD)}`
)
.then((res) => {
if (res.code == 200) {
ElMessage.success({
message: "保存成功",
@ -1165,78 +1147,40 @@ const backEdit = () => {
showEdit.value = false;
drawing.value = false;
};
const shangchuan = async () => {
for (const item of xkzDk) {
let a = [];
a.push(item.point);
// console.log(JSON.stringify(a));
let sj = {
id: item.id,
data: JSON.stringify(a),
};
await http.post(`/api/ggfwyth/regionalDivision/edit`, sj).then((res) => {
//
const saveDK = async () => {
loadingss.value = true;
await http
.post(
`/api/ggfwyth/regionalDivision/edit?id=${
changeCsqkId.value
}&data=${JSON.stringify(arrJWD)}`
)
.then((res) => {
if (res.code == 200) {
ElMessage.success({
message: "保存成功",
});
}
});
await new Promise((resolve) => setTimeout(resolve, 300));
await getCssj();
await loadCs(cfJd.value);
cs_choose_arr.value.forEach((item, index) => {
map.removeOverlay(cs_choose_arr.value[index]);
});
chooseCsList.value.length = 0;
xkzDk.forEach((itemm, indexx) => {
if (itemm.name == cfCs.value) {
chooseCsList.value.push(itemm);
addCsChoose();
}
// xkzDk.forEach(async (item, index) => {
// let a = [];
// a.push(item.point);
// console.log(JSON.stringify(a));
// let sj = {
// id: item.id,
// data: JSON.stringify(a),
// };
// await http.post(`/api/ggfwyth/regionalDivision/edit`, sj).then((res) => {
// if (res.code == 200) {
// ElMessage.success({
// message: "",
// });
// }
// });
// });
};
//
const saveDK = async () => {
loadingss.value = true;
let sj = {
id: changeCsqkId.value,
data: JSON.stringify(arrJWD),
};
console.log(sj.data);
// await http.post(`/api/ggfwyth/regionalDivision/edit`, sj).then((res) => {
// if (res.code == 200) {
// ElMessage.success({
// message: "",
// });
// }
// });
// await getCssj();
// await loadCs(cfJd.value);
// cs_choose_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_choose_arr.value[index]);
// });
// chooseCsList.value.length = 0;
// xkzDk.forEach((itemm, indexx) => {
// if (itemm.name == cfCs.value) {
// chooseCsList.value.push(itemm);
// addCsChoose();
// }
// });
// loadingss.value = false;
});
loadingss.value = false;
};
//
const nameEdit = () => {
dialogVisible.value = true;
};
const centerEdit = () => {
dialogVisible3.value = true;
};
const csName = async () => {
let n = input1.value;
await http
@ -1270,44 +1214,6 @@ const csName = async () => {
});
}, 500);
};
const csCenter = async () => {
let regionalDivisionEditDTO = {
id: changeCsqkId.value,
data: JSON.stringify(input2.value),
};
await http
.post(
`/api/ggfwyth/regionalDivision/updateCsCenter`,
regionalDivisionEditDTO
)
.then((res) => {
if (res.code == 200) {
ElMessage.success({
message: "修改村社中心点成功",
});
}
});
input2.value = [];
dialogVisible3.value = false;
await getCssj();
await loadCs(cfJd.value);
cs_dd_arr.value.forEach((item, index) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
cs_dd_arr.value = [];
xkzCenter.forEach((a) => {
if (a.name == cfCs.value) {
cs_dd_arr.value.push(a);
}
});
console.log("cs_dd_arr.value", cs_dd_arr.value);
setTimeout(() => {
cs_dd_arr.value.map((item, index) => {
DGcreateCs(item, index);
});
}, 200);
};
//
const addmode = () => {
add_mode.value = true;
@ -1560,9 +1466,6 @@ const markera = (e) => {
if (add_mode.value) {
add_new_cs.center = [e.latlng.lng, e.latlng.lat];
}
if (!drawing.value) {
input2.value = [e.latlng.lng, e.latlng.lat];
}
};
//(age)
const buten = async (item) => {
@ -2356,7 +2259,7 @@ const changeys = (name) => {
img_map = item.img_map;
}
});
if (name == "摄像头" || name == "AED") {
if (name == "摄像头") {
getZyys(url, name, img, img_map);
}
}
@ -2369,21 +2272,10 @@ const getZyys = (url, name, img, img_map) => {
item.img = img;
item.img_map = img_map;
item.overlay = null;
item.center = [];
// item.center = [];
// item.center.push(Number(item.jd));
// item.center.push(Number(item.wd));
switch (name) {
case "摄像头":
item.center = [Number(item.jd), Number(item.wd)];
break;
case "AED":
let newStr = item.point.replace("", ",");
item.center = JSON.parse(newStr);
break;
default:
break;
}
// item.onClick = () => {
// handleItemClick(item, index, name);
// };
@ -2429,17 +2321,10 @@ const createZyys = (polygon, indexx, name) => {
);
map.addOverlay(yaosuIcon.value[name].sj[indexx].overlay);
yaosuIcon.value[name].sj[indexx].overlay.addEventListener("click", () => {
switch (name) {
case "摄像头":
sxtShow.deviceCode = polygon.sbbm;
sxtShow.name = polygon.sbmc;
getCameraUrl();
break;
case "AED":
break;
default:
break;
}
// console.log(polygon);
});
};
//
@ -3025,19 +2910,13 @@ const loadTown = () => {
}
};
//
// ()
//
const offsetPoint = (point, offsetX, offsetY) => {
return new BMapGL.Point(point.lng + offsetX, point.lat + offsetY);
};
//
const offsetPoint2 = (point, offsetX, offsetY) => {
return new BMapGL.Point(point.lng + offsetX, point.lat + offsetY);
return new BMapGL.Point(point.lng + offsetX, point.lat - offsetY);
};
//
let offsetX = 0.01095; //
let offsetY = 0.00314; //
let offsetX2 = 0.01; //
let offsetY2 = 0.00328; //
let offsetX = 0.00095; //
let offsetY = 0.00014; //
const addPolygonCounty = () => {
map.clearOverlays();
let fillColor = "#ffffff";
@ -3046,9 +2925,7 @@ const addPolygonCounty = () => {
//
let points = [];
item.point.map((p) => points.push(new BMapGL.Point(...p)));
let offsetPoints = points.map((point) =>
offsetPoint(point, offsetX, offsetY)
);
let offsetPoints = points.map((point) => offsetPoint(point, offsetX, offsetY));
if (points.length) {
//
let polygon = new BMapGL.Polygon(offsetPoints, {
@ -3160,8 +3037,7 @@ const createCustomOverlayJd = (polygon, indexx) => {
jdm_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetX: 10,
offsetY: -15,
offsetY: -10,
properties: {
title: polygon.name,
type: "customOverlay",
@ -3233,8 +3109,7 @@ const createCustomOverlayJd2 = (polygon, indexx) => {
jdm_number_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetX: 10,
offsetY: -15,
offsetY: -10,
properties: {
title: polygon.name,
number: polygon[`${num}`],
@ -3284,22 +3159,14 @@ const loadCs = async (name) => {
}
console.log(6666);
};
//shangchuan
//
const addPolygonCountyCs = () => {
xkzDk.map((item, index) => {
let num = index % 9;
let fillColor = colorList[num].bg;
//
let points = [];
// console.log(item.name,item.point[0]);
// item.point[0].forEach((itemm, indexx) => {
// itemm[0] = itemm[0] + 0.01;
// itemm[1] = itemm[1] + 0.00328;
// });
item.point[0].map((p) => points.push(new BMapGL.Point(...p)));
let offsetPoints2 = points.map((point) =>
offsetPoint2(point, offsetX2, offsetY2)
);
if (points.length) {
//
cs_qk_arr.value[index] = new BMapGL.Polygon(points, {
@ -3360,7 +3227,6 @@ const addPolygonCountyCs = () => {
}
});
};
//
const addCsChoose = () => {
chooseCsList.value.map((item, index) => {
@ -3369,9 +3235,6 @@ const addCsChoose = () => {
//
let points = [];
item.point[0].map((p) => points.push(new BMapGL.Point(...p)));
// let offsetPoints2 = points.map((point) =>
// offsetPoint2(point, offsetX2, offsetY2)
// );
if (points.length) {
//
cs_choose_arr.value[index] = new BMapGL.Polygon(points, {
@ -3394,9 +3257,6 @@ const addCsUnChoose = () => {
//
let points = [];
item.point[0].map((p) => points.push(new BMapGL.Point(...p)));
// let offsetPoints2 = points.map((point) =>
// offsetPoint2(point, offsetX2, offsetY2)
// );
if (points.length) {
//
cs_un_choose_arr.value[index] = new BMapGL.Polygon(points, {
@ -3463,8 +3323,6 @@ const addCsUnChoose = () => {
//
const addCs = () => {
xkzCenter.map((item, index) => {
console.log(item.name,typeof item.center);
createCs(item, index);
});
};
@ -3484,6 +3342,7 @@ const createCs = (polygon, indexx) => {
content.style.height = "60px";
content.style.width = "60px";
content.style.zIndex = BMapGL.Overlay.getZIndex(this.point.lat);
var div = document.createElement("div");
div.style.color = "#333";
div.style.whiteSpace = "nowrap";
@ -3517,8 +3376,7 @@ const createCs = (polygon, indexx) => {
cs_name_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetX: 10,
offsetY: -15,
offsetY: -10,
properties: {
title: polygon.name,
imgSrc2: dwd,
@ -3586,8 +3444,7 @@ const createCs2 = (polygon, indexx) => {
cs_number_name_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetX: 10,
offsetY: -15,
offsetY: -10,
properties: {
title: polygon.name,
number: polygon[`${num}`],
@ -3645,8 +3502,7 @@ const DGcreateCs = (polygon, indexx) => {
cs_dd_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetX: 10,
offsetY: -15,
offsetY: -10,
properties: {
title: polygon.name,
imgSrc2: dwd,
@ -3728,8 +3584,7 @@ const DGcreateCs2 = (polygon, indexx) => {
cs_dd_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
offsetX: 10,
offsetY: -15,
offsetY: -10,
properties: {
title: polygon.name,
number: polygon[`${num}`],
@ -3771,7 +3626,7 @@ const reset_font2 = () => {
"scale(" + width / 1920 + "," + height / 1080 + ")";
};
onMounted(async () => {
tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
// tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
loadingss.value = true;
reset_font();
initMap();