From 172bb66b27c6bdc7d3e6bc65163bea5cb8254adf Mon Sep 17 00:00:00 2001 From: yaoyuhao Date: Wed, 16 Oct 2024 14:35:11 +0800 Subject: [PATCH] map --- src/view/dialog/dialogSf.vue | 292 +++++++++++++++++++++++++++++++++++ src/view/sy_details.vue | 40 +++++ src/view/sy_map.vue | 138 ++++++++++++----- vite.config.js | 4 +- 4 files changed, 430 insertions(+), 44 deletions(-) create mode 100644 src/view/dialog/dialogSf.vue diff --git a/src/view/dialog/dialogSf.vue b/src/view/dialog/dialogSf.vue new file mode 100644 index 0000000..2677b48 --- /dev/null +++ b/src/view/dialog/dialogSf.vue @@ -0,0 +1,292 @@ + + + + \ No newline at end of file diff --git a/src/view/sy_details.vue b/src/view/sy_details.vue index 82fc978..13c5128 100644 --- a/src/view/sy_details.vue +++ b/src/view/sy_details.vue @@ -69,6 +69,15 @@ +
+
+ + 算法模型 +
+
@@ -223,6 +232,14 @@ @close="closeJj" > + +
@@ -232,6 +249,7 @@ import { useRouter, useRoute } from "vue-router"; import http from "@/utils/request.js"; import { ElMessage } from "element-plus"; import DialogLamp from "./dialog/dialogRW.vue"; +import DialogSf from "./dialog/dialogSf.vue"; import lamp1 from "../assets/sy-table/green.gif"; import lamp2 from "../assets/sy-table/red.gif"; import lamp3 from "../assets/sy-table/lampYellow1.gif"; @@ -409,8 +427,20 @@ const lampScreen = (val) => { /** * 表格弹框 * @param {*} dialogShow -弹框状态,false表示关闭,true表示开启 + * @param {*} dialogShowSf -算法弹框状态,false表示关闭,true表示开启 */ const dialogShow = ref(false); +const dialogShowSf = ref(false); +const sfType=reactive({ + url: ``, + title: "服务事项名称", + data:{ + gkmx:'备注内容', + sr:'xxxxxxxxxx(输入内容)xxxxxxxxxx(输入内容)xxxxxxxxxx(输入内容)', + dblj:'对比逻辑', + sc:'输出', + }, +}) const tableType = reactive({ url: `/api/ggfwyth/pg/fwjgqdxq`, title: "服务详情", @@ -479,9 +509,19 @@ const statusDetails = (val) => { // 状态弹框关闭 const closeJj = () => { dialogShow.value = false; + dialogShowSf.value = false; tableType.data = []; pagination3.currentPage = 1; }; +//获取算法模型数据 +const openSf=()=>{ + dialogShowSf.value = true; + // http.get(`/api/ggfwyth/pg/sfmx?xh=${routers.query.xh}`).then((res) => { + // if (res.code == 200) { + // tableType.data = res.data; + // } + // }); +} const getTable = (pagination) => { http .get( diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index 729188f..229dead 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -1853,7 +1853,7 @@ const clearyaosu = () => { yaosuList.value.length = 0; zyys_dk.value.length = 0; zyys_center.value.length = 0; - zyys_choose_cs.value=''; + zyys_choose_cs.value = ""; } }; //定义地图中点 @@ -2741,6 +2741,7 @@ const changeys = (name) => { zyys_center.value.length = 0; } } else { + loadingss.value=true; csh(); clearPerson(); yaosuList.value.push(name); @@ -2808,6 +2809,7 @@ const getZyys = (url, name, img, img_map, tooltip) => { createZyys(itemm, indexx, name, tooltip); }); } + loadingss.value = false; }); }; //本地存储资源要素 @@ -2824,6 +2826,7 @@ const getZyys2 = (name, img, img_map, tooltip) => { yaosuIcon.value[name].sj.forEach((itemm, indexx) => { createZyys(itemm, indexx, name, tooltip); }); + loadingss.value = false; } }; @@ -2884,7 +2887,7 @@ const createZyys = (polygon, indexx, name, tooltip) => { case "汽车充电桩": break; default: - zyys_choose_cs.value=name; + zyys_choose_cs.value = name; if (zyys_dk.value.length) { zyys_dk.value.forEach((item, index) => { map.removeOverlay(item); // 清空服务圈 图标 @@ -2893,18 +2896,14 @@ const createZyys = (polygon, indexx, name, tooltip) => { map.removeOverlay(item); // 清空服务圈 图标 }); } - - await get_dk_zyys( - polygon.xzjd, - polygon.csq, - polygon.num, - polygon.zyysmc - ); - if (zyys_data.value.point.length == 0) { + if (polygon.fgfwrs.length == 0) { ElMessage.warning({ - message: "地图上未找到对应村社", + message: "暂无数据", }); } else { + zyysCenter.length = 0; + zyysDk.length = 0; + await get_dk_zyys(polygon.fgfwrs); xr_dk_center_zyys(); } @@ -2917,26 +2916,73 @@ const createZyys = (polygon, indexx, name, tooltip) => { const zyys_data = ref({ point: [], center: [], - name: "", }); -const get_dk_zyys = async (xzjd, csq, number, name) => { +//资源要素(学校,医院)获取对应街道村社 +const zyysCenter = reactive([]); +const zyysDk = reactive([]); +const loadCs_zyys = async (name) => { + cssj.forEach((item, index) => { + if (item.name == name) { + csqk.value = item.sj; + } + }); + for (let v of csqk.value.features) { + if (v.geometry.coordinates.length > 1) { + for (let w in v.geometry.coordinates) { + if (v.geometry.coordinates[w][0].length < 60) continue; + zyysDk.push({ + id: v.id, + name: v.properties.name, + point: v.geometry.coordinates[w], + }); + } + zyysCenter.push({ + id: v.id, + name: v.properties.name, + center: v.properties.center, + }); + } else { + zyysDk.push({ + id: v.id, + name: v.properties.name, + point: v.geometry.coordinates[0], + }); + zyysCenter.push({ + id: v.id, + name: v.properties.name, + center: v.properties.center, + }); + } + } +}; +const get_dk_zyys = async (sj) => { zyys_dk.value.length = 0; zyys_center.value.length = 0; zyys_data.value.point.length = 0; zyys_data.value.center.length = 0; - zyys_data.value.name = ""; - await loadCs(xzjd); - zyys_data.value.name = csq; - xkzDk.forEach((dk) => { - if (csq == dk.name) { - zyys_data.value.point.push(dk); + let zyys_jd = []; + sj.forEach((itemN) => { + if (!zyys_jd.includes(itemN.town)) { + zyys_jd.push(itemN.town); } }); - xkzCenter.forEach((center) => { - if (csq == center.name) { - let a = { ...center, num: number, zyysmc: name }; - zyys_data.value.center.push(a); - } + console.log(1111111111111, zyys_jd); + + zyys_jd.forEach((item) => { + loadCs_zyys(item); + }); + sj.forEach((item, index) => { + zyysDk.forEach((dk) => { + if (item.committee == dk.name) { + zyys_data.value.point.push(dk); + } + }); + zyysCenter.forEach((center) => { + if (item.committee == center.name) { + let a = { ...center, num: item.num,town: item.town,committee: item.committee}; + zyys_data.value.center.push(a); + } + }); }); }; //资源要素(渲染地块) @@ -2964,7 +3010,6 @@ const xr_dk_center_zyys = async () => { //资源要素(渲染地块) const Xr_zyysNum = (polygon, indexx) => { - console.log(4444444, ...polygon.center); function createLabelDOM() { var content = document.createElement("div"); content.style.display = "flex"; @@ -3027,11 +3072,33 @@ const Xr_zyysNum = (polygon, indexx) => { map.addOverlay(zyys_center.value[indexx]); zyys_center.value[indexx].addEventListener("click", () => { - console.log(polygon.name); + console.log(polygon); // cfCsZs.value = polygon.name; - // open_detail(); + open_detail_zyys(polygon.town, polygon.committee); }); }; +const open_detail_zyys = (town,committee) => { + let age = ""; + dialogShow.value = true; + http + .get( + `/api/ggfwyth/ysyzt/getRyJbxxList?page=${pagination.currentPage}&size=${ + pagination.pageSize + }&committee=${committee}&town=${ + town + }` + ) + .then((res) => { + if (res.code == 200) { + tableType.data = res.data; + res.data.forEach((item, index) => { + item.index = + index + 1 + (pagination.currentPage - 1) * pagination.pageSize; + }); + pagination.total = res.count; + } + }); +}; //获取摄像头地址 const getCameraUrl = () => { // camera.deviceCode = dataMyTag.camera.sbbm; @@ -3303,6 +3370,7 @@ const changeFwq = async (id, name, names) => { // map.removeOverlay(circle); // 清空服务圈 圆 // circle = null; } else { + loadingss.value = true; csh(); clearPerson(); await loadCs(name); @@ -3326,6 +3394,7 @@ const changeFwq = async (id, name, names) => { message: "无数据", }); } + loadingss.value = false; } }; // 服务圈数据 @@ -4010,21 +4079,6 @@ const createCustomOverlayJd2 = (polygon, indexx) => { div.appendChild(number); number.appendChild(document.createTextNode(this.properties.number)); content.appendChild(div); - // div.onclick = function () { - // let jdCenter = []; - // if (polygon.name == "溪口镇") { - // title_choose.value = title_choose.value + `>${polygon.name}`; - // loadCs(); - // addPolygonCountyCs(); - // mapTownCount.map((item) => { - // if (item.name == "溪口镇") { - // jdCenter = item.center; - // } - // }); - // addCs2(); - // goMapCenter(jdCenter, 14); - // } - // }; return content; } let num = ""; diff --git a/vite.config.js b/vite.config.js index be26ac7..5c41c63 100644 --- a/vite.config.js +++ b/vite.config.js @@ -15,8 +15,8 @@ export default defineConfig({ // 第一个代理 "/api": { // 匹配到啥来进行方向代理 - // target: "http://10.0.0.7:8095/", //刘进 - target: "https://jzzf.longyou.gov.cn:998/", //线上 + target: "http://10.0.0.7:8095/", //刘进 + // target: "https://jzzf.longyou.gov.cn:998/", //线上 // target: "http://220.191.238.50:996/", //线上 // target: "https://zzdyyfb.dsjj.qz.gov.cn/web/mgop/gov-open/zj/2002428903/reserved/", //线上 changeOrigin: true, //是否支持跨域