askbot-dragon 1.5.21 → 1.5.22
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.
- package/README.md +27 -27
- package/babel.config.js +6 -6
- package/dragon.iml +7 -7
- package/package.json +59 -58
- package/public/index.html +74 -74
- package/src/App.vue +31 -31
- package/src/api/index.js +1 -1
- package/src/api/mock.http +2 -2
- package/src/api/requestUrl.js +185 -185
- package/src/assets/js/AliyunlssUtil.js +92 -92
- package/src/assets/js/Base64Util.js +22 -22
- package/src/assets/js/common.js +11 -11
- package/src/assets/js/hammer.js +89 -89
- package/src/assets/js/obsBrowser.js +32 -0
- package/src/assets/js/script.js +36 -36
- package/src/assets/less/common.css +6773 -6773
- package/src/assets/less/converSationContainer/common.less +192 -192
- package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
- package/src/assets/less/iconfont.css +37 -37
- package/src/assets/less/ticketMessage.less +294 -294
- package/src/components/ActionAlertIframe.vue +112 -112
- package/src/components/AiGuide.vue +467 -467
- package/src/components/AnswerDocknowledge.vue +492 -492
- package/src/components/AnswerVoice.vue +285 -285
- package/src/components/AskIFrame.vue +15 -15
- package/src/components/ConversationContainer.vue +5089 -5089
- package/src/components/FileType.vue +86 -86
- package/src/components/Message.vue +27 -27
- package/src/components/actionSatisfaction.vue +107 -107
- package/src/components/actionSendToBot.vue +62 -62
- package/src/components/answerDissatisfaction.vue +62 -62
- package/src/components/answerRadio.vue +131 -131
- package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
- package/src/components/ask-components/Msgloading.vue +37 -37
- package/src/components/ask-components/SatisfactionV2.vue +15 -15
- package/src/components/askVideo.vue +141 -138
- package/src/components/assetDetails.vue +370 -370
- package/src/components/assetMessage.vue +228 -228
- package/src/components/associationIntention.vue +349 -349
- package/src/components/attachmentPreview.vue +90 -90
- package/src/components/botActionSatisfactor.vue +68 -68
- package/src/components/chatContent.vue +513 -513
- package/src/components/feedBack.vue +136 -136
- package/src/components/fielListView.vue +351 -351
- package/src/components/file/AliyunOssComponents.vue +108 -108
- package/src/components/formTemplate.vue +3562 -3557
- package/src/components/kkview.vue +1138 -1138
- package/src/components/loadingProcess.vue +164 -164
- package/src/components/message/ActionAlertIframe.vue +112 -112
- package/src/components/message/ShopMessage.vue +164 -164
- package/src/components/message/TextMessage.vue +924 -924
- package/src/components/message/TicketMessage.vue +201 -201
- package/src/components/message/swiper/index.js +4 -4
- package/src/components/message/swiper/ticketSwiper.vue +503 -503
- package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
- package/src/components/msgLoading.vue +231 -231
- package/src/components/myPopup.vue +70 -70
- package/src/components/pdfPosition.vue +1322 -1322
- package/src/components/popup.vue +227 -227
- package/src/components/previewDoc.vue +242 -242
- package/src/components/previewPdf.vue +302 -302
- package/src/components/receiverMessagePlatform.vue +65 -65
- package/src/components/recommend.vue +89 -89
- package/src/components/selector/hOption.vue +20 -20
- package/src/components/selector/hSelector.vue +199 -199
- package/src/components/selector/hWrapper.vue +216 -216
- package/src/components/senderMessagePlatform.vue +50 -50
- package/src/components/source/BotMessage.vue +24 -24
- package/src/components/source/CustomMessage.vue +24 -24
- package/src/components/test.vue +260 -260
- package/src/components/tree.vue +294 -294
- package/src/components/utils/AliyunIssUtil.js +81 -81
- package/src/components/utils/ckeditor.js +177 -174
- package/src/components/utils/ckeditorImageUpload/command.js +111 -109
- package/src/components/utils/ckeditorImageUpload/editing.js +11 -11
- package/src/components/utils/ckeditorImageUpload/plugin-image.js +11 -11
- package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +40 -40
- package/src/components/utils/ckeditorfileUpload/common.js +173 -180
- package/src/components/utils/ckeditorfileUpload/editing.js +11 -11
- package/src/components/utils/ckeditorfileUpload/plugin_file.js +11 -11
- package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +34 -34
- package/src/components/utils/format_date.js +25 -25
- package/src/components/utils/index.js +6 -6
- package/src/components/utils/math_utils.js +29 -29
- package/src/components/voiceComponent.vue +119 -119
- package/src/main.js +60 -60
- package/vue.config.js +55 -55
|
@@ -1,350 +1,350 @@
|
|
|
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 :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.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"></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'],
|
|
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) {
|
|
233
|
-
this.$emit("onRadioClick", id, name, apikey);
|
|
234
|
-
},
|
|
235
|
-
onImageClick(url){
|
|
236
|
-
this.$emit('onImageClick',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
|
-
}
|
|
347
|
-
/deep/.el-drawer__body{
|
|
348
|
-
height: 100%;
|
|
349
|
-
}
|
|
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 :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.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"></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'],
|
|
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) {
|
|
233
|
+
this.$emit("onRadioClick", id, name, apikey);
|
|
234
|
+
},
|
|
235
|
+
onImageClick(url){
|
|
236
|
+
this.$emit('onImageClick',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
|
+
}
|
|
347
|
+
/deep/.el-drawer__body{
|
|
348
|
+
height: 100%;
|
|
349
|
+
}
|
|
350
350
|
</style>
|