2023022104

This commit is contained in:
chengdandan 2023-02-21 20:18:33 +08:00
commit e3a50535e4
15 changed files with 721 additions and 619 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

13
src/api/management.js Normal file
View File

@ -0,0 +1,13 @@
import axios from 'axios';
import qs from 'qs';
if (process.env.NODE_ENV === 'development') {
axios.defaults.baseURL = '/';
} else if (process.env.NODE_ENV === 'production') {
axios.defaults.baseURL = '/';
}
//获取所有账号数据接口
export const getZhanghData = params => {
return axios.get('api/GetZhangh', {
params
});
};

View File

@ -1,5 +1,15 @@
<template>
<div style="width: 100%;margin-top: 5px;">
<div class="tableTitle">
<div>
<span
style="width: 10px;height:10px;border-radius: 50%;background-color: #3297ff;display: inline-block;vertical-align: middle;margin-right: 8px;"
></span>
<span style="font-size:18px;">{{ componentName + '-' + chartName + '-' + '均值图' }}</span>
</div>
</div>
<div id="barChart" ref="barChart" style="width: 100%; height: 300px"></div>
</div>
</template>
<script>
@ -10,10 +20,17 @@ export default {
type: Array,
default() {
return [];
},
}
},
typeValue: {
type:Object,
type: Object
},
//
componentName: {
type: String
},
chartName: {
type: String
}
},
data() {
@ -21,23 +38,14 @@ export default {
},
methods: {
drawBar(arr) {
let myChart = this.$echarts.getInstanceByDom(this.$refs.barChart)
let myChart = this.$echarts.getInstanceByDom(this.$refs.barChart);
if (myChart == null) {
myChart = this.$echarts.init(this.$refs.barChart)
myChart = this.$echarts.init(this.$refs.barChart);
}
let chartData = [{ stage: '', number: 40 }];
let chartData = [{ stage: '', number: 40 }];
let option = {
tooltip: {},
color: ['#0EECE4'],
tooltip: {
// trigger: 'axis',
confine: true
// axisPointer: { //
// type: 'line', // 线'line' | 'shadow'
// lineStyle: {
// color: 'transparent',
// },
// },
},
grid: {
left: '0%',
right: '0%',
@ -49,7 +57,7 @@ export default {
{
type: 'category',
gridIndex: 0,
data: chartData.map((item) => item.stage),
data: chartData.map(item => item.stage),
axisLine: {
show: false
},
@ -79,6 +87,24 @@ export default {
max: 200
},
series: [
{
name: '外框',
type: 'bar',
barGap: '-120%', //
data: [300],
barWidth: 150,
itemStyle: {
normal: {
color: 'rgba(0,0,0,.1)', //
barBorderWidth: 1, //
label: {
//
show: false
}
}
},
z: 1
},
{
name: '平均值',
type: 'bar',
@ -89,90 +115,88 @@ export default {
label: {
show: true,
position: 'right',
// align: 'right',
// offset: [10, 20],
distance: 15,
color: '#000',
fontSize: 17,
formatter: '{c}' + '[avg]'
},
itemStyle: {
color: '#DF8414'
color: '#89c6ff'
},
data: [10],
zlevel: 11
data: [arr.avg],
zlevel: 9
},
{
name: '中间值',
type: 'bar',
barWidth: 150,
// xAxisIndex: 0,
// yAxisIndex: 0,
stack: 'val',
label: {
show: true,
position: 'left',
distance: 15,
color: '#000',
// align: 'left',
fontSize: 17,
formatter: '{c}' + '[med]',
rich: {}
},
itemStyle: {
color: '#0E76AF'
color: '#67b4fd'
},
data: [30],
zlevel: 11
data: [arr.med],
zlevel: 9
},
{
name: '最值',
name: '最值',
type: 'bar',
stack: 'val',
barWidth: 150,
barGap: '-100%',
data: [20],
data: [arr.max],
label: {
show: true,
position: 'bottom',
position: 'right',
distance: 10,
color: '#000',
fontSize: 17,
formatter: '{c}' + '[min]'
},
tooltip: {
backgroundColor: 'transparent',
formatter: ' '
offset: [0, -30],
formatter: '{c}' + '[max]'
},
itemStyle: {
color: '#ABA7A7'
color: '#319cff'
},
zlevel: 9
},
{
name: '最值',
name: '最值',
type: 'bar',
stack: 'val',
barWidth: 150,
barGap: '-100%',
data: [200],
data: [arr.min],
label: {
offset: [10, 20],
show: true,
position: 'top',
distance: 15,
position: 'left',
distance: 10,
color: '#000',
offset: [0, -30],
fontSize: 17,
formatter: '{c}' + '[max]'
},
tooltip: {
backgroundColor: 'transparent',
formatter: ' '
formatter: '{c}' + '[min]'
},
// tooltip: {
// backgroundColor: 'transparent',
// formatter: ' '
// },
itemStyle: {
color: '#ABA7A7'
color: '#328adc'
},
zlevel: 9
}
]
};
myChart.setOption(option);
window.addEventListener('resize', function() {
myChart.resize();
@ -180,16 +204,24 @@ export default {
}
},
mounted() {
this.drawBar()
this.drawBar(this.typeValue);
},
watch: {
// typeValue: {
// handler(newVal) {
// if (newVal) {
// this.drawBar(newVal);
// }
// }
// }
typeValue: {
handler(newVal) {
if (newVal) {
this.drawBar(newVal);
}
},
deep: true
}
}
};
</script>
<style>
.tableTitle {
background: #f7f8fa;
margin-bottom: 5px;
padding: 8px;
}
</style>

View File

@ -1,7 +1,15 @@
<template>
<div style="width: 100%;margin-top: 5px;">
<div class="tableTitle">
<div>
<span
style="width: 10px;height:10px;border-radius: 50%;background-color: #3297ff;display: inline-block;vertical-align: middle;margin-right: 8px;"
></span>
<span style="font-size:18px;">{{ componentName + '-' + chartName + '-' + '柱状图' }}</span>
</div>
</div>
<div id="barChart" ref="barChart" style="width:100%;height:300px;"></div>
</div>
</template>
<script>
@ -10,7 +18,7 @@ export default {
props: {
list: Array,
default() {
return []
return [];
},
pageType: {
type: String
@ -35,51 +43,42 @@ export default {
return {
xData: [],
yData: []
}
},
created() {
};
},
created() {},
methods: {
drawBar() {
let myChart = this.$echarts.getInstanceByDom(this.$refs.barChart)
let myChart = this.$echarts.getInstanceByDom(this.$refs.barChart);
if (myChart == null) {
myChart = this.$echarts.init(this.$refs.barChart)
myChart = this.$echarts.init(this.$refs.barChart);
}
let option = {
color: ['#7262FD', '#FC5A5A'],
title:{
show:true,
text:this.componentName + '-' + this.chartName + '-' + '柱状图',
textStyle:{
lineHeight:'30',
}
},
tooltip: {
confine: true,
confine: true
},
grid: {
left: '2%',
right: '4%',
bottom: '10%',
top: '20%',
containLabel: true,
containLabel: true
},
xAxis: {
type: 'category',
data: this.xData,
axisLine: {
lineStyle: {
color: '#000',
},
color: '#000'
}
},
axisLabel: {
fontSize: 12,
color: '#000',
color: '#000'
},
axisTick: {
show: false,
},
show: false
}
},
yAxis: [
{
@ -87,64 +86,67 @@ export default {
min: 0,
minInterval: 1,
splitArea: {
show: false,
show: false
},
axisLine: {
show: true,
show: true
},
axisTick: {
show: false,
show: false
},
splitLine: {
lineStyle: {
color: '#eeebeb',
type: 'dashed', // dotted 线
},
type: 'dashed' // dotted 线
}
},
axisLabel: {
fontSize: 12,
color: '#000',
fontFamily: 'Bebas',
},
}],
series: [{
fontFamily: 'Bebas'
}
}
],
series: [
{
type: 'bar',
barWidth: 20,
itemStyle: { barBorderRadius: [5, 5, 0, 0], },
itemStyle: { barBorderRadius: [5, 5, 0, 0] },
name: '时间',
data: this.yData
},
],
};
myChart.setOption(option)
// window.onresize = () => { //
// myChart.resize();
// };
window.addEventListener('resize', function () {
myChart.resize()
}
)
},
]
};
myChart.setOption(option);
window.addEventListener('resize', function() {
myChart.resize();
});
}
},
mounted() {
this.drawBar()
this.xData = this.typeValue.type_data.map(ele => {
return ele.name;
});
this.yData = this.typeValue.type_data.map(ele => {
return ele.quantity;
});
this.drawBar();
},
watch: {
typeValue: {
handler(newVal) {
if (newVal) {
this.xData = newVal.type_data.map(ele => {
return ele.name
})
return ele.name;
});
this.yData = newVal.type_data.map(ele => {
return ele.quantity
})
this.drawBar()
}
}
return ele.quantity;
});
this.drawBar();
}
}
}
}
};
</script>

