大哥大

This commit is contained in:
lzp
2026-03-03 11:26:09 +08:00
parent 637bddf6cb
commit bb10101a55

View File

@@ -26,7 +26,7 @@
</span>
</div>
<div class="history-list" v-show="!isCollapse && showHistory">
<div v-for="item in historyList" :key="item.name" class="history-item">
<div v-for="item in list" :key="item.name" class="history-item">
<div v-if="item.title" class="title">{{ item.name }}</div>
<div
v-else
@@ -88,47 +88,6 @@
}
const showHistory = ref(true)
const list = ref([])
const historyList = computed(() => {
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()