diff --git a/src/view/sy_map.vue b/src/view/sy_map.vue index c517468..837dcc6 100644 --- a/src/view/sy_map.vue +++ b/src/view/sy_map.vue @@ -12,13 +12,8 @@
-
+
{{ item.ages }}
{{ item.rksl }}
@@ -30,13 +25,8 @@
-
+
{{ item.name }}
{{ item.rksl }}
@@ -50,19 +40,11 @@
-
+
{{ item.name }}
-
+
{{ itemm.name }}
@@ -75,13 +57,8 @@
-
+
{{ item.name }}
@@ -209,6 +186,10 @@ const tsbq_id_total = ref([ name: "退役军人", id: "tyjr", }, + { + name: "困难儿童", + id: "kjer", + }, ]); //点击龙游县初始化 const csh = () => { @@ -425,7 +406,6 @@ var map = null; // 鼠标点击添加点位 let currentMarker = null; // 用于保存当前标记的引用 const markera = (e) => { - // console.log(`${e.latlng.lng},${e.latlng.lat} `, "name"); // 检查并移除当前标记 if (currentMarker !== null) { map.removeOverlay(currentMarker); @@ -551,7 +531,12 @@ const addPolygonCounty = () => { if (choose.value.person == 0) { getDatas("溪口镇", ""); getDataBq(cfJd.value, ""); + } else if (choose.value.person == "cjr" || choose.value.person == "dibian" || choose.value.person == "db" || choose.value.person == "gxy" || choose.value.person == "tnb" || choose.value.person == "tyjr" || choose.value.person == "kjer") { + getDataBq(cfJd.value, ""); + getDataBqs2(cfJd.value, '', choose.value.person,); + console.log(3); } else { + console.log(4); getDatas("溪口镇", choose.value.person); } @@ -626,12 +611,11 @@ const addJd = () => { }; //添加街道名2含数量 const addJd2 = () => { - // if (center_now.value[0] == 119.178783) { - // goMapCenter([119.178783, 29.034581], 11); - // } - mapTownCount.map((item, index) => { - createCustomOverlayJd2(item, index); - }); + nextTick(() => { + mapTownCount.map((item, index) => { + createCustomOverlayJd2(item, index); + }); + }) // if (center_now.value[0] == 119.178783) { // goMapCenter([119.178783, 29.034581], 11); @@ -714,7 +698,15 @@ const addPolygonCountyCs = () => { DGcreateCs2(item, index); }); } - getDatas2(cfJd.value, choose.value.person, cfCs.value); + if (choose.value.person == "cjr" || choose.value.person == "dibian" || choose.value.person == "db" || choose.value.person == "gxy" || choose.value.person == "tnb" || choose.value.person == "tyjr" || choose.value.person == "kjer") { + console.log(1, '溪口镇'); + getDataBqs2(cfJd.value, cfCs.value, ''); + } else { + console.log(2, '溪口镇'); + + getDatas2('溪口镇', choose.value.person, cfCs.value); + + } addCsChoose(); addCsUnChoose(); }); @@ -790,7 +782,6 @@ const addCsUnChoose = () => { xkzCenter.forEach((a, b) => { if (a.name == item.name) { cs_dd_arr.value.push(a); - console.log("44444444444", a); xuanzhongCs.value.push(a); } }); @@ -919,10 +910,11 @@ const createCustomOverlayJd2 = (polygon, indexx) => { } let num = ""; if (choose.value.person == "6666") { - console.log(11111); num = "swrs"; + } if (choose.value.person == "cjr" || choose.value.person == "dibian" || choose.value.person == "db" || choose.value.person == "gxy" || choose.value.person == "tnb" || choose.value.person == "tyjr" || choose.value.person == "kjer") { + num = "numbers"; + } else { - console.log(222222); num = "number"; } jdm_number_arr.value[indexx] = new BMapGL.CustomOverlay(createLabelDOM, { @@ -936,6 +928,7 @@ const createCustomOverlayJd2 = (polygon, indexx) => { }, }); map.addOverlay(jdm_number_arr.value[indexx]); + }; //创建村社 const addCs = () => { @@ -1000,6 +993,9 @@ const createCs2 = (polygon, indexx) => { let num = ""; if (choose.value.person == "6666") { num = "swrs"; + } if (choose.value.person == "cjr" || choose.value.person == "dibian" || choose.value.person == "db" || choose.value.person == "gxy" || choose.value.person == "tnb" || choose.value.person == "tyjr" || choose.value.person == "kjer") { + num = "numbers"; + } else { num = "number"; } @@ -1177,6 +1173,9 @@ const DGcreateCs2 = (polygon, indexx) => { let num = ""; if (choose.value.person == "6666") { num = "swrs"; + } if (choose.value.person == "cjr" || choose.value.person == "dibian" || choose.value.person == "db" || choose.value.person == "gxy" || choose.value.person == "tnb" || choose.value.person == "tyjr" || choose.value.person == "kjer") { + num = "numbers"; + } else { num = "number"; } @@ -1320,8 +1319,10 @@ const changeRs = (id) => { jdm_number_arr.value.forEach((item, index) => { map.removeOverlay(jdm_number_arr.value[index]); }); + console.log(1); addJd(); } else { + console.log(2); choose.value.person = id; jdm_arr.value.forEach((item, index) => { map.removeOverlay(jdm_arr.value[index]); @@ -1332,6 +1333,16 @@ const changeRs = (id) => { addJd2(); } }; +const changeRs2 = (id) => { + choose.value.person = id; + jdm_arr.value.forEach((item, index) => { + map.removeOverlay(jdm_arr.value[index]); + }); + jdm_number_arr.value.forEach((item, index) => { + map.removeOverlay(jdm_number_arr.value[index]); + }); + addJd2(); +}; const changebq = (id) => { if (choose.value.person == id) { choose.value.person = ""; @@ -2113,7 +2124,6 @@ const buten = async (item) => { getDatas("溪口镇", item.age); }; const buten2 = async (item) => { - console.log(item.id); // getDataBq(item.id, item.age); // getDatas("溪口镇", item.age); getDataBqs(cfJd.value, cfCs.value, item.id); @@ -2161,7 +2171,6 @@ const getData = async (i, e) => { } }); }); - console.log(mapTownCount); mapTownCount.map((item) => { item.number = 0; res.data.town.map((items) => { @@ -2226,7 +2235,6 @@ const getDatas = async (e, i) => { } }); }); - console.log(xkzCenter); xkzCenter.map((item) => { item.number = 0; @@ -2277,6 +2285,9 @@ const getDatas = async (e, i) => { }); }; const getDatas2 = async (e, i, cs) => { + if (i == "cjr" || i == "dibian" || i == "db" || i == "gxy" || i == "tnb" || i == "tyjr" || i == "kjer") { + i = '' + } await http .get( `/api/ggfwyth/ysyzt/getCssrksl?town=${e}&age=${i || ""}&committee=${cs}` @@ -2326,45 +2337,67 @@ const getDataBq = async (jd, cs) => { await http .get(`/api/ggfwyth/ysyzt/getTsbq?csq=${cs || ""}&xzjd=${jd || ""}`) .then((res) => { - console.log(66666666666); if (res.code == 200) { - if (cfJd.value == "") { - tsbqTotal.value.length = 0; - for (let name in res.data) { - let idd = ""; - for (let v = 0; v < tsbq_id_total.value.length; v++) { - if (tsbq_id_total.value[v].name == name) { - idd = tsbq_id_total.value[v].id; - } + tsbqTotal.value.length = 0; + for (let name in res.data) { + let idd = ""; + for (let v = 0; v < tsbq_id_total.value.length; v++) { + if (tsbq_id_total.value[v].name == name) { + idd = tsbq_id_total.value[v].id; } - tsbqTotal.value.push({ - id: idd, - name: name, - rksl: res.data[name], - }); } - console.log(1111111111, tsbqTotal.value); - // res.data.forEach((item, index) => { - // tsbqTotal.value.push({ - // id: index + 1, - // rksl: item.rksl, - // age: item.age + "", - // ages: item.age + "岁", - // }); - // }); + tsbqTotal.value.push({ + id: idd, + name: name, + rksl: res.data[name], + }); } - // mapTownCount.map((item) => { - // item.number = 0; - // res.data.town.map((items) => { - // if (items.town == item.name) { - // item.number = items.rksl; - // } - // }); - // }); } }); }; const getDataBqs = async (jd, cs, bq) => { + let data = {}; + let vv = 0; + if (cs == "" && jd == "") { + data = { + tsbq: bq, + }; + vv = 1; + } else if (cs == "") { + data = { + xzjd: jd, + tsbq: bq, + + }; + vv = 2; + } else { + data = { + xzjd: jd, + tsbq: bq, + csq: cs, + }; + vv = 3; + } + await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => { + if (res.code == 200) { + mapTownCount.map((item) => { + item.numbers = 0; + res.data.map((items) => { + if (items.xzjd == item.name) { + item.numbers = items.rs; + } + }); + }); + console.log(mapTownCount, 'mapTownCount'); + changeRs2(bq); + if (jd) { + addCs2(); + } + + } + }); +}; +const getDataBqs2 = async (jd, cs, bq) => { let data = {}; let vv = 0; if (cs == "" && jd == "") { @@ -2398,17 +2431,17 @@ const getDataBqs = async (jd, cs, bq) => { // }); // }); // } - if (vv == 1) { - mapTownCount.map((item) => { - item.number = 0; - res.data.map((items) => { - if (items.xzjd == item.name) { - item.number = items.rs; - } - }); + xkzCenter.map((item) => { + item.numbers = 0; + res.data.map((items) => { + if (items.csq == item.name) { + item.numbers = items.rs; + } }); - } - changeRs(bq); + }); + console.log(mapTownCount); + changeRs2(bq); + addCs2(); } }); }; @@ -2481,17 +2514,13 @@ onMounted(() => { bottom: 0; width: 520px; height: 960px; - background: linear-gradient( - 270deg, + background: linear-gradient(270deg, rgba(0, 52, 131, 0.69) 0%, rgba(0, 32, 83, 0.77) 50%, - rgba(0, 60, 131, 0.74) 100% - ), - radial-gradient( - 128% 99% at 100% 46%, + rgba(0, 60, 131, 0.74) 100%), + radial-gradient(128% 99% at 100% 46%, rgba(0, 48, 125, 0.29) 0%, - rgba(0, 61, 134, 0.42) 100% - ); + rgba(0, 61, 134, 0.42) 100%); box-shadow: inset 0px 0px 56px 0px rgba(173, 221, 255, 0.5); backdrop-filter: blur(3px); padding: 30px 26px; @@ -2663,17 +2692,13 @@ onMounted(() => { bottom: 0; width: 520px; height: 960px; - background: linear-gradient( - 270deg, + background: linear-gradient(270deg, rgba(0, 52, 131, 0.69) 0%, rgba(0, 32, 83, 0.77) 50%, - rgba(0, 60, 131, 0.74) 100% - ), - radial-gradient( - 128% 99% at 100% 46%, + rgba(0, 60, 131, 0.74) 100%), + radial-gradient(128% 99% at 100% 46%, rgba(0, 48, 125, 0.29) 0%, - rgba(0, 61, 134, 0.42) 100% - ); + rgba(0, 61, 134, 0.42) 100%); box-shadow: inset 0px 0px 56px 0px rgba(173, 221, 255, 0.5); backdrop-filter: blur(3px); padding: 30px 26px; @@ -2831,12 +2856,10 @@ onMounted(() => { // line-height: 44px; letter-spacing: 4px; margin-bottom: 15px; - background: linear-gradient( - 180deg, - #ffffff 0%, - #ffffff 40%, - #00ffff 100% - ); + background: linear-gradient(180deg, + #ffffff 0%, + #ffffff 40%, + #00ffff 100%); /* 使文字没有背景颜色的背景 */ background-clip: text; /* 为了兼容性,添加渐变背景到IE */