From f7ad95439053af6e89e04a2b669e16b6408ece25 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 07 十一月 2023 17:02:15 +0800 Subject: [PATCH] 更新加载状态问题 --- src/stores/tasks.ts | 30 ++++++++---------------------- 1 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/stores/tasks.ts b/src/stores/tasks.ts index 92035a0..e115738 100644 --- a/src/stores/tasks.ts +++ b/src/stores/tasks.ts @@ -77,10 +77,14 @@ /** * 鍒锋柊鎵�鏈夋暟鎹� */ - function reload(channel: number) { + function reloadChannel(channel: number) { getChannels(currentType.value).then(() => { autoSelectTask(channel) }) + } + + function reloadAllData() { + getChannels(currentType.value) } function moreChannelTasksBtn(channelNumber: number) { @@ -123,33 +127,15 @@ activeTask.value = task } - const requestParamsMap = ref<{ - [channel: number]: TaskListParams - }>({}) - function getParamsByChannel(channel: number) { - return ( - requestParamsMap.value[channel] ?? { - type: 1, - offset: 0, - limit: 3 - } - ) - } - - function setParamsByChannel(channel: number, params: TaskListParams) { - requestParamsMap.value[channel] = params - } return { channels, getChannels, moreBtnStatus, activeTask, - reload, + reloadChannel, setActiveTask, - requestParamsMap, - getParamsByChannel, - setParamsByChannel, moreChannelTasksBtn, - foldChannelTasksBtn + foldChannelTasksBtn, + reloadAllData } }) -- Gitblit v1.8.0