diff --git a/src/views/detail/Test.vue b/src/views/detail/Test.vue index 575826e..774ed48 100644 --- a/src/views/detail/Test.vue +++ b/src/views/detail/Test.vue @@ -20,29 +20,36 @@ import MeetingManagement from 'components/tall/task/MeetingManagement.vue'; const store = useStore(); const taskDetail = computed(() => store.state.task.taskDetail); // 任务名称 -const taskObj = ref({}); +// const taskObj = ref({}); const label = ref(null); const sessionTaskDetail = sessionStorage.getItem('taskDetail'); if (sessionTaskDetail) { - taskObj.value = JSON.parse(sessionTaskDetail); + // taskObj.value = JSON.parse(sessionTaskDetail); const taskInfo = JSON.parse(sessionTaskDetail); - taskInfo.plugins[0].forEach((item, index) => { - if (index === 0) { - label.value = item.param; - } - }); + + if (taskInfo.plugins && taskInfo.plugins.length > 0) { + taskInfo.plugins[0].forEach((item, index) => { + if (index === 0) { + label.value = item.param; + } + }); + } } // 监听任务信息 watch(taskDetail, () => { - taskObj.value = taskDetail.value; + // taskObj.value = taskDetail.value; + if (!taskDetail.value) return; + const taskInfo = taskDetail.value; - taskInfo.plugins[0].forEach((item, index) => { - if (index === 0) { - label.value = item.param; - } - }); + if (taskInfo.plugins && taskInfo.plugins.length > 0) { + taskInfo.plugins[0].forEach((item, index) => { + if (index === 0) { + label.value = item.param; + } + }); + } });