Commit b9c7f8ab by 匡雅琴

提交

1 parent 7f757649
......@@ -35,8 +35,6 @@ export default {
},
methods: {
drawBarLine() {
console.log(this.xAxisData);
console.log(this.dataList);
this.barLineOptions = {
xAxis: {
type: 'category',
......
......@@ -76,7 +76,7 @@ export default {
console.log(this.list);
// 指定图表的配置项和数据
var storedList = this.list;
const pointerData = this.list.length ? this.list[0].alarmLevel : 0
const pointerData = this.list.length ? this.list[0].value : 0
this.option = {
backgroundColor: "",
......@@ -106,7 +106,7 @@ export default {
if (!storedList.length) {
return `{无警情<br/>无风险}`;
} else {
return `${storedList[0].alarmLevel}级警情`;
return `${storedList[0].alarmLevel / 1}级警情`;
}
},
textStyle: {
......
......@@ -8,32 +8,32 @@
<div class="top-box">
<template v-if="alarmData.data.length">
<div v-for="item in alarmData.data" :key="item" class="top-box-item">
<div class="top-box-item-left">{{item.alarmName}}</div>
<div class="top-box-item-right">
<div :class="['item', item.alarmLevel <= 5 ? 'item1' : 'item1-grey']"></div>
<div :class="['item', item.alarmLevel <= 4 ? 'item2' : 'item-grey']"></div>
<div :class="['item', item.alarmLevel <= 3 ? 'item3' : 'item-grey']"></div>
<div :class="['item', item.alarmLevel <= 2 ? 'item4' : 'item-grey']"></div>
<div :class="['item', item.alarmLevel <= 1 ? 'item5' : 'item5-grey']"></div>
</div>
<div class="top-box-item-left">{{ item.alarmName }}</div>
<div class="top-box-item-right">
<div :class="['item', item.alarmLevel <= 5 ? 'item1' : 'item1-grey']"></div>
<div :class="['item', item.alarmLevel <= 4 ? 'item2' : 'item-grey']"></div>
<div :class="['item', item.alarmLevel <= 3 ? 'item3' : 'item-grey']"></div>
<div :class="['item', item.alarmLevel <= 2 ? 'item4' : 'item-grey']"></div>
<div :class="['item', item.alarmLevel <= 1 ? 'item5' : 'item5-grey']"></div>
</div>
</div>
</template>
<template v-else>
<div class="top-box-item">
<div class="top-box-item-left">防拆报警</div>
<div class="top-box-item-right-none"></div>
<div class="top-box-item-left">防拆报警</div>
<div class="top-box-item-right-none"></div>
</div>
<div class="top-box-item">
<div class="top-box-item-left">高危区域内长停</div>
<div class="top-box-item-right-none"></div>
<div class="top-box-item-left">高危区域内长停</div>
<div class="top-box-item-right-none"></div>
</div>
<div class="top-box-item">
<div class="top-box-item-left">双设备分离</div>
<div class="top-box-item-right-none"></div>
<div class="top-box-item-left">双设备分离</div>
<div class="top-box-item-right-none"></div>
</div>
<div class="top-box-item">
<div class="top-box-item-left">安装点长停</div>
<div class="top-box-item-right-none"></div>
<div class="top-box-item-left">安装点长停</div>
<div class="top-box-item-right-none"></div>
</div>
<div class="tips">
<div>车辆无警情</div>
......@@ -93,14 +93,16 @@
</div>
<div class="detail-msg">
<div class="detail-msg-left">设备状态:</div>
<div class="detail-msg-desc"> {{ basicData.deviceInformationVOList ? basicData.deviceInformationVOList[0].deviceStateStr : '-' }}</div>
<div class="detail-msg-desc"> {{ basicData.deviceInformationVOList ?
basicData.deviceInformationVOList[0].deviceStateStr : '-' }}</div>
</div>
</div>
</div>
<!-- 用车行为分析 -->
<div class="use-car-box">
<div class="title">用车行为分析</div>
<LineCharts class="line-charts" v-if="useCarData.length" id="useCarCharts" ref="useCarChartsRef" height="250px" :dataList="useCarData" :xAxisData="xAxisDataList"></LineCharts>
<LineCharts class="line-charts" v-if="useCarData.length" id="useCarCharts" ref="useCarChartsRef" height="250px"
:dataList="useCarData" :xAxisData="xAxisDataList"></LineCharts>
<div v-else class="empty-box">
<img src="../../assets/images/empty-status.png" alt="">
<div>暂无里程数据</div>
......@@ -116,6 +118,8 @@ import ParCharts from './ParCharts.vue';
import mapService from "@/utils/mapService.js";
import LineCharts from './LineCharts.vue';
import { services } from "@/api";
import "utils/mapEvent.js";
import EventBus from "../../event-bus";
import { GET_STAY_POINTLIST, GET_BASIC_INFORMATION, GET_RESIDENT_INFORMATION, GET_ALARM_POINTLIST, GET_USER_BEHAVIOR_INFORMATION, GET_HISTORY_LOCATION } from "@/api/services/monitor";
const MONITOR_SERVICE = services.monitor;
export default {
......@@ -143,10 +147,10 @@ export default {
mounted() {
let _this = this;
_this.$mapInit({ version: "2.0" }).then((AMap) => {
_this.$mapInit({ version: '1.4.2' }).then(AMap => {
window.AMap = AMap;
_this.initMap();
});
})
// _this.$refs.pieChartsRef.draw()
// _this.$refs.useCarChartsRef.drawBarLine()
// _this.searchAlarm()
......@@ -161,8 +165,7 @@ export default {
methods: {
initMap() {
let check = () => {
this.checkLoadedTimeoutId &&
window.clearTimeout(this.checkLoadedTimeoutId);
this.checkMapLoaded && window.clearTimeout(this.checkMapLoaded);
return setTimeout(() => {
if (
......@@ -170,47 +173,22 @@ export default {
typeof AMap.Map == "function" &&
!this.mapObj
) {
console.log(88888);
window.AMap = AMap;
this.mapObj = mapService.init("map");
console.log(this.mapObj);
//this.bindEvent();
this.isInitMap = true;
if (this.$route.query.snArr) {
let routeQuery = JSON.parse(this.$route.query.snArr);
if (routeQuery.length > 0) {
/* this.addMonitor(routeQuery[0]);
this.autoOpenLastInfoWindow = true; */
routeQuery.forEach((item) => {
this.addMonitor(item);
});
this.autoOpenLastInfoWindow = true;
this.listDialogHidden = false;
}
}
if (this.$route.query.vin) {
MONITOR_SERVICE.getVehicleTree({
termType: 2,
term: this.$route.query.vin,
returnTrees: true,
}).then((res) => {
const items = res.data;
this.autoOpenLastInfoWindow = true;
this.expandTreeItems(items);
});
this.treeHidden = false;
this.listDialogHidden = true;
}
// this.drawPoi()
} else {
this.checkLoadedTimeoutId = check();
this.checkMapLoaded = check();
}
}, 100);
};
this.checkLoadedTimeoutId = check();
this.checkMapLoaded = check();
},
// 设备停留点查询
getStayPointList(vehicleId) {
GET_STAY_POINTLIST({vehicleId}).then(res => {
GET_STAY_POINTLIST({ vehicleId }).then(res => {
if (res.code != 0) {
this.$message({
type: "error",
......@@ -218,13 +196,73 @@ export default {
})
return
}
// this.resultList = res.data;
EventBus.$emit("uiMap.historyLocation.draw", res.data);
// let _data = [
// {
// workOrderNo: "PAGL-2730216-2022ZLTJ100331902-ZL-01-0630143536375",
// ownerName: "岳**",
// sn: "15204130097",
// standno: "L6T7*********1722",
// shopName: "无锡拓炎汽车服务有限公司",
// beginTime: "2024-03-19 10:59:56",
// endTime: "2024-03-19 16:27:53",
// duration: "05 时 27 分 57 秒",
// locationType: "GPS",
// elat: "41.652284",
// elng: "117.066791",
// address: '江苏省无锡市滨湖区蠡湖大道1800号'
// },
// {
// workOrderNo: "PAGL-2730216-2022ZLTJ100331902-ZL-01-0630143536375",
// ownerName: "岳**",
// sn: "15204130097",
// standno: "L6T7*********1722",
// shopName: "无锡拓炎汽车服务有限公司",
// beginTime: "2024-03-19 09:43:51",
// endTime: "2024-03-19 10:32:26",
// duration: "48 分 35 秒",
// locationType: "GPS",
// elat: "41.579062",
// elng: "117.107705",
// address: '江苏省无锡市滨湖区蠡湖大道1800号'
// },
// {
// workOrderNo: "PAGL-2730216-2022ZLTJ100331902-ZL-01-0630143536375",
// ownerName: "岳**",
// sn: "15204130097",
// standno: "L6T7*********1722",
// shopName: "无锡拓炎汽车服务有限公司",
// beginTime: "2024-03-18 09:24:30",
// endTime: "2024-03-18 12:25:22",
// duration: "03 时 00 分 52 秒",
// locationType: "GPS",
// elat: "41.330770",
// elng: "117.731553",
// address: '江苏省无锡市滨湖区蠡湖大道1800号'
// }
// ]
let _data = res.data
if (!_data.length) {
this.$message({
type: "info",
message: '暂无历史停留数据',
})
return
}
_data.forEach((item, idx) => {
item.idx = idx;
item.name = item.ownerName || "--";
item.sn = item.sn || "--";
item.vin = item.vin || "--";
item.begintime = item.beginTime;
item.endtime = item.endTime;
item.transferAddress = item.address || "--"; // 取后端返回address
});
EventBus.$emit("uiMap.historyLocation.draw", _data);
})
},
// 获取车辆基本信息
getBasicInformation(vehicleId) {
GET_BASIC_INFORMATION({vehicleId}).then(res => {
GET_BASIC_INFORMATION({ vehicleId }).then(res => {
if (res.code != 200) {
this.$message({
type: "error",
......@@ -237,7 +275,7 @@ export default {
},
// 预测家庭地址和预测工作地址查询
getResidentInformation(vehicleId) {
GET_RESIDENT_INFORMATION({vehicleId}).then(res => {
GET_RESIDENT_INFORMATION({ vehicleId }).then(res => {
if (res.code != 200) {
this.$message({
type: "error",
......@@ -252,7 +290,7 @@ export default {
},
// 设备警情数据查询
getAlarmInformation(vehicleId) {
GET_ALARM_POINTLIST({vehicleId}).then(res => {
GET_ALARM_POINTLIST({ vehicleId }).then(res => {
if (res.code != 200) {
this.$message({
type: "error",
......@@ -260,19 +298,20 @@ export default {
})
return
}
this.alarmData.data = res.data
this.alarmData.data = res.data.length > 6 ? res.data.slice(0, 6) : res.data
let _list = res.data
if (_list.length === 0) {
this.$refs.pieChartsRef.draw()
return
}
_list[0].value = 1 / _list[0].alarmLevel * 100
this.pieList.push(_list[0])
this.$refs.pieChartsRef.draw()
})
},
// 用户行为数据查询
getUserBehaviorInformation(vehicleId) {
GET_USER_BEHAVIOR_INFORMATION({vehicleId}).then(res => {
GET_USER_BEHAVIOR_INFORMATION({ vehicleId }).then(res => {
if (res.code != 200) {
this.$message({
type: "error",
......@@ -280,24 +319,26 @@ export default {
})
return
}
let _dataList = res.data.userBehaviorWeekDTOList
let _dataList = res.data.statisticsType == 1 ? res.data.userBehaviorWeekDTOList : res.data.userBehaviorDayDTOList
if (_dataList.length == 200) {
this.useCarData = []
return
}
_dataList.forEach(item => {
this.xAxisDataList.push(item.weekInt)
this.useCarData.push(item.weekNum)
this.xAxisDataList.push(item.weekInt || item.dayInt)
this.useCarData.push(item.weekNum || item.dayNum)
})
console.log(this.xAxisDataList);
console.log(this.useCarData);
this.$nextTick(() => {
this.$refs.useCarChartsRef.drawBarLine()
})
})
}
},
},
async created() {
EventBus.$on("uiMap.historyLocation.transferSuccess", (data) => {
this.resultList = [].concat(data);
});
},
beforeDestroy() {
this.checkLoadedTimeoutId && window.clearTimeout(this.checkLoadedTimeoutId);
},
......@@ -350,10 +391,12 @@ export default {
.top-box {
margin: 16px 0;
position: relative;
&-item {
display: flex;
align-items: center;
margin-bottom: 16px;
&-left {
font-weight: 400;
font-size: 14px;
......@@ -405,24 +448,27 @@ export default {
background: #46495E;
}
}
&-right-none {
width: 180px;
height: 12px;
background: #46495E;
border-radius: 6px;
height: 12px;
background: #46495E;
border-radius: 6px;
}
}
&-item:last-child {
margin-bottom: 0;
}
.tips {
position: absolute;
top: 42px;
left: 158px;
left: 158px;
font-weight: 600;
font-size: 14px;
color: #B5B5B5;
-webkit-text-stroke: 0.5px #181C36;
font-size: 14px;
color: #B5B5B5;
-webkit-text-stroke: 0.5px #181C36;
}
}
......@@ -536,21 +582,24 @@ color: #B5B5B5;
padding: 16px;
box-shadow: 0 4px 6px 0 #00000014;
z-index: 9999;
.title {
font-weight: 500;
font-size: 14px;
color: #ffffff80;
font-size: 14px;
color: #ffffff80;
}
.empty-box {
height: 250px;
font-weight: 400;
font-size: 14px;
color: #999999;
text-align: center;
font-size: 14px;
color: #999999;
text-align: center;
margin-top: 40px;
img {
width: 86px;
height: 86px;
height: 86px;
}
}
}
......@@ -572,6 +621,7 @@ height: 86px;
line-height: 48px;
z-index: 9999;
}
.line-charts {
padding-left: 10px;
}
......
......@@ -506,6 +506,7 @@ MapService.prototype = {
riskBtn.classList.add('resident_btn_hidden');
}
riskBtn.onclick = function() {
console.log(info);
queryCode = `vehicleId=${info.vidCode}`
mapService.openPage(`#/monitor/alarmAnalysis?${queryCode}`)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!