askbot-dragon 1.7.0-beta → 1.7.11-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 (87) 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 +56 -56
  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/js/AliyunlssUtil.js +92 -92
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/common.js +252 -252
  13. package/src/assets/js/hammer.js +100 -100
  14. package/src/assets/js/script.js +36 -36
  15. package/src/assets/less/common.css +6773 -6773
  16. package/src/assets/less/converSationContainer/common.less +199 -199
  17. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  18. package/src/assets/less/iconfont.css +37 -37
  19. package/src/assets/less/ticketMessage.less +294 -294
  20. package/src/components/ActionAlertIframe.vue +177 -177
  21. package/src/components/AiGuide.vue +471 -471
  22. package/src/components/AnswerDocknowledge.vue +1071 -1071
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +4948 -4948
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/MyEditor.vue +351 -351
  29. package/src/components/actionSatisfaction.vue +110 -110
  30. package/src/components/actionSendToBot.vue +62 -62
  31. package/src/components/answerDissatisfaction.vue +62 -62
  32. package/src/components/answerRadio.vue +204 -204
  33. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  34. package/src/components/ask-components/Msgloading.vue +37 -37
  35. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  36. package/src/components/askVideo.vue +162 -162
  37. package/src/components/assetDetails.vue +378 -378
  38. package/src/components/assetMessage.vue +228 -228
  39. package/src/components/associationIntention.vue +381 -381
  40. package/src/components/attachmentPreview.vue +90 -90
  41. package/src/components/botActionSatisfactor.vue +68 -68
  42. package/src/components/chatContent.vue +513 -513
  43. package/src/components/feedBack.vue +136 -136
  44. package/src/components/fielListView.vue +351 -351
  45. package/src/components/file/AliyunOssComponents.vue +108 -108
  46. package/src/components/formTemplate.vue +3577 -3577
  47. package/src/components/intelligentSummary.vue +231 -231
  48. package/src/components/kkview.vue +1138 -1138
  49. package/src/components/loadingProcess.vue +164 -164
  50. package/src/components/message/ActionAlertIframe.vue +112 -112
  51. package/src/components/message/ShopMessage.vue +164 -164
  52. package/src/components/message/TextMessage.vue +929 -929
  53. package/src/components/message/TicketMessage.vue +201 -201
  54. package/src/components/message/swiper/index.js +4 -4
  55. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  56. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  57. package/src/components/msgLoading.vue +231 -231
  58. package/src/components/myPopup.vue +70 -70
  59. package/src/components/newPdfPosition.vue +877 -877
  60. package/src/components/pdfPosition.vue +1508 -1508
  61. package/src/components/popup.vue +227 -227
  62. package/src/components/previewDoc.vue +252 -252
  63. package/src/components/previewPdf.vue +804 -804
  64. package/src/components/receiverMessagePlatform.vue +65 -65
  65. package/src/components/recommend.vue +80 -80
  66. package/src/components/selector/hOption.vue +20 -20
  67. package/src/components/selector/hSelector.vue +199 -199
  68. package/src/components/selector/hWrapper.vue +216 -216
  69. package/src/components/senderMessagePlatform.vue +53 -53
  70. package/src/components/source/BotMessage.vue +24 -24
  71. package/src/components/source/CustomMessage.vue +24 -24
  72. package/src/components/test.vue +260 -260
  73. package/src/components/tree.vue +294 -294
  74. package/src/components/utils/AliyunIssUtil.js +81 -81
  75. package/src/components/utils/ckeditor.js +174 -174
  76. package/src/components/utils/format_date.js +25 -25
  77. package/src/components/utils/index.js +6 -6
  78. package/src/components/utils/math_utils.js +29 -29
  79. package/src/components/voiceComponent.vue +119 -119
  80. package/src/components/welcomeKnowledgeFile.vue +347 -347
  81. package/src/components/welcomeLlmCard.vue +140 -140
  82. package/src/components/welcomeSuggest.vue +97 -97
  83. package/src/locales/cn.json +71 -71
  84. package/src/locales/en.json +72 -72
  85. package/src/locales/jp.json +72 -72
  86. package/src/main.js +74 -74
  87. package/vue.config.js +54 -54
