fix: BUG修改

This commit is contained in:
kun 2024-05-14 09:58:26 +08:00
parent e980cbe92c
commit 7b8d3e3994
4 changed files with 94 additions and 53 deletions

View File

@ -17,6 +17,10 @@ export const getEpSuroundInfoApi = (params: {}) => {
export const getEpAlarmRecordInfoApi = (params: {}) => {
return http.get(BASEURL + `/xmgl/mechanicalEquipmentPositionAlarm/list`, params);
};
// 机械设备定位--分页查询报警信息
export const getEpAlarmRecordInfoPageApi = (params: {}) => {
return http.get(BASEURL + `/xmgl/mechanicalEquipmentPositionAlarm/page`, params);
};
// 机械设备定位--查询实时数据信息
export const getEpRealtimeDataApi = (params: {}) => {
return http.get(BASEURL + `/xmgl/mechanicalEquipmentPositionData/list`, params);

View File

@ -22,6 +22,10 @@ export const getSuroundInfoApi = (params: {}) => {
export const getAlarmRecordInfoApi = (params: {}) => {
return http.get(BASEURL + `/xmgl/safetyHatAlarm/list`, params);
};
// 智能安全帽--分页查询报警信息
export const getAlarmRecordInfoPageApi = (params: {}) => {
return http.get(BASEURL + `/xmgl/safetyHatAlarm/page`, params);
};
// 智能安全帽--查询实时数据信息
export const getRealtimeDataApi = (params: {}) => {
return http.get(BASEURL + `/xmgl/safetyHatData/newestList`, params);

View File

@ -233,7 +233,7 @@
<div style="width: 20%">报警时间</div>
<div style="width: 30%">报警信息</div>
</div>
<el-scrollbar class="list-box">
<el-scrollbar class="list-box" ref="refScrollbar">
<div v-for="(item, index) in listData" class="list-style" :key="item.id">
<div style="width: 5%">{{ index + 1 }}</div>
<div style="width: 20%">{{ item.equipmentName }}</div>
@ -259,7 +259,7 @@ import {
getEpDevOptionApi,
getEpTypeTotalApi,
getEpSuroundInfoApi,
getEpAlarmRecordInfoApi,
getEpAlarmRecordInfoPageApi,
getEpRealtimeDataApi,
getEpRealtimeDataPageApi,
getEpDayRecordApi,
@ -289,6 +289,8 @@ var marker;
var lineArr;
var mapInstance;
var map;
const refScrollbar = ref(null as any); //
let moreScroll = ref(true as any);
let choiceMonth = ref("2023-11");
let dayRunRecord = ref([]); //
let hasRealTime = ref(false);
@ -392,7 +394,7 @@ onMounted(() => {
choiceMonth.value = formatMonthTime(dayValue.value);
// console.log("", choiceMonth.value);
initMap();
getProgressListData();
getProgressListData('search');
getCrewListData();
getFenceList();
getFenceType();
@ -400,6 +402,20 @@ onMounted(() => {
window.addEventListener("resize", e => {
resetMapSize();
});
refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => {
// console.log("", e);
const scrollTop = e.target.scrollTop;
const scrollHeight = e.target.scrollHeight;
const clientHeight = e.target.clientHeight;
// console.log("", scrollTop, scrollHeight, clientHeight);
//
if (scrollTop >= scrollHeight - clientHeight - 1) {
// console.log("");
if (moreScroll.value) {
getProgressListData('more');
}
}
});
});
onBeforeMount(() => {
window.removeEventListener("resize", e => {
@ -462,7 +478,7 @@ function refreshDev() {
queryInfo.value.devSn = "";
clearFn();
getCrewListData();
getProgressListData();
getProgressListData('search');
}
function areaRadiusChange() {
@ -669,7 +685,7 @@ function getTodayMeter(day: any) {
//
function devChange(e) {
console.log("设备改变", e);
getProgressListData();
getProgressListData('search');
if (checked.value === 2) {
getDayRunData();
}
@ -777,14 +793,6 @@ function handle(type, show) {
show: show
};
}
function SizeChange(val) {
pagInfo.value.pageSize = val;
getProgressListData();
}
function CurrentChange(val) {
pagInfo.value.pageNo = val;
getProgressListData();
}
//
function getCrewListData() {
let onlineType = "";
@ -827,20 +835,25 @@ function getCrewListData() {
});
}
//
function getProgressListData() {
let data = {
// pageNo: pagInfo.value.pageNo,
// pageSize: pagInfo.value.pageSize,
async function getProgressListData(tip:any) {
let requestData:any = {
devSns: alarmDevSn.value,
projectSn: store.sn
};
getEpAlarmRecordInfoApi(data).then(res => {
if (res.code == 200) {
listData.value = res.result;
// pagInfo.value.total = res.result.total;
pagInfo.value.total = res.result.length;
}
});
projectSn: store.sn,
pageNo: tip == 'search'?1:pagInfo.value.pageNo,
pageSize: 100
}
const res: any = await getEpAlarmRecordInfoPageApi(requestData);
console.log("获取历史数据", res);
if(tip == 'more'){
listData.value = listData.value.concat(res.result.records);
} else {
listData.value = res.result.records;
}
if (res.result.pages == pagInfo.value.pageNo) {
moreScroll.value = false;
} else {
pagInfo.value.pageNo = pagInfo.value.pageNo + 1;
}
}
function fenceNameChange(e) {
console.log("围栏名称", e);
@ -862,7 +875,7 @@ function handleCheckAllChange(val) {
queryInfo.value.devSn = "";
}
alarmDevSn.value = "";
getProgressListData();
getProgressListData('search');
drawFencePoint();
}
function handleCheckedCitiesChange(value) {
@ -902,7 +915,7 @@ function pointSelectChange() {
}
alarmDevSn.value = warnDevSn;
console.log("当前devSn", alarmDevSn.value);
getProgressListData();
getProgressListData('search');
}
function fenceAllChange(val) {
@ -969,7 +982,7 @@ function selectChange(e) {
// queryInfo.value.devSn = devList.value[0].value;
queryInfo.value.devSn = nameOptions.value[0].value;
alarmDevSn.value = "";
getProgressListData();
getProgressListData('search');
getDayRunData();
}
}

View File

@ -322,7 +322,7 @@
<div style="width: 20%">报警时间</div>
<div style="width: 40%">报警信息</div>
</div>
<el-scrollbar class="list-box">
<el-scrollbar class="list-box" ref="refScrollbar">
<div v-for="(item, index) in listData" class="list-style" :key="item.id">
<div style="width: 10%">{{ index + 1 }}</div>
<div style="width: 15%">{{ item.workerName }}</div>
@ -347,7 +347,7 @@
<script setup lang="ts">
// import { getWorkerInfoList } from "@/assets/js/api/laborPerson";
import {
getAlarmRecordInfoApi,
getAlarmRecordInfoPageApi,
getHatDevOptionApi,
getWeekAlarmDataApi,
getRealtimeDataApi,
@ -374,6 +374,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import type { FormInstance, FormRules } from "element-plus";
import Card from "@/components/card.vue";
import * as echarts from "echarts";
import moment from "moment"
const store = GlobalStore();
import { computed, reactive, ref, onMounted, onBeforeMount, watch } from "vue";
var mouseTool;
@ -381,6 +382,8 @@ var marker;
var lineArr;
var mapInstance;
var map;
const refScrollbar = ref(null as any); //
let moreScroll = ref(true as any);
let choiceMonth = ref("2023-11");
let dayRunRecord = ref([]); //
let hasRealTime = ref(false);
@ -509,7 +512,7 @@ onMounted(async () => {
// console.log("", choiceMonth.value);
initMap();
// --
getProgressListData();
getProgressListData('search');
// --
getCrewListData();
// --
@ -524,6 +527,20 @@ onMounted(async () => {
window.addEventListener("resize", e => {
resetMapSize();
});
refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => {
// console.log("", e);
const scrollTop = e.target.scrollTop;
const scrollHeight = e.target.scrollHeight;
const clientHeight = e.target.clientHeight;
// console.log("", scrollTop, scrollHeight, clientHeight);
//
if (scrollTop >= scrollHeight - clientHeight - 1) {
// console.log("");
if (moreScroll.value) {
getProgressListData('more');
}
}
});
});
onBeforeMount(() => {
window.removeEventListener("resize", e => {
@ -882,7 +899,7 @@ function refreshDev() {
queryInfo.value.devSn = "";
clearFn();
getCrewListData();
getProgressListData();
getProgressListData('search');
getLineEcharts();
getFenceList();
}
@ -938,7 +955,7 @@ function getDayRunData() {
projectSn: store.sn,
devSn: queryInfo.value.devSn,
// month: choiceMonth.value
day: dayValue.value
day: moment(dayValue.value).format("YYYY-MM-DD")
};
console.log("👇日行数据月份查询参数");
console.log(data);
@ -973,7 +990,7 @@ function getTodayMeter(day: any) {
//
function devChange(e) {
console.log("设备改变", e);
getProgressListData();
getProgressListData('search');
if (checked.value === 2) {
getDayRunData();
}
@ -1150,22 +1167,25 @@ function getCrewListData() {
});
}
// --
function getProgressListData() {
let data = {
// pageNo: pagInfo.value.pageNo,
// pageSize: pagInfo.value.pageSize,
async function getProgressListData(tip:any) {
let requestData:any = {
devSns: alarmDevSn.value,
projectSn: store.sn
};
getAlarmRecordInfoApi(data).then(res => {
console.log("👇智能安全帽--查询报警信息");
console.log(res);
if (res.code == 200) {
listData.value = res.result;
pagInfo.value.total = res.result.total;
}
});
projectSn: store.sn,
pageNo: tip == 'search'?1:pagInfo.value.pageNo,
pageSize: 100
}
const res: any = await getAlarmRecordInfoPageApi(requestData);
console.log("获取历史数据", res);
if(tip == 'more'){
listData.value = listData.value.concat(res.result.records);
} else {
listData.value = res.result.records;
}
if (res.result.pages == pagInfo.value.pageNo) {
moreScroll.value = false;
} else {
pagInfo.value.pageNo = pagInfo.value.pageNo + 1;
}
}
function fenceNameChange(e) {
console.log("围栏名称", e);
@ -1188,7 +1208,7 @@ function handleCheckAllChange(val) {
queryInfo.value.devSn = "";
}
alarmDevSn.value = "";
getProgressListData();
getProgressListData('search');
drawFencePoint();
}
function handleCheckedCitiesChange(value) {
@ -1234,7 +1254,7 @@ function pointSelectChange() {
}
alarmDevSn.value = warnDevSn;
console.log("当前devSn", alarmDevSn.value);
getProgressListData();
getProgressListData('search');
}
function fenceAllChange(val) {
@ -1303,7 +1323,7 @@ function selectChange(e) {
queryInfo.value.devSn = nameOptions.value[0].value;
// queryInfo.value.devSn = devList.value[0].devSn;
// alarmDevSn.value = "";
getProgressListData();
getProgressListData('search');
getDayRunData();
}
}