Browse Source

Merge branch 'milestone-20250710-上线前优化' of http://39.101.133.168:8807/hongxilin/AIxiaocaishen into milestone-20250710-上线前优化

dev
宋杰 2 days ago
parent
commit
55ada1f88c
  1. 181
      src/views/AIchat.vue
  2. 151
      src/views/components/HistoryRecord.vue
  3. 16
      src/views/homePage.vue

181
src/views/AIchat.vue

@ -149,7 +149,7 @@ const playNextAudio = () => {
setTimeout(() => { setTimeout(() => {
isCallingPlayNext = false; isCallingPlayNext = false;
playNextAudio(); playNextAudio();
}, 500);
}, 200);
} else { } else {
console.log("🎉 所有音频播放完成,清除音频实例"); console.log("🎉 所有音频播放完成,清除音频实例");
chatStore.messages[chatStore.currentUserIndex].audioStatus = false; chatStore.messages[chatStore.currentUserIndex].audioStatus = false;
@ -752,7 +752,6 @@ const createTypingEffect = (message, content, speed) => {
if (message.end) { if (message.end) {
chatStore.getUserCount(); chatStore.getUserCount();
chatStore.isLoading = false; chatStore.isLoading = false;
chatStore.searchRecord = true;
console.log("打印完毕,接触输入框禁用状态"); console.log("打印完毕,接触输入框禁用状态");
emit("enableInput"); emit("enableInput");
} }
@ -1102,6 +1101,8 @@ watch(
console.log(codeData.value, "codeData"); console.log(codeData.value, "codeData");
// //
if (result.code == 200) { if (result.code == 200) {
//
chatStore.searchRecord = true;
// //
if (thinkingMessageRef && codeData.value.name) { if (thinkingMessageRef && codeData.value.name) {
await continueThinkingProcess( await continueThinkingProcess(
@ -2418,6 +2419,12 @@ watch(
return; return;
} }
try { try {
//
emit("enableInput");
//
typingQueue.value = [];
isTypingInProgress.value = false;
// //
chatStore.messages = []; chatStore.messages = [];
@ -3287,10 +3294,10 @@ function KlineCanvsEcharts(containerId) {
{ {
textStyle: { textStyle: {
color: "black", color: "black",
fontSize: window.innerWidth > 768 ? 15 : vwToPx(1.8),
fontSize: window.innerWidth > 768 ? 12 : 9,
}, },
width: "100%", width: "100%",
top: window.innerWidth > 768 ? "0%" : "-1%",
top: window.innerWidth > 768 ? "5%" : "4%",
left: "center", left: "center",
itemGap: window.innerWidth > 768 ? 20 : 10, itemGap: window.innerWidth > 768 ? 20 : 10,
itemWidth: 10, itemWidth: 10,
@ -3325,10 +3332,10 @@ function KlineCanvsEcharts(containerId) {
{ {
textStyle: { textStyle: {
color: "black", color: "black",
fontSize: window.innerWidth > 768 ? 15 : vwToPx(1.8),
fontSize: window.innerWidth > 768 ? 12 : 9,
}, },
orient: "horizontal", orient: "horizontal",
top: window.innerWidth > 768 ? "3%" : "2%",
top: window.innerWidth > 768 ? "8%" : "7%",
width: "100%", width: "100%",
left: "center", left: "center",
itemGap: 15, itemGap: 15,
@ -3340,11 +3347,11 @@ function KlineCanvsEcharts(containerId) {
rich: { rich: {
green: { green: {
color: "green", color: "green",
fontSize: window.innerWidth > 768 ? 20 : 10,
fontSize: window.innerWidth > 768 ? 12 : 9,
}, },
red: { red: {
color: "red", color: "red",
fontSize: window.innerWidth > 768 ? 20 : 10,
fontSize: window.innerWidth > 768 ? 12 : 9,
}, },
}, },
}, },
@ -3360,10 +3367,10 @@ function KlineCanvsEcharts(containerId) {
{ {
textStyle: { textStyle: {
color: "black", color: "black",
fontSize: window.innerWidth > 768 ? 15 : vwToPx(1.8),
fontSize: window.innerWidth > 768 ? 12 : 9,
}, },
orient: "horizontal", orient: "horizontal",
top: window.innerWidth > 768 ? "68%" : "64%",
top: window.innerWidth > 768 ? "62%" : "60%",
width: "100%", width: "100%",
left: "center", left: "center",
itemGap: 15, itemGap: 15,
@ -3375,11 +3382,11 @@ function KlineCanvsEcharts(containerId) {
rich: { rich: {
green: { green: {
color: "green", color: "green",
fontSize: window.innerWidth > 768 ? 20 : 10,
fontSize: window.innerWidth > 768 ? 12 : 9,
}, },
red: { red: {
color: "red", color: "red",
fontSize: window.innerWidth > 768 ? 20 : 10,
fontSize: window.innerWidth > 768 ? 12 : 9,
}, },
}, },
}, },
@ -3466,53 +3473,56 @@ function KlineCanvsEcharts(containerId) {
}, },
grid: [ grid: [
{ {
top: window.innerWidth > 768 ? "12%" : "10%",
left: left:
window.innerWidth > 1024 window.innerWidth > 1024
? "70vw"
? "14%"
: window.innerWidth > 768 : window.innerWidth > 768
? "65vw"
: "55vw",
? "18%"
: "20%",
right: right:
window.innerWidth > 1024 window.innerWidth > 1024
? "40vw"
? "9%"
: window.innerWidth > 768 : window.innerWidth > 768
? "30vw"
: "40vw",
top: window.innerWidth > 768 ? "8%" : "5%",
height: window.innerWidth > 768 ? "34%" : "34%",
? "12%"
: "14%",
height: window.innerWidth > 768 ? "27%" : "29%",
containLabel: false, containLabel: false,
}, },
{ {
top: window.innerWidth > 768 ? "42%" : "42%",
left: left:
window.innerWidth > 1024 window.innerWidth > 1024
? "70vw"
? "14%"
: window.innerWidth > 768 : window.innerWidth > 768
? "65vw"
: "55vw",
? "18%"
: "20%",
right: right:
window.innerWidth > 1024 window.innerWidth > 1024
? "40vw"
? "9%"
: window.innerWidth > 768 : window.innerWidth > 768
? "30vw"
: "40vw",
top: window.innerWidth > 768 ? "45%" : "42%",
height: window.innerWidth > 768 ? "22%" : "22%",
? "12%"
: "14%",
height: window.innerWidth > 768 ? "20%" : "18%",
containLabel: false, containLabel: false,
}, },
{ {
top: window.innerWidth > 768 ? "66%" : "64%",
left: left:
window.innerWidth > 1024 window.innerWidth > 1024
? "70vw"
? "14%"
: window.innerWidth > 768 : window.innerWidth > 768
? "65vw"
: "55vw",
? "18%"
: "20%",
right: right:
window.innerWidth > 1024 window.innerWidth > 1024
? "40vw"
? "9%"
: window.innerWidth > 768 : window.innerWidth > 768
? "30vw"
: "40vw",
top: window.innerWidth > 768 ? "73%" : "70%",
? "12%"
: "14%",
height: window.innerWidth > 768 ? "20%" : "22%", height: window.innerWidth > 768 ? "20%" : "22%",
containLabel: false, containLabel: false,
}, },
@ -3557,6 +3567,7 @@ function KlineCanvsEcharts(containerId) {
axisLabel: { axisLabel: {
show: true, show: true,
interval: "auto", interval: "auto",
fontSize: window.innerWidth > 768 ? 12 : 9,
}, },
}, },
], ],
@ -3653,11 +3664,15 @@ function KlineCanvsEcharts(containerId) {
show: true, show: true,
xAxisIndex: [0, 1, 2], xAxisIndex: [0, 1, 2],
type: "slider", type: "slider",
top: window.innerWidth > 768 ? "95%" : "96%",
top: window.innerWidth > 768 ? "90%" : "91%",
// left: window.innerWidth > 768 ? "10%" : "8%", // left: window.innerWidth > 768 ? "10%" : "8%",
// right: window.innerWidth > 768 ? "4%" : "8%", // right: window.innerWidth > 768 ? "4%" : "8%",
height: 20,
start: 98, start: 98,
end: 100, end: 100,
textStyle: {
fontSize: window.innerWidth > 768 ? 12 : 9,
},
}, },
], ],
visualMap: [ visualMap: [
@ -4093,6 +4108,11 @@ function KlineCanvsEcharts(containerId) {
type: "solid", type: "solid",
}, },
data: [{ yAxis: 20 }], data: [{ yAxis: 20 }],
label: {
normal: {
fontSize: window.innerWidth > 768 ? 12 : 9,
},
},
}, },
}, },
{ {
@ -4110,6 +4130,11 @@ function KlineCanvsEcharts(containerId) {
type: "solid", type: "solid",
}, },
data: [{ yAxis: 50 }], data: [{ yAxis: 50 }],
label: {
normal: {
fontSize: window.innerWidth > 768 ? 12 : 9,
},
},
}, },
}, },
{ {
@ -4127,6 +4152,11 @@ function KlineCanvsEcharts(containerId) {
type: "solid", type: "solid",
}, },
data: [{ yAxis: 80 }], data: [{ yAxis: 80 }],
label: {
normal: {
fontSize: window.innerWidth > 768 ? 12 : 9,
},
},
}, },
}, },
{ {
@ -4145,6 +4175,11 @@ function KlineCanvsEcharts(containerId) {
type: "solid", type: "solid",
}, },
data: [{ yAxis: 100 }], data: [{ yAxis: 100 }],
label: {
normal: {
fontSize: window.innerWidth > 768 ? 12 : 9,
},
},
}, },
}, },
], ],
@ -4377,23 +4412,30 @@ onUnmounted(() => {
<div v-for="(msg, index) in chatMsg" :key="index"> <div v-for="(msg, index) in chatMsg" :key="index">
<!-- 用户消息容器包含喇叭按钮 --> <!-- 用户消息容器包含喇叭按钮 -->
<div v-if="msg.sender === 'user'" class="user-message-container"> <div v-if="msg.sender === 'user'" class="user-message-container">
<img
:src="msg.audioStatus ? voice : voiceNoActive"
class="user-message-speaker"
:class="{
'speaker-active': msg.audioStatus,
}"
@click="toggleVoiceForUser(index)"
alt="喇叭"
/>
<div
:class="{
'message-bubble': true,
[msg.sender]: msg.sender,
[msg.class]: msg.class,
}"
>
<div v-html="msg.content"></div>
<div class="user-msg">
<div class="user-content">
<img
:src="msg.audioStatus ? voice : voiceNoActive"
class="user-message-speaker"
:class="{
'speaker-active': msg.audioStatus,
}"
@click="toggleVoiceForUser(index)"
alt="喇叭"
/>
<div
:class="{
'message-bubble': true,
[msg.sender]: msg.sender,
[msg.class]: msg.class,
}"
>
<div v-html="msg.content"></div>
</div>
</div>
<div class="user-sendTime">
{{moment(msg.timestamp).format("YYYY-MM-DD HH:mm:ss")}}
</div>
</div> </div>
</div> </div>
@ -4466,7 +4508,7 @@ onUnmounted(() => {
</div> </div>
<div v-else-if="msg.type == 'content2'" class="content2"> <div v-else-if="msg.type == 'content2'" class="content2">
<div class="kline-container content2chart"> <div class="kline-container content2chart">
<div :id="'kline-container-' + index" class="chart-mount-point">
<div :id="'kline-container-' + index" class="chart-mount-pointJN">
<div v-if="!msg.hasValidData" class="no-data-message"> <div v-if="!msg.hasValidData" class="no-data-message">
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
@ -4678,18 +4720,37 @@ p {
/* 用户消息容器样式 */ /* 用户消息容器样式 */
.user-message-container { .user-message-container {
display: flex; display: flex;
align-items: flex-start;
/* align-items: flex-start; */
margin: 10px 0px; margin: 10px 0px;
justify-content: flex-end; justify-content: flex-end;
gap: 10px; gap: 10px;
/* align-items: center; */
flex-direction: column;
}
.user-msg {
margin-left: auto;
}
.user-content {
display: flex;
height: 100%;
align-items: center; align-items: center;
margin-right: 5px;
}
.user-sendTime{
width: 100%;
text-align: center;
color: rgba(255, 255, 255, 0.6);
font-size: 0.8rem;
} }
.user-message-speaker { .user-message-speaker {
width: 32px; width: 32px;
height: 32px; height: 32px;
object-fit: contain; object-fit: contain;
margin-top: 5px;
margin-right: 5px;
cursor: pointer; cursor: pointer;
transition: all 0.3s ease; transition: all 0.3s ease;
} }
@ -4952,6 +5013,14 @@ p {
width: 90%; width: 90%;
} }
.kline-container .chart-mount-pointJN {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
}
/* AI消息容器样式 */ /* AI消息容器样式 */
.ai-message-container { .ai-message-container {
display: flex; display: flex;

151
src/views/components/HistoryRecord.vue

@ -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>
@ -96,11 +96,27 @@
</div> </div>
<div class="record-msg"> <div class="record-msg">
<div class="record-text"> <div class="record-text">
<span class="stock-name">{{ record.stockName || record.stockCode }}</span>
<span class="stock-name">{{ record.stockName }}</span>
<span class="stock-code">({{ record.stockCode }})</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>
<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>
@ -170,17 +186,17 @@
</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>
@ -242,9 +258,27 @@
/> />
</div> </div>
<div class="record-msg"> <div class="record-msg">
<div class="record-text">{{ record.stockCode }}</div>
<div class="record-text">
{{ record.stockCode }}
<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>
@ -316,27 +350,27 @@
<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>
@ -418,12 +452,24 @@ const closeDeleteDialog = () => {
const historyRecords = ref([]); const historyRecords = ref([]);
const categoryHistory = ref([]); const categoryHistory = ref([]);
let firstFlag = false;
const getHistoryList = async (params) => { const getHistoryList = async (params) => {
try { try {
const result = await getHistoryListAPI(params); const result = await getHistoryListAPI(params);
historyRecords.value = result.data; historyRecords.value = result.data;
let remainingRecords = result.data; // let remainingRecords = result.data; //
console.log("result", result.data, "firstFlag", firstFlag);
if (result.data.length != 0 && !firstFlag) {
const userAgent = navigator.userAgent;
if (
!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
userAgent
)
) {
isCollapsed.value = false;
}
firstFlag = true;
}
// 1. // 1.
let topList = remainingRecords.filter((record) => record.isTop === 1); let topList = remainingRecords.filter((record) => record.isTop === 1);
remainingRecords = remainingRecords.filter((record) => record.isTop !== 1); remainingRecords = remainingRecords.filter((record) => record.isTop !== 1);
@ -431,12 +477,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;
}); });
@ -444,13 +490,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)
); );
@ -459,24 +505,24 @@ const getHistoryList = async (params) => {
// 4. 73 // 4. 73
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);
}); });
@ -585,22 +631,22 @@ const selectRecord = async (record) => {
chatStore.dbqbClickRecord = historyData.value; chatStore.dbqbClickRecord = historyData.value;
// //
const stockData = { const stockData = {
queryText: record.stockCode || record.stockName || '', // 使
queryText: record.stockCode || record.stockName || "", // 使
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: new Date().toISOString(),
}; };
// 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);
@ -657,6 +703,7 @@ defineExpose({
isCollapsed, isCollapsed,
toggleCollapse, toggleCollapse,
getHistoryList, getHistoryList,
selectedRecordId,
}); });
// //
@ -708,6 +755,7 @@ onMounted(() => {
} }
.mobileCollapsed { .mobileCollapsed {
/* max-width: 400px */
width: 80vw; width: 80vw;
} }
@ -915,6 +963,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%;
@ -938,9 +990,16 @@ 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 { .stock-name {

16
src/views/homePage.vue

@ -181,7 +181,7 @@ watch(
() => chatStore.announcementMsg, () => chatStore.announcementMsg,
(newVal) => { (newVal) => {
console.log("监听到公告改变", chatStore.announcementMsg); console.log("监听到公告改变", chatStore.announcementMsg);
if (chatStore.announcementMsg) {
if (chatStore.announcementMsg && !isInputDisabled.value) {
message.value = chatStore.announcementMsg; message.value = chatStore.announcementMsg;
chatStore.announcementMsg = null; chatStore.announcementMsg = null;
} }
@ -192,6 +192,8 @@ watch(
() => dataStore.isFeedback, () => dataStore.isFeedback,
async (newVal) => { async (newVal) => {
if (!dataStore.isFeedback) { if (!dataStore.isFeedback) {
//
isAnnouncementVisible.value = false;
await nextTick(); await nextTick();
// //
throttledHeightListener(); throttledHeightListener();
@ -217,6 +219,10 @@ const sendMessage = async () => {
// //
//
if (historyRecordRef) {
historyRecordRef.value.selectedRecordId = null;
}
// AiEmotion // AiEmotion
if (activeTab.value === "AiEmotion") { if (activeTab.value === "AiEmotion") {
// //
@ -353,7 +359,7 @@ const throttledSmoothScrollToBottom = _.throttle(smoothScrollToBottom, 300, {
}); });
watch( watch(
() => chatStore.messages,
() => chatStore.messages.length,
() => { () => {
// console.log('messages') // console.log('messages')
// AIchat // AIchat
@ -362,7 +368,7 @@ watch(
} }
// setTimeout(throttledSmoothScrollToBottom, 100); // setTimeout(throttledSmoothScrollToBottom, 100);
}, },
{ deep: true, immediate: true }
{ deep: false, immediate: true }
); );
watch( watch(
@ -382,7 +388,7 @@ watch(
console.log("activeTab变化了", activeTab.value); console.log("activeTab变化了", activeTab.value);
if (activeTab.value == "AIchat" || activeTab.value == "AiEmotion") { if (activeTab.value == "AIchat" || activeTab.value == "AiEmotion") {
if (historyRecordRef.value && historyRecordRef.value.getHistoryList) { if (historyRecordRef.value && historyRecordRef.value.getHistoryList) {
historyRecordRef.value.getHistoryList({
const result = historyRecordRef.value.getHistoryList({
model: activeTab.value == "AIchat" ? 1 : 2, model: activeTab.value == "AIchat" ? 1 : 2,
token: localStorage.getItem("localToken"), token: localStorage.getItem("localToken"),
}); });
@ -392,7 +398,7 @@ watch(
if (activeTab.value === "AIchat") { if (activeTab.value === "AIchat") {
isScrolling.value = false; // isScrolling.value = false; //
setTimeout(() => { setTimeout(() => {
throttledSmoothScrollToBottom();
// throttledSmoothScrollToBottom();
}, 100); }, 100);
} }
// AiEmotion // AiEmotion

Loading…
Cancel
Save