|
@@ -520,7 +520,7 @@ const streamToAnswer = () => {
|
|
|
const docsNum = historys.value[historyIndex].currentResponse.docs.length;
|
|
|
historys.value[historyIndex].currentResponse.streamMsg = historys.value[historyIndex].currentResponse.streamMsg.replace(
|
|
|
`[[${num}]]`,
|
|
|
- `<span onclick="window.openDocByIndex(${num}, ${id})" class="poi" style=" cursor: pointer; display: inline-block; width: 20px; height: 20px; font-size: 12px; line-height: 20px; text-align: center; margin: 0 5px; border-radius: 10px;background: #d0d5dd; width: 20px;
|
|
|
+ `<span onclick="window.openDocByIndex(${num}, ${id}, ${historyIndex})" class="poi" style=" cursor: pointer; display: inline-block; width: 20px; height: 20px; font-size: 12px; line-height: 20px; text-align: center; margin: 0 5px; border-radius: 10px;background: #d0d5dd; width: 20px;
|
|
|
height: 20px;
|
|
|
background: #FFFFFF;
|
|
|
border-radius: 4px 4px 4px 4px;
|
|
@@ -821,7 +821,7 @@ const handleKnowledgeResponse = (msg, id) => {
|
|
|
const docsNum = historys.value[historyIndex].currentResponse.docs.length;
|
|
|
historys.value[historyIndex].currentResponse.msg = historys.value[historyIndex].currentResponse.msg.replace(
|
|
|
`[[${num}]]`,
|
|
|
- `<span onclick="window.openDocByIndex(${num}, ${id})" class="poi" style=" cursor: pointer; display: inline-block; width: 20px; height: 20px; font-size: 12px; line-height: 20px; text-align: center; margin: 0 5px; border-radius: 10px;background: #d0d5dd; width: 20px;
|
|
|
+ `<span onclick="window.openDocByIndex(${num}, ${id}, ${historyIndex})" class="poi" style=" cursor: pointer; display: inline-block; width: 20px; height: 20px; font-size: 12px; line-height: 20px; text-align: center; margin: 0 5px; border-radius: 10px;background: #d0d5dd; width: 20px;
|
|
|
height: 20px;
|
|
|
background: #FFFFFF;
|
|
|
border-radius: 4px 4px 4px 4px;
|
|
@@ -847,7 +847,7 @@ const handleKnowledgeResponse = (msg, id) => {
|
|
|
const docsNum = historys.value[historyIndex].currentResponse.docs.length;
|
|
|
historys.value[historyIndex].currentResponse.msg = historys.value[historyIndex].currentResponse.msg.replace(
|
|
|
`[[${num}]]`,
|
|
|
- `<span onclick="window.openDocByIndex(${num}, ${id})" class="poi" style=" cursor: pointer; display: inline-block; width: 20px; height: 20px; font-size: 12px; line-height: 20px; text-align: center; margin: 0 5px; border-radius: 10px;background: #d0d5dd; width: 20px;
|
|
|
+ `<span onclick="window.openDocByIndex(${num}, ${id}, ${historyIndex})" class="poi" style=" cursor: pointer; display: inline-block; width: 20px; height: 20px; font-size: 12px; line-height: 20px; text-align: center; margin: 0 5px; border-radius: 10px;background: #d0d5dd; width: 20px;
|
|
|
height: 20px;
|
|
|
background: #FFFFFF;
|
|
|
border-radius: 4px 4px 4px 4px;
|
|
@@ -915,7 +915,7 @@ const handleNetResponse = (msg, id) => {
|
|
|
}
|
|
|
historys.value[historyIndex].currentResponse.msg = historys.value[historyIndex].currentResponse.msg.replace(
|
|
|
`[[${num}]]`,
|
|
|
- `<span onclick="window.openDocByIndex(${num}, ${id})" class="poi" style=" cursor: pointer; display: inline-block; width: 20px; height: 20px; font-size: 12px; line-height: 20px; text-align: center; margin: 0 5px; border-radius: 10px;background: #d0d5dd">${num}</span>`
|
|
|
+ `<span onclick="window.openDocByIndex(${num}, ${id}, ${historyIndex})" class="poi" style=" cursor: pointer; display: inline-block; width: 20px; height: 20px; font-size: 12px; line-height: 20px; text-align: center; margin: 0 5px; border-radius: 10px;background: #d0d5dd">${num}</span>`
|
|
|
);
|
|
|
|
|
|
num = getNum(historys.value[historyIndex].currentResponse.msg);
|
|
@@ -1010,10 +1010,13 @@ const openUrl = (url) => {
|
|
|
window.open(url, '_blank');
|
|
|
};
|
|
|
|
|
|
-const openDocByIndex = (ind, id) => {
|
|
|
+const openDocByIndex = (ind, id, hIndex = null) => {
|
|
|
+ if (hIndex === null) {
|
|
|
+ hIndex = historyIndex
|
|
|
+ }
|
|
|
showDoc.value = false;
|
|
|
let link = null;
|
|
|
- if (id !== historys.value[historyIndex].currentResponse.id) {
|
|
|
+ if (id !== historys.value[hIndex].currentResponse.id) {
|
|
|
if (questHistories.value[id].docs[ind - 1].type === 'url') {
|
|
|
openUrl(questHistories.value[id].docs[ind - 1].link);
|
|
|
return;
|
|
@@ -1022,14 +1025,14 @@ const openDocByIndex = (ind, id) => {
|
|
|
link = questHistories.value[id].docs[ind - 1].link;
|
|
|
fileType.value = questHistories.value[id].docs[ind - 1].type;
|
|
|
} else {
|
|
|
- if (historys.value[historyIndex].currentResponse.docs[ind - 1].type === 'url') {
|
|
|
- openUrl(historys.value[historyIndex].currentResponse.docs[ind - 1].link);
|
|
|
+ if (historys.value[hIndex].currentResponse.docs[ind - 1].type === 'url') {
|
|
|
+ openUrl(historys.value[hIndex].currentResponse.docs[ind - 1].link);
|
|
|
return;
|
|
|
}
|
|
|
- link = historys.value[historyIndex].currentResponse.docs[ind - 1].link;
|
|
|
- fileType.value = historys.value[historyIndex].currentResponse.docs[ind - 1].type;
|
|
|
- pdfContent.value = historys.value[historyIndex].currentResponse.docs[ind - 1].content;
|
|
|
- pdfNum.value = historys.value[historyIndex].currentResponse.docs[ind - 1].num;
|
|
|
+ link = historys.value[hIndex].currentResponse.docs[ind - 1].link;
|
|
|
+ fileType.value = historys.value[hIndex].currentResponse.docs[ind - 1].type;
|
|
|
+ pdfContent.value = historys.value[hIndex].currentResponse.docs[ind - 1].content;
|
|
|
+ pdfNum.value = historys.value[hIndex].currentResponse.docs[ind - 1].num;
|
|
|
}
|
|
|
pdfNum.value = ind;
|
|
|
pdfSrc.value = window.formatDocUrl(link, modelType.value)
|