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

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