askbot-dragon 1.6.76-beta → 1.6.77-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.
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 +55 -55
  5. package/public/index.html +72 -72
  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 +252 -252
  13. package/src/assets/js/hammer.js +100 -100
  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 +199 -199
  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 +294 -294
  20. package/src/components/ActionAlertIframe.vue +177 -177
  21. package/src/components/AiGuide.vue +466 -466
  22. package/src/components/AnswerDocknowledge.vue +1059 -1059
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +4934 -4934
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/MyEditor.vue +351 -351
  29. package/src/components/actionSatisfaction.vue +107 -107
  30. package/src/components/actionSendToBot.vue +62 -62
  31. package/src/components/answerDissatisfaction.vue +62 -62
  32. package/src/components/answerRadio.vue +186 -186
  33. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  34. package/src/components/ask-components/Msgloading.vue +37 -37
  35. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  36. package/src/components/askVideo.vue +162 -162
  37. package/src/components/assetDetails.vue +378 -378
  38. package/src/components/assetMessage.vue +228 -228
  39. package/src/components/associationIntention.vue +355 -355
  40. package/src/components/attachmentPreview.vue +90 -90
  41. package/src/components/botActionSatisfactor.vue +68 -68
  42. package/src/components/chatContent.vue +513 -513
  43. package/src/components/feedBack.vue +136 -136
  44. package/src/components/fielListView.vue +351 -351
  45. package/src/components/file/AliyunOssComponents.vue +108 -108
  46. package/src/components/formTemplate.vue +3572 -3572
  47. package/src/components/intelligentSummary.vue +227 -227
  48. package/src/components/kkview.vue +1138 -1138
  49. package/src/components/loadingProcess.vue +164 -164
  50. package/src/components/message/ActionAlertIframe.vue +112 -112
  51. package/src/components/message/ShopMessage.vue +164 -164
  52. package/src/components/message/TextMessage.vue +924 -924
  53. package/src/components/message/TicketMessage.vue +201 -201
  54. package/src/components/message/swiper/index.js +4 -4
  55. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  56. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  57. package/src/components/msgLoading.vue +231 -231
  58. package/src/components/myPopup.vue +70 -70
  59. package/src/components/newPdfPosition.vue +877 -877
  60. package/src/components/pdfPosition.vue +1508 -1506
  61. package/src/components/popup.vue +227 -227
  62. package/src/components/previewDoc.vue +247 -247
  63. package/src/components/previewPdf.vue +788 -757
  64. package/src/components/receiverMessagePlatform.vue +65 -65
  65. package/src/components/recommend.vue +80 -80
  66. package/src/components/selector/hOption.vue +20 -20
  67. package/src/components/selector/hSelector.vue +199 -199
  68. package/src/components/selector/hWrapper.vue +216 -216
  69. package/src/components/senderMessagePlatform.vue +50 -50
  70. package/src/components/source/BotMessage.vue +24 -24
  71. package/src/components/source/CustomMessage.vue +24 -24
  72. package/src/components/test.vue +260 -260
  73. package/src/components/tree.vue +294 -294
  74. package/src/components/utils/AliyunIssUtil.js +81 -81
  75. package/src/components/utils/ckeditor.js +174 -174
  76. package/src/components/utils/format_date.js +25 -25
  77. package/src/components/utils/index.js +6 -6
  78. package/src/components/utils/math_utils.js +29 -29
  79. package/src/components/voiceComponent.vue +119 -119
  80. package/src/components/welcomeKnowledgeFile.vue +340 -340
  81. package/src/components/welcomeLlmCard.vue +140 -140
  82. package/src/components/welcomeSuggest.vue +97 -97
  83. package/src/main.js +57 -57
  84. package/vue.config.js +54 -54
