|
|
@ -18,18 +18,27 @@ |
|
|
|
@click="openHistory" |
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/b2d784f8607ab65081f5289459581bfe.png" |
|
|
|
alt="icon" |
|
|
|
title="打开边栏" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="isCollapsed" class="collapsed-bottom-container"> |
|
|
|
<div class="collapsed-bottom-btn" @click="handleFeedbackClick"> |
|
|
|
<div |
|
|
|
class="collapsed-bottom-btn" |
|
|
|
@click="handleFeedbackClick" |
|
|
|
title="用户反馈" |
|
|
|
> |
|
|
|
<img |
|
|
|
class="collapsed-bottom-feedback" |
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png" |
|
|
|
alt="icon" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div class="collapsed-bottom-btn" @click="handleAnnouncementClick"> |
|
|
|
<div |
|
|
|
class="collapsed-bottom-btn" |
|
|
|
@click="handleAnnouncementClick" |
|
|
|
title="公告" |
|
|
|
> |
|
|
|
<img |
|
|
|
class="collapsed-bottom-announcement" |
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png" |
|
|
@ -55,11 +64,20 @@ |
|
|
|
@click="closeHistory" |
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/b2d784f8607ab65081f5289459581bfe.png" |
|
|
|
alt="icon" |
|
|
|
title="收起边栏" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<!-- 历史记录列表 --> |
|
|
|
<div class="history-list"> |
|
|
|
<div v-for="history in categoryHistory" :key="history.name"> |
|
|
|
<!-- 空状态 --> |
|
|
|
<div v-if="historyRecords.length === 0" class="empty-state"> |
|
|
|
<div class="empty-icon"> |
|
|
|
<el-icon class="documentDelete"><DocumentDelete /></el-icon> |
|
|
|
</div> |
|
|
|
<p class="empty-text">暂无历史记录</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-else v-for="history in categoryHistory" :key="history.name"> |
|
|
|
<div class="categoryName"> |
|
|
|
{{ history.name }} |
|
|
|
</div> |
|
|
@ -146,25 +164,17 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 空状态 --> |
|
|
|
<div v-if="historyRecords.length === 0" class="empty-state"> |
|
|
|
<div class="empty-icon"> |
|
|
|
<el-icon class="documentDelete"><DocumentDelete /></el-icon> |
|
|
|
</div> |
|
|
|
<p class="empty-text">暂无历史记录</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="bottom-container"> |
|
|
|
<div class="bottom-btn" @click="handleFeedbackClick"> |
|
|
|
<div class="bottom-btn" @click="handleFeedbackClick" title="用户反馈"> |
|
|
|
<img |
|
|
|
class="bottom-feedback" |
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png" |
|
|
|
alt="icon" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div class="bottom-btn" @click="handleAnnouncementClick"> |
|
|
|
<div class="bottom-btn" @click="handleAnnouncementClick" title="公告"> |
|
|
|
<img |
|
|
|
class="bottom-announcement" |
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png" |
|
|
@ -203,7 +213,15 @@ |
|
|
|
</div> |
|
|
|
<!-- 历史记录列表 --> |
|
|
|
<div class="history-list"> |
|
|
|
<div v-for="history in categoryHistory" :key="history.name"> |
|
|
|
<!-- 空状态 --> |
|
|
|
<div v-if="historyRecords.length === 0" class="empty-state"> |
|
|
|
<div class="empty-icon"> |
|
|
|
<el-icon class="documentDelete"><DocumentDelete /></el-icon> |
|
|
|
</div> |
|
|
|
<p class="empty-text">暂无历史记录</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-else v-for="history in categoryHistory" :key="history.name"> |
|
|
|
<div class="categoryName"> |
|
|
|
{{ history.name }} |
|
|
|
</div> |
|
|
@ -290,18 +308,14 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 空状态 --> |
|
|
|
<div v-if="historyRecords.length === 0" class="empty-state"> |
|
|
|
<div class="empty-icon"> |
|
|
|
<el-icon class="documentDelete"><DocumentDelete /></el-icon> |
|
|
|
</div> |
|
|
|
<p class="empty-text">暂无历史记录</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="mobile-bottom-container"> |
|
|
|
<div class="mobile-bottom-btn" @click="handleFeedbackClick"> |
|
|
|
<div |
|
|
|
class="mobile-bottom-btn" |
|
|
|
@click="handleFeedbackClick" |
|
|
|
title="用户反馈" |
|
|
|
> |
|
|
|
<img |
|
|
|
class="mobile-bottom-feedback" |
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png" |
|
|
@ -309,7 +323,11 @@ |
|
|
|
/> |
|
|
|
<div class="mobile-bottom-text">用户反馈</div> |
|
|
|
</div> |
|
|
|
<div class="mobile-bottom-btn" @click="handleAnnouncementClick"> |
|
|
|
<div |
|
|
|
class="mobile-bottom-btn" |
|
|
|
@click="handleAnnouncementClick" |
|
|
|
title="公告" |
|
|
|
> |
|
|
|
<img |
|
|
|
class="mobile-bottom-announcement" |
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png" |
|
|
@ -346,6 +364,9 @@ import moment from "moment"; |
|
|
|
import { ElMessage } from "element-plus"; |
|
|
|
import { useChatStore } from "../../store/chat"; |
|
|
|
const chatStore = useChatStore(); |
|
|
|
import { useRouter } from "vue-router"; |
|
|
|
const router = useRouter(); |
|
|
|
|
|
|
|
// Props |
|
|
|
const props = defineProps({ |
|
|
|
currentType: { |
|
|
@ -407,12 +428,12 @@ const getHistoryList = async (params) => { |
|
|
|
// 2. 筛选今日记录 |
|
|
|
let todayList = remainingRecords.filter((record) => { |
|
|
|
const today = moment().format("YYYY-MM-DD"); |
|
|
|
const recordDate = moment(record.updateTime).format("YYYY-MM-DD"); |
|
|
|
const recordDate = moment(record.updatedTime).format("YYYY-MM-DD"); |
|
|
|
return recordDate === today; |
|
|
|
}); |
|
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
|
const today = moment().format("YYYY-MM-DD"); |
|
|
|
const recordDate = moment(record.updateTime).format("YYYY-MM-DD"); |
|
|
|
const recordDate = moment(record.updatedTime).format("YYYY-MM-DD"); |
|
|
|
return recordDate !== today; |
|
|
|
}); |
|
|
|
|
|
|
@ -420,13 +441,13 @@ const getHistoryList = async (params) => { |
|
|
|
let recent3DaysList = remainingRecords.filter((record) => { |
|
|
|
const threeDaysAgo = moment().subtract(3, "days").startOf("day"); |
|
|
|
const yesterday = moment().subtract(1, "days").endOf("day"); |
|
|
|
const recordDate = moment(record.updateTime); |
|
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
return recordDate.isAfter(threeDaysAgo) && recordDate.isBefore(yesterday); |
|
|
|
}); |
|
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
|
const threeDaysAgo = moment().subtract(3, "days").startOf("day"); |
|
|
|
const yesterday = moment().subtract(1, "days").endOf("day"); |
|
|
|
const recordDate = moment(record.updateTime); |
|
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
return !( |
|
|
|
recordDate.isAfter(threeDaysAgo) && recordDate.isBefore(yesterday) |
|
|
|
); |
|
|
@ -435,24 +456,24 @@ const getHistoryList = async (params) => { |
|
|
|
// 4. 筛选近7日记录(不包括今日和近3日) |
|
|
|
let recent7DaysList = remainingRecords.filter((record) => { |
|
|
|
const sevenDaysAgo = moment().subtract(7, "days").startOf("day"); |
|
|
|
const recordDate = moment(record.updateTime); |
|
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
return recordDate.isAfter(sevenDaysAgo); |
|
|
|
}); |
|
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
|
const sevenDaysAgo = moment().subtract(7, "days").startOf("day"); |
|
|
|
const recordDate = moment(record.updateTime); |
|
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
return !recordDate.isAfter(sevenDaysAgo); |
|
|
|
}); |
|
|
|
|
|
|
|
// 5. 筛选近30日记录(不包括前面已筛选的) |
|
|
|
let recent30DaysList = remainingRecords.filter((record) => { |
|
|
|
const thirtyDaysAgo = moment().subtract(30, "days").startOf("day"); |
|
|
|
const recordDate = moment(record.updateTime); |
|
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
return recordDate.isAfter(thirtyDaysAgo); |
|
|
|
}); |
|
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
|
const thirtyDaysAgo = moment().subtract(30, "days").startOf("day"); |
|
|
|
const recordDate = moment(record.updateTime); |
|
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
return !recordDate.isAfter(thirtyDaysAgo); |
|
|
|
}); |
|
|
|
|
|
|
@ -523,6 +544,10 @@ const toggleCollapse = () => { |
|
|
|
localStorage.setItem("historyRecordCollapsed", isCollapsed.value); |
|
|
|
}; |
|
|
|
|
|
|
|
const backToSelectModel = () => { |
|
|
|
router.push("/Selectmodel"); |
|
|
|
}; |
|
|
|
|
|
|
|
const openHistory = () => { |
|
|
|
// getHistoryList({ |
|
|
|
// model: props.currentType == "AIchat" ? 1 : 2, |
|
|
@ -608,6 +633,19 @@ const handleFeedbackClick = () => { |
|
|
|
emit("showFeedback"); |
|
|
|
}; |
|
|
|
|
|
|
|
watch( |
|
|
|
() => chatStore.searchRecord, |
|
|
|
(newVal) => { |
|
|
|
if (chatStore.searchRecord) { |
|
|
|
getHistoryList({ |
|
|
|
model: props.currentType == "AIchat" ? 1 : 2, |
|
|
|
token: localStorage.getItem("localToken"), |
|
|
|
}); |
|
|
|
chatStore.searchRecord = false; |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
// 暴露方法和状态给父组件 |
|
|
|
defineExpose({ |
|
|
|
isCollapsed, |
|
|
@ -751,6 +789,7 @@ onMounted(() => { |
|
|
|
/* height: 50%; */ |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
cursor: pointer; |
|
|
|
/* align-items: center; */ |
|
|
|
} |
|
|
|
|
|
|
@ -1002,6 +1041,7 @@ onMounted(() => { |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
|
|
|
|
.mobile-bottom-btn { |
|
|
|