|
@@ -12,7 +12,6 @@ const ANSWER_ID_KEY = '@@id@@';
|
|
|
|
|
|
let controller = new AbortController();
|
|
|
|
|
|
-// TODO: 如果这里的key不一样,将会在拆一层组件出来 - list
|
|
|
const { recordList, isFetching, onScrolltolower, onReset, addHistoryRecord } = useInfinite('/front/bigModel/qa/pageList', { module: 2 });
|
|
|
const { scrollRef, scrollToBottom, scrollToBottomIfAtBottom } = useScroll();
|
|
|
const { chatDataSource, addChat, updateChat, clearChat, updateById } = useChat();
|
|
@@ -24,6 +23,7 @@ const switchActive = ref(false);
|
|
|
|
|
|
const isLoading = ref(false);
|
|
|
const inputRef = ref(null);
|
|
|
+const recordActive = ref(null);
|
|
|
|
|
|
const currenSessionId = ref(null);
|
|
|
|
|
@@ -43,6 +43,8 @@ const handleCreateDialog = async () => {
|
|
|
|
|
|
inputRef.value.clearInpVal();
|
|
|
|
|
|
+ recordActive.value = null;
|
|
|
+
|
|
|
currenSessionId.value = null;
|
|
|
|
|
|
clearChat();
|
|
@@ -52,6 +54,10 @@ const handleCreateDialog = async () => {
|
|
|
const handleChatDetail = async ({ sessionId }) => {
|
|
|
isLoading.value = false;
|
|
|
|
|
|
+ recordActive.value = sessionId;
|
|
|
+
|
|
|
+ inputRef.value.clearInpVal();
|
|
|
+
|
|
|
controller.abort();
|
|
|
|
|
|
const { data } = await chatApi.getAnswerHistoryDetail({ sessionId });
|
|
@@ -59,6 +65,8 @@ const handleChatDetail = async ({ sessionId }) => {
|
|
|
chatDataSource.value = data.map(item => ({ ...item, loading: false, }));
|
|
|
currenSessionId.value = sessionId;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
scrollToBottom();
|
|
|
}
|
|
|
|
|
@@ -143,7 +151,9 @@ const handleSubmit = async (question, realQuestion = '') => {
|
|
|
|
|
|
// 处理推荐问题
|
|
|
const handleWelcomeRecommend = ({ content }) => {
|
|
|
+ console.log( inputRef.value )
|
|
|
inputRef.value.inpVal = content;
|
|
|
+ inputRef.value.handleInpFocus();
|
|
|
}
|
|
|
|
|
|
// 删除历史对话
|
|
@@ -179,6 +189,7 @@ onUnmounted(() => {
|
|
|
:title="item.showVal"
|
|
|
:time="item.createTime"
|
|
|
:data-item="item"
|
|
|
+ :class="{'recode-card-item_active': recordActive === item.sessionId}"
|
|
|
@on-click="handleChatDetail"
|
|
|
@on-delete="handeChatDelete"
|
|
|
/>
|
|
@@ -202,7 +213,8 @@ onUnmounted(() => {
|
|
|
@click="handleWelcomeRecommend(item)"
|
|
|
>
|
|
|
<div class="grid-item-icon space-x-[8px]">
|
|
|
- <SvgIcon name="tool-report" size="24"></SvgIcon>
|
|
|
+ <img :src="item.banner" alt="" class="w-[24px]">
|
|
|
+ <!-- <SvgIcon name="tool-report" size="24"></SvgIcon> -->
|
|
|
<h3 class="grid-item-title">{{item.title}}</h3>
|
|
|
</div>
|
|
|
<div class="text-[#5E5E5E] mt-[8px] text-justify">
|
|
@@ -250,7 +262,6 @@ onUnmounted(() => {
|
|
|
<style scoped lang="scss">
|
|
|
.grid-container{
|
|
|
position: relative;
|
|
|
- // height: calc(100vh - 460px);
|
|
|
padding-bottom: 20px;
|
|
|
margin-top: 36px;
|
|
|
overflow: hidden;
|
|
@@ -273,7 +284,6 @@ onUnmounted(() => {
|
|
|
padding: 16px;
|
|
|
margin-bottom: 16px;
|
|
|
border-radius: 10px;
|
|
|
- box-shadow: 0 2px 4px rgba(0,0,0,0.08);
|
|
|
background-color: #fff;
|
|
|
-webkit-column-break-inside: avoid;
|
|
|
break-inside: avoid;
|
|
@@ -282,6 +292,7 @@ onUnmounted(() => {
|
|
|
|
|
|
&:hover {
|
|
|
border:1px solid #2454FF;
|
|
|
+ box-shadow: 0 2px 4px rgba(0,0,0,0.08);
|
|
|
}
|
|
|
|
|
|
.grid-item-icon{
|