@@ -1,382 +1,382 @@
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" :language="language" @close="close" v-if="previewShowPopup"></previewDoc>
72
- </van-popup>
73
- <el-drawer
74
- :title="$t('common.drawerTitle')"
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" :language="language" @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','language'],
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
- this.$i18n.locale = this.language
120
- },
121
- methods:{
122
- // 将匹配结果替换表情图片
123
- emotion(res) {
124
- let word = res.replace(/#|;/gi, "");
125
- const list = [
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
- ];
232
- let index = list.indexOf(word);
233
- return `<img height="20px" src="https://guoranim.oss-cn-beijing.aliyuncs.com/emoji/${
234
- index + 1
235
- }.png" align="middle">`;
236
- },
237
- onRadioClickReco(id, name, apikey,optionApiKey) {
238
- this.$emit("onRadioClick", id, name, apikey,optionApiKey);
239
- },
240
- onImageClick(url){
241
- this.$emit('onImageClick', encodeURI(url))
242
- },
243
- msgContent(content){
244
- console.debug('215',content)
245
- var regBr = /<br\/>/g;
246
- let msg = content.replace(regBr,"\n");
247
- var reg = /<[^>]+>/g;
248
- return reg.test(msg);
249
-
250
- },
251
- //预览图片
252
- lookAttach(e){
253
- console.log(246, e);
254
- /* eslint-disable */
255
- var reg = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/;
256
- /* eslint-enable*/
257
- if (e.target.localName == 'a'){
258
- console.log(252);
259
- this.previewHref = e.target.href;
260
- console.log(254, this.previewHref);
261
- 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'))){
262
- return
263
- } else {
264
- if (isMobile()){
265
- this.previewShowPopup = true
266
- e.returnValue = false
267
- } else {
268
- this.drawer = true;
269
- e.returnValue = false
270
- }
271
- }
272
- // let url = ''
273
- // try {
274
- // url = btoa(e.target.href)
275
- // }
276
- // catch {
277
- // url = encodeURIComponent(btoa(e.target.href))
278
- // }
279
- // window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
280
- // e.stopPropagation()
281
- // e.preventDefault()
282
- e.returnValue = false
283
- }
284
- },
285
- close(){
286
- this.previewShowPopup = false;
287
- this.drawer = false
288
- }
289
- },
290
- watch:{
291
- isOpen:{
292
- handler(value){
293
- if (value){
294
- let reg = this.msg.content.html
295
- if (reg){
296
- reg = reg.replace('<a',"<span class='isReplace'")
297
- reg = reg.replace('</a>','</span>')
298
- console.debug('reg',reg)
299
- this.msg.content.html = reg
300
- }
301
-
302
- }
303
- else {
304
- let reg = this.msg.content.html
305
- console.debug('reg',reg)
306
- if (reg){
307
- reg = reg.replace("<span class='isReplace'","<a download")
308
- let reg2 = reg
309
- reg2 = reg2.replace('</span>','</a>')
310
- this.msg.content.html = reg2
311
- console.debug('reg',reg2)
312
- }
313
- }
314
- }
315
- }
316
- }
317
- }
318
- </script>
319
-
320
-
321
- <style scoped lang="less">
322
- @import "../assets/less/converSationContainer/common";
323
- .association-intention{
324
- .plugin_name-dragon {
325
- // width: 100%;
326
- height: 26px;
327
- border-radius: 26px;
328
- background: #f2f5ff;
329
- padding: 0 12px;
330
- display: flex;
331
- align-items: center;
332
- margin-bottom: 10px;
333
- color: #a9b3c6;
334
- font-size: 12px;
335
- }
336
- .llm_bot_response-model-select-dragon{
337
- margin-top: 12px;
338
- color: #888888;
339
- font-size: 12px;
340
- display: flex;
341
- justify-content: flex-end;
342
- align-items: center;
343
- text-align: right;
344
- }
345
- .association-img{
346
- /*display: flex;
347
- align-items: center;
348
- justify-content: center;*/
349
-
350
- }
351
- .answer-rich-text{
352
- /*padding-bottom: 10px;
353
- border-bottom: 1px solid #EEEEEE;*/
354
- }
355
- ///deep/a{
356
- // disabled:true
357
- // //pointer-events: none;
358
- //}
359
- /deep/ .new-version-rich {
360
- ol {
361
- list-style-type: roman !important;
362
- padding-left: 25px;
363
- }
364
- ul {
365
- list-style-type: square !important;
366
- padding-left:25px;
367
- }
368
- img {
369
- display: block;
370
- }
371
- }
372
- /deep/ img {
373
- height: auto;
374
- width: calc(100vw - 137px);
375
- border-radius: 25px;
376
- max-width: 230px;
377
- }
378
- }
379
- /deep/.el-drawer__body{
380
- height: 100%;
381
- }
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" :language="language" @close="close" v-if="previewShowPopup"></previewDoc>
72
+ </van-popup>
73
+ <el-drawer
74
+ :title="$t('common.drawerTitle')"
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" :language="language" @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','language'],
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
+ this.$i18n.locale = this.language
120
+ },
121
+ methods:{
122
+ // 将匹配结果替换表情图片
123
+ emotion(res) {
124
+ let word = res.replace(/#|;/gi, "");
125
+ const list = [
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
+ ];
232
+ let index = list.indexOf(word);
233
+ return `<img height="20px" src="https://guoranim.oss-cn-beijing.aliyuncs.com/emoji/${
234
+ index + 1
235
+ }.png" align="middle">`;
236
+ },
237
+ onRadioClickReco(id, name, apikey,optionApiKey) {
238
+ this.$emit("onRadioClick", id, name, apikey,optionApiKey);
239
+ },
240
+ onImageClick(url){
241
+ this.$emit('onImageClick', encodeURI(url))
242
+ },
243
+ msgContent(content){
244
+ console.debug('215',content)
245
+ var regBr = /<br\/>/g;
246
+ let msg = content.replace(regBr,"\n");
247
+ var reg = /<[^>]+>/g;
248
+ return reg.test(msg);
249
+
250
+ },
251
+ //预览图片
252
+ lookAttach(e){
253
+ console.log(246, e);
254
+ /* eslint-disable */
255
+ var reg = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/;
256
+ /* eslint-enable*/
257
+ if (e.target.localName == 'a'){
258
+ console.log(252);
259
+ this.previewHref = e.target.href;
260
+ console.log(254, this.previewHref);
261
+ 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'))){
262
+ return
263
+ } else {
264
+ if (isMobile()){
265
+ this.previewShowPopup = true
266
+ e.returnValue = false
267
+ } else {
268
+ this.drawer = true;
269
+ e.returnValue = false
270
+ }
271
+ }
272
+ // let url = ''
273
+ // try {
274
+ // url = btoa(e.target.href)
275
+ // }
276
+ // catch {
277
+ // url = encodeURIComponent(btoa(e.target.href))
278
+ // }
279
+ // window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
280
+ // e.stopPropagation()
281
+ // e.preventDefault()
282
+ e.returnValue = false
283
+ }
284
+ },
285
+ close(){
286
+ this.previewShowPopup = false;
287
+ this.drawer = false
288
+ }
289
+ },
290
+ watch:{
291
+ isOpen:{
292
+ handler(value){
293
+ if (value){
294
+ let reg = this.msg.content.html
295
+ if (reg){
296
+ reg = reg.replace('<a',"<span class='isReplace'")
297
+ reg = reg.replace('</a>','</span>')
298
+ console.debug('reg',reg)
299
+ this.msg.content.html = reg
300
+ }
301
+
302
+ }
303
+ else {
304
+ let reg = this.msg.content.html
305
+ console.debug('reg',reg)
306
+ if (reg){
307
+ reg = reg.replace("<span class='isReplace'","<a download")
308
+ let reg2 = reg
309
+ reg2 = reg2.replace('</span>','</a>')
310
+ this.msg.content.html = reg2
311
+ console.debug('reg',reg2)
312
+ }
313
+ }
314
+ }
315
+ }
316
+ }
317
+ }
318
+ </script>
319
+
320
+
321
+ <style scoped lang="less">
322
+ @import "../assets/less/converSationContainer/common";
323
+ .association-intention{
324
+ .plugin_name-dragon {
325
+ // width: 100%;
326
+ height: 26px;
327
+ border-radius: 26px;
328
+ background: #f2f5ff;
329
+ padding: 0 12px;
330
+ display: flex;
331
+ align-items: center;
332
+ margin-bottom: 10px;
333
+ color: #a9b3c6;
334
+ font-size: 12px;
335
+ }
336
+ .llm_bot_response-model-select-dragon{
337
+ margin-top: 12px;
338
+ color: #888888;
339
+ font-size: 12px;
340
+ display: flex;
341
+ justify-content: flex-end;
342
+ align-items: center;
343
+ text-align: right;
344
+ }
345
+ .association-img{
346
+ /*display: flex;
347
+ align-items: center;
348
+ justify-content: center;*/
349
+
350
+ }
351
+ .answer-rich-text{
352
+ /*padding-bottom: 10px;
353
+ border-bottom: 1px solid #EEEEEE;*/
354
+ }
355
+ ///deep/a{
356
+ // disabled:true
357
+ // //pointer-events: none;
358
+ //}
359
+ /deep/ .new-version-rich {
360
+ ol {
361
+ list-style-type: roman !important;
362
+ padding-left: 25px;
363
+ }
364
+ ul {
365
+ list-style-type: square !important;
366
+ padding-left:25px;
367
+ }
368
+ img {
369
+ display: block;
370
+ }
371
+ }
372
+ /deep/ img {
373
+ height: auto;
374
+ width: calc(100vw - 137px);
375
+ border-radius: 25px;
376
+ max-width: 230px;
377
+ }
378
+ }
379
+ /deep/.el-drawer__body{
380
+ height: 100%;
381
+ }
382
382
  </style>