2026-05-21 21:42:23 +08:00
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { computed, ref } from 'vue';
|
|
|
|
|
|
import WorkbenchModuleCard from './workbench-module-card.vue';
|
|
|
|
|
|
|
2026-05-23 14:22:58 +08:00
|
|
|
|
defineOptions({ name: 'WorkbenchMyTask' });
|
|
|
|
|
|
|
2026-05-21 21:42:23 +08:00
|
|
|
|
interface Props {
|
|
|
|
|
|
editing?: boolean;
|
|
|
|
|
|
collapsed?: boolean;
|
|
|
|
|
|
}
|
|
|
|
|
|
withDefaults(defineProps<Props>(), { editing: false, collapsed: false });
|
2026-05-23 14:22:58 +08:00
|
|
|
|
defineEmits<{ (e: 'hide'): void; (e: 'toggle-collapse'): void }>();
|
2026-05-21 21:42:23 +08:00
|
|
|
|
|
2026-05-23 14:22:58 +08:00
|
|
|
|
interface FocusItem {
|
|
|
|
|
|
id: string;
|
|
|
|
|
|
title: string;
|
|
|
|
|
|
done: boolean;
|
|
|
|
|
|
}
|
2026-05-21 21:42:23 +08:00
|
|
|
|
|
2026-05-23 14:22:58 +08:00
|
|
|
|
const items = ref<FocusItem[]>([
|
|
|
|
|
|
{ id: 'f1', title: '提交昨日工时', done: true },
|
|
|
|
|
|
{ id: 'f2', title: '登录页 SSO 改造 · 18:00 截止', done: false },
|
|
|
|
|
|
{ id: 'f3', title: '迭代 24.05 关闭 · 跟交付 / QA 确认遗留', done: false }
|
|
|
|
|
|
]);
|
2026-05-21 21:42:23 +08:00
|
|
|
|
|
2026-05-23 14:22:58 +08:00
|
|
|
|
const doneCount = computed(() => items.value.filter(i => i.done).length);
|
|
|
|
|
|
const totalCount = computed(() => items.value.length);
|
2026-05-21 21:42:23 +08:00
|
|
|
|
|
2026-05-23 14:22:58 +08:00
|
|
|
|
const todayHours = 3.5;
|
|
|
|
|
|
const targetHours = 8;
|
2026-05-21 21:42:23 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<WorkbenchModuleCard
|
2026-05-23 14:22:58 +08:00
|
|
|
|
title="我的今日"
|
|
|
|
|
|
icon="mdi:calendar-check-outline"
|
2026-05-21 21:42:23 +08:00
|
|
|
|
:editing="editing"
|
|
|
|
|
|
:collapsed="collapsed"
|
|
|
|
|
|
@hide="$emit('hide')"
|
|
|
|
|
|
@toggle-collapse="$emit('toggle-collapse')"
|
|
|
|
|
|
>
|
2026-05-23 14:22:58 +08:00
|
|
|
|
<div class="today-head">
|
|
|
|
|
|
<span class="today-progress">{{ doneCount }} / {{ totalCount }} 已完成</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<ul class="today-list">
|
|
|
|
|
|
<li v-for="item in items" :key="item.id" class="today-row">
|
|
|
|
|
|
<ElCheckbox v-model="item.done" />
|
|
|
|
|
|
<span class="today-text" :class="{ 'today-done': item.done }">{{ item.title }}</span>
|
2026-05-21 21:42:23 +08:00
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
2026-05-23 14:22:58 +08:00
|
|
|
|
<div class="today-foot">
|
|
|
|
|
|
当日累计工时:
|
|
|
|
|
|
<b>{{ todayHours }}h</b>
|
|
|
|
|
|
/ {{ targetHours }}h
|
|
|
|
|
|
</div>
|
2026-05-21 21:42:23 +08:00
|
|
|
|
</WorkbenchModuleCard>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2026-05-23 14:22:58 +08:00
|
|
|
|
.today-head {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: var(--el-text-color-secondary);
|
|
|
|
|
|
margin-bottom: 6px;
|
2026-05-21 21:42:23 +08:00
|
|
|
|
}
|
2026-05-23 14:22:58 +08:00
|
|
|
|
.today-progress {
|
|
|
|
|
|
padding: 2px 8px;
|
|
|
|
|
|
background: var(--el-fill-color-lighter);
|
|
|
|
|
|
border-radius: 999px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.today-list {
|
2026-05-21 21:42:23 +08:00
|
|
|
|
list-style: none;
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
}
|
2026-05-23 14:22:58 +08:00
|
|
|
|
.today-row {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
padding: 8px 4px;
|
|
|
|
|
|
border-bottom: 1px solid var(--el-border-color-lighter);
|
2026-05-21 21:42:23 +08:00
|
|
|
|
}
|
2026-05-23 14:22:58 +08:00
|
|
|
|
.today-row:last-child {
|
|
|
|
|
|
border-bottom: none;
|
2026-05-21 21:42:23 +08:00
|
|
|
|
}
|
2026-05-23 14:22:58 +08:00
|
|
|
|
.today-text {
|
|
|
|
|
|
font-size: 13px;
|
2026-05-21 21:42:23 +08:00
|
|
|
|
}
|
2026-05-23 14:22:58 +08:00
|
|
|
|
.today-done {
|
|
|
|
|
|
text-decoration: line-through;
|
|
|
|
|
|
color: var(--el-text-color-placeholder);
|
2026-05-21 21:42:23 +08:00
|
|
|
|
}
|
2026-05-23 14:22:58 +08:00
|
|
|
|
.today-foot {
|
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
|
padding-top: 8px;
|
|
|
|
|
|
border-top: 1px solid var(--el-border-color-lighter);
|
2026-05-21 21:42:23 +08:00
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
color: var(--el-text-color-secondary);
|
|
|
|
|
|
}
|
2026-05-23 14:22:58 +08:00
|
|
|
|
.today-foot b {
|
|
|
|
|
|
color: var(--el-text-color-primary);
|
|
|
|
|
|
font-weight: 700;
|
2026-05-21 21:42:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|