|
@ -25,23 +25,23 @@ |
|
|
<div v-if="isCollapsed" class="collapsed-bottom-container"> |
|
|
<div v-if="isCollapsed" class="collapsed-bottom-container"> |
|
|
<div |
|
|
<div |
|
|
class="collapsed-bottom-btn" |
|
|
class="collapsed-bottom-btn" |
|
|
@click="handleFeedbackClick" |
|
|
|
|
|
title="用户反馈" |
|
|
|
|
|
|
|
|
@click="handleAnnouncementClick" |
|
|
|
|
|
title="公告" |
|
|
> |
|
|
> |
|
|
<img |
|
|
<img |
|
|
class="collapsed-bottom-feedback" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png" |
|
|
|
|
|
|
|
|
class="collapsed-bottom-announcement" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png" |
|
|
alt="icon" |
|
|
alt="icon" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div |
|
|
<div |
|
|
class="collapsed-bottom-btn" |
|
|
class="collapsed-bottom-btn" |
|
|
@click="handleAnnouncementClick" |
|
|
|
|
|
title="公告" |
|
|
|
|
|
|
|
|
@click="handleFeedbackClick" |
|
|
|
|
|
title="用户反馈" |
|
|
> |
|
|
> |
|
|
<img |
|
|
<img |
|
|
class="collapsed-bottom-announcement" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png" |
|
|
|
|
|
|
|
|
class="collapsed-bottom-feedback" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png" |
|
|
alt="icon" |
|
|
alt="icon" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
@ -78,7 +78,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div v-else v-for="history in categoryHistory" :key="history.name"> |
|
|
<div v-else v-for="history in categoryHistory" :key="history.name"> |
|
|
<div class="categoryName"> |
|
|
|
|
|
|
|
|
<div class="categoryName" v-if="history.list.length != 0"> |
|
|
{{ history.name }} |
|
|
{{ history.name }} |
|
|
</div> |
|
|
</div> |
|
|
<div |
|
|
<div |
|
@ -95,9 +95,28 @@ |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div class="record-msg"> |
|
|
<div class="record-msg"> |
|
|
<div class="record-text">{{ record.stockCode }}</div> |
|
|
|
|
|
|
|
|
<div class="record-text"> |
|
|
|
|
|
<span class="stock-name">{{ record.stockName }}</span> |
|
|
|
|
|
<span class="stock-code">({{ record.stockCode }})</span> |
|
|
|
|
|
<div v-if="history.name === '置顶'"> |
|
|
|
|
|
<svg |
|
|
|
|
|
t="1755227529729" |
|
|
|
|
|
class="top-icon" |
|
|
|
|
|
viewBox="320 280 380 460" |
|
|
|
|
|
version="1.1" |
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg" |
|
|
|
|
|
p-id="7392" |
|
|
|
|
|
> |
|
|
|
|
|
<path |
|
|
|
|
|
d="M351.085714 292.571429h321.828572v29.257142H351.085714v-29.257142z m175.542857 125.805714l146.285715 146.285714-20.48 20.48-125.805715-125.805714V731.428571h-29.257142v-272.091428L371.565714 585.142857l-20.48-20.48 146.285715-146.285714h29.257142z" |
|
|
|
|
|
fill="#FFFFFF" |
|
|
|
|
|
p-id="7393" |
|
|
|
|
|
></path> |
|
|
|
|
|
</svg> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
<div class="record-time"> |
|
|
<div class="record-time"> |
|
|
{{ moment(record.updatedTime).format("YYYY-MM-DD HH:mm:ss") }} |
|
|
|
|
|
|
|
|
{{ moment(record.createdTime).format("YYYY-MM-DD HH:mm:ss") }} |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -156,28 +175,23 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-popover> |
|
|
</el-popover> |
|
|
<!-- <button |
|
|
|
|
|
|
|
|
|
|
|
@click="openDetail(record)" |
|
|
|
|
|
title="更多" |
|
|
|
|
|
></button> --> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="bottom-container"> |
|
|
<div class="bottom-container"> |
|
|
<div class="bottom-btn" @click="handleFeedbackClick" title="用户反馈"> |
|
|
|
|
|
|
|
|
<div class="bottom-btn" @click="handleAnnouncementClick" title="公告"> |
|
|
<img |
|
|
<img |
|
|
class="bottom-feedback" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png" |
|
|
|
|
|
|
|
|
class="bottom-announcement" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png" |
|
|
alt="icon" |
|
|
alt="icon" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div class="bottom-btn" @click="handleAnnouncementClick" title="公告"> |
|
|
|
|
|
|
|
|
<div class="bottom-btn" @click="handleFeedbackClick" title="用户反馈"> |
|
|
<img |
|
|
<img |
|
|
class="bottom-announcement" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png" |
|
|
|
|
|
|
|
|
class="bottom-feedback" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png" |
|
|
alt="icon" |
|
|
alt="icon" |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
@ -222,7 +236,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div v-else v-for="history in categoryHistory" :key="history.name"> |
|
|
<div v-else v-for="history in categoryHistory" :key="history.name"> |
|
|
<div class="categoryName"> |
|
|
|
|
|
|
|
|
<div class="categoryName" v-if="history.list.length != 0"> |
|
|
{{ history.name }} |
|
|
{{ history.name }} |
|
|
</div> |
|
|
</div> |
|
|
<div |
|
|
<div |
|
@ -239,9 +253,28 @@ |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div class="record-msg"> |
|
|
<div class="record-msg"> |
|
|
<div class="record-text">{{ record.stockCode }}</div> |
|
|
|
|
|
|
|
|
<div class="record-text"> |
|
|
|
|
|
<span class="stock-name">{{ record.stockName }}</span> |
|
|
|
|
|
<span class="stock-code">({{ record.stockCode }})</span> |
|
|
|
|
|
<div v-if="history.name === '置顶'"> |
|
|
|
|
|
<svg |
|
|
|
|
|
t="1755227529729" |
|
|
|
|
|
class="top-icon" |
|
|
|
|
|
viewBox="320 280 380 460" |
|
|
|
|
|
version="1.1" |
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg" |
|
|
|
|
|
p-id="7392" |
|
|
|
|
|
> |
|
|
|
|
|
<path |
|
|
|
|
|
d="M351.085714 292.571429h321.828572v29.257142H351.085714v-29.257142z m175.542857 125.805714l146.285715 146.285714-20.48 20.48-125.805715-125.805714V731.428571h-29.257142v-272.091428L371.565714 585.142857l-20.48-20.48 146.285715-146.285714h29.257142z" |
|
|
|
|
|
fill="#FFFFFF" |
|
|
|
|
|
p-id="7393" |
|
|
|
|
|
></path> |
|
|
|
|
|
</svg> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
<div class="record-time"> |
|
|
<div class="record-time"> |
|
|
{{ moment(record.updatedTime).format("YYYY-MM-DD HH:mm:ss") }} |
|
|
|
|
|
|
|
|
{{ moment(record.createdTime).format("YYYY-MM-DD HH:mm:ss") }} |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -300,11 +333,6 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-popover> |
|
|
</el-popover> |
|
|
<!-- <button |
|
|
|
|
|
|
|
|
|
|
|
@click="openDetail(record)" |
|
|
|
|
|
title="更多" |
|
|
|
|
|
></button> --> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -313,33 +341,37 @@ |
|
|
<div class="mobile-bottom-container"> |
|
|
<div class="mobile-bottom-container"> |
|
|
<div |
|
|
<div |
|
|
class="mobile-bottom-btn" |
|
|
class="mobile-bottom-btn" |
|
|
@click="handleFeedbackClick" |
|
|
|
|
|
title="用户反馈" |
|
|
|
|
|
|
|
|
@click="handleAnnouncementClick" |
|
|
|
|
|
title="公告" |
|
|
> |
|
|
> |
|
|
<img |
|
|
<img |
|
|
class="mobile-bottom-feedback" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png" |
|
|
|
|
|
|
|
|
class="mobile-bottom-announcement" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png" |
|
|
alt="icon" |
|
|
alt="icon" |
|
|
/> |
|
|
/> |
|
|
<div class="mobile-bottom-text">用户反馈</div> |
|
|
|
|
|
|
|
|
<div class="mobile-bottom-text">公告</div> |
|
|
</div> |
|
|
</div> |
|
|
<div |
|
|
<div |
|
|
class="mobile-bottom-btn" |
|
|
class="mobile-bottom-btn" |
|
|
@click="handleAnnouncementClick" |
|
|
|
|
|
title="公告" |
|
|
|
|
|
|
|
|
@click="handleFeedbackClick" |
|
|
|
|
|
title="用户反馈" |
|
|
> |
|
|
> |
|
|
<img |
|
|
<img |
|
|
class="mobile-bottom-announcement" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png" |
|
|
|
|
|
|
|
|
class="mobile-bottom-feedback" |
|
|
|
|
|
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png" |
|
|
alt="icon" |
|
|
alt="icon" |
|
|
/> |
|
|
/> |
|
|
<div class="mobile-bottom-text">公告</div> |
|
|
|
|
|
|
|
|
<div class="mobile-bottom-text">用户反馈</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<el-dialog v-model="deleteDialogVisible" title="永久删除记录" width="500"> |
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
|
v-model="deleteDialogVisible" |
|
|
|
|
|
title="永久删除记录" |
|
|
|
|
|
:width="computedDialogWidth" |
|
|
|
|
|
> |
|
|
<span>删除后,该记录将不可恢复。确认删除吗?</span> |
|
|
<span>删除后,该记录将不可恢复。确认删除吗?</span> |
|
|
<template #footer> |
|
|
<template #footer> |
|
|
<div class="dialog-footer"> |
|
|
<div class="dialog-footer"> |
|
@ -404,6 +436,15 @@ const selectedRecordId = ref(null); |
|
|
|
|
|
|
|
|
const delObj = ref({}); |
|
|
const delObj = ref({}); |
|
|
const deleteDialogVisible = ref(false); |
|
|
const deleteDialogVisible = ref(false); |
|
|
|
|
|
const dialogWidth = ref("500px"); // 对话框动态宽度 |
|
|
|
|
|
|
|
|
|
|
|
// 计算属性:根据移动端状态动态设置对话框宽度 |
|
|
|
|
|
const computedDialogWidth = computed(() => { |
|
|
|
|
|
if (props.isMobile) { |
|
|
|
|
|
return "70%"; // 移动端使用百分比宽度 |
|
|
|
|
|
} |
|
|
|
|
|
return dialogWidth.value; // 桌面端使用固定宽度 |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
const openDeleteDialog = () => { |
|
|
const openDeleteDialog = () => { |
|
|
deleteDialogVisible.value = true; |
|
|
deleteDialogVisible.value = true; |
|
@ -415,11 +456,54 @@ const closeDeleteDialog = () => { |
|
|
|
|
|
|
|
|
const historyRecords = ref([]); |
|
|
const historyRecords = ref([]); |
|
|
const categoryHistory = ref([]); |
|
|
const categoryHistory = ref([]); |
|
|
|
|
|
let chatFirstFlag = true; |
|
|
|
|
|
let emotionTirstFlag = true; |
|
|
const getHistoryList = async (params) => { |
|
|
const getHistoryList = async (params) => { |
|
|
try { |
|
|
try { |
|
|
const result = await getHistoryListAPI(params); |
|
|
const result = await getHistoryListAPI(params); |
|
|
historyRecords.value = result.data.list; |
|
|
|
|
|
let remainingRecords = result.data.list; // 复制原数组 |
|
|
|
|
|
|
|
|
historyRecords.value = result.data; |
|
|
|
|
|
let remainingRecords = result.data; // 复制原数组 |
|
|
|
|
|
// console.log( |
|
|
|
|
|
// "params", |
|
|
|
|
|
// params, |
|
|
|
|
|
// "result", |
|
|
|
|
|
// result.data, |
|
|
|
|
|
// "chatFirstFlag", |
|
|
|
|
|
// chatFirstFlag, |
|
|
|
|
|
// "emotionTirstFlag", |
|
|
|
|
|
// emotionTirstFlag |
|
|
|
|
|
// ); |
|
|
|
|
|
const userAgent = navigator.userAgent; |
|
|
|
|
|
const isMobile = |
|
|
|
|
|
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( |
|
|
|
|
|
userAgent |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
if (chatFirstFlag && params.model == 1 && result.data.length != 0) { |
|
|
|
|
|
if (isMobile) { |
|
|
|
|
|
chatStore.aiChatCall = true; |
|
|
|
|
|
} |
|
|
|
|
|
chatFirstFlag = false; |
|
|
|
|
|
} |
|
|
|
|
|
if (emotionTirstFlag && params.model == 2 && result.data.length != 0) { |
|
|
|
|
|
if (isMobile) { |
|
|
|
|
|
chatStore.aiEmotionCall = true; |
|
|
|
|
|
} |
|
|
|
|
|
emotionTirstFlag = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 只在首次加载时根据chatStore状态设置折叠状态,避免搜索后自动弹出历史记录 |
|
|
|
|
|
|
|
|
|
|
|
if (isMobile) { |
|
|
|
|
|
isCollapsed.value = true; |
|
|
|
|
|
} else { |
|
|
|
|
|
if (props.currentType == "AIchat" && chatFirstFlag) { |
|
|
|
|
|
isCollapsed.value = !chatStore.aiChatCall; |
|
|
|
|
|
} else if (props.currentType == "AiEmotion" && emotionTirstFlag) { |
|
|
|
|
|
isCollapsed.value = !chatStore.aiEmotionCall; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 非首次调用时保持当前折叠状态不变 |
|
|
|
|
|
|
|
|
// 1. 筛选置顶记录 |
|
|
// 1. 筛选置顶记录 |
|
|
let topList = remainingRecords.filter((record) => record.isTop === 1); |
|
|
let topList = remainingRecords.filter((record) => record.isTop === 1); |
|
@ -428,12 +512,12 @@ const getHistoryList = async (params) => { |
|
|
// 2. 筛选今日记录 |
|
|
// 2. 筛选今日记录 |
|
|
let todayList = remainingRecords.filter((record) => { |
|
|
let todayList = remainingRecords.filter((record) => { |
|
|
const today = moment().format("YYYY-MM-DD"); |
|
|
const today = moment().format("YYYY-MM-DD"); |
|
|
const recordDate = moment(record.updatedTime).format("YYYY-MM-DD"); |
|
|
|
|
|
|
|
|
const recordDate = moment(record.createdTime).format("YYYY-MM-DD"); |
|
|
return recordDate === today; |
|
|
return recordDate === today; |
|
|
}); |
|
|
}); |
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
const today = moment().format("YYYY-MM-DD"); |
|
|
const today = moment().format("YYYY-MM-DD"); |
|
|
const recordDate = moment(record.updatedTime).format("YYYY-MM-DD"); |
|
|
|
|
|
|
|
|
const recordDate = moment(record.createdTime).format("YYYY-MM-DD"); |
|
|
return recordDate !== today; |
|
|
return recordDate !== today; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -441,13 +525,13 @@ const getHistoryList = async (params) => { |
|
|
let recent3DaysList = remainingRecords.filter((record) => { |
|
|
let recent3DaysList = remainingRecords.filter((record) => { |
|
|
const threeDaysAgo = moment().subtract(3, "days").startOf("day"); |
|
|
const threeDaysAgo = moment().subtract(3, "days").startOf("day"); |
|
|
const yesterday = moment().subtract(1, "days").endOf("day"); |
|
|
const yesterday = moment().subtract(1, "days").endOf("day"); |
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
|
|
|
|
|
const recordDate = moment(record.createdTime); |
|
|
return recordDate.isAfter(threeDaysAgo) && recordDate.isBefore(yesterday); |
|
|
return recordDate.isAfter(threeDaysAgo) && recordDate.isBefore(yesterday); |
|
|
}); |
|
|
}); |
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
const threeDaysAgo = moment().subtract(3, "days").startOf("day"); |
|
|
const threeDaysAgo = moment().subtract(3, "days").startOf("day"); |
|
|
const yesterday = moment().subtract(1, "days").endOf("day"); |
|
|
const yesterday = moment().subtract(1, "days").endOf("day"); |
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
|
|
|
|
|
const recordDate = moment(record.createdTime); |
|
|
return !( |
|
|
return !( |
|
|
recordDate.isAfter(threeDaysAgo) && recordDate.isBefore(yesterday) |
|
|
recordDate.isAfter(threeDaysAgo) && recordDate.isBefore(yesterday) |
|
|
); |
|
|
); |
|
@ -456,28 +540,28 @@ const getHistoryList = async (params) => { |
|
|
// 4. 筛选近7日记录(不包括今日和近3日) |
|
|
// 4. 筛选近7日记录(不包括今日和近3日) |
|
|
let recent7DaysList = remainingRecords.filter((record) => { |
|
|
let recent7DaysList = remainingRecords.filter((record) => { |
|
|
const sevenDaysAgo = moment().subtract(7, "days").startOf("day"); |
|
|
const sevenDaysAgo = moment().subtract(7, "days").startOf("day"); |
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
|
|
|
|
|
const recordDate = moment(record.createdTime); |
|
|
return recordDate.isAfter(sevenDaysAgo); |
|
|
return recordDate.isAfter(sevenDaysAgo); |
|
|
}); |
|
|
}); |
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
const sevenDaysAgo = moment().subtract(7, "days").startOf("day"); |
|
|
const sevenDaysAgo = moment().subtract(7, "days").startOf("day"); |
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
|
|
|
|
|
const recordDate = moment(record.createdTime); |
|
|
return !recordDate.isAfter(sevenDaysAgo); |
|
|
return !recordDate.isAfter(sevenDaysAgo); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 5. 筛选近30日记录(不包括前面已筛选的) |
|
|
// 5. 筛选近30日记录(不包括前面已筛选的) |
|
|
let recent30DaysList = remainingRecords.filter((record) => { |
|
|
let recent30DaysList = remainingRecords.filter((record) => { |
|
|
const thirtyDaysAgo = moment().subtract(30, "days").startOf("day"); |
|
|
const thirtyDaysAgo = moment().subtract(30, "days").startOf("day"); |
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
|
|
|
|
|
const recordDate = moment(record.createdTime); |
|
|
return recordDate.isAfter(thirtyDaysAgo); |
|
|
return recordDate.isAfter(thirtyDaysAgo); |
|
|
}); |
|
|
}); |
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
remainingRecords = remainingRecords.filter((record) => { |
|
|
const thirtyDaysAgo = moment().subtract(30, "days").startOf("day"); |
|
|
const thirtyDaysAgo = moment().subtract(30, "days").startOf("day"); |
|
|
const recordDate = moment(record.updatedTime); |
|
|
|
|
|
|
|
|
const recordDate = moment(record.createdTime); |
|
|
return !recordDate.isAfter(thirtyDaysAgo); |
|
|
return !recordDate.isAfter(thirtyDaysAgo); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
historyRecords.value = result.data.list; |
|
|
|
|
|
|
|
|
historyRecords.value = result.data; |
|
|
|
|
|
|
|
|
categoryHistory.value = [ |
|
|
categoryHistory.value = [ |
|
|
{ |
|
|
{ |
|
@ -501,10 +585,13 @@ const getHistoryList = async (params) => { |
|
|
list: recent30DaysList, |
|
|
list: recent30DaysList, |
|
|
}, |
|
|
}, |
|
|
]; |
|
|
]; |
|
|
console.log("historyRecords", historyRecords.value); |
|
|
|
|
|
console.log("categoryHistory", categoryHistory.value); |
|
|
|
|
|
|
|
|
// console.log("historyRecords", historyRecords.value); |
|
|
|
|
|
// console.log("categoryHistory", categoryHistory.value); |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
console.error("获取历史记录出错", e); |
|
|
console.error("获取历史记录出错", e); |
|
|
|
|
|
// 确保在出错时historyRecords和categoryHistory仍然是数组 |
|
|
|
|
|
historyRecords.value = []; |
|
|
|
|
|
categoryHistory.value = []; |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -518,11 +605,18 @@ const changeTop = async (param) => { |
|
|
|
|
|
|
|
|
const changeTopStatus = async (isTop, id) => { |
|
|
const changeTopStatus = async (isTop, id) => { |
|
|
try { |
|
|
try { |
|
|
|
|
|
// 立即关闭popover,避免闪现 |
|
|
|
|
|
const popoverElement = document.querySelector(".el-popover"); |
|
|
|
|
|
if (popoverElement) { |
|
|
|
|
|
popoverElement.style.display = "none"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (isTop == 0 && categoryHistory.value[0].list.length >= 3) { |
|
|
if (isTop == 0 && categoryHistory.value[0].list.length >= 3) { |
|
|
console.log("超过置顶上线"); |
|
|
console.log("超过置顶上线"); |
|
|
ElMessage.warning("最多置顶三条内容,已达上限!"); |
|
|
ElMessage.warning("最多置顶三条内容,已达上限!"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
await changeTop({ |
|
|
await changeTop({ |
|
|
model: props.currentType == "AIchat" ? 1 : 2, |
|
|
model: props.currentType == "AIchat" ? 1 : 2, |
|
|
recordId: id, |
|
|
recordId: id, |
|
@ -554,18 +648,29 @@ const openHistory = () => { |
|
|
// token: localStorage.getItem("localToken"), |
|
|
// token: localStorage.getItem("localToken"), |
|
|
// }); |
|
|
// }); |
|
|
isCollapsed.value = false; |
|
|
isCollapsed.value = false; |
|
|
|
|
|
if (props.currentType == "AIchat") { |
|
|
|
|
|
chatStore.aiChatCall = true; |
|
|
|
|
|
} else if (props.currentType == "AiEmotion") { |
|
|
|
|
|
chatStore.aiEmotionCall = true; |
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const closeHistory = () => { |
|
|
const closeHistory = () => { |
|
|
isCollapsed.value = true; |
|
|
isCollapsed.value = true; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const openDetail = (record) => { |
|
|
|
|
|
console.log("record", record); |
|
|
|
|
|
|
|
|
if (props.currentType == "AIchat") { |
|
|
|
|
|
chatStore.aiChatCall = false; |
|
|
|
|
|
} else if (props.currentType == "AiEmotion") { |
|
|
|
|
|
chatStore.aiEmotionCall = false; |
|
|
|
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const historyData = ref({}); |
|
|
const historyData = ref({}); |
|
|
const selectRecord = async (record) => { |
|
|
const selectRecord = async (record) => { |
|
|
|
|
|
if (props.currentType == "AIchat" && chatStore.firstAPICall) { |
|
|
|
|
|
ElMessage.warning("正在获取回复中,请稍后"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
selectedRecordId.value = record.id; |
|
|
selectedRecordId.value = record.id; |
|
|
const result = await clickRecordAPI({ |
|
|
const result = await clickRecordAPI({ |
|
@ -575,26 +680,35 @@ const selectRecord = async (record) => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (result && result.data) { |
|
|
if (result && result.data) { |
|
|
|
|
|
if (props.isMobile) { |
|
|
|
|
|
// 如果手机,收起历史记录 |
|
|
|
|
|
isCollapsed.value = true; |
|
|
|
|
|
if (props.currentType == "AIchat") { |
|
|
|
|
|
chatStore.aiChatCall = false; |
|
|
|
|
|
} else if (props.currentType == "AiEmotion") { |
|
|
|
|
|
chatStore.aiEmotionCall = false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
historyData.value = result.data; |
|
|
historyData.value = result.data; |
|
|
chatStore.dbqbClickRecord = historyData.value; |
|
|
chatStore.dbqbClickRecord = historyData.value; |
|
|
// 构造股票数据对象,保持与现有结构一致 |
|
|
// 构造股票数据对象,保持与现有结构一致 |
|
|
const stockData = { |
|
|
const stockData = { |
|
|
queryText: record.stockCode || record.stockName || '', // 使用记录中的股票代码或名称作为查询文本 |
|
|
|
|
|
|
|
|
queryText: result.data.keyword, // 使用记录中的keyword字段作为查询文本 |
|
|
stockInfo: { |
|
|
stockInfo: { |
|
|
name: result.data.stockData?.stockName || record.stockName || '', |
|
|
|
|
|
code: record.stockCode || '', |
|
|
|
|
|
market: record.stockMarket || 'cn' |
|
|
|
|
|
|
|
|
name: result.data.stockData?.stockName || record.stockName || "", |
|
|
|
|
|
code: record.stockCode || "", |
|
|
|
|
|
market: record.stockMarket || "cn", |
|
|
}, |
|
|
}, |
|
|
apiData: result.data.stockData || {}, // 图表数据 |
|
|
apiData: result.data.stockData || {}, // 图表数据 |
|
|
conclusionData: result.data.wokeFlowData?.One || {}, // 场景应用的结论和音频 |
|
|
conclusionData: result.data.wokeFlowData?.One || {}, // 场景应用的结论和音频 |
|
|
timestamp: new Date().toISOString() |
|
|
|
|
|
|
|
|
timestamp: record.createdTime || new Date().toISOString(), // 使用历史记录的createdTime字段 |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 通过emit将数据传递给父组件 |
|
|
// 通过emit将数据传递给父组件 |
|
|
emit('selectRecord', stockData); |
|
|
|
|
|
console.log('历史记录数据已发送给父组件:', stockData); |
|
|
|
|
|
|
|
|
emit("selectRecord", stockData); |
|
|
|
|
|
console.log("历史记录数据已发送给父组件:", stockData); |
|
|
} else { |
|
|
} else { |
|
|
console.error('历史记录数据格式不正确:', result); |
|
|
|
|
|
|
|
|
console.error("历史记录数据格式不正确:", result); |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
console.error("获取历史记录数据失败", e); |
|
|
console.error("获取历史记录数据失败", e); |
|
@ -603,6 +717,16 @@ const selectRecord = async (record) => { |
|
|
|
|
|
|
|
|
const deleteRecord = (id) => { |
|
|
const deleteRecord = (id) => { |
|
|
delObj.value.id = id; |
|
|
delObj.value.id = id; |
|
|
|
|
|
// 立即关闭popover,避免闪现 |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
// 尝试多种方式关闭popover |
|
|
|
|
|
const popoverElement = document.querySelector(".el-popover"); |
|
|
|
|
|
if (popoverElement) { |
|
|
|
|
|
popoverElement.style.display = "none"; |
|
|
|
|
|
} |
|
|
|
|
|
// 触发body点击事件来关闭popover |
|
|
|
|
|
document.body.click(); |
|
|
|
|
|
}); |
|
|
openDeleteDialog(); |
|
|
openDeleteDialog(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -625,11 +749,19 @@ const deleteRecordConfirm = async () => { |
|
|
|
|
|
|
|
|
// 处理公告按钮点击 |
|
|
// 处理公告按钮点击 |
|
|
const handleAnnouncementClick = () => { |
|
|
const handleAnnouncementClick = () => { |
|
|
|
|
|
if (props.currentType == "AIchat" && chatStore.firstAPICall) { |
|
|
|
|
|
ElMessage.warning("正在获取回复中,请稍后"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
emit("showAnnouncement"); |
|
|
emit("showAnnouncement"); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 处理用户反馈按钮点击 |
|
|
// 处理用户反馈按钮点击 |
|
|
const handleFeedbackClick = () => { |
|
|
const handleFeedbackClick = () => { |
|
|
|
|
|
if (props.currentType == "AIchat" && chatStore.firstAPICall) { |
|
|
|
|
|
ElMessage.warning("正在获取回复中,请稍后"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
emit("showFeedback"); |
|
|
emit("showFeedback"); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -651,6 +783,7 @@ defineExpose({ |
|
|
isCollapsed, |
|
|
isCollapsed, |
|
|
toggleCollapse, |
|
|
toggleCollapse, |
|
|
getHistoryList, |
|
|
getHistoryList, |
|
|
|
|
|
selectedRecordId, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 生命周期 |
|
|
// 生命周期 |
|
@ -702,6 +835,7 @@ onMounted(() => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.mobileCollapsed { |
|
|
.mobileCollapsed { |
|
|
|
|
|
/* max-width: 400px */ |
|
|
width: 80vw; |
|
|
width: 80vw; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -814,6 +948,7 @@ onMounted(() => { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
/* padding: 20px; */ |
|
|
/* padding: 20px; */ |
|
|
overflow: hidden; |
|
|
overflow: hidden; |
|
|
|
|
|
min-height: 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.head-container { |
|
|
.head-container { |
|
@ -909,6 +1044,10 @@ onMounted(() => { |
|
|
background: rgba(255, 255, 255, 0.1); |
|
|
background: rgba(255, 255, 255, 0.1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.history-item.active { |
|
|
|
|
|
background: rgba(255, 255, 255, 0.5); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.record-content { |
|
|
.record-content { |
|
|
display: flex; |
|
|
display: flex; |
|
|
width: 100%; |
|
|
width: 100%; |
|
@ -932,9 +1071,27 @@ onMounted(() => { |
|
|
margin-bottom: 6px; |
|
|
margin-bottom: 6px; |
|
|
overflow: hidden; |
|
|
overflow: hidden; |
|
|
text-overflow: ellipsis; |
|
|
text-overflow: ellipsis; |
|
|
display: -webkit-box; |
|
|
|
|
|
-webkit-line-clamp: 2; |
|
|
-webkit-line-clamp: 2; |
|
|
-webkit-box-orient: vertical; |
|
|
-webkit-box-orient: vertical; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.top-icon { |
|
|
|
|
|
margin-left: 5px; |
|
|
|
|
|
color: white; |
|
|
|
|
|
height: auto; |
|
|
|
|
|
width: 15px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.stock-name { |
|
|
|
|
|
font-weight: 500; |
|
|
|
|
|
margin-right: 4px; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.stock-code { |
|
|
|
|
|
color: rgba(255, 255, 255, 0.7); |
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
font-weight: 400; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.record-time { |
|
|
.record-time { |
|
|