fix:地图点位异步处理
This commit is contained in:
parent
2083077397
commit
7aa8abc47c
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
|
@ -43,7 +43,7 @@
|
|||
"vite"
|
||||
],
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"volar.tsPlugin": true,
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
|
|
|
|||
|
|
@ -57,6 +57,29 @@ export function emerWareHouseDetail(params) {
|
|||
method: "GET",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*地图信息:应急上报事件列表
|
||||
*/
|
||||
export function emerEventList(params) {
|
||||
return request({
|
||||
url: `/screen/index/emerEventList`,
|
||||
method: "GET",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
*地图信息:户籍列表
|
||||
*/
|
||||
export function domicileList(params) {
|
||||
return request({
|
||||
url: `/screen/index/domicileList`,
|
||||
method: "GET",
|
||||
params: params
|
||||
});
|
||||
}
|
||||
// 地图信息:整体信息
|
||||
export function emerMapInfo(params) {
|
||||
return request({
|
||||
|
|
|
|||
BIN
src/assets/images/marks/icon-fj.png
Normal file
BIN
src/assets/images/marks/icon-fj.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/images/marks/icon-sb.png
Normal file
BIN
src/assets/images/marks/icon-sb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -14,6 +14,8 @@ import {
|
|||
emerShelterList,
|
||||
emerRiskPoolList,
|
||||
emerWareHouseList,
|
||||
emerEventList,
|
||||
domicileList,
|
||||
emerShelterDetail,
|
||||
emerWareHouseDetail,
|
||||
emerRiskPoolDetail,
|
||||
|
|
@ -138,7 +140,7 @@ const getEmerShelterList = () => {
|
|||
emerShelterList({}).then((res: any) => {
|
||||
res.data.forEach((item) => {
|
||||
// console.log(item, "item===>");
|
||||
addMark(item.lng, item.lat, "icon-bncs", 1, item.othrefugeid);
|
||||
addMark(item.lng, item.lat, "icon-bncs", 1, item.othrefugeid, item);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -147,7 +149,7 @@ const getEmerRiskPoolList = () => {
|
|||
emerRiskPoolList({}).then((res: any) => {
|
||||
res.data.forEach((item) => {
|
||||
// console.log(item, "item===>");
|
||||
addMark(item.lon, item.lat, "icon-wl", 2, item.poolId);
|
||||
addMark(item.lon, item.lat, "icon-wl", 2, item.poolId, item);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -156,7 +158,26 @@ const getEmerWareHouseList = () => {
|
|||
emerWareHouseList({}).then((res: any) => {
|
||||
res.data.forEach((item) => {
|
||||
// console.log(item, "item===>");
|
||||
addMark(item.lon, item.lat, "icon-hj", 3, item.houseId);
|
||||
addMark(item.lon, item.lat, "icon-hj", 3, item.houseId, item);
|
||||
});
|
||||
});
|
||||
};
|
||||
//地图信息:应急上报事件列表
|
||||
const getemerEventList = () => {
|
||||
emerEventList({}).then((res: any) => {
|
||||
res.data.forEach((item) => {
|
||||
// console.log(item, "item===>");
|
||||
addMark(item.lon, item.lat, "icon-sb", 4, item.emerEventId, item);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
//地图信息:户籍列表
|
||||
const getdomicileList = () => {
|
||||
domicileList({}).then((res: any) => {
|
||||
res.data.forEach((item) => {
|
||||
// console.log(item, "item===>");
|
||||
addMark(item.lon, item.lat, "icon-fj", 5, item.emerEventId, item);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
@ -179,6 +200,10 @@ const loadLayer = (insideJson: string, outJson: string) => {
|
|||
getEmerRiskPoolList();
|
||||
// 应急仓库列表
|
||||
getEmerWareHouseList();
|
||||
//应急上报事件列表
|
||||
getemerEventList();
|
||||
//户籍列表
|
||||
getdomicileList();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -371,63 +396,54 @@ const datatext4 = ref("xxxxxxx地址");
|
|||
* 加载点击区域
|
||||
*/
|
||||
const loadAreaChild = (attrTemp: any) => {
|
||||
// graphicLayer.value = new mars3d.layer.GraphicLayer();
|
||||
// map.addLayer(graphicLayer.value);
|
||||
graphicLayer.value.bindPopup((event: any) => {
|
||||
// console.log(event, "event====>");
|
||||
|
||||
console.log(event.graphic, "event====>");
|
||||
let attr = event.graphic.attr || {};
|
||||
// console.log(attr, "attr==>");
|
||||
console.log(
|
||||
event.graphic.objectsToExclude?.id,
|
||||
"event.graphic.objectsToExclude?.id===>"
|
||||
);
|
||||
let title = "点位";
|
||||
let item = event.graphic.objectsToExclude?.item
|
||||
switch (event.graphic.objectsToExclude?.type || -1) {
|
||||
case 1:
|
||||
title = "避难场所";
|
||||
emerShelterDetail({
|
||||
id: event.graphic.objectsToExclude?.id,
|
||||
}).then((res: any) => {
|
||||
attr["场所名称:"] = res.data.name;
|
||||
attr["占地面积:"] = res.data.space;
|
||||
attr["地址:"] = res.data.address;
|
||||
attr["场所名称:"] = item.name;
|
||||
attr["占地面积:"] = item.space;
|
||||
attr["地址:"] = item.address;
|
||||
attr["跳转:"] = `<button
|
||||
onclick="
|
||||
window.open('https://dfxs.sczysoft.com/#/emer/shelter', '_blank');
|
||||
"
|
||||
>详情</button>`;
|
||||
});
|
||||
// getemerShelterDetail(id);
|
||||
break;
|
||||
case 2:
|
||||
title = "风险池";
|
||||
emerRiskPoolDetail({ id: event.graphic.objectsToExclude?.id }).then(
|
||||
(res: any) => {
|
||||
attr["风险地址:"] = res.data.address;
|
||||
attr["风险类型:"] = res.data.typeName;
|
||||
title = item.name;
|
||||
attr["风险地址:"] = item.address;
|
||||
attr["风险类型:"] = item.typeName;
|
||||
attr["跳转:"] = `<button
|
||||
onclick="
|
||||
window.open('https://dfxs.sczysoft.com/#/emer/point', '_blank');
|
||||
"
|
||||
>详情</button>`;
|
||||
}
|
||||
);
|
||||
break;
|
||||
case 3:
|
||||
title = "应急仓库";
|
||||
emerWareHouseDetail({ id: event.graphic.objectsToExclude?.id }).then(
|
||||
(res: any) => {
|
||||
attr["地址:"] = res.data.address;
|
||||
attr["管理员:"] = res.data.nameId;
|
||||
attr["联系电话:"] = res.data.telephone;
|
||||
attr["地址:"] = item.address;
|
||||
attr["管理员:"] = item.nameId;
|
||||
attr["联系电话:"] = item.telephone;
|
||||
attr["跳转:"] = `<button
|
||||
onclick="
|
||||
window.open('https://dfxs.sczysoft.com/#/emer/house', '_blank');
|
||||
"
|
||||
>详情</button>`;
|
||||
}
|
||||
);
|
||||
break;
|
||||
case 4:
|
||||
title = "应急上报事件";
|
||||
attr["上报标题:"] = item.title;
|
||||
attr["所属地区:"] = item.areaName;
|
||||
attr["上报地址:"] = item.address;
|
||||
break;
|
||||
case 5:
|
||||
title = "户籍信息";
|
||||
attr["上报标题:"] = item.name;
|
||||
attr["所属地区:"] = item.areaName;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -438,11 +454,6 @@ const loadAreaChild = (attrTemp: any) => {
|
|||
attr["应急仓库:"] = wholeNumber.value.emerWareHouseNum;
|
||||
break;
|
||||
}
|
||||
// return mars3d.Util.getTemplateHtml({
|
||||
// title,
|
||||
// template: "all",
|
||||
// attr,
|
||||
// });
|
||||
return mars3d.Util.getTemplateHtml({
|
||||
title,
|
||||
template: "all",
|
||||
|
|
@ -489,10 +500,11 @@ const addMark = (
|
|||
lat: number,
|
||||
imgName: string,
|
||||
type: number,
|
||||
id: string
|
||||
id: string,
|
||||
item:object
|
||||
) => {
|
||||
const graphic = new mars3d.graphic.BillboardEntity({
|
||||
objectsToExclude: { type, id },
|
||||
objectsToExclude: { type, id, item },
|
||||
position: new mars3d.LngLatPoint(lng, lat),
|
||||
style: {
|
||||
image: getImageUrl(imgName),
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@
|
|||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="createTimeString"
|
||||
prop="createTime"
|
||||
label="上报时间"
|
||||
align="center"
|
||||
width="100"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user