integrated_traffic_vue/src/views/BI/components/video_ai_analysis.vue

317 lines
7.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div class="container">
<div class="block1">
<layout-title title="告警数" />
<div class="option">
<div
class="list"
v-for="(item, index) in data.block1OptionsList"
:key="index"
>
<img :src="item.img" alt="" class="img" />
<div class="label">{{ item.label }}</div>
<div class="num">
<count-up :end-val="item.count"></count-up>
</div>
</div>
</div>
</div>
<div class="block2">
<layout-title title="报警类型" />
<div class="option" id="main1"></div>
</div>
<div class="block2">
<layout-title title="告警时间趋势" />
<div class="option" id="main2"></div>
</div>
<div class="block3">
<layout-title title="告警来源" />
<div class="option">
<div class="table">
<div class="tr">
<div class="td">序号</div>
<div class="td">告警数据类型</div>
<div class="td">时间</div>
</div>
<div class="tr" v-for="(item, index) in data.block4List" :key="index">
<div class="td">{{ item.serialNumber }}</div>
<div class="td line-1">{{ item.type }}</div>
<div class="td">{{ item.time }}</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import LayoutTitle from "./title.vue";
import CountUp from "vue-countup-v3";
import { onMounted, reactive } from "vue";
import echarts1 from "../js/echarts1.js";
import echarts2 from "../js/echarts2.js";
import {
getCameraAlarmCount,
getCameraAlarmTimeCount,
getCameraAlarmTypeCount,
} from "@/request/bi/mapApi.js";
const data = reactive({
block1OptionsList: [
{
img: new URL("/src/assets/images/map/img13.png", import.meta.url).href,
label: "总数",
count: 0,
},
{
img: new URL("/src/assets/images/map/img14.png", import.meta.url).href,
label: "已处理数",
count: 0,
},
{
img: new URL("/src/assets/images/map/img15.png", import.meta.url).href,
label: "待处理数",
count: 0,
},
],
block4List: [
{
serialNumber: 1,
type: "有限空间作业(编号ZYHJ12)",
time: "2023-12-13 12:25:36",
},
{
serialNumber: 1,
type: "有限空间作业(编号ZYHJ12)",
time: "2023-12-13 12:25:36",
},
{
serialNumber: 1,
type: "有限空间作业(编号ZYHJ12)",
time: "2023-12-13 12:25:36",
},
],
});
const getCameraAlarmData = async () => {
const resData = await getCameraAlarmCount();
let allAlarm = 0;
let disposed = 0;
resData.CameraAlarmCount.forEach((item) => {
allAlarm += item.count;
if (item.type === 3) {
disposed = item.count;
}
});
data.block1OptionsList[0].count = allAlarm;
data.block1OptionsList[1].count = allAlarm - disposed;
data.block1OptionsList[2].count = disposed;
};
const getCameraAlarmTimeData = async () => {
const resData = await getCameraAlarmTimeCount();
echarts2(
"main2",
resData.varList.monthStrList,
resData.varList.accumulatedList,
resData.varList.monthList
);
};
const getCameraAlarmTypeData = async () => {
const resData = await getCameraAlarmTypeCount();
const leg = [];
const cont = [];
resData.varList.forEach((item) => {
leg.push(item.TYPE);
cont.push(item.PERCENTAGE);
});
echarts1("main1", leg, cont);
};
getCameraAlarmData();
getCameraAlarmTimeData();
getCameraAlarmTypeData();
onMounted(() => {
echarts1(
"main1",
["烟雾", "水电", "烟雾", "烟雾", "烟雾"],
[12.2, 15, 11, 8, 16]
);
echarts2(
"main2",
["1月", "2月", "3月", "4月", "5月", "6月", "7月"],
[393, 831, 933, 1200, 1386, 1721, 2027],
[393, 438, 102, 267, 186, 315, 316]
);
});
</script>
<style scoped lang="scss">
.container {
width: 100%;
.block1 {
width: 430px;
.option {
width: 100%;
min-height: 100px;
background-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.8)
);
border-radius: 10px;
border: 1px solid;
border-image: linear-gradient(
to bottom,
rgba(58, 122, 149, 0),
rgba(16, 188, 236, 1)
)
1;
border-top: none;
display: flex;
justify-content: space-around;
padding: 20px 0;
text-align: center;
.list {
text-align: center;
width: 33%;
.img {
animation: slideY 2s infinite;
}
.label {
margin-top: 5px;
}
.num {
font-size: 24px;
margin-top: 10px;
background: linear-gradient(to top, #ffffff, #00a8ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: bold;
font-family: "Pingfang SC", "Microsoft YaHei", "Monospaced Number",
"Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue",
Helvetica, Arial, sans-serif;
text-shadow: 0 0 20px #2c67ec;
}
}
}
}
.block2 {
width: 430px;
margin-top: 10px;
.option {
width: 100%;
min-height: 100px;
background-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.8)
);
border-radius: 10px;
border: 1px solid;
border-image: linear-gradient(
to bottom,
rgba(58, 122, 149, 0),
rgba(16, 188, 236, 1)
)
1;
border-top: none;
padding: 20px 0;
height: 225px;
}
}
.block3 {
width: 430px;
margin-top: 10px;
.option {
width: 100%;
min-height: 100px;
background-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 0.8)
);
border-radius: 10px;
border: 1px solid;
border-image: linear-gradient(
to bottom,
rgba(58, 122, 149, 0),
rgba(16, 188, 236, 1)
)
1;
border-top: none;
padding: 10px;
.table {
margin-top: 5px;
.tr {
display: flex;
&:nth-child(odd) {
background-color: rgba(42, 86, 158, 0.53);
}
.td {
flex: 1;
text-align: left;
font-size: 14px;
color: #fff;
padding: 10px 10px;
&:nth-child(1) {
flex-basis: 50px;
}
&:nth-child(2) {
flex-basis: 50%;
}
&:nth-child(3) {
flex-basis: 40%;
}
}
.empty {
flex: 1;
text-align: center;
font-size: 12px;
color: #fff;
padding: 5px;
}
}
}
}
}
@keyframes slideY {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-5px);
}
100% {
transform: translateY(0);
}
}
@keyframes scale {
0% {
transform: translateX(-50%) scale(1);
}
50% {
transform: translateX(-50%) scale(0.5);
}
100% {
transform: translateX(-50%) scale(1);
}
}
}
</style>