feat: base ticketd_b调整样式
This commit is contained in:
parent
8d9a066d8c
commit
d2754d3b0c
|
|
@ -1,5 +1,4 @@
|
|||
<template>
|
||||
<span v-if="actionShow">
|
||||
<button
|
||||
v-for="item in transitions"
|
||||
:key="item.id"
|
||||
|
|
@ -7,10 +6,8 @@
|
|||
:loading="isSaveing"
|
||||
:disabled="isSaveing"
|
||||
@click="handleTransition(item)"
|
||||
style="margin-right: 2px"
|
||||
size="mini"
|
||||
>{{ item.name }}</button>
|
||||
</span>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, defineEmits, watch } from 'vue'
|
||||
|
|
@ -27,8 +24,9 @@ const props = defineProps({
|
|||
|
||||
const workflow = ref(null);
|
||||
const transitions = ref([]);
|
||||
const currentUser = ref(uni.getStorageSync("userInfo").id);
|
||||
onMounted(async () => {
|
||||
setTimeout(()=>{init()}, 2000)
|
||||
setTimeout(()=>{init()}, 1000)
|
||||
// await init();
|
||||
// watch(
|
||||
// () => props.ticket_,
|
||||
|
|
@ -40,24 +38,22 @@ onMounted(async () => {
|
|||
// { deep: true }
|
||||
// )
|
||||
})
|
||||
const actionShow = ref(false);
|
||||
const suggestion = ref("")
|
||||
const isOwn = ref(false)
|
||||
const ticketId = ref(null)
|
||||
const init = async () => {
|
||||
transitions.value = [];
|
||||
actionShow.value = false;
|
||||
if (props.ticket_ && props.ticket_.id) {
|
||||
isOwn.value = props.ticket_.create_by === currentUser.value;
|
||||
ticketId.value = props.ticket_.id;
|
||||
const isParticipant =
|
||||
(props.ticket_.participant_type === 1 && props.ticket_.participant === currentUser.value) ||
|
||||
(props.ticket_.participant_type === 2 && props.ticket_.participant.includes(currentUser.value))
|
||||
if (isParticipant) {
|
||||
actionShow.value = true;
|
||||
transitions.value = await API.getTransition(props.ticket_.id);
|
||||
}
|
||||
}else if (props.workflow_key) {
|
||||
let res = await API.workflowInitkey(props.workflow_key);
|
||||
actionShow.value = true
|
||||
transitions.value = res.transitions;
|
||||
workflow.value = res.workflow
|
||||
}else{
|
||||
|
|
@ -81,7 +77,7 @@ const submit = async (transition_id) => {
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (props.ticket_?.id) {
|
||||
if (ticketId.value) {
|
||||
console.log('props.ticket_data',props.ticket_data)
|
||||
let params = new Object();
|
||||
params.transition = transition_id;
|
||||
|
|
@ -120,9 +116,11 @@ const submit = async (transition_id) => {
|
|||
return;
|
||||
}
|
||||
|
||||
ticket.transition = transition_id;
|
||||
try {
|
||||
let res = await API.ticketCreate(ticket);
|
||||
ticketId.value = res.id;
|
||||
try{
|
||||
await API.ticketHandle(ticketId.value, {transition: transition_id, ticket_data: props.ticket_data});
|
||||
isSaveing.value = false;
|
||||
uni.showToast({
|
||||
title: '提交成功',
|
||||
|
|
@ -133,6 +131,10 @@ const submit = async (transition_id) => {
|
|||
isSaveing.value = false;
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
isSaveing.value = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
// const handleRetreat = async () =>{
|
||||
|
|
|
|||
Loading…
Reference in New Issue