调整历史记录跟当前对话

master
jiangjunjie 6 days ago
parent f2f01d3c41
commit 5674d1a186
  1. 72
      src/components/chat-content.vue
  2. 19
      src/components/text-content.vue
  3. 3
      src/components/text-folding.vue

@ -295,7 +295,7 @@
</div> </div>
<div class="chat-items"> <div class="chat-items">
<div class="content-left-main"> <div class="content-left-main">
<edit-address :itemList="item" :disabled="true"></edit-address> <edit-address :itemList="item" :disabled="isHistory"></edit-address>
</div> </div>
</div> </div>
</div> </div>
@ -396,7 +396,7 @@
</div> </div>
<div class="chat-items"> <div class="chat-items">
<div class="content-left-main computing-text-box" style="padding: 14rem"> <div class="content-left-main computing-text-box" style="padding: 14rem">
<network-address :itemList="item" :disabled="true"></network-address> <network-address :itemList="item" :disabled="isHistory"></network-address>
</div> </div>
</div> </div>
</div> </div>
@ -459,7 +459,7 @@
</div> </div>
<div class="chat-items"> <div class="chat-items">
<div class="content-left-main computing-text-box" style="padding: 14rem"> <div class="content-left-main computing-text-box" style="padding: 14rem">
<xqjfzzsx-accounts :itemList="item" :disabled="true"></xqjfzzsx-accounts> <xqjfzzsx-accounts :itemList="item" :disabled="isHistory"></xqjfzzsx-accounts>
</div> </div>
</div> </div>
</div> </div>
@ -476,7 +476,7 @@
</div> </div>
<div class="chat-items"> <div class="chat-items">
<div class="content-left-main computing-text-box" style="padding: 14rem"> <div class="content-left-main computing-text-box" style="padding: 14rem">
<insurance-reservation :itemList="item" :disabled="true"></insurance-reservation> <insurance-reservation :itemList="item" :disabled="isHistory"></insurance-reservation>
</div> </div>
</div> </div>
</div> </div>
@ -527,9 +527,9 @@
</div> </div>
--> -->
<text-folding v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true"></text-folding> :disabled="isHistory"></text-folding>
</div> </div>
</div> </div>
</div> </div>
@ -566,12 +566,12 @@
'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ',
}"> }">
<!-- <!--
<text-content v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" :itemlist="item" :disabled="true"></text-content> <text-content :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" :itemlist="item" :disabled="isHistory"></text-content>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">0101如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="manualAnswer($event)">进入人工服务</button>。</div> --> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">0101如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="manualAnswer($event)">进入人工服务</button>。</div> -->
<text-folding v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true"></text-folding> :disabled="isHistory"></text-folding>
<!--问题反馈 --> <!--问题反馈 -->
<div class="help-button-box flex flex-align-center before-top" <div class="help-button-box flex flex-align-center before-top"
v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'"> v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'">
@ -619,9 +619,9 @@
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="replacementRag(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replacementRag(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true"></text-folding> :disabled="isHistory"></text-folding>
<!--问题反馈 --> <!--问题反馈 -->
<div class="help-button-box flex flex-align-center before-top" <div class="help-button-box flex flex-align-center before-top"
v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'"> v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'">
@ -655,9 +655,9 @@
</div> </div>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="replacementRag(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replacementRag(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true"></text-folding> :disabled="isHistory"></text-folding>
</div> </div>
</div> </div>
</div> </div>
@ -680,9 +680,9 @@
</div> </div>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="item.msgText" :intents="item.intents" :itemlist="item" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="item.msgText" :intents="item.intents" :itemlist="item"
:isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true"></text-folding> :disabled="isHistory"></text-folding>
</div> </div>
</div> </div>
</div> </div>
@ -701,9 +701,9 @@
<div class="chat-left-txt connectionArtificial" v-html="replacementRag(item.msgText)"></div> <div class="chat-left-txt connectionArtificial" v-html="replacementRag(item.msgText)"></div>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="replacementRag(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replacementRag(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true"></text-folding> :disabled="isHistory"></text-folding>
</div> </div>
</div> </div>
</div> </div>
@ -732,8 +732,8 @@
</div> </div>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="item.msgText" :intents="item.intents" :itemlist="item" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="item.msgText" :intents="item.intents" :itemlist="item"
:isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :disabled="true" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :disabled="isHistory"
:reqAndResType="item.reqAndResType"></text-folding> :reqAndResType="item.reqAndResType"></text-folding>
</div> </div>
</div> </div>
@ -753,13 +753,13 @@
'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ',
}"> }">
<!-- <!--
<text-content v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" heightMax="autoHeight" :disabled="true"></text-content> <text-content :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" heightMax="autoHeight" :disabled="isHistory"></text-content>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true" heightMax="autoHeight"></text-folding> :disabled="isHistory" heightMax="autoHeight"></text-folding>
<!--问题反馈 --> <!--问题反馈 -->
<div class="help-button-box flex flex-align-center before-top" <div class="help-button-box flex flex-align-center before-top"
v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'"> v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'">
@ -790,13 +790,13 @@
'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ',
}"> }">
<!-- <!--
<text-content v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" heightMax="autoHeight" :disabled="true"></text-content> <text-content :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" heightMax="autoHeight" :disabled="isHistory"></text-content>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true" heightMax="autoHeight"></text-folding> :disabled="isHistory" heightMax="autoHeight"></text-folding>
<!--问题反馈 --> <!--问题反馈 -->
<div class="help-button-box flex flex-align-center before-top" <div class="help-button-box flex flex-align-center before-top"
v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'"> v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'">
@ -881,9 +881,9 @@
<div class="chat-left-txt connectionArtificial" v-html="replacementRag(item.msgText)"></div> <div class="chat-left-txt connectionArtificial" v-html="replacementRag(item.msgText)"></div>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="replacementRag(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replacementRag(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true" heightMax="autoHeight"></text-folding> :disabled="isHistory" heightMax="autoHeight"></text-folding>
</div> </div>
</div> </div>
</div> </div>
@ -1016,11 +1016,11 @@
<div class="chat-items"> <div class="chat-items">
<div class="content-left-main img-text-type text-folding-box"> <div class="content-left-main img-text-type text-folding-box">
<!-- <!--
<text-content v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" :disabled="true"></text-content> <text-content :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" :disabled="isHistory"></text-content>
--> -->
<text-folding v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true"></text-folding> :disabled="isHistory"></text-folding>
</div> </div>
</div> </div>
</div> </div>
@ -1038,12 +1038,12 @@
'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ',
}"> }">
<!-- <!--
<text-content v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" heightMax="autoHeight" :disabled="true"></text-content> <text-content :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" heightMax="autoHeight" :disabled="isHistory"></text-content>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :itemlist="item" :isWX="isWX" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :itemlist="item" :isWX="isWX"
:tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :disabled="true" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :disabled="isHistory"
heightMax="autoHeight"></text-folding> heightMax="autoHeight"></text-folding>
<hot-question :isQA="true"></hot-question> <hot-question :isQA="true"></hot-question>
<!--问题反馈 --> <!--问题反馈 -->
@ -1076,13 +1076,13 @@
'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ',
}"> }">
<!-- <!--
<text-content v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" heightMax="autoHeight" :disabled="true"></text-content> <text-content :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" heightMax="autoHeight" :disabled="isHistory"></text-content>
<div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div> <div class="question-answer-help" v-if="item.cmd && item.cmd == 'RGFWHS'">如需更多帮助,请点击<button class="answer-help-btn" disabled="disabled" @click.stop="connectionArtificial($event)">进入人工服务</button>。</div>
--> -->
<text-folding v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents" <text-folding :isHistory="isHistory" v-if="item.msgText" :introduce="replaceALabel(item.msgText)" :intents="item.intents"
:itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" :itemlist="item" :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum"
:disabled="true" heightMax="autoHeight"></text-folding> :disabled="isHistory" heightMax="autoHeight"></text-folding>
<!--问题反馈 --> <!--问题反馈 -->
<div class="help-button-box flex flex-align-center before-top" <div class="help-button-box flex flex-align-center before-top"
v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'"> v-if="item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ'">

