流程详情组件重新发起显示逻辑修改
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
</el-timeline-item>
|
</el-timeline-item>
|
||||||
<div class="return_send" v-for="(item, index) in tasksList" :key="index">
|
<div class="return_send" v-for="(item, index) in tasksList" :key="index">
|
||||||
<!-- 最后一条不显示重新发起 -->
|
<!-- 最后一条不显示重新发起 -->
|
||||||
<el-timeline-item type="success" v-if="index != 0">
|
<el-timeline-item type="success" v-if="index != 0 && item.name != '审核'">
|
||||||
<p style="font-weight: 700">
|
<p style="font-weight: 700">
|
||||||
重新发起:【{{ item.processInstance.startUser?.name }}】在
|
重新发起:【{{ item.processInstance.startUser?.name }}】在
|
||||||
{{ formatDate(item?.createTime) }} 重新发起【 {{ item.processInstance.name }} 】流程
|
{{ formatDate(item?.createTime) }} 重新发起【 {{ item.processInstance.name }} 】流程
|
||||||
@@ -108,31 +108,31 @@ const props = defineProps({
|
|||||||
processInstance: propTypes.object, // 流程实例
|
processInstance: propTypes.object, // 流程实例
|
||||||
tasks: propTypes.arrayOf(propTypes.object) // 流程任务的数组
|
tasks: propTypes.arrayOf(propTypes.object) // 流程任务的数组
|
||||||
})
|
})
|
||||||
const tasksList:any=ref([])
|
const tasksList: any = ref([])
|
||||||
watch(
|
watch(
|
||||||
() => props.tasks,
|
() => props.tasks,
|
||||||
(val, oldVal) => {
|
(val, oldVal) => {
|
||||||
if (val&&val.length!=0) {
|
if (val && val.length != 0) {
|
||||||
tasksList.value =JSON.parse(JSON.stringify( val)).sort((a, b) => {
|
tasksList.value = JSON.parse(JSON.stringify(val))
|
||||||
// 有已完成的情况,按照完成时间倒序
|
.sort((a, b) => {
|
||||||
if (a.endTime && b.endTime) {
|
// 有已完成的情况,按照完成时间倒序
|
||||||
return sortYMDHMS(a.endTime) - sortYMDHMS(b.endTime)
|
if (a.endTime && b.endTime) {
|
||||||
}
|
return sortYMDHMS(a.endTime) - sortYMDHMS(b.endTime)
|
||||||
else if (a.endTime) {
|
} else if (a.endTime) {
|
||||||
return 1
|
return 1
|
||||||
} else if (b.endTime) {
|
} else if (b.endTime) {
|
||||||
return -1
|
return -1
|
||||||
// 都是未完成,按照创建时间倒序
|
// 都是未完成,按照创建时间倒序
|
||||||
}
|
} else {
|
||||||
else {
|
return sortYMDHMS(a.createTime) - sortYMDHMS(b.createTime)
|
||||||
return sortYMDHMS(a.createTime) - sortYMDHMS(b.createTime)
|
}
|
||||||
}
|
})
|
||||||
}).reverse()
|
.reverse()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate:true,
|
immediate: true,
|
||||||
deep:true
|
deep: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
const sortYMDHMS = val => {
|
const sortYMDHMS = val => {
|
||||||
|
|||||||
@@ -343,9 +343,9 @@ const getTaskList = async () => {
|
|||||||
//根据历史实例id查询历史任务日志数据把最新的id加进去
|
//根据历史实例id查询历史任务日志数据把最新的id加进去
|
||||||
historyInstanceIdList.value.push(id)
|
historyInstanceIdList.value.push(id)
|
||||||
//轮询
|
//轮询
|
||||||
await historyInstanceIdList.value?.map((item: any, index: any) => {
|
await historyInstanceIdList.value?.map((item: any) => {
|
||||||
getTaskListByProcessInstanceId(item).then(res => {
|
getTaskListByProcessInstanceId(item).then(res => {
|
||||||
res.data.map(vv => {
|
res.data?.map(vv => {
|
||||||
stepList.value.push(vv)
|
stepList.value.push(vv)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user