地图补全年龄
This commit is contained in:
parent
286a601018
commit
fab6090612
|
@ -315,19 +315,8 @@ watch(
|
|||
// 使用生命钩子
|
||||
onMounted(() => {
|
||||
dialogShow.value = props.dialogShow;
|
||||
// data.columns = props.columns;
|
||||
// data.title = props.title;
|
||||
// data.tableData = props.tableData;
|
||||
// console.log("状态", data);
|
||||
});
|
||||
// onBeforeMount(() => {
|
||||
// dialogShow.value = props.dialogShow;
|
||||
// data.columns = props.columns;
|
||||
// data.title = props.title;
|
||||
// data.typeId = props.typeId;
|
||||
// data.tableData = props.tableData;
|
||||
// console.log("状态3", data);
|
||||
// });
|
||||
|
||||
|
||||
const closeDialog = () => {
|
||||
dialogShow.value = false;
|
||||
|
|
|
@ -166,19 +166,19 @@
|
|||
/>
|
||||
</div> -->
|
||||
<img
|
||||
style="width: 30px; height: 30px"
|
||||
style="width: 30px; height: 30px;cursor: pointer;"
|
||||
v-if="scope.row.deng == 0"
|
||||
:src="lampImages[1]"
|
||||
@click="statusDetails(scope.row)"
|
||||
/>
|
||||
<img
|
||||
style="width: 30px; height: 30px"
|
||||
style="width: 30px; height: 30px;cursor: pointer;"
|
||||
v-if="scope.row.deng == 1"
|
||||
:src="lampImages[3]"
|
||||
@click="statusDetails(scope.row)"
|
||||
/>
|
||||
<img
|
||||
style="width: 30px; height: 30px"
|
||||
style="width: 30px; height: 30px;cursor: pointer;"
|
||||
v-if="scope.row.deng == 2"
|
||||
:src="lampImages[2]"
|
||||
@click="statusDetails(scope.row)"
|
||||
|
|
|
@ -683,10 +683,11 @@ const mapTownCount = reactive([
|
|||
},
|
||||
]);
|
||||
//选中
|
||||
//choose.value.person(9999为全部岁数,6666为选中死亡人数)
|
||||
const choose = ref({
|
||||
person: "",
|
||||
fwq: 9999,
|
||||
yaosu: 9999,
|
||||
// yaosu: 9999,
|
||||
});
|
||||
//人口数
|
||||
const personTotal = ref([
|
||||
|
@ -1851,7 +1852,7 @@ const buten = async (item) => {
|
|||
} else {
|
||||
loadingss.value = true;
|
||||
await getData(item.age);
|
||||
await getDatas(cfJd.value, item.age);
|
||||
await getDatasL(cfJd.value, item.age);
|
||||
loadingss.value = false;
|
||||
}
|
||||
};
|
||||
|
@ -1982,6 +1983,58 @@ const getData = async (e) => {
|
|||
changeRs(e1);
|
||||
}
|
||||
};
|
||||
//列表点击
|
||||
const getDatasL = async (e, i) => {
|
||||
//y用来判断选中标签后,点击街道,不重复渲染
|
||||
if (i == "9999") {
|
||||
i = "";
|
||||
}
|
||||
http
|
||||
.get(`/api/ggfwyth/ysyzt/getCssrksl?town=${e}&age=${i || ""}`)
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
if (cfJd.value != "") {
|
||||
xkzCenter.map((item) => {
|
||||
item.swrs = 0;
|
||||
res.data.committeeSwrs.map((items) => {
|
||||
if (items.csq == item.name) {
|
||||
item.swrs = items.swrs;
|
||||
}
|
||||
});
|
||||
});
|
||||
xkzCenter.map((item) => {
|
||||
item.number = 0;
|
||||
res.data.committee.map((items) => {
|
||||
if (items.committee == item.name) {
|
||||
item.number = items.rksl;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
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 (cfCs.value) {
|
||||
cs_dd_arr.value = [...xuanzhongCs.value];
|
||||
cs_dd_arr.value.map((item, index) => {
|
||||
DGcreateCs2(item, index);
|
||||
});
|
||||
} else {
|
||||
addCs2();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
//地图点击->返回及街道区块点击
|
||||
const getDatas = async (e, i, y = true) => {
|
||||
//y用来判断选中标签后,点击街道,不重复渲染
|
||||
if (i == "9999") {
|
||||
|
@ -2009,7 +2062,7 @@ const getDatas = async (e, i, y = true) => {
|
|||
percent: "",
|
||||
},
|
||||
];
|
||||
let before_age = "";
|
||||
let before_age = 0;
|
||||
personTotal.value[0].rksl = res.data.total;
|
||||
personTotal.value[0].ages = "总人口";
|
||||
personTotal.value[1].rksl = res.data.swrs;
|
||||
|
@ -2023,25 +2076,26 @@ const getDatas = async (e, i, y = true) => {
|
|||
ages: item.age + "岁",
|
||||
percent: item.percent,
|
||||
});
|
||||
before_age = item.age;
|
||||
// before_age = item.age;
|
||||
before_age = 1;
|
||||
} else {
|
||||
if (item.age - before_age == 1) {
|
||||
if (item.age - before_age == 0) {
|
||||
personTotal.value.push({
|
||||
rksl: item.rksl,
|
||||
age: item.age + "",
|
||||
ages: item.age + "岁",
|
||||
percent: item.percent,
|
||||
});
|
||||
before_age = item.age;
|
||||
before_age = before_age + 1;
|
||||
} else {
|
||||
for (let k = before_age; k < item.age - 1; k++) {
|
||||
before_age = before_age + 1;
|
||||
for (let k = before_age; k < item.age; k++) {
|
||||
personTotal.value.push({
|
||||
rksl: 0,
|
||||
age: before_age + "",
|
||||
ages: before_age + "岁",
|
||||
percent: 0.0,
|
||||
});
|
||||
before_age = before_age + 1;
|
||||
}
|
||||
personTotal.value.push({
|
||||
rksl: item.rksl,
|
||||
|
@ -2049,7 +2103,7 @@ const getDatas = async (e, i, y = true) => {
|
|||
ages: item.age + "岁",
|
||||
percent: item.percent,
|
||||
});
|
||||
before_age = item.age;
|
||||
before_age = item.age+1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -2141,6 +2195,7 @@ const getDatas = async (e, i, y = true) => {
|
|||
}
|
||||
});
|
||||
};
|
||||
//地图点击->村社点击
|
||||
const getDatas2 = async (e, i, cs) => {
|
||||
//i1用来防止i清空,用来渲染单个点位
|
||||
let i1 = i;
|
||||
|
@ -2195,7 +2250,7 @@ const getDatas2 = async (e, i, cs) => {
|
|||
// percent: item.percent,
|
||||
// });
|
||||
// });
|
||||
let before_age = "";
|
||||
let before_age = 0;
|
||||
res.data.age.forEach((item, index) => {
|
||||
if (index == 0 && item.age == 0) {
|
||||
personTotal.value.push({
|
||||
|
@ -2204,25 +2259,27 @@ const getDatas2 = async (e, i, cs) => {
|
|||
ages: item.age + "岁",
|
||||
percent: item.percent,
|
||||
});
|
||||
before_age = item.age;
|
||||
// before_age = item.age;
|
||||
before_age = 1;
|
||||
} else {
|
||||
if (item.age - before_age == 1) {
|
||||
if (item.age - before_age == 0) {
|
||||
personTotal.value.push({
|
||||
rksl: item.rksl,
|
||||
age: item.age + "",
|
||||
ages: item.age + "岁",
|
||||
percent: item.percent,
|
||||
});
|
||||
before_age = item.age;
|
||||
before_age = before_age + 1;
|
||||
// before_age = item.age;
|
||||
} else {
|
||||
for (let k = before_age; k < item.age - 1; k++) {
|
||||
before_age = before_age + 1;
|
||||
for (let k = before_age; k < item.age ; k++) {
|
||||
personTotal.value.push({
|
||||
rksl: 0,
|
||||
age: before_age + "",
|
||||
ages: before_age + "岁",
|
||||
percent: 0.0,
|
||||
});
|
||||
before_age = before_age + 1;
|
||||
}
|
||||
personTotal.value.push({
|
||||
rksl: item.rksl,
|
||||
|
@ -2230,7 +2287,7 @@ const getDatas2 = async (e, i, cs) => {
|
|||
ages: item.age + "岁",
|
||||
percent: item.percent,
|
||||
});
|
||||
before_age = item.age;
|
||||
before_age = item.age+1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -2341,6 +2398,7 @@ const getDataBqFirst = async () => {
|
|||
}
|
||||
});
|
||||
};
|
||||
//列表点击
|
||||
const getDataBqs = async (jd, cs, bq) => {
|
||||
await getDataBqJD(bq);
|
||||
if (cfJd.value == "") {
|
||||
|
@ -2429,7 +2487,7 @@ const getDataBqs2 = async (jd, cs, bq) => {
|
|||
}
|
||||
});
|
||||
};
|
||||
//单点选择区域获取特殊标签
|
||||
//地图点击->单点选择区域获取特殊标签
|
||||
const getDataBqs3 = async (jd, cs, bq) => {
|
||||
let data = {};
|
||||
let tagIdBq;
|
||||
|
@ -2472,7 +2530,7 @@ const getDataBqs3 = async (jd, cs, bq) => {
|
|||
}
|
||||
});
|
||||
};
|
||||
//点击地图区块进入社区取消await的影响
|
||||
//地图点击->点击地图区块进入社区取消await的影响
|
||||
const getDataBqs4 = async (jd, cs, bq) => {
|
||||
let data = {};
|
||||
let tagIdBq;
|
||||
|
@ -3306,9 +3364,9 @@ const offsetPoint2 = (point, offsetX, offsetY) => {
|
|||
return new BMapGL.Point(point.lng + offsetX, point.lat + offsetY);
|
||||
};
|
||||
// 设置偏移量
|
||||
let offsetX = 0.01095; // 横向偏移量
|
||||
let offsetX = 0.01095; // 街道横向偏移量
|
||||
let offsetY = 0.00314; // 纵向偏移量
|
||||
let offsetX2 = 0.01; // 横向偏移量
|
||||
let offsetX2 = 0.01; // 村社横向偏移量
|
||||
let offsetY2 = 0.00328; // 纵向偏移量
|
||||
const isclick = ref('');
|
||||
const addPolygonCounty = () => {
|
||||
|
@ -3323,9 +3381,9 @@ const addPolygonCounty = () => {
|
|||
// itemm[1] = itemm[1] + 0.00314;
|
||||
// });
|
||||
item.point[0].map((p) => points.push(new BMapGL.Point(...p)));
|
||||
let offsetPoints = points.map((point) =>
|
||||
offsetPoint(point, offsetX, offsetY)
|
||||
);
|
||||
// let offsetPoints = points.map((point) =>
|
||||
// offsetPoint(point, offsetX, offsetY)
|
||||
// );
|
||||
if (points.length) {
|
||||
//创建面
|
||||
let polygon = new BMapGL.Polygon(points, {
|
||||
|
|
Loading…
Reference in New Issue