askbot-dragon 1.4.2 → 1.4.3

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 (85) 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 +58 -58
  5. package/public/index.html +59 -59
  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/hammer.js +71 -71
  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 +191 -191
  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 +211 -211
  20. package/src/components/ActionAlertIframe.vue +112 -112
  21. package/src/components/AiGuide.vue +467 -467
  22. package/src/components/AnswerDocknowledge.vue +446 -446
  23. package/src/components/AnswerVoice.vue +285 -280
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +4029 -4028
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/actionSatisfaction.vue +107 -107
  29. package/src/components/actionSendToBot.vue +62 -62
  30. package/src/components/answerDissatisfaction.vue +62 -62
  31. package/src/components/answerRadio.vue +108 -108
  32. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  33. package/src/components/ask-components/Msgloading.vue +37 -37
  34. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  35. package/src/components/askVideo.vue +138 -138
  36. package/src/components/assetDetails.vue +370 -370
  37. package/src/components/assetMessage.vue +228 -228
  38. package/src/components/associationIntention.vue +331 -331
  39. package/src/components/attachmentPreview.vue +90 -90
  40. package/src/components/botActionSatisfactor.vue +68 -68
  41. package/src/components/chatContent.vue +513 -513
  42. package/src/components/feedBack.vue +136 -136
  43. package/src/components/fielListView.vue +349 -349
  44. package/src/components/file/AliyunOssComponents.vue +108 -108
  45. package/src/components/formTemplate.vue +3362 -3362
  46. package/src/components/loadingProcess.vue +164 -164
  47. package/src/components/message/ActionAlertIframe.vue +112 -112
  48. package/src/components/message/ShopMessage.vue +164 -164
  49. package/src/components/message/TextMessage.vue +924 -924
  50. package/src/components/message/TicketMessage.vue +177 -177
  51. package/src/components/message/swiper/index.js +4 -4
  52. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  53. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  54. package/src/components/msgLoading.vue +231 -231
  55. package/src/components/myPopup.vue +70 -70
  56. package/src/components/pdfPosition.vue +829 -829
  57. package/src/components/popup.vue +227 -227
  58. package/src/components/previewDoc.vue +228 -228
  59. package/src/components/previewPdf.vue +257 -257
  60. package/src/components/receiverMessagePlatform.vue +65 -65
  61. package/src/components/recommend.vue +89 -89
  62. package/src/components/selector/hOption.vue +20 -20
  63. package/src/components/selector/hSelector.vue +199 -199
  64. package/src/components/selector/hWrapper.vue +216 -216
  65. package/src/components/senderMessagePlatform.vue +50 -50
  66. package/src/components/source/BotMessage.vue +24 -24
  67. package/src/components/source/CustomMessage.vue +24 -24
  68. package/src/components/test.vue +260 -260
  69. package/src/components/tree.vue +294 -294
  70. package/src/components/utils/AliyunIssUtil.js +72 -72
  71. package/src/components/utils/ckeditor.js +155 -155
  72. package/src/components/utils/ckeditorImageUpload/command.js +109 -109
  73. package/src/components/utils/ckeditorImageUpload/editing.js +11 -11
  74. package/src/components/utils/ckeditorImageUpload/plugin-image.js +11 -11
  75. package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +40 -40
  76. package/src/components/utils/ckeditorfileUpload/common.js +133 -133
  77. package/src/components/utils/ckeditorfileUpload/editing.js +11 -11
  78. package/src/components/utils/ckeditorfileUpload/plugin_file.js +11 -11
  79. package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +34 -34
  80. package/src/components/utils/format_date.js +25 -25
  81. package/src/components/utils/index.js +6 -6
  82. package/src/components/utils/math_utils.js +29 -29
  83. package/src/components/voiceComponent.vue +119 -119
  84. package/src/main.js +60 -60
  85. package/vue.config.js +55 -55
