-
@@ -13,9 +13,10 @@
import { formaterTotal } from '../../utils/formate'
export default {
name: 'AccountNum',
+ props:['totalnum'],
data(){
return {
- total: formaterTotal(219706)
+ total: formaterTotal(this.totalnum)
}
}
}
diff --git a/src/components/base/PieEchart.vue b/src/components/base/PieEchart.vue
index 6d522f5..956485d 100644
--- a/src/components/base/PieEchart.vue
+++ b/src/components/base/PieEchart.vue
@@ -68,6 +68,7 @@ export default {
},
methods: {
setOptions({yData} = {}) {
+ let per = ((yData[0]/(yData[0]+yData[1]))*100).toFixed(2)+'%'
this.chart.setOption(
{
tooltip: {
@@ -135,7 +136,7 @@ export default {
value: 0,
label: {
normal: {
- formatter: '50.5%',//小数点后一位
+ formatter: per,//小数点后一位
textStyle: {
color: '#fe8b53',
fontSize: 18,
diff --git a/src/components/base/barChart.vue b/src/components/base/barChart.vue
index 0526f66..ea6009a 100644
--- a/src/components/base/barChart.vue
+++ b/src/components/base/barChart.vue
@@ -67,7 +67,8 @@ export default {
this.chart = null
},
methods: {
- setOptions({yData} = {}) {
+ setOptions({seriesData,total} = {}) {
+ console.log(seriesData)
this.chart.setOption(
{
@@ -122,19 +123,19 @@ export default {
inverse: true,
data: [
{
- value:1000,
+ value:seriesData[0],
textStyle:{
color:'#01AEFE'
}
},
{
- value:200,
+ value:seriesData[1],
textStyle:{
color:'#06C406'
}
},
{
- value:300,
+ value:seriesData[2],
textStyle:{
color:'#FFAB00'
}
@@ -151,10 +152,10 @@ export default {
name: '条',
type: 'bar',
yAxisIndex: 0,
- data: [1000,200,300],
+ data: seriesData,
data:[
{
- value:1000,
+ value:seriesData[0],
itemStyle: {
normal: {
color: {
@@ -173,7 +174,7 @@ export default {
}
},
{
- value:200,
+ value:seriesData[1],
itemStyle: {
normal: {
color: {
@@ -192,7 +193,7 @@ export default {
}
},
{
- value:300,
+ value:seriesData[2],
itemStyle: {
normal: {
color: {
@@ -223,7 +224,7 @@ export default {
type: 'bar',
yAxisIndex: 1,
barGap: '-100%',
- data: [1500,1500,1500],//百分比
+ data: [total,total,total],//百分比
barWidth: '40%',
itemStyle: {
normal: {
diff --git a/src/utils/formate.js b/src/utils/formate.js
index 3eed038..5d71e04 100644
--- a/src/utils/formate.js
+++ b/src/utils/formate.js
@@ -20,6 +20,8 @@ function formateTime() {
}
function formaterTotal(val) {
+ // console.log(val)
+ // console.log(typeof val)
let str = val.toString()
let newStr = ''
let count = 0
diff --git a/src/view/VHome.vue b/src/view/VHome.vue
index 93bec17..5e6609b 100644
--- a/src/view/VHome.vue
+++ b/src/view/VHome.vue
@@ -4,27 +4,27 @@
-
-
+
-
+
-
+
-
-
+
-
-
+
-
+
-
+
@@ -51,6 +51,65 @@ export default {
VIncome,
VBerth,
VEquipment
+ },
+ data(){
+ return {
+ parkingTotal: 319706,
+ rodeside: 2345,
+ rodeclose: 23,
+ tollTotal: 23454,
+ tollsign: 12309,
+ tollnosign: 2130,
+ inoutmsg: '万达广场停车场1 京A231231',
+ inouttime: '08:00',
+ imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1552297151876&di=fcc094f43d6caaf4b9526dabbefd1243&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20190124%2F1fc9d7e14be54986b9e2e055a2b5ccc1.jpeg',
+ incometotal:123213,
+ barChartData:{
+ seriesData:[2000,200,300],
+ total:2500
+ },
+ bertotal:28839,
+ pieChartData: {
+ yData: [21321,13311],
+ legendData: ['空余','占有']
+ },
+ equipment:{
+ PDA:150,
+ PDATotal:3000,
+ berth:150,
+ berthTotal:2300,
+ daozha:150,
+ daozhaTotal:1300,
+ ydp:150,
+ ydpTotal:300
+ },
+ ditudata:[
+ {Name:'万达停车场1',lonId:'111.742579',latId:'40.818675',status:0,freeBrethNum:0,plBerthNum:1000,plName:'万达广场停车场1',plAddress:'北京万达广场1'},
+ {Name:'万达停车场2',lonId:'111.622579',latId:'40.878675',status:1,freeBrethNum:100,plBerthNum:800,plName:'万达广场停车场2',plAddress:'北京万达广场2'},
+ {Name:'万达停车场333333',lonId:'111.782579',latId:'40.778675',status:2,freeBrethNum:300,plBerthNum:500,plName:'万达广场停车场3',plAddress:'北京万达广场3'}
+ ]
+
+ }
+ },
+ mounted(){
+ // this.setmethod()
+ // this.$nextTick(function () {
+ // this.setmethod()
+ // })
+ var self = this
+ var t =setInterval(()=>{
+ self.parkingTotal ++
+ console.log(self.parkingTotal)
+ },1000)
+
+ },
+ methods:{
+ setmethod(){
+ setInterval(()=>{
+ this.parkingTotal ++
+ console.log(this.parkingTotal)
+ },1000)
+ }
}
}
--
libgit2 0.21.4