@ -49,6 +49,7 @@ const props = defineProps({
disabled: { type: Boolean, default: false }, disabled: { type: Boolean, default: false },
heightMax: { type: String, default: '' }, heightMax: { type: String, default: '' },
itemlist: { type: Object, default: () => ({}) }, itemlist: { type: Object, default: () => ({}) },
isHistory: { type: Boolean, default: false },
}) })
const store = inject('appStore', null) const store = inject('appStore', null)
@ -252,6 +253,23 @@ function handleURL(url, params) {
function replacementRagEmoticon(str) { function replacementRagEmoticon(str) {
str = str || '' str = str || ''
let res = str.replace(/\\n/gm, '<br/>') let res = str.replace(/\\n/gm, '<br/>')
// 历史消息里的内嵌跳转链接置为禁用态(与 text-folding 行为一致)
if (props.isHistory) {
if (res.indexOf('open-wx-web-button')) {
res = res.replace(/"open-wx-web-button"/g, '"open-wx-web-button-disable"')
} else if (res.indexOf('jump-web-button')) {
res = res.replace(/"jump-web-button"/g, '"jump-web-button-disable"')
} else if (res.indexOf('open-app-page-button')) {
res = res.replace(/"open-app-page-button"/g, '"open-app-page-button-disable"')
}
if (res.indexOf('open-wx-web')) {
res = res.replace(/"open-wx-web"/g, '"open-wx-web-disable"')
} else if (res.indexOf('jump-web')) {
res = res.replace(/"jump-web"/g, '"jump-web-disable"')
} else if (res.indexOf('open-app-page')) {
res = res.replace(/"open-app-page"/g, '"open-app-page-disable"')
}
}
return emojiToImage(res) return emojiToImage(res)
} }
@ -429,7 +447,6 @@ function manualAnswer(event, item) {
} }
.answer-items[disabled] { .answer-items[disabled] {
opacity: 0.5;
cursor: not-allowed; cursor: not-allowed;
} }

@ -26,7 +26,7 @@
" "
> >
<button <button
:class="hasClicked || disabled ? 'answer-items setGrey' : 'answer-items'" :class="hasClicked ? 'answer-items setGrey' : 'answer-items'"
v-for="(items, index) in intents" v-for="(items, index) in intents"
:key="index" :key="index"
:disabled="disabled" :disabled="disabled"
@ -531,7 +531,6 @@ function manualAnswer(event, item) {
} }
.answer-items[disabled] { .answer-items[disabled] {
opacity: 0.5;
cursor: not-allowed; cursor: not-allowed;
} }

Loading…
Cancel
Save