View File

@ -1,5 +1,15 @@
<template>
<div style="width: 100%;margin-top: 5px;">
<div class="tableTitle">
<div>
<span
style="width: 10px;height:10px;border-radius: 50%;background-color: #3297ff;display: inline-block;vertical-align: middle;margin-right: 8px;"
></span>
<span style="font-size:18px;">{{this.componentName + '-' + this.chartName + '-' + '曲线图', }}</span>
</div>
</div>
<div id="lineChart" ref="lineChart" style="width: 100%; height: 300px"></div>
</div>
</template>
<script>
@ -41,7 +51,6 @@ export default {
return {
xData: [],
yData: [],
yData1: [],
yData2: [],
yData3: [],
@ -65,13 +74,13 @@ export default {
myChart = this.$echarts.init(this.$refs.lineChart);
}
let option = {
title: {
show: true,
text: this.componentName + '-' + this.chartName + '-' + '曲线图',
textStyle: {
lineHeight: '30'
}
},
// title: {
// show: true,
// text: this.componentName + '-' + this.chartName + '-' + '线',
// textStyle: {
// lineHeight: '30'
// }
// },
legend: {},
grid: {
left: '2%',
@ -282,4 +291,10 @@ export default {
}
};
</script>
<style scoped></style>
<style scoped>
.tableTitle {
background: #f7f8fa;
margin-bottom: 5px;
padding: 8px;
}
</style>

View File

@ -1,5 +1,15 @@
<template>
<div style="width: 100%;margin-top: 5px;">
<div class="tableTitle">
<div>
<span
style="width: 10px;height:10px;border-radius: 50%;background-color: #3297ff;display: inline-block;vertical-align: middle;margin-right: 8px;"
></span>
<span style="font-size:18px;">{{this.componentName + '-' + this.chartName + '-' + '饼状图', }}</span>
</div>
</div>
<div id="pieChart" ref="pieChart" style="width:100%;height:300px;"></div>
</div>
</template>
<script>
@ -9,7 +19,7 @@ export default {
list: {
type: Array,
default() {
return []
return [];
}
},
componentName: {
@ -21,10 +31,8 @@ export default {
typeValue: {
type: Object
}
},
data() {
return {
//
legend: [],
@ -37,58 +45,52 @@ export default {
{
name: '非机动车',
value: 0
}, {
},
{
name: '行人',
value: 0
}
]
}
},
created() {
};
},
created() {},
methods: {
drawPie() {
let myChart = this.$echarts.getInstanceByDom(this.$refs.pieChart)
let myChart = this.$echarts.getInstanceByDom(this.$refs.pieChart);
if (myChart == null) {
myChart = this.$echarts.init(this.$refs.pieChart)
myChart = this.$echarts.init(this.$refs.pieChart);
}
var color = [
'#0CD2E6',
'#3751E6',
'#FFC722'
];
var color = ['#0CD2E6', '#3751E6', '#FFC722'];
let option = {
title: {
show: true,
text: this.componentName + '-' + this.chartName + '-' + '饼状图',
textStyle: {
lineHeight: '30',
}
},
// title: {
// show: true,
// text: this.componentName + '-' + this.chartName + '-' + '',
// textStyle: {
// lineHeight: '30'
// }
// },
color: color,
legend: {
top: 20,
right: 'center',
textStyle: {
},
data: this.legend,
textStyle: {},
data: this.legend
},
tooltip: {},
series: [{
series: [
{
type: 'pie',
center: ['50%', '55%'],
radius: '70%',
label: {
normal: {
show: false,
},
show: false
}
},
labelLine: {
show: false,
length: 0,
length2: 0,
length2: 0
},
label: {
normal: {
@ -98,51 +100,63 @@ export default {
rich: {
value: {
fontSize: 20,
color: '#ffffff',
},
},
color: '#ffffff'
}
}
}
},
data: this.seriesData,
}],
data: this.seriesData
}
]
};
myChart.setOption(option)
myChart.setOption(option);
// window.onresize = () => { //
// myChart.resize();
// };
window.addEventListener('resize', function() {
myChart.resize()
myChart.resize();
});
}
)
},
},
mounted() {
if (this.typeValue) {
this.typeValue.type_data.forEach(ele => {
this.seriesData.push({
name: ele.name,
value: ele.quantity
});
});
this.drawPie();
}
},
watch: {
//
typeValue: {
handler(newVal) {
if (newVal) {
this.legend = newVal.type_data.map(ele => {
return ele.name
return ele.name;
});
this.seriesData = []
this.seriesData = [];
newVal.type_data.forEach(ele => {
this.seriesData.push({
name: ele.name,
value: ele.quantity
})
})
this.drawPie()
}
});
});
// this.drawPie();
}
}
}
}
};
</script>
<style scoped></style>
<style scoped>
.tableTitle {
background: #f7f8fa;
margin-bottom: 5px;
padding: 8px;
}
</style>

