|
@@ -926,7 +926,6 @@ const handleDocs = (docs) => {
|
|
|
) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
historys.value[historyIndex].currentResponse.docs = docs.map((v, i) => {
|
|
|
if (activeTab.value === 'net') {
|
|
|
return {
|
|
@@ -975,16 +974,8 @@ const handleDocs = (docs) => {
|
|
|
const openDoc = (doc, i) => {
|
|
|
var link = doc.link;
|
|
|
var type = doc.type;
|
|
|
- pdfSrc.value = link.replace(
|
|
|
- window.AppGlobalConfig.knowledgeDocUrl.replace(
|
|
|
- '=policy&',
|
|
|
- activeTab.value === 'paper' ? '=compose_paper_material_total&' : '=policy&'
|
|
|
- ),
|
|
|
- window.AppGlobalConfig.knowledgeDocUrlProxy.replace(
|
|
|
- '=policy&',
|
|
|
- activeTab.value === 'paper' ? '=compose_paper_material_total&' : '=policy&'
|
|
|
- )
|
|
|
- );
|
|
|
+ pdfSrc.value = window.formatDocUrl(link, modelType.value)
|
|
|
+ console.log(pdfSrc.value)
|
|
|
showDoc.value = true;
|
|
|
fileType.value = type;
|
|
|
pdfContent.value = doc.content;
|
|
@@ -1029,16 +1020,33 @@ const openDocByIndex = (ind, id) => {
|
|
|
pdfNum.value = historys.value[historyIndex].currentResponse.docs[ind - 1].num;
|
|
|
}
|
|
|
pdfNum.value = ind;
|
|
|
- pdfSrc.value = link.replace(
|
|
|
- window.AppGlobalConfig.knowledgeDocUrl.replace(
|
|
|
+ const knowledgeDocUrl = window.AppGlobalConfig.knowledgeDocUrl.replace(
|
|
|
'=policy&',
|
|
|
activeTab.value === 'paper' ? '=compose_paper_material_total&' : '=policy&'
|
|
|
- ),
|
|
|
- window.AppGlobalConfig.knowledgeDocUrlProxy.replace(
|
|
|
- '=policy&',
|
|
|
- activeTab.value === 'paper' ? '=compose_paper_material_total&' : '=policy&'
|
|
|
- )
|
|
|
- );
|
|
|
+ )
|
|
|
+ console.log("knowledgeDocUrl-------------------------")
|
|
|
+ console.log(knowledgeDocUrl)
|
|
|
+ console.log(link)
|
|
|
+ if(link.indexOf(knowledgeDocUrl) != -1) {
|
|
|
+ pdfSrc.value = link.replace(knowledgeDocUrl,
|
|
|
+ window.AppGlobalConfig.knowledgeDocUrlProxy.replace(
|
|
|
+ '=policy&',
|
|
|
+ activeTab.value === 'paper' ? '=compose_paper_material_total&' : '=policy&'
|
|
|
+ )
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ pdfSrc.value = link.replace(
|
|
|
+ window.AppGlobalConfig.knowledgeDocUrl2.replace(
|
|
|
+ '=policy&',
|
|
|
+ activeTab.value === 'paper' ? '=compose_paper_material_total&' : '=policy&'
|
|
|
+ ),
|
|
|
+ window.AppGlobalConfig.knowledgeDocUrlProxy2.replace(
|
|
|
+ '=policy&',
|
|
|
+ activeTab.value === 'paper' ? '=compose_paper_material_total&' : '=policy&'
|
|
|
+ )
|
|
|
+ );
|
|
|
+ }
|
|
|
+ console.log(pdfSrc.value)
|
|
|
showDoc.value = true;
|
|
|
};
|
|
|
window.openDocByIndex = openDocByIndex;
|
|
@@ -1126,7 +1134,7 @@ const switchSession = async (item) => {
|
|
|
isSessionNew.value = false;
|
|
|
const results = await getQuestionList(item['id'])
|
|
|
historys.value = []
|
|
|
- results.forEach((item) => {
|
|
|
+ results.forEach((item,index) => {
|
|
|
let nums = getNumAll(item['answer']);
|
|
|
let msg = item['answer'];
|
|
|
const id = questHistories.value.length;
|
|
@@ -1154,7 +1162,7 @@ const switchSession = async (item) => {
|
|
|
}
|
|
|
})
|
|
|
activeIndex.value = 5
|
|
|
- historyIndex = results.length - 1;
|
|
|
+ historyIndex = index;
|
|
|
handleDocs(docs)
|
|
|
})
|
|
|
}
|