This commit is contained in:
shijing 2025-10-28 15:34:41 +08:00
commit f9694f0466
2 changed files with 32 additions and 23 deletions

View File

@ -63,7 +63,7 @@
</el-dialog>
</template>
<script setup>
import { ref, defineProps, onMounted } from "vue";
import { ref, defineProps, onMounted, watch } from "vue";
import { actStateEnum, interveneTypeEnum } from "@/utils/enum.js";
import API from '@/api';
import TOOL from "@/utils/tool.js";
@ -79,7 +79,16 @@ const ticketDetail = ref({
});
const ticketLog = ref([]);
const ticketId = ref(null);
watch(
onMounted(() => {
//
if (props.ticket_ && Object.keys(props.ticket_).length > 0) {
ticketId.value = props.ticket_.id
getTicketDetail()
getTicketLog()
}
//
watch(
() => props.ticket_,
async (newVal) => {
if (newVal && Object.keys(newVal).length > 0) {
@ -88,9 +97,8 @@ watch(
getTicketLog()
}
},
{ immediate: false }
)
onMounted(() => {
{ deep: true }
)
});
const emit = defineEmits(['success']);
const refreshTicket = async () => {

View File

@ -35,21 +35,22 @@ const props = defineProps({
const workflow = ref(null);
const transitions = ref([]);
onMounted(async () => {
init()
})
watch(
init();
watch(
() => props.ticket_,
async (newVal) => {
if (newVal && Object.keys(newVal).length > 0) {
await init()
init();
}
},
{ immediate: false }
)
{ deep: true }
)
})
const ticketId = ref(null);
const actionShow = ref(false);
const init = async () => {
if (props.ticket_ != null && props.ticket_ != undefined) {
if (props.ticket_ && Object.keys(props.ticket_).length > 0) {
const isParticipant =
(props.ticket_.participant_type === 1 && props.ticket_.participant === currentUser.value) ||
(props.ticket_.participant_type === 2 && props.ticket_.participant.includes(currentUser.value))