View File

@ -1,15 +1,15 @@
<template><!-- 触发类型 -->
<template
><!-- 触发类型 -->
<div class="setion" v-if="isRefer">
<p class="chartTitle"><span class="titleIcon"></span> {{ componentName }} {{ triggerType }}</p>
<!-- 触发数据数值渲染 -->
<div class="typeContent" v-if="triggerType == '触发' || '周期时刻'">
<div v-if="dataArr && dataArr.length != 0">
<div v-if="title == '类型'" style="display:flex">
<el-card v-for="(n, i) in typeValue.type_data" :key="i"
style="width: 150px; margin-bottom: 20px; text-align: center">
<el-card v-for="(n, i) in typeValue.type_data" :key="i" style="width: 150px; margin-bottom: 20px; text-align: center">
<div>
<span style="font-size: 15px;">{{ n.name }}</span><br />
<span style="font-size: 15px;">{{ n.name }}</span
><br />
<span style="font-size: 30px; font-weight: bold">{{ n.quantity }}</span>
</div>
<div>
@ -34,27 +34,19 @@
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '流量'">
<span style="font-size: 15px;">流量</span><br />
<span style="font-size: 30px; font-weight: bold">{{
typeValue.flow
}}</span>
<span style="font-size: 30px; font-weight: bold">{{ typeValue.flow }}</span>
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '车头时距'">
<span style="font-size: 15px;">车头时距</span><br />
<span style="font-size: 30px; font-weight: bold">{{
typeValue.heavy
}}</span>
<span style="font-size: 30px; font-weight: bold">{{ typeValue.heavy }}</span>
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '排队数'">
<span style="font-size: 15px;">排队数</span>
<span style="font-size: 30px; font-weight: bold">{{
typeValue.n_queue
}}</span>
<span style="font-size: 30px; font-weight: bold">{{ typeValue.n_queue }}</span>
</div>
<div style="font-size: 30px; font-weight: bold" v-if="title == '检测数'">
<span style="font-size: 15px;">检测数</span>
<span style="font-size: 30px; font-weight: bold">{{
typeValue.n_stay
}}</span>
<span style="font-size: 30px; font-weight: bold">{{ typeValue.n_stay }}</span>
</div>
<div>
<div>
@ -66,15 +58,17 @@
<el-empty :image-size="100"></el-empty>
</div>
</el-card>
</div>
<div v-show="echartArr.includes('表格')">
<div class="tableTitle">
<div class="">
<div>
<span
style="width: 10px;height:10px;border-radius: 50%;background-color: #3297ff;display: inline-block;vertical-align: middle;margin-right: 8px;"
></span>
<span style="font-size:18px;">{{ this.chartName + '-' + this.componentName + '-' + '表格' }}</span>
</div>
<div class="tableTime">
{{ typeValue.time }}
</div>
</div>
<div v-if="pageType == '断面'" style="margin-bottom: 20px; border: 1px solid #e4e7ed">
@ -86,25 +80,53 @@
</div>
<div class="border" v-if="echartArr.includes('曲线图')">
<detailDialog />
<lineChart :componentName="componentName" :chartName="chartName" :pageType="pageType" :list="dataArr"
:status="triggerType" :title="title" :typeValue = typeValue />
<lineChart
:componentName="componentName"
:chartName="chartName"
:pageType="pageType"
:list="dataArr"
:status="triggerType"
:title="title"
:typeValue="typeValue"
/>
</div>
<div class="border" v-if="echartArr.includes('饼状图')">
<detailDialog />
<pieChart :componentName="componentName" :chartName="chartName" :pageType="pageType" :list="dataArr"
:status="triggerType" :title="title" :typeValue = typeValue />
<pieChart
:componentName="componentName"
:chartName="chartName"
:pageType="pageType"
:list="dataArr"
:status="triggerType"
:title="title"
:typeValue="typeValue"
/>
</div>
<div class="border" v-if="echartArr.includes('均值图')">
<detailDialog />
<avgChart :componentName="componentName" :chartName="chartName" :pageType="pageType" :list="dataArr"
:status="triggerType" :title="title" :typeValue = typeValue />
<avgChart
ref="avgRefChart"
:componentName="componentName"
:chartName="chartName"
:pageType="pageType"
:list="dataArr"
:status="triggerType"
:title="title"
:typeValue="typeValue"
/>
</div>
<div class="border" v-if="echartArr.includes('直方图')">
<detailDialog />
<barChart :componentName="componentName" :chartName="chartName" :pageType="pageType" :list="dataArr"
:status="triggerType" :title="title" :typeValue = typeValue />
<barChart
:componentName="componentName"
:chartName="chartName"
:pageType="pageType"
:list="dataArr"
:status="triggerType"
:title="title"
:typeValue="typeValue"
/>
</div>
</div>
</template>
@ -141,40 +163,28 @@ export default {
valueShow: {}
};
},
created() {
},
created() {},
methods: {
//
},
computed: {
},
computed: {},
mounted() {},
watch: {
//
dataArr: {
handler(newVal) {
},
handler(newVal) {},
immediate: true
},
typeValue: {
handler(newVal) {
this.total = 0
this.total = 0;
if (this.title == '类型') {
newVal.type_data.forEach(ele => {
this.total += ele.quantity
})
this.total += ele.quantity;
});
}
}
}
// cycleTimeData: {
@ -186,6 +196,11 @@ export default {
};
</script>
<style scoped>
.tableTitle {
background: #f7f8fa;
margin-bottom: 5px;
padding: 8px;
}
.typeContent {
box-sizing: border-box;
}

