fix: 修复时间线组件中存在审批意见时,候选人名称头像样式布局错位问题

pull/582/head
GoldenZqqq 2024-11-06 15:55:48 +08:00
parent cd69659c93
commit 0fbd98291e
2 changed files with 42 additions and 136 deletions

View File

@ -146,100 +146,6 @@ const getDefinitionList = async () => {
processDefinitionList.value = await DefinitionApi.getProcessDefinitionList({
suspensionState: 1
})
/* 测试数据 */
// processDefinitionList.value = [
// {
// id: 'business:3:fab1dceb-95be-11ef-8c7d-00a6181404fd',
// version: 3,
// name: '',
// key: 'business',
// icon: 'https://picsum.photos/200?r=2',
// description: '',
// category: 'test0',
// categoryName: '0',
// formType: 10,
// formId: 27,
// formName: null,
// formConf:
// '{"form":{"inline":false,"hideRequiredAsterisk":false,"labelPosition":"right","size":"default","labelWidth":"100px"},"resetBtn":{"show":false,"innerText":""},"submitBtn":{"show":false,"innerText":""}}',
// formFields: [
// '{"type":"input","field":"F1yrm2sosxgeabc","title":"","info":"","$required":false,"props":{"type":"text","placeholder":"123"},"_fc_id":"id_Fhrbm2sosxgeacc","name":"ref_Festm2sosxgeadc","display":true,"hidden":false,"_fc_drag_tag":"input"}',
// '{"type":"radio","field":"F9r3m2sp1b34aec","title":"","info":"","$required":false,"props":{"_optionType":2},"_fc_id":"id_F4nwm2sp1b34afc","name":"ref_Fkodm2sp1b34agc","display":true,"hidden":false,"_fc_drag_tag":"radio","options":[{"label":"","value":"1"},{"label":"","value":"2"},{"label":"","value":"3"}]}',
// '{"type":"datePicker","field":"Finom2tsbwbpadc","title":"","info":"","$required":false,"props":{"type":"datetimerange"},"_fc_id":"id_F028m2tsbwbpaec","name":"ref_F0okm2tsbwbpafc","display":true,"hidden":false,"_fc_drag_tag":"dateRange"}'
// ],
// formCustomCreatePath: '',
// formCustomViewPath: '',
// suspensionState: 1,
// deploymentTime: null,
// bpmnXml: null,
// startUserSelectTasks: null
// },
// {
// id: 'oa_leave:1:6e5ac269-5f87-11ef-bdb6-00a6181404fd',
// version: 1,
// name: 'oa_leave',
// key: 'oa_leave',
// icon: null,
// description: 'oa_leave',
// category: 'etst',
// categoryName: '1',
// formType: 20,
// formId: null,
// formName: null,
// formConf: null,
// formFields: null,
// formCustomCreatePath: '/bpm/oa/leave/create',
// formCustomViewPath: '/bpm/oa/leave/detail',
// suspensionState: 1,
// deploymentTime: null,
// bpmnXml: null,
// startUserSelectTasks: null
// },
// {
// id: 'oa_leave:3:c9d06889-94fd-11ef-bf08-00a6181404fd',
// version: 3,
// name: '',
// key: 'oa_leave',
// icon: 'https://picsum.photos/200?r=1',
// description: '',
// category: 'test3',
// categoryName: '3',
// formType: 10,
// formId: 27,
// formName: null,
// formConf:
// '{"form":{"inline":false,"hideRequiredAsterisk":false,"labelPosition":"right","size":"default","labelWidth":"100px"},"resetBtn":{"show":false,"innerText":""},"submitBtn":{"show":true,"innerText":""}}',
// formFields: [
// '{"type":"input","field":"F1yrm2sosxgeabc","title":"","info":"","$required":false,"props":{"type":"text","placeholder":"123"},"_fc_id":"id_Fhrbm2sosxgeacc","name":"ref_Festm2sosxgeadc","display":true,"hidden":false,"_fc_drag_tag":"input"}',
// '{"type":"radio","field":"F9r3m2sp1b34aec","title":"","info":"","$required":false,"props":{"_optionType":2},"_fc_id":"id_F4nwm2sp1b34afc","name":"ref_Fkodm2sp1b34agc","display":true,"hidden":false,"_fc_drag_tag":"radio","options":[{"label":"","value":"1"},{"label":"","value":"2"},{"label":"","value":"3"}]}'
// ],
// formCustomCreatePath: 'bpm/oa/leave/create',
// formCustomViewPath: 'bpm/oa/leave/create',
// suspensionState: 1,
// deploymentTime: null,
// bpmnXml: null,
// startUserSelectTasks: null
// }
// ]
/* 测试数据 */
// processDefinitionList.value = [
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value,
// ...processDefinitionList.value
// ]
//
filteredProcessDefinitionList.value = processDefinitionList.value
} finally {

View File

@ -24,7 +24,7 @@
</div>
</div>
</template>
<div class="flex flex-col items-start">
<div class="flex flex-col items-start gap2" :id="`activity-task-${activity.id}`">
<!-- 第一行节点名称时间 -->
<div class="flex w-full">
<div class="font-bold"> {{ activity.name }}</div>
@ -36,53 +36,53 @@
{{ getApprovalNodeTime(activity) }}
</div>
</div>
<div class="flex items-center flex-wrap mt-1">
<div class="flex items-center flex-wrap mt-1 gap2">
<!-- 情况一遍历每个审批节点下的进行中task 任务 -->
<div v-for="(task, idx) in activity.tasks" :key="idx" class="flex items-center">
<div class="flex flex-col pr-2 gap2">
<div v-for="(task, idx) in activity.tasks" :key="idx" class="flex flex-col pr-2 gap2">
<div
class="position-relative flex flex-wrap gap2"
v-if="task.assigneeUser || task.ownerUser"
>
<!-- 信息头像昵称 -->
<div
class="position-relative flex flex-wrap gap2"
v-if="task.assigneeUser || task.ownerUser"
class="bg-gray-100 h-35px rounded-3xl flex items-center p-8px gap-2 dark:color-gray-600 position-relative"
>
<!-- 信息头像昵称 -->
<template v-if="task.assigneeUser?.avatar || task.assigneeUser?.nickname">
<el-avatar
:size="28"
v-if="task.assigneeUser?.avatar"
:src="task.assigneeUser?.avatar"
/>
<el-avatar :size="28" v-else>
{{ task.assigneeUser?.nickname.substring(0, 1) }}
</el-avatar>
{{ task.assigneeUser?.nickname }}
</template>
<template v-else-if="task.ownerUser?.avatar || task.ownerUser?.nickname">
<el-avatar
:size="28"
v-if="task.ownerUser?.avatar"
:src="task.ownerUser?.avatar"
/>
<el-avatar :size="28" v-else>
{{ task.ownerUser?.nickname.substring(0, 1) }}
</el-avatar>
{{ task.ownerUser?.nickname }}
</template>
<!-- 信息任务 ICON -->
<div
class="bg-gray-100 h-35px rounded-3xl flex items-center p-8px gap-2 dark:color-gray-600 position-relative"
v-if="onlyStatusIconShow.includes(task.status)"
class="position-absolute top-22px left-26px bg-#fff rounded-full flex items-center p-2px"
>
<template v-if="task.assigneeUser?.avatar || task.assigneeUser?.nickname">
<el-avatar
:size="28"
v-if="task.assigneeUser?.avatar"
:src="task.assigneeUser?.avatar"
/>
<el-avatar :size="28" v-else>
{{ task.assigneeUser?.nickname.substring(0, 1) }}
</el-avatar>
{{ task.assigneeUser?.nickname }}
</template>
<template v-else-if="task.ownerUser?.avatar || task.ownerUser?.nickname">
<el-avatar
:size="28"
v-if="task.ownerUser?.avatar"
:src="task.ownerUser?.avatar"
/>
<el-avatar :size="28" v-else>
{{ task.ownerUser?.nickname.substring(0, 1) }}
</el-avatar>
{{ task.ownerUser?.nickname }}
</template>
<!-- 信息任务 ICON -->
<div
v-if="onlyStatusIconShow.includes(task.status)"
class="position-absolute top-22px left-26px bg-#fff rounded-full flex items-center p-2px"
>
<Icon
:size="12"
:icon="statusIconMap2[task.status]?.icon"
:color="statusIconMap2[task.status]?.color"
/>
</div>
<Icon
:size="12"
:icon="statusIconMap2[task.status]?.icon"
:color="statusIconMap2[task.status]?.color"
/>
</div>
</div>
</div>
<teleport defer :to="`#activity-task-${activity.id}`">
<div
v-if="
task.reason &&
@ -92,7 +92,7 @@
>
审批意见{{ task.reason }}
</div>
</div>
</teleport>
</div>
<!-- 情况二遍历每个审批节点下的候选的task 任务例如说1依次审批2未来的审批任务等 -->
<div