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