askbot-dragon 1.2.9 → 1.3.11

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 (83) 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 +43 -43
  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 +11 -11
  13. package/src/assets/js/script.js +36 -36
  14. package/src/assets/less/common.css +6773 -6773
  15. package/src/assets/less/converSationContainer/common.less +191 -191
  16. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  17. package/src/assets/less/iconfont.css +37 -37
  18. package/src/assets/less/ticketMessage.less +211 -211
  19. package/src/components/ActionAlertIframe.vue +112 -112
  20. package/src/components/AiGuide.vue +467 -467
  21. package/src/components/AnswerDocknowledge.vue +362 -362
  22. package/src/components/AnswerVoice.vue +256 -0
  23. package/src/components/AskIFrame.vue +15 -15
  24. package/src/components/ConversationContainer.vue +4024 -4011
  25. package/src/components/FileType.vue +86 -86
  26. package/src/components/Message.vue +27 -27
  27. package/src/components/actionSatisfaction.vue +107 -107
  28. package/src/components/actionSendToBot.vue +62 -62
  29. package/src/components/answerDissatisfaction.vue +62 -62
  30. package/src/components/answerRadio.vue +76 -76
  31. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  32. package/src/components/ask-components/Msgloading.vue +37 -37
  33. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  34. package/src/components/askVideo.vue +138 -138
  35. package/src/components/assetDetails.vue +370 -370
  36. package/src/components/assetMessage.vue +228 -228
  37. package/src/components/associationIntention.vue +323 -323
  38. package/src/components/attachmentPreview.vue +90 -90
  39. package/src/components/botActionSatisfactor.vue +68 -68
  40. package/src/components/chatContent.vue +513 -513
  41. package/src/components/feedBack.vue +136 -136
  42. package/src/components/fielListView.vue +344 -344
  43. package/src/components/file/AliyunOssComponents.vue +108 -108
  44. package/src/components/formTemplate.vue +3363 -3363
  45. package/src/components/loadingProcess.vue +164 -164
  46. package/src/components/message/ActionAlertIframe.vue +112 -112
  47. package/src/components/message/ShopMessage.vue +164 -164
  48. package/src/components/message/TextMessage.vue +924 -924
  49. package/src/components/message/TicketMessage.vue +177 -177
  50. package/src/components/message/swiper/index.js +4 -4
  51. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  52. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  53. package/src/components/msgLoading.vue +231 -231
  54. package/src/components/myPopup.vue +70 -70
  55. package/src/components/popup.vue +227 -227
  56. package/src/components/previewDoc.vue +108 -112
  57. package/src/components/previewPdf.vue +205 -205
  58. package/src/components/receiverMessagePlatform.vue +65 -65
  59. package/src/components/recommend.vue +89 -89
  60. package/src/components/selector/hOption.vue +20 -20
  61. package/src/components/selector/hSelector.vue +199 -199
  62. package/src/components/selector/hWrapper.vue +216 -216
  63. package/src/components/senderMessagePlatform.vue +50 -50
  64. package/src/components/source/BotMessage.vue +24 -24
  65. package/src/components/source/CustomMessage.vue +24 -24
  66. package/src/components/test.vue +260 -260
  67. package/src/components/tree.vue +294 -294
  68. package/src/components/utils/AliyunIssUtil.js +72 -72
  69. package/src/components/utils/ckeditor.js +155 -155
  70. package/src/components/utils/ckeditorImageUpload/command.js +109 -109
  71. package/src/components/utils/ckeditorImageUpload/editing.js +11 -11
  72. package/src/components/utils/ckeditorImageUpload/plugin-image.js +11 -11
  73. package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +40 -40
  74. package/src/components/utils/ckeditorfileUpload/common.js +111 -111
  75. package/src/components/utils/ckeditorfileUpload/editing.js +11 -11
  76. package/src/components/utils/ckeditorfileUpload/plugin_file.js +11 -11
  77. package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +34 -34
  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/main.js +60 -60
  83. package/vue.config.js +55 -55
