From 36d72090e22ca4372a5bbbc6082116665650b7fe Mon Sep 17 00:00:00 2001 From: caoqianming Date: Sun, 28 Sep 2025 10:21:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ticketd=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/wf/ticketd.vue | 35 ++++++++++++++++++-------------- src/views/wf/ticketd_b_start.vue | 31 ++++++++++++++++++---------- src/views/wf/ticketd_default.vue | 4 ++-- 3 files changed, 42 insertions(+), 28 deletions(-) diff --git a/src/views/wf/ticketd.vue b/src/views/wf/ticketd.vue index 50645f50..4e9e85f4 100644 --- a/src/views/wf/ticketd.vue +++ b/src/views/wf/ticketd.vue @@ -75,7 +75,7 @@ import TOOL from "@/utils/tool.js"; import { ElMessageBox } from 'element-plus' const props = defineProps({ ticket_data: { type: Object, default: null }, - ticket_full_data: { type: Object, default: null, required: true }, + ticket_: { type: Object, default: null, required: true }, }); const currentUser = ref(TOOL.data.get("USER_INFO").id) const actionShow = ref(false); @@ -90,8 +90,9 @@ const handleForm = ref({ }) const ticketId = ref(null); onMounted(() => { - if (props.ticket_full_data) { - ticketId.value = props.ticket_full_data.id; + if (props.ticket_) { + ticketId.value = props.ticket_.id; + getTicketDetail(); getTicketLog(); } }); @@ -111,21 +112,25 @@ const refreshTicket = async () => { const getTicketDetail = () => { API.wf.ticket.ticketItem.req(ticketId.value).then(res => { ticketDetail.value = res; - if (res.create_by === currentUser.value) { - isOwn.value = true; - actionShow.value = true; - if (!activeNames.value.includes('2')) activeNames.value.push('2') + const isCreator = res.create_by === currentUser.value + const isParticipant = + (res.participant_type === 1 && res.participant === currentUser.value) || + (res.participant_type === 2 && res.participant.includes(currentUser.value)) + + if (isCreator) { + isOwn.value = true } - if (res.participant_type == 1 && res.participant === currentUser.value) { - actionShow.value = true; - if (!activeNames.value.includes('2')) activeNames.value.push('2') - getTransitions(); + + if (isCreator || isParticipant) { + actionShow.value = true + if (!activeNames.value.includes('2')) { + activeNames.value.push('2') } - if (res.participant_type == 2 && res.participant.includes(currentUser.value)) { - actionShow.value = true; - if (!activeNames.value.includes('2')) activeNames.value.push('2') - getTransitions(); + if (isParticipant) { + getTransitions() } + } + }); }; diff --git a/src/views/wf/ticketd_b_start.vue b/src/views/wf/ticketd_b_start.vue index 3d0eff57..7299c1f5 100644 --- a/src/views/wf/ticketd_b_start.vue +++ b/src/views/wf/ticketd_b_start.vue @@ -1,5 +1,5 @@