Files
2024-05-20 11:32:39 +08:00

142 lines
4.6 KiB
HTML
Raw Permalink 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="d-flex align-center mt-2" >
<div :class="`item-user-box d-flex align-center px-3 ${ user.username?.includes('(账号被禁用)') && 'item-user-box-error'} `">
<div class="item-avatar d-flex align-center justify-center mr-2">{{user.username[0] || ''}}</div>
<div class="">{{user.username}}</div>
</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 .item-user-box {
min-width: 60px;
height: 40px;
line-height: 40px;
background-color: #edf5fe;
border-radius: 2px;
}
.node-user-box .item-avatar {
width: 25px;
height: 25px;
color: white;
font-weight: 600;
background-color: #5fb362;
}
.item-user-box-error{
background-color: rgb(231, 75, 75) !important;
color: white;
}
.node-user-box .user-box-comment{
position:relative;
margin-top: 8px;
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: 90%;
width: 0px;
margin: 0 auto 1px;
border: #cdcfd1 solid 1px;
}
</style>
<!-- <<<<<<<<<<<<< taskHistory.html -->