Skip to content

Commit f47e8f3

Browse files
committed
【功能修改】 审批意见 使用 tooltip 显示
1 parent ac13524 commit f47e8f3

File tree

1 file changed

+22
-55
lines changed

1 file changed

+22
-55
lines changed

src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue

Lines changed: 22 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,31 @@
1111
>
1212
<div class="flex flex-col items-start">
1313
<div class="font-bold"> {{ activity.name }}</div>
14-
<div class="flex items-center mt-1">
14+
<div class="flex items-center flex-wrap mt-1 ">
1515
<!-- 情况一:遍历每个审批节点下的【进行中】task 任务 -->
1616
<div v-for="(task, idx) in activity.tasks" :key="idx" class="flex items-center">
1717
<div class="flex flex-col pr-2">
1818
<div class="position-relative" v-if="task.assigneeUser || task.ownerUser">
1919
<!-- 信息:头像 -->
20-
<el-avatar
21-
:size="36"
22-
v-if="task.assigneeUser && task.assigneeUser.avatar"
23-
:src="task.assigneeUser.avatar"
24-
/>
25-
<el-avatar v-else-if="task.assigneeUser && task.assigneeUser.nickname">
26-
{{ task.assigneeUser.nickname.substring(0, 1) }}
27-
</el-avatar>
28-
<el-avatar
29-
v-else-if="task.ownerUser && task.ownerUser.avatar"
30-
:src="task.ownerUser.avatar"
31-
/>
32-
<el-avatar v-else-if="task.ownerUser && task.ownerUser.nickname">
33-
{{ task.ownerUser.nickname.substring(0, 1) }}
34-
</el-avatar>
20+
<el-tooltip :content="task.reason" placement="bottom" v-if="task.assigneeUser && task.assigneeUser.avatar" effect="light">
21+
<el-avatar
22+
:size="36"
23+
:src="task.assigneeUser.avatar"
24+
/>
25+
</el-tooltip>
26+
<el-tooltip :content="task.reason" placement="bottom" v-else-if="task.assigneeUser && task.assigneeUser.nickname" effect="light">
27+
<el-avatar >
28+
{{ task.assigneeUser.nickname.substring(0, 1) }}
29+
</el-avatar>
30+
</el-tooltip>
31+
<el-tooltip :content="task.reason" placement="bottom" v-else-if="task.ownerUser && task.ownerUser.avatar" effect="light">
32+
<el-avatar :src="task.ownerUser.avatar"/>
33+
</el-tooltip>
34+
<el-tooltip :content="task.reason" placement="bottom" v-else-if="task.ownerUser && task.ownerUser.nickname" effect="light">
35+
<el-avatar >
36+
{{ task.ownerUser.nickname.substring(0, 1) }}
37+
</el-avatar>
38+
</el-tooltip>
3539
<!-- 信息:任务 ICON -->
3640
<div
3741
class="position-absolute top-26px left-26px bg-#fff rounded-full flex items-center p-2px"
@@ -57,6 +61,7 @@
5761
>
5862
{{ task.ownerUser.nickname }}
5963
</div>
64+
<!--
6065
<div v-if="task.reason" class="text-#a5a5a5 my-4px text-12px flex items-center w-100%">
6166
<div
6267
:title="task.reason"
@@ -65,6 +70,7 @@
6570
{{ task.reason }}
6671
</div>
6772
</div>
73+
-->
6874
</div>
6975
</div>
7076
</div>
@@ -134,25 +140,6 @@ import { TaskStatusEnum } from '@/api/bpm/task'
134140
import { NodeType } from '@/components/SimpleProcessDesignerV2/src/consts'
135141
import { Check, Close, Loading, Clock, Minus, Delete } from '@element-plus/icons-vue'
136142
defineOptions({ name: 'BpmProcessInstanceTimeline' })
137-
// const props = defineProps({
138-
// // 流程实例编号
139-
// processInstanceId: {
140-
// type: String,
141-
// required: false,
142-
// default: ''
143-
// },
144-
// // 流程定义编号
145-
// processDefinitionId: {
146-
// type: String,
147-
// required: false,
148-
// default: ''
149-
// },
150-
// approveNodes : {
151-
// type: ProcessInstanceApi.ApprovalNodeInfo[],
152-
// required: false,
153-
// default: ''
154-
// }
155-
// })
156143
defineProps<{
157144
approveNodes: ProcessInstanceApi.ApprovalNodeInfo[] // 审批节点信息
158145
}>()
@@ -201,15 +188,6 @@ const statusIconMap = {
201188
'7': { color: '#00b32a', icon: Check }
202189
}
203190
204-
/** 获得审批详情 */
205-
// const getApprovalDetail = async () => {
206-
// const data = await ProcessInstanceApi.getApprovalDetail(
207-
// props.processInstanceId,
208-
// props.processDefinitionId
209-
// )
210-
// approveNodes.value = data.approveNodes
211-
// }
212-
213191
const getApprovalNodeIcon = (taskStatus: number, nodeType: NodeType) => {
214192
if (taskStatus == TaskStatusEnum.NOT_START) {
215193
return statusIconMap[taskStatus]?.icon
@@ -232,15 +210,4 @@ const getApprovalNodeTime = (node: ProcessInstanceApi.ApprovalNodeInfo) => {
232210
return `创建时间:${formatDate(node.startTime)}`
233211
}
234212
}
235-
236-
/** 重新刷新审批详情 */
237-
// const refresh = () => {
238-
// getApprovalDetail()
239-
// }
240-
241-
// defineExpose({ refresh })
242-
243-
// onMounted(async () => {
244-
// await getApprovalDetail()
245-
// })
246213
</script>

0 commit comments

Comments
 (0)