feat: 修改ticketd传入ticket_full_data

This commit is contained in:
caoqianming 2025-09-28 09:01:30 +08:00
parent bb992adbfe
commit 680425be8a
2 changed files with 11 additions and 11 deletions

View File

@ -74,8 +74,8 @@ import API from '@/api';
import TOOL from "@/utils/tool.js"; import TOOL from "@/utils/tool.js";
import { ElMessageBox } from 'element-plus' import { ElMessageBox } from 'element-plus'
const props = defineProps({ const props = defineProps({
ticketId: { type: String, required: true, default: null },
ticket_data: { type: Object, default: null }, ticket_data: { type: Object, default: null },
ticket_full_data: { type: Object, default: null, required: true },
}); });
const currentUser = ref(TOOL.data.get("USER_INFO").id) const currentUser = ref(TOOL.data.get("USER_INFO").id)
const actionShow = ref(false); const actionShow = ref(false);
@ -88,10 +88,10 @@ const ticketLog = ref([]);
const handleForm = ref({ const handleForm = ref({
suggestion: "" suggestion: ""
}) })
const ticketId = ref(null);
onMounted(() => { onMounted(() => {
console.log(props) if (props.ticket_full_data) {
if (props.ticketId) { ticketId.value = props.ticket_full_data.id;
getTicketDetail();
getTicketLog(); getTicketLog();
} }
}); });
@ -109,7 +109,7 @@ const refreshTicket = async () => {
} }
const getTicketDetail = () => { const getTicketDetail = () => {
API.wf.ticket.ticketItem.req(props.ticketId).then(res => { API.wf.ticket.ticketItem.req(ticketId.value).then(res => {
ticketDetail.value = res; ticketDetail.value = res;
if (res.create_by === currentUser.value) { if (res.create_by === currentUser.value) {
isOwn.value = true; isOwn.value = true;
@ -130,13 +130,13 @@ const getTicketDetail = () => {
}; };
const getTransitions = () => { const getTransitions = () => {
API.wf.ticket.ticketTransitions.req(props.ticketId).then(res => { API.wf.ticket.ticketTransitions.req(ticketId.value).then(res => {
transitions.value = res; transitions.value = res;
}); });
} }
const getTicketLog = () => { const getTicketLog = () => {
API.wf.ticket.ticketFlowlogs.req(props.ticketId).then(res => { API.wf.ticket.ticketFlowlogs.req(ticketId.value).then(res => {
ticketLog.value = res; ticketLog.value = res;
}) })
} }
@ -154,7 +154,7 @@ const handleRetreat = () => {
type: "warning", type: "warning",
}).then(() => { }).then(() => {
API.wf.ticket.ticketRetreat API.wf.ticket.ticketRetreat
.req(props.ticketId, handleForm.value) .req(ticketId.value, handleForm.value)
.then((res) => { .then((res) => {
refreshTicket(); refreshTicket();
}); });
@ -173,7 +173,7 @@ const handleTransition = (transitionId) => {
} }
params.suggestion = handleForm.value.suggestion; params.suggestion = handleForm.value.suggestion;
submitLoading.value = true; submitLoading.value = true;
API.wf.ticket.ticketHandle.req(props.ticketId, params).then((res) => { API.wf.ticket.ticketHandle.req(ticketId.value, params).then((res) => {
submitLoading.value = false; submitLoading.value = false;
refreshTicket(); refreshTicket();
}).catch((e) => { }).catch((e) => {

View File

@ -4,7 +4,7 @@
</el-main> </el-main>
<el-aside width="30%"> <el-aside width="30%">
<ticketd :ticketId="props.ticketId"></ticketd> <ticketd :ticket_full_data="props.ticket_full_data"></ticketd>
</el-aside> </el-aside>
</el-container> </el-container>
</template> </template>
@ -13,7 +13,7 @@ import { ref, defineProps, onMounted} from "vue";
import ticketd from './ticketd.vue' import ticketd from './ticketd.vue'
import API from '@/api' import API from '@/api'
const props = defineProps({ const props = defineProps({
ticketId: { type: String, required: false, default: null } ticket_full_data: { type: Object, required: false, default: null }
}); });
onMounted(() => { onMounted(() => {