|
@@ -29,7 +29,7 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const { point_type } = toRefs<any>(proxy?.useDict('point_type'));
|
|
|
const appStore = useAppStore();
|
|
|
const mapStore = useMapStore();
|
|
|
-const emits = defineEmits(['handleShowWarehouse', 'handleShowVideo', 'handleShowPeople', 'resize']);
|
|
|
+const emits = defineEmits(['handleShowWarehouse', 'handleShowVideo', 'handleShowPeople', 'closeDetailDialog', 'resize']);
|
|
|
|
|
|
const mapRef = ref(null);
|
|
|
const containerRef = ref();
|
|
@@ -55,6 +55,7 @@ watch(
|
|
|
);
|
|
|
const mapList = reactive({
|
|
|
satellite2: [
|
|
|
+ { layer: 'map', layerType: 'WMTS', code: 'YZT1708679726700', zIndex: '-100', visible: true },
|
|
|
{ layer: 'map', layerType: 'WFS', code: 'YZT1712111943104', zIndex: '-99', visible: true },
|
|
|
{ layer: 'annotation', layerType: 'WMTS', code: 'YZT1695608158269', zIndex: '-98', visible: true }
|
|
|
],
|
|
@@ -115,7 +116,12 @@ const init = () => {
|
|
|
// let drawTool = new DrawTool({ mapUtils, map });
|
|
|
handleResize();
|
|
|
},
|
|
|
- onMarkerClick: (data) => {
|
|
|
+ onMarkerClick: (data, flag) => {
|
|
|
+ let title = titleList[data.dataType];
|
|
|
+ if (flag && !!title) {
|
|
|
+ data.title = title;
|
|
|
+ emits('closeDetailDialog', data);
|
|
|
+ }
|
|
|
// 多点位
|
|
|
if (data.type === '1') {
|
|
|
getPointInfoList2({
|
|
@@ -159,7 +165,10 @@ const init = () => {
|
|
|
content.appendChild(tableBox);
|
|
|
let closeBtn = document.createElement('div');
|
|
|
closeBtn.className = 'close';
|
|
|
- closeBtn.onclick = () => mapUtils.hideInfo(true);
|
|
|
+ closeBtn.onclick = () => {
|
|
|
+ mapUtils.hideInfo(true);
|
|
|
+ emits('closeDetailDialog', data);
|
|
|
+ };
|
|
|
content.appendChild(closeBtn);
|
|
|
mapUtils.showInfo(content, [data.longitude, data.latitude], -data.scale * data.size[1], true);
|
|
|
});
|
|
@@ -182,36 +191,35 @@ const handlePointDetails = (data) => {
|
|
|
titleDom.className = 'title-box';
|
|
|
titleDom.innerHTML = '<div class="gradient-text">' + title + '</div></div>';
|
|
|
div.appendChild(titleDom);
|
|
|
- if (data.dataType === 2) {
|
|
|
- let btnBox = document.createElement('div');
|
|
|
- let btn = document.createElement('div');
|
|
|
- btnBox.className = 'flex';
|
|
|
- btn.className = 'btn';
|
|
|
- btn.innerHTML = '<div class="video-icon"></div><div>物资详情</div>';
|
|
|
- btn.onclick = () => {
|
|
|
- emits('handleShowWarehouse', data);
|
|
|
- };
|
|
|
- btnBox.appendChild(btn);
|
|
|
- div.appendChild(btnBox);
|
|
|
- } else if (data.dataType === 4) {
|
|
|
- let btnBox = document.createElement('div');
|
|
|
- let btn = document.createElement('div');
|
|
|
- btnBox.className = 'flex';
|
|
|
- btn.className = 'btn';
|
|
|
- btn.innerHTML = '<div class="video-icon"></div><div>附近视频</div>';
|
|
|
- btn.onclick = () => {
|
|
|
- emits('handleShowVideo', data);
|
|
|
+ const objs = {
|
|
|
+ '2': {
|
|
|
+ title: '物资详情',
|
|
|
+ method: 'handleShowWarehouse'
|
|
|
+ },
|
|
|
+ '41': {
|
|
|
+ title: '人员列表',
|
|
|
+ method: 'handleShowPeople'
|
|
|
+ },
|
|
|
+ '43': {
|
|
|
+ title: '历史轨迹',
|
|
|
+ method: 'handleShowTrack'
|
|
|
+ }
|
|
|
+ };
|
|
|
+ let obj = objs[data.dataType];
|
|
|
+ if ([4, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58].includes(data.dataType)) {
|
|
|
+ obj = {
|
|
|
+ title: '附近视频',
|
|
|
+ method: 'handleShowVideo'
|
|
|
};
|
|
|
- btnBox.appendChild(btn);
|
|
|
- div.appendChild(btnBox);
|
|
|
- } else if (data.dataType === 41) {
|
|
|
+ }
|
|
|
+ if (!!obj) {
|
|
|
let btnBox = document.createElement('div');
|
|
|
let btn = document.createElement('div');
|
|
|
btnBox.className = 'flex';
|
|
|
btn.className = 'btn';
|
|
|
- btn.innerHTML = '<div class="video-icon"></div><div>人员列表</div>';
|
|
|
+ btn.innerHTML = '<div class="video-icon"></div>' + obj.title + '<div></div>';
|
|
|
btn.onclick = () => {
|
|
|
- emits('handleShowPeople', data);
|
|
|
+ emits(obj.method, data);
|
|
|
};
|
|
|
btnBox.appendChild(btn);
|
|
|
div.appendChild(btnBox);
|
|
@@ -253,7 +261,10 @@ const handlePointDetails = (data) => {
|
|
|
div.appendChild(table);
|
|
|
let closeBtn = document.createElement('div');
|
|
|
closeBtn.className = 'close';
|
|
|
- closeBtn.onclick = () => mapUtils.hideInfo(true);
|
|
|
+ closeBtn.onclick = () => {
|
|
|
+ mapUtils.hideInfo(true);
|
|
|
+ emits('closeDetailDialog', data);
|
|
|
+ };
|
|
|
div.appendChild(closeBtn);
|
|
|
mapUtils.showInfo(div, [data.longitude, data.latitude], -data.scale * data.size[1], true);
|
|
|
} else if (data.dataType === 'video') {
|