bug修改
This commit is contained in:
parent
56a5e93bb4
commit
ea3eb0d0ca
|
@ -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
|
||||||
|
});
|
||||||
|
};
|
|
@ -1,7 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div id="barChart" ref="barChart" style="width:100%;height:300px;"></div>
|
<div id="barChart" ref="barChart" style="width:100%;height:300px;"></div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -10,7 +8,7 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
list: Array,
|
list: Array,
|
||||||
default() {
|
default() {
|
||||||
return []
|
return [];
|
||||||
},
|
},
|
||||||
pageType: {
|
pageType: {
|
||||||
type: String
|
type: String
|
||||||
|
@ -27,59 +25,58 @@ export default {
|
||||||
chartName: {
|
chartName: {
|
||||||
type: String
|
type: String
|
||||||
},
|
},
|
||||||
typeValue:{
|
typeValue: {
|
||||||
type:Object
|
type: Object
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
xData: [],
|
xData: [],
|
||||||
yData: []
|
yData: []
|
||||||
}
|
};
|
||||||
},
|
|
||||||
created() {
|
|
||||||
},
|
},
|
||||||
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
drawBar() {
|
drawBar() {
|
||||||
|
console.log(this.yData, 222);
|
||||||
let myChart = this.$echarts.getInstanceByDom(this.$refs.barChart)
|
let myChart = this.$echarts.getInstanceByDom(this.$refs.barChart);
|
||||||
if (myChart == null) {
|
if (myChart == null) {
|
||||||
myChart = this.$echarts.init(this.$refs.barChart)
|
myChart = this.$echarts.init(this.$refs.barChart);
|
||||||
}
|
}
|
||||||
let option = {
|
let option = {
|
||||||
color: ['#7262FD', '#FC5A5A'],
|
color: ['#7262FD', '#FC5A5A'],
|
||||||
title:{
|
title: {
|
||||||
show:true,
|
show: true,
|
||||||
text:this.componentName + '-' + this.chartName + '-' + '柱状图',
|
text: this.componentName + '-' + this.chartName + '-' + '柱状图',
|
||||||
textStyle:{
|
textStyle: {
|
||||||
lineHeight:'30',
|
lineHeight: '30'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tooltip: {
|
tooltip: {
|
||||||
confine: true,
|
confine: true
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
left: '2%',
|
left: '2%',
|
||||||
right: '4%',
|
right: '4%',
|
||||||
bottom: '10%',
|
bottom: '10%',
|
||||||
top: '20%',
|
top: '20%',
|
||||||
containLabel: true,
|
containLabel: true
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: this.xData,
|
data: this.xData,
|
||||||
axisLine: {
|
axisLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#000',
|
color: '#000'
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: '#000',
|
color: '#000'
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false,
|
show: false
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
|
@ -87,64 +84,64 @@ export default {
|
||||||
min: 0,
|
min: 0,
|
||||||
minInterval: 1,
|
minInterval: 1,
|
||||||
splitArea: {
|
splitArea: {
|
||||||
show: false,
|
show: false
|
||||||
},
|
},
|
||||||
|
|
||||||
axisLine: {
|
axisLine: {
|
||||||
show: true,
|
show: true
|
||||||
},
|
},
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false,
|
show: false
|
||||||
},
|
},
|
||||||
splitLine: {
|
splitLine: {
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#eeebeb',
|
color: '#eeebeb',
|
||||||
type: 'dashed', // dotted 虚线
|
type: 'dashed' // dotted 虚线
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: '#000',
|
color: '#000',
|
||||||
fontFamily: 'Bebas',
|
fontFamily: 'Bebas'
|
||||||
},
|
}
|
||||||
}],
|
}
|
||||||
series: [{
|
|
||||||
type: 'bar',
|
|
||||||
barWidth: 20,
|
|
||||||
itemStyle: { barBorderRadius: [5, 5, 0, 0], },
|
|
||||||
name: '时间',
|
|
||||||
data: this.yData
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 20,
|
||||||
|
itemStyle: { barBorderRadius: [5, 5, 0, 0] },
|
||||||
|
name: '时间',
|
||||||
|
data: this.yData
|
||||||
|
}
|
||||||
|
]
|
||||||
};
|
};
|
||||||
myChart.setOption(option)
|
myChart.setOption(option);
|
||||||
// window.onresize = () => { // 根据窗口大小变化图表自适应
|
// window.onresize = () => { // 根据窗口大小变化图表自适应
|
||||||
// myChart.resize();
|
// myChart.resize();
|
||||||
// };
|
// };
|
||||||
window.addEventListener('resize', function () {
|
window.addEventListener('resize', function() {
|
||||||
myChart.resize()
|
myChart.resize();
|
||||||
}
|
});
|
||||||
)
|
}
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.drawBar()
|
this.drawBar();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
typeValue: {
|
typeValue: {
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.xData = newVal.type_data.map(ele => {
|
this.xData = newVal.type_data.map(ele => {
|
||||||
return ele.name
|
return ele.name;
|
||||||
})
|
});
|
||||||
this.yData = newVal.type_data.map(ele => {
|
this.yData = newVal.type_data.map(ele => {
|
||||||
return ele.quantity
|
return ele.quantity;
|
||||||
})
|
});
|
||||||
this.drawBar()
|
this.drawBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
|
@ -72,7 +72,7 @@ export default {
|
||||||
lineHeight: '30'
|
lineHeight: '30'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
legend:{},
|
legend: {},
|
||||||
grid: {
|
grid: {
|
||||||
left: '2%',
|
left: '2%',
|
||||||
right: '4%',
|
right: '4%',
|
||||||
|
@ -265,7 +265,7 @@ export default {
|
||||||
}
|
}
|
||||||
if (this.$refs.lineChart) {
|
if (this.$refs.lineChart) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.drawLine();
|
// this.drawLine();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'pieChart',//饼图图组件
|
name: 'pieChart', //饼图图组件
|
||||||
props: {
|
props: {
|
||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default() {
|
default() {
|
||||||
return []
|
return [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
componentName: {
|
componentName: {
|
||||||
|
@ -21,10 +21,8 @@ export default {
|
||||||
typeValue: {
|
typeValue: {
|
||||||
type: Object
|
type: Object
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// 图例数据
|
// 图例数据
|
||||||
legend: [],
|
legend: [],
|
||||||
|
@ -37,88 +35,80 @@ export default {
|
||||||
{
|
{
|
||||||
name: '非机动车',
|
name: '非机动车',
|
||||||
value: 0
|
value: 0
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
name: '行人',
|
name: '行人',
|
||||||
value: 0
|
value: 0
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
};
|
||||||
},
|
|
||||||
created() {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
created() {},
|
||||||
methods: {
|
methods: {
|
||||||
drawPie() {
|
drawPie() {
|
||||||
let myChart = this.$echarts.getInstanceByDom(this.$refs.pieChart)
|
let myChart = this.$echarts.getInstanceByDom(this.$refs.pieChart);
|
||||||
if (myChart == null) {
|
if (myChart == null) {
|
||||||
myChart = this.$echarts.init(this.$refs.pieChart)
|
myChart = this.$echarts.init(this.$refs.pieChart);
|
||||||
}
|
}
|
||||||
var color = [
|
var color = ['#0CD2E6', '#3751E6', '#FFC722'];
|
||||||
'#0CD2E6',
|
|
||||||
'#3751E6',
|
|
||||||
'#FFC722'
|
|
||||||
];
|
|
||||||
let option = {
|
let option = {
|
||||||
title: {
|
title: {
|
||||||
show: true,
|
show: true,
|
||||||
text: this.componentName + '-' + this.chartName + '-' + '饼状图',
|
text: this.componentName + '-' + this.chartName + '-' + '饼状图',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
lineHeight: '30',
|
lineHeight: '30'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
color: color,
|
color: color,
|
||||||
legend: {
|
legend: {
|
||||||
top: 20,
|
top: 20,
|
||||||
right: 'center',
|
right: 'center',
|
||||||
textStyle: {
|
textStyle: {},
|
||||||
|
data: this.legend
|
||||||
},
|
|
||||||
data: this.legend,
|
|
||||||
},
|
},
|
||||||
tooltip: {},
|
tooltip: {},
|
||||||
series: [{
|
series: [
|
||||||
type: 'pie',
|
{
|
||||||
center: ['50%', '55%'],
|
type: 'pie',
|
||||||
radius: '70%',
|
center: ['50%', '55%'],
|
||||||
label: {
|
radius: '70%',
|
||||||
normal: {
|
label: {
|
||||||
show: false,
|
normal: {
|
||||||
|
show: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
labelLine: {
|
||||||
labelLine: {
|
show: false,
|
||||||
show: false,
|
length: 0,
|
||||||
length: 0,
|
length2: 0
|
||||||
length2: 0,
|
},
|
||||||
},
|
label: {
|
||||||
label: {
|
normal: {
|
||||||
normal: {
|
show: true,
|
||||||
show: true,
|
position: 'inside',
|
||||||
position: 'inside',
|
formatter: '{value|{c}}',
|
||||||
formatter: '{value|{c}}',
|
rich: {
|
||||||
rich: {
|
value: {
|
||||||
value: {
|
fontSize: 20,
|
||||||
fontSize: 20,
|
color: '#ffffff'
|
||||||
color: '#ffffff',
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
}
|
},
|
||||||
},
|
data: this.seriesData
|
||||||
data: this.seriesData,
|
}
|
||||||
}],
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
myChart.setOption(option)
|
myChart.setOption(option);
|
||||||
|
|
||||||
|
|
||||||
// window.onresize = () => { // 根据窗口大小变化图表自适应
|
// window.onresize = () => { // 根据窗口大小变化图表自适应
|
||||||
// myChart.resize();
|
// myChart.resize();
|
||||||
// };
|
// };
|
||||||
window.addEventListener('resize', function () {
|
window.addEventListener('resize', function() {
|
||||||
myChart.resize()
|
myChart.resize();
|
||||||
}
|
});
|
||||||
)
|
}
|
||||||
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.drawPie();
|
this.drawPie();
|
||||||
|
@ -128,21 +118,20 @@ export default {
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.legend = newVal.type_data.map(ele => {
|
this.legend = newVal.type_data.map(ele => {
|
||||||
return ele.name
|
return ele.name;
|
||||||
});
|
});
|
||||||
this.seriesData = []
|
this.seriesData = [];
|
||||||
newVal.type_data.forEach(ele => {
|
newVal.type_data.forEach(ele => {
|
||||||
this.seriesData.push({
|
this.seriesData.push({
|
||||||
name: ele.name,
|
name: ele.name,
|
||||||
value: ele.quantity
|
value: ele.quantity
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
this.drawPie()
|
// this.drawPie();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped></style>
|
<style scoped></style>
|
|
@ -1,118 +1,113 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="content-box">
|
<div class="content-box">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="title">账号管理</p>
|
<p class="title">账号管理</p>
|
||||||
<!-- <div class="test-div">
|
<el-button @click="addAccountDialog = true" type="primary" style="margin-bottom: 10px;"
|
||||||
<i class="el-icon-edit"></i>
|
><i class="el-icon-circle-plus-outline" style="margin-right: 3px;"></i>新增</el-button
|
||||||
<i class="el-icon-share"></i>
|
>
|
||||||
<i class="el-icon-delete"></i>
|
<el-table :data="tableData" :height="tableHeight" border style="width: 100%">
|
||||||
</div> -->
|
<el-table-column align="center" prop="userName" label="用户名称" width="180"></el-table-column>
|
||||||
<el-button @click="addAccountDialog = true" type="primary" style="margin-bottom: 10px;"><i
|
<el-table-column align="center" prop="account" label="用户账号" width="180"></el-table-column>
|
||||||
class="el-icon-circle-plus-outline" style="margin-right: 3px;"></i>新增</el-button>
|
<el-table-column align="center" prop="roleName" label="角色"></el-table-column>
|
||||||
|
<el-table-column align="center" label="权限">
|
||||||
<el-table :data="tableData" :height="tableHeight" border style="width: 100%">
|
<template slot-scope="scope">
|
||||||
<el-table-column align="center" prop="name" label="用户名称" width="180"></el-table-column>
|
<span>{{ scope.row.isEnable === '1' ? '启用' : '禁用' }}</span>
|
||||||
<el-table-column align="center" prop="account" label="用户账号" width="180"></el-table-column>
|
</template>
|
||||||
<el-table-column align="center" prop="role" label="角色"></el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" prop="jurisdiction" label="权限"></el-table-column>
|
<el-table-column align="center" label="操作" width="160">
|
||||||
<el-table-column align="center" label="操作" width="160">
|
<template slot-scope="scope">
|
||||||
<template slot-scope="scope">
|
<el-button @click="edit(scope.row)" type="text" size="small" class="">编辑</el-button>
|
||||||
<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="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>
|
||||||
<el-button @click="clickDelete(scope.row)" type="text" size="small" class="el-icon-delete"></el-button>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table>
|
||||||
</el-table>
|
<div class="dialog">
|
||||||
|
<el-dialog :title="dialogTitle" :visible.sync="addAccountDialog" width="30%">
|
||||||
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
<el-form label-position="left" label-width="80px" :model="formLabelAlign">
|
||||||
:current-page.sync="currentPage" :page-sizes="[100, 200, 300, 400]" :page-size="pageSize"
|
<el-form-item label="名称:">
|
||||||
layout="sizes, prev, pager, next" :total="totalNumber" style="padding-top: 10px;">
|
<el-input v-model="formLabelAlign.name"></el-input>
|
||||||
</el-pagination>
|
</el-form-item>
|
||||||
<div class="dialog">
|
<el-form-item label="账号:">
|
||||||
<el-dialog :title="dialogTitle" :visible.sync="addAccountDialog" width="30%">
|
<el-input v-model="formLabelAlign.account"></el-input>
|
||||||
<el-form label-position="left" label-width="80px" :model="formLabelAlign">
|
</el-form-item>
|
||||||
<el-form-item label="名称:">
|
<el-form-item label="角色:">
|
||||||
<el-input v-model="formLabelAlign.name"></el-input>
|
<el-input v-model="formLabelAlign.role"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="账号:">
|
<el-form-item label="权限:">
|
||||||
<el-input v-model="formLabelAlign.account"></el-input>
|
<el-input v-model="formLabelAlign.jurisdiction"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色:">
|
</el-form>
|
||||||
<el-input v-model="formLabelAlign.role"></el-input>
|
<span slot="footer" class="dialog-footer">
|
||||||
</el-form-item>
|
<el-button type="primary" @click="addAccountDialog = false">确 定</el-button>
|
||||||
<el-form-item label="权限:">
|
</span>
|
||||||
<el-input v-model="formLabelAlign.jurisdiction"></el-input>
|
</el-dialog>
|
||||||
</el-form-item>
|
</div>
|
||||||
</el-form>
|
</div>
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="addAccountDialog = false">确 定</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getZhanghData } from '@/api/management';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
addAccountDialog: false,
|
addAccountDialog: false,
|
||||||
formLabelAlign: {
|
formLabelAlign: {
|
||||||
name: '',
|
name: '',
|
||||||
account: '',
|
account: '',
|
||||||
role: '',
|
role: '',
|
||||||
jurisdiction: ''
|
jurisdiction: ''
|
||||||
},
|
},
|
||||||
tableData: [
|
tableData: [],
|
||||||
{
|
tableHeight: 0,
|
||||||
name: 'admin',
|
currentPage: 1,
|
||||||
account: '',
|
pageSize: 100,
|
||||||
role: 'admin',
|
totalNumber: 1000,
|
||||||
jurisdiction: '超级管理员'
|
tableHeight: 0,
|
||||||
|
dialogTitle: '新增'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
||||||
|
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 = '编辑';
|
||||||
|
this.addAccountDialog = true;
|
||||||
|
},
|
||||||
|
showView(scope) {
|
||||||
|
console.log(scope, '查看');
|
||||||
|
this.dialogTitle = '查看';
|
||||||
|
this.addAccountDialog = true;
|
||||||
|
},
|
||||||
|
clickDelete(scope) {
|
||||||
|
console.log(scope, '删除');
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
console.log(`每页 ${val} 条`);
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
console.log(`当前页: ${val}`);
|
||||||
}
|
}
|
||||||
],
|
|
||||||
tableHeight: 0,
|
|
||||||
currentPage: 1,
|
|
||||||
pageSize: 100,
|
|
||||||
totalNumber: 1000,
|
|
||||||
tableHeight: 0,
|
|
||||||
dialogTitle: '新增'
|
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
created() {
|
|
||||||
let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
|
||||||
this.tableHeight = windowHeight - 220;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
edit(scope) {
|
|
||||||
console.log(scope, '编辑');
|
|
||||||
this.dialogTitle = '编辑';
|
|
||||||
this.addAccountDialog = true;
|
|
||||||
},
|
|
||||||
showView(scope) {
|
|
||||||
console.log(scope, '查看');
|
|
||||||
this.dialogTitle = '查看';
|
|
||||||
this.addAccountDialog = true;
|
|
||||||
},
|
|
||||||
clickDelete(scope) {
|
|
||||||
console.log(scope, '删除');
|
|
||||||
},
|
|
||||||
handleSizeChange(val) {
|
|
||||||
console.log(`每页 ${val} 条`);
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
console.log(`当前页: ${val}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.test-div i {
|
.test-div i {
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
}
|
}
|
||||||
.dialog .el-form-item{
|
.dialog .el-form-item {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -3,11 +3,15 @@
|
||||||
<el-empty v-show="componentList.length == 0" :image-size="400"></el-empty>
|
<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> -->
|
<!-- <p class="title" style="margin-bottom: 20px;font-size: 20px;font-weight: 400;">数据看板</p> -->
|
||||||
<el-scrollbar class="scrollbar">
|
<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="plate1" ref="plate1">
|
||||||
<div :class="sectionData.length <= 2 ? 'sectionBox' : 'section'" ref="section"
|
<div
|
||||||
v-for="(s, i) in sectionData" :key="s.analogAreaComponentId">
|
:class="sectionData.length <= 2 ? 'sectionBox' : 'section'"
|
||||||
|
ref="section"
|
||||||
|
v-for="(s, i) in sectionData"
|
||||||
|
:key="s.analogAreaComponentId"
|
||||||
|
>
|
||||||
<template>
|
<template>
|
||||||
<div ref="sectionContent">
|
<div ref="sectionContent">
|
||||||
<div>
|
<div>
|
||||||
|
@ -17,17 +21,27 @@
|
||||||
<span class="downPull1" data-num="1" @click="sectionHandle(i)"></span>
|
<span class="downPull1" data-num="1" @click="sectionHandle(i)"></span>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="o in s.children" :key="o.analogAreaComponentId">
|
<div v-for="o in s.children" :key="o.analogAreaComponentId">
|
||||||
|
<OD
|
||||||
<OD v-if="o.componentName.includes('OD')" :pageType="o.graphicType" triggerType="触发"
|
v-if="o.componentName.includes('OD')"
|
||||||
:componentName="o.componentName" :echartArr="o.presentationForm"
|
:pageType="o.graphicType"
|
||||||
:dataArr="o.trigger" :title="o.componentName.split('_')[0]"
|
triggerType="触发"
|
||||||
:chartName='o.combinationName' />
|
:componentName="o.componentName"
|
||||||
<typeChart v-else :pageType="o.graphicType" :triggerType="o.timeMode"
|
: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"
|
:componentName="o.componentName"
|
||||||
:dataArr="o.timeMode == '触发' ? o.trigger : o.cycleTimeData"
|
:dataArr="o.timeMode == '触发' ? o.trigger : o.cycleTimeData"
|
||||||
:echartArr="o.presentationForm" :title="o.componentName.split('_')[0]"
|
:echartArr="o.presentationForm"
|
||||||
:chartName='o.combinationName'
|
:title="o.componentName.split('_')[0]"
|
||||||
:typeValue="o.timeMode == '触发' ? typeValue : typeCycleTimeData" />
|
:chartName="o.combinationName"
|
||||||
|
:typeValue="o.timeMode == '触发' ? typeValue : typeCycleTimeData"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- :data="triggerList.length != 0 ? triggerList : tableData" -->
|
<!-- :data="triggerList.length != 0 ? triggerList : tableData" -->
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,9 +51,9 @@
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
<!-- 详情框 -->
|
<!-- 详情框 -->
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<!-- :data="triggerList.length != 0 ? tripHandle(o) : tableData" -->
|
<!-- :data="triggerList.length != 0 ? tripHandle(o) : tableData" -->
|
||||||
<script>
|
<script>
|
||||||
import typeChart from '../../components/target/typeChart.vue';
|
import typeChart from '../../components/target/typeChart.vue';
|
||||||
import OD from '../../components/target/OD.vue';
|
import OD from '../../components/target/OD.vue';
|
||||||
|
@ -80,7 +94,7 @@ export default {
|
||||||
default() {
|
default() {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -302,8 +316,6 @@ export default {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
idVal: '',
|
idVal: '',
|
||||||
//组件数组
|
//组件数组
|
||||||
componentList: [],
|
componentList: [],
|
||||||
|
@ -312,16 +324,12 @@ export default {
|
||||||
|
|
||||||
sectionData: [],
|
sectionData: [],
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 单个区域或者断面的表格触发数据
|
// 单个区域或者断面的表格触发数据
|
||||||
tableList: [],
|
tableList: [],
|
||||||
|
|
||||||
|
|
||||||
// 路线数据
|
// 路线数据
|
||||||
headWay: [],
|
headWay: [],
|
||||||
|
|
||||||
|
|
||||||
tripData: [],
|
tripData: [],
|
||||||
|
|
||||||
sectionArr: [],
|
sectionArr: [],
|
||||||
|
@ -334,11 +342,11 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.idVal = this.$route.query.id;
|
this.idVal = this.$route.query.id;
|
||||||
getComponentSection({ VideoId: this.idVal }).then((res) => {
|
getComponentSection({ VideoId: this.idVal }).then(res => {
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
console.log(res.data.data, '11111111111111111');
|
console.log(res.data.data, '11111111111111111');
|
||||||
this.componentList = res.data.data
|
this.componentList = res.data.data;
|
||||||
this.siftData()
|
this.siftData();
|
||||||
// 处理获取过来的数据
|
// 处理获取过来的数据
|
||||||
// this.componentList.forEach((val) => {
|
// this.componentList.forEach((val) => {
|
||||||
// this.sectionArr.push(val.combinationName);
|
// this.sectionArr.push(val.combinationName);
|
||||||
|
@ -357,18 +365,16 @@ export default {
|
||||||
} else if (res.data.code == 404) {
|
} else if (res.data.code == 404) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
siftData() {
|
siftData() {
|
||||||
this.componentList.forEach((val) => {
|
this.componentList.forEach(val => {
|
||||||
this.sectionArr.push(val.combinationName);
|
this.sectionArr.push(val.combinationName);
|
||||||
this.sectionArr = Array.from(new Set(this.sectionArr));
|
this.sectionArr = Array.from(new Set(this.sectionArr));
|
||||||
});
|
});
|
||||||
this.sectionData = this.sectionArr.map((item) => {
|
this.sectionData = this.sectionArr.map(item => {
|
||||||
item = { title: item, children: [] };
|
item = { title: item, children: [] };
|
||||||
this.componentList.forEach((val) => {
|
this.componentList.forEach(val => {
|
||||||
if (item.title == val.combinationName) {
|
if (item.title == val.combinationName) {
|
||||||
item.children.push(val);
|
item.children.push(val);
|
||||||
}
|
}
|
||||||
|
@ -390,60 +396,48 @@ export default {
|
||||||
if (sectionBox[i] != undefined) {
|
if (sectionBox[i] != undefined) {
|
||||||
sectionBox[i].style.height = 'auto';
|
sectionBox[i].style.height = 'auto';
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
downPulls1[i].style.cssText = 'transition: all 0.5s linear;';
|
downPulls1[i].style.cssText = 'transition: all 0.5s linear;';
|
||||||
sections[i].style.height = '500px';
|
sections[i].style.height = '500px';
|
||||||
if (sectionBox[i] != undefined) {
|
if (sectionBox[i] != undefined) {
|
||||||
sectionBox[i].style.height = '48vh'
|
sectionBox[i].style.height = '48vh';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
|
|
||||||
// 触发数据的类型数值
|
// 触发数据的类型数值
|
||||||
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
},
|
},
|
||||||
|
mounted() {},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
||||||
// 触发的原始数据
|
// 触发的原始数据
|
||||||
triggerData: {
|
triggerData: {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {},
|
||||||
},
|
|
||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理过的触发数据
|
// 处理过的触发数据
|
||||||
triggerListData: {
|
triggerListData: {
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
this.triggerList = newVal
|
this.triggerList = newVal;
|
||||||
// 触发数据
|
|
||||||
console.log(newVal, 'triggerlistData');
|
|
||||||
|
|
||||||
this.componentList.forEach(ele => {
|
this.componentList.forEach(ele => {
|
||||||
if (ele.trigger == undefined && ele.timeMode == '触发') {
|
if (ele.trigger == undefined && ele.timeMode == '触发') {
|
||||||
ele.trigger = []
|
ele.trigger = [];
|
||||||
}
|
}
|
||||||
newVal.forEach(item => {
|
newVal.forEach(item => {
|
||||||
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '触发') {
|
if (ele.analogAreaComponentId == item.component_id && ele.timeMode == '触发') {
|
||||||
if (ele.trigger.length == 10) {
|
if (ele.trigger.length == 10) {
|
||||||
ele.trigger.pop()
|
ele.trigger.pop();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 该时间的触发数据
|
// 该时间的触发数据
|
||||||
if (item.type_data != null) {
|
if (item.type_data != null) {
|
||||||
// console.log(item,'461461');
|
// console.log(item,'461461');
|
||||||
this.typeValue = item
|
this.typeValue = item;
|
||||||
}
|
}
|
||||||
ele.trigger.unshift(item)
|
ele.trigger.unshift(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
|
@ -455,38 +449,38 @@ export default {
|
||||||
if (newVal.length != 0) {
|
if (newVal.length != 0) {
|
||||||
this.componentList.forEach(ele => {
|
this.componentList.forEach(ele => {
|
||||||
if (ele.cycleTimeData == undefined && ele.timeMode == '周期时刻') {
|
if (ele.cycleTimeData == undefined && ele.timeMode == '周期时刻') {
|
||||||
ele.cycleTimeData = []
|
ele.cycleTimeData = [];
|
||||||
}
|
}
|
||||||
newVal.forEach(item => {
|
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) {
|
if (ele.cycleTimeData.length == 10) {
|
||||||
ele.cycleTimeData.slice(ele.cycleTimeData.length-1,0)
|
ele.cycleTimeData.slice(ele.cycleTimeData.length - 1, 0);
|
||||||
} else {
|
} else {
|
||||||
if(item.type_data!=null){
|
if (item.type_data != null) {
|
||||||
// 周期时刻的类型数据
|
// 周期时刻的类型数据
|
||||||
this.typeCycleTimeData = item
|
this.typeCycleTimeData = item;
|
||||||
}
|
}
|
||||||
ele.cycleTimeData.unshift(item)
|
ele.cycleTimeData.unshift(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
console.log(this.sectionData, '455');
|
console.log(this.sectionData, '455');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
// 周期统计数据
|
// 周期统计数据
|
||||||
cycleStatistics:{
|
cycleStatistics: {
|
||||||
handler(newVal){
|
handler(newVal) {
|
||||||
console.log(newVal,'周期统计');
|
console.log(newVal, '周期统计');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -506,7 +500,7 @@ export default {
|
||||||
|
|
||||||
/deep/ .el-scrollbar__view {
|
/deep/ .el-scrollbar__view {
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
width: 100%
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .el-scrollbar__wrap {
|
/deep/ .el-scrollbar__wrap {
|
||||||
|
@ -520,7 +514,6 @@ export default {
|
||||||
.dataBoard {
|
.dataBoard {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dataBoard .region,
|
.dataBoard .region,
|
||||||
|
|
Loading…
Reference in New Issue