You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
JiangningUrbanManagePc/src/views/bigScreen/components/mapLeftContent.vue

284 lines
7.7 KiB

2 years ago
<!--
* @Descripttion:
* @version:
* @Author: JC9527
* @Date: 2023-08-15 09:44:13
* @LastEditors: JC9527
* @LastEditTime: 2024-01-04 15:23:57
2 years ago
-->
<template>
<div class="left-box">
2 years ago
<div class="item left-list-title" :style="itemTwo">
2 years ago
<title-box title="今日事件情况"></title-box>
<div class="item-main">
<div class="lists">
<div class="bgc"></div>
<div class="list-text"> · 上报事件总数</div>
<div class="list-bottom">
<img src="@/assets/images/incident.png" alt="">
<div class="list-num">200</div>
</div>
</div>
<div class="lists">
<div class="bgc"></div>
<div class="list-text"> · 已受理事件</div>
2 years ago
<div class="list-bottom">
<img src="@/assets/images/incident.png" alt="">
<div class="list-num">180</div>
</div>
</div>
<div class="lists">
<div class="bgc"></div>
<div class="list-text"> · 未受理事件</div>
2 years ago
<div class="list-bottom">
<img src="@/assets/images/incident.png" alt="">
<div class="list-num">20</div>
</div>
</div>
</div>
</div>
2 years ago
<div class="item left-list-title" :style="itemTwo">
2 years ago
<title-box title="今日任务情况"></title-box>
<div class="item-main">
<div class="lists">
<div class="bgc"></div>
<div class="list-text"> · 派发任务总数</div>
2 years ago
<div class="list-bottom">
<img src="@/assets/images/task.png" alt="">
<div class="list-num">200</div>
</div>
</div>
<div class="lists">
<div class="bgc"></div>
<div class="list-text"> · 已处理任务数量</div>
2 years ago
<div class="list-bottom">
<img src="@/assets/images/task.png" alt="">
<div class="list-num">180</div>
</div>
</div>
<div class="lists">
<div class="bgc"></div>
<div class="list-text"> · 未处理任务数量</div>
2 years ago
<div class="list-bottom">
<img src="@/assets/images/task.png" alt="">
<div class="list-num">20</div>
</div>
</div>
</div>
</div>
2 years ago
<div class="item lfet-list-one" id="parent-getHeight" :style="itemOne">
2 years ago
<title-box title="人员在线情况"></title-box>
<map-number title="在线人员总数" :onLine="100" :sum="150" type="人" :numberArray="peopleArray" :height="oneHeight" :id="1" v-on="$listeners"></map-number>
2 years ago
</div>
2 years ago
<div class="item lfet-list-two" :style="itemOne">
2 years ago
<title-box title="车辆在线情况"></title-box>
<map-number title="在线车辆总数" :onLine="10" :sum="18" type="辆" :numberArray="vehicleArray" :height="oneHeight" :id="2"></map-number>
2 years ago
</div>
</div>
</template>
<script>
import titleBox from '../../components/title/index.vue'
import mapNumber from '../../components/mapLeftNumber/index.vue'
import { getQueryViewListPage,getTrend } from '@/api/bigScreenApi/eventApi.js'
2 years ago
export default {
name:'mapLeftContent',
components:{titleBox,mapNumber},
data() {
return {
peopleArray:[
{
title:'李飞'
},{
title:'李飞'
},{
title:'李飞'
},{
title:'李飞'
},{
title:'李飞'
},{
title:'李飞'
},{
title:'李飞'
},{
title:'李飞'
},{
title:'李飞'
},{
title:'李飞'
},
],
vehicleArray:[
{
userName:'苏A123456'
2 years ago
},{
userName:'苏A123456'
2 years ago
},{
userName:'苏A123456'
2 years ago
},{
userName:'苏A123456'
2 years ago
},{
userName:'苏A123456'
2 years ago
},{
userName:'苏A123456'
2 years ago
},{
userName:'苏A123456'
2 years ago
},{
userName:'苏A123456'
2 years ago
},{
userName:'苏A123456'
2 years ago
},{
userName:'苏A123456'
2 years ago
},
2 years ago
],
itemOne:{
height:'',
},
itemTwo:{
height:'',
},
oneHeight:0,
screenHeight:'',
$listeners:false,
eventList:{
viewCode:"event-all-list",
pageNo:"1",
pageSize:"10"
},
eventData:{
"queryValue": [
// {
// "colCode": "name",
// "queryValue": "111"
// },
],
"myInstanceClassify": "all"
}
2 years ago
}
},
props:['personLine','carLine'],
watch:{
personLine:{
handler(newPerson){
// console.log(newPerson,'在线人员情况');
this.peopleArray = newPerson
},
immediate:true,
},
carLine:{
handler(newPerson){
// console.log(newPerson,'在线人员情况');
this.vehicleArray = newPerson
},
immediate:true,
}
},
2 years ago
methods:{
2 years ago
getDomHeight(){
this.$nextTick(()=>{
let dom = document.getElementsByClassName('lfet-list-one');
let dom2 = document.getElementsByClassName('left-list-title');
let height2 = dom2[0].getBoundingClientRect();
let height = dom[0].getBoundingClientRect();
let windowHeight = window.innerHeight;
// let relativeHeight = (windowHeight - height.top) / 2 - 14;
let relativeHeight = (windowHeight - height.top) / 2 + 4;
2 years ago
let sum = relativeHeight * 2 - 2;
// let relativeHeight2 = (windowHeight - height2.top - sum) / 2 - 55;
let relativeHeight2 = (windowHeight - height2.top - sum) / 2 - 115;
2 years ago
this.itemOne.height = relativeHeight + 'px';
this.itemTwo.height = relativeHeight2 + 'px';
this.oneHeight = Number(relativeHeight);
})
},
getEvent(){
getQueryViewListPage(this.eventList,this.eventData).then(res=>{
console.log(res,'resres');
})
},
2 years ago
},
mounted(){
window.addEventListener("resize", () => {
this.screenHeight = document.body.clientHeight;
this.getDomHeight();
});
this.getDomHeight();
this.getEvent();
getTrend({type:1}).then(res=>{
console.log(res,'事件来源');
})
2 years ago
},
}
</script>
<style lang="scss" scoped>
.left-box {
display: grid;
grid-column: 1fr;
2 years ago
grid-row-gap: 24px;
height: 100%;
2 years ago
.item {
// background: rgba(222, 225, 230, 0.6);
.item-main {
margin-top: 5px;
display: flex;
justify-content: space-between;
padding-left: 17px;
.lists {
// padding: 5px;
width: 141px;
display: flex;
flex-direction: column;
// justify-content: space-between;
position: relative;
.bgc {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
width: 141px;
background: linear-gradient(180deg, #0073FF 0%, rgba(0,71,129,0) 100%);
opacity: 0.5;
}
.list-text {
font-size: 15px;
height: 38px;
font-family: 'Source Han Sans CN-Regular';
2 years ago
font-weight: 400;
color: #D3EEF2;
line-height: 22px;
background-image: url("../../../assets/images/masking.png");
background-size: 100% 100%;
padding: 16px 0 0 8px;
}
.list-bottom {
display: flex;
padding-left: 24px;
margin-top: 11px;
img {
width: 37px;
height: 40px;
margin-right: 14px;
}
.list-num {
font-size: 32px;
font-family: 'D-DIN';
2 years ago
font-weight: 400;
color: #D3EEF2;
line-height: 35px;
letter-spacing: 1px
}
}
}
}
}
2 years ago
.lfet-list-one {
height: 100%;
}
.left-list-title {
height: 100%;
}
2 years ago
}
</style>