统计分析

This commit is contained in:
851673013@qq.com 2022-07-05 20:01:31 +08:00
parent 9fa06acd50
commit f4717b5744
1 changed files with 316 additions and 168 deletions

View File

@ -1,200 +1,348 @@
<template> <template>
<div class="box"> <div class="box">
<div class="title">统计分析</div>
<div class="tabs-button"> <div class="water-points-content">
<div class="tabs-button-box"> <div class="time">更新时间{{ time }}</div>
<div class="tabs-button-btn" <div class="water-point-reporting-title">
@click="tabHandleClick(item)" <div class="water-point-reporting-title-top">积水点上报Top10</div>
v-for="item in tabsButton" <div class="water-point-reporting-title-bottom"></div>
:key="item" </div>
:class="tabsActiveName == item?'tabs-button-btn-active':''" <div class="water-point-reporting-table">
> <div class="table-title">
{{item}} <span>序号</span><span>积水点</span><span>上报次数</span>
</div>
<div class="table-content">
<div
class="table-content-card"
v-for="(item, index) in dataList"
:key="`table-${index}`"
>
<span>{{ index + 1 }}</span>
<el-tooltip
class="item"
effect="dark"
:content="item.name"
placement="top"
>
<span>{{ item.name }}</span></el-tooltip
><span>{{ item.number }}</span>
</div>
</div> </div>
</div> </div>
</div> <div class="water-point-analysis">
<div class="water-point-reporting-title">
<div class="label-content"> <div class="water-point-reporting-title-top">积水点来源分析</div>
<el-input <div class="water-point-reporting-title-bottom"></div>
placeholder="请输入关键词" </div>
prefix-icon="el-icon-search" <div class="water-point-reporting-title">
v-model="labelSearch" <div class="water-point-reporting-title-top">积水点级别分析</div>
@input="searchLabel" <div class="water-point-reporting-title-bottom"></div>
> </div>
</el-input> </div>
<el-checkbox-group v-model="checkboxGroup"> <div class="water-point-analysis-eachars">
<el-checkbox-button <div id="analysis-of-water-source"></div>
v-for="item in tabList" <div id="analysis-of-water-level"></div>
:label="item.labelName" </div>
:key="item.id"
@change="tabChange(item)"
>
{{item.labelName}}
</el-checkbox-button>
</el-checkbox-group>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import moment from 'moment'
import { getCameraAll,getCameraLabel,getCameraAllLabel,searchCamera,getCameraAllOrgan,getCameraByParentId,selectByLabelName,selectByChannelName } from '@/api/videoSurveillance/index' import * as echarts from 'echarts'
import bus from "@/views/layout/bus";
export default { export default {
data() { data () {
return { return {
tabsButton: ["视频标签","视频列表"], time: moment().format('YYYY-MM-DD HH:mm:ss'),
tabsActiveName: "视频标签", dataList: [
tabList:[], {
labelSearch:'', name: '积水点位置66666666666666666666666',
checkboxGroup: [], number: '15'
cameraAllData:[], },
}; {
name: '积水点位置666666666666',
number: '15'
},
{
name: '积水点位置6666666666666666666666666',
number: '15'
},
{
name: '积水点位置666666666666',
number: '15'
},
{
name: '积水点位置66666666666666666666666',
number: '15'
},
{
name: '积水点位置666666666666',
number: '15'
}
]
}
}, },
mounted() { mounted () {
getCameraAllLabel().then((res) => { this.$nextTick(() => {
this.tabList = res.data.data // charts
}); this.initEventTypeCharts()
getCameraAll().then((res) => { this.initEventTypeCharts2()
this.cameraAllData = res.data
// this.addResourceTomap('cameraAll',res.data);
}) })
}, },
methods: { methods: {
tabHandleClick(item) { // charts
this.tabsActiveName = item initEventTypeCharts () {
}, const inner = [
tabChange(item){ {
if(this.checkboxGroup.indexOf(item.labelName) !== -1){ value: 2,
bus.$emit("removeCameraLayer",'全部') unit: '个',
getCameraLabel({labelCode:item.labelCode}).then((res) => { name: '物联感知'
bus.$emit("CameraSingleDataOnMap",item.labelName,res.data.data) },
{
// this.addResourceTomap(item.labelName,res.data.data); value: 2,
// res.data.data.forEach((item) => { unit: '个',
// this.camreaTreeSingle.forEach((val) => { name: '视频感知'
// if(item.nodeName == val.channelName){ },
// val.children.push(item) {
// } value: 4,
// }) unit: '个',
// }) name: '市民上报'
// this.camreaTreeIsShow = false; },
}) {
}else { value: 2,
bus.$emit("removeCameraLayer",item.labelName) unit: '个',
// this.checkStatus = "2" name: '巡查上报'
// this.camreaTreeIsShow = true }
// getCameraAllOrgan({parentId:'S4NbecfYB1DBH8HNULGS34'}).then((res) => { ]
// this.camreaTree = res.data.data const legend1 = inner.map((v) => v.name)
// }) const legendData = [...legend1]
const option = {
color: ['#FBBD00', '#A3A3A3', '#E97C30', '#5A99D3'],
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
grid: {
height: '10px'
},
// itemStyle: {
// normal: {
// borderWidth: 2
// },
// label: {
// textStyle: {
// color: 'black',
// fontSize: 14,
// fontWeight: 'bolder'
// }
// }
// },
chart: {
type: 'pie',
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
series: [
{
name: '访问来源',
type: 'pie',
radius: ['0%', '80%'],
label: {
normal: {
position: 'inner'
}
},
labelLine: {
normal: {
show: false
}
},
data: inner
}
]
} }
const eventType = echarts.init(
document.getElementById('analysis-of-water-source')
)
eventType.setOption(option)
}, },
searchLabel(value) { initEventTypeCharts2 () {
const params = { const inner = [
labelName:value {
value: 2,
unit: '个',
name: '物联感知'
},
{
value: 2,
unit: '个',
name: '视频感知'
},
{
value: 4,
unit: '个',
name: '市民上报'
},
{
value: 2,
unit: '个',
name: '巡查上报'
}
]
const legend1 = inner.map((v) => v.name)
const legendData = [...legend1]
const option = {
color: ['#FBBD00', '#A3A3A3', '#E97C30', '#5A99D3'],
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
grid: {
height: '10px'
},
// itemStyle: {
// normal: {
// borderWidth: 2
// },
// label: {
// textStyle: {
// color: 'black',
// fontSize: 14,
// fontWeight: 'bolder'
// }
// }
// },
chart: {
type: 'pie',
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
series: [
{
name: '访问来源',
type: 'pie',
radius: ['45%', '80%'],
label: {
normal: {
position: 'inner'
}
},
labelLine: {
normal: {
show: false
}
},
data: inner
}
]
} }
selectByLabelName(params).then((res) => { const eventType = echarts.init(
console.log(res) document.getElementById('analysis-of-water-level')
this.tabList = res.data.data )
}) eventType.setOption(option)
}, }
}, }
}; }
</script> </script>
<style lang='scss' scoped> <style lang="scss" scoped>
.box { .box {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: url(../../../../assets/construction/listTopBg.png) no-repeat, background: url(../../../../assets/construction/subTitle.png) no-repeat;
url(../../../../assets/construction/videoTag.png) no-repeat 324px 17px; text-align: center;
padding: 30px 0 18px 18px; color: #fff;
.title {
.tabs-button { font-size: 26px;
position: relative; font-weight: bold;
.tabs-button-box { background: linear-gradient(0deg, #9dbbd2 0%, #ffffff 100%);
width: 358px; background-clip: text;
padding-bottom: 11px; -webkit-background-clip: text;
border-bottom: 3px solid #2c619c; -webkit-text-fill-color: transparent;
display: flex; font-family: 'Tensentype-ZhiHeiJ-W5';
align-items: center; }
.tabs-button-btn { .time {
font-size: 18px; text-align: left;
color: rgba($color: #fff, $alpha: 0.6); margin-bottom: 10px;
position: relative; margin-top: 10px;
cursor: pointer; }
margin-right: 28px; .water-point-reporting-title {
text-align: left;
padding-top: 5px;
font-weight: bold;
background: linear-gradient(
to right,
rgba(27, 103, 176, 1),
rgba(27, 103, 176, 0)
);
.water-point-reporting-title-top {
margin-left: 10px;
}
.water-point-reporting-title-bottom {
height: 5px;
background: linear-gradient(
to right,
rgba(55, 185, 192, 1),
rgba(55, 185, 192, 0)
);
}
}
.water-point-reporting-table {
.table-title {
margin: 10px 0;
span {
display: inline-block;
text-align: center;
width: 25%;
} }
.tabs-button-btn-active { span:nth-child(2) {
font-size: 20px; width: 199px;
color: #fff;
} }
.tabs-button-btn-active::after { }
content: ''; .table-content {
position: absolute; height: 180px;
bottom: -15px; overflow-y: auto;
right: 6%; .table-content-card {
width: 64px; display: flex;
height: 5px; align-items: center;
border-radius: 5px; margin-bottom: 5px;
background-color: #1ffffc; span {
display: inline-block;
text-align: center;
width: 25%;
}
span:nth-child(2) {
width: 199px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
}
} }
} }
} }
.water-point-analysis {
::v-deep .label-content { display: flex;
margin-top: 16px; & > div:first-child {
.el-input { width: 60%;
width: 358px;
} }
.el-input__inner { & > div:last-child {
border: 1px solid rgba(31,254,253,.9); width: 40%;
color: #fff;
border-radius: unset;
background: rgba($color: #203b5d, $alpha: .8);
&::placeholder {
color: rgba($color: #fff, $alpha: 0.6);
}
} }
.el-input__prefix { }
color: rgba(31,254,253,.9); .water-point-analysis-eachars {
display: flex;
& > div:first-child {
width: 60%;
height: 165px;
} }
& > div:last-child {
.el-checkbox-group { width: 40%;
height: 316px; height: 165px;
width: 372px;
overflow-y: auto;
margin-top: 6px;
&::-webkit-scrollbar {
width: 8px;
background-color: #10335e;
}
&::-webkit-scrollbar-thumb {
background-color: #446dac !important;
}
}
.el-checkbox-button {
border-radius: 15px;
margin: 10px;
.el-checkbox-button__inner {
height: 30px;
line-height: 6px;
border-radius: 15px;
background: linear-gradient(0deg, rgba($color: #24517b, $alpha: 1) 0, rgba($color: #24517b, $alpha: 0) 100%);
border: 1px solid #1d98a0;
font-size: 16px;
color: #1ffefd;
}
.el-checkbox-button__inner:hover {
border: 1px solid #1ffefd;
background: linear-gradient(0deg, #1577d3 0%, #1251ab 100%);
}
}
.el-checkbox-button.is-checked {
.el-checkbox-button__inner{
color: #fff;
border: 1px solid #1ffefd;
background: linear-gradient(0deg, #1577d3 0%, #1251ab 100%);
}
} }
} }
} }