From bb10101a55b2342b97a09924dbc5a45a60b5738f Mon Sep 17 00:00:00 2001 From: lzp Date: Tue, 3 Mar 2026 11:26:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=93=A5=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/left-nav.vue | 81 +++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/src/views/home/left-nav.vue b/src/views/home/left-nav.vue index 83908f1..0a681b6 100644 --- a/src/views/home/left-nav.vue +++ b/src/views/home/left-nav.vue @@ -26,7 +26,7 @@
-
+
{{ item.name }}
{ - const str = 'yyyyMMdd' - const today = FormatDate(Date.now(), str) - const yesterday = FormatDate(Date.now() - 24 * 60 * 60 * 1000, str) - const todayList = [] - const yesterdayList = [] - const earlierChatList = [] - list.value.forEach((item: any) => { - const date = FormatDate(item.updateTime * 1000, str) - if (date == today) { - todayList.push(item) - } else if (date == yesterday) { - yesterdayList.push(item) - } else { - earlierChatList.push(item) - } - }) - const arr = [] - if (todayList.length > 0) { - arr.push({ - title: true, - name: $t('Home.today') - }) - arr.push(...todayList) - } - if (yesterdayList.length > 0) { - arr.push({ - title: true, - name: $t('Home.yesterday') - }) - arr.push(...yesterdayList) - } - if (earlierChatList.length > 0) { - arr.push({ - title: true, - name: $t('Home.earlierChat') - }) - arr.push(...earlierChatList) - } - return arr - }) const onCreateProject = () => { router.push({ name: 'mainInput' }) @@ -186,12 +145,46 @@ page: 1, size: 100 }) - list.value = [] const arr = res.records || [] + list.value = [] + const str = 'yyyyMMdd' + const today = FormatDate(Date.now(), str) + const yesterday = FormatDate(Date.now() - 24 * 60 * 60 * 1000, str) + const todayList = [] + const yesterdayList = [] + const earlierChatList = [] arr.forEach((item: any) => { const obj = { ...item, edit: false, visible: false } - list.value.push(obj) + const date = FormatDate(obj.updateTime * 1000, str) + if (date == today) { + todayList.push(obj) + } else if (date == yesterday) { + yesterdayList.push(obj) + } else { + earlierChatList.push(obj) + } }) + if (todayList.length > 0) { + list.value.push({ + title: true, + name: $t('Home.today') + }) + list.value.push(...todayList) + } + if (yesterdayList.length > 0) { + list.value.push({ + title: true, + name: $t('Home.yesterday') + }) + list.value.push(...yesterdayList) + } + if (earlierChatList.length > 0) { + list.value.push({ + title: true, + name: $t('Home.earlierChat') + }) + list.value.push(...earlierChatList) + } } MyEvent.add('updateProjectList', GetProjectList) GetProjectList()