diff --git a/src/view/dialog/dialogMapDp.vue b/src/view/dialog/dialogMapDp.vue index 553d450..2b79948 100644 --- a/src/view/dialog/dialogMapDp.vue +++ b/src/view/dialog/dialogMapDp.vue @@ -75,6 +75,7 @@ { - map = new BMapGL.Map("map", { minZoom: 11, maxZoom: 20 }); + map = new BMapGL.Map("map", { minZoom: 8, maxZoom: 20 }); map.setMapType(BMAP_SATELLITE_MAP); map.enableScrollWheelZoom(true); goMapCenter([119.178783, 29.034583], 11); @@ -1400,14 +1400,25 @@ const getDatas2 = async (e, i, cs) => { } } }); - if (choose.value.person == "") { - cs_dd_arr.value.map((item, index) => { - DGcreateCs(item, index); - }); + if ( + i == "cjr" || + i == "dibian" || + i == "db" || + i == "gxy" || + i == "tnb" || + i == "tyjr" || + i == "kjer" + ) { } else { - cs_dd_arr.value.map((item, index) => { - DGcreateCs2(item, index); - }); + if (choose.value.person == "") { + cs_dd_arr.value.map((item, index) => { + DGcreateCs(item, index); + }); + } else { + cs_dd_arr.value.map((item, index) => { + DGcreateCs2(item, index); + }); + } } }; //特殊标签 @@ -1532,6 +1543,80 @@ const getDataBqs2 = async (jd, cs, bq, f = true) => { } }); }; +//单点选择区域获取特殊标签 +const getDataBqs3 = async (jd, cs, bq) => { + //f用来判断执不执行changeRs2 + 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) { + // if (cfJd.value != "") { + xkzCenter.map((item) => { + item.numbers = 0; + res.data.map((items) => { + if (items.csq == item.name) { + item.numbers = items.rs; + } + }); + }); + // } + // cs_name_arr.value.forEach((item, index) => { + // map.removeOverlay(cs_name_arr.value[index]); + // }); + // cs_number_name_arr.value.forEach((item, index) => { + // map.removeOverlay(cs_number_name_arr.value[index]); + // }); + // cs_dd_arr.value.forEach((item, index) => { + // map.removeOverlay(cs_dd_arr.value[index]); + // }); + // if (title_jd.value == "") { + // } else { + // if (sfdd.value) { + cs_dd_arr.value = [...xuanzhongCs.value]; + if (choose.value.person == "") { + // cs_dd_arr.value.forEach((item, index) => { + // map.removeOverlay(cs_dd_arr.value[index]); + // }); + cs_dd_arr.value.map((item, index) => { + DGcreateCs(item, index); + }); + } else { + // cs_dd_arr.value = [...xuanzhongCs.value]; + cs_dd_arr.value.map((item, index) => { + DGcreateCs2(item, index); + }); + } + // } + // else { + // if (choose.value.person == "") { + // addCs(); + // } else { + // addCs2(); + // } + // } + // } + } + }); +}; //特殊标签单独获取各个街道人数 const getDataBqJD = async (bq) => { let data = {}; @@ -2183,7 +2268,7 @@ const addPolygonCountyCs = () => { map.addOverlay(cs_qk_arr.value[index]); cs_qk_arr.value[index].addEventListener("click", () => { // console.log("名字", item.name); - + cs_dd_arr.value = []; cfCs.value = item.name; title_cs.value = item.name; sfdd.value = true; @@ -2221,7 +2306,7 @@ const addPolygonCountyCs = () => { choose.value.person == "tyjr" || choose.value.person == "kjer" ) { - getDataBqs2(cfJd.value, cfCs.value, choose.value.person, false); + getDataBqs3(cfJd.value, cfCs.value, choose.value.person); } else { // getDataBqs(cfJd.value, cfCs.value); } @@ -2314,9 +2399,9 @@ const addCsUnChoose = () => { unChooseList.value.push(itemm); } }); - cs_un_choose_arr.value.forEach((item, index) => { - map.removeOverlay(cs_qk_arr.value[index]); - }); + // cs_un_choose_arr.value.forEach((item, index) => { + // map.removeOverlay(cs_qk_arr.value[index]); + // }); // getDataBqs(cfJd.value, cfCs.value); getDataBq(cfJd.value, cfCs.value); getDatas2(cfJd.value, choose.value.person, cfCs.value); @@ -2345,7 +2430,7 @@ const addCsUnChoose = () => { choose.value.person == "tyjr" || choose.value.person == "kjer" ) { - getDataBqs2(cfJd.value, cfCs.value, choose.value.person, false); + getDataBqs3(cfJd.value, cfCs.value, choose.value.person); } // if (choose.value.person == "") { // cs_dd_arr.value.map((item, index) => { @@ -2665,7 +2750,7 @@ const reset_font = () => { } }; onMounted(() => { - // tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d"); + tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d"); reset_font(); initMap(); getData();