-
@@ -363,6 +363,7 @@ 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 j7_map from "@/assets/images/map/j7_map.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";
@@ -795,6 +796,7 @@ const yaosuTotal = ref([
id: 7,
name: "养老机构",
img: j7,
+ img_map: j7_map,
wz: false,
},
{
@@ -849,6 +851,84 @@ const yaosuIcon = ref({
卫生服务中心: { sj: [] },
AED: { sj: [] },
});
+//养老机构数据
+const ylCount = reactive([
+ {
+ name: "龙游县湖镇镇养老服务中心(龙游县湖镇中心敬老院)",
+ value: 34,
+ center: [119.290573, 29.05917],
+ },
+ {
+ name: "龙游县模环敬老院(龙游县模环乡钱江缘颐养院)",
+ value: 73,
+ center: [119.245178, 29.11824],
+ },
+ {
+ name: "龙游县小南海敬老院(龙游县小南海销钱江缘颐养院)",
+ value: 29,
+ center: [119.116203, 29.078722],
+ },
+ {
+ name: "龙游县广和长青养老服务中心",
+ value: 310,
+ center: [119.15457, 29.01811],
+ },
+ {
+ name: "龙游县泽随敬老院(龙游泽随养老中心)",
+ value: 57,
+ center: [119.102493, 29.14036],
+ },
+ {
+ name: "龙游县龙南中心敬老院(龙游龙南养老中心)",
+ value: 73,
+ center: [119.157143, 28.833012],
+ },
+ {
+ name: "龙游县詹家敬老院(龙游詹家养老中心)",
+ value: 33,
+ center: [119.078972, 29.026592],
+ },
+ {
+ name: "龙游县龙洲敬老院(龙游龙洲养老中心)",
+ value: 23,
+ center: [119.164062, 28.984661],
+ },
+ {
+ name: "龙游县横山镇敬老院(龙游横山养老中心)",
+ value: 58,
+ center: [119.237015, 29.240862],
+ },
+ {
+ name: "龙游骨科医院(六顺颐养院)",
+ value: 247,
+ center: [119.171921, 29.01895],
+ },
+ {
+ name: "龙游石佛敬老院(龙游县石佛乡六顺养老中心)",
+ value: 61,
+ center: [119.11557, 29.187431],
+ },
+ {
+ name: "龙游县国华养老服务有限公司",
+ value: 25,
+ center: [119.125282, 29.098713],
+ },
+ {
+ name: "龙游县社会养老和儿童福利院",
+ value: 0,
+ center: [119.17602, 29.03358],
+ },
+ {
+ name: "龙游荷庄养老院",
+ value: 0,
+ center: [119.211021, 29.174171],
+ },
+ {
+ name: "龙游县湖镇中心卫生院(天禾康养)",
+ value: 0,
+ center: [119.299393, 29.059999],
+ },
+]);
// 鼠标点击添加点位
let currentMarker = null; // 用于保存当前标记的引用
// 详情弹框
@@ -923,7 +1003,7 @@ const pagination = reactive({
//--------定义方法----------------------------------------
//地图初始化
const initMap = () => {
- map = new BMapGL.Map("map", { minZoom: 8, maxZoom: 16 });
+ map = new BMapGL.Map("map", { minZoom: 8, maxZoom: 18 });
map.setMapType(BMAP_SATELLITE_MAP);
map.enableScrollWheelZoom(true);
goMapCenter([119.178783, 29.034583], 11);
@@ -959,7 +1039,6 @@ const movemode = () => {
var selectedOverlay = null;
var sceneMove;
var movepoy;
-var select;
const normalStyle = {
fillColor: "#ad9ff8",
strokeColor: "#4f2ff1",
@@ -986,17 +1065,12 @@ const clickHandler = (e) => {
let target = polyLayer.pickOverlays(e.target);
if (target && target[0]) {
selectedOverlay = target[0];
- console.log("5-1", selectedOverlay);
// setActiveStyle(selectedOverlay);
- movepoy.open(selectedOverlay, call());
+ movepoy.open(selectedOverlay);
} else {
- console.log("5-2");
polyLayer.resetStyle();
}
};
-const call = () => {
- console.log("执行");
-};
//开始平移
const moveEdit = () => {
console.log(11111, cs_choose_arr.value[0]);
@@ -1008,7 +1082,6 @@ const moveEdit = () => {
selectedOverlay = null;
sceneMove = null;
movepoy = null;
- select = null;
map.addGeoJSONLayer(polyLayer);
polyLayer.addOverlay(cs_choose_arr.value[0]);
sceneMove = new DrawScene(map);
@@ -1052,9 +1125,11 @@ const moveSave = () => {
};
//退出移动模式
const moveBack = () => {
- // select.close();
- // movepoy.close();
- // sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
+ //如果进入移动模式,但不点击移动,直接退出,movepoy为空,不执行取消监听
+ if (movepoy) {
+ movepoy.close();
+ sceneMove.removeEventListener(OperateEventType.CLICK, clickHandler);
+ }
polyLayer.removeOverlay(cs_choose_arr.value[0]);
map.removeGeoJSONLayer(polyLayer);
cs_choose_arr.value.forEach((item, index) => {
@@ -1167,27 +1242,11 @@ const backEdit = () => {
};
//批量修改村社位置
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) => {
- if (res.code == 200) {
- ElMessage.success({
- message: "保存成功",
- });
- }
- });
- await new Promise((resolve) => setTimeout(resolve, 1000));
- }
- // xkzDk.forEach(async (item, index) => {
+ //上传地块0.00328
+ // for (const item of xkzDk) {
// let a = [];
// a.push(item.point);
- // console.log(JSON.stringify(a));
+ // // console.log(JSON.stringify(a));
// let sj = {
// id: item.id,
// data: JSON.stringify(a),
@@ -1199,7 +1258,26 @@ const shangchuan = async () => {
// });
// }
// });
- // });
+ // await new Promise((resolve) => setTimeout(resolve, 1000));
+ // }
+ //上传中心点
+ for (const item of xkzCenter) {
+ let sj = {
+ id: item.id,
+ data: JSON.stringify(item.center),
+ };
+ console.log(sj);
+ await http
+ .post(`/api/ggfwyth/regionalDivision/updateCsCenter`, sj)
+ .then((res) => {
+ if (res.code == 200) {
+ ElMessage.success({
+ message: "保存成功",
+ });
+ }
+ });
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+ }
};
//上传编辑的地块
const saveDK = async () => {
@@ -1208,28 +1286,28 @@ const saveDK = async () => {
id: changeCsqkId.value,
data: JSON.stringify(arrJWD),
};
- console.log(sj.data);
+ // 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;
+ 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 = () => {
@@ -1240,14 +1318,12 @@ const centerEdit = () => {
};
const csName = async () => {
let n = input1.value;
- let regionalDivisionEditDTO = {
+ let regionalDivisionEditDTO = {
id: changeCsqkId.value,
data: input1.value,
};
await http
- .post(
- `/api/ggfwyth/regionalDivision/updateCsName`,regionalDivisionEditDTO
- )
+ .post(`/api/ggfwyth/regionalDivision/updateCsName`, regionalDivisionEditDTO)
.then((res) => {
if (res.code == 200) {
ElMessage.success({
@@ -2364,8 +2440,12 @@ const changeys = (name) => {
if (name == "摄像头" || name == "AED") {
getZyys(url, name, img, img_map);
}
+ if (name == "养老机构") {
+ getZyys2(name, img, img_map);
+ }
}
};
+//线上接口资源要素
const getZyys = (url, name, img, img_map) => {
http.get(url).then((res) => {
if (res.code == 200) {
@@ -2399,9 +2479,20 @@ const getZyys = (url, name, img, img_map) => {
}
});
};
-// const handleItemClick = (item, index, name) => {
-// console.log("Item clicked:", item, index, name);
-// };
+//本地存储资源要素
+const getZyys2 = (name, img, img_map) => {
+ if (name == "养老机构") {
+ yaosuIcon.value[name].sj = ylCount;
+ yaosuIcon.value[name].sj.forEach((item, index) => {
+ item.img = img;
+ item.img_map = img_map;
+ item.overlay = null;
+ });
+ yaosuIcon.value[name].sj.forEach((itemm, indexx) => {
+ createZyys(itemm, indexx, name);
+ });
+ }
+};
// 添加资源要素的图标(overlay存放标记点)
const createZyys = (polygon, indexx, name) => {
@@ -2425,7 +2516,9 @@ const createZyys = (polygon, indexx, name) => {
{
point: new BMapGL.Point(...polygon.center),
opacity: 0.5,
- offsetY: -10,
+ // offsetY: -10,
+ offsetX: 10,
+ offsetY: -15,
properties: {
imgSrc2: polygon.img_map,
type: "customOverlay",
@@ -3469,8 +3562,9 @@ const addCsUnChoose = () => {
//创建村社
const addCs = () => {
xkzCenter.map((item, index) => {
- console.log(item.name,typeof item.center);
-
+ // item.center[0] = item.center[0] + 0.01;
+ // item.center[1] = item.center[1] + 0.00328;
+ console.log(item.center);
createCs(item, index);
});
};
@@ -3777,7 +3871,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();