人员管控

This commit is contained in:
cwchen 2024-08-16 10:59:25 +08:00
parent 4db1e0dff5
commit 94e640ade3
2 changed files with 90 additions and 107 deletions

View File

@ -60,4 +60,13 @@ export function getPersonDetail(query) {
method: 'get', method: 'get',
params: query params: query
}) })
}
/* 人员历史轨迹 */
export function getHistoryGj(query) {
return request({
url: '/bracelet/consControl/getHistoryGj',
method: 'get',
params: query
})
} }

View File

@ -17,7 +17,7 @@
<div class="content"> <div class="content">
<div id="searchBox" class="layout" v-if="isShowHistoryGj"> <div id="searchBox" class="layout" v-if="isShowHistoryGj">
<el-button type="primary" plain @click="clsoeHistoryGj" style="margin-right: 10px;">返回</el-button> <el-button type="primary" plain @click="clsoeHistoryGj" style="margin-right: 10px;">返回</el-button>
<el-date-picker v-model="chooseDate" @change="loadGj" :editable="false" :clearable="false" type="date" <el-date-picker v-model="chooseDate" @change="loadHistoryGj" :editable="false" :clearable="false" type="date"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择日期"> format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择日期">
</el-date-picker> </el-date-picker>
</div> </div>
@ -73,8 +73,9 @@
<div class="layout" v-if="person.sh.isWarn == 0"><img <div class="layout" v-if="person.sh.isWarn == 0"><img
src="../../../../assets/person_img/position_nowarn.png">正常 src="../../../../assets/person_img/position_nowarn.png">正常
</div> </div>
<div class="layout info" v-if="person.sh.isWarn == 1"><img <div class="layout" v-if="person.sh.isWarn == 1"><img
src="../../../../assets/person_img/position_warn.png">异常</div> src="../../../../assets/person_img/position_warn.png">异常
</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>
<div class="layout"> <div class="layout">
@ -169,7 +170,7 @@
</template> </template>
<script> <script>
import { personsTree, teamPersonByTower, spotCheck, getCheckConfig, checkConfig, getPersonsInfo, getPersonDetail } from "@/api/construction/manage/personManage.js"; import { personsTree, teamPersonByTower, spotCheck, getCheckConfig, checkConfig, getPersonsInfo, getPersonDetail, getHistoryGj } from "@/api/construction/manage/personManage.js";
import no_warn from "@/assets/svg/no_warn.svg"; import no_warn from "@/assets/svg/no_warn.svg";
import no_warn2 from "@/assets/svg/no_warn2.svg"; import no_warn2 from "@/assets/svg/no_warn2.svg";
import warn from "@/assets/svg/warn.svg"; import warn from "@/assets/svg/warn.svg";
@ -214,13 +215,6 @@ export default {
}, },
// //
rules: {}, rules: {},
//
deviceData: [
{ "position": { lng: 116.404, lat: 39.915 }, "deviceName": "设备11", show: false, },
{ "position": { lng: 116.405, lat: 39.915 }, "deviceName": "设备22", show: false, },
{ "position": { lng: 116.404, lat: 39.916 }, "deviceName": "设备33", show: false, },
{ "position": { lng: 116.404, lat: 39.917 }, "deviceName": "设备44", show: false, },
],
map: null, map: null,
BMap: null, BMap: null,
// //
@ -260,99 +254,33 @@ export default {
isPerson: false, isPerson: false,
isShowHistoryGj: false, isShowHistoryGj: false,
// //
gjArr: [ gjArr: [],
{ lon: 117.287800, lat: 31.255550 },
{ lon: 117.287450, lat: 31.255650 },
{ lon: 117.287700, lat: 31.255750 },
{ lon: 117.287650, lat: 31.255850 },
],
person: { person: {
name: '张三', name: null,
phone: '18855798259', phone: null,
teamName: '张三班组', teamName: null,
idCard: '341181199807165636', idCard: null,
warnName: '离开工作区域/人脸验证异常', warnName: null,
warnType: 'danger', warnType: 'success',
hasSafetyHat: true, hasSafetyHat: false,
sh: { sh: {
devId: 37, devId: null,
name: '1号手环', name: null,
elec: 10, elec: 0,
isWarn: 0, isWarn: 1,
temp: '37℃', temp: null,
heartRate: '80次/分', heartRate: null,
bloodPressure: '150/80mmHg', bloodPressure: null,
mjCode: '1号马甲' mjCode: null,
}, },
hat: { hat: {
name: '1号安全帽', name: null,
}, },
workTeamNum: 5, workTeamNum: 0,
workPersonNum: 30 workPersonNum: 0
}, },
// //
warnTable: [ warnTable: [],
{
warnTime: '2024-08-15 11:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 12:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 13:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 11:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 12:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 13:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 11:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 12:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 13:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 11:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 12:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 13:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 11:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 12:32:12',
warnContent: '离开工作区域'
},
{
warnTime: '2024-08-15 13:32:12',
warnContent: '离开工作区域'
},
],
// //
hatTable: [ hatTable: [
{ {
@ -550,7 +478,7 @@ export default {
this.dialogVisible2 = false this.dialogVisible2 = false
}, },
// //
laodPersonsInfo(params) { loadPersonsInfo(params) {
getPersonsInfo(params).then((res) => { getPersonsInfo(params).then((res) => {
const data = res.data; const data = res.data;
if (data) { if (data) {
@ -584,13 +512,54 @@ export default {
}).catch((res) => { }) }).catch((res) => { })
}, },
// //
loadPersonDetail() { loadPersonDetail(params) {
getPersonDetail(params).then((res) => { getPersonDetail(params).then((res) => {
const data = res.data; const data = res.data;
if (data) { if (data && data.vo) {
const obj = data.vo;
this.warnTable = obj.warnInfoList;
this.person.name = obj.name;
this.person.phone = obj.phone;
this.person.teamName = obj.teamName;
this.person.idCard = obj.idCard;
this.person.warnName = obj.warnName;
this.person.warnType = obj.warnType;
this.person.hasSafetyHat = obj.hasSafetyHat;
this.person.sh.devId = obj.bracelet.devId;
this.person.sh.name = obj.bracelet.name;
this.person.sh.elec = obj.bracelet.elec;
this.person.sh.isWarn = obj.bracelet.isWarn;
this.person.sh.temp = this.handleData(obj.bracelet.temp);
this.person.sh.heartRate = this.handleData(obj.bracelet.heartRate);
this.person.sh.bloodPressure = this.handleData(obj.bracelet.bloodPressure);
this.person.sh.mjCode = this.handleData(obj.mjCode);
this.person.hat.name = obj.safetyHat.name;
} }
}).catch((res) => { }) }).catch((res) => { })
}, },
//
loadHistoryGj() {
// ID
let obj = {
'id': this.person.sh.devId,
'startTime': this.chooseDate
};
getHistoryGj(obj).then((res) => {
const data = res.data;
if (data && data.length > 0) {
this.gjArr = data;
} else {
this.gjArr = [];
}
this.loadGj();
}).catch((res) => { })
},
handleData(value) {
if (!value) {
return '--';
}
return value;
},
handler({ BMap, map }) { handler({ BMap, map }) {
this.BMap = BMap; this.BMap = BMap;
this.map = map; this.map = map;
@ -623,7 +592,7 @@ export default {
'id': towerId, 'id': towerId,
'teamId': teamId 'teamId': teamId
} }
this.laodPersonsInfo(obj); this.loadPersonsInfo(obj);
} else if (node.level === 4) { } else if (node.level === 4) {
this.isTower = false; this.isTower = false;
this.isTeam = false; this.isTeam = false;
@ -671,6 +640,12 @@ export default {
this.isTower = false; this.isTower = false;
this.isTeam = false; this.isTeam = false;
this.isPerson = true; this.isPerson = true;
// idID type: 0 1
const obj = {
'id': item.id,
'type': item.type
}
this.loadPersonDetail(obj);
}, },
/* 添加人员定位的覆盖物 */ /* 添加人员定位的覆盖物 */
addPersonMarker(item) { addPersonMarker(item) {
@ -695,25 +670,24 @@ export default {
marker.addEventListener("click", () => { this.clickMarker(item) }); marker.addEventListener("click", () => { this.clickMarker(item) });
}, },
// //
openHistoryGj(devId) { openHistoryGj() {
this.removeOverlay(); this.removeOverlay();
this.loadHistoryGj();
this.isShowHistoryGj = true; this.isShowHistoryGj = true;
this.loadGj(this.chooseDate);
}, },
// //
clsoeHistoryGj(devId) { clsoeHistoryGj() {
this.removeOverlay(); this.removeOverlay();
this.isShowHistoryGj = false; this.isShowHistoryGj = false;
const obj = { const obj = {
'id': this.id, 'id': this.id,
'teamId': this.teamId 'teamId': this.teamId
} }
this.laodPersonsInfo(obj); this.loadPersonsInfo(obj);
}, },
// //
loadGj(val) { loadGj() {
this.removeOverlay(); this.removeOverlay();
alert(val);
const list = this.gjArr; const list = this.gjArr;
if (list.length >= 2) { // 2 if (list.length >= 2) { // 2
// //