Commit b9c7f8ab by 匡雅琴

提交

1 parent 7f757649
...@@ -35,8 +35,6 @@ export default { ...@@ -35,8 +35,6 @@ export default {
}, },
methods: { methods: {
drawBarLine() { drawBarLine() {
console.log(this.xAxisData);
console.log(this.dataList);
this.barLineOptions = { this.barLineOptions = {
xAxis: { xAxis: {
type: 'category', type: 'category',
......
...@@ -76,7 +76,7 @@ export default { ...@@ -76,7 +76,7 @@ export default {
console.log(this.list); console.log(this.list);
// 指定图表的配置项和数据 // 指定图表的配置项和数据
var storedList = 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 = { this.option = {
backgroundColor: "", backgroundColor: "",
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
if (!storedList.length) { if (!storedList.length) {
return `{无警情<br/>无风险}`; return `{无警情<br/>无风险}`;
} else { } else {
return `${storedList[0].alarmLevel}级警情`; return `${storedList[0].alarmLevel / 1}级警情`;
} }
}, },
textStyle: { textStyle: {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="top-box"> <div class="top-box">
<template v-if="alarmData.data.length"> <template v-if="alarmData.data.length">
<div v-for="item in alarmData.data" :key="item" class="top-box-item"> <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-left">{{ item.alarmName }}</div>
<div class="top-box-item-right"> <div class="top-box-item-right">
<div :class="['item', item.alarmLevel <= 5 ? 'item1' : 'item1-grey']"></div> <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 <= 4 ? 'item2' : 'item-grey']"></div>
...@@ -93,14 +93,16 @@ ...@@ -93,14 +93,16 @@
</div> </div>
<div class="detail-msg"> <div class="detail-msg">
<div class="detail-msg-left">设备状态:</div> <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>
</div> </div>
<!-- 用车行为分析 --> <!-- 用车行为分析 -->
<div class="use-car-box"> <div class="use-car-box">
<div class="title">用车行为分析</div> <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"> <div v-else class="empty-box">
<img src="../../assets/images/empty-status.png" alt=""> <img src="../../assets/images/empty-status.png" alt="">
<div>暂无里程数据</div> <div>暂无里程数据</div>
...@@ -116,6 +118,8 @@ import ParCharts from './ParCharts.vue'; ...@@ -116,6 +118,8 @@ import ParCharts from './ParCharts.vue';
import mapService from "@/utils/mapService.js"; import mapService from "@/utils/mapService.js";
import LineCharts from './LineCharts.vue'; import LineCharts from './LineCharts.vue';
import { services } from "@/api"; 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"; 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; const MONITOR_SERVICE = services.monitor;
export default { export default {
...@@ -143,10 +147,10 @@ export default { ...@@ -143,10 +147,10 @@ export default {
mounted() { mounted() {
let _this = this; let _this = this;
_this.$mapInit({ version: "2.0" }).then((AMap) => { _this.$mapInit({ version: '1.4.2' }).then(AMap => {
window.AMap = AMap; window.AMap = AMap;
_this.initMap(); _this.initMap();
}); })
// _this.$refs.pieChartsRef.draw() // _this.$refs.pieChartsRef.draw()
// _this.$refs.useCarChartsRef.drawBarLine() // _this.$refs.useCarChartsRef.drawBarLine()
// _this.searchAlarm() // _this.searchAlarm()
...@@ -161,8 +165,7 @@ export default { ...@@ -161,8 +165,7 @@ export default {
methods: { methods: {
initMap() { initMap() {
let check = () => { let check = () => {
this.checkLoadedTimeoutId && this.checkMapLoaded && window.clearTimeout(this.checkMapLoaded);
window.clearTimeout(this.checkLoadedTimeoutId);
return setTimeout(() => { return setTimeout(() => {
if ( if (
...@@ -170,47 +173,22 @@ export default { ...@@ -170,47 +173,22 @@ export default {
typeof AMap.Map == "function" && typeof AMap.Map == "function" &&
!this.mapObj !this.mapObj
) { ) {
console.log(88888);
window.AMap = AMap; window.AMap = AMap;
this.mapObj = mapService.init("map"); this.mapObj = mapService.init("map");
console.log(this.mapObj);
//this.bindEvent(); //this.bindEvent();
this.isInitMap = true; this.isInitMap = true;
if (this.$route.query.snArr) { // this.drawPoi()
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;
}
} else { } else {
this.checkLoadedTimeoutId = check(); this.checkMapLoaded = check();
} }
}, 100); }, 100);
}; };
this.checkLoadedTimeoutId = check(); this.checkMapLoaded = check();
}, },
// 设备停留点查询 // 设备停留点查询
getStayPointList(vehicleId) { getStayPointList(vehicleId) {
GET_STAY_POINTLIST({vehicleId}).then(res => { GET_STAY_POINTLIST({ vehicleId }).then(res => {
if (res.code != 0) { if (res.code != 0) {
this.$message({ this.$message({
type: "error", type: "error",
...@@ -218,13 +196,73 @@ export default { ...@@ -218,13 +196,73 @@ export default {
}) })
return return
} }
// this.resultList = res.data; // let _data = [
EventBus.$emit("uiMap.historyLocation.draw", res.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) { getBasicInformation(vehicleId) {
GET_BASIC_INFORMATION({vehicleId}).then(res => { GET_BASIC_INFORMATION({ vehicleId }).then(res => {
if (res.code != 200) { if (res.code != 200) {
this.$message({ this.$message({
type: "error", type: "error",
...@@ -237,7 +275,7 @@ export default { ...@@ -237,7 +275,7 @@ export default {
}, },
// 预测家庭地址和预测工作地址查询 // 预测家庭地址和预测工作地址查询
getResidentInformation(vehicleId) { getResidentInformation(vehicleId) {
GET_RESIDENT_INFORMATION({vehicleId}).then(res => { GET_RESIDENT_INFORMATION({ vehicleId }).then(res => {
if (res.code != 200) { if (res.code != 200) {
this.$message({ this.$message({
type: "error", type: "error",
...@@ -252,7 +290,7 @@ export default { ...@@ -252,7 +290,7 @@ export default {
}, },
// 设备警情数据查询 // 设备警情数据查询
getAlarmInformation(vehicleId) { getAlarmInformation(vehicleId) {
GET_ALARM_POINTLIST({vehicleId}).then(res => { GET_ALARM_POINTLIST({ vehicleId }).then(res => {
if (res.code != 200) { if (res.code != 200) {
this.$message({ this.$message({
type: "error", type: "error",
...@@ -260,19 +298,20 @@ export default { ...@@ -260,19 +298,20 @@ export default {
}) })
return return
} }
this.alarmData.data = res.data this.alarmData.data = res.data.length > 6 ? res.data.slice(0, 6) : res.data
let _list = res.data let _list = res.data
if (_list.length === 0) { if (_list.length === 0) {
this.$refs.pieChartsRef.draw() this.$refs.pieChartsRef.draw()
return return
} }
_list[0].value = 1 / _list[0].alarmLevel * 100
this.pieList.push(_list[0]) this.pieList.push(_list[0])
this.$refs.pieChartsRef.draw() this.$refs.pieChartsRef.draw()
}) })
}, },
// 用户行为数据查询 // 用户行为数据查询
getUserBehaviorInformation(vehicleId) { getUserBehaviorInformation(vehicleId) {
GET_USER_BEHAVIOR_INFORMATION({vehicleId}).then(res => { GET_USER_BEHAVIOR_INFORMATION({ vehicleId }).then(res => {
if (res.code != 200) { if (res.code != 200) {
this.$message({ this.$message({
type: "error", type: "error",
...@@ -280,24 +319,26 @@ export default { ...@@ -280,24 +319,26 @@ export default {
}) })
return return
} }
let _dataList = res.data.userBehaviorWeekDTOList let _dataList = res.data.statisticsType == 1 ? res.data.userBehaviorWeekDTOList : res.data.userBehaviorDayDTOList
if (_dataList.length == 200) { if (_dataList.length == 200) {
this.useCarData = [] this.useCarData = []
return return
} }
_dataList.forEach(item => { _dataList.forEach(item => {
this.xAxisDataList.push(item.weekInt) this.xAxisDataList.push(item.weekInt || item.dayInt)
this.useCarData.push(item.weekNum) this.useCarData.push(item.weekNum || item.dayNum)
}) })
console.log(this.xAxisDataList);
console.log(this.useCarData);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.useCarChartsRef.drawBarLine() this.$refs.useCarChartsRef.drawBarLine()
}) })
}) })
} }
}, },
async created() {
EventBus.$on("uiMap.historyLocation.transferSuccess", (data) => {
this.resultList = [].concat(data);
});
},
beforeDestroy() { beforeDestroy() {
this.checkLoadedTimeoutId && window.clearTimeout(this.checkLoadedTimeoutId); this.checkLoadedTimeoutId && window.clearTimeout(this.checkLoadedTimeoutId);
}, },
...@@ -350,10 +391,12 @@ export default { ...@@ -350,10 +391,12 @@ export default {
.top-box { .top-box {
margin: 16px 0; margin: 16px 0;
position: relative; position: relative;
&-item { &-item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 16px; margin-bottom: 16px;
&-left { &-left {
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
...@@ -405,24 +448,27 @@ export default { ...@@ -405,24 +448,27 @@ export default {
background: #46495E; background: #46495E;
} }
} }
&-right-none { &-right-none {
width: 180px; width: 180px;
height: 12px; height: 12px;
background: #46495E; background: #46495E;
border-radius: 6px; border-radius: 6px;
} }
} }
&-item:last-child { &-item:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
.tips { .tips {
position: absolute; position: absolute;
top: 42px; top: 42px;
left: 158px; left: 158px;
font-weight: 600; font-weight: 600;
font-size: 14px; font-size: 14px;
color: #B5B5B5; color: #B5B5B5;
-webkit-text-stroke: 0.5px #181C36; -webkit-text-stroke: 0.5px #181C36;
} }
} }
...@@ -536,21 +582,24 @@ color: #B5B5B5; ...@@ -536,21 +582,24 @@ color: #B5B5B5;
padding: 16px; padding: 16px;
box-shadow: 0 4px 6px 0 #00000014; box-shadow: 0 4px 6px 0 #00000014;
z-index: 9999; z-index: 9999;
.title { .title {
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
color: #ffffff80; color: #ffffff80;
} }
.empty-box { .empty-box {
height: 250px; height: 250px;
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
color: #999999; color: #999999;
text-align: center; text-align: center;
margin-top: 40px; margin-top: 40px;
img { img {
width: 86px; width: 86px;
height: 86px; height: 86px;
} }
} }
} }
...@@ -572,6 +621,7 @@ height: 86px; ...@@ -572,6 +621,7 @@ height: 86px;
line-height: 48px; line-height: 48px;
z-index: 9999; z-index: 9999;
} }
.line-charts { .line-charts {
padding-left: 10px; padding-left: 10px;
} }
......
...@@ -506,6 +506,7 @@ MapService.prototype = { ...@@ -506,6 +506,7 @@ MapService.prototype = {
riskBtn.classList.add('resident_btn_hidden'); riskBtn.classList.add('resident_btn_hidden');
} }
riskBtn.onclick = function() { riskBtn.onclick = function() {
console.log(info);
queryCode = `vehicleId=${info.vidCode}` queryCode = `vehicleId=${info.vidCode}`
mapService.openPage(`#/monitor/alarmAnalysis?${queryCode}`) 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!