czh-20260430-修复任务管理相关bug

This commit is contained in:
zhihao
2026-04-30 22:43:59 +08:00
parent 2641522dcd
commit d9d5ab70cc
8 changed files with 1925 additions and 556 deletions
+273 -169
View File
@@ -18,8 +18,10 @@
@quick-access-tab-click="onQuickAccessTabClick"
@move-list="onMoveList"
@move-group="onMoveGroup"
@remove-favorite="onRemoveFavorite"
/>
<TaskContent
v-if="!isFlatView"
:current-list="currentList"
:task-list-groups="showListGroupView ? quickAccessGroups : taskListGroups"
:status-filter="statusFilter"
@@ -28,12 +30,10 @@
:sort-direction="sortDirection"
:visible-fields="visibleFields"
:show-list-group-view="showListGroupView"
:list-group-tab="listGroupTab"
:favorite-id-map="favoriteIdMap"
@create-task="onCreateTask"
@toggle-task="onToggleTask"
@task-click="onTaskClick"
@create-group="onCreateGroupFromContent"
@add-group="onAddGroup"
@update-task-field="onUpdateTaskField"
@update-task-fields="onUpdateTaskFields"
@@ -42,7 +42,6 @@
@update:sort-field="(v) => (sortField = v)"
@update:sort-direction="(v) => (sortDirection = v)"
@update:visible-fields="(v) => (visibleFields = v)"
@update:list-group-tab="onQuickAccessTabClick"
@list-select="onListSelect"
@open-collaborator="onOpenCollaborator"
@add-to-favorites="onAddToFavorites"
@@ -54,6 +53,26 @@
@rename-group="onRenameTaskGroup"
@delete-group="onDeleteTaskGroup"
/>
<TaskFlatView
v-else
:title="flatViewTitle"
:tasks="flatTasks"
:status-filter="statusFilter"
:sort-field="sortField"
:sort-direction="sortDirection"
:visible-fields="visibleFields"
:editable="flatViewEditable"
:task-edit-map="flatTaskEditMap"
@toggle-task="onToggleTask"
@task-click="onTaskClick"
@update-task-field="onUpdateTaskField"
@update-task-fields="onUpdateTaskFields"
@update:status-filter="(v) => (statusFilter = v)"
@update:sort-field="(v) => (sortField = v)"
@update:sort-direction="(v) => (sortDirection = v)"
@update:visible-fields="(v) => (visibleFields = v)"
@load-subtasks="onLoadSubtasks"
/>
<CreateTaskModal @register="registerTaskModal" @success="onTaskCreated" />
<CreateListModal @register="registerListModal" @success="onListCreated" />
<TaskDetailDrawer
@@ -76,11 +95,13 @@
</template>
<script lang="ts" name="tasklist-index-page" setup>
import { ref, reactive, computed, onMounted } from 'vue';
import { ref, computed, onMounted } from 'vue';
import { useModal } from '/@/components/Modal';
import { useDrawer } from '/@/components/Drawer';
import { useUserStore } from '/@/store/modules/user';
import TaskSidebar from './components/TaskSidebar.vue';
import TaskContent from './components/TaskContent.vue';
import TaskFlatView from './components/TaskFlatView.vue';
import CreateTaskModal from './components/CreateTaskModal.vue';
import CreateListModal from './components/CreateListModal.vue';
import TaskDetailDrawer from './components/TaskDetailDrawer.vue';
@@ -93,7 +114,6 @@
removeFavoriteGroup,
deleteTaskListApi,
renameTaskList,
saveOrUpdate,
renameGroup,
getMyOwnLists,
getMyCollabLists,
@@ -138,7 +158,6 @@
const sortField = ref<SortField>('sortOrder');
const sortDirection = ref<SortDirection>('asc');
const showListGroupView = ref(false);
const listGroupTab = ref('all');
const visibleFields = ref<FieldKey[]>([...DEFAULT_VISIBLE_FIELDS]);
const currentDrawerTaskId = ref<string>('');
@@ -147,23 +166,35 @@
const [registerDetailDrawer, { openDrawer: openDetailDrawer }] = useDrawer();
const collaboratorModalRef = ref<InstanceType<typeof CollaboratorModal> | null>(null);
const defaultGroupRealIdMap = ref<Record<string, string>>({});
const favoriteIdMap = reactive(new Map<string, string>());
const permissionMap = reactive(new Map<string, string>());
const userStore = useUserStore();
const flatTasks = ref<TaskItem[]>([]);
const flatViewTitle = ref('');
const flatViewEditable = ref(false);
const flatTaskEditMap = ref<Map<string, boolean>>(new Map());
const isFlatView = computed(() => currentView.value === 'my-tasks' || currentView.value === 'followed');
const favoriteIdMap = ref(new Map<string, string>());
const permissionMap = ref(new Map<string, string>());
async function loadFavorites() {
try {
const data: any[] = await getMyFavorites();
favoriteIdMap.clear();
permissionMap.clear();
const newFavMap = new Map<string, string>();
const newPermMap = new Map<string, string>();
for (const fav of data) {
if (fav.type === '1' && fav.mainId) {
favoriteIdMap.set(fav.mainId, fav.id);
newFavMap.set(fav.mainId, fav.id);
if (fav.permission) {
permissionMap.set(fav.mainId, fav.permission);
newPermMap.set(fav.mainId, fav.permission);
}
}
}
favoriteIdMap.value = newFavMap;
permissionMap.value = newPermMap;
taskListGroups.value = buildTree(data);
} catch (e) {
console.error('[TaskList] 加载收藏列表失败', e);
@@ -232,6 +263,7 @@
onMounted(() => {
loadFavorites();
onViewSelect('my-tasks');
});
function findListInGroups(groups: TaskListGroup[], listId: string): TaskList | null {
@@ -299,6 +331,17 @@
pid: tr.pid || '',
hasChild: tr.hasChild || '0',
sortOrder: tr.sortOrder ?? 0,
isDefault: tr.isDefault,
};
}
function buildFlatTaskItem(tr: any): TaskItem {
const base = buildTaskItem(tr);
return {
...base,
listName: tr.listName || '',
mainId: tr.mainId || '',
myPermission: tr.myPermission || '',
};
}
@@ -322,10 +365,13 @@
taskListId: listId,
collapsed: false,
tasks: [],
isDefault: gr.isDefault,
sortOrder: gr.sortOrder ?? 0,
};
groupMap.set(gr.id, tg);
if (gr.taskName === '默认分组') {
if (gr.isDefault === 1) {
defaultGroup = tg;
defaultGroupRealIdMap.value[listId] = gr.id;
}
}
@@ -336,6 +382,7 @@
taskListId: listId,
collapsed: false,
tasks: [],
sortOrder: 0,
};
}
@@ -365,21 +412,8 @@
targetGroup.tasks.push(taskItem);
}
const resultGroups: TaskGroup[] = [];
if (defaultGroup) {
resultGroups.push(defaultGroup);
}
for (const [_gid, tg] of groupMap) {
if (tg !== defaultGroup) {
resultGroups.push(tg);
}
}
resultGroups.sort((a, b) => {
if (a.id === '__default__') return -1;
if (b.id === '__default__') return 1;
return (a.sortOrder ?? 0) - (b.sortOrder ?? 0);
});
const resultGroups = Array.from(groupMap.values());
resultGroups.sort((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0));
list.groups = resultGroups;
} catch (e) {
@@ -391,97 +425,47 @@
currentView.value = view;
showListGroupView.value = false;
currentListId.value = '';
flatTasks.value = [];
groupDimension.value = 'none';
sortField.value = 'createTime';
sortDirection.value = 'asc';
if (view === 'my-tasks') {
try {
flatViewTitle.value = '我负责的任务';
flatViewEditable.value = true;
flatTaskEditMap.value = new Map();
const data: any[] = await myResponsibleTasks();
quickAccessGroups.value = buildGroupsFromTasks(data, '我负责的任务');
showListGroupView.value = true;
flatTasks.value = (data || []).map(buildFlatTaskItem);
} catch (e) {
console.error('[TaskList] 加载我负责的任务失败', e);
}
} else if (view === 'followed') {
try {
flatViewTitle.value = '我关注的任务';
flatViewEditable.value = false;
const data: any[] = await myFollowedTasks();
quickAccessGroups.value = buildGroupsFromTasks(data, '我关注的任务');
showListGroupView.value = true;
const items = (data || []).map(buildFlatTaskItem);
const editMap = new Map<string, boolean>();
const userId = userStore.getUserInfo?.id || '';
for (const item of items) {
const isAssignee = item.assigneeId?.includes(userId);
const hasListPerm = item.myPermission === '1' || item.myPermission === '2';
editMap.set(item.id, !!isAssignee || hasListPerm);
}
flatTaskEditMap.value = editMap;
flatTasks.value = items;
} catch (e) {
console.error('[TaskList] 加载我关注的任务失败', e);
}
}
}
function buildGroupsFromTasks(tasks: any[], virtualGroupName: string): TaskListGroup[] {
const taskItems: TaskItem[] = (tasks || []).map((tr: any) => ({
id: tr.id,
taskName: tr.taskName || '',
taskDesc: tr.taskDesc || '',
completed: tr.taskStatus === 1,
priority: tr.priority || '',
assigneeId: tr.assigneeId || '',
assigneeName: tr.assigneeName || '',
assignId: tr.assignId || '',
assignName: tr.assignName || '',
participantId: tr.participantId || '',
participantName: tr.participantName || '',
followersId: tr.followersId || '',
followersName: tr.followersName || '',
createBy: tr.createBy || '',
startTime: tr.startTime ? tr.startTime.split(' ')[0] : '',
endTime: tr.endTime ? tr.endTime.split(' ')[0] : '',
completeTime: tr.completeTime ? tr.completeTime.split(' ')[0] : '',
createTime: tr.createTime ? tr.createTime.split(' ')[0] : '',
updateTime: tr.updateTime ? tr.updateTime.split(' ')[0] : '',
type: tr.type || '',
subTaskCount: tr.subTaskCount || 0,
completedSubTaskCount: tr.completedSubTaskCount || 0,
remark: tr.remark || '',
groupId: '',
groupName: '',
childCount: tr.subTaskCount || 0,
completedChildCount: tr.completedSubTaskCount || 0,
pid: tr.pid || '',
hasChild: tr.hasChild || '0',
sortOrder: tr.sortOrder ?? 0,
}));
const taskList: TaskList = {
id: '__virtual_view__',
name: virtualGroupName,
pid: '',
hasChild: '0',
type: 1,
sortOrder: 0,
delFlag: 0,
groups: [
{
id: '__default__',
name: virtualGroupName,
taskListId: '__virtual_view__',
collapsed: false,
tasks: taskItems,
},
],
};
return [
{
id: '__virtual_view_group__',
name: virtualGroupName,
pid: '0',
hasChild: '0',
type: 0,
sortOrder: 0,
delFlag: 0,
taskLists: [taskList],
},
];
}
function onListSelect(listId: string) {
currentView.value = '';
currentListId.value = listId;
showListGroupView.value = false;
groupDimension.value = 'custom';
loadPermissionForList(listId);
loadTasks(listId);
}
@@ -496,9 +480,9 @@
}
}
async function onAddToFavorites(taskListId: string) {
async function onAddToFavorites(taskListId: string, pid?: string) {
try {
await addToFavorites({ taskListId });
await addToFavorites({ taskListId, pid: pid || undefined });
await loadFavorites();
} catch (e) {
console.error('[TaskList] 添加收藏失败', e);
@@ -514,6 +498,23 @@
}
}
async function onRemoveFavorite(listId: string) {
try {
const favId = favoriteIdMap.value.get(listId);
if (favId) {
await removeFavorite({ favoriteId: favId });
const isCurrent = currentListId.value === listId;
await loadFavorites();
if (isCurrent) {
const firstAvailable = findFirstAvailableList();
currentListId.value = firstAvailable?.id || '';
}
}
} catch (e) {
console.error('[TaskList] 从收藏移除失败', e);
}
}
async function onQuickAccessTabClick(tabKey: string) {
const quickAccessViewMap: Record<string, ViewType> = {
all: 'all-tasks',
@@ -523,7 +524,8 @@
currentView.value = quickAccessViewMap[tabKey] || currentView.value;
showListGroupView.value = true;
currentListId.value = '';
listGroupTab.value = tabKey;
groupDimension.value = 'custom';
flatTasks.value = [];
try {
if (tabKey === 'all') {
@@ -568,19 +570,15 @@
}));
}
async function onCreateTask(groupId: string, taskName: string, sortOrder?: number) {
async function onCreateTask(groupId: string, taskName: string) {
if (taskName && taskName.trim()) {
try {
console.log('[TaskList] onCreateTask:', { groupId, taskName, mainId: currentListId.value, sortOrder });
const params: any = {
mainId: currentListId.value,
taskName: taskName.trim(),
type: '1',
pid: groupId && groupId !== '__default__' ? groupId : '',
};
if (sortOrder !== undefined) {
params.sortOrder = sortOrder;
}
await addTask(params);
if (currentListId.value) {
await loadTasks(currentListId.value);
@@ -596,18 +594,24 @@
async function onCreateList(name: string, groupId: string) {
if (!name || !name.trim()) return;
try {
await addTaskList({
const listId = await addTaskList({
tasklistName: name.trim(),
pid: groupId || undefined,
sortOrder: 1,
});
if (listId) {
await addToFavorites({ taskListId: listId, pid: groupId || undefined });
}
await loadFavorites();
} catch (e) {
console.error('[TaskList] 创建清单失败', e);
}
}
function onListCreated() {
function onListCreated(listId?: string) {
if (listId) {
addToFavorites({ taskListId: listId });
}
loadFavorites();
}
@@ -627,17 +631,17 @@
}
}
async function onCreateGroupFromContent(_name: string) {
const groupName = '新建分组';
async function onAddGroup(listId: string, groupName: string) {
if (!groupName.trim() || !listId) return;
try {
if (!currentListId.value) return;
await addTask({
mainId: currentListId.value,
taskName: groupName,
mainId: listId,
taskName: groupName.trim(),
type: '0',
sortOrder: 1,
});
await loadTasks(currentListId.value);
if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
console.error('[TaskList] 创建任务分组失败', e);
}
@@ -668,48 +672,83 @@
async function onMoveList(favoriteId: string, targetGroupId: string, sortOrder: number) {
try {
await moveTaskList({ favoriteId, targetGroupId: targetGroupId || undefined, sortOrder });
await loadFavorites();
await moveTaskList({ favoriteId, targetGroupId: targetGroupId || '', sortOrder });
} catch (e) {
console.error('[TaskList] 移动清单失败', e);
} finally {
await loadFavorites();
}
}
async function onMoveGroup(groupId: string, sortOrder: number) {
try {
await moveGroup({ groupId, sortOrder });
await loadFavorites();
} catch (e) {
console.error('[TaskList] 移动分组失败', e);
} finally {
await loadFavorites();
}
}
async function onMoveTask(taskId: string, targetPid: string, targetSortOrder: number) {
try {
await moveTask({ taskId, targetPid, targetSortOrder });
} catch (e) {
console.error('[TaskList] 移动任务失败', e);
} finally {
if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
console.error('[TaskList] 移动任务失败', e);
}
}
async function onMoveTaskGroup(taskGroupId: string, targetSortOrder: number) {
try {
await moveTaskGroup({ taskGroupId, targetSortOrder });
} catch (e) {
console.error('[TaskList] 移动任务分组失败', e);
} finally {
if (currentListId.value) {
await loadTasks(currentListId.value);
}
}
}
async function onDeleteTaskGroup(groupId: string) {
if (groupId === '__default__') return;
try {
await deleteTaskApi({ id: groupId }, () => {});
if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
console.error('[TaskList] 移动任务分组失败', e);
console.error('[TaskList] 删除任务分组失败', e);
}
}
async function onRenameTaskGroup(groupId: string, newName: string) {
if (!newName.trim()) return;
const realGroupId = groupId === '__default__' ? defaultGroupRealIdMap.value[currentListId.value] : groupId;
if (!realGroupId) return;
try {
await editTask({ id: realGroupId, taskName: newName.trim() });
if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
console.error('[TaskList] 重命名任务分组失败', e);
}
}
async function onToggleTask(taskId: string) {
try {
await toggleTaskStatus({ id: taskId });
if (currentListId.value) {
if (isFlatView.value) {
const idx = flatTasks.value.findIndex((t) => t.id === taskId);
if (idx >= 0) {
flatTasks.value[idx] = { ...flatTasks.value[idx], completed: !flatTasks.value[idx].completed };
}
} else if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
@@ -717,12 +756,75 @@
}
}
function getAllTasks(): TaskItem[] {
if (isFlatView.value) return flatTasks.value;
const allTasks: TaskItem[] = [];
for (const group of taskListGroups.value) {
for (const list of group.taskLists) {
for (const taskGroup of list.groups) {
allTasks.push(...taskGroup.tasks);
}
}
}
return allTasks;
}
function onTaskClick(taskId: string) {
currentDrawerTaskId.value = taskId;
const allTasks = getAllTasks();
const task = allTasks.find((t) => t.id === taskId);
if (task) {
openDetailDrawer(true, { task, allTasks });
const readOnly = isFlatView.value ? !canEditFlatTask(task) : currentList.value?.myPermission === '3';
openDetailDrawer(true, { task, allTasks, readOnly });
}
}
function canEditFlatTask(task: TaskItem): boolean {
if (flatViewEditable.value) return true;
return flatTaskEditMap.value.has(task.id);
}
async function refreshFlatViewTasks() {
if (currentView.value === 'my-tasks') {
const data: any[] = await myResponsibleTasks();
flatTasks.value = (data || []).map(buildFlatTaskItem);
} else if (currentView.value === 'followed') {
const data: any[] = await myFollowedTasks();
const items = (data || []).map(buildFlatTaskItem);
const editMap = new Map<string, boolean>();
const userId = userStore.getUserInfo?.id || '';
for (const item of items) {
const isAssignee = item.assigneeId?.includes(userId);
const hasListPerm = item.myPermission === '1' || item.myPermission === '2';
editMap.set(item.id, !!isAssignee || hasListPerm);
}
flatTaskEditMap.value = editMap;
flatTasks.value = items;
}
}
async function onLoadSubtasks(taskId: string, mainId: string) {
try {
const res: any = await listAllByMainId({ mainId });
const records: any[] = Array.isArray(res) ? res : Array.isArray(res?.result) ? res.result : [];
const taskRecords = records.filter((r: any) => r.type === '1' && r.pid === taskId);
if (taskRecords.length === 0) return;
const newChildren = taskRecords.map((tr: any) => buildFlatTaskItem(tr));
flatTasks.value = [...flatTasks.value, ...newChildren];
if (currentView.value === 'followed') {
const editMap = new Map(flatTaskEditMap.value);
const userId = userStore.getUserInfo?.id || '';
for (const child of newChildren) {
const isAssignee = child.assigneeId?.includes(userId);
const hasListPerm = child.myPermission === '1' || child.myPermission === '2';
if (isAssignee || hasListPerm) {
editMap.set(child.id, true);
}
}
flatTaskEditMap.value = editMap;
}
} catch (e) {
console.error('[TaskList] 加载子任务失败', e);
}
}
@@ -731,14 +833,20 @@
const allTasks = getAllTasks();
const task = allTasks.find((t) => t.id === currentDrawerTaskId.value);
if (task) {
openDetailDrawer(true, { task, allTasks });
const readOnly = isFlatView.value ? !canEditFlatTask(task) : currentList.value?.myPermission === '3';
openDetailDrawer(true, { task, allTasks, readOnly });
}
}
async function onUpdateTaskField(taskId: string, field: string, value: any) {
try {
await editTask({ id: taskId, [field]: value });
if (currentListId.value) {
if (isFlatView.value) {
const idx = flatTasks.value.findIndex((t) => t.id === taskId);
if (idx >= 0) {
flatTasks.value[idx] = { ...flatTasks.value[idx], [field]: value };
}
} else if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
@@ -749,7 +857,12 @@
async function onUpdateTaskFields(taskId: string, fields: Record<string, any>) {
try {
await editTask({ id: taskId, ...fields });
if (currentListId.value) {
if (isFlatView.value) {
const idx = flatTasks.value.findIndex((t) => t.id === taskId);
if (idx >= 0) {
flatTasks.value[idx] = { ...flatTasks.value[idx], ...fields };
}
} else if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
@@ -775,7 +888,12 @@
type: updatedTask.type,
remark: updatedTask.remark,
});
if (currentListId.value) {
if (isFlatView.value) {
const idx = flatTasks.value.findIndex((t) => t.id === updatedTask.id);
if (idx >= 0) {
flatTasks.value[idx] = { ...flatTasks.value[idx], ...updatedTask };
}
} else if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
@@ -785,13 +903,11 @@
async function onCreateSubTask(parentTaskId: string, taskName: string) {
try {
await addTask({
mainId: currentListId.value,
taskName,
type: '1',
pid: parentTaskId,
});
if (currentListId.value) {
const mainId = isFlatView.value ? flatTasks.value.find((t) => t.id === parentTaskId)?.mainId || '' : currentListId.value;
await addTask({ mainId, taskName, type: '1', pid: parentTaskId });
if (isFlatView.value) {
await refreshFlatViewTasks();
} else if (currentListId.value) {
await loadTasks(currentListId.value);
refreshDrawer();
}
@@ -803,7 +919,9 @@
async function onToggleSubTask(taskId: string) {
try {
await toggleTaskStatus({ id: taskId });
if (currentListId.value) {
if (isFlatView.value) {
await refreshFlatViewTasks();
} else if (currentListId.value) {
await loadTasks(currentListId.value);
refreshDrawer();
}
@@ -824,7 +942,9 @@
async function onDeleteTask(taskId: string) {
try {
await deleteTaskApi({ id: taskId }, () => {});
if (currentListId.value) {
if (isFlatView.value) {
flatTasks.value = flatTasks.value.filter((t) => t.id !== taskId);
} else if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
@@ -835,7 +955,9 @@
async function onDeleteSubTaskRecord(taskId: string) {
try {
await deleteTaskApi({ id: taskId }, () => {});
if (currentListId.value) {
if (isFlatView.value) {
await refreshFlatViewTasks();
} else if (currentListId.value) {
await loadTasks(currentListId.value);
refreshDrawer();
}
@@ -847,7 +969,9 @@
async function onUpdateSubTaskField(taskId: string, field: string, value: any) {
try {
await editTask({ id: taskId, [field]: value || '' });
if (currentListId.value) {
if (isFlatView.value) {
await refreshFlatViewTasks();
} else if (currentListId.value) {
await loadTasks(currentListId.value);
refreshDrawer();
}
@@ -859,7 +983,9 @@
async function onUpdateSubTaskFields(taskId: string, fields: Record<string, any>) {
try {
await editTask({ id: taskId, ...fields });
if (currentListId.value) {
if (isFlatView.value) {
await refreshFlatViewTasks();
} else if (currentListId.value) {
await loadTasks(currentListId.value);
refreshDrawer();
}
@@ -871,7 +997,9 @@
async function onFollowTask(taskId: string) {
try {
await followTaskApi({ id: taskId });
if (currentListId.value) {
if (isFlatView.value) {
refreshFlatViewTasks();
} else if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
@@ -882,7 +1010,9 @@
async function onUnfollowTask(taskId: string) {
try {
await unfollowTaskApi({ id: taskId });
if (currentListId.value) {
if (isFlatView.value) {
refreshFlatViewTasks();
} else if (currentListId.value) {
await loadTasks(currentListId.value);
}
} catch (e) {
@@ -890,20 +1020,6 @@
}
}
async function onAddGroup(listId: string, groupName: string) {
try {
await addTask({
mainId: listId,
taskName: groupName,
type: '0',
sortOrder: 1,
});
await loadTasks(listId);
} catch (e) {
console.error('[TaskList] 创建任务分组失败', e);
}
}
async function onRenameList(listId: string, newName: string) {
const list = findListById(listId);
if (list) {
@@ -919,7 +1035,7 @@
async function onDeleteList(listId: string) {
try {
if (showListGroupView.value) {
const favId = favoriteIdMap.get(listId);
const favId = favoriteIdMap.value.get(listId);
if (favId) {
await removeFavorite({ favoriteId: favId });
}
@@ -936,18 +1052,6 @@
}
}
function getAllTasks(): TaskItem[] {
const allTasks: TaskItem[] = [];
for (const group of taskListGroups.value) {
for (const list of group.taskLists) {
for (const taskGroup of list.groups) {
allTasks.push(...taskGroup.tasks);
}
}
}
return allTasks;
}
function findListById(listId: string): TaskList | null {
for (const group of taskListGroups.value) {
for (const list of group.taskLists) {