askbot-dragon 1.6.80-beta → 1.6.82-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +27 -27
  2. package/babel.config.js +6 -6
  3. package/dragon.iml +7 -7
  4. package/package.json +55 -55
  5. package/public/index.html +72 -72
  6. package/src/App.vue +31 -31
  7. package/src/api/index.js +1 -1
  8. package/src/api/mock.http +2 -2
  9. package/src/api/requestUrl.js +185 -185
  10. package/src/assets/image/default_avt_ui.png +0 -0
  11. package/src/assets/image/filtType/audio.png +0 -0
  12. package/src/assets/image/filtType/excel1.png +0 -0
  13. package/src/assets/image/filtType/general.png +0 -0
  14. package/src/assets/image/filtType/image1.png +0 -0
  15. package/src/assets/image/filtType/link.png +0 -0
  16. package/src/assets/image/filtType/md2.png +0 -0
  17. package/src/assets/image/filtType/mode.png +0 -0
  18. package/src/assets/image/filtType/news.png +0 -0
  19. package/src/assets/image/filtType/pdf1.png +0 -0
  20. package/src/assets/image/filtType/ppt1.png +0 -0
  21. package/src/assets/image/filtType/selfadd1.png +0 -0
  22. package/src/assets/image/filtType/txt1.png +0 -0
  23. package/src/assets/image/filtType/video.png +0 -0
  24. package/src/assets/image/filtType/wechat.png +0 -0
  25. package/src/assets/image/filtType/word1.png +0 -0
  26. package/src/assets/image/loading.gif +0 -0
  27. package/src/assets/js/AliyunlssUtil.js +92 -92
  28. package/src/assets/js/Base64Util.js +22 -22
  29. package/src/assets/js/common.js +252 -252
  30. package/src/assets/js/hammer.js +89 -100
  31. package/src/assets/js/script.js +36 -36
  32. package/src/assets/less/common.css +6773 -6773
  33. package/src/assets/less/converSationContainer/common.less +192 -199
  34. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  35. package/src/assets/less/iconfont.css +37 -37
  36. package/src/assets/less/ticketMessage.less +294 -294
  37. package/src/components/ActionAlertIframe.vue +154 -177
  38. package/src/components/AiGuide.vue +468 -466
  39. package/src/components/AnswerDocknowledge.vue +1068 -1061
  40. package/src/components/AnswerVoice.vue +285 -285
  41. package/src/components/AskIFrame.vue +15 -15
  42. package/src/components/ConversationContainer.vue +5140 -4934
  43. package/src/components/FileType.vue +86 -86
  44. package/src/components/Message.vue +27 -27
  45. package/src/components/MyEditor.vue +350 -351
  46. package/src/components/actionSatisfaction.vue +107 -107
  47. package/src/components/actionSendToBot.vue +62 -62
  48. package/src/components/answerDissatisfaction.vue +62 -62
  49. package/src/components/answerRadio.vue +186 -186
  50. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  51. package/src/components/ask-components/Msgloading.vue +37 -37
  52. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  53. package/src/components/askVideo.vue +139 -162
  54. package/src/components/assetDetails.vue +378 -378
  55. package/src/components/assetMessage.vue +228 -228
  56. package/src/components/associationIntention.vue +374 -355
  57. package/src/components/attachmentPreview.vue +90 -90
  58. package/src/components/botActionSatisfactor.vue +68 -68
  59. package/src/components/chatContent.vue +513 -513
  60. package/src/components/feedBack.vue +136 -136
  61. package/src/components/fielListView.vue +351 -351
  62. package/src/components/file/AliyunOssComponents.vue +108 -108
  63. package/src/components/formTemplate.vue +3572 -3572
  64. package/src/components/intelligentSummary.vue +227 -231
  65. package/src/components/kkview.vue +1138 -1138
  66. package/src/components/loadingProcess.vue +164 -164
  67. package/src/components/message/ActionAlertIframe.vue +112 -112
  68. package/src/components/message/ShopMessage.vue +164 -164
  69. package/src/components/message/TextMessage.vue +924 -924
  70. package/src/components/message/TicketMessage.vue +201 -201
  71. package/src/components/message/swiper/index.js +4 -4
  72. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  73. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  74. package/src/components/msgLoading.vue +231 -231
  75. package/src/components/myPopup.vue +70 -70
  76. package/src/components/pdfPosition.vue +1334 -1508
  77. package/src/components/popup.vue +227 -227
  78. package/src/components/previewDoc.vue +247 -247
  79. package/src/components/previewPdf.vue +779 -799
  80. package/src/components/receiverMessagePlatform.vue +65 -65
  81. package/src/components/recommend.vue +80 -80
  82. package/src/components/selector/hOption.vue +20 -20
  83. package/src/components/selector/hSelector.vue +199 -199
  84. package/src/components/selector/hWrapper.vue +216 -216
  85. package/src/components/senderMessagePlatform.vue +50 -50
  86. package/src/components/source/BotMessage.vue +24 -24
  87. package/src/components/source/CustomMessage.vue +24 -24
  88. package/src/components/test.vue +260 -260
  89. package/src/components/tree.vue +294 -294
  90. package/src/components/utils/AliyunIssUtil.js +81 -81
  91. package/src/components/utils/ckeditor.js +174 -174
  92. package/src/components/utils/format_date.js +25 -25
  93. package/src/components/utils/index.js +6 -6
  94. package/src/components/utils/math_utils.js +29 -29
  95. package/src/components/voiceComponent.vue +119 -119
  96. package/src/components/welcomeKnowledgeFile.vue +340 -340
  97. package/src/components/welcomeLlmCard.vue +140 -140
  98. package/src/components/welcomeSuggest.vue +97 -97
  99. package/src/main.js +57 -57
  100. package/vue.config.js +54 -54
  101. package/src/components/newPdfPosition.vue +0 -878
