施工管控修改

This commit is contained in:
cwchen 2024-09-29 15:36:20 +08:00
parent 58db31c668
commit d23d86945e
7 changed files with 111 additions and 31 deletions

View File

@ -81,11 +81,11 @@
} }
function onServerOpen(time) { function onServerOpen(time) {
alert("第" + time + "次连接上视频服务器"); // alert("第" + time + "次连接上视频服务器");
} }
function onServerClose(time) { function onServerClose(time) {
alert("第" + time + "次断开视频服务器"); // alert("第" + time + "次断开视频服务器");
} }
//视频================================================================================================ //视频================================================================================================

View File

@ -0,0 +1,9 @@
import request from '@/utils/request'
/* 判断人员管控是否有告警 */
export function getPersonControlIsWarn(query) {
return request({
url: '/bracelet/consControl/getPersonControlIsWarn',
method: 'get',
params: query
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 B

View File

@ -186,6 +186,8 @@ export default {
}, },
// //
intervalId: null, intervalId: null,
//
checkDevCode: null
}; };
}, },
created() { created() {
@ -204,8 +206,8 @@ export default {
}, },
methods: { methods: {
startRefresh() { startRefresh() {
// 10 // 3
this.intervalId = setInterval(this.refreshData, 1000 * 60 * 10); this.intervalId = setInterval(this.refreshData, 1000 * 60 * 3);
}, },
stopRefresh() { stopRefresh() {
if (this.intervalId) { if (this.intervalId) {
@ -264,6 +266,21 @@ export default {
} else { } else {
this.isShow = false; this.isShow = false;
} }
if (this.checkDevCode) {
this.devArr.forEach((item, index) => {
if (item.devCode === this.checkDevCode) {
this.devArr[index].status = 'check'
//
if (warnPosition) {
this.dz_dev_warn_img = require('../../../../assets/gif/' + warnPosition + '.gif');
} else {
this.dz_dev_warn_img = dz_dev_warn_img;
}
}
})
// dom
this.$forceUpdate();
}
}).catch(() => { }) }).catch(() => { })
}, },
/* 加载近电感应设备 */ /* 加载近电感应设备 */

View File

@ -1,7 +1,10 @@
<template> <template>
<div class="app-container" style="background-color: #F9F9F9;"> <div class="app-container" style="background-color: #F9F9F9;">
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane v-for="(item, index) in tabs" :key="index" :label="item.label" :name="item.name" lazy> <!-- <el-tab-pane v-for="(item, index) in tabs" :key="index" :label="item.label" :name="item.name" lazy> -->
<el-tab-pane v-for="(item, index) in tabs" :key="index" :name="item.name" lazy>
<span slot="label"><img v-if="item.label === '人员管控' && item.isWarn === 1"
src="../../../assets/images/warn_img.png">{{ item.label }}</span>
<component :is=item.content v-if="item.flag"></component> <component :is=item.content v-if="item.flag"></component>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -13,6 +16,7 @@
import realTimeManage from './realTimeManage/realTimeManage.vue'; import realTimeManage from './realTimeManage/realTimeManage.vue';
import personManage from './personManage/personManage.vue'; import personManage from './personManage/personManage.vue';
import hoistManage from './hoistManage/hoistManage.vue'; import hoistManage from './hoistManage/hoistManage.vue';
import { getPersonControlIsWarn } from "@/api/construction/index.js";
export default { export default {
name: "manage", name: "manage",
components: { components: {
@ -25,15 +29,35 @@ export default {
activeName: 'realTimeManage', activeName: 'realTimeManage',
currentTab: 'realTimeManage', // currentTab: 'realTimeManage', //
tabs: [ tabs: [
{ name: 'realTimeManage', label: '实时监控', content: 'realTimeManage', flag: true }, { name: 'realTimeManage', label: '实时监控', isWarn: 0, content: 'realTimeManage', flag: true },
{ name: 'personManage', label: '人员管控', content: 'personManage', flag: false }, { name: 'personManage', label: '人员管控', isWarn: 1, content: 'personManage', flag: false },
{ name: 'hoistManage', label: '吊装管控', content: 'hoistManage', flag: false }, { name: 'hoistManage', label: '吊装管控', isWarn: 0, content: 'hoistManage', flag: false },
], ],
}; };
}, },
created() { created() {
this.loadPersonControlIsWarn();
},
mounted() {
this.startRefresh();
},
destroyed() {
this.stopRefresh();
}, },
methods: { methods: {
startRefresh() {
// 3
this.intervalId = setInterval(this.refreshData, 1000 * 60 * 3);
},
stopRefresh() {
if (this.intervalId) {
clearInterval(this.intervalId);
this.intervalId = null;
}
},
refreshData() {
this.loadPersonControlIsWarn();
},
handleClick(tab, event) { handleClick(tab, event) {
const arr = this.tabs const arr = this.tabs
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
@ -44,7 +68,17 @@ export default {
} }
} }
this.tabs = arr this.tabs = arr
} },
//
loadPersonControlIsWarn() {
getPersonControlIsWarn().then(res => {
console.error(res.data);
this.tabs[1].isWarn = res.data;
this.$forceUpdate();
}).catch(res => {
});
},
} }
}; };
</script> </script>

