|
@@ -51,7 +51,7 @@ const props = withDefaults(defineProps<Props>(), {});
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const { point_type } = toRefs<any>(proxy?.useDict('point_type'));
|
|
|
|
|
|
-const emits = defineEmits(['update:drawing', 'selectGraphics', 'unSelectGraphics', 'showTextEditBox', 'onDrawCompleted']);
|
|
|
+const emits = defineEmits(['update:drawing', 'selectGraphics', 'unSelectGraphics', 'showTextEditBox', 'onDrawCompleted', 'handleShowVideo']);
|
|
|
const containerRef = ref();
|
|
|
const width = ref('100%');
|
|
|
const height = ref('100%');
|
|
@@ -95,7 +95,7 @@ const { getAMap, getMap, switchMap, addMarker, addSearchMarker, clearMarker, get
|
|
|
drawTool.initMouseTool({ container: 'aMap', map, AMap });
|
|
|
handleResize();
|
|
|
},
|
|
|
- onMarkerClick: (data) => {
|
|
|
+ onMarkerClick: (data, e) => {
|
|
|
// 多点位
|
|
|
if (data.type === '1') {
|
|
|
let path = [];
|
|
@@ -109,6 +109,7 @@ const { getAMap, getMap, switchMap, addMarker, addSearchMarker, clearMarker, get
|
|
|
}).then((res) => {
|
|
|
const data2 = res.data.list;
|
|
|
let content = document.createElement('div');
|
|
|
+ // content.style.cssText = 'transform: scale(' + containerScale().scaleX + ');';
|
|
|
content.className = 'point-info';
|
|
|
let content2 = '';
|
|
|
content2 += '<div class="title-box"><div class="gradient-text">多点位信息</div></div>';
|
|
@@ -125,8 +126,11 @@ const { getAMap, getMap, switchMap, addMarker, addSearchMarker, clearMarker, get
|
|
|
item.latitude = data.latitude;
|
|
|
const div = document.createElement('div');
|
|
|
div.className = 'point-item';
|
|
|
- div.innerHTML = '<div class="td2">' + getDictLabel(point_type.value, item.dataType.toString()) + '</div><div class="td2">' + item.name + '</div>';
|
|
|
- div.addEventListener('click', () => handlePointDetails(item));
|
|
|
+ div.innerHTML =
|
|
|
+ '<div class="td2">' + getDictLabel(point_type.value, item.dataType.toString()) + '</div><div class="td2">' + item.name + '</div>';
|
|
|
+ div.addEventListener('click', () => {
|
|
|
+ handlePointDetails(item);
|
|
|
+ });
|
|
|
table.appendChild(div);
|
|
|
});
|
|
|
content.appendChild(table);
|
|
@@ -168,16 +172,41 @@ const handlePointDetails = (data) => {
|
|
|
method(data.id).then((res) => {
|
|
|
if (!!pointDetailTemplate[data.dataType]) {
|
|
|
let div = document.createElement('div');
|
|
|
+ // div.style.cssText = 'transform: scale(' + containerScale().scaleX + ');';
|
|
|
div.className = 'point-info';
|
|
|
+ let titleDom = document.createElement('div');
|
|
|
+ titleDom.className = 'title-box';
|
|
|
+ titleDom.innerHTML = '<div class="gradient-text">' + title + '</div></div>';
|
|
|
+ div.appendChild(titleDom);
|
|
|
+ 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);
|
|
|
+ };
|
|
|
+ btnBox.appendChild(btn);
|
|
|
+ div.appendChild(btnBox);
|
|
|
+ }
|
|
|
+ let icon1 = document.createElement('div');
|
|
|
+ icon1.className = 'icon1';
|
|
|
+ let icon2 = document.createElement('div');
|
|
|
+ icon2.className = 'icon2';
|
|
|
+ let icon3 = document.createElement('div');
|
|
|
+ icon3.className = 'icon3';
|
|
|
+ let icon4 = document.createElement('div');
|
|
|
+ icon4.className = 'icon4';
|
|
|
+ div.appendChild(icon1);
|
|
|
+ div.appendChild(icon2);
|
|
|
+ div.appendChild(icon3);
|
|
|
+ div.appendChild(icon4);
|
|
|
+ let table = document.createElement('div');
|
|
|
+ table.className = 'table';
|
|
|
let content = '';
|
|
|
- content += '<div class="title-box"><div class="gradient-text">' + title + '</div></div>';
|
|
|
- content += '<div class="icon1"></div>';
|
|
|
- content += '<div class="icon2"></div>';
|
|
|
- content += '<div class="icon3"></div>';
|
|
|
- content += '<div class="icon4"></div>';
|
|
|
content += '<div class="table">';
|
|
|
const newData = filterTd(res.rows[0], data.dataType);
|
|
|
-
|
|
|
newData.forEach((item) => {
|
|
|
if (item.type === 'shortText') {
|
|
|
content += '<div class="tr">';
|
|
@@ -194,7 +223,8 @@ const handlePointDetails = (data) => {
|
|
|
}
|
|
|
});
|
|
|
content += '</div>';
|
|
|
- div.innerHTML = content;
|
|
|
+ table.innerHTML = content;
|
|
|
+ div.appendChild(table);
|
|
|
let closeBtn = document.createElement('div');
|
|
|
closeBtn.className = 'close';
|
|
|
closeBtn.onclick = hideInfo;
|