2023-12-07 03:53:11 +08:00
|
|
|
<template>
|
|
|
|
<div class="relative leading-5 h-full flex items-center">
|
2024-03-01 10:20:35 +08:00
|
|
|
<div>
|
2023-12-07 03:53:11 +08:00
|
|
|
{{ i18n.t('experiments.card.completed_value', {
|
|
|
|
completed: params.data.completed_tasks,
|
|
|
|
all: params.data.total_tasks
|
|
|
|
}) }}
|
|
|
|
<div class="py-1">
|
2023-12-11 16:18:22 +08:00
|
|
|
<div class="w-24 h-1 bg-sn-light-grey">
|
2024-03-13 18:30:58 +08:00
|
|
|
<div class="h-full"
|
|
|
|
:class="{
|
|
|
|
'bg-sn-black': params.data.archived_on,
|
|
|
|
'bg-sn-blue': !params.data.archived_on
|
|
|
|
}"
|
|
|
|
:style="{
|
|
|
|
width: `${progress}%`
|
|
|
|
}"></div>
|
2023-12-07 03:53:11 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'CompletedTasksRenderer',
|
|
|
|
props: {
|
|
|
|
params: {
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2024-03-01 10:20:35 +08:00
|
|
|
computed: {
|
|
|
|
progress() {
|
|
|
|
const { completed_tasks: completedTasks, total_tasks: totalTasks } = this.params.data;
|
|
|
|
|
|
|
|
if (totalTasks === 0) return 0;
|
|
|
|
|
|
|
|
return (completedTasks / totalTasks) * 100;
|
|
|
|
}
|
|
|
|
}
|
2023-12-07 03:53:11 +08:00
|
|
|
};
|
|
|
|
</script>
|