施工管控修改

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) {
alert("第" + time + "次连接上视频服务器");
// alert("第" + 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,
//
checkDevCode: null
};
},
created() {
@ -204,8 +206,8 @@ export default {
},
methods: {
startRefresh() {
// 10
this.intervalId = setInterval(this.refreshData, 1000 * 60 * 10);
// 3
this.intervalId = setInterval(this.refreshData, 1000 * 60 * 3);
},
stopRefresh() {
if (this.intervalId) {
@ -264,6 +266,21 @@ export default {
} else {
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(() => { })
},
/* 加载近电感应设备 */

View File

@ -1,7 +1,10 @@
<template>
<div class="app-container" style="background-color: #F9F9F9;">
<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>
</el-tab-pane>
</el-tabs>
@ -13,6 +16,7 @@
import realTimeManage from './realTimeManage/realTimeManage.vue';
import personManage from './personManage/personManage.vue';
import hoistManage from './hoistManage/hoistManage.vue';
import { getPersonControlIsWarn } from "@/api/construction/index.js";
export default {
name: "manage",
components: {
@ -25,15 +29,35 @@ export default {
activeName: 'realTimeManage',
currentTab: 'realTimeManage', //
tabs: [
{ name: 'realTimeManage', label: '实时监控', content: 'realTimeManage', flag: true },
{ name: 'personManage', label: '人员管控', content: 'personManage', flag: false },
{ name: 'hoistManage', label: '吊装管控', content: 'hoistManage', flag: false },
{ name: 'realTimeManage', label: '实时监控', isWarn: 0, content: 'realTimeManage', flag: true },
{ name: 'personManage', label: '人员管控', isWarn: 1, content: 'personManage', flag: false },
{ name: 'hoistManage', label: '吊装管控', isWarn: 0, content: 'hoistManage', flag: false },
],
};
},
created() {
this.loadPersonControlIsWarn();
},
mounted() {
this.startRefresh();
},
destroyed() {
this.stopRefresh();
},
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) {
const arr = this.tabs
for (var i = 0; i < arr.length; i++) {
@ -44,7 +68,17 @@ export default {
}
}
this.tabs = arr
}
},
//
loadPersonControlIsWarn() {
getPersonControlIsWarn().then(res => {
console.error(res.data);
this.tabs[1].isWarn = res.data;
this.$forceUpdate();
}).catch(res => {
});
},
}
};
</script>

View File

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

View File

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