소스 검색

【值班系统】后台管理删除日志或者周报,值班人员-工作台日志周报列表切换的时候列表数据没有更新,F5刷新整个页面才会重新请求接口

CzRger 1 년 전
부모
커밋
1e21e64b27
3개의 변경된 파일18개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 1
      src/views/staging/zby/center/calendar.vue
  2. 10 1
      src/views/staging/zby/center/statistic.vue
  3. 2 2
      src/views/staging/zby/right/daily-weekly-com.vue

+ 6 - 1
src/views/staging/zby/center/calendar.vue

@@ -107,7 +107,7 @@ import {
   getCurrentInstance,
   ComponentInternalInstance,
   toRefs,
-  nextTick
+  nextTick, onActivated
 } from 'vue'
 import {useStore} from 'vuex'
 import {useRouter, useRoute} from 'vue-router'
@@ -261,6 +261,11 @@ export default defineComponent({
     watch(() => props.refresh, () => {
       getCalendarInfo()
     })
+    onActivated(() => {
+      if (state.selectMonth) {
+        getCalendarInfo()
+      }
+    })
     return {
       ...toRefs(state),
       getWeekCN,

+ 10 - 1
src/views/staging/zby/center/statistic.vue

@@ -297,7 +297,7 @@ import {
   getCurrentInstance,
   ComponentInternalInstance,
   toRefs,
-  nextTick
+  nextTick, onActivated
 } from 'vue'
 import {useStore} from 'vuex'
 import {useRouter, useRoute} from 'vue-router'
@@ -718,6 +718,15 @@ export default defineComponent({
         getMonthInfo()
       }
     })
+    onActivated(() => {
+      if (state.dateType === 'day' && state.dateValue.selectDay) {
+        getDayInfo()
+      } else if (state.dateType === 'week' && state.dateValue.selectWeek) {
+        getWeekInfo()
+      } else if (state.dateType === 'month' && state.dateValue.selectMonth) {
+        getMonthInfo()
+      }
+    })
     onMounted(() => {
       initDictionary()
       initStatic()

+ 2 - 2
src/views/staging/zby/right/daily-weekly-com.vue

@@ -46,7 +46,7 @@ import {
   getCurrentInstance,
   ComponentInternalInstance,
   toRefs,
-  nextTick
+  nextTick, onActivated
 } from 'vue'
 import {useStore} from 'vuex'
 import {useRouter, useRoute} from 'vue-router'
@@ -122,7 +122,7 @@ export default defineComponent({
       }).catch(() => {
       })
     }
-    onMounted(() => {
+    onActivated(() => {
       state.loading = true
       Promise.all([
         initDaily(),