diff --git a/src/views/wf/ticketd.vue b/src/views/wf/ticketd.vue index d361898f..515ce988 100644 --- a/src/views/wf/ticketd.vue +++ b/src/views/wf/ticketd.vue @@ -79,12 +79,18 @@ const ticketDetail = ref({ }); const ticketLog = ref([]); const ticketId = ref(null); +watch( + () => props.ticket_, + async (newVal) => { + if (newVal && Object.keys(newVal).length > 0) { + ticketId.value = newVal.id + getTicketDetail() + getTicketLog() + } + }, + { immediate: false } +) onMounted(() => { - if (props.ticket_) { - ticketId.value = props.ticket_.id; - getTicketDetail(); - getTicketLog(); - } }); const emit = defineEmits(['success']); const refreshTicket = async () => { @@ -103,7 +109,6 @@ const getTicketDetail = () => { if (isCreator) { isOwn.value = true } - }); };