@@ -1,324 +1,324 @@
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.content.recommend && msg.content.recommend.status)">
26
- <p 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.content.recommend && msg.content.recommend.status)">
29
- <p v-html="$options.filters.imageStyle(msg.content.html)" class="answer-rich-text" @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"></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" :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
- :visible.sync="drawer"
72
- :with-header="false"
73
- size="65%"
74
- >
75
- <previewDoc ref="previewDoc" :url="previewHref" @close="close" v-if="drawer"></previewDoc>
76
- </el-drawer>
77
- </div>
78
- </template>
79
-
80
- <script>
81
- import askVideo from "./askVideo";
82
- import Recommend from "./recommend";
83
- import previewDoc from "./previewDoc";
84
- import { isMobile } from "../assets/js/common";
85
- export default {
86
- name: "associationIntention",
87
- components: {Recommend, askVideo, previewDoc},
88
- props: ["msg",'msgType','isOpen','sourceOhm','isOhmPc'],
89
- filters: {
90
- imageStyle: function (html) {
91
- //富文本内图片自适应高度宽度
92
- const regex = new RegExp("<img", "gi");
93
- return html.replace(
94
- regex,
95
- "<img style='max-width: 230px;border-radius: 25px;' onclick='imageOnClick(this)'"
96
- );
97
- },
98
- msgHtmlContent:function (content){
99
- var reg = /<br\/>/g;
100
- let msg = content.replace(reg,'\n');
101
- return msg
102
- },
103
- },
104
- data() {
105
- return {
106
- previewHref: "",
107
- previewShowPopup:false,
108
- drawer:false
109
- }
110
- },
111
- mounted() {
112
- },
113
- methods:{
114
- // 将匹配结果替换表情图片
115
- emotion(res) {
116
- let word = res.replace(/#|;/gi, "");
117
- const list = [
118
- "微笑",
119
- "撇嘴",
120
- "色",
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
- let index = list.indexOf(word);
225
- return `<img height="20px" src="https://guoranim.oss-cn-beijing.aliyuncs.com/emoji/${
226
- index + 1
227
- }.png" align="middle">`;
228
- },
229
- onRadioClickReco(id, name, apikey) {
230
- this.$emit("onRadioClick", id, name, apikey);
231
- },
232
- onImageClick(url){
233
- this.$emit('onImageClick',url)
234
- },
235
- msgContent(content){
236
- console.debug('215',content)
237
- var regBr = /<br\/>/g;
238
- let msg = content.replace(regBr,"\n");
239
- var reg = /<[^>]+>/g;
240
- return reg.test(msg);
241
-
242
- },
243
- //预览图片
244
- lookAttach(e){
245
- if (e.target.localName == 'a'){
246
- this.previewHref = e.target.href;
247
- if (this.previewHref.includes('https://www') || this.previewHref.includes('http://www')){
248
- return
249
- } else {
250
- if (isMobile()){
251
- this.previewShowPopup = true
252
- } else {
253
- this.drawer = true;
254
- }
255
- }
256
- // let url = ''
257
- // try {
258
- // url = btoa(e.target.href)
259
- // }
260
- // catch {
261
- // url = encodeURIComponent(btoa(e.target.href))
262
- // }
263
- // window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
264
- // e.stopPropagation()
265
- // e.preventDefault()
266
- e.returnValue = false
267
- }
268
- },
269
- close(){
270
- this.previewShowPopup = false;
271
- this.drawer = false
272
- }
273
- },
274
- watch:{
275
- isOpen:{
276
- handler(value){
277
- if (value){
278
- let reg = this.msg.content.html
279
- if (reg){
280
- reg = reg.replace('<a',"<span class='isReplace'")
281
- reg = reg.replace('</a>','</span>')
282
- console.debug('reg',reg)
283
- this.msg.content.html = reg
284
- }
285
-
286
- }
287
- else {
288
- let reg = this.msg.content.html
289
- console.debug('reg',reg)
290
- if (reg){
291
- reg = reg.replace("<span class='isReplace'","<a download")
292
- let reg2 = reg
293
- reg2 = reg2.replace('</span>','</a>')
294
- this.msg.content.html = reg2
295
- console.debug('reg',reg2)
296
- }
297
- }
298
- }
299
- }
300
- }
301
- }
302
- </script>
303
-
304
-
305
- <style scoped lang="less">
306
- @import "../assets/less/converSationContainer/common";
307
- .association-intention{
308
- .association-img{
309
- /*display: flex;
310
- align-items: center;
311
- justify-content: center;*/
312
-
313
- }
314
- .answer-rich-text{
315
- /*padding-bottom: 10px;
316
- border-bottom: 1px solid #EEEEEE;*/
317
- }
318
- ///deep/a{
319
- // disabled:true
320
- // //pointer-events: none;
321
- //}
322
- }
323
-
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.content.recommend && msg.content.recommend.status)">
26
+ <p 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.content.recommend && msg.content.recommend.status)">
29
+ <p v-html="$options.filters.imageStyle(msg.content.html)" class="answer-rich-text" @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"></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" :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
+ :visible.sync="drawer"
72
+ :with-header="false"
73
+ size="65%"
74
+ >
75
+ <previewDoc ref="previewDoc" :url="previewHref" @close="close" v-if="drawer"></previewDoc>
76
+ </el-drawer>
77
+ </div>
78
+ </template>
79
+
80
+ <script>
81
+ import askVideo from "./askVideo";
82
+ import Recommend from "./recommend";
83
+ import previewDoc from "./previewDoc";
84
+ import { isMobile } from "../assets/js/common";
85
+ export default {
86
+ name: "associationIntention",
87
+ components: {Recommend, askVideo, previewDoc},
88
+ props: ["msg",'msgType','isOpen','sourceOhm','isOhmPc'],
89
+ filters: {
90
+ imageStyle: function (html) {
91
+ //富文本内图片自适应高度宽度
92
+ const regex = new RegExp("<img", "gi");
93
+ return html.replace(
94
+ regex,
95
+ "<img style='max-width: 230px;border-radius: 25px;' onclick='imageOnClick(this)'"
96
+ );
97
+ },
98
+ msgHtmlContent:function (content){
99
+ var reg = /<br\/>/g;
100
+ let msg = content.replace(reg,'\n');
101
+ return msg
102
+ },
103
+ },
104
+ data() {
105
+ return {
106
+ previewHref: "",
107
+ previewShowPopup:false,
108
+ drawer:false
109
+ }
110
+ },
111
+ mounted() {
112
+ },
113
+ methods:{
114
+ // 将匹配结果替换表情图片
115
+ emotion(res) {
116
+ let word = res.replace(/#|;/gi, "");
117
+ const list = [
118
+ "微笑",
119
+ "撇嘴",
120
+ "色",
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
+ let index = list.indexOf(word);
225
+ return `<img height="20px" src="https://guoranim.oss-cn-beijing.aliyuncs.com/emoji/${
226
+ index + 1
227
+ }.png" align="middle">`;
228
+ },
229
+ onRadioClickReco(id, name, apikey) {
230
+ this.$emit("onRadioClick", id, name, apikey);
231
+ },
232
+ onImageClick(url){
233
+ this.$emit('onImageClick',url)
234
+ },
235
+ msgContent(content){
236
+ console.debug('215',content)
237
+ var regBr = /<br\/>/g;
238
+ let msg = content.replace(regBr,"\n");
239
+ var reg = /<[^>]+>/g;
240
+ return reg.test(msg);
241
+
242
+ },
243
+ //预览图片
244
+ lookAttach(e){
245
+ if (e.target.localName == 'a'){
246
+ this.previewHref = e.target.href;
247
+ if (this.previewHref.includes('https://www') || this.previewHref.includes('http://www')){
248
+ return
249
+ } else {
250
+ if (isMobile()){
251
+ this.previewShowPopup = true
252
+ } else {
253
+ this.drawer = true;
254
+ }
255
+ }
256
+ // let url = ''
257
+ // try {
258
+ // url = btoa(e.target.href)
259
+ // }
260
+ // catch {
261
+ // url = encodeURIComponent(btoa(e.target.href))
262
+ // }
263
+ // window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
264
+ // e.stopPropagation()
265
+ // e.preventDefault()
266
+ e.returnValue = false
267
+ }
268
+ },
269
+ close(){
270
+ this.previewShowPopup = false;
271
+ this.drawer = false
272
+ }
273
+ },
274
+ watch:{
275
+ isOpen:{
276
+ handler(value){
277
+ if (value){
278
+ let reg = this.msg.content.html
279
+ if (reg){
280
+ reg = reg.replace('<a',"<span class='isReplace'")
281
+ reg = reg.replace('</a>','</span>')
282
+ console.debug('reg',reg)
283
+ this.msg.content.html = reg
284
+ }
285
+
286
+ }
287
+ else {
288
+ let reg = this.msg.content.html
289
+ console.debug('reg',reg)
290
+ if (reg){
291
+ reg = reg.replace("<span class='isReplace'","<a download")
292
+ let reg2 = reg
293
+ reg2 = reg2.replace('</span>','</a>')
294
+ this.msg.content.html = reg2
295
+ console.debug('reg',reg2)
296
+ }
297
+ }
298
+ }
299
+ }
300
+ }
301
+ }
302
+ </script>
303
+
304
+
305
+ <style scoped lang="less">
306
+ @import "../assets/less/converSationContainer/common";
307
+ .association-intention{
308
+ .association-img{
309
+ /*display: flex;
310
+ align-items: center;
311
+ justify-content: center;*/
312
+
313
+ }
314
+ .answer-rich-text{
315
+ /*padding-bottom: 10px;
316
+ border-bottom: 1px solid #EEEEEE;*/
317
+ }
318
+ ///deep/a{
319
+ // disabled:true
320
+ // //pointer-events: none;
321
+ //}
322
+ }
323
+
324
324
  </style>