152 lines
4.9 KiB
HTML
152 lines
4.9 KiB
HTML
<!-- taskHistory.html >>>>>>>>>>>>> -->
|
|
<script type="text/html" id="task-history">
|
|
<div>
|
|
<!-- <div>111---{{taskId}}</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">
|
|
{{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: {
|
|
taskId: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
taskConfigId: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
workflowConfig: {
|
|
type: Object,
|
|
default: ()=>{
|
|
return {}
|
|
},
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
isTableLoading: false,
|
|
workflowHistory: [],
|
|
};
|
|
},
|
|
watch: {
|
|
taskId: {
|
|
handler(val, oldVal) {
|
|
if (!val) return;
|
|
this.getTableData();
|
|
},
|
|
immediate: true,
|
|
},
|
|
},
|
|
methods: {
|
|
// ---------- 获取列表 >>>>>>>>>> --------
|
|
async getTableData() {
|
|
this.isTableLoading = true;
|
|
const resultData = (await window.jianghuAxios({
|
|
data: {
|
|
appData: {
|
|
pageId: 'todo',
|
|
actionId: 'getTaskWorkflow',
|
|
actionData: {taskId: this.taskId},
|
|
}
|
|
}
|
|
})).data.appData.resultData
|
|
this.workflowHistory = resultData
|
|
console.log(resultData);
|
|
this.isTableLoading = false;
|
|
},
|
|
// ---------- <<<<<<<<<< 获取列表 --------
|
|
},
|
|
});
|
|
|
|
</script>
|
|
<style>
|
|
.history-box{
|
|
padding: 5px 16px;
|
|
}
|
|
|
|
.node-user-box .user-box-comment{
|
|
position:relative;
|
|
margin-top: 10px;
|
|
padding: 2px;
|
|
border: 1px solid #4caf50;
|
|
border-radius: 1%;
|
|
}
|
|
|
|
.node-user-box .user-box-comment::before{
|
|
content: "";
|
|
width: 8px;
|
|
height: 8px;
|
|
border: solid #4caf50;
|
|
border-width: 1px 0 0 1px;
|
|
position: absolute;
|
|
transform: translate(-50%, -50%) rotate(45deg);
|
|
left: 12px;
|
|
top: 0;
|
|
background: linear-gradient(to right bottom, white 50%, transparent 50%);
|
|
}
|
|
|
|
.node-box .node-box-item{
|
|
margin: 2px 8px;
|
|
}
|
|
|
|
.node-box-stepper .vertical-line {
|
|
height: 80%;
|
|
width: 0px;
|
|
margin: 0 auto 1px;
|
|
border: #cdcfd1 solid 1px;
|
|
}
|
|
</style>
|
|
<!-- <<<<<<<<<<<<< taskHistory.html -->
|