View File

@ -2,32 +2,26 @@
<div class="content-box">
<div class="container">
<p class="title">账号管理</p>
<!-- <div class="test-div">
<i class="el-icon-edit"></i>
<i class="el-icon-share"></i>
<i class="el-icon-delete"></i>
</div> -->
<el-button @click="addAccountDialog = true" type="primary" style="margin-bottom: 10px;"><i
class="el-icon-circle-plus-outline" style="margin-right: 3px;"></i>新增</el-button>
<el-button @click="addAccountDialog = true" type="primary" style="margin-bottom: 10px;"
><i class="el-icon-circle-plus-outline" style="margin-right: 3px;"></i>新增</el-button
>
<el-table :data="tableData" :height="tableHeight" border style="width: 100%">
<el-table-column align="center" prop="name" label="用户名称" width="180"></el-table-column>
<el-table-column align="center" prop="userName" label="用户名称" width="180"></el-table-column>
<el-table-column align="center" prop="account" label="用户账号" width="180"></el-table-column>
<el-table-column align="center" prop="role" label="角色"></el-table-column>
<el-table-column align="center" prop="jurisdiction" label="权限"></el-table-column>
<el-table-column align="center" prop="roleName" label="角色"></el-table-column>
<el-table-column align="center" label="权限">
<template slot-scope="scope">
<span>{{ scope.row.isEnable === '1' ? '启用' : '禁用' }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="160">
<template slot-scope="scope">
<el-button @click="edit(scope.row)" type="text" size="small" class="">编辑</el-button>
<el-button @click="showView(scope.row)" type="text" size="small" class="el-icon-view"></el-button>
<el-button @click="clickDelete(scope.row)" type="text" size="small" class="el-icon-delete"></el-button>
<!-- <el-button @click="showView(scope.row)" type="text" size="small" class="el-icon-view"></el-button> -->
<el-button @click="clickDelete(scope.row)" type="text" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page.sync="currentPage" :page-sizes="[100, 200, 300, 400]" :page-size="pageSize"
layout="sizes, prev, pager, next" :total="totalNumber" style="padding-top: 10px;">
</el-pagination>
<div class="dialog">
<el-dialog :title="dialogTitle" :visible.sync="addAccountDialog" width="30%">
<el-form label-position="left" label-width="80px" :model="formLabelAlign">
@ -54,6 +48,7 @@
</template>
<script>
import { getZhanghData } from '@/api/management';
export default {
data() {
return {
@ -64,27 +59,27 @@ export default {
role: '',
jurisdiction: ''
},
tableData: [
{
name: 'admin',
account: '',
role: 'admin',
jurisdiction: '超级管理员'
}
],
tableData: [],
tableHeight: 0,
currentPage: 1,
pageSize: 100,
totalNumber: 1000,
tableHeight: 0,
dialogTitle: '新增'
}
};
},
created() {
let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
this.tableHeight = windowHeight - 220;
this.tableHeight = windowHeight - 280;
this.getData();
},
methods: {
getData() {
getZhanghData().then(res => {
console.log(res);
this.tableData = res.data.data;
});
},
edit(scope) {
console.log(scope, '编辑');
this.dialogTitle = '编辑';
@ -105,7 +100,7 @@ export default {
console.log(`当前页: ${val}`);
}
}
}
};
</script>
<style scoped>

