diff --git a/sgzb-ui/src/api/store/iotManagement.js b/sgzb-ui/src/api/store/iotManagement.js index 197f4718..a78122c3 100644 --- a/sgzb-ui/src/api/store/iotManagement.js +++ b/sgzb-ui/src/api/store/iotManagement.js @@ -96,3 +96,11 @@ export const getIotDeviceLocationApi = (data) => { export const getIotDeviceTripApi = (data) => { return request.post('/material/iotMachine/searchItinerary', data) } +/** 获取机具设备的停留点信息 */ +export const getIotDeviceParkDetailApi = (data) => { + return request.post('/material/iotMachine/reportParkDetailByTime', data) +} +/** 获取机具设备的报警信息 */ +export const getIotDeviceAlarmApi = (data) => { + return request.post('/material/iotMachine/reportAlarm', data) +} diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue index 094fe3f8..ff81bfe5 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue @@ -1,257 +1,351 @@ diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue index 585d0914..c6e4873d 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue @@ -18,7 +18,7 @@
{{ engineering }}工程
- + -
    +
    @@ -90,22 +90,38 @@
    -
    +
    - 1 - 2024-07-18 01:18:53 - 1时19分 + {{ + index + 1 + }} + {{ item.startTime }} + {{ item.hours }}时{{ + item.mints + }}分
    -

    安徽省------

    +

    {{ item.address }}

    -
    +
    - 1 - 2024-07-18 01:18:53 + {{ + index + 1 + }} + {{ item.warnTime }}
    -

    手动触发紧急报警---------

    +

    {{ item.startAlarm }}

    @@ -127,6 +143,8 @@ import moment from 'moment' import { getIotDeviceLocationApi, getIotDeviceTripApi, + getIotDeviceParkDetailApi, + getIotDeviceAlarmApi, } from '@/api/store/iotManagement.js' export default { name: 'MapDialog', @@ -189,6 +207,8 @@ export default { // 行程信息 tripList: [], activeIndex: '', + // 停留点信息 + parkList: [], } }, created() { @@ -237,8 +257,44 @@ export default { const res = await getIotDeviceTripApi({ ...this.tripParams }) console.log(res, '行程信息--') + const resS = await getIotDeviceParkDetailApi({ ...this.tripParams }) + + console.log(resS, '停留点信息--') + + const params = { ...this.tripParams } + params.beginTime = params.beginTime.slice(0, 10) + params.endTime = params.endTime.slice(0, 10) + const resSs = await getIotDeviceAlarmApi(params) + + this.warningList = resSs.data + this.warningList.forEach((e) => { + e.warnTime = moment(parseInt(e.startAlarmTime)).format( + 'YYYY-MM-DD HH:mm:ss', + ) + }) + console.log(resSs, '报警信息--') + + this.parkList = resS.data + this.parkList.forEach((e) => { + e.startTime = moment(parseInt(e.beginTime)).format( + 'YYYY-MM-DD HH:mm:ss', + ) + + e.hours = parseInt( + (parseInt(e.endTime) - parseInt(e.beginTime)) / + 1000 / + 60 / + 60, + ) + e.mints = parseInt( + ((parseInt(e.endTime) - parseInt(e.beginTime)) / + 1000 / + 60) % + 60, + ) + }) let tripInfo = JSON.parse(res.msg) - console.log(tripInfo, '反序列化之后') + console.log(tripInfo, '反序列化之后', this.parkList) let addressList = [] if (tripInfo.addressmap) { @@ -246,7 +302,9 @@ export default { } tripInfo.totaltrips.forEach((e) => { - e.startTime = moment(e.startTime).format('YYYY-MM-DD HH:mm:ss') + e.startTime = moment(e.trackstarttime).format( + 'YYYY-MM-DD HH:mm:ss', + ) e.endTime = moment(e.trackendtime).format('YYYY-MM-DD HH:mm:ss') e.drivingDuration = parseInt(