This commit is contained in:
姚宇浩 2024-07-31 11:36:51 +08:00
parent 584700303b
commit 94a435ff34
3 changed files with 207036 additions and 107 deletions

206904
src/assets/json/cssj.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -23,14 +23,10 @@
:key="index"
>
<div class="content_item_name">{{ ageLess0(item.ages) }}</div>
<div
class="content_item_bg"
v-if="index != 0 && index != 1"
></div>
<div class="content_item_value">
<div class="content_item_percent" v-if="item.ages != '总人口'">
{{ item.percent }}%
({{ item.percent }}%)
</div>
<div class="content_item_value">
{{ item.rksl }}
</div>
</div>
@ -120,7 +116,8 @@ import tools from "@/utils/tools";
import initializeMap from "@/utils/mapInitializer.js";
import http from "@/utils/request.js";
import mapTown from "@/assets/json/ly.json";
import xkz from "@/assets/json/xkz.json";
// import xkz from "@/assets/json/xkz.json";
import cssj from "@/assets/json/cssj.json";
import j0 from "@/assets/images/map/j0.png";
import j1 from "@/assets/images/map/j1.png";
import j2 from "@/assets/images/map/j2.png";
@ -158,6 +155,8 @@ const cs_number_name_arr = ref([]); //社区名(+数量)
const cs_choose_arr = ref([]); //()
const cs_un_choose_arr = ref([]); //()
const cs_dd_arr = ref([]); //
//
const csqk = ref({});
//
const title_choose = ref("");
const title_jd = ref("");
@ -833,7 +832,7 @@ const initMap = () => {
//
const csh = () => {
clear();
xkzDk.length = 0;
map.removeEventListener("click", markera);
if (currentMarker !== null) {
map.removeOverlay(currentMarker);
@ -851,6 +850,7 @@ const clear = () => {
title_cs.value = "";
cfJd.value = "";
cfCs.value = "";
cs_un_choose_arr.value.forEach((item, index) => {
map.removeOverlay(cs_un_choose_arr.value[index]);
});
@ -912,7 +912,7 @@ const markera = (e) => {
//
const buten = async (item) => {
getData(item.id, item.age);
getDatas("溪口镇", item.age);
getDatas(cfJd.value, item.age);
};
//
const buten2 = async (item) => {
@ -1023,6 +1023,7 @@ const getDatas = async (e, i) => {
});
});
}
if (cfJd.value != "") {
xkzCenter.map((item) => {
// item.number = 0;
res.data.committeeSwrs.map((items) => {
@ -1040,6 +1041,7 @@ const getDatas = async (e, i) => {
}
});
});
}
cs_name_arr.value.forEach((item, index) => {
map.removeOverlay(cs_name_arr.value[index]);
@ -1072,7 +1074,6 @@ const getDatas = async (e, i) => {
});
}
} else {
console.log("hhhhh", xkzCenter);
if (choose.value.person == "") {
addCs();
} else {
@ -1208,6 +1209,7 @@ const getDataBqs2 = async (jd, cs, bq, f = true) => {
}
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) => {
@ -1216,6 +1218,8 @@ const getDataBqs2 = async (jd, cs, bq, f = true) => {
}
});
});
}
if (f) {
changeRs2(bq);
}
@ -1250,7 +1254,6 @@ const getDataBqs2 = async (jd, cs, bq, f = true) => {
});
}
} else {
// console.log("hhhhh", xkzCenter);
if (choose.value.person == "") {
addCs();
} else {
@ -1364,7 +1367,7 @@ const to_jd = (item_name) => {
}
}
}
loadCs();
loadCs(item_name);
addPolygonCountyCs();
mapTownCount.map((item) => {
if (item.name == item_name) {
@ -1593,6 +1596,7 @@ const loadTown = () => {
});
}
} else {
console.log("长度超过60");
mapTownDataDK.push({
name: v.properties.name,
point: v.geometry.coordinates[0],
@ -1626,15 +1630,21 @@ const addPolygonCounty = () => {
// townName.value = item.name;
if (item.name == cfJd.value) {
} else {
// cs_qk_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_qk_arr.value[index]);
// });
// cs_qk_arr.value.length=0;
clear();
xkzDk.length = 0;
cfJd.value = item.name;
let jdCenter = [];
if (item.name == "溪口镇") {
console.log(444444444, choose.value.person);
// if (item.name == "") {
BMAP();
loadCs(item.name);
addPolygonCountyCs();
getDataBq(cfJd.value, "");
if (choose.value.person == "") {
getDatas("溪口镇", "");
getDatas(cfJd.value, "");
}
if (
choose.value.person == "cjr" ||
@ -1646,15 +1656,15 @@ const addPolygonCounty = () => {
choose.value.person == "kjer"
) {
getDataBqs2(cfJd.value, cfCs.value, choose.value.person, false);
getDatas("溪口镇", "");
getDatas(cfJd.value, "");
} else if (choose.value.person != "") {
if (choose.value.person == "9999") {
getDatas("溪口镇", "");
getDatas(cfJd.value, "");
} else {
if (choose.value.person == 1) {
getDatas("溪口镇", "0"); //0
getDatas(cfJd.value, "0"); //0
} else {
getDatas("溪口镇", choose.value.person - 1);
getDatas(cfJd.value, choose.value.person - 1);
}
}
}
@ -1663,23 +1673,24 @@ const addPolygonCounty = () => {
title_jd.value = item.name;
}
loadCs();
addPolygonCountyCs();
mapTownCount.map((item) => {
if (item.name == "溪口镇") {
jdCenter = item.center;
mapTownCount.map((itemm) => {
if (itemm.name == item.name) {
jdCenter = itemm.center;
}
});
goMapCenter(jdCenter, 13);
} else {
map.removeEventListener("click", markera);
if (currentMarker !== null) {
map.removeOverlay(currentMarker);
}
clear();
getData();
getDataBq();
}
// }
// else {
// loadCs(item.name);
// addPolygonCountyCs();
// // map.removeEventListener("click", markera);
// // if (currentMarker !== null) {
// // map.removeOverlay(currentMarker);
// // }
// // clear();
// // getData();
// // getDataBq();
// }
}
});
}
@ -1828,26 +1839,41 @@ const createCustomOverlayJd2 = (polygon, indexx) => {
//------------------------------
//---------------------
//
const loadCs = () => {
for (let v of xkz.features) {
const loadCs = (name) => {
xkzCenter.length = 0;
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;
xkzDk.push({
name: v.properties.name,
point: v.geometry.coordinates[w][0],
point: v.geometry.coordinates[w],
});
}
xkzCenter.push({
name: v.properties.name,
center: [119.2002156322304, 28.83866363229786],
});
} else {
xkzDk.push({
name: v.properties.name,
point: v.geometry.coordinates[0],
});
xkzCenter.push({
name: v.properties.name,
center: [119.2002156322304, 28.83866363229786],
});
}
}
};
//
const addPolygonCountyCs = () => {
console.log(11111111111111,xkzDk);
xkzDk.map((item, index) => {
let num = index % 9;
let fillColor = colorList[num].bg;
@ -2336,7 +2362,7 @@ const reset_font = () => {
}
};
onMounted(() => {
// tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
reset_font();
initMap();
getData();
@ -2409,7 +2435,7 @@ onMounted(() => {
justify-content: space-between;
padding: 18px;
padding-left: 24px;
padding-right: 5px;
// padding-right: 5px;
width: 48%;
position: relative;
// height: 57px;
@ -2419,15 +2445,15 @@ onMounted(() => {
margin-bottom: 12px;
font-size: 18px;
}
.content_item_bg {
position: absolute;
top: 0;
left: 0;
width: 40%;
height: 100%;
background: RGBA(53, 85, 114, 0.8);
z-index: -1;
}
// .content_item_bg {
// position: absolute;
// top: 0;
// left: 0;
// width: 40%;
// height: 100%;
// background: RGBA(53, 85, 114, 0.8);
// z-index: -1;
// }
.content_item:first-child {
box-sizing: border-box;
display: flex;
@ -2473,13 +2499,12 @@ onMounted(() => {
top: 7.5px;
left: -13px;
}
.content_item_value {
display: flex;
.content_item_percent {
margin-right: 5px;
color: #6bfeff;
text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
}
.content_item_value {
// display: flex;
}
.choose {

View File

@ -15,8 +15,8 @@ export default defineConfig({
// 第一个代理
"/api": {
// 匹配到啥来进行方向代理
target: "http://192.168.2.17:8095/", //刘进
// target: "http://220.191.238.50:996/", //线上
// target: "http://192.168.2.17:8095/", //刘进
target: "http://220.191.238.50:996/", //线上
changeOrigin: true, //是否支持跨域
//rewrite: (path) => path.replace(/^\/api/, '') // 如果不需要api 直接把路径上的api 替换成空,这个
},