View File

@ -32,7 +32,7 @@
</div> </div>
<!-- 班组 --> <!-- 班组 -->
<div id="team-box" v-if="isTeam"> <div id="team-box" v-if="isTeam">
<h4>智能安全帽</h4> <!-- <h4>智能安全帽</h4>
<el-table :data="hatTable" style="width: 100%" max-height="400"> <el-table :data="hatTable" style="width: 100%" max-height="400">
<el-table-column prop="name" label="姓名" align="center"> <el-table-column prop="name" label="姓名" align="center">
</el-table-column> </el-table-column>
@ -43,8 +43,8 @@
<img style="cursor: pointer;margin-right: 10px;" title="对讲" src="../../../../assets/person_img/talk.png"> <img style="cursor: pointer;margin-right: 10px;" title="对讲" src="../../../../assets/person_img/talk.png">
<img style="cursor: pointer;" title="视频" src="../../../../assets/person_img/video.png"> <img style="cursor: pointer;" title="视频" src="../../../../assets/person_img/video.png">
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table> -->
</div> </div>
<!-- 人员 --> <!-- 人员 -->
<div id="person-box" v-if="isPerson"> <div id="person-box" v-if="isPerson">
@ -78,7 +78,7 @@
src="../../../../assets/person_img/position_nowarn.png">正常 src="../../../../assets/person_img/position_nowarn.png">正常
</div> </div>
<div class="layout" v-if="person.sh.isWarn == 1"><img <div class="layout" v-if="person.sh.isWarn == 1"><img
src="../../../../assets/person_img/position_warn.png">异常 src="../../../../assets/person_img/position_warn.png"><span style="color: red;">异常</span>
</div> </div>
<div class="layout info"><img src="../../../../assets/person_img/temp.png">{{ person.sh.temp }}</div> <div class="layout info"><img src="../../../../assets/person_img/temp.png">{{ person.sh.temp }}</div>
</div> </div>
@ -332,8 +332,8 @@ export default {
}, },
methods: { methods: {
startRefresh() { startRefresh() {
// 10 // 3
this.intervalId = setInterval(this.refreshData, 1000 * 60 * 10); this.intervalId = setInterval(this.refreshData, 1000 * 60 * 3);
}, },
stopRefresh() { stopRefresh() {
if (this.intervalId) { if (this.intervalId) {
@ -342,13 +342,13 @@ export default {
} }
}, },
async refreshData() { async refreshData() {
this.$message('页面刷新了'); // this.$message('');
// //
this.treeData.splice(0); this.treeData.splice(0);
this.idArr.splice(0); this.idArr.splice(0);
await this.getPersonsTree(); await this.getPersonsTree();
if (this.filterText) { if (this.filterText) {
this.$refs.tree.filter(); this.$refs.tree.filter(this.filterText);
} }
if (this.checkNodeId) { if (this.checkNodeId) {
this.$refs.tree.setCurrentKey(this.checkNodeId); this.$refs.tree.setCurrentKey(this.checkNodeId);
@ -356,10 +356,10 @@ export default {
this.idArr.push(this.checkNodeId); this.idArr.push(this.checkNodeId);
} }
if (this.checkNodeLevel === 2) { // if (this.checkNodeLevel === 2) { //
this.$message('刷新杆塔选中的数据'); // this.$message('');
this.loadWorkInfo(); this.loadWorkInfo();
} else if (this.checkNodeLevel === 3) { // } else if (this.checkNodeLevel === 3) { //
this.$message('刷新班组选中的数据'); // this.$message('');
this.removeOverlay(); this.removeOverlay();
const obj = { const obj = {
'id': this.checkNodeTowerId, 'id': this.checkNodeTowerId,
@ -367,13 +367,18 @@ export default {
} }
this.loadPersonsInfo(obj, null); this.loadPersonsInfo(obj, null);
} else if (this.checkNodeLevel === 4) { // } else if (this.checkNodeLevel === 4) { //
this.$message('刷新班组人员选中的数据'); // this.$message('');
if (!this.isShowHistoryGj) {
this.removeOverlay(); this.removeOverlay();
const obj = { const obj = {
'id': this.checkNodeTowerId, 'id': this.checkNodeTowerId,
'teamId': this.checkTeamId 'teamId': this.checkTeamId
} }
this.loadPersonsInfo(obj, this.checkPersonObj); this.loadPersonsInfo(obj, this.checkPersonObj);
} else {
this.removeOverlay();
this.loadHistoryGj();
}
} }
} }
}, },
@ -415,6 +420,14 @@ export default {
}, },
/* 人员树过滤 */ /* 人员树过滤 */
filterNode(value, data, node) { filterNode(value, data, node) {
/* if (!value) {
if (node.level == 1 || node.level == 2) {
node.expanded = true
} else {
node.expanded = false
}
return true
} */
// //
let val = value.toLowerCase() let val = value.toLowerCase()
return this.chooseNode(val, data, node) return this.chooseNode(val, data, node)
@ -719,12 +732,16 @@ export default {
}, },
// //
clickMarker(item) { clickMarker(item) {
this.checkNodeLevel = 4;
this.checkPersonObj = item;
let userId = null; let userId = null;
if (new RegExp(/^[0-9]*$/).test(item.id)) { if (new RegExp(/^[0-9]*$/).test(item.id)) {
userId = item.id; userId = item.id;
this.$refs.tree.setCurrentKey(item.type === 0 ? 'zs-' + item.id : 'ls-' + item.id); this.$refs.tree.setCurrentKey(item.type === 0 ? 'zs-' + item.id : 'ls-' + item.id);
this.checkNodeId = item.type === 0 ? 'zs-' + item.id : 'ls-' + item.id;
} else { } else {
userId = item.type === 0 ? parseInt(item.id.replace('zs-', '')) : parseInt(item.id.replace('ls-', '')) userId = item.type === 0 ? parseInt(item.id.replace('zs-', '')) : parseInt(item.id.replace('ls-', ''))
this.checkNodeId = item.id;
} }
const allOverlay = this.map.getOverlays(); const allOverlay = this.map.getOverlays();
for (let index = 0; index < allOverlay.length; index++) { for (let index = 0; index < allOverlay.length; index++) {
@ -786,15 +803,16 @@ export default {
marker.isWarn = item.isWarn; marker.isWarn = item.isWarn;
this.map.addOverlay(marker); this.map.addOverlay(marker);
// //
console.error(item);
marker.addEventListener("click", () => { this.clickMarker(item) }); marker.addEventListener("click", () => { this.clickMarker(item) });
}, },
// //
openHistoryGj() { openHistoryGj() {
if (!this.isShowHistoryGj) {
this.removeOverlay(); this.removeOverlay();
this.loadHistoryGj(); this.loadHistoryGj();
this.isShowHistoryGj = true; this.isShowHistoryGj = true;
}
}, },
// //
closeHistoryGj() { closeHistoryGj() {
@ -908,7 +926,7 @@ export default {
checkedNodes.forEach(item => { checkedNodes.forEach(item => {
console.error(item.parentId); console.error(item.parentId);
if (item.parentId !== -1 && item.parentId !== 0) { if (item.parentId !== -1 && item.parentId !== 0) {
checkArr.push({ "userId": item.id, "userType": item.userType, "devCode": item.devCode, "shCode": item.shCode }) checkArr.push({ "userId": parseInt(item.id.replace('team-', '')), "userType": item.userType, "devCode": item.devCode, "shCode": item.shCode })
} }
}); });
if (checkArr.length == 0) { if (checkArr.length == 0) {
@ -920,6 +938,8 @@ export default {
const obj = { const obj = {
'spotCheckList': checkArr 'spotCheckList': checkArr
} }
console.log(obj);
spotCheck(obj).then((res) => { spotCheck(obj).then((res) => {
this.$modal.msgSuccess(res.msg); this.$modal.msgSuccess(res.msg);
this.dialogVisible1 = false; this.dialogVisible1 = false;

View File

@ -201,7 +201,7 @@ export default {
this.idArr.splice(0); this.idArr.splice(0);
await this.laodBallDeviceLists(); await this.laodBallDeviceLists();
if(this.filterText){ if(this.filterText){
this.$refs.tree.filter(); this.$refs.tree.filter(this.filterText);
} }
if(this.checkNodeId){ if(this.checkNodeId){
this.$refs.tree.setCurrentKey(this.checkNodeId); this.$refs.tree.setCurrentKey(this.checkNodeId);