Browse Source

first commit

master
j1ack 2 years ago
parent
commit
b1fc8ac2b1
  1. 3
      src/api/request.js
  2. 8
      src/components/dynamicList/index.vue
  3. 12
      src/components/ringPie/index.vue
  4. 4
      src/components/seamless/index.vue
  5. 308
      src/components/szBar/index.vue
  6. 73
      src/views/Brand.vue

3
src/api/request.js

@ -8,11 +8,10 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
const service = axios.create({ const service = axios.create({
// axios中请求配置有baseURL选项,表示请求URL公共部分 // axios中请求配置有baseURL选项,表示请求URL公共部分
// baseURL: 'http://192.168.31.128:8866', // baseURL: 'http://192.168.31.128:8866',
baseURL: 'http://parkingadmin.lepa580.com/prod-api', baseURL: 'http://parking.weirui0755.com/prod-api',
// 超时 // 超时
timeout: 30000 timeout: 30000
}) })
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
// get请求映射params参数 // get请求映射params参数

8
src/components/dynamicList/index.vue

@ -18,7 +18,7 @@
<div class="y-number-bg animated infinite rotate"></div> <div class="y-number-bg animated infinite rotate"></div>
<div class="y-number-icon"></div> <div class="y-number-icon"></div>
<div class="y-number-text"> <div class="y-number-text">
<span>临时车</span> <span>临时车</span>
<span id="number1" class="odometer odometer-theme-digital"> <span id="number1" class="odometer odometer-theme-digital">
<div class="odometer-inside"> <div class="odometer-inside">
<span class="odometer-digit"> <span class="odometer-digit">
@ -43,7 +43,7 @@
<div class="y-number-bg animated infinite rotateF"></div> <div class="y-number-bg animated infinite rotateF"></div>
<div class="y-number-icon"></div> <div class="y-number-icon"></div>
<div class="y-number-text"> <div class="y-number-text">
<span>月卡车</span> <span>月卡车</span>
<span id="number2" class="odometer odometer-theme-digital"> <span id="number2" class="odometer odometer-theme-digital">
<div class="odometer-inside"> <div class="odometer-inside">
<span class="odometer-digit"> <span class="odometer-digit">
@ -68,7 +68,7 @@
<div class="y-number-bg animated infinite rotateF"></div> <div class="y-number-bg animated infinite rotateF"></div>
<div class="y-number-icon"></div> <div class="y-number-icon"></div>
<div class="y-number-text"> <div class="y-number-text">
<span>免费车</span> <span>免费车</span>
<span id="number3" class="odometer odometer-theme-digital"> <span id="number3" class="odometer odometer-theme-digital">
<div class="odometer-inside"> <div class="odometer-inside">
<span class="odometer-digit"> <span class="odometer-digit">
@ -93,7 +93,7 @@
<div class="y-number-bg animated infinite rotate"></div> <div class="y-number-bg animated infinite rotate"></div>
<div class="y-number-icon"></div> <div class="y-number-icon"></div>
<div class="y-number-text"> <div class="y-number-text">
<span>绿牌车</span> <span>绿牌车</span>
<span id="number4" class="odometer odometer-theme-digital"> <span id="number4" class="odometer odometer-theme-digital">
<div class="odometer-inside"> <div class="odometer-inside">
<span class="odometer-digit"> <span class="odometer-digit">

12
src/components/ringPie/index.vue

@ -51,9 +51,11 @@ export default {
if (!this.chartData.parkingPlaceTurnover) { if (!this.chartData.parkingPlaceTurnover) {
this.chartData.parkingPlaceTurnover = 0 this.chartData.parkingPlaceTurnover = 0
} }
// this.dataRate=this.chartData.parkingPlaceUseNums/this.chartData.parkingPlaceTotalNums this.dataRate = this.chartData.parkingPlaceUseNums / this.chartData.parkingPlaceTotalNums
// this.dataRate=Math.round(this.dataRate*100) // this.dataRate=Math.round(this.dataRate*100)
this.dataRate=this.chartData.parkingPlaceTurnover // this.dataRate=this.chartData.parkingPlaceTurnover
this.dataRate = this.dataRate * 100
this.dataRate = parseInt(this.dataRate.toPrecision(10))
this.shenRate = 100 - this.dataRate this.shenRate = 100 - this.dataRate
this.getEchart(); this.getEchart();
}, 800); }, 800);
@ -62,7 +64,9 @@ export default {
chartData: { chartData: {
deep: true, deep: true,
handler: function () { handler: function () {
this.dataRate=this.chartData.parkingPlaceTurnover this.dataRate = this.chartData.parkingPlaceUseNums / this.chartData.parkingPlaceTotalNums
this.dataRate = this.dataRate * 100
this.dataRate = parseInt(this.dataRate.toPrecision(10))
this.shenRate = 100 - this.dataRate this.shenRate = 100 - this.dataRate
this.getEchart() this.getEchart()
} }
@ -304,8 +308,10 @@ export default {
} }
.chart { .chart {
display: table;
width: 3rem; width: 3rem;
height: 3rem; height: 3rem;
margin: 0 auto !important;
} }
} }
</style> </style>

