feat: base 优化ticket组件
This commit is contained in:
parent
ca99eb54b3
commit
43d0223fa6
|
@ -133,7 +133,8 @@
|
|||
<h4 :id="titleId" :class="titleClass">工单详情</h4>
|
||||
<el-button type="danger" @click="close">关闭</el-button>
|
||||
</template>
|
||||
<component :is="currentComponent" :ticketId="ticketId" :modelId="modelId"></component>
|
||||
<component :is="currentComponent" :ticketId="ticketId" :t_id="t_id" @closed="drawer = false"
|
||||
@success="()=>{drawer = false; $refs.table.refresh()}"></component>
|
||||
</el-drawer>
|
||||
</el-container>
|
||||
</template>
|
||||
|
@ -179,7 +180,7 @@ export default {
|
|||
wfOptions: [],
|
||||
currentComponent: null,
|
||||
ticketId: null,
|
||||
modelId: null,
|
||||
t_id: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -220,7 +221,7 @@ export default {
|
|||
handleShow(row) {
|
||||
this.drawer = true;
|
||||
this.ticketId = row.id;
|
||||
this.modelId = row.ticket_data.t_id;
|
||||
this.t_id = row.ticket_data.t_id;
|
||||
const viewPath = row.workflow_.view_path;
|
||||
// 动态 import
|
||||
this.currentComponent = markRaw(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-collapse v-model="activeNames">
|
||||
<el-collapse v-model="activeNames" style="padding-left: 2px; padding-right: 2px;">
|
||||
<el-collapse-item title="基本信息" name="1">
|
||||
<el-descriptions :column="1">
|
||||
<el-descriptions-item>
|
||||
|
@ -12,6 +12,10 @@
|
|||
{{ actStateEnum[ticketDetail.act_state]?.text }}
|
||||
</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="可处理人:"
|
||||
v-if="ticketDetail.participant_type == 2 || ticketDetail.participant_type == 1">
|
||||
<span v-for="item in ticketDetail.participant_" :key="item.id">{{ item.name }}/</span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="操作" name="2" v-if="actionShow">
|
||||
|
@ -85,12 +89,13 @@ const handleForm = ref({
|
|||
suggestion: ""
|
||||
})
|
||||
onMounted(() => {
|
||||
console.log('props.ticketId', props.ticketId)
|
||||
console.log(props)
|
||||
if (props.ticketId) {
|
||||
getTicketDetail();
|
||||
getTicketLog();
|
||||
}
|
||||
});
|
||||
const emit = defineEmits(['success']);
|
||||
const refreshTicket = async () => {
|
||||
actionShow.value = false
|
||||
isOwn.value = false
|
||||
|
@ -100,6 +105,7 @@ const refreshTicket = async () => {
|
|||
activeNames.value = ['1', '3'] // 根据需要恢复初始展开项
|
||||
getTicketDetail()
|
||||
getTicketLog()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
const getTicketDetail = () => {
|
||||
|
|
|
@ -27,9 +27,13 @@ const props = defineProps({
|
|||
const workflow = ref(null);
|
||||
const transitions = ref([]);
|
||||
onMounted(async () => {
|
||||
init()
|
||||
})
|
||||
const init = async () => {
|
||||
if (props.ticketId != null && props.ticketId != undefined) {
|
||||
API.wf.ticket.ticketTransitions.req(props.ticketId).then(res => {
|
||||
transitions.value = res;
|
||||
console.log("res", res)
|
||||
});
|
||||
}else if (props.workflow_key !=null && props.workflow_key != undefined) {
|
||||
let res = await API.wf.workflow.initkey.req(props.workflow_key);
|
||||
|
@ -38,8 +42,7 @@ onMounted(async () => {
|
|||
}else{
|
||||
ElMessage.error("缺少workflow_key或ticketId");
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
const isSaveing = ref(false);
|
||||
|
||||
|
|
Loading…
Reference in New Issue