Commit 7f757649 by 匡雅琴

1.50.0开发

1 parent 14ecaa10
......@@ -1591,16 +1591,6 @@
"integrity": "sha1-MgmlHKSkrVQaO409am1bg6JIWTU=",
"dev": true
},
"bindings": {
"version": "1.5.0",
"resolved": "https://registry.npmmirror.com/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
"dev": true,
"optional": true,
"requires": {
"file-uri-to-path": "1.0.0"
}
},
"bluebird": {
"version": "3.5.1",
"resolved": "http://registry.npm.taobao.org/bluebird/download/bluebird-3.5.1.tgz",
......@@ -3494,6 +3484,15 @@
"safer-buffer": "^2.1.0"
}
},
"echarts": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.5.0.tgz",
"integrity": "sha512-rNYnNCzqDAPCr4m/fqyUFv7fD9qIsd50S6GDFgO1DxZhncCsNsG7IfUlAlvZe5oSEQxtsjnHiUuppzccry93Xw==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.5.0"
}
},
"editions": {
"version": "1.3.4",
"resolved": "http://registry.npm.taobao.org/editions/download/editions-1.3.4.tgz",
......@@ -4227,13 +4226,6 @@
"schema-utils": "^0.4.5"
}
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
"dev": true,
"optional": true
},
"filename-regex": {
"version": "2.0.1",
"resolved": "http://registry.npm.taobao.org/filename-regex/download/filename-regex-2.0.1.tgz",
......@@ -4462,9 +4454,8 @@
"dev": true,
"optional": true,
"requires": {
"bindings": "^1.5.0",
"nan": "^2.12.1",
"node-pre-gyp": "*"
"nan": "^2.3.0",
"node-pre-gyp": "^0.6.39"
},
"dependencies": {
"abbrev": {
......@@ -12999,6 +12990,11 @@
"integrity": "sha1-Antp+oIyJeVRys4+8DsR9qs3wdc=",
"dev": true
},
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"tty-browserify": {
"version": "0.0.0",
"resolved": "http://registry.npm.taobao.org/tty-browserify/download/tty-browserify-0.0.0.tgz",
......@@ -14914,6 +14910,14 @@
}
}
}
},
"zrender": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-5.5.0.tgz",
"integrity": "sha512-O3MilSi/9mwoovx77m6ROZM7sXShR/O/JIanvzTwjN3FORfLSr81PsUGd7jlaYOeds9d8tw82oP44+3YucVo+w==",
"requires": {
"tslib": "2.3.0"
}
}
}
}
......@@ -19,6 +19,7 @@
"chart.js": "^2.7.2",
"clipboard": "^2.0.4",
"downloadjs": "^1.4.7",
"echarts": "^5.5.0",
"element-ui": "^2.13.2",
"es6-promise": "^4.2.4",
"font-awesome": "^4.7.0",
......
......@@ -169,4 +169,24 @@ export const GET_HISTORY_LOCATION = params => {
// 常驻地数据
export const GET_RESIDENT_LOCATION = params => {
return request(params, '/trialdrive/monitor/residentList', 'get')
}
// 风险评估设备停留点查询
export const GET_STAY_POINTLIST = params => {
return request(params, '/trialdrive/riskAssessment/getStayPointList', 'get')
}
// 风险评估获取车辆基本信息
export const GET_BASIC_INFORMATION = params => {
return request(params, '/trialdrive/riskAssessment/getBasicInformation', 'get')
}
// 风险评估设备预测家庭地址和预测工作地址查询
export const GET_RESIDENT_INFORMATION = params => {
return request(params, '/trialdrive/riskAssessment/getResidentInformation', 'get')
}
// 风险评估设备警情数据查询
export const GET_ALARM_POINTLIST = params => {
return request(params, '/trialdrive/riskAssessment/getAlarmInformation', 'get')
}
// 风险评估用户行为数据查询
export const GET_USER_BEHAVIOR_INFORMATION = params => {
return request(params, '/trialdrive/riskAssessment/getUserBehaviorInformation', 'get')
}
\ No newline at end of file
......@@ -646,4 +646,8 @@
.clear_link:hover {
opacity: 0.8;
}
}
.resident_btn_hidden {
display: none;
}
\ No newline at end of file
<template>
<div>
<div :id="domId" style="width: 100%;" :style="{ height }"></div>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'BarLineChart',
props: {
height: {
type: String
},
domId: {
type: String,
default: 'bar-line'
},
dataList: {
type: Array,
default: () => []
},
xAxisData: {
type: Array,
default: () => ['1', '2', '3', '4', '5', '6']
}
},
data() {
return {
barLineOptions: null,
}
},
mounted() {
this.barLineDom = document.getElementById(this.domId)
this[this.domId] = echarts.init(this.barLineDom)
},
methods: {
drawBarLine() {
console.log(this.xAxisData);
console.log(this.dataList);
this.barLineOptions = {
xAxis: {
type: 'category',
name: '周',
boundaryGap: true,//坐标轴两边留白
data: this.xAxisData,
axisLabel: { //坐标轴刻度标签的相关设置。
interval: 0,//设置为 1,表示『隔一个标签显示一个标签』
// margin:15,
textStyle: {
color: '#FFFFFF',
fontSize: 12,
}
},
},
yAxis: {
type: 'value',
name: '公里',
boundaryGap: true,//坐标轴两边留白
min: 0,
max: 1500,
interval: 300,
axisLabel: {
interval: 0,
margin: 2,
textStyle: {
color: '#FFFFFF',
fontSize: 12,
},
},
splitLine: {
lineStyle: {
color: '#ffffff00;',
},
},
grid: {
left: '15%'
},
},
series: [
{
name: 'usecar',
type: 'line',
symbol: "circle",
symbolSize: 0,
itemStyle: {
normal: {
color: '#419fff',
lineStyle: {
color: "#1890FF",
width: 3
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
offset: 0,
color: 'rgba(65,159,255,0)'
}, {
offset: 1,
color: 'rgba(65,159,255,0.19)'
}]),
}
}
},
data: this.dataList
},
]
};
this[this.domId].setOption(this.barLineOptions)
},
}
}
</script>
<style scoped lang="scss"></style>
\ No newline at end of file
<template>
<div class="pie-box">
<div :id="id" :style="{ height: height }" class="pie-chart"></div>
<div>{{ list.length ? list[0].advise : '无' }}
</div>
</div>
</template>
<script>
import * as echarts from 'echarts'
export default {
name: 'PieChart',
props: {
id: {
type: String,
default: ''
},
height: {
type: String,
default: '8.54vh'
},
list: {
type: Array,
default: () => [
// {
// alarmName: "防拆报警",
// alarmLevel: 20,
// }
]
},
},
data() {
return {
option: '',
echartsPie: '',
mTime: '',
viewData: [],
text: '',
subtext: '',
currentIndex: -1,
mainValue: 0,
numDesc: '',
descColor: ''
}
},
watch: {
list: {
handler(newVal) {
if (newVal.length > 0) {
this.initData()
this.$nextTick(() => {
this.draw()
})
}
},
immediate: true
}
},
mounted() { },
methods: {
// 初始化数据
initData() {
const { list, keys } = this
this.viewData = []
// list.forEach(item => {
// this.viewData.push({
// name: item[keys[0]],
// value: item[keys[1]],
// avarage: item[keys[2]]
// })
// })
},
draw() {
if (this.mTime) clearInterval(this.mTime)
this.echartsPie = echarts.init(document.getElementById(this.id))
console.log(this.list);
// 指定图表的配置项和数据
var storedList = this.list;
const pointerData = this.list.length ? this.list[0].alarmLevel : 0
this.option = {
backgroundColor: "",
series: [{
type: "gauge",
radius: '80%',
startAngle: 225,
endAngle: -45,
splitNumber: 50,
title: {
color: 'red',
},
splitLine: {
show: false,
length: 15,
distance: -10,
lineStyle: {
color: "#fff",
width: 1
}
},
detail: {
show: true,
offsetCenter: [0, 60],
fontSize: 12,
formatter: function(val) {
if (!storedList.length) {
return `{无警情<br/>无风险}`;
} else {
return `${storedList[0].alarmLevel}级警情`;
}
},
textStyle: {
fontSize: 12,
color: '#ffffff',
top: '80%',
},
},
// 仪表盘的线,颜色值为一个数组
axisLine: {
show: true,
// 两端是否设置为圆角;在5.0之后的版本有效
roundCap: true,
lineStyle: {
width: 15,
opacity: 1,
color: [
[pointerData / 100, {
x: 0,
y: 1,
x1: 1,
y1: 0,
colorStops: [{
offset: 0,
color: '#4ED5D7'
},
{
offset: 0.3,
color: '#58D068'
},
{
offset: 0.5,
color: '#FBD924'
},
{
offset: 0.8,
color: '#F38906'
}, {
offset: 1,
color: '#F23204'
}]
}],
[1, "#46495E"]
]
}
},
// 仪表盘刻度标签
axisLabel: {
show: false,
color: "rgba(84, 108, 198, 0.65)",
fontSize: 14,
distance: 20,
formatter: val => {
const num = Math.floor(val);
return num % 20 === 0 ? num : "";
}
},
// 刻度
axisTick: {
show: false
},
// 指针,此设置仅对5.0以上的版本生效
anchor: {
show: true,
icon: "circle",
showAbove: true,
size: 15,
itemStyle: {
borderWidth: 3,
borderColor: "#FFFFFF"
}
},
data: [pointerData]
}
]
};
this.echartsPie.setOption(this.option)
},
// 事件触发
emitEvent(data) {
this.echartsPie.setOption(this.option)
this.$emit('pieAction', data)
},
highlightPie() {
// 取消所有高亮并高亮当前图形
// 遍历饼图数据,取消所有图形的高亮效果
for (var idx in this.option.series[0].data) {
this.echartsPie.dispatchAction({
type: 'downplay',
seriesIndex: 0,
dataIndex: idx
})
}
// 高亮当前图形
this.echartsPie.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: this.currentIndex
})
this.descColor = this.option.color[this.currentIndex]
},
// 高亮
pieActive() {
const dataLen = this.option.series[0].data.length
this.currentIndex = (this.currentIndex + 1) % dataLen
this.highlightPie()
this.emitEvent(this.viewData[this.currentIndex])
}
}
}
</script>
<style lang="scss" scoped>
.pie-box {
background: #181C36;
font-weight: 500;
font-size: 12px;
color: #A3A4AF;
text-align: center;
.center-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
max-width: 40%;
&-num-color {
color: #fff;
}
&-num {
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
// font-size: 0.6vw;
--step: 0;
counter-reset: count var(--step);
z-index: var(--step);
transition: --step 0.5s;
&::before {
content: counter(count);
}
}
&-desc {
font-size: 0.5vw;
color: #606266;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
animation: rotateIn 3s infinite;
}
}
.content-desc {
display: flex;
align-items: center;
font-size: 8px;
color: #c8c8c8;
text-align: center;
font-weight: 400;
position: absolute;
top: 91%;
left: 50%;
transform: translateX(-50%);
text-align: center;
height: 14px !important;
white-space: nowrap;
&-icon {
width: 8px;
height: 4px;
border-radius: 2px;
margin-right: 4px;
}
}
}
@property --step {
syntax: '<integer>';
inherits: false;
initial-value: 15;
}
@keyframes rotateIn {
from {
transform: rotateY(0turn);
}
to {
transform: rotateY(-1turn);
}
}
</style>
\ No newline at end of file
<template>
<div class="main-container">
<div id="map" class="map-container"></div>
<!-- 饼图组件 -->
<ParCharts class="pie" ref="pieChartsRef" id="pie-chart" height="250px" :list="pieList" />
<!-- 风险分析 -->
<div class="analy-box">
<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>
</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>
<div class="top-box-item">
<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>
<div class="top-box-item">
<div class="top-box-item-left">安装点长停</div>
<div class="top-box-item-right-none"></div>
</div>
<div class="tips">
<div>车辆无警情</div>
<div>触发</div>
</div>
</template>
</div>
<div class="middle-box">
<div><span class="dot dot-1"></span>安全</div>
<div><span class="dot dot-2"></span>低分险</div>
<div><span class="dot dot-3"></span>中风险</div>
<div><span class="dot dot-4"></span>高风险</div>
<div><span class="dot dot-5"></span>极高风险</div>
</div>
<div class="bottom-box">
<div class="bottom-box-item">
<div class="bottom-box-item-left">常驻地:</div>
<div class="bottom-box-item-right">{{ alarmData.residence || '-' }}</div>
</div>
<div class="bottom-box-item">
<div class="bottom-box-item-left">预测家庭地址:</div>
<div class="bottom-box-item-right">{{ alarmData.homeAddress || '-' }}</div>
</div>
<div class="bottom-box-item">
<div class="bottom-box-item-left">预测工作地址:</div>
<div class="bottom-box-item-right">{{ alarmData.workAddress || '-' }}</div>
</div>
</div>
</div>
<!-- 基本信息 -->
<div class="detail-box">
<div class="title">基本信息</div>
<div>
<div class="detail-msg">
<div class="detail-msg-left">承租人姓名:</div>
<div class="detail-msg-right"> {{ basicData.lesseeName || '-' }}</div>
</div>
<div class="detail-msg">
<div class="detail-msg-left">店面名称:</div>
<div class="detail-msg-right"> {{ basicData.shopName || '-' }}</div>
</div>
<div class="detail-msg">
<div class="detail-msg-left">客户姓名:</div>
<div class="detail-msg-right"> {{ basicData.userName || '-' }}</div>
</div>
<div class="detail-msg">
<div class="detail-msg-left">业务工单号:</div>
<div class="detail-msg-right"> {{ basicData.workOrderNo || '-' }}</div>
</div>
<div class="detail-msg">
<div class="detail-msg-left">车架号:</div>
<div class="detail-msg-right">{{ basicData.vin || '-' }} </div>
</div>
<div class="detail-msg">
<div class="detail-msg-left">创建时间:</div>
<div class="detail-msg-right">{{ basicData.createTime || '-' }} </div>
</div>
<div class="detail-msg">
<div class="detail-msg-left">设备状态:</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>
<div v-else class="empty-box">
<img src="../../assets/images/empty-status.png" alt="">
<div>暂无里程数据</div>
</div>
</div>
<!-- 热力图 -->
<div class="hot-box">“历史停留”热力图</div>
</div>
</template>
<script>
import ParCharts from './ParCharts.vue';
import mapService from "@/utils/mapService.js";
import LineCharts from './LineCharts.vue';
import { services } from "@/api";
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 {
name: 'OEshieldAlarmAnalysis',
components: { ParCharts, LineCharts },
data() {
return {
AMap: null,
mapObj: null,
mapLoading: false,
isInitMap: false,
num: 4,
basicData: {},
alarmData: {
data: [],
residence: '',
homeAddress: '',
workAddress: '',
},
useCarData: [],
xAxisDataList: [],
pieList: []
};
},
mounted() {
let _this = this;
_this.$mapInit({ version: "2.0" }).then((AMap) => {
window.AMap = AMap;
_this.initMap();
});
// _this.$refs.pieChartsRef.draw()
// _this.$refs.useCarChartsRef.drawBarLine()
// _this.searchAlarm()
const _vehicleId = _this.$route.query.vehicleId
_this.getStayPointList(_vehicleId)
_this.getBasicInformation(_vehicleId)
_this.getResidentInformation(_vehicleId)
_this.getAlarmInformation(_vehicleId)
_this.getUserBehaviorInformation(_vehicleId)
},
methods: {
initMap() {
let check = () => {
this.checkLoadedTimeoutId &&
window.clearTimeout(this.checkLoadedTimeoutId);
return setTimeout(() => {
if (
"AMap" in window &&
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;
}
} else {
this.checkLoadedTimeoutId = check();
}
}, 100);
};
this.checkLoadedTimeoutId = check();
},
// 设备停留点查询
getStayPointList(vehicleId) {
GET_STAY_POINTLIST({vehicleId}).then(res => {
if (res.code != 0) {
this.$message({
type: "error",
message: res.message,
})
return
}
// this.resultList = res.data;
EventBus.$emit("uiMap.historyLocation.draw", res.data);
})
},
// 获取车辆基本信息
getBasicInformation(vehicleId) {
GET_BASIC_INFORMATION({vehicleId}).then(res => {
if (res.code != 200) {
this.$message({
type: "error",
message: res.message,
})
return
}
this.basicData = res.data
})
},
// 预测家庭地址和预测工作地址查询
getResidentInformation(vehicleId) {
GET_RESIDENT_INFORMATION({vehicleId}).then(res => {
if (res.code != 200) {
this.$message({
type: "error",
message: res.message,
})
return
}
this.alarmData.residence = res.data.residence
this.alarmData.homeAddress = res.data.homeAddress
this.alarmData.workAddress = res.data.workAddress
})
},
// 设备警情数据查询
getAlarmInformation(vehicleId) {
GET_ALARM_POINTLIST({vehicleId}).then(res => {
if (res.code != 200) {
this.$message({
type: "error",
message: res.message,
})
return
}
this.alarmData.data = res.data
let _list = res.data
if (_list.length === 0) {
this.$refs.pieChartsRef.draw()
return
}
this.pieList.push(_list[0])
this.$refs.pieChartsRef.draw()
})
},
// 用户行为数据查询
getUserBehaviorInformation(vehicleId) {
GET_USER_BEHAVIOR_INFORMATION({vehicleId}).then(res => {
if (res.code != 200) {
this.$message({
type: "error",
message: res.message,
})
return
}
let _dataList = res.data.userBehaviorWeekDTOList
if (_dataList.length == 200) {
this.useCarData = []
return
}
_dataList.forEach(item => {
this.xAxisDataList.push(item.weekInt)
this.useCarData.push(item.weekNum)
})
console.log(this.xAxisDataList);
console.log(this.useCarData);
this.$nextTick(() => {
this.$refs.useCarChartsRef.drawBarLine()
})
})
}
},
beforeDestroy() {
this.checkLoadedTimeoutId && window.clearTimeout(this.checkLoadedTimeoutId);
},
};
</script>
<style lang="scss" scoped>
.main-container {
position: fixed;
width: calc(100% - 200px);
height: calc(100% - 60px);
top: 60px;
left: 200px;
background: #fff;
padding: 0;
}
.map-container {
/* position: fixed;
width: calc(100% - 200px);
height: calc(100% - 60px);
top: 60px;
left: 200px;
background: #fff;
padding: 0; */
}
.pie {
position: absolute;
top: 40px;
left: 40px;
width: 340px;
height: 299px;
background: #181C36;
box-shadow: 0 4px 6px 0 #00000014;
z-index: 9999;
}
.analy-box {
position: absolute;
bottom: 40px;
left: 40px;
width: 340px;
background: #181C36;
box-shadow: 0 4px 6px 0 #00000014;
box-sizing: border-box;
padding: 16px;
z-index: 9999;
.top-box {
margin: 16px 0;
position: relative;
&-item {
display: flex;
align-items: center;
margin-bottom: 16px;
&-left {
font-weight: 400;
font-size: 14px;
color: #FFFFFF;
min-width: 100px;
}
&-right {
display: flex;
.item {
width: 36px;
height: 12px;
}
.item1 {
background: #4ED5D7;
border-radius: 6px 0 0 6px;
}
.item2 {
background: #58D068;
}
.item3 {
background: #F7D310;
}
.item4 {
background: #F38906;
}
.item5 {
background: #F23204;
border-radius: 0 6px 6px 0;
}
.item1-grey {
background: #46495E;
border-radius: 6px 0 0 6px;
}
.item5-grey {
background: #46495E;
border-radius: 0 6px 6px 0;
}
.item-grey {
background: #46495E;
}
}
&-right-none {
width: 180px;
height: 12px;
background: #46495E;
border-radius: 6px;
}
}
&-item:last-child {
margin-bottom: 0;
}
.tips {
position: absolute;
top: 42px;
left: 158px;
font-weight: 600;
font-size: 14px;
color: #B5B5B5;
-webkit-text-stroke: 0.5px #181C36;
}
}
.middle-box {
display: flex;
justify-content: space-around;
width: 280px;
font-size: 10px;
color: #ffffffb3;
margin: auto;
.dot {
width: 6px;
height: 6px;
border-radius: 3px;
display: inline-block;
margin-right: 2px;
}
.dot-1 {
background: #4ED5D7;
}
.dot-2 {
background: #58D068;
}
.dot-3 {
background: #F7D310;
}
.dot-4 {
background: #F38906;
}
.dot-5 {
background: #F23204;
}
}
.bottom-box {
&-item {
display: flex;
font-weight: 400;
font-size: 14px;
margin-top: 16px;
&-left {
min-width: 100px;
color: #A3A4AF;
}
&-right {
color: #E5E5E8;
}
}
}
}
.detail-box {
position: absolute;
top: 40px;
right: 40px;
width: 340px;
background: #181C36;
box-shadow: 0 4px 6px 0 #00000014;
z-index: 9999;
box-sizing: border-box;
padding: 16px;
.title {
font-weight: 500;
font-size: 14px;
color: #ffffff80;
margin-bottom: 24px;
}
.detail-msg {
display: flex;
justify-content: space-between;
font-weight: 400;
font-size: 14px;
margin-bottom: 10px;
&-left {
color: #A3A4AF;
min-width: 100px;
}
&-right {
color: #E5E5E8;
text-align: right;
}
&-desc {
color: #E5E5E8;
}
}
}
.use-car-box {
position: absolute;
bottom: 40px;
right: 40px;
width: 340px;
height: 264px;
background: #181C36;
box-sizing: border-box;
padding: 16px;
box-shadow: 0 4px 6px 0 #00000014;
z-index: 9999;
.title {
font-weight: 500;
font-size: 14px;
color: #ffffff80;
}
.empty-box {
height: 250px;
font-weight: 400;
font-size: 14px;
color: #999999;
text-align: center;
margin-top: 40px;
img {
width: 86px;
height: 86px;
}
}
}
.hot-box {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 254px;
height: 48px;
background: #333336cc;
box-shadow: 0 4px 6px 0 #00000014;
border-radius: 24px 24px 0 0;
font-weight: 600;
font-size: 20px;
color: #FFFFFF;
text-align: center;
line-height: 48px;
z-index: 9999;
}
.line-charts {
padding-left: 10px;
}
</style>
\ No newline at end of file
......@@ -446,6 +446,7 @@ export default {
pageSize: 10,
loadingMore: false,
placeholderText: "请输入6位以上车架号",
vidCode: undefined
};
},
computed: {
......@@ -936,6 +937,7 @@ export default {
if (!list || list.length <= 0) {
return false;
}
this.vidCode = list[0].vid;
for (var i = 0, len = list.length; i < len; i++) {
_this.handleSelect(list[i]);
}
......@@ -1221,6 +1223,7 @@ export default {
item = this.filterGpsBase(item);
item.isSource = relItem.source;
item.vidCode = this.vidCode
});
this.monitorList = Object.assign({}, this.monitorList);
let drawData = data.filter(
......
......@@ -205,6 +205,13 @@ const routes = [
component: monitor
},
{
path: 'alarmAnalysis',
name: 'alarmAnlaysis',
meta: { title: '警情分析' },
component: () => import('pages/monitor/alarmAnalysis.vue'),
notMenu: true,
},
{
path: 'zoneCar',
name: 'zoneCar',
meta: { title: '区域查车' },
......
......@@ -21,45 +21,45 @@ function MapService() {
var zhongliType = sessionStorage.getItem('zhongliType');//获取是否仲利账号状态,从本地内存中拿取数据
MapService.prototype = {
init: function (id,options) {
init: function(id, options) {
var self = this;
let params = options||{}
if(self.map){
let params = options || {}
if (self.map) {
self.map.destroy()
}
var map = new AMap.Map(id, {
resizeEnable: true,
zoom: params.zoom||11,
zoom: params.zoom || 11,
...params
});
// 添加比例尺
map.plugin(["AMap.Scale"], function () {
map.plugin(["AMap.Scale"], function() {
var scale = new AMap.Scale()
map.addControl(scale);
scale.show()
});
//距离测量
map.plugin(["AMap.RangingTool"], function () {
map.plugin(["AMap.RangingTool"], function() {
self.ruler = new AMap.RangingTool(map);
});
//定位
map.plugin('AMap.Geolocation', function () {
map.plugin('AMap.Geolocation', function() {
self.geolocation = new AMap.Geolocation();
});
self.map = map;
return self.map;
},
toggleMapType: function () {
toggleMapType: function() {
var self = this;
let _map = self.map;
self.type = self.type ? 0 : 1; //0:使用2D地图,1:混合图
_map.plugin(["AMap.MapType"],function(){
_map.plugin(["AMap.MapType"], function() {
//地图类型切换
let _mapType= new AMap.MapType({
let _mapType = new AMap.MapType({
defaultType: self.type,
});
_map.addControl(_mapType);
......@@ -80,7 +80,7 @@ MapService.prototype = {
} else {
// 地图上设置图层
self.map.remove(self.mixLayers);
/*self.map.plugin(["AMap.MapType"],function(){
//地图类型切换
var type = new window.AMap.MapType({
......@@ -90,18 +90,18 @@ MapService.prototype = {
});*/
}
},
rulerTurnOn: function () {
rulerTurnOn: function() {
this.ruler.turnOn();
},
rulerTurnOff: function () {
rulerTurnOff: function() {
this.ruler.turnOff();
},
getCurrentLocation: function () {
getCurrentLocation: function() {
var self = this;
self.geolocation.getCurrentPosition(function(status,result){
self.geolocation.getCurrentPosition(function(status, result) {
console.log(status);
console.log(result);
if(status == 'complete'){
if (status == 'complete') {
self.currentMarker && self.map.remove(self.currentMarker);
var lnglatXY = self.getLngLat(result.position.lng, result.position.lat);
self.currentMarker = self.createMarker(lnglatXY);
......@@ -121,7 +121,7 @@ MapService.prototype = {
// });
},
createMarker: function (lnglatXY) {
createMarker: function(lnglatXY) {
var marker = new AMap.Marker({
position: lnglatXY,
icon: require('images/mapLocation.gif'),
......@@ -130,7 +130,7 @@ MapService.prototype = {
});
return marker;
},
createPointMarker: function (lnglatXY) {
createPointMarker: function(lnglatXY) {
var marker = new AMap.Marker({
position: lnglatXY,
icon: require('images/point.png'),
......@@ -139,7 +139,7 @@ MapService.prototype = {
});
return marker;
},
createConstantMarker: function (lnglatXY, map) {
createConstantMarker: function(lnglatXY, map) {
var marker = new AMap.Marker({
position: lnglatXY,
icon: require('images/icon_constant.png'),
......@@ -148,7 +148,7 @@ MapService.prototype = {
});
return marker;
},
createCarMarker: function (lnglatXY, map) {
createCarMarker: function(lnglatXY, map) {
var marker = new AMap.Marker({
position: lnglatXY,
icon: require('images/icon_car.png'),
......@@ -219,7 +219,7 @@ MapService.prototype = {
});
return marker;
},
createStartMarker: function (lnglatXY, map) {
createStartMarker: function(lnglatXY, map) {
var marker = new AMap.Marker({
position: lnglatXY,
icon: require('images/icon_start.png'),
......@@ -229,7 +229,7 @@ MapService.prototype = {
});
return marker;
},
createEndMarker: function (lnglatXY, map) {
createEndMarker: function(lnglatXY, map) {
var marker = new AMap.Marker({
position: lnglatXY,
icon: require('images/icon_end.png'),
......@@ -239,14 +239,14 @@ MapService.prototype = {
});
return marker;
},
createPolyline: function (map) {
createPolyline: function(map) {
return new AMap.Polyline({
map: map,
strokeWeight: 2,
strokeColor: '#009944'
});
},
createCircle: function (lnglatXY, map, radius) {
createCircle: function(lnglatXY, map, radius) {
return new AMap.Circle({
map: map,
center: lnglatXY,
......@@ -258,7 +258,7 @@ MapService.prototype = {
fillOpacity: 0.1
});
},
createPoint: function (lnglatXY, map) {
createPoint: function(lnglatXY, map) {
return new AMap.Circle({
map: map,
center: lnglatXY,
......@@ -278,19 +278,19 @@ MapService.prototype = {
});
marker.infoWindow = infoWindow;
// var clipboard = new ClipboardJS(div.querySelector('.copy-btn'));
if(clipboard){
if (clipboard) {
clipboard.destroy();
}
clipboard = new ClipboardJS('.copy-btn',{
text:function(trigger){
}
clipboard = new ClipboardJS('.copy-btn', {
text: function(trigger) {
return trigger.getAttribute('aria-label');
}
})
clipboard.on('success', function (e) {
clipboard.on('success', function(e) {
e.clearSelection();
EventBus.$emit('uiMap.copySuccess');
});
clipboard.on('error', function (e) {
clipboard.on('error', function(e) {
});
......@@ -309,16 +309,16 @@ MapService.prototype = {
},
// 初始化复制事件
initCopyEvent(){
var clipboard = new ClipboardJS('.copy-btn',{
text:function(trigger){
initCopyEvent() {
var clipboard = new ClipboardJS('.copy-btn', {
text: function(trigger) {
return trigger.getAttribute('aria-label');
}
})
},
// 车辆监控-查看位置点
bindMonitorInfoWindow: function (marker, map, info, isInfoOpen, isInfoAutoMove) {
bindMonitorInfoWindow: function(marker, map, info, isInfoOpen, isInfoAutoMove) {
var self = this;
var infoDiv = document.createElement('div');
infoDiv.innerHTML = self.createMonitorInfo(info);
......@@ -327,12 +327,12 @@ MapService.prototype = {
var statusArr = ['行驶中', '静止', '离线', '在线']
if (info.status === 2) {
let _msg = `${statusArr[info.status]} | 已离线${info.statusTime && info.statusTime != null?info.statusTime:''}`;
let _msg = `${statusArr[info.status]} | 已离线${info.statusTime && info.statusTime != null ? info.statusTime : ''}`;
infoDiv.querySelector('[data-status]').textContent = _msg;
infoDiv.querySelector('[data-status]').setAttribute('aria-label',_msg)
infoDiv.querySelector('[data-status]').setAttribute('aria-label', _msg)
} else {
infoDiv.querySelector('[data-status]').textContent = statusArr[info.status];
infoDiv.querySelector('[data-status]').setAttribute('aria-label',statusArr[info.status]);
infoDiv.querySelector('[data-status]').setAttribute('aria-label', statusArr[info.status]);
}
infoDiv.querySelector('[data-time]').textContent = eLocation.dateTime;
......@@ -364,7 +364,7 @@ MapService.prototype = {
}
// 基站
baseBtn && (baseBtn.onclick = function (e) {
baseBtn && (baseBtn.onclick = function(e) {
if (info.eLocateType === 'bsLocation') return;
info.eLocateType = 'bsLocation'
eLocation = info[info.eLocateType];
......@@ -389,7 +389,7 @@ MapService.prototype = {
})
// gps
gpsBtn && (gpsBtn.onclick = function (e) {
gpsBtn && (gpsBtn.onclick = function(e) {
if (info.eLocateType === 'gpsLocation') return;
info.eLocateType = 'gpsLocation'
eLocation = info[info.eLocateType];
......@@ -415,7 +415,7 @@ MapService.prototype = {
// wifi数据
wifiBtn && (wifiBtn.onclick = function (e) {
wifiBtn && (wifiBtn.onclick = function(e) {
if (info.wifiLocation && info.wifiLocation.elng) {
console.log(info)
if (info.eLocateType === 'wifiLocation') return;
......@@ -470,7 +470,7 @@ MapService.prototype = {
if (info.isSource != 1) {
historyBtn.classList.add('history_btn_grey');
}
historyBtn.onclick = function () {
historyBtn.onclick = function() {
if (info.isSource == 1) {
mapService.openPage(`#/monitor/historyLocation?${queryCode}`)
}
......@@ -483,7 +483,7 @@ MapService.prototype = {
if (info.isSource != 1) {
residentBtn.classList.add('resident_btn_grey');
}
residentBtn.onclick = function () {
residentBtn.onclick = function() {
if (info.isSource == 1) {
queryCode = `sn=${info.sn}&name=${encodeURI(info.name)}&standno=${info.standNo}&locationType=${info.eLocateType}`
mapService.openPage(`#/monitor/resident?${queryCode}`)
......@@ -494,11 +494,23 @@ MapService.prototype = {
// 跳转到轨迹回放页面
let replayBtn = infoDiv.querySelector('[data-replay]');
if (replayBtn) {
replayBtn.onclick = function () {
replayBtn.onclick = function() {
mapService.openPage(`#/monitor/replay?${queryCode}`)
}
}
// 跳转到风险评估页面 无线设备不显示按钮 isSource:1有线,其他无线
let riskBtn = infoDiv.querySelector('[data-risk]');
if (riskBtn) {
if (info.isSource != 1) {
riskBtn.classList.add('resident_btn_hidden');
}
riskBtn.onclick = function() {
queryCode = `vehicleId=${info.vidCode}`
mapService.openPage(`#/monitor/alarmAnalysis?${queryCode}`)
}
}
// 跳转到电子围栏页面 无线设备不能跳转电子围栏 isSource:1有线,其他无线
let fenceBtn = infoDiv.querySelector('[data-fence]');
// 判断是否分配了电子围栏按钮权限
......@@ -513,7 +525,7 @@ MapService.prototype = {
}
// v1.25.0版本需求,无线设备和有线设备都支持围栏
queryCode = `sn=${info.sn}&name=${encodeURI(info.name)}&standno=${info.standNo}&source=${info.isSource}`;
fenceBtn.onclick = function () {
fenceBtn.onclick = function() {
if (fencePermission) {
mapService.openPage(`#/monitor/fence?${queryCode}`)
}
......@@ -533,14 +545,14 @@ MapService.prototype = {
// 浮窗点击事件
let questionIcon = infoDiv.querySelector('.question_icon');
if(questionIcon){
if (questionIcon) {
let _obj = infoDiv.querySelector('.popover_box');
questionIcon.addEventListener('mouseenter',function(e){
questionIcon.addEventListener('mouseenter', function(e) {
console.log(e.stopPropagation)
_obj.style.display = 'block';
e.stopPropagation()
})
questionIcon.addEventListener('mouseleave',function(e){
questionIcon.addEventListener('mouseleave', function(e) {
_obj.style.display = 'none';
e.stopPropagation()
})
......@@ -602,22 +614,22 @@ MapService.prototype = {
}
infoDiv.querySelector('#locateTypeGps').onclick = function (e) {
infoDiv.querySelector('#locateTypeGps').onclick = function(e) {
fillGPS()
}
infoDiv.querySelector('#locateTypeBase').onclick = function (e) {
infoDiv.querySelector('#locateTypeBase').onclick = function(e) {
fillBase()
}
fillGPS();
return this.createInfoWindow(marker, map, infoDiv);
},
getLngLat: function (lng, lat) {
getLngLat: function(lng, lat) {
return new AMap.LngLat(lng, lat);
},
getGeocoder: function () {
getGeocoder: function() {
return new Promise((resolve) => {
AMap.service('AMap.Geocoder', function () {//回调函数
AMap.service('AMap.Geocoder', function() {//回调函数
var geocoder = new AMap.Geocoder({
batch: true
});
......@@ -625,8 +637,8 @@ MapService.prototype = {
});
})
},
getAddress: function (geocoder, lnglatXY) {
geocoder.getAddress(lnglatXY, function (status, result) {
getAddress: function(geocoder, lnglatXY) {
geocoder.getAddress(lnglatXY, function(status, result) {
if (status === 'complete' && result.info === 'OK') {
//获得了有效的地址信息:
//即,result.regeocode.formattedAddress
......@@ -635,15 +647,15 @@ MapService.prototype = {
}
});
},
zoomIn: function () {
zoomIn: function() {
this.map.zoomIn();
},
zoomOut: function () {
zoomOut: function() {
this.map.zoomOut();
},
// 监控弹框
createMonitorInfo: function (info) {
createMonitorInfo: function(info) {
/*var _html = '<h3 class="uimap-info-title">'+ info.name+'/'+ info.standNo +'</h3><div class="uimap-info-ct"><p><span><i class="fa fa-inbox"></i></span>'+ info.sn +'</p>';
if(info.time){
_html += '<p><span><i class="fa fa-clock-o"></i></span>'+ info.time +'</p>';
......@@ -728,6 +740,7 @@ MapService.prototype = {
<a class="redirect-btn" id="btn_fence" data-fence>电子围栏</a>
<a class="redirect-btn" id="btn_resident" data-resident>常驻地</a>
<a class="redirect-btn" id="btn_history" data-history>历史停留</a>
<a class="redirect-btn" id="btn_risk" data-risk>风险评估</a>
</p>
</div>`;
......@@ -836,10 +849,10 @@ MapService.prototype = {
</div>`;
},
clearMap: function (map) {
clearMap: function(map) {
this.map.clearMap();
},
setFitView: function (map) {
setFitView: function(map) {
this.map.setFitView();
},
bindClickEvent() {
......@@ -896,10 +909,10 @@ MapService.prototype = {
marker.infoWindow && marker.infoWindow.open(map, marker.getPosition());
}
infoDiv.querySelector('#locateTypeGps').onclick = function (e) {
infoDiv.querySelector('#locateTypeGps').onclick = function(e) {
fillGPS()
}
infoDiv.querySelector('#locateTypeBase').onclick = function (e) {
infoDiv.querySelector('#locateTypeBase').onclick = function(e) {
fillBase()
}
......@@ -943,15 +956,15 @@ MapService.prototype = {
},
// 区域查车弹框
createAraeInfowindow(info){
createAraeInfowindow(info) {
let _types = {
1:'有线设备',
0:'无线设备'
1: '有线设备',
0: '无线设备'
}
let _div = `<h3 class="map-infowindow-title">${info.ownerName || '--'}/${info.vin || '--'}</h3>
<div class="map-infowindow-ct">
<p><i class="icon icon-info_device"></i> 设备号:<span class="des"> ${info.sn||'--'} (${_types[info.source]||'--'})</span>
<span class="battery" data-battery style="display:${info.battery?'block':'none'}">
<p><i class="icon icon-info_device"></i> 设备号:<span class="des"> ${info.sn || '--'} (${_types[info.source] || '--'})</span>
<span class="battery" data-battery style="display:${info.battery ? 'block' : 'none'}">
<i class="fill"><i class="fill-percentage" data-battery-percentage style="width:${info.battery}%;"></i></i>
<i class="icon icon-battery_enough"></i>
<i class="text" data-battery-text>${info.battery}</i>
......@@ -961,29 +974,29 @@ MapService.prototype = {
offset: new AMap.Pixel(0, -20),
content: _div,
autoMove: true,
position:[info.lng,info.lat]
position: [info.lng, info.lat]
})
return infoWindow
},
// 创建poi信息弹框
createPoiMarkerInfowindow(info){
createPoiMarkerInfowindow(info) {
let infoDiv = document.createElement('div');
let _div = `<div class="map_poi_infowindow_popup"><h3 class="map_poi_infowindow_title">${info.address || '暂无地址'}</h3>
<div class="map_poi_infowindow_content">
<span class="near_address">${info.near||'无'}${info.near?'附近':''}</span>
<span class="near_address">${info.near || '无'}${info.near ? '附近' : ''}</span>
<button href="javascript:void(0)" class="clear_link" data-poi-delete>删除</button>
</div></div>`;
infoDiv.innerHTML = _div;
infoDiv.querySelector('[data-poi-delete]').onclick = function (e) {
infoDiv.querySelector('[data-poi-delete]').onclick = function(e) {
console.log(e);
EventBus.$emit('uiMap.poi.marker.delete',info);
EventBus.$emit('uiMap.poi.marker.delete', info);
}
var infoWindow = new AMap.InfoWindow({
offset: new AMap.Pixel(12, -5),
content: infoDiv,
autoMove: true,
position:[info.lng,info.lat],
position: [info.lng, info.lat],
})
return infoWindow
}
......
......@@ -153,7 +153,6 @@ const monitor = {
const MAP = mapService.map;
this.data = data;
const transferObj = []
data.forEach((item) => {
if (item.gpsLocation && item.gpsLocation.elat && item.gpsLocation.elng) {
transferObj.push(item.gpsLocation)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!