View File

@ -3,11 +3,15 @@
<el-empty v-show="componentList.length == 0" :image-size="400"></el-empty>
<!-- <p class="title" style="margin-bottom: 20px;font-size: 20px;font-weight: 400;">数据看板</p> -->
<el-scrollbar class="scrollbar">
<div class="dataBoard" ref='dataBoard' v-if="activeName == 'second'">
<div class="dataBoard" ref="dataBoard" v-if="activeName == 'second'">
<!-- 断面 -->
<div class="plate1" ref="plate1">
<div :class="sectionData.length <= 2 ? 'sectionBox' : 'section'" ref="section"
v-for="(s, i) in sectionData" :key="s.analogAreaComponentId">
<div
:class="sectionData.length <= 2 ? 'sectionBox' : 'section'"
ref="section"
v-for="(s, i) in sectionData"
:key="s.analogAreaComponentId"
>
<template>
<div ref="sectionContent">
<div>
@ -17,17 +21,27 @@
<span class="downPull1" data-num="1" @click="sectionHandle(i)"></span>
</div>
<div v-for="o in s.children" :key="o.analogAreaComponentId">
<OD v-if="o.componentName.includes('OD')" :pageType="o.graphicType" triggerType="触发"
:componentName="o.componentName" :echartArr="o.presentationForm"
:dataArr="o.trigger" :title="o.componentName.split('_')[0]"
:chartName='o.combinationName' />
<typeChart v-else :pageType="o.graphicType" :triggerType="o.timeMode"
<OD
v-if="o.componentName.includes('OD')"
:pageType="o.graphicType"
triggerType="触发"
:componentName="o.componentName"
:echartArr="o.presentationForm"
:dataArr="o.trigger"
:title="o.componentName.split('_')[0]"
:chartName="o.combinationName"
/>
<typeChart
v-else
:pageType="o.graphicType"
:triggerType="o.timeMode"
:componentName="o.componentName"
:dataArr="o.timeMode == '触发' ? o.trigger : o.cycleTimeData"
:echartArr="o.presentationForm" :title="o.componentName.split('_')[0]"
:chartName='o.combinationName'
:typeValue="o.timeMode == '触发' ? typeValue : typeCycleTimeData" />
:echartArr="o.presentationForm"
:title="o.componentName.split('_')[0]"
:chartName="o.combinationName"
:typeValue="o.timeMode == '触发' ? typeValue : typeCycleTimeData"
/>
</div>
<!-- :data="triggerList.length != 0 ? triggerList : tableData" -->
</div>
@ -80,7 +94,7 @@ export default {
default() {
return [];
}
},
}
},
data() {
return {
@ -302,8 +316,6 @@ export default {
}
],
idVal: '',
//
componentList: [],
@ -312,16 +324,12 @@ export default {
sectionData: [],
//
tableList: [],
// 线
headWay: [],
tripData: [],
sectionArr: [],
@ -334,11 +342,11 @@ export default {
},
created() {
this.idVal = this.$route.query.id;
getComponentSection({ VideoId: this.idVal }).then((res) => {
getComponentSection({ VideoId: this.idVal }).then(res => {
if (res.data.code == 200) {
console.log(res.data.data, '11111111111111111');
this.componentList = res.data.data
this.siftData()
this.componentList = res.data.data;
this.siftData();
//
// this.componentList.forEach((val) => {
// this.sectionArr.push(val.combinationName);
@ -357,18 +365,16 @@ export default {
} else if (res.data.code == 404) {
}
});
},
methods: {
siftData() {
this.componentList.forEach((val) => {
this.componentList.forEach(val => {
this.sectionArr.push(val.combinationName);
this.sectionArr = Array.from(new Set(this.sectionArr));
});
this.sectionData = this.sectionArr.map((item) => {
this.sectionData = this.sectionArr.map(item => {
item = { title: item, children: [] };
this.componentList.forEach((val) => {
this.componentList.forEach(val => {
if (item.title == val.combinationName) {
item.children.push(val);
}
@ -390,60 +396,46 @@ export default {
if (sectionBox[i] != undefined) {
sectionBox[i].style.height = 'auto';
}
} else {
downPulls1[i].style.cssText = 'transition: all 0.5s linear;';
sections[i].style.height = '500px';
if (sectionBox[i] != undefined) {
sectionBox[i].style.height = '48vh'
sectionBox[i].style.height = '48vh';
}
}
}
},
//
},
mounted() {
},
mounted() {},
watch: {
//
triggerData: {
handler(newVal, oldVal) {
},
handler(newVal, oldVal) {},
immediate: true
},
//
triggerListData: {
handler(newVal) {
this.triggerList = newVal
//
console.log(newVal, 'triggerlistData');
this.triggerList = newVal;
this.componentList.forEach(ele => {
if (ele.trigger == undefined && ele.timeMode == '触发') {
ele.trigger = []
ele.trigger = [];
}
newVal.forEach(item => {
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '触发') {
if (ele.trigger.length == 10) {
ele.trigger.pop()
ele.trigger.pop();
} else {
//
if (item.type_data != null) {
// console.log(item,'461461');
this.typeValue = item
}
ele.trigger.unshift(item)
this.typeValue = item;
ele.trigger.unshift(item);
}
}
})
})
});
});
},
immediate: true
},
@ -455,22 +447,26 @@ export default {
if (newVal.length != 0) {
this.componentList.forEach(ele => {
if (ele.cycleTimeData == undefined && ele.timeMode == '周期时刻') {
ele.cycleTimeData = []
ele.cycleTimeData = [];
}
newVal.forEach(item => {
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '周期时刻' && ele.analogAreaGraphId == item.graphical_id) {
if (
ele.analogAreaComponentId == item.component_id &&
ele.timeMode == '周期时刻' &&
ele.analogAreaGraphId == item.graphical_id
) {
if (ele.cycleTimeData.length == 10) {
ele.cycleTimeData.slice(ele.cycleTimeData.length-1,0)
ele.cycleTimeData.slice(ele.cycleTimeData.length - 1, 0);
} else {
if(item.type_data!=null){
// if (item.type_data != null) {
//
this.typeCycleTimeData = item
}
ele.cycleTimeData.unshift(item)
this.typeCycleTimeData = item;
// }
ele.cycleTimeData.unshift(item);
}
}
})
})
});
});
console.log(this.sectionData, '455');
}
},
@ -482,11 +478,7 @@ export default {
console.log(newVal, '周期统计');
}
}
},
}
};
</script>
@ -506,7 +498,7 @@ export default {
/deep/ .el-scrollbar__view {
display: inline-block !important;
width: 100%
width: 100%;
}
/deep/ .el-scrollbar__wrap {
@ -520,7 +512,6 @@ export default {
.dataBoard {
height: 100%;
}
}
.dataBoard .region,

View File

@ -15,12 +15,17 @@
v-if="videoUnityShow"
></iframe>
<!-- <iframe src="./VideoWeb/index.html" style="height: 100%; width: 100%;border: none" ref="iframe"></iframe> -->
<el-empty :description="description" v-if="videoAnalysisShow">
</el-empty>
<el-empty :description="description" v-if="videoAnalysisShow"> </el-empty>
</div>
</el-tab-pane>
<el-tab-pane label="数据看板" name="second">
<dataBoard :activeName="activeName" :triggerData="triggerData" :triggerListData="triggerListData" :cycleTimeData='cycleTimeData' :cycleStatistics='cycleStatistics'></dataBoard>
<dataBoard
:activeName="activeName"
:triggerData="triggerData"
:triggerListData="triggerListData"
:cycleTimeData="cycleTimeData"
:cycleStatistics="cycleStatistics"
></dataBoard>
</el-tab-pane>
<el-tab-pane label="分析配置" name="third">
<analysisConfiguration :analysisConfigurationdata="analysisConfigurationdata"></analysisConfiguration>
@ -32,8 +37,16 @@
</el-tabs>
<!-- <el-button class="videoAnalysis" type="primary" size="mini" @click="videoAnalysisBtn" v-if="videoAnalysisShow" :disabled='disabledVideoAnalysis'
>视频分析</el-button> -->
<el-button class="trafficAnalysis" type="primary" plain size="mini" @click="trafficAnalysisBtn" v-if="trafficAnalysisShow" :disabled='disabledTrafficAnalysis'
>交通分析</el-button>
<el-button
class="trafficAnalysis"
type="primary"
plain
size="mini"
@click="trafficAnalysisBtn"
v-if="trafficAnalysisShow"
:disabled="disabledTrafficAnalysis"
>交通分析</el-button
>
</div>
<el-drawer
class="new-dialog"
@ -80,7 +93,14 @@
<el-checkbox v-for="item in typeData" :label="item" :key="item">{{ item }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="数值筛选:" v-if="componentForm.componentType != 'OD' &&componentForm.componentType != '类型'&&componentForm.componentType != '流量'">
<el-form-item
label="数值筛选:"
v-if="
componentForm.componentType != 'OD' &&
componentForm.componentType != '类型' &&
componentForm.componentType != '流量'
"
>
<el-input-number v-model="componentForm.startValue"></el-input-number>
<el-input-number v-model="componentForm.endValue" style="margin-left:5%"></el-input-number>
</el-form-item>
@ -92,7 +112,11 @@
</el-form-item>
<el-form-item label="时间模式:">
<el-select v-model="componentForm.timeMode" placeholder="请选择时间模式">
<el-option label="触发" value="触发" v-if="componentForm.componentType != '延误'&&componentForm.componentType != '拥堵'"></el-option>
<el-option
label="触发"
value="触发"
v-if="componentForm.componentType != '延误' && componentForm.componentType != '拥堵'"
></el-option>
<el-option
label="周期时刻"
value="周期时刻"
@ -102,9 +126,9 @@
componentForm.componentType != '延误' &&
componentForm.componentType != '拥堵' &&
componentForm.componentType != '流量'
"></el-option>
<el-option label="周期统计" value="周期统计" v-if="componentForm.componentType != 'OD'">
</el-option>
"
></el-option>
<el-option label="周期统计" value="周期统计" v-if="componentForm.componentType != 'OD'"> </el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="触发类型:" v-if="componentForm.timeModel=='touch'">
@ -120,10 +144,7 @@
<el-select v-model="componentForm.company" placeholder="请选择单位" @change="changeCompany">
<!-- <el-option v-for="item in timeSelect" :key="item.value" :label="item.label" :value="item.value"></el-option> -->
<el-option label="秒" value="秒" v-if="componentForm.timeMode != '周期统计'"></el-option>
<el-option
label="分钟"
value="分钟"
></el-option>
<el-option label="分钟" value="分钟"></el-option>
<el-option label="小时" value="小时"></el-option>
</el-select>
<el-slider v-model="componentForm.cycleInterval" :max="max"> </el-slider>
@ -277,7 +298,6 @@ export default {
typeFiltering: '',
typeData: [],
FlowType: '出流'
},
// typeData: ['', '', '', '', ''],
typeData: ['机动车', '非机动车', '行人'],
@ -390,7 +410,7 @@ export default {
} else if (this.$route.query.type == '离线视频') {
this.videoAnalysisShow = true;
this.trafficAnalysisShow = true;
this.getAnalysisStatus()
this.getAnalysisStatus();
// this.createMqtt();
// if(this.$route.query.status==''){
// }
@ -400,14 +420,19 @@ export default {
// }
}
},
mounted() {
},
mounted() {},
methods: {
/** 创建mqtt */
createMqtt() {
//
this.topicSends = ['stream' + this.number, 'trajectory' + this.number, 'detection' + this.number,'trigger-'+ this.$route.query.id,'cycle_time-'+ this.$route.query.id,'cycle_statistics-'+ this.$route.query.id];
this.topicSends = [
'stream' + this.number,
'trajectory' + this.number,
'detection' + this.number,
'trigger-' + this.$route.query.id,
'cycle_time-' + this.$route.query.id,
'cycle_statistics-' + this.$route.query.id
];
window.PubScribe(this.topicSends, this.number, this.realInfo);
// mqtt = mqttConfig;
/*mqtt = new mqttConfig(this.topicSends);
@ -438,32 +463,32 @@ export default {
//
getAnalysisStatus() {
getVideoStatus(this.$route.query.id).then(res => {
console.log("res.data",res.data)
console.log('res.data', res.data);
//
if (res.data.data.videoAnalysisStatus == '未分析') {
this.disabledTrafficAnalysis= true
this.videoUnityShow = true
this.analysisData()
this.disabledTrafficAnalysis = true;
this.videoUnityShow = true;
this.analysisData();
} else if (res.data.data.videoAnalysisStatus == '分析中') {
this.disabledVideoAnalysis= true
this.videoUnityShow = false
this.disabledVideoAnalysis = true;
this.videoUnityShow = false;
setTimeout(() => {
this.getAnalysisStatus()
this.getAnalysisStatus();
}, 5000);
} else if (res.data.data.videoAnalysisStatus == '已分析') {
this.videoUnityShow = true
this.videoAnalysisSta = res.data.data.videoAnalysisStatus
this.disabledTrafficAnalysis= false
this.analysisData()
this.videoUnityShow = true;
this.videoAnalysisSta = res.data.data.videoAnalysisStatus;
this.disabledTrafficAnalysis = false;
this.analysisData();
//
} else if (res.data.data.trafficAnalysisStatus == '未分析') {
this.disabledVideoAnalysis= true
this.disabledVideoAnalysis = true;
} else if (res.data.data.trafficAnalysisStatus == '分析中') {
this.disabledVideoAnalysis= true
this.disabledTrafficAnalysis= true
this.disabledVideoAnalysis = true;
this.disabledTrafficAnalysis = true;
} else if (res.data.data.videoAnalysisStatus == '已分析' || res.data.data.trafficAnalysisStatus == '已分析') {
this.disabledVideoAnalysis= false
this.disabledTrafficAnalysis= true
this.disabledVideoAnalysis = false;
this.disabledTrafficAnalysis = true;
}
});
},
@ -477,7 +502,7 @@ export default {
type: 'success'
});
setTimeout(() => {
this.getAnalysisStatus()
this.getAnalysisStatus();
}, 5000);
// if(this.videoAnalysisSta==''){
@ -495,13 +520,13 @@ export default {
trafficAnalysisBtn() {
startTrafficAnalysis(this.$route.query.id).then(res => {
//
console.log("res.data",res.data.data)
console.log('res.data', res.data.data);
if (res.data.code == 200) {
this.$message({
message: res.data.msg,
type: 'success'
});
document.getElementById('mapModule').contentWindow.addColor()
document.getElementById('mapModule').contentWindow.addColor();
} else {
this.$message({
message: res.data.msg,
@ -513,14 +538,14 @@ export default {
//
analysisData() {
getAnalysisData(this.$route.query.id).then(res => {
console.log("res.data.data",res.data.data)
this.analysis.trafficAnalysisPath1 = res.data.data.trafficAnalysisPath1
this.analysis.trafficAnalysisPath2 = res.data.data.trafficAnalysisPath2
this.analysis.videoAnalysisPath = res.data.data.videoAnalysisPath
this.analysis.videoName = res.data.data.videoName
this.analysis.videoPath = res.data.data.videoPath
this.analysis.videoTotalFrames = res.data.data.videoTotalFrames
this.analysis.videoType=this.$route.query.type
console.log('res.data.data', res.data.data);
this.analysis.trafficAnalysisPath1 = res.data.data.trafficAnalysisPath1;
this.analysis.trafficAnalysisPath2 = res.data.data.trafficAnalysisPath2;
this.analysis.videoAnalysisPath = res.data.data.videoAnalysisPath;
this.analysis.videoName = res.data.data.videoName;
this.analysis.videoPath = res.data.data.videoPath;
this.analysis.videoTotalFrames = res.data.data.videoTotalFrames;
this.analysis.videoType = this.$route.query.type;
});
},
//mqtt
@ -598,7 +623,6 @@ export default {
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
console.log("trigger_msgN",msgN)
this.triggerListData = msgN;
} catch (error) {}
break;
@ -610,7 +634,6 @@ export default {
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
// console.log("trigger_msgN",msgN)
this.cycleTimeData = msgN;
} catch (error) {}
break;
@ -622,7 +645,6 @@ export default {
const temp = utf8decoder.decode(u8arr); //
var detId = [];
const msgN = JSON.parse(temp);
// console.log("trigger_msgN",msgN)
this.cycleStatistics = msgN;
} catch (error) {}
break;
@ -643,22 +665,24 @@ export default {
//unity
OnSceneN() {
var ip = window.location.host;
this.ipData = "http://"+ip.split(":")[0]+':5000'
this.ipData = 'http://' + ip.split(':')[0] + ':5000';
// document.getElementById('mapModule').contentWindow.getIpData(this.ipData);
document.getElementById('mapModule').contentWindow.getIpData('http://172.16.1.168:5000');
if (this.$route.query.type == '离线视频') {
document.getElementById('mapModule').contentWindow.lixianVideo(JSON.stringify(this.analysis));
}
document.getElementById('mapModule').contentWindow.postVideoId(JSON.stringify(this.$route.query.id+ ',' +this.$route.query.type));
document
.getElementById('mapModule')
.contentWindow.postVideoId(JSON.stringify(this.$route.query.id + ',' + this.$route.query.type));
},
//
delSuccess() {
if (this.$route.query.type == '离线视频') {
this.$message({
type: "warning",
message: "请点击交通分析,获取最新数据!",
type: 'warning',
message: '请点击交通分析,获取最新数据!',
showClose: true,
duration:0,
duration: 0
});
}
},
@ -683,13 +707,13 @@ export default {
if (res.data.data.timeMode != '') {
this.componentForm.timeMode = res.data.data.timeMode;
} else {
console.log("this.componentForm.timeMode",this.componentForm.timeMode);
console.log("this.componentForm.componentType",this.componentForm.componentType);
console.log('this.componentForm.timeMode', this.componentForm.timeMode);
console.log('this.componentForm.componentType', this.componentForm.componentType);
if (this.componentForm.componentType == '延误' || this.componentForm.componentType == '拥堵') {
console.log("this.componentForm.timeMode",this.componentForm.timeMode);
this.componentForm.timeMode = '周期统计'
console.log('this.componentForm.timeMode', this.componentForm.timeMode);
this.componentForm.timeMode = '周期统计';
} else {
this.componentForm.timeMode = '触发'
this.componentForm.timeMode = '触发';
}
}
this.componentForm.componentParameterId = res.data.data.componentParameterId;
@ -788,9 +812,9 @@ export default {
this.componentForm.timeMode = res.data.data.timeMode;
} else {
if (this.componentForm.componentType == '延误' || this.componentForm.componentType == '拥堵') {
this.componentForm.timeMode = '周期统计'
this.componentForm.timeMode = '周期统计';
} else {
this.componentForm.timeMode = '触发'
this.componentForm.timeMode = '触发';
}
}
this.componentForm.componentName = res.data.data.componentName;
@ -955,7 +979,9 @@ export default {
// }, 3000);
document.getElementById('mapModule').contentWindow.postFigureId(JSON.stringify(res.data.data));
document.getElementById('mapModule').contentWindow.postFigureName(
document
.getElementById('mapModule')
.contentWindow.postFigureName(
JSON.stringify(res.data.data + ',' + form.name + ',' + this.startFigureName + ',' + this.numberNew)
);
@ -1004,10 +1030,10 @@ export default {
});
setTimeout(() => {
this.$message({
type: "warning",
message: "请点击交通分析,获取最新数据!",
type: 'warning',
message: '请点击交通分析,获取最新数据!',
showClose: true,
duration:0,
duration: 0
});
}, 5000);
console.log('startFigureName', this.startFigureName);
@ -1048,7 +1074,6 @@ export default {
formData.append('startValue', componentForm.startValue);
formData.append('timeMode', componentForm.timeMode);
formData.append('presentationForm', '矩阵图');
} else if (componentForm.componentType == '类型') {
//