@@ -1,447 +1,447 @@
1
- <template>
2
- <div class="answer-docknowledge">
3
- <div v-if="msg.content.type == 0" class="answer-text">
4
- <template v-if="msg.content.renderType == 1">
5
- <p v-html="msg.content.text"></p>
6
- </template>
7
- <template v-else>
8
- {{ msg.content.text }}
9
- </template>
10
- </div>
11
- <div v-if="msg.content.type == 1" class="answer-text">
12
- <template v-if="msg.content.renderType == 1">
13
- <p v-html="msg.content.text"></p>
14
- </template>
15
- <template v-else>
16
- {{ msg.content.text }}
17
- </template>
18
- </div>
19
- <div class="ad-list">
20
- <div v-for="(item, itemIndex) in msg.content.list" :style="{paddingBottom: itemIndex === msg.content.list.length - 1?0:'10px'}" :key="itemIndex" class="ad-list-cell">
21
- <div class="alc-title">
22
- <div class="alc-box">
23
- <div class="alc-source-left">
24
- <span class="source-form">出自</span>
25
- <img class="alc-title-icon" height="24px" width="24px" :src="item.src" alt="" srcset="">
26
- <span class="alc-title-from">{{ item.from }}</span>
27
- </div>
28
-
29
- </div>
30
- <div v-html="item.introduction" v-if="!srcContentTypeIMG(item)" class="alc-box-introduction">
31
- </div>
32
- <div v-else class="alc-box-introduction">
33
- <img :src="item.expiredUrl" alt="" @click="lookAttach(item.url, item, $event)">
34
- </div>
35
- <div class="alc-updateTime">
36
- <div v-show="docSource[item.source]" class="upload-source">
37
- {{docSource[item.source]}}
38
- </div>
39
- <div v-show="item.url" class="alc-content-text">
40
- <span @click="lookAttach(item.url, item, $event)" class="aci-view">查看 ></span>
41
- </div>
42
- <!-- <div class="time">
43
- <span>更新时间:</span>
44
- {{ new Date(item.updateTime).Format('MM-dd hh:mm') }}
45
- </div> -->
46
- </div>
47
- <!-- <span v-if="isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>-->
48
- </div>
49
- <div class="alc-content" v-if="false">
50
- <div v-if="msg.content.type == 1" class="alc-content-text">{{ item.introduction }} <span
51
- @click="lookAttach(item.url, item, $event)" class="aci-view">查看原文 ></span>
52
- </div>
53
- <span v-if="!isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>
54
- <div v-if="false" class="alc-content-info">
55
- <div class="alcc-box">
56
- <span class="aci-owner">所有者: {{ item.owner }}</span>
57
- <span class="aci-enterprise">所属企业: {{ item.enterprise }}</span>
58
- <span class="aci-source">文件来源: {{ item.source }}</span>
59
- </div>
60
- </div>
61
- </div>
62
- </div>
63
- </div>
64
- <previewPdf ref="previewPdf" :url="previewHref" officePreviewType="pdf"></previewPdf>
65
- </div>
66
- </template>
67
-
68
- <script>
69
- /* eslint-disable */
70
- import previewPdf from "./previewPdf";
71
- import { isMobile } from "../assets/js/common";
72
- export default {
73
- name: "answerDocknowledge",
74
- components: { previewPdf },
75
- data() {
76
- return {
77
- isPC: true,
78
- previewHref: "",
79
- docSource: {
80
- LOCAL_FILE: "来源于本地文件",
81
- CREATED_BY_ONESELF: "来源于自建知识",
82
- WECHAT: "来源于微信",
83
- AUTO_SYN_FROM_LOCAL_FILE: "自动同步于本地",
84
- YUQUE: "来源于语雀",
85
- CORP_LOCAL_FILE:'来源于企业知识库'
86
- },
87
- imageObj: {
88
- PDF: 'pdf1',
89
- pdf: 'pdf1',
90
- TXT: 'txt1',
91
- txt: 'txt1',
92
- selfadd: 'selfadd1',
93
- md: "md2",
94
- html: 'selfadd1',
95
- mode: "mode",
96
- general: 'general',
97
- word: "word1",
98
- Word: "word1",
99
- docx: "word1",
100
- doc: "word1",
101
- WORD: "word1",
102
- Excel: 'excel1',
103
- EXCEL: 'excel1',
104
- excel: 'excel1',
105
- PPT: 'ppt1',
106
- ppt: 'ppt1',
107
- pptx: 'ppt1',
108
- img: "image1",
109
- image: "image1",
110
- video: "video",
111
- audio: 'audio',
112
- link: "link",
113
- wechat: "wechat",
114
- mp4: "video",
115
- MP4: "video",
116
- xlsx: "excel1",
117
- xls: "excel1",
118
- jpg: "image1",
119
- jpeg: "image1",
120
- png: "image1",
121
- webp: "image1",
122
- gif: "image1",
123
- svg: "image1",
124
- bmp: "image1",
125
- avi: "video",
126
- mov: "video",
127
- rmvb: "video",
128
- wav: "audio",
129
- mp3: "audio",
130
- yqhtml: "yqhtml",
131
- }
132
- }
133
- },
134
- props: ['msg','isAskLightning', 'isMessageRecord'],
135
- beforeMounted() {
136
-
137
- },
138
- watch:{
139
- msg:{
140
- handler(n){
141
- n.content.list.forEach(element => {
142
- console.log(this.imageObj[element.format],1111);
143
- element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
144
- if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
145
- element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
146
- }
147
- });
148
- },
149
- deep:true,
150
- immediate:true
151
- }
152
- },
153
- created() {
154
- var system = {};
155
- system.pingtai = /(Win32|Win16|WinCE|Mac68K|MacIntel|MacIntel|MacPPC|Linux mips64)/i.test(navigator.platform);
156
- if (system.pingtai) {
157
- //电脑
158
- this.isPC = true;
159
- } else {
160
- //手机
161
- this.isPC = false;
162
- }
163
- // this.msg.content.list.forEach(element => {
164
- // console.log(this.imageObj[element.format],1111);
165
- // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
166
- // if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
167
- // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
168
- // }
169
- // });
170
- },
171
- mounted() {
172
-
173
- },
174
- methods: {
175
- //预览图片
176
- lookAttach(url, item, event) {
177
- event.preventDefault();
178
- if (this.isAskLightning == 1){
179
- window.parent.postMessage({
180
- data: "bot_preview",
181
- item: JSON.stringify(item),
182
- url: url
183
- },"*");
184
- } else {
185
- // if (isMobile()) {
186
- // this.$refs.previewPdf.drawer = true;
187
- // this.$refs.previewPdf.previewShowPopup = false;
188
- // } else {
189
- // this.$refs.previewPdf.drawer = false;
190
- // }
191
- this.$refs.previewPdf.previewShowPopup = false;
192
- this.$refs.previewPdf.drawer = false;
193
- let index = url.lastIndexOf('?')
194
- let type = ''
195
- let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
196
- if (index !== -1) {
197
- url = url.substring(0, index)
198
- type = this.fileType(url)
199
- } else {
200
- type = this.fileType(url)
201
- }
202
- if (type === '' || type === 'OTHER') {
203
- httpUrl = httpUrl += '?needEncrypt=true'
204
- } else {
205
- httpUrl = httpUrl += '?needEncrypt=false'
206
- }
207
- this.$http.post(httpUrl, {
208
- "fileInOssPath":url
209
- }).then(res =>{
210
- if(res.data.code == '0') {
211
- this.previewHref = res.data.data;
212
- if (isMobile()){
213
- this.$refs.previewPdf.drawer = true;
214
- this.$refs.previewPdf.previewShowPopup = true;
215
- } else {
216
- this.$refs.previewPdf.previewShowPopup = false;
217
- this.$refs.previewPdf.drawer = true;
218
- }
219
- this.$refs.previewPdf.fileType = type
220
- // this.$refs.previewPdf.tagIds = item.tagIds
221
- this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false
222
- this.$refs.previewPdf.tagIds = ["64591b7d8bb8ab1b91c65f24"]
223
-
224
- if(item.tagIds && item.tagIds.length != 0) {
225
- this.$refs.previewPdf.loading = false
226
- return
227
- }
228
- this.$nextTick(() =>{
229
- if(item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
230
- this.$refs.previewPdf.getBolb(item)
231
- }
232
- this.$refs.previewPdf.loadIframe(item)
233
- })
234
- }
235
- })
236
- }
237
- },
238
- fileType (url) {
239
- const fileType = url.substring(url.lastIndexOf('.'));
240
- if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.MOVC' || fileType === '.mov' || fileType === '.movc' || fileType === '.mav' || fileType === '.MAV' || fileType == '.mp3' || fileType == '.MP3') {
241
- return 'VIDEO'
242
- } else if (fileType === '.html') {
243
- return 'HTML'
244
- } else {
245
- return 'OTHER'
246
- }
247
- },
248
- srcContentTypeIMG(item) {
249
- let url = item.url
250
- const type = url.substring(url.lastIndexOf('.'));
251
- if(type === '.jpg' || type === '.jpeg' || type === '.png' || type === '.gif') {
252
- this.getSrc(item)
253
- return true
254
- } else {
255
- return false
256
- }
257
- },
258
- getSrc (item) {
259
- // let imgurl = ''
260
- this.$http.post(
261
- '/knowledge-api/temporary-certificate/or-origin?expired=30',
262
- item.url,
263
- {
264
- headers: {
265
- "Content-Type": "application/json",
266
- },
267
- }).then( res => {
268
- console.log(res,'=====');
269
- // imgurl = await res.bodyText
270
- this.$set(item,'expiredUrl',res.data ? res.data : res.bodyText)
271
- // return res.data
272
- })
273
- // return imgurl
274
- }
275
- }
276
- }
277
- </script>
278
-
279
- <style scoped lang="less">
280
- .answer-docknowledge {
281
- min-width: 100px;
282
-
283
- .answer-text {
284
- // font-size: 13px;
285
- text-align: left;
286
- line-height: 25px;
287
- padding: 0px 0px 12px 0px;
288
-
289
- .aci-view {
290
- // font-size: 13px;
291
- display: inline-block;
292
- // margin-left: 5px;
293
- color: #366aff;
294
- cursor: pointer;
295
- }
296
- }
297
-
298
- .ad-list {
299
- .ad-list-cell {
300
- border-top: solid 1px #E0E6F7;
301
- padding: 10px 0 10px;
302
-
303
- .alc-title {
304
- display: flex;
305
- flex-wrap: wrap;
306
- align-items: center;
307
- justify-content: space-between;
308
- line-height: 16px;
309
-
310
- .alc-box {
311
- display: flex;
312
- align-items: center;
313
- justify-content: space-between;
314
- // font-size: 12px;
315
- width: 100%;
316
- .alc-source-left{
317
- display: flex;
318
- align-items: center;
319
- .source-form{
320
- width: 34px;
321
- flex: none;
322
- color: #A9B3C6;
323
- }
324
- }
325
- .alc-content-text{
326
- width: 55px;
327
- flex: none;
328
- .aci-view{
329
- color: #366aff;
330
- cursor: pointer;
331
- }
332
- }
333
- .alc-title-from {
334
- line-height: 22px;
335
- word-break: break-all !important;
336
- text-align: left;
337
- flex: auto;
338
- display: flex;
339
- justify-content: flex-start;
340
- }
341
- }
342
- .alc-box-introduction{
343
- overflow: hidden;
344
- text-overflow: ellipsis;
345
- display: -webkit-box;
346
- -webkit-line-clamp:3;
347
- -webkit-box-orient:vertical;
348
- margin-top: 10px;
349
- color: #616161;
350
- // font-size: 12px;
351
- line-height: 24px;
352
- text-align: left;
353
- img {
354
- width: 50px;
355
- height: 50px;
356
- margin: 10px;
357
- cursor: pointer;
358
- }
359
- }
360
- .alc-updateTime{
361
- display: flex;
362
- align-items: center;
363
- justify-content: space-between;
364
- font-size: 13px;
365
- width: 100%;
366
- margin-top: 10px;
367
- .upload-source{
368
- flex: none;
369
- height: 18px;
370
- line-height: 18px;
371
- background: #E9F9F8;
372
- border: 1px solid #AFF2CD;
373
- border-radius: 2px;
374
- display: flex;
375
- align-items: center;
376
- justify-content: center;
377
- padding: 0 8px;
378
- color: #00C2BB;
379
- }
380
- .time{
381
- color: #999999;
382
- margin-left: 10px;
383
- }
384
- .alc-content-text {
385
- color: #366aff;
386
- cursor: pointer;
387
- }
388
- }
389
- .alc-title-icon {
390
- margin: 0 2px;
391
- width: 18px;
392
- height: 18px;
393
- flex: none;
394
- }
395
-
396
- .alc-title-updateTime {
397
- text-align: right;
398
- color: #999999;
399
- // font-size: 13px;
400
- }
401
- }
402
-
403
- .alc-content {
404
- .alc-title-updateTime {
405
- margin-top: 6px;
406
- display: block;
407
- text-align: right;
408
- color: #999999;
409
- // font-size: 13px;
410
- }
411
-
412
- .alc-content-text {
413
- margin-bottom: 6px;
414
- width: 55px;
415
- flex: none;
416
- .aci-view {
417
- display: inline-block;
418
- margin-left: 30px;
419
- color: #366aff;
420
- cursor: pointer;
421
- }
422
- }
423
-
424
- .alc-content-info {
425
- display: flex;
426
- flex-wrap: wrap;
427
- justify-content: space-between;
428
-
429
- .alcc-box {
430
- display: flex;
431
- flex-wrap: wrap;
432
- color: #999999;
433
-
434
- .aci-owner {
435
- margin-right: 20px;
436
- }
437
-
438
- .aci-enterprise {
439
- margin-right: 20px;
440
- }
441
- }
442
- }
443
- }
444
- }
445
- }
446
- }
1
+ <template>
2
+ <div class="answer-docknowledge">
3
+ <div v-if="msg.content.type == 0" class="answer-text">
4
+ <template v-if="msg.content.renderType == 1">
5
+ <p v-html="msg.content.text"></p>
6
+ </template>
7
+ <template v-else>
8
+ {{ msg.content.text }}
9
+ </template>
10
+ </div>
11
+ <div v-if="msg.content.type == 1" class="answer-text">
12
+ <template v-if="msg.content.renderType == 1">
13
+ <p v-html="msg.content.text"></p>
14
+ </template>
15
+ <template v-else>
16
+ {{ msg.content.text }}
17
+ </template>
18
+ </div>
19
+ <div class="ad-list">
20
+ <div v-for="(item, itemIndex) in msg.content.list" :style="{paddingBottom: itemIndex === msg.content.list.length - 1?0:'10px'}" :key="itemIndex" class="ad-list-cell">
21
+ <div class="alc-title">
22
+ <div class="alc-box">
23
+ <div class="alc-source-left">
24
+ <span class="source-form">出自</span>
25
+ <img class="alc-title-icon" height="24px" width="24px" :src="item.src" alt="" srcset="">
26
+ <span class="alc-title-from">{{ item.from }}</span>
27
+ </div>
28
+
29
+ </div>
30
+ <div v-html="item.introduction" v-if="!srcContentTypeIMG(item)" class="alc-box-introduction">
31
+ </div>
32
+ <div v-else class="alc-box-introduction">
33
+ <img :src="item.expiredUrl" alt="" @click="lookAttach(item.url, item, $event)">
34
+ </div>
35
+ <div class="alc-updateTime">
36
+ <div v-show="docSource[item.source]" class="upload-source">
37
+ {{docSource[item.source]}}
38
+ </div>
39
+ <div v-show="item.url" class="alc-content-text">
40
+ <span @click="lookAttach(item.url, item, $event)" class="aci-view">查看 ></span>
41
+ </div>
42
+ <!-- <div class="time">
43
+ <span>更新时间:</span>
44
+ {{ new Date(item.updateTime).Format('MM-dd hh:mm') }}
45
+ </div> -->
46
+ </div>
47
+ <!-- <span v-if="isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>-->
48
+ </div>
49
+ <div class="alc-content" v-if="false">
50
+ <div v-if="msg.content.type == 1" class="alc-content-text">{{ item.introduction }} <span
51
+ @click="lookAttach(item.url, item, $event)" class="aci-view">查看原文 ></span>
52
+ </div>
53
+ <span v-if="!isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>
54
+ <div v-if="false" class="alc-content-info">
55
+ <div class="alcc-box">
56
+ <span class="aci-owner">所有者: {{ item.owner }}</span>
57
+ <span class="aci-enterprise">所属企业: {{ item.enterprise }}</span>
58
+ <span class="aci-source">文件来源: {{ item.source }}</span>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ <previewPdf ref="previewPdf" :url="previewHref" officePreviewType="pdf"></previewPdf>
65
+ </div>
66
+ </template>
67
+
68
+ <script>
69
+ /* eslint-disable */
70
+ import previewPdf from "./previewPdf";
71
+ import { isMobile } from "../assets/js/common";
72
+ export default {
73
+ name: "answerDocknowledge",
74
+ components: { previewPdf },
75
+ data() {
76
+ return {
77
+ isPC: true,
78
+ previewHref: "",
79
+ docSource: {
80
+ LOCAL_FILE: "来源于本地文件",
81
+ CREATED_BY_ONESELF: "来源于自建知识",
82
+ WECHAT: "来源于微信",
83
+ AUTO_SYN_FROM_LOCAL_FILE: "自动同步于本地",
84
+ YUQUE: "来源于语雀",
85
+ CORP_LOCAL_FILE:'来源于企业知识库'
86
+ },
87
+ imageObj: {
88
+ PDF: 'pdf1',
89
+ pdf: 'pdf1',
90
+ TXT: 'txt1',
91
+ txt: 'txt1',
92
+ selfadd: 'selfadd1',
93
+ md: "md2",
94
+ html: 'selfadd1',
95
+ mode: "mode",
96
+ general: 'general',
97
+ word: "word1",
98
+ Word: "word1",
99
+ docx: "word1",
100
+ doc: "word1",
101
+ WORD: "word1",
102
+ Excel: 'excel1',
103
+ EXCEL: 'excel1',
104
+ excel: 'excel1',
105
+ PPT: 'ppt1',
106
+ ppt: 'ppt1',
107
+ pptx: 'ppt1',
108
+ img: "image1",
109
+ image: "image1",
110
+ video: "video",
111
+ audio: 'audio',
112
+ link: "link",
113
+ wechat: "wechat",
114
+ mp4: "video",
115
+ MP4: "video",
116
+ xlsx: "excel1",
117
+ xls: "excel1",
118
+ jpg: "image1",
119
+ jpeg: "image1",
120
+ png: "image1",
121
+ webp: "image1",
122
+ gif: "image1",
123
+ svg: "image1",
124
+ bmp: "image1",
125
+ avi: "video",
126
+ mov: "video",
127
+ rmvb: "video",
128
+ wav: "audio",
129
+ mp3: "audio",
130
+ yqhtml: "yqhtml",
131
+ }
132
+ }
133
+ },
134
+ props: ['msg','isAskLightning', 'isMessageRecord'],
135
+ beforeMounted() {
136
+
137
+ },
138
+ watch:{
139
+ msg:{
140
+ handler(n){
141
+ n.content.list.forEach(element => {
142
+ console.log(this.imageObj[element.format],1111);
143
+ element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
144
+ if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
145
+ element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
146
+ }
147
+ });
148
+ },
149
+ deep:true,
150
+ immediate:true
151
+ }
152
+ },
153
+ created() {
154
+ var system = {};
155
+ system.pingtai = /(Win32|Win16|WinCE|Mac68K|MacIntel|MacIntel|MacPPC|Linux mips64)/i.test(navigator.platform);
156
+ if (system.pingtai) {
157
+ //电脑
158
+ this.isPC = true;
159
+ } else {
160
+ //手机
161
+ this.isPC = false;
162
+ }
163
+ // this.msg.content.list.forEach(element => {
164
+ // console.log(this.imageObj[element.format],1111);
165
+ // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
166
+ // if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
167
+ // element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
168
+ // }
169
+ // });
170
+ },
171
+ mounted() {
172
+
173
+ },
174
+ methods: {
175
+ //预览图片
176
+ lookAttach(url, item, event) {
177
+ event.preventDefault();
178
+ if (this.isAskLightning == 1){
179
+ window.parent.postMessage({
180
+ data: "bot_preview",
181
+ item: JSON.stringify(item),
182
+ url: url
183
+ },"*");
184
+ } else {
185
+ // if (isMobile()) {
186
+ // this.$refs.previewPdf.drawer = true;
187
+ // this.$refs.previewPdf.previewShowPopup = false;
188
+ // } else {
189
+ // this.$refs.previewPdf.drawer = false;
190
+ // }
191
+ this.$refs.previewPdf.previewShowPopup = false;
192
+ this.$refs.previewPdf.drawer = false;
193
+ let index = url.lastIndexOf('?')
194
+ let type = ''
195
+ let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
196
+ if (index !== -1) {
197
+ url = url.substring(0, index)
198
+ type = this.fileType(url)
199
+ } else {
200
+ type = this.fileType(url)
201
+ }
202
+ if (type === '' || type === 'OTHER') {
203
+ httpUrl = httpUrl += '?needEncrypt=true'
204
+ } else {
205
+ httpUrl = httpUrl += '?needEncrypt=false'
206
+ }
207
+ this.$http.post(httpUrl, {
208
+ "fileInOssPath":url
209
+ }).then(res =>{
210
+ if(res.data.code == '0') {
211
+ this.previewHref = res.data.data;
212
+ if (isMobile()){
213
+ this.$refs.previewPdf.drawer = true;
214
+ this.$refs.previewPdf.previewShowPopup = true;
215
+ } else {
216
+ this.$refs.previewPdf.previewShowPopup = false;
217
+ this.$refs.previewPdf.drawer = true;
218
+ }
219
+ this.$refs.previewPdf.fileType = type
220
+ // this.$refs.previewPdf.tagIds = item.tagIds
221
+ this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false
222
+ this.$refs.previewPdf.tagIds = ["64591b7d8bb8ab1b91c65f24"]
223
+
224
+ if(item.tagIds && item.tagIds.length != 0) {
225
+ this.$refs.previewPdf.loading = false
226
+ return
227
+ }
228
+ this.$nextTick(() =>{
229
+ if(item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
230
+ this.$refs.previewPdf.getBolb(item)
231
+ }
232
+ this.$refs.previewPdf.loadIframe(item)
233
+ })
234
+ }
235
+ })
236
+ }
237
+ },
238
+ fileType (url) {
239
+ const fileType = url.substring(url.lastIndexOf('.'));
240
+ if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.MOVC' || fileType === '.mov' || fileType === '.movc' || fileType === '.mav' || fileType === '.MAV' || fileType == '.mp3' || fileType == '.MP3') {
241
+ return 'VIDEO'
242
+ } else if (fileType === '.html') {
243
+ return 'HTML'
244
+ } else {
245
+ return 'OTHER'
246
+ }
247
+ },
248
+ srcContentTypeIMG(item) {
249
+ let url = item.url
250
+ const type = url.substring(url.lastIndexOf('.'));
251
+ if(type === '.jpg' || type === '.jpeg' || type === '.png' || type === '.gif') {
252
+ this.getSrc(item)
253
+ return true
254
+ } else {
255
+ return false
256
+ }
257
+ },
258
+ getSrc (item) {
259
+ // let imgurl = ''
260
+ this.$http.post(
261
+ '/knowledge-api/temporary-certificate/or-origin?expired=30',
262
+ item.url,
263
+ {
264
+ headers: {
265
+ "Content-Type": "application/json",
266
+ },
267
+ }).then( res => {
268
+ console.log(res,'=====');
269
+ // imgurl = await res.bodyText
270
+ this.$set(item,'expiredUrl',res.data ? res.data : res.bodyText)
271
+ // return res.data
272
+ })
273
+ // return imgurl
274
+ }
275
+ }
276
+ }
277
+ </script>
278
+
279
+ <style scoped lang="less">
280
+ .answer-docknowledge {
281
+ min-width: 100px;
282
+
283
+ .answer-text {
284
+ // font-size: 13px;
285
+ text-align: left;
286
+ line-height: 25px;
287
+ padding: 0px 0px 12px 0px;
288
+
289
+ .aci-view {
290
+ // font-size: 13px;
291
+ display: inline-block;
292
+ // margin-left: 5px;
293
+ color: #366aff;
294
+ cursor: pointer;
295
+ }
296
+ }
297
+
298
+ .ad-list {
299
+ .ad-list-cell {
300
+ border-top: solid 1px #E0E6F7;
301
+ padding: 10px 0 10px;
302
+
303
+ .alc-title {
304
+ display: flex;
305
+ flex-wrap: wrap;
306
+ align-items: center;
307
+ justify-content: space-between;
308
+ line-height: 16px;
309
+
310
+ .alc-box {
311
+ display: flex;
312
+ align-items: center;
313
+ justify-content: space-between;
314
+ // font-size: 12px;
315
+ width: 100%;
316
+ .alc-source-left{
317
+ display: flex;
318
+ align-items: center;
319
+ .source-form{
320
+ width: 34px;
321
+ flex: none;
322
+ color: #A9B3C6;
323
+ }
324
+ }
325
+ .alc-content-text{
326
+ width: 55px;
327
+ flex: none;
328
+ .aci-view{
329
+ color: #366aff;
330
+ cursor: pointer;
331
+ }
332
+ }
333
+ .alc-title-from {
334
+ line-height: 22px;
335
+ word-break: break-all !important;
336
+ text-align: left;
337
+ flex: auto;
338
+ display: flex;
339
+ justify-content: flex-start;
340
+ }
341
+ }
342
+ .alc-box-introduction{
343
+ overflow: hidden;
344
+ text-overflow: ellipsis;
345
+ display: -webkit-box;
346
+ -webkit-line-clamp:3;
347
+ -webkit-box-orient:vertical;
348
+ margin-top: 10px;
349
+ color: #616161;
350
+ // font-size: 12px;
351
+ line-height: 24px;
352
+ text-align: left;
353
+ img {
354
+ width: 50px;
355
+ height: 50px;
356
+ margin: 10px;
357
+ cursor: pointer;
358
+ }
359
+ }
360
+ .alc-updateTime{
361
+ display: flex;
362
+ align-items: center;
363
+ justify-content: space-between;
364
+ font-size: 13px;
365
+ width: 100%;
366
+ margin-top: 10px;
367
+ .upload-source{
368
+ flex: none;
369
+ height: 18px;
370
+ line-height: 18px;
371
+ background: #E9F9F8;
372
+ border: 1px solid #AFF2CD;
373
+ border-radius: 2px;
374
+ display: flex;
375
+ align-items: center;
376
+ justify-content: center;
377
+ padding: 0 8px;
378
+ color: #00C2BB;
379
+ }
380
+ .time{
381
+ color: #999999;
382
+ margin-left: 10px;
383
+ }
384
+ .alc-content-text {
385
+ color: #366aff;
386
+ cursor: pointer;
387
+ }
388
+ }
389
+ .alc-title-icon {
390
+ margin: 0 2px;
391
+ width: 18px;
392
+ height: 18px;
393
+ flex: none;
394
+ }
395
+
396
+ .alc-title-updateTime {
397
+ text-align: right;
398
+ color: #999999;
399
+ // font-size: 13px;
400
+ }
401
+ }
402
+
403
+ .alc-content {
404
+ .alc-title-updateTime {
405
+ margin-top: 6px;
406
+ display: block;
407
+ text-align: right;
408
+ color: #999999;
409
+ // font-size: 13px;
410
+ }
411
+
412
+ .alc-content-text {
413
+ margin-bottom: 6px;
414
+ width: 55px;
415
+ flex: none;
416
+ .aci-view {
417
+ display: inline-block;
418
+ margin-left: 30px;
419
+ color: #366aff;
420
+ cursor: pointer;
421
+ }
422
+ }
423
+
424
+ .alc-content-info {
425
+ display: flex;
426
+ flex-wrap: wrap;
427
+ justify-content: space-between;
428
+
429
+ .alcc-box {
430
+ display: flex;
431
+ flex-wrap: wrap;
432
+ color: #999999;
433
+
434
+ .aci-owner {
435
+ margin-right: 20px;
436
+ }
437
+
438
+ .aci-enterprise {
439
+ margin-right: 20px;
440
+ }
441
+ }
442
+ }
443
+ }
444
+ }
445
+ }
446
+ }
447
447
  </style>