feat(projects): 工作台小组件设计
This commit is contained in:
@@ -57,7 +57,7 @@ const mainTabs: Array<{ key: WorkbenchTodoMainTab; label: string }> = [
|
||||
{ key: 'task', label: '任务' },
|
||||
{ key: 'ticket', label: '工单' },
|
||||
{ key: 'personal', label: '个人事项' },
|
||||
{ key: 'review', label: '待评审' }
|
||||
{ key: 'approval', label: '待审批' }
|
||||
];
|
||||
|
||||
const deadlineFilters: Array<{ key: Exclude<WorkbenchTodoDeadlineFilter, null>; label: string }> = [
|
||||
@@ -85,7 +85,7 @@ const tabCounts = computed(() => {
|
||||
task: 0,
|
||||
ticket: 0,
|
||||
personal: 0,
|
||||
review: 0
|
||||
approval: 0
|
||||
};
|
||||
allItems.value.forEach(item => {
|
||||
counts[item.category] += 1;
|
||||
@@ -99,7 +99,7 @@ const tabOverdueCount = computed(() => {
|
||||
task: 0,
|
||||
ticket: 0,
|
||||
personal: 0,
|
||||
review: 0
|
||||
approval: 0
|
||||
};
|
||||
allItems.value.forEach(item => {
|
||||
if (!isWorkbenchTodoOverdue(item)) return;
|
||||
@@ -144,6 +144,7 @@ watch([activeTab, activeDeadlineFilter, activeSort], () => {
|
||||
function handleSelectTab(key: WorkbenchTodoMainTab) {
|
||||
if (activeTab.value === key) return;
|
||||
activeTab.value = key;
|
||||
if (key === 'approval') activeDeadlineFilter.value = null;
|
||||
activeDeadlineFilter.value = null;
|
||||
if (key !== 'task' && activeSort.value === 'priority') {
|
||||
activeSort.value = 'deadline';
|
||||
@@ -209,7 +210,7 @@ function getDeadlineToneClass(item: WorkbenchTodoItem) {
|
||||
</div>
|
||||
|
||||
<div class="workbench-todo__filters">
|
||||
<div class="workbench-todo__filters-left">
|
||||
<div v-if="activeTab !== 'approval'" class="workbench-todo__filters-left">
|
||||
<button
|
||||
v-for="filter in deadlineFilters"
|
||||
:key="filter.key"
|
||||
@@ -221,6 +222,7 @@ function getDeadlineToneClass(item: WorkbenchTodoItem) {
|
||||
{{ filter.label }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-else></div>
|
||||
|
||||
<ElDropdown trigger="click" placement="bottom-end" @command="handleSelectSort">
|
||||
<span class="workbench-todo__sort">
|
||||
|
||||
Reference in New Issue
Block a user