|
@@ -205,7 +205,7 @@ import {
|
|
|
getCurrentInstance,
|
|
|
ComponentInternalInstance,
|
|
|
toRefs,
|
|
|
- nextTick
|
|
|
+ nextTick, onActivated
|
|
|
} from 'vue'
|
|
|
import {useStore} from 'vuex'
|
|
|
import {useRouter, useRoute} from 'vue-router'
|
|
@@ -260,6 +260,35 @@ export default defineComponent({
|
|
|
})
|
|
|
const initStatisticData = () => {
|
|
|
state.loading = true
|
|
|
+ if (state.dateType === '1' || state.dateType === '4') {
|
|
|
+ state.statisticData.day = {
|
|
|
+ cqs: {num: 0, total: 0},
|
|
|
+ qqs: {num: 0, total: 0},
|
|
|
+ cds: {num: 0, total: 0},
|
|
|
+ zts: {num: 0, total: 0},
|
|
|
+ cql: 0,
|
|
|
+ rztjl: 0,
|
|
|
+ zbtjl: 0,
|
|
|
+ }
|
|
|
+ } else if (state.dateType === '2' || state.dateType === '5') {
|
|
|
+ state.statisticData.week = {
|
|
|
+ ycqts: 0,
|
|
|
+ qqqk: 0,
|
|
|
+ rztjqk: 0,
|
|
|
+ cql: 0,
|
|
|
+ rztjl: 0,
|
|
|
+ zbtjl: 0
|
|
|
+ }
|
|
|
+ } else if (state.dateType === '3' || state.dateType === '6') {
|
|
|
+ state.statisticData.month = {
|
|
|
+ ycqts: 0,
|
|
|
+ qqqk: 0,
|
|
|
+ rztjqk: 0,
|
|
|
+ cql: 0,
|
|
|
+ rztjl: 0,
|
|
|
+ zbtjl: 0
|
|
|
+ }
|
|
|
+ }
|
|
|
state.statisticTime = new Date()
|
|
|
that.$api.zbglyWorkbenchAdminStatistics({
|
|
|
type: state.dateType
|
|
@@ -301,37 +330,11 @@ export default defineComponent({
|
|
|
})
|
|
|
}
|
|
|
watch(() => state.dateType, (n) => {
|
|
|
- if (n === '1' || n === '4') {
|
|
|
- state.statisticData.day = {
|
|
|
- cqs: {num: 0, total: 0},
|
|
|
- qqs: {num: 0, total: 0},
|
|
|
- cds: {num: 0, total: 0},
|
|
|
- zts: {num: 0, total: 0},
|
|
|
- cql: 0,
|
|
|
- rztjl: 0,
|
|
|
- zbtjl: 0,
|
|
|
- }
|
|
|
- } else if (n === '2' || n === '5') {
|
|
|
- state.statisticData.week = {
|
|
|
- ycqts: 0,
|
|
|
- qqqk: 0,
|
|
|
- rztjqk: 0,
|
|
|
- cql: 0,
|
|
|
- rztjl: 0,
|
|
|
- zbtjl: 0
|
|
|
- }
|
|
|
- } else if (n === '3' || n === '6') {
|
|
|
- state.statisticData.month = {
|
|
|
- ycqts: 0,
|
|
|
- qqqk: 0,
|
|
|
- rztjqk: 0,
|
|
|
- cql: 0,
|
|
|
- rztjl: 0,
|
|
|
- zbtjl: 0
|
|
|
- }
|
|
|
- }
|
|
|
initStatisticData()
|
|
|
}, {immediate: true})
|
|
|
+ onActivated(() => {
|
|
|
+ initStatisticData()
|
|
|
+ })
|
|
|
return {
|
|
|
...toRefs(state),
|
|
|
}
|