@@ -1,757 +1,788 @@
1
-
2
- <!-- preview-pdf
3
- 组件主要负责 知识项目中 文件的预览,携带定位信息参数 tagIds tagId 的会解析文件增加定位功能
4
- 不携带定位信息的 也是走 kkview项目预览
5
- 另外增加了在知识项目中预览当前文件的一些功能
6
- -->
7
- <template>
8
- <el-drawer title="我是标题" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
9
- :modal="false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
10
- custom-class="pdf-preview-drawer" v-if="drawer">
11
- <!-- v-else-if="drawer" -->
12
- <div class="drawer-header" :class="isLiBang ? 'libang_head' : ''" v-if="!isPc">
13
- <div class="header-btn btn_position">
14
- <div class="onload_btn" v-if="isDownload || true" @click="downLoad">
15
- 下载
16
- </div>
17
- <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
18
- v-if="isHasChat || true">
19
- <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
20
- <span>智能摘要</span>
21
- </div>
22
- <template v-if="isHasChat || true">
23
- <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
24
- <i class="iconfont guoran-wendapingjia"></i>
25
- 聊一聊
26
- </div>
27
- <div class="chat chat_active" @click="previewToDialog(false)" v-else>
28
- <i class="iconfont guoran-wendapingjia"></i>
29
- 聊一聊
30
- </div>
31
- </template>
32
- </div>
33
- <div class="header_title">
34
- <div class="header_close">
35
- <span>
36
- {{ title ? title : "查看详情" }}
37
- </span>
38
- <section @click="close">
39
- <i class="iconfont guoran-shanchu"></i>
40
- </section>
41
- </div>
42
- <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
43
- <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
44
- {{ folderName }}
45
- <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
46
- </p>
47
- </div>
48
- </div>
49
- <div class="drawer-header" :class="isLiBang && folderName ? 'libang_head' : ''" v-else>
50
- <div class="header_title">
51
- <div :class="isLiBang && folderName ? 'header_close' : 'header_top'">
52
- <span>
53
- {{ title ? title : "查看详情" }}
54
- </span>
55
- <div class="header-btn">
56
- <div class="onload_btn" v-if="isDownload || true" @click="downLoad">
57
- 下载
58
- </div>
59
- <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
60
- v-if="isHasChat || true">
61
- <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
62
- <span>智能摘要</span>
63
- </div>
64
- <template v-if="isHasChat || true">
65
- <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
66
- <i class="iconfont guoran-wendapingjia"></i>
67
- 聊一聊
68
- </div>
69
- <div class="chat chat_active" @click="previewToDialog(false)" v-else>
70
- <i class="iconfont guoran-wendapingjia"></i>
71
- 聊一聊
72
- </div>
73
- </template>
74
- <section @click="close">
75
- <i class="iconfont guoran-shanchu"></i>
76
- </section>
77
- </div>
78
- </div>
79
- <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
80
- <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
81
- {{ folderName }}
82
- <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
83
- </p>
84
- </div>
85
- </div>
86
- <div id="drawer_content_pre" :class="isLiBang && folderName ? 'libang_content_pre' : ''">
87
- <!-- :style="{marginTop:tagIds && tagIds.length != 0 && isPc ? '50px' : ''}" -->
88
- <intelligent-summary v-show="showSummary && isHasChat" :tagIds="tagIds" :knowledgeId="knowledgeId"
89
- @closeSummary="closeSummary" @recommendQues="recommendQues"
90
- @getSummarySuccess="getSummarySuccess"></intelligent-summary>
91
- <div class="pdf_positon" :style="pdfStyle" v-if="tagIds && tagIds.length != 0 && drawer">
92
- <pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :textWatermarkStr="textWatermarkStr">
93
- </pdfPosition>
94
- </div>
95
- <template v-else>
96
- <div v-if="fileType == 'VIDEO'" style="width: 100%;">
97
- <video :src="url" controls width="100%;" height="98%"></video>
98
- </div>
99
- <div v-else-if="fileType == 'HTML'" style="width: 100%;">
100
- <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
101
- </div>
102
- <template v-else-if="url.includes('https://www') || url.includes('http://www')">
103
- <iframe class="preview_iframe" :src="url" width="100%" height="100%" scrolling="100%" frameborder="no"
104
- border="0"></iframe>
105
- </template>
106
- <template v-else>
107
- <iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;"
108
- :style="{ height: iframeHeight }"></iframe>
109
- </template>
110
- </template>
111
- <!-- <div class="mobile_onload_btn" v-if="isDownload && !isPc" @click="downLoad">
112
- 下载
113
- </div> -->
114
- </div>
115
- <div class="loading_img" v-show="loading">
116
- <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
117
- </div>
118
- </el-drawer>
119
- </template>
120
-
121
- <script>
122
- import pdfPosition from './pdfPosition.vue'
123
- import { zoomElement } from '../assets/js/hammer'
124
- import IntelligentSummary from "./intelligentSummary";
125
- import { isMobile } from "../assets/js/common";
126
- // import { Toast } from 'vant';
127
- export default {
128
- data () {
129
- return {
130
- previewShowPopup: false,
131
- fileText: '',
132
- fileType: "",
133
- isPc: false,
134
- drawer: false,
135
- tagIds: [],
136
- // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
137
- loading: true,
138
- fileName:'',
139
- previewKnowledgeId:"",
140
- showSummary:true,
141
- iframeHeight:"100%",
142
- isDownload: false,
143
- textWatermarkStr:""
144
- }
145
- },
146
- mounted() {
147
- window.addEventListener('message',this.handleIframeMessage,false);
148
- this.isPcFun();
149
- },
150
- props:{
151
- url:{
152
- type: String,
153
- required: true,
154
- },
155
- officePreviewType:{
156
- type: String,
157
- default: ''
158
- },
159
- isMessageRecord:{
160
- type: Boolean,
161
- default:false,
162
- },
163
- sourceFileType:{
164
- type: String,
165
- default: '',
166
- },
167
- title: {
168
- type: String,
169
- default: ''
170
- },
171
- isHasChat:{
172
- type:Boolean,
173
- default:false
174
- },
175
- knowledgeId:{
176
- type: String,
177
- default: '',
178
- },
179
- previewOssPath:{
180
- type: String,
181
- default: '',
182
- },
183
- folderName: {
184
- type: String,
185
- default: '',
186
- },
187
- folderUrl: {
188
- type: String,
189
- default: '',
190
- },
191
- isLiBang: {
192
- type: Boolean,
193
- default: false
194
- }
195
- },
196
- components: {
197
- IntelligentSummary,
198
- pdfPosition
199
- },
200
- watch: {
201
- drawer (value) {
202
- if (value) {
203
- this.$emit('open')
204
- this.$nextTick(() => {
205
- if (this.tagIds && this.tagIds.length != 0){
206
- zoomElement(document.getElementById('pdf_container_view'))
207
- }
208
- })
209
- } else {
210
- this.$emit('close')
211
- }
212
- setTimeout(() => {
213
- let previewIframe = document.getElementsByClassName('preview_iframe')
214
- Array.from(previewIframe).forEach(item =>{
215
- item.onload = () =>{
216
- console.debug('previewIframe 106',previewIframe,this.drawer)
217
- item.style.backgroundImage = 'none'
218
- }
219
- })
220
- })
221
- },
222
- showSummary:{
223
- handler(val){
224
- // if (!val){
225
- // this.$nextTick(() => {
226
- // let preCon = document.querySelector('.pdf_view');
227
- // if (preCon){
228
- // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
229
- // }
230
- // })
231
- // } else {
232
- // this.getSummarySuccess();
233
- // }
234
- if(val) {
235
- this.getSummarySuccess();
236
- }
237
- }
238
- },
239
- knowledgeId:{
240
- handler(val){
241
- if (val){
242
- this.getTextWatermark();
243
- }
244
- }
245
- }
246
- },
247
- computed:{
248
- pdfStyle() {
249
- return {
250
- paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
251
- paddingBottom: this.tagIds > 1 ? '60px' : '0',
252
- height: '100%'
253
- }
254
- },
255
- previewUrl() {
256
- console.debug('VUE_APP_ENV',process.env.VUE_APP_ENV)
257
- let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
258
- // if(this.url != '') {
259
- // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
260
- // url += btoa(encodeURIComponent(this.url))
261
- // } else {
262
- // url += btoa(this.url)
263
- // }
264
- // }
265
- url = url + this.url
266
- url += '&officePreviewType=pdf'
267
- if(this.watermark) {
268
- url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
269
- url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
270
- }
271
- console.log('textWatermarkStr 216', this.textWatermarkStr)
272
- if (this.textWatermarkStr) {
273
- url += '&textWatermarkValue=' + this.textWatermarkStr
274
- }
275
- return url
276
- },
277
- // fileType() {
278
- // const fileType = this.url.substring(this.url.lastIndexOf('.'));
279
- // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
280
- // return 'VIDEO'
281
- // } else {
282
- // return 'OTHER'
283
- // }
284
-
285
- // }
286
- },
287
- methods: {
288
- close () {
289
- setTimeout(() => {
290
- this.previewShowPopup = false;
291
- this.fileType = ''
292
- }, 300)
293
- this.drawer = false;
294
- this.showSummary = false;
295
- },
296
- loadIframe () {
297
-
298
- if (this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0)) {
299
- this.loading = false
300
- } else {
301
- let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
302
- if (iframe) {
303
- iframe.onload = () => {
304
- this.loading = false;
305
- document.getElementById('drawer_content_pre').style.backgroundImage = 'none'
306
- }
307
- }
308
- // let time = setInterval(() =>{
309
- //
310
- // if(iframe) {
311
- // this.loading = false
312
- // clearInterval(time)
313
- // }
314
- // }, 500)
315
- }
316
- },
317
- getBolb () {
318
- this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false', {
319
- fileInOssPath: this.url,
320
- templateId: ''
321
- }).then(res => {
322
- if (res.data.code == 0) {
323
- this.fileText = res.data.data
324
- this.loading = false
325
- }
326
- })
327
- },
328
- previewToDialog (flag) {
329
- this.$emit('previewToDialog', flag)
330
- },
331
- closeSummary () {
332
- this.showSummary = false;
333
- },
334
- recommendQues (item, knowledgeId) {
335
- console.log('recommendQues', item, knowledgeId);
336
- this.$emit('recommendQues', item, knowledgeId)
337
- },
338
- handleIframeMessage (res) {
339
- console.log('handleIframeMessage', res)
340
- if (res.data.type == 'getViewerHeight') {
341
- let iframeHeight = this.iframeHeight.replace('px', '')
342
- if (res.data.data && iframeHeight != (res.data.data + 50)) {
343
- this.iframeHeight = res.data.data + 50 + 'px'
344
- }
345
- }
346
- },
347
- summaryFun () {
348
- this.showSummary = !this.showSummary;
349
- if (this.showSummary) {
350
- document.getElementById('drawer_content_pre').scrollTop = 0;
351
- }
352
- },
353
- getSummarySuccess () {
354
- this.$nextTick(() => {
355
- // if (this.tagIds.length > 0){
356
- // let intelligentSummary = document.getElementById('intelligentSummary');
357
- // let preCon = document.querySelector('.pdf_view')
358
- // if (intelligentSummary){
359
- // let height = intelligentSummary.offsetHeight + (this.isPc ? 100 : 50 );
360
- // if (preCon){
361
- // preCon.style.height = 'calc(100% - ' + height + 'px)'
362
- // }
363
- // console.log('height',height,preCon)
364
- // }
365
- // }
366
- // let intelligentSummary = document.getElementById('intelligentSummary');
367
- // let height = intelligentSummary.offsetHeight
368
- // this.pdfStyle.height = 'calc(100% - ' + height + 'px)'
369
- })
370
- },
371
- getTextWatermark () {
372
- let url = '/knowledge-api/open/knowledge/getPermissionInfo';
373
- let obj = {
374
- "knowledgeId": this.knowledgeId,
375
- "userId": sessionStorage.getItem('_currentUserId'),
376
- "mainId": sessionStorage.getItem('_mainId'),
377
- "corpId": sessionStorage.getItem('_corpid')
378
- }
379
- this.$http.post(url, obj).then(res => {
380
- console.log('getTextWatermark', res.data.data)
381
- if (res.data.data) {
382
- this.textWatermarkStr = res.data.data.textWatermarkStr;
383
- this.isDownload = res.data.data.showDownloadBtn;
384
- }
385
- })
386
- },
387
- downLoad () {
388
- let url = this.previewOssPath
389
- if (decodeURIComponent(url) != url) {
390
- url = decodeURIComponent(url)
391
- }
392
- const fileType = url.substring(url.lastIndexOf('.'));
393
- this.$http.post('/knowledge-api/temporary-certificate/or-origin?expired=10', url, {
394
- headers: {
395
- "Content-Type": "application/json",
396
- }
397
- }).then(res => {
398
- console.log('downLoad 341', res)
399
- if (res.data|| res.bodyText) {
400
- if (isMobile()) {
401
-
402
- const iframe = document.createElement("iframe");
403
- iframe.setAttribute("hidden", "hidden");
404
- iframe.onload = () => {
405
- if (iframe) {
406
- console.log("iframe onload....")
407
- iframe.setAttribute('src', 'about:blank');
408
- }
409
- };
410
- document.body.insertBefore(iframe, null);
411
- iframe.setAttribute("src", res.data || res.bodyText);
412
- } else {
413
- let a = document.createElement('a')
414
- a.href = res.data|| res.bodyText
415
- a.download = (this.title) + fileType
416
- a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
417
- }
418
- this.close()
419
-
420
- }
421
- })
422
- },
423
- isPcFun () {
424
- if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
425
- this.isPc = false
426
- } else {
427
- this.isPc = true
428
- }
429
- },
430
- clickFloder() {
431
- this.$emit('previewClickFloder')
432
- }
433
- },
434
- beforeDestroy () {
435
- window.removeEventListener('message', this.handleIframeMessage);
436
- }
437
- }
438
- </script>
439
-
440
- <style lang="less" scoped>
441
- #drawer_content_pre {
442
- padding: 20px;
443
- scroll-behavior: smooth;
444
-
445
- .mobile_onload_btn {
446
- position: absolute;
447
- right: 0;
448
- bottom: 10%;
449
- width: 20px;
450
- height: 60px;
451
- display: flex;
452
- align-items: center;
453
- justify-content: center;
454
- cursor: pointer;
455
- border-top-left-radius: 10px;
456
- border-bottom-left-radius: 10px;
457
- color: #366aff;
458
- background: #ffffff;
459
- border: 1px solid #a1b9ff;
460
- font-size: 12px;
461
- border-right: none;
462
- text-align: center;
463
- }
464
-
465
- .pdf_positon {
466
- width: 100%;
467
- box-sizing: border-box;
468
- }
469
- }
470
-
471
- .onload_btn {
472
- width: 76px;
473
- height: 26px;
474
- display: flex;
475
- align-items: center;
476
- justify-content: center;
477
- cursor: pointer;
478
- margin-right: 10px;
479
- border-radius: 15px;
480
- color: #366aff;
481
- background: #ffffff;
482
- border: 1px solid #a1b9ff;
483
- box-sizing: border-box;
484
- }
485
-
486
- .preview_iframe {
487
- width: 100%;
488
- height: 100%;
489
- box-sizing: border-box;
490
- background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
491
- background-position: center;
492
- background-size: 50px;
493
- background-repeat: no-repeat;
494
- }
495
-
496
- .preview_iframe_kk {
497
- width: 100%;
498
- height: 100%;
499
- }
500
-
501
-
502
- .preview_iframe_html {
503
- width: 100%;
504
- height: 100%;
505
- overflow-y: scroll;
506
- text-align: left;
507
- box-sizing: border-box;
508
- padding: 16px;
509
-
510
- /deep/.lake-content {
511
- margin-left: 10px;
512
- }
513
-
514
- /deep/a:link {
515
- color: #0000ee !important;
516
- }
517
-
518
- /deep/a:visited {
519
- color: #0000ee !important;
520
- }
521
-
522
- /deep/a:hover {
523
- color: #0000ee !important;
524
- }
525
-
526
- /deep/a:active {
527
- color: #0000ee !important;
528
- }
529
-
530
- /deep/li:not(.rich-text-li),
531
- ol:not(.list-paddingleft-2),
532
- ul:not(.list-paddingleft-2) {
533
- list-style-type: auto !important;
534
- }
535
-
536
- /deep/img {
537
- width: 100%;
538
- }
539
-
540
- /deep/.ne-table {
541
- width: 100% !important;
542
- }
543
- }
544
-
545
- .footer {
546
- width: calc(100% - 40px);
547
- height: 50px;
548
- display: flex;
549
- align-items: center;
550
- justify-content: space-between;
551
- cursor: pointer;
552
- padding: 0 20px;
553
- border-bottom: 1px solid #cccccc;
554
- }
555
-
556
- .loading_img {
557
- display: flex;
558
- align-items: center;
559
- justify-content: center;
560
- width: 100%;
561
- height: 100%;
562
- position: absolute;
563
- top: 0;
564
- left: 0;
565
- background: #FFF;
566
-
567
- img {
568
- width: 50px;
569
- height: 50px;
570
- }
571
- }
572
-
573
- .libang_head {
574
- height: 64px !important;
575
- }
576
-
577
- .drawer-header {
578
- width: 100%;
579
- height: 50px;
580
- cursor: pointer;
581
- padding: 6px 20px;
582
- border-bottom: 1px solid #cccccc;
583
- .btn_position {
584
- position: absolute;
585
- top: -34px;
586
- left: 12px;
587
- }
588
-
589
- .header-btn {
590
- display: flex;
591
- align-items: center;
592
- justify-content: space-between;
593
-
594
- .header-right {
595
- display: flex;
596
- }
597
-
598
- .summaryBtn {
599
- flex: none;
600
- //width: 95px;
601
- height: 26px;
602
- padding: 0 8px;
603
- background: #ffffff;
604
- display: flex;
605
- align-items: center;
606
- justify-content: center;
607
- box-sizing: border-box;
608
- border: 1px solid #a1b9ff;
609
- border-radius: 15px;
610
- cursor: pointer;
611
- color: #366aff;
612
- margin-right: 10px;
613
- font-size: 14px;
614
-
615
- i {
616
- font-size: 14px;
617
- margin-right: 5px;
618
- }
619
- }
620
-
621
- .summaryActiveBtn {
622
- background: #366aff !important;
623
- color: #ffffff !important;
624
- }
625
-
626
- .chat {
627
- flex: none;
628
- height: 26px;
629
- padding: 0 8px;
630
- background: #ffffff;
631
- display: flex;
632
- align-items: center;
633
- justify-content: center;
634
- box-sizing: border-box;
635
- border: 1px solid #a1b9ff;
636
- border-radius: 15px 0px 15px 15px;
637
- cursor: pointer;
638
- color: #366aff;
639
- margin-right: 10px;
640
- font-size: 14px;
641
-
642
- i {
643
- font-size: 14px;
644
- margin-right: 5px;
645
- margin-top: 2px;
646
- }
647
- }
648
-
649
- .chat_active {
650
- background: #366aff !important;
651
- color: #FFFFFF !important;
652
- }
653
- }
654
-
655
- .header_title {
656
- font-size: 14px;
657
- height: 100%;
658
- .header_close {
659
- display: flex;
660
- align-items: center;
661
- justify-content: space-between;
662
- line-height: 26px;
663
- }
664
- .header_floder {
665
- display: flex;
666
- align-items: center;
667
- line-height: 26px;
668
- i {
669
- margin: 0 5px;
670
- color: #366aff;
671
- }
672
- }
673
- .header_top {
674
- height: 100%;
675
- display: flex;
676
- align-items: center;
677
- justify-content: space-between;
678
- }
679
- }
680
- }
681
-
682
- @media screen and (max-width: 767px) {
683
-
684
- /* 这里是针对移动设备的css样式设置 */
685
- /deep/.el-drawer__body {
686
- height: 100%;
687
- }
688
-
689
- #drawer_content_pre {
690
- overflow: auto;
691
- height: calc(100% - 50px);
692
- background: #FFF;
693
- }
694
-
695
- .libang_content_pre {
696
- height: calc(100% - 64px) !important;
697
- }
698
- }
699
-
700
- @media screen and (min-width: 768px) {
701
-
702
- /* 这里是针对pc设备的css样式设置 */
703
- /deep/.el-drawer__body {
704
- height: 100%;
705
- }
706
-
707
- #drawer_content_pre {
708
- overflow: auto;
709
- height: calc(100% - 50px);
710
- background: #FFF;
711
- }
712
-
713
- .libang_content_pre {
714
- height: calc(100% - 64px) !important;
715
- }
716
- }
717
-
718
- @media screen and (min-width: 1200px) {
719
-
720
- /* 这里是针对pc设备的css样式设置 */
721
- .el-drawer__wrapper {
722
- width: 55%;
723
- left: calc(100vw - 55%);
724
- right: 0;
725
-
726
- /deep/.pdf-preview-drawer {
727
- width: 100% !important;
728
- }
729
- }
730
-
731
- /deep/.el-drawer__body {
732
- height: 100%;
733
- }
734
-
735
- #drawer_content_pre {
736
- overflow: auto;
737
- height: calc(100% - 50px);
738
- background: #FFF;
739
- }
740
-
741
- .libang_content_pre {
742
- height: calc(100% - 64px) !important;
743
- }
744
- }
745
- </style><style lang="less">
746
- .pdf-preview-drawer {
747
- overflow: visible !important;
748
- }
749
- .libang_content_pre {
750
- .change_scale {
751
- top: 64px !important;
752
- }
753
- .float_intelligentSummary {
754
- top: 74px !important;
755
- }
756
- }
757
- </style>
1
+
2
+ <!-- preview-pdf
3
+ 组件主要负责 知识项目中 文件的预览,携带定位信息参数 tagIds tagId 的会解析文件增加定位功能
4
+ 不携带定位信息的 也是走 kkview项目预览
5
+ 另外增加了在知识项目中预览当前文件的一些功能
6
+ -->
7
+ <template>
8
+ <el-drawer title="我是标题" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
9
+ :modal="false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
10
+ custom-class="pdf-preview-drawer" v-if="drawer">
11
+ <!-- v-else-if="drawer" -->
12
+ <div class="drawer-header" :class="isLiBang ? 'libang_head' : ''" v-if="!isPc">
13
+ <div class="header-btn btn_position">
14
+ <div class="onload_btn" v-if="isDownload || true" @click="downLoad">
15
+ 下载
16
+ </div>
17
+ <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
18
+ v-if="isHasChat || true">
19
+ <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
20
+ <span>智能摘要</span>
21
+ </div>
22
+ <template v-if="isHasChat || true">
23
+ <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
24
+ <i class="iconfont guoran-wendapingjia"></i>
25
+ 聊一聊
26
+ </div>
27
+ <div class="chat chat_active" @click="previewToDialog(false)" v-else>
28
+ <i class="iconfont guoran-wendapingjia"></i>
29
+ 聊一聊
30
+ </div>
31
+ </template>
32
+ </div>
33
+ <div class="header_title">
34
+ <div class="header_close">
35
+ <span>
36
+ {{ title ? title : "查看详情" }}
37
+ </span>
38
+ <section @click="close">
39
+ <i class="iconfont guoran-shanchu"></i>
40
+ </section>
41
+ </div>
42
+ <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
43
+ <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
44
+ {{ folderName }}
45
+ <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
46
+ </p>
47
+ </div>
48
+ </div>
49
+ <div class="drawer-header" :class="isLiBang && folderName ? 'libang_head' : ''" v-else>
50
+ <div class="header_title">
51
+ <div :class="isLiBang && folderName ? 'header_close' : 'header_top'">
52
+ <span>
53
+ {{ title ? title : "查看详情" }}
54
+ </span>
55
+ <div class="header-btn">
56
+ <div class="onload_btn" v-if="isDownload || true" @click="downLoad">
57
+ 下载
58
+ </div>
59
+ <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
60
+ v-if="isHasChat || true">
61
+ <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
62
+ <span>智能摘要</span>
63
+ </div>
64
+ <template v-if="isHasChat || true">
65
+ <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
66
+ <i class="iconfont guoran-wendapingjia"></i>
67
+ 聊一聊
68
+ </div>
69
+ <div class="chat chat_active" @click="previewToDialog(false)" v-else>
70
+ <i class="iconfont guoran-wendapingjia"></i>
71
+ 聊一聊
72
+ </div>
73
+ </template>
74
+ <section @click="close">
75
+ <i class="iconfont guoran-shanchu"></i>
76
+ </section>
77
+ </div>
78
+ </div>
79
+ <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
80
+ <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
81
+ {{ folderName }}
82
+ <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
83
+ </p>
84
+ </div>
85
+ </div>
86
+ <div id="drawer_content_pre" :class="isLiBang && folderName ? 'libang_content_pre' : ''">
87
+ <!-- :style="{marginTop:tagIds && tagIds.length != 0 && isPc ? '50px' : ''}" -->
88
+ <intelligent-summary v-show="showSummary && isHasChat" :tagIds="tagIds" :knowledgeId="knowledgeId"
89
+ @closeSummary="closeSummary" @recommendQues="recommendQues"
90
+ @getSummarySuccess="getSummarySuccess"></intelligent-summary>
91
+ <div class="pdf_positon" :style="pdfStyle" v-if="tagIds && tagIds.length != 0 && drawer">
92
+ <pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :textWatermarkStr="textWatermarkStr">
93
+ </pdfPosition>
94
+ </div>
95
+ <template v-else>
96
+ <div v-if="fileType == 'VIDEO'" style="width: 100%;">
97
+ <video :src="url" controls width="100%;" height="98%"></video>
98
+ </div>
99
+ <div v-else-if="fileType == 'HTML'" style="width: 100%;">
100
+ <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
101
+ </div>
102
+ <template v-else-if="url.includes('https://www') || url.includes('http://www')">
103
+ <iframe class="preview_iframe" :src="url" width="100%" height="100%" scrolling="100%" frameborder="no"
104
+ border="0"></iframe>
105
+ </template>
106
+ <template v-else>
107
+ <iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;"
108
+ :style="{ height: iframeHeight }"></iframe>
109
+ </template>
110
+ </template>
111
+ <!-- <div class="mobile_onload_btn" v-if="isDownload && !isPc" @click="downLoad">
112
+ 下载
113
+ </div> -->
114
+ </div>
115
+ <div class="loading_img" v-show="loading">
116
+ <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
117
+ </div>
118
+ <div id="text">
119
+ {{ copy }}
120
+ </div>
121
+ </el-drawer>
122
+ </template>
123
+
124
+ <script>
125
+ import pdfPosition from './pdfPosition.vue'
126
+ import { zoomElement } from '../assets/js/hammer'
127
+ import IntelligentSummary from "./intelligentSummary";
128
+ import { isMobile } from "../assets/js/common";
129
+ import { Toast } from 'vant';
130
+ export default {
131
+ data () {
132
+ return {
133
+ previewShowPopup: false,
134
+ fileText: '',
135
+ fileType: "",
136
+ isPc: false,
137
+ drawer: false,
138
+ tagIds: [],
139
+ // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
140
+ loading: true,
141
+ fileName:'',
142
+ previewKnowledgeId:"",
143
+ showSummary:true,
144
+ iframeHeight:"100%",
145
+ isDownload: false,
146
+ textWatermarkStr:"",
147
+ copy:''}
148
+ },
149
+ mounted() {
150
+ window.addEventListener('message',this.handleIframeMessage,false);
151
+ this.isPcFun();
152
+ },
153
+ props:{
154
+ url:{
155
+ type: String,
156
+ required: true,
157
+ },
158
+ officePreviewType:{
159
+ type: String,
160
+ default: ''
161
+ },
162
+ isMessageRecord:{
163
+ type: Boolean,
164
+ default:false,
165
+ },
166
+ sourceFileType:{
167
+ type: String,
168
+ default: '',
169
+ },
170
+ title: {
171
+ type: String,
172
+ default: ''
173
+ },
174
+ isHasChat:{
175
+ type:Boolean,
176
+ default:false
177
+ },
178
+ knowledgeId:{
179
+ type: String,
180
+ default: '',
181
+ },
182
+ previewOssPath:{
183
+ type: String,
184
+ default: '',
185
+ },
186
+ folderName: {
187
+ type: String,
188
+ default: '',
189
+ },
190
+ folderUrl: {
191
+ type: String,
192
+ default: '',
193
+ },
194
+ isLiBang: {
195
+ type: Boolean,
196
+ default: false
197
+ }
198
+ },
199
+ components: {
200
+ IntelligentSummary,
201
+ pdfPosition
202
+ },
203
+ watch: {
204
+ drawer (value) {
205
+ if (value) {
206
+ this.$emit('open')
207
+ this.$nextTick(() => {
208
+ if (this.tagIds && this.tagIds.length != 0){
209
+ zoomElement(document.getElementById('pdf_container_view'))
210
+ }
211
+ })
212
+ } else {
213
+ this.$emit('close')
214
+ }
215
+ setTimeout(() => {
216
+ let previewIframe = document.getElementsByClassName('preview_iframe')
217
+ Array.from(previewIframe).forEach(item =>{
218
+ item.onload = () =>{
219
+ console.debug('previewIframe 106',previewIframe,this.drawer)
220
+ item.style.backgroundImage = 'none'
221
+ }
222
+ })
223
+ })
224
+ },
225
+ showSummary:{
226
+ handler(val){
227
+ // if (!val){
228
+ // this.$nextTick(() => {
229
+ // let preCon = document.querySelector('.pdf_view');
230
+ // if (preCon){
231
+ // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
232
+ // }
233
+ // })
234
+ // } else {
235
+ // this.getSummarySuccess();
236
+ // }
237
+ if(val) {
238
+ this.getSummarySuccess();
239
+ }
240
+ }
241
+ },
242
+ knowledgeId:{
243
+ handler(val){
244
+ if (val){
245
+ this.getTextWatermark();
246
+ }
247
+ }
248
+ }
249
+ },
250
+ computed:{
251
+ pdfStyle() {
252
+ return {
253
+ paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
254
+ paddingBottom: this.tagIds > 1 ? '60px' : '0',
255
+ height: '100%'
256
+ }
257
+ },
258
+ previewUrl() {
259
+ console.debug('VUE_APP_ENV',process.env.VUE_APP_ENV)
260
+ let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
261
+ // if(this.url != '') {
262
+ // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
263
+ // url += btoa(encodeURIComponent(this.url))
264
+ // } else {
265
+ // url += btoa(this.url)
266
+ // }
267
+ // }
268
+ url = url + this.url
269
+ url += '&officePreviewType=pdf'
270
+ if(this.watermark) {
271
+ url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
272
+ url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
273
+ }
274
+ console.log('textWatermarkStr 216', this.textWatermarkStr)
275
+ if (this.textWatermarkStr) {
276
+ url += '&textWatermarkValue=' + this.textWatermarkStr
277
+ }
278
+ return url
279
+ },
280
+ // fileType() {
281
+ // const fileType = this.url.substring(this.url.lastIndexOf('.'));
282
+ // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
283
+ // return 'VIDEO'
284
+ // } else {
285
+ // return 'OTHER'
286
+ // }
287
+
288
+ // }
289
+ },
290
+ methods: {
291
+ close () {
292
+ setTimeout(() => {
293
+ this.previewShowPopup = false;
294
+ this.fileType = ''
295
+ }, 300)
296
+ this.drawer = false;
297
+ this.showSummary = false;
298
+ },
299
+ loadIframe () {
300
+
301
+ if (this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0)) {
302
+ this.loading = false
303
+ } else {
304
+ let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
305
+ if (iframe) {
306
+ iframe.onload = () => {
307
+ this.loading = false;
308
+ document.getElementById('drawer_content_pre').style.backgroundImage = 'none'
309
+ }
310
+ }
311
+ // let time = setInterval(() =>{
312
+ //
313
+ // if(iframe) {
314
+ // this.loading = false
315
+ // clearInterval(time)
316
+ // }
317
+ // }, 500)
318
+ }
319
+ },
320
+ getBolb () {
321
+ this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false', {
322
+ fileInOssPath: this.url,
323
+ templateId: ''
324
+ }).then(res => {
325
+ if (res.data.code == 0) {
326
+ this.fileText = res.data.data
327
+ this.loading = false
328
+ }
329
+ })
330
+ },
331
+ previewToDialog (flag) {
332
+ this.$emit('previewToDialog', flag)
333
+ },
334
+ closeSummary () {
335
+ this.showSummary = false;
336
+ },
337
+ recommendQues (item, knowledgeId) {
338
+ console.log('recommendQues', item, knowledgeId);
339
+ this.$emit('recommendQues', item, knowledgeId)
340
+ },
341
+ handleIframeMessage (res) {
342
+ console.log('handleIframeMessage', res)
343
+ if (res.data.type == 'getViewerHeight') {
344
+ let iframeHeight = this.iframeHeight.replace('px', '')
345
+ if (res.data.data && iframeHeight != (res.data.data + 50)) {
346
+ this.iframeHeight = res.data.data + 50 + 'px'
347
+ }
348
+ }
349
+ },
350
+ summaryFun () {
351
+ this.showSummary = !this.showSummary;
352
+ if (this.showSummary) {
353
+ document.getElementById('drawer_content_pre').scrollTop = 0;
354
+ }
355
+ },
356
+ getSummarySuccess () {
357
+ this.$nextTick(() => {
358
+ // if (this.tagIds.length > 0){
359
+ // let intelligentSummary = document.getElementById('intelligentSummary');
360
+ // let preCon = document.querySelector('.pdf_view')
361
+ // if (intelligentSummary){
362
+ // let height = intelligentSummary.offsetHeight + (this.isPc ? 100 : 50 );
363
+ // if (preCon){
364
+ // preCon.style.height = 'calc(100% - ' + height + 'px)'
365
+ // }
366
+ // console.log('height',height,preCon)
367
+ // }
368
+ // }
369
+ // let intelligentSummary = document.getElementById('intelligentSummary');
370
+ // let height = intelligentSummary.offsetHeight
371
+ // this.pdfStyle.height = 'calc(100% - ' + height + 'px)'
372
+ })
373
+ },
374
+ getTextWatermark () {
375
+ let url = '/knowledge-api/open/knowledge/getPermissionInfo';
376
+ let obj = {
377
+ "knowledgeId": this.knowledgeId,
378
+ "userId": sessionStorage.getItem('_currentUserId'),
379
+ "mainId": sessionStorage.getItem('_mainId'),
380
+ "corpId": sessionStorage.getItem('_corpid')
381
+ }
382
+ this.$http.post(url, obj).then(res => {
383
+ console.log('getTextWatermark', res.data.data)
384
+ if (res.data.data) {
385
+ this.textWatermarkStr = res.data.data.textWatermarkStr;
386
+ this.isDownload = res.data.data.showDownloadBtn;
387
+ }
388
+ })
389
+ },
390
+ downLoad () {
391
+ let url = this.previewOssPath
392
+ if (decodeURIComponent(url) != url) {
393
+ url = decodeURIComponent(url)
394
+ }
395
+ const fileType = url.substring(url.lastIndexOf('.'));
396
+ this.$http.post('/knowledge-api/temporary-certificate/or-origin?expired=10', url, {
397
+ headers: {
398
+ "Content-Type": "application/json",
399
+ }
400
+ }).then(res => {
401
+ console.log('downLoad 341', res)
402
+ if (res.data|| res.bodyText) {
403
+ if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
404
+ this.copy = res.data
405
+ if (isMobile()) {
406
+ setTimeout(() =>{
407
+ const range = document.createRange();
408
+ range.selectNode(document.getElementById('text'));
409
+ const selection = window.getSelection();
410
+ //移除之前选中内容
411
+ if (selection.rangeCount > 0) selection.removeAllRanges();
412
+ selection.addRange(range);
413
+ document.execCommand('copy');
414
+ selection.removeAllRanges()
415
+ Toast('下载地址已复制,请前往Safari浏览器访问下载');
416
+ this.close()
417
+ },100)
418
+ } else {
419
+ let a = document.createElement('a')
420
+ a.href = res.data
421
+ a.download = (this.title) + fileType
422
+ a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
423
+ }
424
+ return
425
+ } else {
426
+ // setTimeout(() =>{
427
+ // window.open(res.data,'下载', 'noopener')
428
+ // }, 2000)
429
+ // window.open(res.data,'下载', 'noopener')
430
+ if (isMobile()) {
431
+
432
+ const iframe = document.createElement("iframe");
433
+ iframe.setAttribute("hidden", "hidden");
434
+ iframe.onload = () => {
435
+ if (iframe) {
436
+ console.log("iframe onload....")
437
+ iframe.setAttribute('src', 'about:blank');
438
+ }
439
+ };
440
+ document.body.insertBefore(iframe, null);
441
+ iframe.setAttribute("src", res.data );
442
+ } else {
443
+ let a = document.createElement('a')
444
+ a.href = res.data
445
+ a.download = (this.title) + fileType
446
+ a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
447
+ }
448
+ this.close()
449
+ }
450
+ }
451
+ })
452
+ },
453
+ isPcFun () {
454
+ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
455
+ this.isPc = false
456
+ } else {
457
+ this.isPc = true
458
+ }
459
+ },
460
+ clickFloder() {
461
+ this.$emit('previewClickFloder')
462
+ }
463
+ },
464
+ beforeDestroy () {
465
+ window.removeEventListener('message', this.handleIframeMessage);
466
+ }
467
+ }
468
+ </script>
469
+
470
+ <style lang="less" scoped>
471
+ #drawer_content_pre {
472
+ padding: 20px;
473
+ scroll-behavior: smooth;
474
+
475
+ .mobile_onload_btn {
476
+ position: absolute;
477
+ right: 0;
478
+ bottom: 10%;
479
+ width: 20px;
480
+ height: 60px;
481
+ display: flex;
482
+ align-items: center;
483
+ justify-content: center;
484
+ cursor: pointer;
485
+ border-top-left-radius: 10px;
486
+ border-bottom-left-radius: 10px;
487
+ color: #366aff;
488
+ background: #ffffff;
489
+ border: 1px solid #a1b9ff;
490
+ font-size: 12px;
491
+ border-right: none;
492
+ text-align: center;
493
+ }
494
+
495
+ .pdf_positon {
496
+ width: 100%;
497
+ box-sizing: border-box;
498
+ }
499
+ }
500
+
501
+ .onload_btn {
502
+ width: 76px;
503
+ height: 26px;
504
+ display: flex;
505
+ align-items: center;
506
+ justify-content: center;
507
+ cursor: pointer;
508
+ margin-right: 10px;
509
+ border-radius: 15px;
510
+ color: #366aff;
511
+ background: #ffffff;
512
+ border: 1px solid #a1b9ff;
513
+ box-sizing: border-box;
514
+ }
515
+
516
+ .preview_iframe {
517
+ width: 100%;
518
+ height: 100%;
519
+ box-sizing: border-box;
520
+ background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
521
+ background-position: center;
522
+ background-size: 50px;
523
+ background-repeat: no-repeat;
524
+ }
525
+
526
+ .preview_iframe_kk {
527
+ width: 100%;
528
+ height: 100%;
529
+ }
530
+
531
+
532
+ .preview_iframe_html {
533
+ width: 100%;
534
+ height: 100%;
535
+ overflow-y: scroll;
536
+ text-align: left;
537
+ box-sizing: border-box;
538
+ padding: 16px;
539
+
540
+ /deep/.lake-content {
541
+ margin-left: 10px;
542
+ }
543
+
544
+ /deep/a:link {
545
+ color: #0000ee !important;
546
+ }
547
+
548
+ /deep/a:visited {
549
+ color: #0000ee !important;
550
+ }
551
+
552
+ /deep/a:hover {
553
+ color: #0000ee !important;
554
+ }
555
+
556
+ /deep/a:active {
557
+ color: #0000ee !important;
558
+ }
559
+
560
+ /deep/li:not(.rich-text-li),
561
+ ol:not(.list-paddingleft-2),
562
+ ul:not(.list-paddingleft-2) {
563
+ list-style-type: auto !important;
564
+ }
565
+
566
+ /deep/img {
567
+ width: 100%;
568
+ }
569
+
570
+ /deep/.ne-table {
571
+ width: 100% !important;
572
+ }
573
+ }
574
+
575
+ .footer {
576
+ width: calc(100% - 40px);
577
+ height: 50px;
578
+ display: flex;
579
+ align-items: center;
580
+ justify-content: space-between;
581
+ cursor: pointer;
582
+ padding: 0 20px;
583
+ border-bottom: 1px solid #cccccc;
584
+ }
585
+
586
+ .loading_img {
587
+ display: flex;
588
+ align-items: center;
589
+ justify-content: center;
590
+ width: 100%;
591
+ height: 100%;
592
+ position: absolute;
593
+ top: 0;
594
+ left: 0;
595
+ background: #FFF;
596
+
597
+ img {
598
+ width: 50px;
599
+ height: 50px;
600
+ }
601
+ }
602
+
603
+ .libang_head {
604
+ height: 64px !important;
605
+ }
606
+
607
+ .drawer-header {
608
+ width: 100%;
609
+ height: 50px;
610
+ cursor: pointer;
611
+ padding: 6px 20px;
612
+ border-bottom: 1px solid #cccccc;
613
+ .btn_position {
614
+ position: absolute;
615
+ top: -34px;
616
+ left: 12px;
617
+ }
618
+
619
+ .header-btn {
620
+ display: flex;
621
+ align-items: center;
622
+ justify-content: space-between;
623
+
624
+ .header-right {
625
+ display: flex;
626
+ }
627
+
628
+ .summaryBtn {
629
+ flex: none;
630
+ //width: 95px;
631
+ height: 26px;
632
+ padding: 0 8px;
633
+ background: #ffffff;
634
+ display: flex;
635
+ align-items: center;
636
+ justify-content: center;
637
+ box-sizing: border-box;
638
+ border: 1px solid #a1b9ff;
639
+ border-radius: 15px;
640
+ cursor: pointer;
641
+ color: #366aff;
642
+ margin-right: 10px;
643
+ font-size: 14px;
644
+
645
+ i {
646
+ font-size: 14px;
647
+ margin-right: 5px;
648
+ }
649
+ }
650
+
651
+ .summaryActiveBtn {
652
+ background: #366aff !important;
653
+ color: #ffffff !important;
654
+ }
655
+
656
+ .chat {
657
+ flex: none;
658
+ height: 26px;
659
+ padding: 0 8px;
660
+ background: #ffffff;
661
+ display: flex;
662
+ align-items: center;
663
+ justify-content: center;
664
+ box-sizing: border-box;
665
+ border: 1px solid #a1b9ff;
666
+ border-radius: 15px 0px 15px 15px;
667
+ cursor: pointer;
668
+ color: #366aff;
669
+ margin-right: 10px;
670
+ font-size: 14px;
671
+
672
+ i {
673
+ font-size: 14px;
674
+ margin-right: 5px;
675
+ margin-top: 2px;
676
+ }
677
+ }
678
+
679
+ .chat_active {
680
+ background: #366aff !important;
681
+ color: #FFFFFF !important;
682
+ }
683
+ }
684
+
685
+ .header_title {
686
+ font-size: 14px;
687
+ height: 100%;
688
+ .header_close {
689
+ display: flex;
690
+ align-items: center;
691
+ justify-content: space-between;
692
+ line-height: 26px;
693
+ }
694
+ .header_floder {
695
+ display: flex;
696
+ align-items: center;
697
+ line-height: 26px;
698
+ i {
699
+ margin: 0 5px;
700
+ color: #366aff;
701
+ }
702
+ }
703
+ .header_top {
704
+ height: 100%;
705
+ display: flex;
706
+ align-items: center;
707
+ justify-content: space-between;
708
+ }
709
+ }
710
+ }
711
+
712
+ @media screen and (max-width: 767px) {
713
+
714
+ /* 这里是针对移动设备的css样式设置 */
715
+ /deep/.el-drawer__body {
716
+ height: 100%;
717
+ }
718
+
719
+ #drawer_content_pre {
720
+ overflow: auto;
721
+ height: calc(100% - 50px);
722
+ background: #FFF;
723
+ }
724
+
725
+ .libang_content_pre {
726
+ height: calc(100% - 64px) !important;
727
+ }
728
+ }
729
+
730
+ @media screen and (min-width: 768px) {
731
+
732
+ /* 这里是针对pc设备的css样式设置 */
733
+ /deep/.el-drawer__body {
734
+ height: 100%;
735
+ }
736
+
737
+ #drawer_content_pre {
738
+ overflow: auto;
739
+ height: calc(100% - 50px);
740
+ background: #FFF;
741
+ }
742
+
743
+ .libang_content_pre {
744
+ height: calc(100% - 64px) !important;
745
+ }
746
+ }
747
+
748
+ @media screen and (min-width: 1200px) {
749
+
750
+ /* 这里是针对pc设备的css样式设置 */
751
+ .el-drawer__wrapper {
752
+ width: 55%;
753
+ left: calc(100vw - 55%);
754
+ right: 0;
755
+
756
+ /deep/.pdf-preview-drawer {
757
+ width: 100% !important;
758
+ }
759
+ }
760
+
761
+ /deep/.el-drawer__body {
762
+ height: 100%;
763
+ }
764
+
765
+ #drawer_content_pre {
766
+ overflow: auto;
767
+ height: calc(100% - 50px);
768
+ background: #FFF;
769
+ }
770
+
771
+ .libang_content_pre {
772
+ height: calc(100% - 64px) !important;
773
+ }
774
+ }
775
+ </style>
776
+ <style lang="less">
777
+ .pdf-preview-drawer {
778
+ overflow: visible !important;
779
+ }
780
+ .libang_content_pre {
781
+ .change_scale {
782
+ top: 64px !important;
783
+ }
784
+ .float_intelligentSummary {
785
+ top: 74px !important;
786
+ }
787
+ }
788
+ </style>