diff --git a/src/api/modules/smartSafeHat.ts b/src/api/modules/smartSafeHat.ts index 031fab9..470feed 100644 --- a/src/api/modules/smartSafeHat.ts +++ b/src/api/modules/smartSafeHat.ts @@ -51,6 +51,11 @@ export const getVehiclePositionDayRecord = (params: {}) => { export const getHatDevOptionApi = (params: {}) => { return http.get(BASEURL + `/xmgl/safetyHatDev/list`, params); }; +// 智能安全帽--分类查询设备树 +export const getEnterpriseTreeApi = (params: {}) => { + return http.get(BASEURL + `/xmgl/safetyHatDev/enterprise/tree/list`, params); +}; + // 智能安全帽--查询设备状态总数 export const getSafeHatTypeTotalApi = (params: {}) => { return http.post(BASEURL + `/xmgl/safetyHatDev/countSafetyHatDev`, params); diff --git a/src/assets/images/carPosition/person.png b/src/assets/images/carPosition/person.png new file mode 100644 index 0000000..eeba329 Binary files /dev/null and b/src/assets/images/carPosition/person.png differ diff --git a/src/assets/images/carPosition/person2.png b/src/assets/images/carPosition/person2.png new file mode 100644 index 0000000..a3ab808 Binary files /dev/null and b/src/assets/images/carPosition/person2.png differ diff --git a/src/config/staticMenu.ts b/src/config/staticMenu.ts index b7a43c9..2305b05 100644 --- a/src/config/staticMenu.ts +++ b/src/config/staticMenu.ts @@ -1910,6 +1910,10 @@ export const ZMMLMenu: Array = [ menuName: "安全管理", companyPath: "/securityManagement" }, + { + menuName: "安全教育", + companyPath: "/safeEducation" + }, { companyPath: "/foundationPitMonitor", menuName: "基坑监测" @@ -1922,10 +1926,6 @@ export const ZMMLMenu: Array = [ menuName: "高支模监测", companyPath: "/highFormwork" }, - { - menuName: "安全教育", - companyPath: "/safeEducation" - }, { menuName: "外墙脚手架监测", companyPath: "/wallScaffold2" @@ -1940,14 +1940,14 @@ export const ZMMLMenu: Array = [ menuName: "质量管理", companyPath: "/qualityManagement" }, - { - menuName: "混凝土测温", - companyPath: "/concreteMonitor" - }, { menuName: "进度计划", companyPath: "/schedulePlan" } + // { + // menuName: "混凝土测温", + // companyPath: "/concreteMonitor" + // } ] }, { diff --git a/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue b/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue index b428dd4..d3cfd63 100644 --- a/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue +++ b/src/views/sevenLargeScreen/digitalConstruction/smartSafeHat/index.vue @@ -50,21 +50,40 @@ style="margin-left: 55px; color: #fff" >全选 - +
- + + + + {{ item.workerName }} - - + -->
暂无设备
@@ -113,11 +132,14 @@
-
-
{{ item.fenceName }}
-
{{ item.workerNum }}
-
-
+
+
{{ item.fenceName }}
+
{{ item.workerNum }}
+
+

暂无数据

@@ -129,40 +151,38 @@
-
-
-
-
- 围栏中的人员 -
-
-
- - - -
-
-
-
-
-
序号
-
人员名称
-
身份证号
-
- -
-
{{ index + 1 }}
-
{{ item.workerName }}
-
{{ item.idCard }}
-
-
- -

暂无数据

-
-
-
-
-
+
+
+
+
围栏中的人员
+
+
+ + + +
+
+
+
+
+
序号
+
人员名称
+
身份证号
+
+ +
+
{{ index + 1 }}
+
{{ item.workerName }}
+
{{ item.idCard }}
+
+
+ +

暂无数据

+
+
+
+
+
@@ -181,7 +201,7 @@
-
+
@@ -274,8 +294,15 @@
- - + + @@ -323,12 +350,24 @@
-
开始轨迹动画
-
+
+ 开始轨迹动画 +
+
-
+
@@ -391,6 +430,7 @@ import { getAlarmRecordInfoApi, getHatDevOptionApi, + getEnterpriseTreeApi, addstandardDevApi, getRealtimeRecordInfo, getRealtimeRecordList, @@ -413,8 +453,8 @@ import { // import carIcon from "@/assets/images/carPosition/carIcon.png"; import carOn from "@/assets/images/carPosition/carOn2.png"; import carOff from "@/assets/images/carPosition/carOff2.png"; -import smartSafeHat from "@/assets/images/carPosition/smartSafeHat.png"; -import smartSafeHat2 from "@/assets/images//carPosition/smartSafeHat2.png"; +import smartSafeHat from "@/assets/images/carPosition/person.png"; +import smartSafeHat2 from "@/assets/images//carPosition/person2.png"; import personOff from "@/assets/images/carPosition/personOff.png"; import startIcon from "@/assets/images/carPosition/startIcon.png"; import endIcon from "@/assets/images/carPosition/endIcon.png"; @@ -449,7 +489,8 @@ let checkAll = ref(false); let checkAllFence = ref(false); let checkedCities = ref([]); let checkedFence = ref([]); -let devList = ref(["鲁U6675", "刘江", "蒋东", "鲁U9675"]); +let devList = ref([]); +let treeList = ref([]); let isIndeterminate = ref(true); let isIndeterminateFence = ref(true); let checked = ref(1); @@ -459,6 +500,7 @@ interface RuleForm { // fenceName: string // areaRadius: number } +let tree = ref(null); let addFormRef = ref(); // const addForm = reactive({ let addForm = ref({ @@ -518,7 +560,7 @@ let formFenceRules = ref({ message: "必填", trigger: "blur" } - ], + ], fenceName: [ { required: true, @@ -604,11 +646,11 @@ watch(choiceMonth, newVal => { getDayRunData(); } }); -function enlargeMap(){ - enlarge.value = true +function enlargeMap() { + enlarge.value = true; } -function notEnlargeMap(){ - enlarge.value = false +function notEnlargeMap() { + enlarge.value = false; } let isOpenDetail = ref(false); let workerListInFence = ref([]); @@ -622,17 +664,17 @@ function openDetail(item) { // workerListInFence.value = res.result.workerListInFence // } // }); - let welanBox = document.getElementById('welanMaskContainer') - if(welanBox){ - welanBox.style.zIndex= '999' + 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' + let welanBox = document.getElementById("welanMaskContainer"); + if (welanBox) { + welanBox.style.zIndex = "-1"; } isOpenDetail.value = false; } @@ -676,7 +718,7 @@ const resolveAddStr = computed(() => async (longitude: any, latitude: any) => { return "未知位置2"; }); -let regionList = ref([] as any); +let regionList = ref([] as any); function getRegionList() { let data = { projectSn: store.sn @@ -684,8 +726,8 @@ function getRegionList() { getRegionListApi(data).then(res => { if (res.success) { checkedFence.value = []; - regionList.value = res.result - console.log(regionList.value,777777777777777777777) + regionList.value = res.result; + console.log(regionList.value, 777777777777777777777); } }); } @@ -1197,7 +1239,8 @@ function getCrewListData() { }; console.log("👇智能安全帽--分类查询设备列表--查询参数"); console.log(data); - getHatDevOptionApi(data).then(res => { + // getHatDevOptionApi(data).then(res => { + getEnterpriseTreeApi(data).then(res => { console.log("👇智能安全帽--分类查询设备列表"); console.log(res); if (res.code == 200) { @@ -1224,13 +1267,25 @@ function getCrewListData() { // }); // nameOptions.value = nameOption.concat(carOption); nameOptions.value = nameOption.concat([]); - - devList.value = res.result; + treeList.value = res.result; + devList.value = flattenTree(res.result).filter(item => item.devSn); } else { ElMessage.error(res.message); } }); } +// 扁平化树形数据 +function flattenTree(tree) { + let result = []; + tree.forEach(item => { + result.push(item); + if (item.safetyHatDevs && item.safetyHatDevs.length > 0) { + result = result.concat(flattenTree(item.safetyHatDevs)); + } + }); + return result; +} + // 智能安全帽--查询报警信息 function getProgressListData() { let data = { @@ -1262,6 +1317,7 @@ function handleCheckAllChange(val) { clearFn(); let nameArr = devList.value.map(item => item.devSn); checkedCities.value = val ? nameArr : []; + tree.value.setCheckedKeys(checkedCities.value); isIndeterminate.value = false; if (val) { listData; @@ -1273,6 +1329,11 @@ function handleCheckAllChange(val) { getProgressListData(); drawFencePoint(); } +const handleCheck = () => { + checkedCities.value = tree?.value.getCheckedKeys().filter(item => item); + console.info(checkedCities.value, "checkedCities"); + handleCheckedCitiesChange(checkedCities.value); +}; function handleCheckedCitiesChange(value) { console.log("设备选中", value); clearFn(); @@ -1476,7 +1537,6 @@ function trackMapInit(path: any, item: any) { function createMarkerAndInfoWindow() { AMap.plugin("AMap.MoveAnimation", function () { - marker = new AMap.Marker({ map: map, position: path[0], @@ -1525,7 +1585,13 @@ function trackMapInit(path: any, item: any) { info.push('
人员名称: ' + item.workerName + "
"); // info.push('
最后更新时间: ' + item.updateTime + "
"); info.push('
最后更新时间: ' + item.uploadTime + "
"); - info.push('
经纬度: ' + item.longitude.toFixed(6) + "|" + item.latitude.toFixed(6) + "
"); + info.push( + '
经纬度: ' + + item.longitude.toFixed(6) + + "|" + + item.latitude.toFixed(6) + + "
" + ); info.push('
位置: ' + address + "
"); var infoWindow = new AMap.InfoWindow({ offset: new AMap.Pixel(30, -30), @@ -1864,7 +1930,13 @@ function echoCarMarker(item) { info.push('
人员名称: ' + item.workerName + "
"); // info.push('
最后更新时间: ' + item.updateTime + "
"); info.push('
最后更新时间: ' + item.uploadTime + "
"); - info.push('
经纬度: ' + item.longitude.toFixed(6) + "|" + item.latitude.toFixed(6) + "
"); + info.push( + '
经纬度: ' + + item.longitude.toFixed(6) + + "|" + + item.latitude.toFixed(6) + + "
" + ); info.push('
位置: ' + address + "
"); let infoWindow = new AMap.InfoWindow({ @@ -1923,7 +1995,13 @@ function echoPersonMarker(item) { info.push('
人员名称: ' + item.workerName + "
"); // info.push('
最后更新时间: ' + item.updateTime + "
"); info.push('
最后更新时间: ' + item.uploadTime + "
"); - info.push('
经纬度: ' + item.longitude.toFixed(6) + "|" + item.latitude.toFixed(6) + "
"); + info.push( + '
经纬度: ' + + item.longitude.toFixed(6) + + "|" + + item.latitude.toFixed(6) + + "
" + ); info.push('
位置: ' + address + "
"); var infoWindow = new AMap.InfoWindow({ @@ -1961,12 +2039,12 @@ function echoPersonMarker(item) { // } .welanMask { position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */ - z-index: -1; /* 确保遮罩层位于其他内容上方 */ + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */ + z-index: -1; /* 确保遮罩层位于其他内容上方 */ // position: absolute; // width: 99%; @@ -1996,7 +2074,7 @@ function echoPersonMarker(item) { height: 100%; // background-color: #fff; display: flex; - justify-content: start; + justify-content: flex-start; align-items: center; color: #fff; font-size: 26px; @@ -2493,10 +2571,10 @@ function echoPersonMarker(item) { margin-top: 1%; height: 38%; :deep(.h-card) { - .content { - margin-top: 4% !important; - } + .content { + margin-top: 4% !important; } + } .left-content { height: 100%; width: 100%; @@ -2689,7 +2767,7 @@ function echoPersonMarker(item) { box-shadow: 0px 0px 10px 0px rgba(39, 45, 69, 0.2); bottom: 8%; right: 1%; - img{ + img { width: 20px; height: 22px; margin: 6px auto; @@ -3021,4 +3099,56 @@ function echoPersonMarker(item) { } } } + +:deep() { + .el-tree { + background-color: transparent; + .el-tree-node { + white-space: normal; + &:focus > .el-tree-node__content { + background-color: transparent; + } + &.is-current > .el-tree-node__content { + background-color: rgba(81, 129, 246, 0.14); + color: #5181f6; + } + } + .el-tree-node__label { + color: #fff; + } + .el-tree-node__content { + position: relative; + &:hover { + background-color: rgba(81, 129, 246, 0.14); + color: #5181f6; + } + } + .el-tree-node__expand-icon { + font-size: 16px; + padding: 0 6px; + &.is-leaf { + color: transparent !important; + } + } + .treeTitle { + background-color: #f7f7f7; + margin-bottom: 10px; + } + } +} +.custom-tree-node { + width: 100%; + img { + width: 16px; + height: 16px; + margin-right: 4px; + } +} +.nodeName { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; + color: #fff; +}