This commit is contained in:
姚宇浩 2024-08-13 15:29:28 +08:00
parent 1404413c5a
commit 10689020d1
1 changed files with 63 additions and 24 deletions

View File

@ -168,6 +168,9 @@
<div v-if="currentData.jzzt == 1">居住</div> <div v-if="currentData.jzzt == 1">居住</div>
<div v-else>未居住</div> <div v-else>未居住</div>
</template> </template>
<template #sxt="{ currentCol, currentData }">
<div>摄像头</div>
</template>
</Dialog> </Dialog>
<personDetail <personDetail
class="detail" class="detail"
@ -661,6 +664,13 @@ const fwqList = ref([]);
// //
const yaosuTotal = ref([ const yaosuTotal = ref([
{
id: 11,
name: "摄像头",
img: j0,
wz: false,
url: "/api/ggfwyth/ysyzt/getJashsxt",
},
{ {
id: 0, id: 0,
name: "体育场所", name: "体育场所",
@ -733,10 +743,15 @@ const yaosuTotal = ref([
const yaosuList = ref([]); const yaosuList = ref([]);
// //
const yaosuIcon = ref({ const yaosuIcon = ref({
摄像头: {
sj: [],
},
体育场所: { 体育场所: {
sj: [], sj: [],
}, },
幼儿园: { sj: [] }, 幼儿园: {
sj: [],
},
小学: { sj: [] }, 小学: { sj: [] },
初中: { sj: [] }, 初中: { sj: [] },
高中: { sj: [] }, 高中: { sj: [] },
@ -797,6 +812,11 @@ const tableType = reactive({
property: "domicAddr", property: "domicAddr",
width: "300px", width: "300px",
}, },
{
label: "",
property: "sxt",
type: "slot",
},
], ],
data: [], data: [],
}); });
@ -902,7 +922,7 @@ const markera = (e) => {
map.addOverlay(marker); map.addOverlay(marker);
currentMarker = marker; currentMarker = marker;
}; };
// //(age)
const buten = async (item) => { const buten = async (item) => {
if (choose.value.person == item.age) { if (choose.value.person == item.age) {
choose.value.person = ""; choose.value.person = "";
@ -939,7 +959,7 @@ const buten = async (item) => {
getDatas(cfJd.value, item.age); getDatas(cfJd.value, item.age);
} }
}; };
// //(name)
const buten2 = async (item) => { const buten2 = async (item) => {
// //
if (choose.value.person == item.id) { if (choose.value.person == item.id) {
@ -1224,6 +1244,7 @@ const getDatas = async (e, i, y = true) => {
}); });
}; };
const getDatas2 = async (e, i, cs) => { const getDatas2 = async (e, i, cs) => {
//i1i
let i1 = i; let i1 = i;
if ( if (
i == "残疾人" || i == "残疾人" ||
@ -1276,7 +1297,6 @@ const getDatas2 = async (e, i, cs) => {
// }); // });
let before_age = ""; let before_age = "";
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({
rksl: item.rksl, rksl: item.rksl,
@ -1550,7 +1570,7 @@ const getDataBqs3 = async (jd, cs, bq) => {
const getDataBqJD = async (bq) => { const getDataBqJD = async (bq) => {
let data = {}; let data = {};
console.log(tsbq_id_total.value); console.log(tsbq_id_total.value);
tsbq_id_total.value.forEach((item, index) => { tsbq_id_total.value.forEach((item, index) => {
if (bq == item.name) { if (bq == item.name) {
data = { data = {
@ -1626,51 +1646,66 @@ const removeCharFromArray = (arr, charToRemove) => {
const changeys = (name) => { const changeys = (name) => {
if (yaosuList.value.includes(name)) { if (yaosuList.value.includes(name)) {
yaosuList.value = yaosuList.value.filter((ch) => ch !== name); yaosuList.value = yaosuList.value.filter((ch) => ch !== name);
// yaosuIcon.value[name].sj.forEach((item, index) => { yaosuIcon.value[name].sj.forEach((item, index) => {
// map.removeOverlay( yaosuIcon.value[name].sj[index]); map.removeOverlay(yaosuIcon.value[name].sj[index].overlay);
// }); });
} else { } else {
yaosuList.value.push(name); yaosuList.value.push(name);
// getZyys(name); let url;
let img
yaosuTotal.value.forEach((item, index) => {
if (item.name == name) {
url = item.url;
img=item.img
}
});
getZyys(url, name,img);
} }
}; };
const getZyys = (name) => { const getZyys = (url, name,img) => {
http.get(``).then((res) => { http.get(url).then((res) => {
if (res.code == 200) { if (res.code == 200) {
res.data.map((item, index) => { yaosuIcon.value[name].sj = res.data;
createZyys(item, index, name); yaosuIcon.value[name].sj.forEach((item, index) => {
item.img = img;
item.overlay = null;
item.center = [];
item.center.push(Number(item.jd));
item.center.push(Number(item.wd));
});
yaosuIcon.value[name].sj.forEach((itemm, indexx) => {
createZyys(itemm,indexx,name)
}); });
} }
}); });
}; };
// // (overlay)
const createZyys = (polygon, indexx, name) => { const createZyys = (polygon, indexx, name) => {
// data.fwqCoordinates = polygon.point;
function createLabelDOM() { function createLabelDOM() {
var content = document.createElement("div"); var content = document.createElement("div");
content.style.display = "flex"; content.style.display = "flex";
content.style.flexDirection = "column"; content.style.flexDirection = "column";
content.style.alignItems = "center"; content.style.alignItems = "center";
content.style.height = "40px";
content.style.width = "40px";
content.style.zIndex = BMapGL.Overlay.getZIndex(this.point.lat); content.style.zIndex = BMapGL.Overlay.getZIndex(this.point.lat);
content.style.height = "30px";
content.style.width = "30px";
let img2 = document.createElement("img"); let img2 = document.createElement("img");
img2.style.width = "20px"; img2.style.width = "20px";
img2.style.height = "20px"; img2.style.height = "26px";
img2.src = this.properties.imgSrc2; img2.src = this.properties.imgSrc2;
content.appendChild(img2); content.appendChild(img2);
return content; return content;
} }
yaosuIcon.value[name].sj[indexx] = new BMapGL.CustomOverlay(createLabelDOM, { yaosuIcon.value[name].sj[indexx].overlay = new BMapGL.CustomOverlay(createLabelDOM, {
point: new BMapGL.Point(...polygon.point), point: new BMapGL.Point(...polygon.center),
opacity: 0.5, opacity: 0.5,
offsetY: -10, offsetY: -10,
properties: { properties: {
imgSrc2: polygon.img2, imgSrc2: polygon.img,
type: "customOverlay", type: "customOverlay",
}, },
}); });
map.addOverlay(yaosuIcon.value[name].sj[indexx]); map.addOverlay( yaosuIcon.value[name].sj[indexx].overlay);
}; };
//---------------------- //----------------------
// //
@ -2497,7 +2532,7 @@ const addPolygonCountyCs = () => {
strokeWeight: 2, strokeWeight: 2,
strokeOpacity: 0.8, strokeOpacity: 0.8,
fillColor: fillColor, fillColor: fillColor,
fillOpacity: 0.7, fillOpacity: 0.5,
name: item.name, name: item.name,
zIndex: 99, zIndex: 99,
}); });
@ -3362,12 +3397,13 @@ onMounted(() => {
.zyys { .zyys {
.zyys_content { .zyys_content {
height: 200px;
margin-top: 20px; margin-top: 20px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-flow: row wrap; flex-flow: row wrap;
overflow: auto;
.zyys_content_item { .zyys_content_item {
width: 110px; width: 110px;
height: 54px; height: 54px;
@ -3401,6 +3437,9 @@ onMounted(() => {
background-size: 100% 100%; background-size: 100% 100%;
} }
} }
.zyys_content::-webkit-scrollbar {
display: none;
}
} }
} }