瀏覽代碼

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

CzRger 1 年之前
父節點
當前提交
1e21e64b27

+ 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(),