askbot-dragon 1.6.45-beta → 1.6.46-beta
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 +55 -55
- package/public/index.html +72 -72
- 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 +75 -75
- package/src/assets/js/hammer.js +100 -100
- package/src/assets/js/script.js +36 -36
- package/src/assets/less/common.css +6773 -6773
- package/src/assets/less/converSationContainer/common.less +199 -199
- 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 +177 -177
- package/src/components/AiGuide.vue +466 -466
- package/src/components/AnswerDocknowledge.vue +691 -696
- package/src/components/AnswerVoice.vue +285 -285
- package/src/components/AskIFrame.vue +15 -15
- package/src/components/ConversationContainer.vue +5097 -5097
- package/src/components/FileType.vue +86 -86
- package/src/components/Message.vue +27 -27
- package/src/components/MyEditor.vue +350 -350
- 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 +186 -186
- 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 +162 -162
- package/src/components/assetDetails.vue +370 -370
- package/src/components/assetMessage.vue +228 -228
- package/src/components/associationIntention.vue +355 -355
- 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 +3572 -3572
- package/src/components/intelligentSummary.vue +209 -209
- 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/newPdfPosition.vue +877 -877
- package/src/components/pdfPosition.vue +1508 -1508
- package/src/components/popup.vue +227 -227
- package/src/components/previewDoc.vue +242 -242
- package/src/components/previewPdf.vue +483 -486
- package/src/components/receiverMessagePlatform.vue +65 -65
- package/src/components/recommend.vue +80 -80
- 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 +174 -174
- 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/components/welcomeKnowledgeFile.vue +316 -315
- package/src/components/welcomeLlmCard.vue +139 -134
- package/src/main.js +57 -57
- package/vue.config.js +54 -54
|
@@ -1,487 +1,484 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- <van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}" v-if="previewShowPopup">
|
|
3
|
-
<div class="footer">
|
|
4
|
-
<span>查看详情</span>
|
|
5
|
-
<section @click="close">
|
|
6
|
-
<i class="iconfont guoran-shanchu"></i>
|
|
7
|
-
</section>
|
|
8
|
-
</div>
|
|
9
|
-
<template v-if="tagIds && tagIds.length != 0 && previewShowPopup">
|
|
10
|
-
<pdfPosition :tagIds="tagIds" ></pdfPosition>
|
|
11
|
-
</template>
|
|
12
|
-
<template v-else>
|
|
13
|
-
<div v-if="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 60px)">
|
|
14
|
-
<video :src="url" controls width="100%;" height="98%"></video>
|
|
15
|
-
</div>
|
|
16
|
-
<div v-else-if="fileType == 'HTML'" style="width: 100%;height: calc(100% - 60px)">
|
|
17
|
-
<div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
|
|
18
|
-
</div>
|
|
19
|
-
<template v-else-if="url.includes('https://www') || url.includes('http://www')">
|
|
20
|
-
<iframe class="preview_iframe"
|
|
21
|
-
:src="url"
|
|
22
|
-
width="100%"
|
|
23
|
-
height="100%"
|
|
24
|
-
scrolling="100%"
|
|
25
|
-
frameborder="no"
|
|
26
|
-
border="0"></iframe>
|
|
27
|
-
</template>
|
|
28
|
-
<template v-else>
|
|
29
|
-
<iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
|
|
30
|
-
</template>
|
|
31
|
-
</template>
|
|
32
|
-
<div class="loading_img" v-show="loading">
|
|
33
|
-
<img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
|
|
34
|
-
</div>
|
|
35
|
-
</van-popup> -->
|
|
36
|
-
<el-drawer
|
|
37
|
-
title="我是标题"
|
|
38
|
-
:visible.sync="drawer"
|
|
39
|
-
:with-header="false"
|
|
40
|
-
:append-to-body="true"
|
|
41
|
-
:destroy-on-close="true"
|
|
42
|
-
:model="false"
|
|
43
|
-
:direction="previewShowPopup ? 'btt' : 'rtl'"
|
|
44
|
-
:size="previewShowPopup ? '90%' : '65%'"
|
|
45
|
-
custom-class="pdf-preview-drawer"
|
|
46
|
-
v-if="drawer"
|
|
47
|
-
>
|
|
48
|
-
<!-- v-else-if="drawer" -->
|
|
49
|
-
<div class="drawer-footer">
|
|
50
|
-
<span>{{title ? title : "查看详情"}}</span>
|
|
51
|
-
<div class="header-right">
|
|
52
|
-
<div class="summaryBtn"
|
|
53
|
-
:class="showSummary ? 'summaryActiveBtn' : ''"
|
|
54
|
-
@click="summaryFun"
|
|
55
|
-
>
|
|
56
|
-
<i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
|
|
57
|
-
<span>智能摘要</span>
|
|
58
|
-
</div>
|
|
59
|
-
<template v-if="isHasChat">
|
|
60
|
-
<div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
|
|
61
|
-
<i class="iconfont guoran-wendapingjia"></i>
|
|
62
|
-
聊一聊
|
|
63
|
-
</div>
|
|
64
|
-
<div class="chat chat_active" @click="previewToDialog(false)" v-else>
|
|
65
|
-
<i class="iconfont guoran-wendapingjia"></i>
|
|
66
|
-
聊一聊
|
|
67
|
-
</div>
|
|
68
|
-
</template>
|
|
69
|
-
<section @click="close">
|
|
70
|
-
<i class="iconfont guoran-shanchu"></i>
|
|
71
|
-
</section>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
<div id="drawer_content_pre">
|
|
75
|
-
<intelligent-summary
|
|
76
|
-
v-show="showSummary"
|
|
77
|
-
:knowledgeId="knowledgeId"
|
|
78
|
-
@closeSummary="closeSummary"
|
|
79
|
-
@recommendQues="recommendQues"
|
|
80
|
-
@getSummarySuccess="getSummarySuccess"
|
|
81
|
-
:style="{marginTop:tagIds && tagIds.length != 0 ? '50px' : ''}"
|
|
82
|
-
></intelligent-summary>
|
|
83
|
-
<template v-if="tagIds && tagIds.length != 0 && drawer">
|
|
84
|
-
<pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :fileName="fileName" :knowledgeItem="watermark" ref="pdfPosition"></pdfPosition>
|
|
85
|
-
</template>
|
|
86
|
-
<template v-else>
|
|
87
|
-
<div v-if="fileType == 'VIDEO'" style="width: 100%;">
|
|
88
|
-
<video :src="url" controls width="100%;" height="98%"></video>
|
|
89
|
-
</div>
|
|
90
|
-
<div v-else-if="fileType == 'HTML'" style="width: 100%;">
|
|
91
|
-
<div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
|
|
92
|
-
</div>
|
|
93
|
-
<template v-else-if="url.includes('https://www') || url.includes('http://www')">
|
|
94
|
-
<iframe class="preview_iframe"
|
|
95
|
-
:src="url"
|
|
96
|
-
width="100%"
|
|
97
|
-
height="100%"
|
|
98
|
-
scrolling="100%"
|
|
99
|
-
frameborder="no"
|
|
100
|
-
border="0"></iframe>
|
|
101
|
-
</template>
|
|
102
|
-
<template v-else>
|
|
103
|
-
<iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;" :style="{height: iframeHeight}"></iframe>
|
|
104
|
-
</template>
|
|
105
|
-
</template>
|
|
106
|
-
</div>
|
|
107
|
-
<div class="loading_img" v-show="loading">
|
|
108
|
-
<img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
|
|
109
|
-
</div>
|
|
110
|
-
</el-drawer>
|
|
111
|
-
</template>
|
|
112
|
-
|
|
113
|
-
<script>
|
|
114
|
-
import pdfPosition from './pdfPosition.vue'
|
|
115
|
-
import { zoomElement } from '../assets/js/hammer'
|
|
116
|
-
import IntelligentSummary from "./intelligentSummary";
|
|
117
|
-
export default {
|
|
118
|
-
data () {
|
|
119
|
-
return {
|
|
120
|
-
previewShowPopup: false,
|
|
121
|
-
fileText:'',
|
|
122
|
-
fileType:"",
|
|
123
|
-
isPc:true,
|
|
124
|
-
drawer:false,
|
|
125
|
-
tagIds: [],
|
|
126
|
-
// '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
|
|
127
|
-
loading:true,
|
|
128
|
-
fileName:'',
|
|
129
|
-
previewKnowledgeId:"",
|
|
130
|
-
showSummary:true,
|
|
131
|
-
iframeHeight:"100%"
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
mounted() {
|
|
135
|
-
window.addEventListener('message',this.handleIframeMessage,false)
|
|
136
|
-
},
|
|
137
|
-
props:{
|
|
138
|
-
url:{
|
|
139
|
-
type: String,
|
|
140
|
-
required: true,
|
|
141
|
-
},
|
|
142
|
-
officePreviewType:{
|
|
143
|
-
type: String,
|
|
144
|
-
default: ''
|
|
145
|
-
},
|
|
146
|
-
isMessageRecord:{
|
|
147
|
-
type: Boolean,
|
|
148
|
-
default:false,
|
|
149
|
-
},
|
|
150
|
-
sourceFileType:{
|
|
151
|
-
type: String,
|
|
152
|
-
default: '',
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
type:
|
|
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
|
-
//
|
|
228
|
-
//
|
|
229
|
-
//
|
|
230
|
-
//
|
|
231
|
-
|
|
232
|
-
//
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
//
|
|
259
|
-
//
|
|
260
|
-
//
|
|
261
|
-
//
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
this
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
background-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
/deep
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
/deep/a:
|
|
355
|
-
color: #0000ee!important;
|
|
356
|
-
}
|
|
357
|
-
/deep/a:
|
|
358
|
-
color: #0000ee!important;
|
|
359
|
-
}
|
|
360
|
-
/deep/a:
|
|
361
|
-
color: #0000ee!important;
|
|
362
|
-
}
|
|
363
|
-
/deep/
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
/deep/
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
/deep
|
|
370
|
-
width: 100
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<!-- <van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}" v-if="previewShowPopup">
|
|
3
|
+
<div class="footer">
|
|
4
|
+
<span>查看详情</span>
|
|
5
|
+
<section @click="close">
|
|
6
|
+
<i class="iconfont guoran-shanchu"></i>
|
|
7
|
+
</section>
|
|
8
|
+
</div>
|
|
9
|
+
<template v-if="tagIds && tagIds.length != 0 && previewShowPopup">
|
|
10
|
+
<pdfPosition :tagIds="tagIds" ></pdfPosition>
|
|
11
|
+
</template>
|
|
12
|
+
<template v-else>
|
|
13
|
+
<div v-if="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 60px)">
|
|
14
|
+
<video :src="url" controls width="100%;" height="98%"></video>
|
|
15
|
+
</div>
|
|
16
|
+
<div v-else-if="fileType == 'HTML'" style="width: 100%;height: calc(100% - 60px)">
|
|
17
|
+
<div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
|
|
18
|
+
</div>
|
|
19
|
+
<template v-else-if="url.includes('https://www') || url.includes('http://www')">
|
|
20
|
+
<iframe class="preview_iframe"
|
|
21
|
+
:src="url"
|
|
22
|
+
width="100%"
|
|
23
|
+
height="100%"
|
|
24
|
+
scrolling="100%"
|
|
25
|
+
frameborder="no"
|
|
26
|
+
border="0"></iframe>
|
|
27
|
+
</template>
|
|
28
|
+
<template v-else>
|
|
29
|
+
<iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
|
|
30
|
+
</template>
|
|
31
|
+
</template>
|
|
32
|
+
<div class="loading_img" v-show="loading">
|
|
33
|
+
<img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
|
|
34
|
+
</div>
|
|
35
|
+
</van-popup> -->
|
|
36
|
+
<el-drawer
|
|
37
|
+
title="我是标题"
|
|
38
|
+
:visible.sync="drawer"
|
|
39
|
+
:with-header="false"
|
|
40
|
+
:append-to-body="true"
|
|
41
|
+
:destroy-on-close="true"
|
|
42
|
+
:model="false"
|
|
43
|
+
:direction="previewShowPopup ? 'btt' : 'rtl'"
|
|
44
|
+
:size="previewShowPopup ? '90%' : '65%'"
|
|
45
|
+
custom-class="pdf-preview-drawer"
|
|
46
|
+
v-if="drawer"
|
|
47
|
+
>
|
|
48
|
+
<!-- v-else-if="drawer" -->
|
|
49
|
+
<div class="drawer-footer">
|
|
50
|
+
<span>{{title ? title : "查看详情"}}</span>
|
|
51
|
+
<div class="header-right">
|
|
52
|
+
<div class="summaryBtn"
|
|
53
|
+
:class="showSummary ? 'summaryActiveBtn' : ''"
|
|
54
|
+
@click="summaryFun"
|
|
55
|
+
>
|
|
56
|
+
<i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
|
|
57
|
+
<span>智能摘要</span>
|
|
58
|
+
</div>
|
|
59
|
+
<template v-if="isHasChat">
|
|
60
|
+
<div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
|
|
61
|
+
<i class="iconfont guoran-wendapingjia"></i>
|
|
62
|
+
聊一聊
|
|
63
|
+
</div>
|
|
64
|
+
<div class="chat chat_active" @click="previewToDialog(false)" v-else>
|
|
65
|
+
<i class="iconfont guoran-wendapingjia"></i>
|
|
66
|
+
聊一聊
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
<section @click="close">
|
|
70
|
+
<i class="iconfont guoran-shanchu"></i>
|
|
71
|
+
</section>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<div id="drawer_content_pre">
|
|
75
|
+
<intelligent-summary
|
|
76
|
+
v-show="showSummary"
|
|
77
|
+
:knowledgeId="knowledgeId"
|
|
78
|
+
@closeSummary="closeSummary"
|
|
79
|
+
@recommendQues="recommendQues"
|
|
80
|
+
@getSummarySuccess="getSummarySuccess"
|
|
81
|
+
:style="{marginTop:tagIds && tagIds.length != 0 ? '50px' : ''}"
|
|
82
|
+
></intelligent-summary>
|
|
83
|
+
<template v-if="tagIds && tagIds.length != 0 && drawer">
|
|
84
|
+
<pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :fileName="fileName" :knowledgeItem="watermark" ref="pdfPosition"></pdfPosition>
|
|
85
|
+
</template>
|
|
86
|
+
<template v-else>
|
|
87
|
+
<div v-if="fileType == 'VIDEO'" style="width: 100%;">
|
|
88
|
+
<video :src="url" controls width="100%;" height="98%"></video>
|
|
89
|
+
</div>
|
|
90
|
+
<div v-else-if="fileType == 'HTML'" style="width: 100%;">
|
|
91
|
+
<div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
|
|
92
|
+
</div>
|
|
93
|
+
<template v-else-if="url.includes('https://www') || url.includes('http://www')">
|
|
94
|
+
<iframe class="preview_iframe"
|
|
95
|
+
:src="url"
|
|
96
|
+
width="100%"
|
|
97
|
+
height="100%"
|
|
98
|
+
scrolling="100%"
|
|
99
|
+
frameborder="no"
|
|
100
|
+
border="0"></iframe>
|
|
101
|
+
</template>
|
|
102
|
+
<template v-else>
|
|
103
|
+
<iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;" :style="{height: iframeHeight}"></iframe>
|
|
104
|
+
</template>
|
|
105
|
+
</template>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="loading_img" v-show="loading">
|
|
108
|
+
<img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
|
|
109
|
+
</div>
|
|
110
|
+
</el-drawer>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<script>
|
|
114
|
+
import pdfPosition from './pdfPosition.vue'
|
|
115
|
+
import { zoomElement } from '../assets/js/hammer'
|
|
116
|
+
import IntelligentSummary from "./intelligentSummary";
|
|
117
|
+
export default {
|
|
118
|
+
data () {
|
|
119
|
+
return {
|
|
120
|
+
previewShowPopup: false,
|
|
121
|
+
fileText:'',
|
|
122
|
+
fileType:"",
|
|
123
|
+
isPc:true,
|
|
124
|
+
drawer:false,
|
|
125
|
+
tagIds: [],
|
|
126
|
+
// '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
|
|
127
|
+
loading:true,
|
|
128
|
+
fileName:'',
|
|
129
|
+
previewKnowledgeId:"",
|
|
130
|
+
showSummary:true,
|
|
131
|
+
iframeHeight:"100%"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
mounted() {
|
|
135
|
+
window.addEventListener('message',this.handleIframeMessage,false)
|
|
136
|
+
},
|
|
137
|
+
props:{
|
|
138
|
+
url:{
|
|
139
|
+
type: String,
|
|
140
|
+
required: true,
|
|
141
|
+
},
|
|
142
|
+
officePreviewType:{
|
|
143
|
+
type: String,
|
|
144
|
+
default: ''
|
|
145
|
+
},
|
|
146
|
+
isMessageRecord:{
|
|
147
|
+
type: Boolean,
|
|
148
|
+
default:false,
|
|
149
|
+
},
|
|
150
|
+
sourceFileType:{
|
|
151
|
+
type: String,
|
|
152
|
+
default: '',
|
|
153
|
+
},
|
|
154
|
+
title: {
|
|
155
|
+
type: String,
|
|
156
|
+
default: ''
|
|
157
|
+
},
|
|
158
|
+
isHasChat:{
|
|
159
|
+
type:Boolean,
|
|
160
|
+
default:false
|
|
161
|
+
},
|
|
162
|
+
knowledgeId:{
|
|
163
|
+
type: String,
|
|
164
|
+
default: '',
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
components:{
|
|
168
|
+
IntelligentSummary,
|
|
169
|
+
pdfPosition
|
|
170
|
+
},
|
|
171
|
+
watch:{
|
|
172
|
+
drawer(value) {
|
|
173
|
+
if(value) {
|
|
174
|
+
this.$nextTick(() =>{
|
|
175
|
+
if (this.tagIds && this.tagIds.length != 0){
|
|
176
|
+
zoomElement(document.getElementById('pdf_container_view'))
|
|
177
|
+
}
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
setTimeout(() => {
|
|
181
|
+
let previewIframe = document.getElementsByClassName('preview_iframe')
|
|
182
|
+
Array.from(previewIframe).forEach(item =>{
|
|
183
|
+
item.onload = () =>{
|
|
184
|
+
console.debug('previewIframe 106',previewIframe,this.drawer)
|
|
185
|
+
item.style.backgroundImage = 'none'
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
},
|
|
190
|
+
showSummary:{
|
|
191
|
+
handler(val){
|
|
192
|
+
if (!val){
|
|
193
|
+
this.$nextTick(() => {
|
|
194
|
+
let preCon = document.querySelector('.pdf_view');
|
|
195
|
+
if (preCon){
|
|
196
|
+
preCon.style.height = 'calc(100% - ' + 50 + 'px)'
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
} else {
|
|
200
|
+
this.getSummarySuccess();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
computed:{
|
|
206
|
+
previewUrl() {
|
|
207
|
+
console.debug('VUE_APP_ENV',process.env.VUE_APP_ENV)
|
|
208
|
+
let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
|
|
209
|
+
// if(this.url != '') {
|
|
210
|
+
// if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
|
|
211
|
+
// url += btoa(encodeURIComponent(this.url))
|
|
212
|
+
// } else {
|
|
213
|
+
// url += btoa(this.url)
|
|
214
|
+
// }
|
|
215
|
+
// }
|
|
216
|
+
url = url + this.url
|
|
217
|
+
url += '&officePreviewType=pdf'
|
|
218
|
+
if(this.watermark) {
|
|
219
|
+
url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
|
|
220
|
+
url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
|
|
221
|
+
}
|
|
222
|
+
return url
|
|
223
|
+
},
|
|
224
|
+
// fileType() {
|
|
225
|
+
// const fileType = this.url.substring(this.url.lastIndexOf('.'));
|
|
226
|
+
// if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
|
|
227
|
+
// return 'VIDEO'
|
|
228
|
+
// } else {
|
|
229
|
+
// return 'OTHER'
|
|
230
|
+
// }
|
|
231
|
+
|
|
232
|
+
// }
|
|
233
|
+
},
|
|
234
|
+
methods :{
|
|
235
|
+
close() {
|
|
236
|
+
setTimeout(() =>{
|
|
237
|
+
this.previewShowPopup = false;
|
|
238
|
+
this.fileType = ''
|
|
239
|
+
}, 300)
|
|
240
|
+
this.drawer = false;
|
|
241
|
+
this.showSummary = false;
|
|
242
|
+
},
|
|
243
|
+
loadIframe() {
|
|
244
|
+
|
|
245
|
+
if(this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0)) {
|
|
246
|
+
this.loading = false
|
|
247
|
+
} else {
|
|
248
|
+
let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
|
|
249
|
+
if (iframe){
|
|
250
|
+
iframe.onload = () => {
|
|
251
|
+
this.loading = false;
|
|
252
|
+
document.getElementById('drawer_content_pre').style.backgroundImage = 'none'
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// let time = setInterval(() =>{
|
|
256
|
+
//
|
|
257
|
+
// if(iframe) {
|
|
258
|
+
// this.loading = false
|
|
259
|
+
// clearInterval(time)
|
|
260
|
+
// }
|
|
261
|
+
// }, 500)
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
getBolb() {
|
|
265
|
+
this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false',{
|
|
266
|
+
fileInOssPath: this.url,
|
|
267
|
+
templateId: ''
|
|
268
|
+
}).then(res =>{
|
|
269
|
+
if (res.data.code == 0) {
|
|
270
|
+
this.fileText = res.data.data
|
|
271
|
+
this.loading = false
|
|
272
|
+
}
|
|
273
|
+
})
|
|
274
|
+
},
|
|
275
|
+
previewToDialog(flag){
|
|
276
|
+
this.$emit('previewToDialog',flag)
|
|
277
|
+
},
|
|
278
|
+
closeSummary(){
|
|
279
|
+
this.showSummary = false;
|
|
280
|
+
},
|
|
281
|
+
recommendQues(item,knowledgeId){
|
|
282
|
+
console.log('recommendQues',item,knowledgeId);
|
|
283
|
+
this.$emit('recommendQues',item,knowledgeId)
|
|
284
|
+
},
|
|
285
|
+
handleIframeMessage(res){
|
|
286
|
+
console.log('handleIframeMessage',res)
|
|
287
|
+
if (res.data.type == 'getViewerHeight'){
|
|
288
|
+
let iframeHeight = this.iframeHeight.replace('px','')
|
|
289
|
+
if (res.data.data && iframeHeight != (res.data.data + 50)){
|
|
290
|
+
this.iframeHeight = res.data.data + 50 + 'px'
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
summaryFun(){
|
|
295
|
+
this.showSummary = !this.showSummary;
|
|
296
|
+
if (this.showSummary){
|
|
297
|
+
document.getElementById('drawer_content_pre').scrollTop = 0;
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
getSummarySuccess(){
|
|
301
|
+
this.$nextTick(() => {
|
|
302
|
+
if (this.tagIds.length > 0){
|
|
303
|
+
let intelligentSummary = document.getElementById('intelligentSummary');
|
|
304
|
+
let preCon = document.querySelector('.pdf_view')
|
|
305
|
+
console.log('intelligentSummary',preCon,intelligentSummary)
|
|
306
|
+
if (intelligentSummary){
|
|
307
|
+
let height = intelligentSummary.offsetHeight + 100;
|
|
308
|
+
if (preCon){
|
|
309
|
+
preCon.style.height = 'calc(100% - ' + height + 'px)'
|
|
310
|
+
}
|
|
311
|
+
console.log('height',height,preCon)
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
})
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
beforeDestroy() {
|
|
318
|
+
window.removeEventListener('message', this.handleIframeMessage);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
</script>
|
|
322
|
+
|
|
323
|
+
<style lang="less" scoped>
|
|
324
|
+
#drawer_content_pre{
|
|
325
|
+
padding: 20px;
|
|
326
|
+
scroll-behavior: smooth;
|
|
327
|
+
}
|
|
328
|
+
.preview_iframe {
|
|
329
|
+
width: 100%;
|
|
330
|
+
height: 100%;
|
|
331
|
+
box-sizing: border-box;
|
|
332
|
+
background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
|
|
333
|
+
background-position: center;
|
|
334
|
+
background-size: 50px;
|
|
335
|
+
background-repeat: no-repeat;
|
|
336
|
+
}
|
|
337
|
+
.preview_iframe_kk{
|
|
338
|
+
width: 100%;
|
|
339
|
+
height: 100%;
|
|
340
|
+
}
|
|
341
|
+
.preview_iframe_html{
|
|
342
|
+
width: 100%;
|
|
343
|
+
height: 100%;
|
|
344
|
+
overflow-y: scroll;
|
|
345
|
+
text-align: left;
|
|
346
|
+
box-sizing: border-box;
|
|
347
|
+
padding: 16px;
|
|
348
|
+
/deep/.lake-content{
|
|
349
|
+
margin-left: 10px;
|
|
350
|
+
}
|
|
351
|
+
/deep/a:link {
|
|
352
|
+
color: #0000ee!important;
|
|
353
|
+
}
|
|
354
|
+
/deep/a:visited {
|
|
355
|
+
color: #0000ee!important;
|
|
356
|
+
}
|
|
357
|
+
/deep/a:hover {
|
|
358
|
+
color: #0000ee!important;
|
|
359
|
+
}
|
|
360
|
+
/deep/a:active {
|
|
361
|
+
color: #0000ee!important;
|
|
362
|
+
}
|
|
363
|
+
/deep/li:not(.rich-text-li), ol:not(.list-paddingleft-2), ul:not(.list-paddingleft-2){
|
|
364
|
+
list-style-type: auto!important;
|
|
365
|
+
}
|
|
366
|
+
/deep/img{
|
|
367
|
+
width: 100%;
|
|
368
|
+
}
|
|
369
|
+
/deep/.ne-table{
|
|
370
|
+
width: 100% !important;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
.footer {
|
|
374
|
+
width: calc(100% - 40px);
|
|
375
|
+
height: 50px;
|
|
376
|
+
display: flex;
|
|
377
|
+
align-items: center;
|
|
378
|
+
justify-content: space-between;
|
|
379
|
+
cursor: pointer;
|
|
380
|
+
padding: 0 20px;
|
|
381
|
+
border-bottom: 1px solid #cccccc;
|
|
382
|
+
}
|
|
383
|
+
.loading_img {
|
|
384
|
+
display: flex;
|
|
385
|
+
align-items: center;
|
|
386
|
+
justify-content: center;
|
|
387
|
+
width: 100%;
|
|
388
|
+
height: 100%;
|
|
389
|
+
position: absolute;
|
|
390
|
+
top: 0;
|
|
391
|
+
left: 0;
|
|
392
|
+
background: #FFF;
|
|
393
|
+
img {
|
|
394
|
+
width: 50px;
|
|
395
|
+
height: 50px;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.drawer-footer{
|
|
400
|
+
width:100%;
|
|
401
|
+
height: 50px;
|
|
402
|
+
display: flex;
|
|
403
|
+
align-items: center;
|
|
404
|
+
justify-content: space-between;
|
|
405
|
+
cursor: pointer;
|
|
406
|
+
padding: 0 20px;
|
|
407
|
+
border-bottom: 1px solid #cccccc;
|
|
408
|
+
.header-right{
|
|
409
|
+
display: flex;
|
|
410
|
+
align-items: center;
|
|
411
|
+
.summaryBtn{
|
|
412
|
+
flex: none;
|
|
413
|
+
//width: 95px;
|
|
414
|
+
height: 26px;
|
|
415
|
+
padding: 0 10px;
|
|
416
|
+
background: #ffffff;
|
|
417
|
+
display: flex;
|
|
418
|
+
align-items: center;
|
|
419
|
+
justify-content: center;
|
|
420
|
+
box-sizing: border-box;
|
|
421
|
+
border: 1px solid #a1b9ff;
|
|
422
|
+
border-radius: 15px;
|
|
423
|
+
cursor: pointer;
|
|
424
|
+
color: #366aff;
|
|
425
|
+
margin-right: 10px;
|
|
426
|
+
font-size: 14px;
|
|
427
|
+
i {
|
|
428
|
+
font-size: 18px;
|
|
429
|
+
margin: 0 5px;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
.summaryActiveBtn{
|
|
433
|
+
background: #366aff !important;
|
|
434
|
+
color: #ffffff !important;
|
|
435
|
+
}
|
|
436
|
+
.chat {
|
|
437
|
+
width: 95px;
|
|
438
|
+
height: 26px;
|
|
439
|
+
background: #ffffff;
|
|
440
|
+
display: flex;
|
|
441
|
+
align-items: center;
|
|
442
|
+
justify-content: center;
|
|
443
|
+
box-sizing: border-box;
|
|
444
|
+
border: 1px solid #a1b9ff;
|
|
445
|
+
border-radius: 15px 0px 15px 15px;
|
|
446
|
+
cursor: pointer;
|
|
447
|
+
color: #366aff;
|
|
448
|
+
margin-right: 10px;
|
|
449
|
+
font-size: 14px;
|
|
450
|
+
i {
|
|
451
|
+
font-size: 16px;
|
|
452
|
+
margin: 0 5px;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
.chat_active {
|
|
456
|
+
background: #366aff !important;
|
|
457
|
+
color: #FFFFFF !important;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
@media screen and (max-width: 767px) {
|
|
462
|
+
/* 这里是针对移动设备的css样式设置 */
|
|
463
|
+
/deep/.el-drawer__body{
|
|
464
|
+
height: 100%;
|
|
465
|
+
}
|
|
466
|
+
#drawer_content_pre {
|
|
467
|
+
overflow: auto;
|
|
468
|
+
height: calc(100% - 50px);
|
|
469
|
+
background: #FFF;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
@media screen and (min-width: 768px) {
|
|
473
|
+
/* 这里是针对pc设备的css样式设置 */
|
|
474
|
+
/deep/.el-drawer__body{
|
|
475
|
+
height: 100%;
|
|
476
|
+
}
|
|
477
|
+
#drawer_content_pre {
|
|
478
|
+
overflow: auto;
|
|
479
|
+
height: calc(100% - 50px);
|
|
480
|
+
background: #FFF;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
487
484
|
</style>
|