123
This commit is contained in:
parent
2714be0bf7
commit
e7f95921d7
@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>title</title>
|
<title>洛阳弘义智慧城市建设服务有限公司</title>
|
||||||
<meta name="keywords" content="title" />
|
<meta name="keywords" content="title" />
|
||||||
<meta name="description" content="title" />
|
<meta name="description" content="title" />
|
||||||
<style>
|
<style>
|
||||||
|
@ -97,6 +97,12 @@
|
|||||||
<div class="ds-markdown ds-markdown--block" style="--ds-md-zoom: 1.143;">
|
<div class="ds-markdown ds-markdown--block" style="--ds-md-zoom: 1.143;">
|
||||||
<div v-html="item.content"></div>
|
<div v-html="item.content"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="item.emptyShow">
|
||||||
|
<div class="a6d716f5 db5991dd">
|
||||||
|
<div class="ds-icon acbf4957" style="font-size: 12px; width: 12px; height: 12px;"><svg t="1741138938671" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2618" width="200" height="200"><path d="M512 29.538462a482.461538 482.461538 0 1 0 482.461538 482.461538A482.461538 482.461538 0 0 0 512 29.538462z m55.138462 206.178461l-15.753847 354.461539h-78.76923l-15.753847-354.461539zM512 788.283077a68.923077 68.923077 0 1 1 68.923077-68.923077 68.923077 68.923077 0 0 1-68.923077 68.923077z" p-id="2619"></path></svg>
|
||||||
|
</div>系统访问超时,请稍候重试...
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="ds-flex" style="margin-top: 12px; height: 20px; align-items: center; gap: 12px;">
|
<div class="ds-flex" style="margin-top: 12px; height: 20px; align-items: center; gap: 12px;">
|
||||||
<div class="ds-flex abe97156" style="align-items: center; gap: 12px;">
|
<div class="ds-flex abe97156" style="align-items: center; gap: 12px;">
|
||||||
<div class="ds-icon-button" tabindex="0"
|
<div class="ds-icon-button" tabindex="0"
|
||||||
@ -159,7 +165,7 @@
|
|||||||
<div class="cefa5c26">
|
<div class="cefa5c26">
|
||||||
<div class="dd442025 b699646e" @click="focusTextarea">
|
<div class="dd442025 b699646e" @click="focusTextarea">
|
||||||
<div class="fad49dec">
|
<div class="fad49dec">
|
||||||
<textarea v-model="message" id="chat-input" class="c92459f0" placeholder="给 DeepSeek 发送消息 "
|
<textarea v-model="message" id="chat-input" class="c92459f0" placeholder="给 DeepSeek 发送消息 "
|
||||||
rows="2" @keyup.enter.prevent="handleEnterPress" ref="textareaRef"
|
rows="2" @keyup.enter.prevent="handleEnterPress" ref="textareaRef"
|
||||||
maxlength="200"></textarea>
|
maxlength="200"></textarea>
|
||||||
<div class="b13855df">
|
<div class="b13855df">
|
||||||
@ -275,19 +281,19 @@ const handleScroll = (event: WheelEvent) => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
Nevkey.value = Date.now().toString();
|
Nevkey.value = Date.now().toString();
|
||||||
})
|
})
|
||||||
|
//查询超时次数
|
||||||
|
const emptyCount = ref(0);
|
||||||
|
|
||||||
//提问回答列表
|
//提问回答列表
|
||||||
const getQuestionList = () => {
|
const getQuestionList = () => {
|
||||||
|
|
||||||
if (storp.value == true) {
|
if (storp.value == true) {
|
||||||
storp.value = false;
|
storp.value = false;
|
||||||
chatHdEnd.value = true;
|
chatHdEnd.value = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const index = paramMsg.value.length - 1;
|
const index = paramMsg.value.length - 1;
|
||||||
|
|
||||||
if (paramMsg.value[index].role != 'assistant') {
|
if (paramMsg.value[index].role != 'assistant') {
|
||||||
paramMsg.value.push({ role: 'assistant', sk: '', content: '', skLong: false, msgCode: 1 });
|
paramMsg.value.push({ role: 'assistant', sk: '', content: '', skLong: false, msgCode: 1,emptyShow:false });
|
||||||
}
|
}
|
||||||
if (paramMsg.value[index].msgCode == 0) {
|
if (paramMsg.value[index].msgCode == 0) {
|
||||||
storp.value = false;
|
storp.value = false;
|
||||||
@ -296,6 +302,28 @@ const getQuestionList = () => {
|
|||||||
}
|
}
|
||||||
getQuestion({ 'key': Nevkey.value, 'page': page.page, 'limit': page.limit }).then(res => {
|
getQuestion({ 'key': Nevkey.value, 'page': page.page, 'limit': page.limit }).then(res => {
|
||||||
if (res.code == 1) {
|
if (res.code == 1) {
|
||||||
|
// 检查是否为空数组
|
||||||
|
if (res.data.list.length === 0) {
|
||||||
|
emptyCount.value++;
|
||||||
|
|
||||||
|
// 如果空数组计数达到30次,结束递归
|
||||||
|
if (emptyCount.value >= 100) {
|
||||||
|
const lIndex = paramMsg.value.length - 1;
|
||||||
|
paramMsg.value[lIndex].content = marked(paramMsg.value[lIndex].content);
|
||||||
|
paramMsg.value[lIndex].skLong = false;
|
||||||
|
chatHdEnd.value = true;
|
||||||
|
paramMsg.value[lIndex].emptyShow = true;
|
||||||
|
// 重置计数器
|
||||||
|
emptyCount.value = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 继续轮询
|
||||||
|
getQuestionList();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 如果收到非空数据,重置计数器
|
||||||
|
emptyCount.value = 0;
|
||||||
|
// ... 原有的数据处理逻辑 ...
|
||||||
for (let i = 0; i < res.data.list.length; i++) {
|
for (let i = 0; i < res.data.list.length; i++) {
|
||||||
const item = res.data.list[i];
|
const item = res.data.list[i];
|
||||||
if (!processedIds.value.has(item.id)) {
|
if (!processedIds.value.has(item.id)) {
|
||||||
@ -305,7 +333,6 @@ const getQuestionList = () => {
|
|||||||
paramMsg.value[lastIndex].skLong = true;
|
paramMsg.value[lastIndex].skLong = true;
|
||||||
paramMsg.value[lastIndex].sk += item.content;
|
paramMsg.value[lastIndex].sk += item.content;
|
||||||
} else {
|
} else {
|
||||||
//paramMsg.value[lastIndex].sk = '';
|
|
||||||
paramMsg.value[lastIndex].skLong = false;
|
paramMsg.value[lastIndex].skLong = false;
|
||||||
paramMsg.value[lastIndex].content += item.content;
|
paramMsg.value[lastIndex].content += item.content;
|
||||||
}
|
}
|
||||||
@ -317,8 +344,9 @@ const getQuestionList = () => {
|
|||||||
chatHdEnd.value = true;
|
chatHdEnd.value = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
scrollToBottom(); // 每次添加新消息后滚动
|
scrollToBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res.data.list.length == page.limit) {
|
if (res.data.list.length == page.limit) {
|
||||||
page.page++;
|
page.page++;
|
||||||
getQuestionList();
|
getQuestionList();
|
||||||
@ -604,5 +632,6 @@ pre[class*=language-] {
|
|||||||
.support-units a {
|
.support-units a {
|
||||||
color: #1A9BFF;
|
color: #1A9BFF;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
line-height: 25px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -89,6 +89,7 @@ const startChat = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.company-title {
|
.company-title {
|
||||||
|
line-height: 40px;
|
||||||
font-size: 60px;
|
font-size: 60px;
|
||||||
color: #4D6BFE;
|
color: #4D6BFE;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user