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