Commit 3b7be3b2a80ae64f5054d4b8747370db61f526df
1 parent
2242831b
今日订单数
Showing
3 changed files
with
17 additions
and
5 deletions
src/components/chinaMap/index.vue
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | <table class="parkTotalTb"> | 21 | <table class="parkTotalTb"> |
22 | <tr> | 22 | <tr> |
23 | <td><div class="dayTotalImg"></div></td> | 23 | <td><div class="dayTotalImg"></div></td> |
24 | - <td><div class="infoBox"><div><countTo :startVal='dayParams.startVal' :endVal='dayParams.endVal' :duration='animationTime'></countTo></div><div>今日订单数</div></div> </td> | 24 | + <td><div class="infoBox"><div><countTo :startVal='dayParams.startVal' :endVal='getOrderTotal' :duration='animationTime'></countTo></div><div>今日订单数</div></div> </td> |
25 | </tr> | 25 | </tr> |
26 | </table> | 26 | </table> |
27 | </div> | 27 | </div> |
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | } | 55 | } |
56 | }, | 56 | }, |
57 | computed: { | 57 | computed: { |
58 | - ...mapGetters(['getParkingTotal']) | 58 | + ...mapGetters(['getParkingTotal','getOrderTotal']) |
59 | }, | 59 | }, |
60 | mounted() { | 60 | mounted() { |
61 | //this.parkParams.endVal = this.getParkingTotal | 61 | //this.parkParams.endVal = this.getParkingTotal |
src/components/weekAndDay/uWeek.vue
@@ -14,6 +14,7 @@ | @@ -14,6 +14,7 @@ | ||
14 | 14 | ||
15 | <script> | 15 | <script> |
16 | import echarts from 'echarts' | 16 | import echarts from 'echarts' |
17 | + import {mapActions} from 'vuex' | ||
17 | export default { | 18 | export default { |
18 | name: "uWeek", | 19 | name: "uWeek", |
19 | data() { | 20 | data() { |
@@ -27,12 +28,14 @@ | @@ -27,12 +28,14 @@ | ||
27 | orgIds: [10003,10005] | 28 | orgIds: [10003,10005] |
28 | }).then((response)=>{ | 29 | }).then((response)=>{ |
29 | let data = response.data.data | 30 | let data = response.data.data |
30 | - let xData=[],inNum=[],outNum=[] | 31 | + let xData=[],inNum=[],outNum=[],lastInNum |
31 | for(let i=0;i<data.length;i++){ | 32 | for(let i=0;i<data.length;i++){ |
32 | xData.push(data[i].queryDate) | 33 | xData.push(data[i].queryDate) |
33 | inNum.push(data[i].inNum) | 34 | inNum.push(data[i].inNum) |
34 | outNum.push(data[i].outNum) | 35 | outNum.push(data[i].outNum) |
36 | + lastInNum = data[data.length-1].inNum | ||
35 | } | 37 | } |
38 | + this.$store.dispatch('transferOrderTotal',lastInNum) | ||
36 | this.weekChart=this.createLine(xData,inNum,outNum); | 39 | this.weekChart=this.createLine(xData,inNum,outNum); |
37 | window.addEventListener('resize', function() { | 40 | window.addEventListener('resize', function() { |
38 | this.weekChart.resize() | 41 | this.weekChart.resize() |
src/store/index.js
@@ -6,19 +6,25 @@ import createLogger from 'vuex/dist/logger' | @@ -6,19 +6,25 @@ import createLogger from 'vuex/dist/logger' | ||
6 | Vue.use(Vuex) | 6 | Vue.use(Vuex) |
7 | 7 | ||
8 | const state = { | 8 | const state = { |
9 | - ParkingTotal: 0 | ||
10 | - | 9 | + ParkingTotal: 0, |
10 | + orderTotal:0 | ||
11 | } | 11 | } |
12 | 12 | ||
13 | const getters = { | 13 | const getters = { |
14 | getParkingTotal: function (state) { | 14 | getParkingTotal: function (state) { |
15 | return state.ParkingTotal | 15 | return state.ParkingTotal |
16 | + }, | ||
17 | + getOrderTotal: function (state) { | ||
18 | + return state.orderTotal | ||
16 | } | 19 | } |
17 | } | 20 | } |
18 | 21 | ||
19 | const mutations = { | 22 | const mutations = { |
20 | changeParkingTotal(state,str){ | 23 | changeParkingTotal(state,str){ |
21 | state.ParkingTotal = str | 24 | state.ParkingTotal = str |
25 | + }, | ||
26 | + changeOrderTotal(state,str){ | ||
27 | + state.orderTotal = str | ||
22 | } | 28 | } |
23 | 29 | ||
24 | } | 30 | } |
@@ -26,6 +32,9 @@ const mutations = { | @@ -26,6 +32,9 @@ const mutations = { | ||
26 | const actions = { | 32 | const actions = { |
27 | transferParkingTotal(context,obj){ | 33 | transferParkingTotal(context,obj){ |
28 | context.commit('changeParkingTotal',obj) | 34 | context.commit('changeParkingTotal',obj) |
35 | + }, | ||
36 | + transferOrderTotal(context,obj){ | ||
37 | + context.commit('changeOrderTotal',obj) | ||
29 | } | 38 | } |
30 | } | 39 | } |
31 | 40 |