|
@@ -49,7 +49,7 @@ import EditProject from './edit.vue'
|
|
|
import { Modal } from 'ant-design-vue'
|
|
|
import { HeadPanl, BodyPanl } from '@/layout/panl'
|
|
|
import { router, RoutesName, routesMetas } from '@/router'
|
|
|
-import { computed, toRef } from 'vue'
|
|
|
+import { computed, onActivated, onDeactivated, toRef } from 'vue'
|
|
|
import { useProject, ProjectStatus } from '@/store'
|
|
|
import { useRealtime } from '@/hook'
|
|
|
import { renderModal } from '@/helper'
|
|
@@ -90,6 +90,18 @@ useRealtime(() => {
|
|
|
}
|
|
|
return projectStore.setCurrent(id).catch(back)
|
|
|
})
|
|
|
+
|
|
|
+let interval: number
|
|
|
+onActivated(() => {
|
|
|
+ interval = setInterval(() => {
|
|
|
+ const id = Number(router.currentRoute.value.params.id)
|
|
|
+ id && projectStore.setCurrent(id)
|
|
|
+ }, 1000)
|
|
|
+})
|
|
|
+onDeactivated(() => {
|
|
|
+ clearInterval(interval)
|
|
|
+})
|
|
|
+
|
|
|
const deleteProject = () => {
|
|
|
Modal.confirm({
|
|
|
content: '删除后无法恢复,是否确认?',
|