From 910b287cedeee75527d80971ac74eee3c08ad57d Mon Sep 17 00:00:00 2001 From: Vce Date: Sat, 30 Mar 2024 11:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=89=E5=85=A8=E5=B8=BD?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smartSafeHat/index.vue | 312 +++++++++++++++--- 1 file changed, 265 insertions(+), 47 deletions(-) diff --git a/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue b/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue index 7f0723a..dda6cf8 100644 --- a/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue +++ b/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue @@ -113,9 +113,11 @@
-
{{ item.fenceName }}
-
{{ item.workerNum }}
-
+
+
{{ item.fenceName }}
+
{{ item.workerNum }}
+
+

暂无数据

@@ -126,6 +128,42 @@
+ +
+
+
+
+ 围栏中的人员 +
+
+
+ + + +
+
+
+
+
+
序号
+
人员名称
+
身份证号
+
+ +
+
{{ index + 1 }}
+
{{ item.workerName }}
+
{{ item.idCard }}
+
+
+ +

暂无数据

+
+
+
+
+
+
@@ -279,7 +317,7 @@
-
+
@@ -502,6 +540,23 @@ onMounted(async () => { getWeekAlarmData(); // clearFn(); + resetMapSize(); + window.addEventListener("resize", e => { + resetMapSize(); + }); +}); +const resetMapSize = () => { + console.log(666); + setTimeout(() => { + let mapContent: any = document.getElementById("mapContainer"); + console.log(mapContent); + mapContent.style.transform = `scale(${1 / store.globalScale})`; + }, 200); +}; +onBeforeMount(() => { + window.removeEventListener("resize", e => { + resetMapSize(); + }); }); watch(dayValue, newVal => { @@ -521,6 +576,33 @@ watch(choiceMonth, newVal => { } }); +let isOpenDetail = ref(false); +let workerListInFence = ref([]); +function openDetail(item) { + // let data = { + // id: fenceId, + // projectSn: store.sn + // }; + // getFencePersonApi(data).then(res => { + // if (res.success) { + // workerListInFence.value = res.result.workerListInFence + // } + // }); + let welanBox = document.getElementById('welanMaskContainer') + if(welanBox){ + welanBox.style.zIndex= '999' + } + workerListInFence.value = item.workerListInFence; + isOpenDetail.value = true; +} +function closeDetail() { + let welanBox = document.getElementById('welanMaskContainer') + if(welanBox){ + welanBox.style.zIndex= '-1' + } + isOpenDetail.value = false; +} + function handleCancel() { fenceCreateShow.value = false; clearFn(); @@ -604,7 +686,8 @@ function deleteFence() { function deleteFenceInfo(idGroups) { console.log("删除id", idGroups); let data = { - ids: idGroups + ids: idGroups, + projectSn: store.sn }; deleteSafehatFence(data).then(res => { if (res.success) { @@ -863,7 +946,8 @@ function getTodayTrack(day) { let data = { devSn: queryInfo.value.devSn, createTime_begin: day, - createTime_end: day + createTime_end: day, + projectSn: store.sn }; getRealtimeDataApi(data).then((res: any) => { @@ -1057,8 +1141,8 @@ function getCrewListData() { onlineType = laborType.value; } let data = { - online: onlineType - // projectSn: store.sn + online: onlineType, + projectSn: store.sn }; console.log("👇智能安全帽--分类查询设备列表--查询参数"); console.log(data); @@ -1340,22 +1424,25 @@ function trackMapInit(path: any, item: any) { }); function createMarkerAndInfoWindow() { - marker = new AMap.Marker({ - map: map, - position: path[0], - // icon: "https://webapi.amap.com/images/car.png", - // icon: "src/assets/images/smartSafeHat.png", // 自定义图标 - icon: smartSafeHat, // 自定义图标 - // icon: "@/assets/images/carPosition/carIcon.png", // 自定义图标 - // icon: "src/assets/images/carPosition/carIcon.png", // 自定义图标 - offset: new AMap.Pixel(-26, -13), - autoRotation: true, - angle: -90 - }); - marker.on("click", markerClick); - marker.emit("click", { target: marker }); - marker.on("moving", function (e) { - passedPolyline.setPath(e.passedPath); + AMap.plugin("AMap.MoveAnimation", function () { + + marker = new AMap.Marker({ + map: map, + position: path[0], + // icon: "https://webapi.amap.com/images/car.png", + // icon: "src/assets/images/smartSafeHat.png", // 自定义图标 + icon: smartSafeHat, // 自定义图标 + // icon: "@/assets/images/carPosition/carIcon.png", // 自定义图标 + // icon: "src/assets/images/carPosition/carIcon.png", // 自定义图标 + offset: new AMap.Pixel(-26, -13), + autoRotation: true, + angle: 90 + }); + marker.on("click", markerClick); + marker.emit("click", { target: marker }); + marker.on("moving", function (e) { + passedPolyline.setPath(e.passedPath); + }); }); } @@ -1383,12 +1470,12 @@ function trackMapInit(path: any, item: any) { // console.log(e); let info = []; - info.push('

设备序号: ' + item.devSn + "

"); - // info.push('

车辆/人员名称: ' + item.numberPlate + "

"); - info.push('

人员名称: ' + item.workerName + "

"); - info.push('

最后更新时间: ' + item.updateTime + "

"); - info.push('

位置: ' + address + "

"); - // info.push('

位置: ' + address + "

"); + info.push('
设备序号: ' + item.devSn + "
"); + info.push('
人员名称: ' + item.workerName + "
"); + // info.push('
最后更新时间: ' + item.updateTime + "
"); + info.push('
最后更新时间: ' + item.uploadTime + "
"); + info.push('
经纬度: ' + item.longitude.toFixed(6) + "|" + item.latitude.toFixed(6) + "
"); + info.push('
位置: ' + address + "
"); var infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(30, -30), content: info.join("") //使用默认信息窗体框样式,显示信息内容 @@ -1399,7 +1486,9 @@ function trackMapInit(path: any, item: any) { map.setFitView(); } function startAnimation() { - marker.moveAlong(lineArr, 200); + marker.moveAlong(lineArr, { + duration: 500 + }); } var placeSearch = ref(); @@ -1526,8 +1615,8 @@ function addMarker() { var marker = new AMap.Marker({ icon: startIcon, position: [locationList.value[0].longitude, locationList.value[0].latitude], - size: new AMap.Size(25, 34) - // offset: new AMap.Pixel(-13, -30) + size: new AMap.Size(25, 34), + offset: new AMap.Pixel(-12, -29) }); marker.setMap(map); } @@ -1720,10 +1809,12 @@ function echoCarMarker(item) { // console.log(e) let info = []; - info.push('

设备序号: ' + item.devSn + "

"); - info.push('

车辆/人员名称: ' + item.numberPlate + "

"); - info.push('

最后更新时间: ' + item.updateTime + "

"); - info.push('

位置: ' + address + "

"); + info.push('
设备序号: ' + item.devSn + "
"); + info.push('
人员名称: ' + item.workerName + "
"); + // info.push('
最后更新时间: ' + item.updateTime + "
"); + info.push('
最后更新时间: ' + item.uploadTime + "
"); + info.push('
经纬度: ' + item.longitude.toFixed(6) + "|" + item.latitude.toFixed(6) + "
"); + info.push('
位置: ' + address + "
"); let infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(30, -30), @@ -1777,12 +1868,12 @@ function echoPersonMarker(item) { console.log(e); let info = []; - info.push('

设备序号: ' + item.devSn + "

"); - // info.push('

车辆/人员名称: ' + item.personName + "

"); - info.push('

人员名称: ' + item.workerName + "

"); - info.push('

最后更新时间: ' + item.updateTime + "

"); - info.push('

位置: ' + address + "

"); - info.push('

经纬度: ' + item.longitude + "|" + item.latitude + "

"); + info.push('
设备序号: ' + item.devSn + "
"); + info.push('
人员名称: ' + item.workerName + "
"); + // info.push('
最后更新时间: ' + item.updateTime + "
"); + info.push('
最后更新时间: ' + item.uploadTime + "
"); + info.push('
经纬度: ' + item.longitude.toFixed(6) + "|" + item.latitude.toFixed(6) + "
"); + info.push('
位置: ' + address + "
"); var infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(10, -30), @@ -1811,9 +1902,136 @@ function echoPersonMarker(item) {