Commit 79dd7494 by 前端

Merge branch 'hotfix_v1.50.1' into 'master'

上线合并

See merge request !46
2 parents b4ce31b0 820d663d
...@@ -42,18 +42,18 @@ export default { ...@@ -42,18 +42,18 @@ export default {
drawBarLine() { drawBarLine() {
this.barLineOptions = { this.barLineOptions = {
grid: { grid: {
right: '19%', right: '5%',
left: '15%' left: `${this.linetype == 1 ? '13%' : '5%'}`
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
name: (this.linetype == 1 ? '周' : '天')+(this.lineChartsYear && '\n('+this.lineChartsYear + '年'+')'), // name: (this.linetype == 1 ? '周' : '天')+(this.lineChartsYear && '\n('+this.lineChartsYear + '年'+')'),
// nameLocation: 'center', // nameLocation: 'center',
// nameGap: 20, // nameGap: 20,
nameTextStyle: { // nameTextStyle: {
fontSize: 10, // fontSize: 10,
lineHeight: 16 // lineHeight: 16
}, // },
boundaryGap: false,//坐标轴两边留白 boundaryGap: false,//坐标轴两边留白
data: this.xAxisData, data: this.xAxisData,
axisLabel: { //坐标轴刻度标签的相关设置。 axisLabel: { //坐标轴刻度标签的相关设置。
......
...@@ -254,9 +254,10 @@ export default { ...@@ -254,9 +254,10 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pie-box { .pie-box {
background: #181C36; background: rgba(24 ,28, 54 ,0.9);
font-weight: 500; font-weight: 500;
font-size: 12px; font-size: 12px;
border-radius: 8px;
color: #A3A4AF; color: #A3A4AF;
text-align: center; text-align: center;
......
...@@ -3,47 +3,48 @@ ...@@ -3,47 +3,48 @@
<div id="alarmMap" class="map-container"></div> <div id="alarmMap" class="map-container"></div>
<div class="left-box" v-show="boxShow"> <div class="left-box" v-show="boxShow">
<!-- 饼图组件 --> <!-- 饼图组件 -->
<ParCharts class="pie" ref="pieChartsRef" id="pie-chart" height="250px" :list="pieList" /> <ParCharts class="pie" ref="pieChartsRef" id="pie-chart" height="220px" :list="pieList" />
<!-- 风险分析 --> <!-- 风险分析 -->
<div class="analy-box"> <div class="analy-box">
<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', 'item'+item.alarmLevel]">
<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>
<div :class="['item', item.alarmLevel <= 3 ? 'item3' : '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 <= 2 ? 'item4' : 'item-grey']"></div>
<div :class="['item', item.alarmLevel <= 1 ? 'item5' : 'item5-grey']"></div> <div :class="['item', item.alarmLevel <= 1 ? 'item5' : 'item5-grey']"></div> -->
</div> </div>
</div> </div>
</template> </template>
<template v-else> <div class="top-box-none" v-else>
<div class="top-box-item"> <div class="dask-bg">
<div class="top-box-item-left">防拆报警</div> <div class="top-box-item">
<div class="top-box-item-right-none"></div> <div class="top-box-item-left">防拆报警</div>
</div> <div class="top-box-item-right-none"></div>
<div class="top-box-item"> </div>
<div class="top-box-item-left">高危区域内长停</div> <div class="top-box-item">
<div class="top-box-item-right-none"></div> <div class="top-box-item-left">高危区域内长停</div>
</div> <div class="top-box-item-right-none"></div>
<div class="top-box-item"> </div>
<div class="top-box-item-left">双设备分离</div> <div class="top-box-item">
<div class="top-box-item-right-none"></div> <div class="top-box-item-left">双设备分离</div>
</div> <div class="top-box-item-right-none"></div>
<div class="top-box-item"> </div>
<div class="top-box-item-left">安装点长停</div> <div class="top-box-item">
<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> </div>
<div class="tips"> <div class="dask">
<div>车辆无警情</div> <div>车辆无警情触发</div>
<div>触发</div>
</div> </div>
</template> </div>
</div> </div>
<div class="middle-box"> <div class="middle-box">
<div><span class="dot dot-1"></span>安全</div> <div><span class="dot dot-1"></span>无风险</div>
<div><span class="dot dot-2"></span>低风险</div> <div><span class="dot dot-2"></span>低风险</div>
<div><span class="dot dot-3"></span>中风险</div> <div><span class="dot dot-3"></span>中风险</div>
<div><span class="dot dot-4"></span>高风险</div> <div><span class="dot dot-4"></span>高风险</div>
...@@ -66,6 +67,19 @@ ...@@ -66,6 +67,19 @@
</div> </div>
</div> </div>
<div class="right-box" v-show="boxShow"> <div class="right-box" v-show="boxShow">
<!-- 用车行为分析 -->
<div class="use-car-box">
<div class="title">用车行为分析</div>
<div class="x-name"><span>{{ linetype== 1 ? '周' : '天' }}</span><span v-if="lineChartsYear">-{{ lineChartsYear }}年</span></div>
<div class="line-charts" v-if="xAxisDataList.length">
<LineCharts id="useCarCharts" ref="useCarChartsRef" height="250px" :linetype="linetype" :dataList="useCarData"
:xAxisData="xAxisDataList" :lineChartsYear="lineChartsYear"></LineCharts>
</div>
<div v-else class="empty-box">
<img src="https://wx.glsx.com.cn/upload/biz/501829f0-6c34-443c-bf56-ae94072a6619.png" alt="">
<div>暂无里程数据</div>
</div>
</div>
<!-- 基本信息 --> <!-- 基本信息 -->
<div class="detail-box"> <div class="detail-box">
<div class="title">基本信息</div> <div class="title">基本信息</div>
...@@ -99,7 +113,7 @@ ...@@ -99,7 +113,7 @@
<template v-if="basicData.deviceInformationVOList&&basicData.deviceInformationVOList.length"> <template v-if="basicData.deviceInformationVOList&&basicData.deviceInformationVOList.length">
<div class="detail-msg-right"> <div class="detail-msg-right">
<div class="detail-msg-desc" v-for="item in basicData.deviceInformationVOList"> <div class="detail-msg-desc" v-for="item in basicData.deviceInformationVOList">
<div>{{ item.sourceStr }}-{{ item.sn }}</div> <div class="sn">{{ item.sourceStr }}-{{ item.sn }}</div>
<div v-show="item.deviceStateStr">{{ item.deviceStateStr }}</div> <div v-show="item.deviceStateStr">{{ item.deviceStateStr }}</div>
<div>定位-{{ item.address || ' --' }}</div> <div>定位-{{ item.address || ' --' }}</div>
</div> </div>
...@@ -111,18 +125,7 @@ ...@@ -111,18 +125,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 用车行为分析 -->
<div class="use-car-box">
<div class="title">用车行为分析</div>
<div class="line-charts" v-if="xAxisDataList.length">
<LineCharts id="useCarCharts" ref="useCarChartsRef" height="250px" :linetype="linetype" :dataList="useCarData"
:xAxisData="xAxisDataList" :lineChartsYear="lineChartsYear"></LineCharts>
</div>
<div v-else class="empty-box">
<img src="https://wx.glsx.com.cn/upload/biz/501829f0-6c34-443c-bf56-ae94072a6619.png" alt="">
<div>暂无里程数据</div>
</div>
</div>
</div> </div>
<!-- 热力图 --> <!-- 热力图 -->
<div class="hot-box">“历史停留”热力图</div> <div class="hot-box">“历史停留”热力图</div>
...@@ -143,6 +146,7 @@ export default { ...@@ -143,6 +146,7 @@ export default {
components: { ParCharts, LineCharts }, components: { ParCharts, LineCharts },
data() { data() {
return { return {
resizeObserver: null,
AMap: null, AMap: null,
mapObj: null, mapObj: null,
mapLoading: false, mapLoading: false,
...@@ -173,9 +177,32 @@ export default { ...@@ -173,9 +177,32 @@ export default {
// window.AMap = AMap; // window.AMap = AMap;
_this.initMap(); _this.initMap();
}) })
this.resetWidth()
}, },
methods: { methods: {
resetWidth() {
const homePage = document.querySelector('.desktop-left-sider');
// 创建 ResizeObserver 对象
this.resizeObserver = new ResizeObserver(entries => {
console.log(111111)
// 当元素大小发生变化时执行的回调函数
for (let entry of entries) {
const width = entry.contentRect.width;
let myElement = document.querySelector('.main-container');
if(width==0) {
myElement.style.width = '100%';
myElement.style.left = '0';
}
if(width==200) {
myElement.style.width = 'calc(100% - 200px)';
myElement.style.left = '200px';
}
}
});
// 开始观察目标元素的大小变化
homePage && this.resizeObserver.observe(homePage);
},
initMap() { initMap() {
let check = () => { let check = () => {
this.checkMapLoaded && window.clearTimeout(this.checkMapLoaded); this.checkMapLoaded && window.clearTimeout(this.checkMapLoaded);
...@@ -320,17 +347,39 @@ export default { ...@@ -320,17 +347,39 @@ export default {
// }); // });
// }, // },
beforeDestroy() { beforeDestroy() {
this.resizeObserver.disconnect()
// this.checkLoadedTimeoutId && window.clearTimeout(this.checkLoadedTimeoutId); // this.checkLoadedTimeoutId && window.clearTimeout(this.checkLoadedTimeoutId);
}, },
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.analy-box, .detail-box{
/* 修改垂直滚动条 */
&::-webkit-scrollbar {
width: 2px; /* 修改宽度 */
}
/* 修改滚动条轨道背景色 */
&::-webkit-scrollbar-track {
background-color: #fff;
}
/* 修改滚动条滑块颜色 */
&::-webkit-scrollbar-thumb {
background-color: #181c36e6;
}
/* 修改滚动条滑块悬停时的颜色 */
&::-webkit-scrollbar-thumb:hover {
background-color: #181c36e6;
}
}
.main-container { .main-container {
position: fixed; position: fixed;
width: calc(100% - 200px); width: calc(100% - 200px);
height: calc(100% - 60px); height: calc(100% - 60px);
top: 60px; top:60px;
left: 200px; left: 200px;
background: #fff; background: #fff;
padding: 0; padding: 0;
...@@ -349,13 +398,13 @@ export default { ...@@ -349,13 +398,13 @@ export default {
.left-box { .left-box {
position: absolute; position: absolute;
top: 10px; top: 10px;
left: 40px; left: 26px;
z-index: 9999; z-index: 9999;
} }
.pie { .pie {
width: 340px; width: 300px;
height: 299px; height: 270px;
background: #181C36; background: #181C36;
box-shadow: 0 4px 6px 0 #00000014; box-shadow: 0 4px 6px 0 #00000014;
z-index: 9999; z-index: 9999;
...@@ -363,78 +412,96 @@ export default { ...@@ -363,78 +412,96 @@ export default {
.analy-box { .analy-box {
margin-top: 8px; margin-top: 8px;
width: 340px; width: 300px;
background: #181C36; max-height: 420px;
border-radius: 8px;
box-sizing: border-box;
overflow-y: auto;
overflow-x: hidden;
background: rgba(24 ,28, 54 ,0.9);
box-shadow: 0 4px 6px 0 #00000014; box-shadow: 0 4px 6px 0 #00000014;
box-sizing: border-box; box-sizing: border-box;
padding: 16px; padding: 30px 16px 16px;
z-index: 9999; z-index: 9999;
.top-box { .top-box {
margin: 16px 0;
position: relative; position: relative;
.top-box-none{
position: relative;
width: 100%;
height: 130px;
.dask-bg{
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
}
.dask{
position: absolute;
z-index: 2;
left: 0;
top: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
border-radius: 8px;
background-color: rgba(82, 89, 141, 0.2);
backdrop-filter: blur(10px);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-weight: 600;
font-size: 21px;
color: #FFFFFF;
}
}
&-item { &-item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 16px; margin-bottom: 16px;
&-left { .top-box-item-left {
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 12px;
color: #FFFFFF; color: #FFFFFF;
width: 120px; text-align: center;
width: 100px;
margin-right: 12px;
} }
&-right { .top-box-item-right {
display: flex; width: 140px;
height: 12px;
.item { border-radius: 6px;
width: 36px; background: #46495E;
height: 12px; }
} .item5 {
background: #4ED5D7;
.item1 { }
background: #4ED5D7;
border-radius: 6px 0 0 6px;
}
.item2 {
background: #58D068;
}
.item3 {
background: #F7D310;
}
.item4 {
background: #F38906;
}
.item5 { .item4 {
background: #F23204; background: #58D068;
border-radius: 0 6px 6px 0; }
}
.item1-grey { .item3 {
background: #46495E; background: #F7D310;
border-radius: 6px 0 0 6px; }
}
.item5-grey { .item2 {
background: #46495E; background: #F38906;
border-radius: 0 6px 6px 0; }
}
.item-grey { .item1 {
background: #46495E; background: #F23204;
}
} }
&-right-none { &-right-none {
width: 180px; width: 140px;
height: 12px; height: 12px;
background: #46495E; background: #7a87d3;
border-radius: 6px; border-radius: 6px;
} }
} }
...@@ -457,21 +524,22 @@ export default { ...@@ -457,21 +524,22 @@ export default {
.middle-box { .middle-box {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
width: 280px; width: 100%;
font-size: 10px; font-size: 10px;
color: #ffffffb3; color: #ffffffb3;
margin: auto; margin: 20px 0;
.dot { .dot {
width: 6px; width: 6px;
height: 6px; height: 6px;
border-radius: 3px; border-radius: 50%;
display: inline-block; display: inline-block;
margin-right: 2px; margin-right: 4px;
vertical-align: middle;
} }
.dot-1 { .dot-1 {
background: #4ED5D7; background: #7481c3;
} }
.dot-2 { .dot-2 {
...@@ -500,11 +568,19 @@ export default { ...@@ -500,11 +568,19 @@ export default {
margin-top: 16px; margin-top: 16px;
&-left { &-left {
min-width: 100px; min-width: 84px;
text-align: right;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #A3A4AF; color: #A3A4AF;
} }
&-right { &-right {
font-family: PingFangSC-Regular;
line-height: 17px;
font-weight: 400;
font-size: 12px;
color: #E5E5E8; color: #E5E5E8;
} }
} }
...@@ -515,13 +591,19 @@ export default { ...@@ -515,13 +591,19 @@ export default {
.right-box { .right-box {
position: absolute; position: absolute;
top: 10px; top: 10px;
right: 40px; right: 26px;
z-index: 9999; z-index: 9999;
} }
.detail-box { .detail-box {
width: 340px;
background: #181C36; margin-top: 8px;
width: 300px;
max-height: 420px;
overflow-y: auto;
overflow-x: hidden;
background: rgba(24 ,28, 54 ,0.9);
border-radius: 8px;
box-shadow: 0 4px 6px 0 #00000014; box-shadow: 0 4px 6px 0 #00000014;
z-index: 9999; z-index: 9999;
box-sizing: border-box; box-sizing: border-box;
...@@ -530,8 +612,8 @@ export default { ...@@ -530,8 +612,8 @@ export default {
.title { .title {
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
color: #ffffff80; color: #158BFF;
margin-bottom: 24px; margin-bottom: 10px;
} }
.detail-msg { .detail-msg {
...@@ -539,39 +621,60 @@ export default { ...@@ -539,39 +621,60 @@ export default {
justify-content: space-between; justify-content: space-between;
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
margin-bottom: 10px; margin-bottom: 8px;
&:last-child{
margin-bottom: 0;
}
&-left { &-left {
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #A3A4AF; color: #A3A4AF;
min-width: 100px; min-width: 72px;
text-align: right;
} }
&-right { &-right {
flex: 1; flex: 1;
font-family: PingFangSC-Regular;
font-weight: 400;
font-size: 12px;
color: #E5E5E8; color: #E5E5E8;
text-align: left;
} }
&-desc { .detail-msg-desc {
color: #E5E5E8; color: #E5E5E8;
.sn{
color: #2994FF;
}
& div{
margin-bottom: 1px;
line-height: 17px;
}
} }
} }
} }
.use-car-box { .use-car-box {
margin-top: 8px; width: 300px;
width: 340px; height: 270px;
height: 264px; background: rgba(24 ,28, 54 ,0.9);
background: #181C36; border-radius: 8px;
box-sizing: border-box; box-sizing: border-box;
padding: 16px; padding: 16px;
box-shadow: 0 4px 6px 0 #00000014; box-shadow: 0 4px 6px 0 #00000014;
z-index: 9999; z-index: 9999;
position: relative;
.x-name{
color: #6e7079;
position: absolute;
right: 20px;
top: 30px;
}
.title { .title {
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
color: #ffffff80; color: #158BFF;
} }
.empty-box { .empty-box {
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
</el-row> </el-row>
<ul class="monitor-list" style="max-height: calc(100vh - 380px)"> <ul class="monitor-list" style="max-height: calc(100vh - 380px)">
<template v-for="(sn, key) in monitorList.itemArr"> <template v-for="(sn, key) in monitorList.itemArr">
<li class="monitor-list-item" :key="sn" @click="openMapInfoWindow(sn, monitorList[sn].source)" v-if="key !== 'count' && <li class="monitor-list-item" :key="sn" @click="openMapInfoWindow(sn, monitorList[sn].source, monitorList[sn].vid)" v-if="key !== 'count' &&
monitorList[sn] && monitorList[sn] &&
(monitorList[sn].source == monitorFilterType || (monitorList[sn].source == monitorFilterType ||
monitorFilterType == '') monitorFilterType == '')
...@@ -465,7 +465,8 @@ export default { ...@@ -465,7 +465,8 @@ export default {
} }
console.log(list); console.log(list);
let defaultVid = list && list.length ? list[list.length-1].vid : null
localStorage.setItem('vehicleId', defaultVid)
let items = []; let items = [];
items = list.map((item) => { items = list.map((item) => {
return { return {
...@@ -476,6 +477,7 @@ export default { ...@@ -476,6 +477,7 @@ export default {
id: item.id, id: item.id,
source: item.source === "有线" ? "1" : "0", source: item.source === "有线" ? "1" : "0",
sourceType: item.source, sourceType: item.source,
vid: item.vid
}; };
}); });
...@@ -777,6 +779,7 @@ export default { ...@@ -777,6 +779,7 @@ export default {
return false; return false;
} }
this.vidCode = list[0].vid; this.vidCode = list[0].vid;
localStorage.setItem('vehicleId', list && list[0] ? list[0].vid : null)
for (var i = 0, len = list.length; i < len; i++) { for (var i = 0, len = list.length; i < len; i++) {
_this.handleSelect(list[i]); _this.handleSelect(list[i]);
} }
...@@ -819,6 +822,7 @@ export default { ...@@ -819,6 +822,7 @@ export default {
id: item.id, id: item.id,
source: item.source === "有线" ? "1" : "0", source: item.source === "有线" ? "1" : "0",
sourceType: item.source, sourceType: item.source,
vid: item.vid
}); });
} else { } else {
console.log("展开节点", item); console.log("展开节点", item);
...@@ -1168,7 +1172,8 @@ export default { ...@@ -1168,7 +1172,8 @@ export default {
terminate() { terminate() {
this._drawTimeoutId && window.clearTimeout(this._drawTimeoutId); this._drawTimeoutId && window.clearTimeout(this._drawTimeoutId);
}, },
openMapInfoWindow(sn, source) { openMapInfoWindow(sn, source, vid) {
localStorage.setItem('vehicleId', vid)
EventBus.$emit("uiMap.monitor.openInfoWindow", `${sn}:${source}`); EventBus.$emit("uiMap.monitor.openInfoWindow", `${sn}:${source}`);
}, },
downloadTpl() { downloadTpl() {
......
...@@ -534,7 +534,7 @@ MapService.prototype = { ...@@ -534,7 +534,7 @@ MapService.prototype = {
riskBtn.classList.add('resident_btn_hidden'); riskBtn.classList.add('resident_btn_hidden');
} }
riskBtn.onclick = function() { riskBtn.onclick = function() {
let id = info.vidCode || localStorage.getItem('vehicleId'); let id = localStorage.getItem('vehicleId');
queryCode = `vehicleId=${id}` queryCode = `vehicleId=${id}`
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!