Files
workflow/app/view/component/taskHistory.html
T
2024-05-16 15:40:50 +08:00

122 lines
4.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- taskHistory.html >>>>>>>>>>>>> -->
<script type="text/html" id="task-history">
<div>
<div class="history-box">
<div class="node-box d-flex mb-2" v-for="(nodeItem, nodeIndex) in workflowHistory" :key="nodeIndex">
<div class="node-box-stepper">
<template v-if="nodeItem.nodeStatus == '已同意' || nodeItem.nodeStatus == '已抄送'">
<v-icon v-if="nodeItem.id.startsWith('approvalTask')" color="#4caf50">mdi-account-circle</v-icon>
<v-icon v-if="nodeItem.id.startsWith('noticeTask')" color="#4caf50">mdi-send-circle</v-icon>
</template>
<template v-if="nodeItem.nodeStatus == '已拒绝'">
<v-icon v-if="nodeItem.id.startsWith('approvalTask')" color="#f4807b">mdi-account-circle</v-icon>
<v-icon v-if="nodeItem.id.startsWith('noticeTask')" color="#f4807b">mdi-send-circle</v-icon>
</template>
<template v-if="nodeItem.nodeStatus == '审批中' || nodeItem.nodeStatus == '抄送中'">
<v-icon v-if="nodeItem.id.startsWith('approvalTask')" color="#cdcfd1">mdi-account-circle</v-icon>
<v-icon v-if="nodeItem.id.startsWith('noticeTask')" color="#cdcfd1">mdi-send-circle</v-icon>
</template>
<div v-if="nodeIndex < workflowHistory.length - 1" class="vertical-line" :style="{ borderColor: ['已同意','已抄送'].includes(nodeItem['nodeStatus']) ? '#4caf50' : '#cdcfd1' }"></div>
</div>
<div class="node-box-item">
<div class="node-label font-weight-bold">
{{nodeItem.label}}
<template v-if="nodeItem.approvalType && (nodeItem.nodeStatus != '审批中' || nodeItem.id == taskConfigId)"> · {{nodeItem.nodeStatus}}</template>
<v-chip class="ml-1 px-1 py-2" x-small v-if="nodeItem.approvalType" label outlined color="#4caf50">
{{nodeItem.approvalType}}
</v-chip>
</div>
<div class="node-user-box">
<template v-for="(user, index) in nodeItem.userList" :key="index">
<div class="user-box-item d-flex align-center mt-2" >
<div class="text-center">
<span class="ml-1">{{user.username}}</span>
</div>
<div class="d-flex align-center ml-4" v-if="nodeItem.id.startsWith('approvalTask') && user.handleDesc">
<v-icon v-if="user.handleDesc == '同意'" size="16" color="green">mdi-check-circle-outline</v-icon>
<v-icon v-if="user.handleDesc == '拒绝'" size="16" color="red">mdi-close-circle-outline</v-icon>
<span class="ml-1">已{{user.handleDesc}} · {{user.createHistoryAt}}</span>
</div>
</div>
<div v-if="user.comment" class="user-box-comment">
<span style="color: gray;">审批意见: </span> {{user.comment}}
</div>
</template>
</div>
</div>
</div>
</div>
</div>
</script>
<script>
Vue.component('task-history', {
template: "#task-history",
vueComponent: 'task-history',
vuetify: new Vuetify(),
props: {
taskConfigId: {
type: String,
default: '',
},
workflowHistory: {
type: Array,
default: ()=>{
return []
},
},
},
data() {
return {
isTableLoading: false,
};
},
watch: {
},
methods: {
},
});
</script>
<style>
.history-box{
padding: 5px 16px;
}
.node-user-box .user-box-comment{
position:relative;
margin-top: 6px;
padding: 10px 8px;
background-color: #f5f4f4;
border-radius: 1%;
}
.node-user-box .user-box-comment::before{
content: "";
width: 10px;
height: 10px;
border-width: 1px 0 0 1px;
position: absolute;
transform: translate(-50%, -50%) rotate(45deg);
left: 10px;
top: 0;
background: linear-gradient(to right bottom, #f5f4f4 50%, transparent 50%);
}
.node-box .node-box-item{
flex: 1;
margin: 2px 8px;
}
.node-box-stepper .vertical-line {
height: 80%;
width: 0px;
margin: 0 auto 1px;
border: #cdcfd1 solid 1px;
}
</style>
<!-- <<<<<<<<<<<<< taskHistory.html -->