askbot-dragon 1.3.57 → 1.3.59

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