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