askbot-dragon 1.3.85 → 1.3.87

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 +428 -428
  23. package/src/components/AnswerVoice.vue +280 -280
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +4106 -4106
  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 +76 -76
  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 -3363
  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 +783 -783
  57. package/src/components/popup.vue +227 -227
  58. package/src/components/previewDoc.vue +228 -228
  59. package/src/components/previewPdf.vue +260 -260
  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 -111
  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,429 +1,429 @@
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'],
135
- beforeMounted() {
136
-
137
- },
138
- created() {
139
- var system = {};
140
- system.pingtai = /(Win32|Win16|WinCE|Mac68K|MacIntel|MacIntel|MacPPC|Linux mips64)/i.test(navigator.platform);
141
- if (system.pingtai) {
142
- //电脑
143
- this.isPC = true;
144
- } else {
145
- //手机
146
- this.isPC = false;
147
- }
148
- this.msg.content.list.forEach(element => {
149
- element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
150
- if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
151
- element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
152
- }
153
- });
154
- },
155
- mounted() {
156
-
157
- },
158
- methods: {
159
- //预览图片
160
- lookAttach(url, item, event) {
161
- event.preventDefault();
162
- if (this.isAskLightning == 1){
163
- window.parent.postMessage({
164
- data: "bot_preview",
165
- item: JSON.stringify(item),
166
- url: url
167
- },"*");
168
- } else {
169
- // if (isMobile()) {
170
- // this.$refs.previewPdf.drawer = true;
171
- // this.$refs.previewPdf.previewShowPopup = false;
172
- // } else {
173
- // this.$refs.previewPdf.drawer = false;
174
- // }
175
- this.$refs.previewPdf.previewShowPopup = false;
176
- this.$refs.previewPdf.drawer = false;
177
- let index = url.lastIndexOf('?')
178
- let type = ''
179
- let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
180
- if (index !== -1) {
181
- url = url.substring(0, index)
182
- type = this.fileType(url)
183
- } else {
184
- type = this.fileType(url)
185
- }
186
- if (type === '' || type === 'OTHER') {
187
- httpUrl = httpUrl += '?needEncrypt=true'
188
- } else {
189
- httpUrl = httpUrl += '?needEncrypt=false'
190
- }
191
- this.$http.post(httpUrl, {
192
- "fileInOssPath":url
193
- }).then(res =>{
194
- if(res.data.code == '0') {
195
- this.previewHref = res.data.data;
196
- if (isMobile()){
197
- this.$refs.previewPdf.drawer = true;
198
- this.$refs.previewPdf.previewShowPopup = true;
199
- } else {
200
- this.$refs.previewPdf.previewShowPopup = false;
201
- this.$refs.previewPdf.drawer = true;
202
- }
203
- this.$refs.previewPdf.fileType = type
204
- this.$refs.previewPdf.tagIds = item.tagIds
205
- if(item.tagIds) {
206
- this.$refs.previewPdf.loading = false
207
- return
208
- }
209
- this.$nextTick(() =>{
210
- if(item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
211
- this.$refs.previewPdf.getBolb(item)
212
- } else {
213
- this.$refs.previewPdf.loadIframe(item)
214
- }
215
- })
216
- }
217
- })
218
- }
219
- },
220
- fileType (url) {
221
- const fileType = url.substring(url.lastIndexOf('.'));
222
- if (fileType === '.mp4' || fileType === '.MP4') {
223
- return 'VIDEO'
224
- } else if (fileType === '.html') {
225
- return 'HTML'
226
- } else {
227
- return 'OTHER'
228
- }
229
- },
230
- srcContentTypeIMG(item) {
231
- let url = item.url
232
- const type = url.substring(url.lastIndexOf('.'));
233
- if(type === '.jpg' || type === '.jpeg' || type === '.png' || type === '.gif') {
234
- this.getSrc(item)
235
- return true
236
- } else {
237
- return false
238
- }
239
- },
240
- getSrc (item) {
241
- // let imgurl = ''
242
- this.$http.post(
243
- '/knowledge-api/temporary-certificate/or-origin?expired=30',
244
- item.url,
245
- {
246
- headers: {
247
- "Content-Type": "application/json",
248
- },
249
- }).then( res => {
250
- console.log(res,'=====');
251
- // imgurl = await res.bodyText
252
- this.$set(item,'expiredUrl',res.data ? res.data : res.bodyText)
253
- // return res.data
254
- })
255
- // return imgurl
256
- }
257
- }
258
- }
259
- </script>
260
-
261
- <style scoped lang="less">
262
- .answer-docknowledge {
263
- min-width: 100px;
264
-
265
- .answer-text {
266
- // font-size: 13px;
267
- text-align: left;
268
- line-height: 25px;
269
- padding: 0px 0px 12px 0px;
270
-
271
- .aci-view {
272
- // font-size: 13px;
273
- display: inline-block;
274
- // margin-left: 5px;
275
- color: #366aff;
276
- cursor: pointer;
277
- }
278
- }
279
-
280
- .ad-list {
281
- .ad-list-cell {
282
- border-top: solid 1px #E0E6F7;
283
- padding: 10px 0 10px;
284
-
285
- .alc-title {
286
- display: flex;
287
- flex-wrap: wrap;
288
- align-items: center;
289
- justify-content: space-between;
290
- line-height: 16px;
291
-
292
- .alc-box {
293
- display: flex;
294
- align-items: center;
295
- justify-content: space-between;
296
- // font-size: 12px;
297
- width: 100%;
298
- .alc-source-left{
299
- display: flex;
300
- align-items: center;
301
- .source-form{
302
- width: 34px;
303
- flex: none;
304
- color: #A9B3C6;
305
- }
306
- }
307
- .alc-content-text{
308
- width: 55px;
309
- flex: none;
310
- .aci-view{
311
- color: #366aff;
312
- cursor: pointer;
313
- }
314
- }
315
- .alc-title-from {
316
- line-height: 22px;
317
- word-break: break-all !important;
318
- text-align: left;
319
- flex: auto;
320
- display: flex;
321
- justify-content: flex-start;
322
- }
323
- }
324
- .alc-box-introduction{
325
- overflow: hidden;
326
- text-overflow: ellipsis;
327
- display: -webkit-box;
328
- -webkit-line-clamp:3;
329
- -webkit-box-orient:vertical;
330
- margin-top: 10px;
331
- color: #616161;
332
- // font-size: 12px;
333
- line-height: 24px;
334
- text-align: left;
335
- img {
336
- width: 50px;
337
- height: 50px;
338
- margin: 10px;
339
- cursor: pointer;
340
- }
341
- }
342
- .alc-updateTime{
343
- display: flex;
344
- align-items: center;
345
- justify-content: space-between;
346
- font-size: 13px;
347
- width: 100%;
348
- margin-top: 10px;
349
- .upload-source{
350
- flex: none;
351
- height: 18px;
352
- line-height: 18px;
353
- background: #E9F9F8;
354
- border: 1px solid #AFF2CD;
355
- border-radius: 2px;
356
- display: flex;
357
- align-items: center;
358
- justify-content: center;
359
- padding: 0 8px;
360
- color: #00C2BB;
361
- }
362
- .time{
363
- color: #999999;
364
- margin-left: 10px;
365
- }
366
- .alc-content-text {
367
- color: #366aff;
368
- cursor: pointer;
369
- }
370
- }
371
- .alc-title-icon {
372
- margin: 0 2px;
373
- width: 18px;
374
- height: 18px;
375
- flex: none;
376
- }
377
-
378
- .alc-title-updateTime {
379
- text-align: right;
380
- color: #999999;
381
- // font-size: 13px;
382
- }
383
- }
384
-
385
- .alc-content {
386
- .alc-title-updateTime {
387
- margin-top: 6px;
388
- display: block;
389
- text-align: right;
390
- color: #999999;
391
- // font-size: 13px;
392
- }
393
-
394
- .alc-content-text {
395
- margin-bottom: 6px;
396
- width: 55px;
397
- flex: none;
398
- .aci-view {
399
- display: inline-block;
400
- margin-left: 30px;
401
- color: #366aff;
402
- cursor: pointer;
403
- }
404
- }
405
-
406
- .alc-content-info {
407
- display: flex;
408
- flex-wrap: wrap;
409
- justify-content: space-between;
410
-
411
- .alcc-box {
412
- display: flex;
413
- flex-wrap: wrap;
414
- color: #999999;
415
-
416
- .aci-owner {
417
- margin-right: 20px;
418
- }
419
-
420
- .aci-enterprise {
421
- margin-right: 20px;
422
- }
423
- }
424
- }
425
- }
426
- }
427
- }
428
- }
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'],
135
+ beforeMounted() {
136
+
137
+ },
138
+ created() {
139
+ var system = {};
140
+ system.pingtai = /(Win32|Win16|WinCE|Mac68K|MacIntel|MacIntel|MacPPC|Linux mips64)/i.test(navigator.platform);
141
+ if (system.pingtai) {
142
+ //电脑
143
+ this.isPC = true;
144
+ } else {
145
+ //手机
146
+ this.isPC = false;
147
+ }
148
+ this.msg.content.list.forEach(element => {
149
+ element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/' + this.imageObj[element.format] + '.png';
150
+ if ((element.format === "txt" || element.format === "html") && element.source === "WECHAT") {
151
+ element.src = 'https://static.guoranbot.com/cdn-office-website/askbot_doc/wechat.png';
152
+ }
153
+ });
154
+ },
155
+ mounted() {
156
+
157
+ },
158
+ methods: {
159
+ //预览图片
160
+ lookAttach(url, item, event) {
161
+ event.preventDefault();
162
+ if (this.isAskLightning == 1){
163
+ window.parent.postMessage({
164
+ data: "bot_preview",
165
+ item: JSON.stringify(item),
166
+ url: url
167
+ },"*");
168
+ } else {
169
+ // if (isMobile()) {
170
+ // this.$refs.previewPdf.drawer = true;
171
+ // this.$refs.previewPdf.previewShowPopup = false;
172
+ // } else {
173
+ // this.$refs.previewPdf.drawer = false;
174
+ // }
175
+ this.$refs.previewPdf.previewShowPopup = false;
176
+ this.$refs.previewPdf.drawer = false;
177
+ let index = url.lastIndexOf('?')
178
+ let type = ''
179
+ let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
180
+ if (index !== -1) {
181
+ url = url.substring(0, index)
182
+ type = this.fileType(url)
183
+ } else {
184
+ type = this.fileType(url)
185
+ }
186
+ if (type === '' || type === 'OTHER') {
187
+ httpUrl = httpUrl += '?needEncrypt=true'
188
+ } else {
189
+ httpUrl = httpUrl += '?needEncrypt=false'
190
+ }
191
+ this.$http.post(httpUrl, {
192
+ "fileInOssPath":url
193
+ }).then(res =>{
194
+ if(res.data.code == '0') {
195
+ this.previewHref = res.data.data;
196
+ if (isMobile()){
197
+ this.$refs.previewPdf.drawer = true;
198
+ this.$refs.previewPdf.previewShowPopup = true;
199
+ } else {
200
+ this.$refs.previewPdf.previewShowPopup = false;
201
+ this.$refs.previewPdf.drawer = true;
202
+ }
203
+ this.$refs.previewPdf.fileType = type
204
+ this.$refs.previewPdf.tagIds = item.tagIds
205
+ if(item.tagIds) {
206
+ this.$refs.previewPdf.loading = false
207
+ return
208
+ }
209
+ this.$nextTick(() =>{
210
+ if(item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
211
+ this.$refs.previewPdf.getBolb(item)
212
+ } else {
213
+ this.$refs.previewPdf.loadIframe(item)
214
+ }
215
+ })
216
+ }
217
+ })
218
+ }
219
+ },
220
+ fileType (url) {
221
+ const fileType = url.substring(url.lastIndexOf('.'));
222
+ if (fileType === '.mp4' || fileType === '.MP4') {
223
+ return 'VIDEO'
224
+ } else if (fileType === '.html') {
225
+ return 'HTML'
226
+ } else {
227
+ return 'OTHER'
228
+ }
229
+ },
230
+ srcContentTypeIMG(item) {
231
+ let url = item.url
232
+ const type = url.substring(url.lastIndexOf('.'));
233
+ if(type === '.jpg' || type === '.jpeg' || type === '.png' || type === '.gif') {
234
+ this.getSrc(item)
235
+ return true
236
+ } else {
237
+ return false
238
+ }
239
+ },
240
+ getSrc (item) {
241
+ // let imgurl = ''
242
+ this.$http.post(
243
+ '/knowledge-api/temporary-certificate/or-origin?expired=30',
244
+ item.url,
245
+ {
246
+ headers: {
247
+ "Content-Type": "application/json",
248
+ },
249
+ }).then( res => {
250
+ console.log(res,'=====');
251
+ // imgurl = await res.bodyText
252
+ this.$set(item,'expiredUrl',res.data ? res.data : res.bodyText)
253
+ // return res.data
254
+ })
255
+ // return imgurl
256
+ }
257
+ }
258
+ }
259
+ </script>
260
+
261
+ <style scoped lang="less">
262
+ .answer-docknowledge {
263
+ min-width: 100px;
264
+
265
+ .answer-text {
266
+ // font-size: 13px;
267
+ text-align: left;
268
+ line-height: 25px;
269
+ padding: 0px 0px 12px 0px;
270
+
271
+ .aci-view {
272
+ // font-size: 13px;
273
+ display: inline-block;
274
+ // margin-left: 5px;
275
+ color: #366aff;
276
+ cursor: pointer;
277
+ }
278
+ }
279
+
280
+ .ad-list {
281
+ .ad-list-cell {
282
+ border-top: solid 1px #E0E6F7;
283
+ padding: 10px 0 10px;
284
+
285
+ .alc-title {
286
+ display: flex;
287
+ flex-wrap: wrap;
288
+ align-items: center;
289
+ justify-content: space-between;
290
+ line-height: 16px;
291
+
292
+ .alc-box {
293
+ display: flex;
294
+ align-items: center;
295
+ justify-content: space-between;
296
+ // font-size: 12px;
297
+ width: 100%;
298
+ .alc-source-left{
299
+ display: flex;
300
+ align-items: center;
301
+ .source-form{
302
+ width: 34px;
303
+ flex: none;
304
+ color: #A9B3C6;
305
+ }
306
+ }
307
+ .alc-content-text{
308
+ width: 55px;
309
+ flex: none;
310
+ .aci-view{
311
+ color: #366aff;
312
+ cursor: pointer;
313
+ }
314
+ }
315
+ .alc-title-from {
316
+ line-height: 22px;
317
+ word-break: break-all !important;
318
+ text-align: left;
319
+ flex: auto;
320
+ display: flex;
321
+ justify-content: flex-start;
322
+ }
323
+ }
324
+ .alc-box-introduction{
325
+ overflow: hidden;
326
+ text-overflow: ellipsis;
327
+ display: -webkit-box;
328
+ -webkit-line-clamp:3;
329
+ -webkit-box-orient:vertical;
330
+ margin-top: 10px;
331
+ color: #616161;
332
+ // font-size: 12px;
333
+ line-height: 24px;
334
+ text-align: left;
335
+ img {
336
+ width: 50px;
337
+ height: 50px;
338
+ margin: 10px;
339
+ cursor: pointer;
340
+ }
341
+ }
342
+ .alc-updateTime{
343
+ display: flex;
344
+ align-items: center;
345
+ justify-content: space-between;
346
+ font-size: 13px;
347
+ width: 100%;
348
+ margin-top: 10px;
349
+ .upload-source{
350
+ flex: none;
351
+ height: 18px;
352
+ line-height: 18px;
353
+ background: #E9F9F8;
354
+ border: 1px solid #AFF2CD;
355
+ border-radius: 2px;
356
+ display: flex;
357
+ align-items: center;
358
+ justify-content: center;
359
+ padding: 0 8px;
360
+ color: #00C2BB;
361
+ }
362
+ .time{
363
+ color: #999999;
364
+ margin-left: 10px;
365
+ }
366
+ .alc-content-text {
367
+ color: #366aff;
368
+ cursor: pointer;
369
+ }
370
+ }
371
+ .alc-title-icon {
372
+ margin: 0 2px;
373
+ width: 18px;
374
+ height: 18px;
375
+ flex: none;
376
+ }
377
+
378
+ .alc-title-updateTime {
379
+ text-align: right;
380
+ color: #999999;
381
+ // font-size: 13px;
382
+ }
383
+ }
384
+
385
+ .alc-content {
386
+ .alc-title-updateTime {
387
+ margin-top: 6px;
388
+ display: block;
389
+ text-align: right;
390
+ color: #999999;
391
+ // font-size: 13px;
392
+ }
393
+
394
+ .alc-content-text {
395
+ margin-bottom: 6px;
396
+ width: 55px;
397
+ flex: none;
398
+ .aci-view {
399
+ display: inline-block;
400
+ margin-left: 30px;
401
+ color: #366aff;
402
+ cursor: pointer;
403
+ }
404
+ }
405
+
406
+ .alc-content-info {
407
+ display: flex;
408
+ flex-wrap: wrap;
409
+ justify-content: space-between;
410
+
411
+ .alcc-box {
412
+ display: flex;
413
+ flex-wrap: wrap;
414
+ color: #999999;
415
+
416
+ .aci-owner {
417
+ margin-right: 20px;
418
+ }
419
+
420
+ .aci-enterprise {
421
+ margin-right: 20px;
422
+ }
423
+ }
424
+ }
425
+ }
426
+ }
427
+ }
428
+ }
429
429
  </style>