From d09bf8ccf9e27e3c332a6ad76e34ce6f0783a8be Mon Sep 17 00:00:00 2001 From: yaoyuhao Date: Thu, 29 Aug 2024 16:50:20 +0800 Subject: [PATCH] 1 --- src/assets/images/map/j7_map.png | Bin 0 -> 5141 bytes src/view/dialog/dialogMapDp.vue | 9 +- src/view/sy_map.vue | 224 ++++++++++++++++++++++--------- vite.config.js | 4 +- 4 files changed, 167 insertions(+), 70 deletions(-) create mode 100644 src/assets/images/map/j7_map.png diff --git a/src/assets/images/map/j7_map.png b/src/assets/images/map/j7_map.png new file mode 100644 index 0000000000000000000000000000000000000000..00ec73045dda4210c86a00760eff3250dc897867 GIT binary patch literal 5141 zcmV+w6zc1VP)Px|&q+i-bDDbDzB@{AKLzoRrU4a?k>~N>Js$rCw1RcGkpbmxynfn zbkriV69HAQPfIP|?Xx8*Y(!Wo@I<qvYwbCTg zD32q|+S<&+x1KILs@+dj0o5g;DzidE5U(ni)?=fDL(IUPUg^g;I3Wf8- z1Ff_@RaAtD8@qDtv}2^H98hHe8vD2&=r%J4IIf&d%dHaytVFxdIyGE)<0-i5PoK24rZ0x1!oYnEznRpyAW zN1;xlu5i-)ybBNkFow!*7vaJQr_18FkYWQGy+kh&VMZ(ZGK%*bgGf@_Zkc#qjOZhEPDwih#p&3T`QM=T6m!lPO#Il1+E1Wa&3|SHd zDH71=C3-yYD=4g1Q5}4U^S1+EnRurBw(Mno^a4FVQ>+r9OQB`F(#cm_g_5@C2=8k% z-6x(StBcL0s07tNsWqFnvQk}ov}_(L1@dpNpQodq3O>_eFHWlODb0n(R}|2di*&re zcakitNdZ*qStpg4V&hZz>7=vd+Sq`uTBygk@SF%v&?pCu;HSI5*N=j|_e_cv1}(QUt*-LD97G%w!BbiWz6}_f?6B8^DOW`rKbMJ}~1v*UOj;JmtogGyodH#)0!kW$5dQmErRKoJ4 zBjk9x%J5syk*Q%QYJx6)o3H+X@>9pkkV{-?( z&FCo&EkEQ)(B%tsq$sxqGm8bhesNB=&j~AG-PWxAu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}lyF$B)D^9~S*;I*P9OLB7Li&W#Vq$pCT@$3Z?Cj$#p8RmoPvylU@1A4-mj zITmU5eSI { - console.log(row,'sxt'); - + console.log(row, "sxt"); + // row 是当前行的数据 emit("openMessage", { nm: row.nm, identNo: row.identNo }); // router.push({ @@ -225,6 +226,7 @@ const handle = (current) => { :deep(.el-dialog) { --el-dialog-bg-color: none; --el-dialog-width: 76% !important; + margin: 11vh auto !important; } .my-header { @@ -234,6 +236,7 @@ const handle = (current) => { .tabelPart { padding: 16px; + padding-bottom: 5px; background: linear-gradient( 270deg, rgba(0, 77, 131, 0.69) 0%, @@ -334,7 +337,7 @@ const handle = (current) => { } .custom-table-font { - font-size: 10px; + font-size: 15px; } :deep(.el-table:not(.el-table--border) .el-table__cell) { padding: 3px 0px; diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index df37d58..4487aa9 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -111,7 +111,7 @@
-
+
基本公共服务圈
@@ -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(); diff --git a/vite.config.js b/vite.config.js index 99753df..7708875 100644 --- a/vite.config.js +++ b/vite.config.js @@ -15,8 +15,8 @@ export default defineConfig({ // 第一个代理 "/api": { // 匹配到啥来进行方向代理 - // target: "http://10.0.0.65:8095/", //刘进 - target: "http://220.191.238.50:996/", //线上 + target: "http://10.0.0.65:8095/", //刘进 + // target: "http://220.191.238.50:996/", //线上 changeOrigin: true, //是否支持跨域 //rewrite: (path) => path.replace(/^\/api/, '') // 如果不需要api 直接把路径上的api 替换成空,这个 },