@@ -1,356 +1,375 @@
1
- <template>
2
- <div class="association-intention">
3
- <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && !(msg.recommend&& msg.recommend.status)">
4
- <!-- <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)"></p>-->
5
- <template v-if="msg.dispatchServiceType === 'CHATGPT'">
6
- <p style="white-space: pre-wrap;">
7
- {{msg.content | msgHtmlContent}}
8
- </p>
9
- </template>
10
- <template v-else>
11
- <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)" class="answer-rich-text"></p>
12
- </template>
13
- </div>
14
- <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && (msg.recommend&& msg.recommend.status)">
15
- <template v-if="msg.dispatchServiceType === 'CHATGPT'">
16
- <p style="white-space: pre-wrap;">
17
- {{msg.content | msgHtmlContent}}
18
- </p>
19
- </template>
20
- <template v-else>
21
- <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)" class="answer-rich-text"></p>
22
- </template>
23
- <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
24
- </div>
25
- <div v-if="(msg.type === 'answer_rich_text' || msg.type === 'answer_rich_text_pro') && !(msg.content.recommend && msg.content.recommend.status)">
26
- <p :class="[msg.content.vertion == 1?'new-version-rich':'']" v-html="$options.filters.imageStyle(msg.content.html)" @click="lookAttach($event)"></p>
27
- </div>
28
- <div v-else-if="(msg.type == 'answer_rich_text' || msg.type === 'answer_rich_text_pro') && (msg.content.recommend && msg.content.recommend.status)">
29
- <p :class="['answer-rich-text', msg.content.vertion == 1?'new-version-rich':'']" v-html="$options.filters.imageStyle(msg.content.html)" @click="lookAttach($event)"></p>
30
- <Recommend :msg="msg.content" @onRadioClickReco="onRadioClickReco"></Recommend>
31
- </div>
32
- <div v-else-if="msgType === 'answer_image'" >
33
- <div
34
- class="association-img"
35
- v-if="msg.content.url"
36
- >
37
- <!-- LPY 原生宽度适配有bug,弃用 -->
38
- <template v-if="sourceOhm === 'ohm' && !isOhmPc">
39
- <viewer :images="[msg.content.url]">
40
- <img
41
- v-for="(src,index) in [msg.content.url]"
42
- :src="src"
43
- :key="index"
44
- style="height: auto; width: calc(100vw - 137px);border-radius: 25px;max-width: 230px"
45
- class="img-class"
46
- />
47
- </viewer>
48
- </template>
49
- <img
50
- v-else
51
- :src="msg.content.url"
52
- style="height: auto; width: calc(100vw - 137px);border-radius: 25px;max-width: 230px"
53
- @click="onImageClick(msg.content.url)"
54
- class="img-class"
55
- />
56
- </div>
57
- <Recommend v-if="msg.recommend && msg.recommend.list && msg.recommend.list.length > 0" :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
58
- </div>
59
- <div v-else-if="msgType === 'answer_video' || msgType === 'user_video' || msgType === 'VIDEO'">
60
- <div class="association-img" v-if="msg.content.url">
61
- <ask-video :msg="msg" :url="msg.content.url" :local-url="msg.content.localUrl"
62
- :progress="msg.content.progress" :nodownload="nodownload"></ask-video>
63
- </div>
64
- <Recommend v-if="msg.recommend && msg.recommend.list && msg.recommend.list.length > 0" :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
65
- </div>
66
- <van-popup v-model="previewShowPopup" position="bottom" v-if="previewShowPopup" :style="{ height: '90%', background:'#FFFFFF'}">
67
- <previewDoc ref="previewDoc" :url="previewHref" @close="close" v-if="previewShowPopup"></previewDoc>
68
- </van-popup>
69
- <el-drawer
70
- title="我是标题"
71
- :append-to-body="true"
72
- :model="false"
73
- :visible.sync="drawer"
74
- :with-header="false"
75
- size="65%"
76
- v-if="drawer"
77
- >
78
- <previewDoc ref="previewDoc" :url="previewHref" @close="close" v-if="drawer"></previewDoc>
79
- </el-drawer>
80
- </div>
81
- </template>
82
-
83
- <script>
84
- import askVideo from "./askVideo";
85
- import Recommend from "./recommend";
86
- import previewDoc from "./previewDoc";
87
- import { isMobile } from "../assets/js/common";
88
- export default {
89
- name: "associationIntention",
90
- components: {Recommend, askVideo, previewDoc},
91
- props: ["msg",'msgType','isOpen','sourceOhm','isOhmPc', 'nodownload'],
92
- filters: {
93
- imageStyle: function (html) {
94
- //富文本内图片自适应高度宽度
95
- const regex = new RegExp("<img", "gi");
96
- return html.replace(
97
- regex,
98
- "<img style='max-width: 230px;border-radius: 25px;' onclick='imageOnClick(this)'"
99
- );
100
- },
101
- msgHtmlContent:function (content){
102
- var reg = /<br\/>/g;
103
- let msg = content.replace(reg,'\n');
104
- return msg
105
- },
106
- },
107
- data() {
108
- return {
109
- previewHref: "",
110
- previewShowPopup:false,
111
- drawer:false
112
- }
113
- },
114
- mounted() {
115
- },
116
- methods:{
117
- // 将匹配结果替换表情图片
118
- emotion(res) {
119
- let word = res.replace(/#|;/gi, "");
120
- const list = [
121
- "微笑",
122
- "撇嘴",
123
- "色",
124
- "发呆",
125
- "得意",
126
- "流泪",
127
- "害羞",
128
- "闭嘴",
129
- "睡",
130
- "大哭",
131
- "尴尬",
132
- "发怒",
133
- "调皮",
134
- "呲牙",
135
- "惊讶",
136
- "难过",
137
- "酷",
138
- "冷汗",
139
- "抓狂",
140
- "吐",
141
- "偷笑",
142
- "可爱",
143
- "白眼",
144
- "傲慢",
145
- "饥饿",
146
- "困",
147
- "惊恐",
148
- "流汗",
149
- "憨笑",
150
- "大兵",
151
- "奋斗",
152
- "咒骂",
153
- "疑问",
154
- "嘘",
155
- "晕",
156
- "折磨",
157
- "衰",
158
- "骷髅",
159
- "敲打",
160
- "再见",
161
- "擦汗",
162
- "抠鼻",
163
- "鼓掌",
164
- "糗大了",
165
- "坏笑",
166
- "左哼哼",
167
- "右哼哼",
168
- "哈欠",
169
- "鄙视",
170
- "委屈",
171
- "快哭了",
172
- "阴险",
173
- "亲亲",
174
- "吓",
175
- "可怜",
176
- "菜刀",
177
- "西瓜",
178
- "啤酒",
179
- "篮球",
180
- "乒乓",
181
- "咖啡",
182
- "饭",
183
- "猪头",
184
- "玫瑰",
185
- "凋谢",
186
- "示爱",
187
- "爱心",
188
- "心碎",
189
- "蛋糕",
190
- "闪电",
191
- "炸弹",
192
- "刀",
193
- "足球",
194
- "瓢虫",
195
- "便便",
196
- "月亮",
197
- "太阳",
198
- "礼物",
199
- "拥抱",
200
- "强",
201
- "弱",
202
- "握手",
203
- "胜利",
204
- "抱拳",
205
- "勾引",
206
- "拳头",
207
- "差劲",
208
- "爱你",
209
- "不",
210
- "可以",
211
- "爱情",
212
- "飞吻",
213
- "跳跳",
214
- "发抖",
215
- "怄火",
216
- "转圈",
217
- "磕头",
218
- "回头",
219
- "跳绳",
220
- "挥手",
221
- "激动",
222
- "街舞",
223
- "献吻",
224
- "左太极",
225
- "右太极",
226
- ];
227
- let index = list.indexOf(word);
228
- return `<img height="20px" src="https://guoranim.oss-cn-beijing.aliyuncs.com/emoji/${
229
- index + 1
230
- }.png" align="middle">`;
231
- },
232
- onRadioClickReco(id, name, apikey,optionApiKey) {
233
- this.$emit("onRadioClick", id, name, apikey,optionApiKey);
234
- },
235
- onImageClick(url){
236
- this.$emit('onImageClick', encodeURI(url))
237
- },
238
- msgContent(content){
239
- console.debug('215',content)
240
- var regBr = /<br\/>/g;
241
- let msg = content.replace(regBr,"\n");
242
- var reg = /<[^>]+>/g;
243
- return reg.test(msg);
244
-
245
- },
246
- //预览图片
247
- lookAttach(e){
248
- console.log(246, e);
249
- /* eslint-disable */
250
- var reg = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/;
251
- /* eslint-enable*/
252
- if (e.target.localName == 'a'){
253
- console.log(252);
254
- this.previewHref = e.target.href;
255
- console.log(254, this.previewHref);
256
- if (this.previewHref.includes('https://www') || this.previewHref.includes('http://www') || (this.previewHref.indexOf('https://static.guoranbot.com') == -1 && this.previewHref.indexOf('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com'))){
257
- return
258
- } else {
259
- if (isMobile()){
260
- this.previewShowPopup = true
261
- e.returnValue = false
262
- } else {
263
- this.drawer = true;
264
- e.returnValue = false
265
- }
266
- }
267
- // let url = ''
268
- // try {
269
- // url = btoa(e.target.href)
270
- // }
271
- // catch {
272
- // url = encodeURIComponent(btoa(e.target.href))
273
- // }
274
- // window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
275
- // e.stopPropagation()
276
- // e.preventDefault()
277
- e.returnValue = false
278
- }
279
- },
280
- close(){
281
- this.previewShowPopup = false;
282
- this.drawer = false
283
- }
284
- },
285
- watch:{
286
- isOpen:{
287
- handler(value){
288
- if (value){
289
- let reg = this.msg.content.html
290
- if (reg){
291
- reg = reg.replace('<a',"<span class='isReplace'")
292
- reg = reg.replace('</a>','</span>')
293
- console.debug('reg',reg)
294
- this.msg.content.html = reg
295
- }
296
-
297
- }
298
- else {
299
- let reg = this.msg.content.html
300
- console.debug('reg',reg)
301
- if (reg){
302
- reg = reg.replace("<span class='isReplace'","<a download")
303
- let reg2 = reg
304
- reg2 = reg2.replace('</span>','</a>')
305
- this.msg.content.html = reg2
306
- console.debug('reg',reg2)
307
- }
308
- }
309
- }
310
- }
311
- }
312
- }
313
- </script>
314
-
315
-
316
- <style scoped lang="less">
317
- @import "../assets/less/converSationContainer/common";
318
- .association-intention{
319
- .association-img{
320
- /*display: flex;
321
- align-items: center;
322
- justify-content: center;*/
323
-
324
- }
325
- .answer-rich-text{
326
- /*padding-bottom: 10px;
327
- border-bottom: 1px solid #EEEEEE;*/
328
- }
329
- ///deep/a{
330
- // disabled:true
331
- // //pointer-events: none;
332
- //}
333
- /deep/ .new-version-rich {
334
- ol {
335
- list-style-type: roman !important;
336
- padding-left: 25px;
337
- }
338
- ul {
339
- list-style-type: square !important;
340
- padding-left:25px;
341
- }
342
- img {
343
- display: block;
344
- }
345
- }
346
- /deep/ img {
347
- height: auto;
348
- width: calc(100vw - 137px);
349
- border-radius: 25px;
350
- max-width: 230px;
351
- }
352
- }
353
- /deep/.el-drawer__body{
354
- height: 100%;
355
- }
1
+ <template>
2
+ <div class="association-intention">
3
+ <div class="plugin_name-dragon" v-if="msg.headerStyleValue && !hiddenHeaderFooter">{{ msg.headerStyleValue }}</div>
4
+ <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && !(msg.recommend&& msg.recommend.status)">
5
+ <!-- <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)"></p>-->
6
+ <template v-if="msg.dispatchServiceType === 'CHATGPT'">
7
+ <p style="white-space: pre-wrap;">
8
+ {{msg.content | msgHtmlContent}}
9
+ </p>
10
+ </template>
11
+ <template v-else>
12
+ <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)" class="answer-rich-text"></p>
13
+ </template>
14
+ </div>
15
+ <div v-if=" (msgType === 'answer_welcofmetext' || msgType === 'answer_text') && (msg.recommend&& msg.recommend.status)">
16
+ <template v-if="msg.dispatchServiceType === 'CHATGPT'">
17
+ <p style="white-space: pre-wrap;">
18
+ {{msg.content | msgHtmlContent}}
19
+ </p>
20
+ </template>
21
+ <template v-else>
22
+ <p v-html="msg.content.replace(/\#[\u4E00-\u9FA5]{1,3}\;/gi, emotion)" class="answer-rich-text"></p>
23
+ </template>
24
+ <Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
25
+ </div>
26
+ <div v-if="(msg.type === 'answer_rich_text' || msg.type === 'answer_rich_text_pro') && !(msg.content.recommend && msg.content.recommend.status)">
27
+ <p :class="[msg.content.vertion == 1?'new-version-rich':'']" v-html="$options.filters.imageStyle(msg.content.html)" @click="lookAttach($event)"></p>
28
+ </div>
29
+ <div v-else-if="(msg.type == 'answer_rich_text' || msg.type === 'answer_rich_text_pro') && (msg.content.recommend && msg.content.recommend.status)">
30
+ <p :class="['answer-rich-text', msg.content.vertion == 1?'new-version-rich':'']" v-html="$options.filters.imageStyle(msg.content.html)" @click="lookAttach($event)"></p>
31
+ <Recommend :msg="msg.content" @onRadioClickReco="onRadioClickReco"></Recommend>
32
+ </div>
33
+ <div v-else-if="msgType === 'answer_image'" >
34
+ <div
35
+ class="association-img"
36
+ v-if="msg.content.url"
37
+ >
38
+ <!-- LPY 原生宽度适配有bug,弃用 -->
39
+ <template v-if="sourceOhm === 'ohm' && !isOhmPc">
40
+ <viewer :images="[msg.content.url]">
41
+ <img
42
+ v-for="(src,index) in [msg.content.url]"
43
+ :src="src"
44
+ :key="index"
45
+ style="height: auto; width: calc(100vw - 137px);border-radius: 25px;max-width: 230px"
46
+ class="img-class"
47
+ />
48
+ </viewer>
49
+ </template>
50
+ <img
51
+ v-else
52
+ :src="msg.content.url"
53
+ style="height: auto; width: calc(100vw - 137px);border-radius: 25px;max-width: 230px"
54
+ @click="onImageClick(msg.content.url)"
55
+ class="img-class"
56
+ />
57
+ </div>
58
+ <Recommend v-if="msg.recommend && msg.recommend.list && msg.recommend.list.length > 0" :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
59
+ </div>
60
+ <div v-else-if="msgType === 'answer_video' || msgType === 'user_video' || msgType === 'VIDEO'">
61
+ <div class="association-img" v-if="msg.content.url">
62
+ <ask-video :msg="msg" :url="msg.content.url" :local-url="msg.content.localUrl"
63
+ :progress="msg.content.progress" :nodownload="nodownload"></ask-video>
64
+ </div>
65
+ <Recommend v-if="msg.recommend && msg.recommend.list && msg.recommend.list.length > 0" :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
66
+ </div>
67
+ <div v-if="msg.footerStyleValue && !hiddenHeaderFooter" class="llm_bot_response-model-select-dragon">
68
+ <span class="model-switch-handle-name">{{msg.footerStyleValue}}</span>
69
+ </div>
70
+ <van-popup v-model="previewShowPopup" position="bottom" v-if="previewShowPopup" :style="{ height: '90%', background:'#FFFFFF'}">
71
+ <previewDoc ref="previewDoc" :url="previewHref" @close="close" v-if="previewShowPopup"></previewDoc>
72
+ </van-popup>
73
+ <el-drawer
74
+ title="我是标题"
75
+ :append-to-body="true"
76
+ :model="false"
77
+ :visible.sync="drawer"
78
+ :with-header="false"
79
+ size="65%"
80
+ v-if="drawer"
81
+ >
82
+ <previewDoc ref="previewDoc" :url="previewHref" @close="close" v-if="drawer"></previewDoc>
83
+ </el-drawer>
84
+ </div>
85
+ </template>
86
+
87
+ <script>
88
+ import askVideo from "./askVideo";
89
+ import Recommend from "./recommend";
90
+ import previewDoc from "./previewDoc";
91
+ import { isMobile } from "../assets/js/common";
92
+ export default {
93
+ name: "associationIntention",
94
+ components: {Recommend, askVideo, previewDoc},
95
+ props: ["msg",'msgType','isOpen','sourceOhm','isOhmPc', 'nodownload', 'hiddenHeaderFooter'],
96
+ filters: {
97
+ imageStyle: function (html) {
98
+ //富文本内图片自适应高度宽度
99
+ const regex = new RegExp("<img", "gi");
100
+ return html.replace(
101
+ regex,
102
+ "<img style='max-width: 230px;border-radius: 25px;' onclick='imageOnClick(this)'"
103
+ );
104
+ },
105
+ msgHtmlContent:function (content){
106
+ var reg = /<br\/>/g;
107
+ let msg = content.replace(reg,'\n');
108
+ return msg
109
+ },
110
+ },
111
+ data() {
112
+ return {
113
+ previewHref: "",
114
+ previewShowPopup:false,
115
+ drawer:false
116
+ }
117
+ },
118
+ mounted() {
119
+ },
120
+ methods:{
121
+ // 将匹配结果替换表情图片
122
+ emotion(res) {
123
+ let word = res.replace(/#|;/gi, "");
124
+ const list = [
125
+ "微笑",
126
+ "撇嘴",
127
+ "色",
128
+ "发呆",
129
+ "得意",
130
+ "流泪",
131
+ "害羞",
132
+ "闭嘴",
133
+ "睡",
134
+ "大哭",
135
+ "尴尬",
136
+ "发怒",
137
+ "调皮",
138
+ "呲牙",
139
+ "惊讶",
140
+ "难过",
141
+ "酷",
142
+ "冷汗",
143
+ "抓狂",
144
+ "吐",
145
+ "偷笑",
146
+ "可爱",
147
+ "白眼",
148
+ "傲慢",
149
+ "饥饿",
150
+ "困",
151
+ "惊恐",
152
+ "流汗",
153
+ "憨笑",
154
+ "大兵",
155
+ "奋斗",
156
+ "咒骂",
157
+ "疑问",
158
+ "嘘",
159
+ "晕",
160
+ "折磨",
161
+ "衰",
162
+ "骷髅",
163
+ "敲打",
164
+ "再见",
165
+ "擦汗",
166
+ "抠鼻",
167
+ "鼓掌",
168
+ "糗大了",
169
+ "坏笑",
170
+ "左哼哼",
171
+ "右哼哼",
172
+ "哈欠",
173
+ "鄙视",
174
+ "委屈",
175
+ "快哭了",
176
+ "阴险",
177
+ "亲亲",
178
+ "吓",
179
+ "可怜",
180
+ "菜刀",
181
+ "西瓜",
182
+ "啤酒",
183
+ "篮球",
184
+ "乒乓",
185
+ "咖啡",
186
+ "饭",
187
+ "猪头",
188
+ "玫瑰",
189
+ "凋谢",
190
+ "示爱",
191
+ "爱心",
192
+ "心碎",
193
+ "蛋糕",
194
+ "闪电",
195
+ "炸弹",
196
+ "刀",
197
+ "足球",
198
+ "瓢虫",
199
+ "便便",
200
+ "月亮",
201
+ "太阳",
202
+ "礼物",
203
+ "拥抱",
204
+ "强",
205
+ "弱",
206
+ "握手",
207
+ "胜利",
208
+ "抱拳",
209
+ "勾引",
210
+ "拳头",
211
+ "差劲",
212
+ "爱你",
213
+ "不",
214
+ "可以",
215
+ "爱情",
216
+ "飞吻",
217
+ "跳跳",
218
+ "发抖",
219
+ "怄火",
220
+ "转圈",
221
+ "磕头",
222
+ "回头",
223
+ "跳绳",
224
+ "挥手",
225
+ "激动",
226
+ "街舞",
227
+ "献吻",
228
+ "左太极",
229
+ "右太极",
230
+ ];
231
+ let index = list.indexOf(word);
232
+ return `<img height="20px" src="https://guoranim.oss-cn-beijing.aliyuncs.com/emoji/${
233
+ index + 1
234
+ }.png" align="middle">`;
235
+ },
236
+ onRadioClickReco(id, name, apikey,optionApiKey) {
237
+ this.$emit("onRadioClick", id, name, apikey,optionApiKey);
238
+ },
239
+ onImageClick(url){
240
+ this.$emit('onImageClick',url)
241
+ },
242
+ msgContent(content){
243
+ console.debug('215',content)
244
+ var regBr = /<br\/>/g;
245
+ let msg = content.replace(regBr,"\n");
246
+ var reg = /<[^>]+>/g;
247
+ return reg.test(msg);
248
+
249
+ },
250
+ //预览图片
251
+ lookAttach(e){
252
+ console.log(246, e);
253
+ /* eslint-disable */
254
+ var reg = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/;
255
+ /* eslint-enable*/
256
+ if (e.target.localName == 'a'){
257
+ console.log(252);
258
+ this.previewHref = e.target.href;
259
+ console.log(254, this.previewHref);
260
+ if (this.previewHref.includes('https://www') || this.previewHref.includes('http://www') || (this.previewHref.indexOf('https://static.guoranbot.com') == -1 && this.previewHref.indexOf('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com'))){
261
+ return
262
+ } else {
263
+ if (isMobile()){
264
+ this.previewShowPopup = true
265
+ e.returnValue = false
266
+ } else {
267
+ this.drawer = true;
268
+ e.returnValue = false
269
+ }
270
+ }
271
+ // let url = ''
272
+ // try {
273
+ // url = btoa(e.target.href)
274
+ // }
275
+ // catch {
276
+ // url = encodeURIComponent(btoa(e.target.href))
277
+ // }
278
+ // window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
279
+ // e.stopPropagation()
280
+ // e.preventDefault()
281
+ e.returnValue = false
282
+ }
283
+ },
284
+ close(){
285
+ this.previewShowPopup = false;
286
+ this.drawer = false
287
+ }
288
+ },
289
+ watch:{
290
+ isOpen:{
291
+ handler(value){
292
+ if (value){
293
+ let reg = this.msg.content.html
294
+ if (reg){
295
+ reg = reg.replace('<a',"<span class='isReplace'")
296
+ reg = reg.replace('</a>','</span>')
297
+ console.debug('reg',reg)
298
+ this.msg.content.html = reg
299
+ }
300
+
301
+ }
302
+ else {
303
+ let reg = this.msg.content.html
304
+ console.debug('reg',reg)
305
+ if (reg){
306
+ reg = reg.replace("<span class='isReplace'","<a download")
307
+ let reg2 = reg
308
+ reg2 = reg2.replace('</span>','</a>')
309
+ this.msg.content.html = reg2
310
+ console.debug('reg',reg2)
311
+ }
312
+ }
313
+ }
314
+ }
315
+ }
316
+ }
317
+ </script>
318
+
319
+
320
+ <style scoped lang="less">
321
+ @import "../assets/less/converSationContainer/common";
322
+ .association-intention{
323
+ .plugin_name-dragon {
324
+ // width: 100%;
325
+ height: 26px;
326
+ border-radius: 26px;
327
+ background: #f2f5ff;
328
+ padding: 0 12px;
329
+ display: flex;
330
+ align-items: center;
331
+ margin-bottom: 10px;
332
+ color: #a9b3c6;
333
+ font-size: 12px;
334
+ }
335
+ .llm_bot_response-model-select-dragon{
336
+ margin-top: 12px;
337
+ color: #888888;
338
+ font-size: 12px;
339
+ display: flex;
340
+ justify-content: flex-end;
341
+ align-items: center;
342
+ text-align: right;
343
+ }
344
+ .association-img{
345
+ /*display: flex;
346
+ align-items: center;
347
+ justify-content: center;*/
348
+
349
+ }
350
+ .answer-rich-text{
351
+ /*padding-bottom: 10px;
352
+ border-bottom: 1px solid #EEEEEE;*/
353
+ }
354
+ ///deep/a{
355
+ // disabled:true
356
+ // //pointer-events: none;
357
+ //}
358
+ /deep/ .new-version-rich {
359
+ ol {
360
+ list-style-type: roman !important;
361
+ padding-left: 25px;
362
+ }
363
+ ul {
364
+ list-style-type: square !important;
365
+ padding-left:25px;
366
+ }
367
+ img {
368
+ display: block;
369
+ }
370
+ }
371
+ }
372
+ /deep/.el-drawer__body{
373
+ height: 100%;
374
+ }
356
375
  </style>