diff --git a/src/components/Image.vue b/src/components/Image.vue index c29ffaa..f5c79b6 100644 --- a/src/components/Image.vue +++ b/src/components/Image.vue @@ -62,7 +62,24 @@
核查进度
-核查进度(0/121)
+3号核反应堆
@@ -400,7 +400,9 @@ const onChange = async val => { // 终止自动核查任务 if (val) { taskStore.updateCheckStatus(false) - const res = await breakOffAutoCheckApi(taskStore.currentTaskId) + if (taskStore.currentTaskId) { + const res = await breakOffAutoCheckApi(taskStore.currentTaskId) + } } checkStore.handleChangeCheck(val) } @@ -446,18 +448,27 @@ const getInitData = async () => { const res = await getProcessTaskInfoApi() if (res?.code == 200) { const data = res?.data - taskStore.updateTaskStatus(data.status) - if (data.status == 1) { - taskStore.updateCheckStatus(true) + if (data) { + taskStore.updateTaskStatus(data.status) + if (data.status == 1) { + taskStore.updateCheckStatus(true) + } else { + taskStore.updateCheckStatus(false) + } + taskStore.updateCurrentCoord(data.currentCoord) + imageStore.updateNuclearCoreName(data.nuclearCoreName) + imageStore.updateShowImage(false) + taskStore.getExcelList(data.id) + taskStore.updateCurrentTaskId(data.id) + taskStore.updateCurrentDetailTaskId(null) } else { + taskStore.updateCurrentCoord(null) + // taskStore.updateCurrentTaskId(null) + taskStore.updateExcelData([]) + imageStore.updateShowImage(false) taskStore.updateCheckStatus(false) + taskStore.updateTaskStatus(0) } - taskStore.updateCurrentCoord(data.currentCoord) - imageStore.updateNuclearCoreName(data.nuclearCoreName) - imageStore.updateShowImage(false) - taskStore.getExcelList(data.id) - taskStore.updateCurrentTaskId(data.id) - taskStore.updateCurrentDetailTaskId(null) } } @@ -473,10 +484,10 @@ const logout = () => { } const getSocketdata = res => { - console.log(res) if (res == 'update') { // 更新一系列数据 taskStore.getExcelList(taskStore.currentTaskId) + getInitData() } }