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