4
src/components/seamless/index.vue

@ -83,8 +83,8 @@ export default {
display: block; display: block;
width: 9.8rem; width: 9.8rem;
height: 3.55rem; height: 3.55rem;
left: 6.6rem; left: 7rem;
top: 9.5375rem; top: 9.8rem;
// top: 3.5375rem; // top: 3.5375rem;
.sn-title { .sn-title {

308
src/components/szBar/index.vue

@ -16,6 +16,8 @@
</template> </template>
<script> <script>
import img from '../../assets/img/brand/green.png'
import img2 from '../../assets/img/brand/org.png'
export default { export default {
props: { props: {
chartData: { chartData: {
@ -26,8 +28,11 @@ export default {
data() { data() {
return { return {
option: null, option: null,
// in
xAxisData: [], xAxisData: [],
yData1: [], yData1: [],
// out
yData1Out: [],
} }
}, },
watch: { watch: {
@ -41,7 +46,6 @@ export default {
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
// console.log(this.chartData) // console.log(this.chartData)
this.getEchart(); this.getEchart();
}, 800); }, 800);
}, },
@ -49,60 +53,47 @@ export default {
methods: { methods: {
getEchart() { getEchart() {
this.xAxisData = []; this.xAxisData = [];
this.yData1Out = [];
this.yData1 = []; this.yData1 = [];
for (var i = 0; i < this.chartData.inStatistics.length; i++) { for (var i = 0; i < this.chartData.inStatistics.length; i++) {
this.xAxisData.push(this.chartData.inStatistics[i].timeUnit) this.xAxisData.push(this.chartData.inStatistics[i].timeUnit)
this.yData1.push(this.chartData.inStatistics[i].num) this.yData1.push(this.chartData.inStatistics[i].num)
this.yData1Out.push(this.chartData.outStatistics[i].num)
} }
// for (var i = 0; i < this.chartData.outStatistics.length; i++) {
// this.yData1Out.push(this.chartData.outStatistics[i].num)
// }
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
let myChart = echarts.init(document.getElementById('chart_bar')); let myChart = echarts.init(document.getElementById('chart_bar'));
let barWidth = '15%'; let barWidth = '15%';
let dataCoord = [
{ coord: [0, 9] },
{ coord: [1, 12] },
{ coord: [2, 15] },
{ coord: [3, 18] },
{ coord: [4, 15] },
{ coord: [5, 12] },
{ coord: [6, 9] },
{ coord: [7, 12] },
{ coord: [8, 15] },
{ coord: [9, 18] },
{ coord: [10, 15] },
{ coord: [11, 12] },
];
let dataCoord2 = [
{ coord: [0, -9] },
{ coord: [1, -12] },
{ coord: [2, -15] },
{ coord: [3, -18] },
{ coord: [4, -15] },
{ coord: [5, -12] },
{ coord: [6, -9] },
{ coord: [7, -12] },
{ coord: [8, -15] },
{ coord: [9, -18] },
{ coord: [10, -15] },
{ coord: [11, -12] },
];
this.option = { this.option = {
// xAxis: {
// data: this.xAxisData,
// axisLabel: {
// color: '#999',
// formatter: '{value}'
// },
// axisTick: {
// show: false
// },
// axisLine: {
// show: true,
// lineStyle: {
// color: 'rgba(40, 103, 168, 0.3)',
// }
// },
// },
xAxis: { xAxis: {
type: 'category',
boundaryGap: false,
data: this.xAxisData, data: this.xAxisData,
axisLabel: {
color: '#999',
formatter: '{value}'
}, },
axisTick: { yAxis: {
show: false type: 'value',
}, axisLabel: {
axisLine: { formatter: '{value} 辆'
show: true,
lineStyle: {
color: 'rgba(40, 103, 168, 0.3)',
} }
}, },
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
showContent: true, showContent: true,
@ -119,23 +110,23 @@ export default {
} }
}, },
}, },
yAxis: { // yAxis: {
axisLabel: { // axisLabel: {
color: '#999' // color: '#999'
}, // },
axisTick: { // axisTick: {
show: false // show: false
}, // },
splitLine: { // splitLine: {
show: false // show: false
}, // },
axisLine: { // axisLine: {
show: true, // show: true,
lineStyle: { // lineStyle: {
color: 'rgba(40, 103, 168, 0.3)' // color: 'rgba(40, 103, 168, 0.3)'
} // }
}, // },
}, // },
grid: { grid: {
top: 20, top: 20,
left: 20, left: 20,
@ -143,51 +134,188 @@ export default {
bottom: 20, bottom: 20,
containLabel: true containLabel: true
}, },
legend: {
itemWidth: 30,
itemHeight: 30,
top: '-3%', //
right: '5%',//
data: [
{
name: '入场量',
textStyle: {
fontSize: 12,
fontWeight: 'bolder',
color: '#fff'
},
icon: `image://${img}`,
},
{
name: '出场量',
textStyle: {
fontSize: 12,
fontWeight: 'bolder',
color: '#fff',
},
icon: `image://${img2}`,
}
],
// textStyle:{
// fontSize: 14,//
// color: '#ffffff'//
// },
},
// series: [
// {
// name: '',
// type: 'bar',
// // stack: 'one',
// barGap: "100%", //
// itemStyle: {
// normal: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
// offset: 1,
// color: 'rgba(0, 0, 0, 0)'
// }, {
// offset: 0.6,
// color: '#466e71'
// }, {
// offset: 0,
// color: '#43FFFF'
// }]),
// label: {
// position: "top",
// show: true, //
// textStyle: { //
// color: '#fff',
// fontSize: 10
// }
// },
// }
// },
// barWidth: barWidth,
// // markPoint: {
// // symbol: 'circle',
// // itemStyle: {
// // normal: {
// // color: '#43FFFF',
// // shadowColor: '#43FFFF',
// // shadowBlur: 20
// // }
// // },
// // symbolSize: [5, 5], //
// // symbolOffset: [0, 0], //
// // data: dataCoord,
// // },
// data: this.yData1
// },
// {
// name: '',
// type: 'bar',
// // stack: 'one',
// barGap: "100%", //
// itemStyle: {
// normal: {
// color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
// offset: 1,
// color: 'rgba(0, 0, 0, 0)'
// }, {
// offset: 0.6,
// color: '#91CC75'
// }, {
// offset: 0,
// color: '#91CC75'
// }]),
// label: {
// position: "top",
// show: true, //
// textStyle: { //
// color: '#fff',
// fontSize: 10
// }
// },
// }
// },
// barWidth: barWidth,
// data: this.yData1Out
// },
// ]
series: [ series: [
{ {
name: '车位使用', name: '入场量',
type: 'bar', type: 'line',
stack: 'one', data: this.yData1,
symbolSize:8, //线
itemStyle:{ itemStyle:{
normal:{ normal:{
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 1,
color: 'rgba(0, 0, 0, 0)'
}, {
offset: 0.6,
color: '#466e71'
}, {
offset: 0,
color: '#43FFFF'
}]),
label : { label : {
position: "top", show: true, // 线
show: true, // color:"#fff"
textStyle: { // },
color: '#fff', lineStyle:{
fontSize: 10 width:3, // 线
color:'#1BDB7F'
} }
} }
} }
},
barWidth: barWidth,
// markPoint: { // markPoint: {
// symbol: 'circle', // data: [
// itemStyle: { // { type: 'max', name: 'Max' },
// normal: { // { type: 'min', name: 'Min' }
// color: '#43FFFF', // ]
// shadowColor: '#43FFFF', // },
// shadowBlur: 20 // markLine: {
// data: [{ type: 'average', name: 'Avg' }]
// } // }
},
{
name: '出场量',
type: 'line',
data: this.yData1Out,
symbolSize:8, //线
itemStyle:{
normal:{
label : {
show: true, // 线
position: 'bottom',
color:"#fff"
},
lineStyle:{
width:3, // 线
color:'#EF8C62'
}
}
}
// markPoint: {
// data: [{ name: '', value: -2, xAxis: 1, yAxis: -1.5 }]
// }, // },
// symbolSize: [5, 5], // // markLine: {
// symbolOffset: [0, 0], // // data: [
// data: dataCoord, // { type: 'average', name: 'Avg' },
// [
// {
// symbol: 'none',
// x: '90%',
// yAxis: 'max'
// }, // },
data: this.yData1 // {
}, // symbol: 'circle',
// label: {
// position: 'start',
// formatter: 'Max'
// },
// type: 'max',
// name: ''
// }
// ]
// ]
// }
}
] ]
}; };
myChart.setOption(this.option, true); myChart.setOption(this.option, true);

73
src/views/Brand.vue

@ -95,9 +95,9 @@
<div class="panel-footer"></div> <div class="panel-footer"></div>
</div> </div>
<div class="left-top"> <div class="left-top" style="margin-top:0.8rem">
<div class="topBg"> <div class="topBg">
收费车辆统计 场内车辆实时统计
</div> </div>
<!-- <business :chart-data="payDataCar" /> --> <!-- <business :chart-data="payDataCar" /> -->
<DynamicList :chart-data="payDataCar" /> <DynamicList :chart-data="payDataCar" />
@ -133,7 +133,7 @@
</div> </div>
<div class="item right"> <div class="item right">
<div class="left-top"> <div class="left-top left-top2">
<div class="topBg2"> <div class="topBg2">
24小时车流统计 24小时车流统计
</div> </div>
@ -141,26 +141,40 @@
<div class="panel-footer"></div> <div class="panel-footer"></div>
</div> </div>
<div class="left-top"> <div class="left-top left-top2">
<div class="topBg">使用统计</div> <div class="topBg">使用统计</div>
<div class="carFlex"> <div class="carFlex">
<div class="let"> <div class="let">
<div class="item"> <div class="item" style="height: 1.5rem;width: 2rem;margin-top:0.3rem">
<p class="p1">总车位</p> <p class="p1">日均周转率</p>
<p class="p2">{{ useCarCon.parkingPlaceTotalNums }}</p> <p class="p2"> <span v-if="useCarCon.dailyAverageTurnover">
{{
getNum(useCarCon.dailyAverageTurnover)
}}%</span>
<span v-else>0%</span>
</p>
</div> </div>
<div class="item"> <!-- <div class="item" style="background:none">
<p class="p1">周转率</p>
<p class="p2"> <span v-if="useCarCon.parkingPlaceTurnover"> </div> -->
<div class="item" style="height: 1.5rem;width: 2rem;margin-top:0.3rem">
<p class="p1">日均占用率</p>
<p class="p2"> <span v-if="useCarCon.dailyAverageOccupy">
{{ {{
useCarCon.parkingPlaceTurnover getNum(useCarCon.dailyAverageOccupy)
}}%</span> }}%</span>
<span v-else>0%</span> <span v-else>0%</span>
</p> </p>
</div> </div>
</div> </div>
<ringPie :chart-data="useCarCon" /> <ringPie :chart-data="useCarCon" />
<div class="rig"> <div class="rig">
<div class="item">
<p class="p1">总车位</p>
<p class="p2">{{ useCarCon.parkingPlaceTotalNums }}</p>
</div>
<div class="item"> <div class="item">
<p class="p1">已使用车位</p> <p class="p1">已使用车位</p>
<p class="p2">{{ useCarCon.parkingPlaceUseNums }}</p> <p class="p2">{{ useCarCon.parkingPlaceUseNums }}</p>
@ -177,7 +191,7 @@
<div class="left-top"> <div class="left-top">
<div class="topBg"> <div class="topBg">
24小时车位使用统计 月度车辆通勤量实时统计
</div> </div>
<szBar :chart-data="todayCarUse" /> <szBar :chart-data="todayCarUse" />
<div class="panel-footer"></div> <div class="panel-footer"></div>
@ -310,6 +324,16 @@ export default {
} }
}, },
methods: { methods: {
getNum(s){
var i;
i=s*100
/*
js 数字精度问题
*/
i=parseFloat(i.toPrecision(10))
i = String(i)
return i.substring(0,i.indexOf(".")+3);
},
meetfunction(val) { meetfunction(val) {
this.parkingInfoId = val this.parkingInfoId = val
this.showFlag = true; this.showFlag = true;
@ -920,25 +944,30 @@ export default {
color: #fff; color: #fff;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.let,.rig{
// display: flex;
// align-items: center;
// color: #fff;
// justify-content: space-between;
}
.item { .item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
width: 2rem; width: 1.6rem;
text-align: center; text-align: center;
height: 1.3rem; height: 1rem;
background: url(/img/img12.png) no-repeat; background: url(/img/img12.png) no-repeat;
background-size: contain; background-size: contain;
margin-top: 0.3rem; margin-top: 0.1rem;
.p1 { .p1 {
font-size: 0.2rem; font-size: 0.18rem;
margin-bottom: 0.1rem; margin-bottom: 0.1rem;
} }
.p2 { .p2 {
font-size: 0.3rem; font-size: 0.25rem;
} }
} }
} }
@ -966,13 +995,15 @@ export default {
} }
.left-top { .left-top {
height: 3.5rem; // height: 3.5rem;
position: relative; position: relative;
background: url(/img/img2.png) no-repeat; background: url(/img/img2.png) no-repeat;
background-size: cover; background-size: cover;
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
} }
.left-top2{
margin-bottom: 0.36rem !important;
}
.tbody .tr:nth-child(odd) { .tbody .tr:nth-child(odd) {
background: #06184b; background: #06184b;
} }

Loading…
Cancel
Save