askbot-dragon 1.7.84-beta → 1.7.86-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 (95) 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 +60 -58
  5. package/public/index.html +73 -76
  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 +141 -117
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/common.js +261 -261
  13. package/src/assets/js/hammer.js +100 -89
  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 -192
  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 +178 -155
  21. package/src/components/AiGuide.vue +434 -471
  22. package/src/components/AnswerDocknowledge.vue +1203 -1203
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +10684 -10880
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/MyEditor.vue +342 -341
  29. package/src/components/QwFeedback.vue +302 -302
  30. package/src/components/actionSatisfaction.vue +107 -107
  31. package/src/components/actionSendToBot.vue +62 -62
  32. package/src/components/answerDissatisfaction.vue +62 -62
  33. package/src/components/answerRadio.vue +259 -259
  34. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  35. package/src/components/ask-components/Msgloading.vue +37 -37
  36. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  37. package/src/components/askVideo.vue +162 -139
  38. package/src/components/assetDetails.vue +378 -378
  39. package/src/components/assetMessage.vue +229 -229
  40. package/src/components/associationIntention.vue +378 -374
  41. package/src/components/attachmentPreview.vue +90 -90
  42. package/src/components/botActionSatisfactor.vue +68 -68
  43. package/src/components/chatContent.vue +513 -513
  44. package/src/components/feedBack.vue +136 -136
  45. package/src/components/fielListView.vue +351 -351
  46. package/src/components/file/AliyunOssComponents.vue +108 -108
  47. package/src/components/formTemplate.vue +3522 -3518
  48. package/src/components/imgView.vue +31 -31
  49. package/src/components/intelligentSummary.vue +234 -230
  50. package/src/components/kkview.vue +1128 -1128
  51. package/src/components/loadingProcess.vue +164 -164
  52. package/src/components/markDownText.vue +959 -960
  53. package/src/components/message/ActionAlertIframe.vue +112 -112
  54. package/src/components/message/ShopMessage.vue +164 -164
  55. package/src/components/message/TextMessage.vue +928 -924
  56. package/src/components/message/TicketMessage.vue +201 -201
  57. package/src/components/message/swiper/index.js +4 -4
  58. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  59. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  60. package/src/components/msgLoading.vue +231 -231
  61. package/src/components/myPopup.vue +73 -73
  62. package/src/components/newPdfPosition.vue +878 -0
  63. package/src/components/pagination.vue +128 -128
  64. package/src/components/pdfPosition.vue +1514 -1336
  65. package/src/components/popup.vue +228 -228
  66. package/src/components/preview/docView.vue +123 -113
  67. package/src/components/preview/excelView.vue +210 -198
  68. package/src/components/preview/newPositionPreview.vue +390 -388
  69. package/src/components/preview/pdfView.vue +831 -831
  70. package/src/components/previewDoc.vue +252 -248
  71. package/src/components/previewPdf.vue +1119 -1119
  72. package/src/components/receiverMessagePlatform.vue +69 -69
  73. package/src/components/recommend.vue +80 -80
  74. package/src/components/selector/hOption.vue +20 -20
  75. package/src/components/selector/hSelector.vue +199 -199
  76. package/src/components/selector/hWrapper.vue +216 -216
  77. package/src/components/senderMessagePlatform.vue +58 -58
  78. package/src/components/source/BotMessage.vue +24 -24
  79. package/src/components/source/CustomMessage.vue +24 -24
  80. package/src/components/test.vue +260 -260
  81. package/src/components/tree.vue +307 -307
  82. package/src/components/utils/AliyunIssUtil.js +103 -103
  83. package/src/components/utils/ckeditor.js +185 -185
  84. package/src/components/utils/format_date.js +25 -25
  85. package/src/components/utils/index.js +6 -6
  86. package/src/components/utils/math_utils.js +29 -29
  87. package/src/components/voiceComponent.vue +119 -119
  88. package/src/components/welcomeKnowledgeFile.vue +347 -343
  89. package/src/components/welcomeLlmCard.vue +144 -140
  90. package/src/components/welcomeSuggest.vue +97 -97
  91. package/src/locales/cn.json +98 -98
  92. package/src/locales/en.json +98 -98
  93. package/src/locales/jp.json +73 -0
  94. package/src/main.js +76 -76
  95. package/vue.config.js +54 -54
@@ -1,1119 +1,1119 @@
1
- <!-- preview-pdf
2
- 组件主要负责 知识项目中 文件的预览,携带定位信息参数 tagIds tagId 的会解析文件增加定位功能
3
- 不携带定位信息的 也是走 kkview项目预览
4
- 另外增加了在知识项目中预览当前文件的一些功能
5
- -->
6
- <template>
7
- <el-drawer title="" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
8
- :modal="false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
9
- custom-class="pdf-preview-drawer" v-if="drawer">
10
- <div class="drawer-header"
11
- :class="(isDownload || (isHasChat && fileType != 'IMAGE')) && isLiBang ? 'has_btn_libang_head' : (isLiBang ? 'libang_head' : (isDownload || (isHasChat && fileType != 'IMAGE') ? 'has_btn_head' : ''))"
12
- v-if="!isPc">
13
- <div class="header_title">
14
- <template v-if="isDownload || (isHasChat && fileType != 'IMAGE')">
15
- <div class="top-header">
16
- <div class="header-btn">
17
- <div class="onload_btn" v-if="isDownload" @click="downLoad">
18
- {{ $t('dragonCommon.download') }}
19
- </div>
20
- <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
21
- v-if="isHasChat && fileType != 'IMAGE'">
22
- <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
23
- <span>{{ $t('dragonCommon.smartSummary') }}</span>
24
- </div>
25
- <template v-if="isHasChat && fileType != 'IMAGE'">
26
- <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
27
- <i class="iconfont guoran-wendapingjia"></i>
28
- {{ $t('dragonCommon.chat') }}
29
- </div>
30
- <div class="chat chat_active" @click="previewToDialog(false)" v-else>
31
- <i class="iconfont guoran-wendapingjia"></i>
32
- {{ $t('dragonCommon.chat') }}
33
- </div>
34
- </template>
35
- </div>
36
- <section @click="close">
37
- <i class="iconfont guoran-shanchu"></i>
38
- </section>
39
- </div>
40
- <span class="title_left">
41
- {{ title ? title : $t('dragonCommon.viewDetails') }}
42
- </span>
43
- </template>
44
- <div class="header_close" v-else>
45
- <span class="title_left">
46
- {{ title ? title : $t('dragonCommon.viewDetails') }}
47
- </span>
48
- <section @click="close">
49
- <i class="iconfont guoran-shanchu"></i>
50
- </section>
51
- </div>
52
- <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
53
- <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
54
- {{ folderName }}
55
- <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
56
- </p>
57
- </div>
58
- </div>
59
- <div class="drawer-header" :class="isLiBang && folderName ? 'libang_head' : ''" v-else>
60
- <div class="header_title">
61
- <div :class="isLiBang && folderName ? 'header_close' : 'header_top'">
62
- <span class="title_left">
63
- {{ title ? title : $t('dragonCommon.viewDetails') }}
64
- </span>
65
- <div class="header-btn">
66
- <div class="onload_btn" v-if="isDownload" @click="downLoad">
67
- {{ $t('dragonCommon.download') }}
68
- </div>
69
- <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
70
- v-if="isHasChat && fileType != 'IMAGE'">
71
- <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
72
- <span>{{ $t('dragonCommon.smartSummary') }}</span>
73
- </div>
74
- <template v-if="isHasChat && fileType != 'IMAGE'">
75
- <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
76
- <i class="iconfont guoran-wendapingjia"></i>
77
- {{ $t('dragonCommon.chat') }}
78
- </div>
79
- <div class="chat chat_active" @click="previewToDialog(false)" v-else>
80
- <i class="iconfont guoran-wendapingjia"></i>
81
- {{ $t('dragonCommon.chat') }}
82
- </div>
83
- </template>
84
- <section @click="close">
85
- <i class="iconfont guoran-shanchu"></i>
86
- </section>
87
- </div>
88
- </div>
89
- <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
90
- <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
91
- {{ folderName }}
92
- <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
93
- </p>
94
- </div>
95
- </div>
96
- <div id="drawer_content_pre"
97
- :class="(isDownload || (isHasChat && fileType != 'IMAGE')) && !isPc && isLiBang && folderName ? 'has_btn_libang_content_pre' : (isLiBang && folderName ? 'libang_content_pre' : '')">
98
- <intelligent-summary v-show="showSummary && (isHasChat && fileType != 'IMAGE')" :tagIds="tagIds"
99
- :knowledgeId="knowledgeId" @closeSummary="closeSummary" @recommendQues="recommendQues"
100
- @getSummarySuccess="getSummarySuccess"></intelligent-summary>
101
- <div class="pdf_positon" :style="pdfStyle"
102
- v-if="tagIds && tagIds.length != 0 && drawer && newVersion === false && newFileType !== 'PPT'">
103
- <pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :textWatermarkStr="textWatermarkStr">
104
- </pdfPosition>
105
- </div>
106
- <new-position-preview ref="newPositionPreview"
107
- v-else-if="tagIds && tagIds.length != 0 && newVersion && newFileType !== 'PPT'"
108
- :textWatermarkStr="textWatermarkStr"
109
- :knowledgeId="knowledgeId" :tagIds="tagIds" :url="previewHref"></new-position-preview>
110
- <template v-else>
111
- <div v-if="fileType == 'VIDEO'" style="width: 100%;">
112
- <video :src="url" controls width="100%;" height="98%"></video>
113
- </div>
114
- <div v-else-if="fileType == 'HTML'" style="width: 100%;">
115
- <div class="preview_iframe_html" style="text-align:left" v-html="fileText"></div>
116
- </div>
117
- <template v-else-if="url.includes('https://www') || url.includes('http://www')">
118
- <iframe class="preview_iframe" :src="url" width="100%" height="100%" scrolling="100%"
119
- frameborder="no" border="0"></iframe>
120
- </template>
121
- <template v-else>
122
- <iframe class="preview_iframe_kk" :src="previewUrl" @load="load" style="border:none;"
123
- :style="{ height: iframeHeight }"></iframe>
124
- <template v-if="!loading && (newFileType === 'PPT' && pageChunkData.length > 1)">
125
- <div class="btn_footer" v-if="!isPc">
126
- <div class="prev" @click="prev">上一段</div>
127
- <div class="next" @click="next">下一段</div>
128
- </div>
129
- <div id="pagination" v-if="isPc">
130
- <el-pagination :current-page="currentPage + 1" @current-change="currentChange"
131
- @prev-click="prev" @next-click="next" layout="slot, prev, pager, next" :page-size="1"
132
- :total="pageChunkData.length">
133
- <span class="total-class">答案由{{ pageChunkData.length }}段内容生成</span>
134
- </el-pagination>
135
- </div>
136
- </template>
137
- </template>
138
- </template>
139
- </div>
140
- <div class="loading_img" v-show="loading">
141
- <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
142
- </div>
143
- <div id="text">
144
- {{ copy }}
145
- </div>
146
- </el-drawer>
147
- </template>
148
-
149
- <script>
150
- import pdfPosition from './pdfPosition.vue'
151
- import { zoomElement } from '../assets/js/hammer'
152
- import IntelligentSummary from "./intelligentSummary";
153
- import { isMobile } from "../assets/js/common";
154
- import { Toast } from 'vant';
155
- import NewPositionPreview from "./preview/newPositionPreview";
156
- export default {
157
- data() {
158
- return {
159
- previewShowPopup: false,
160
- fileText: '',
161
- fileType: "",
162
- isPc: false,
163
- drawer: false,
164
- tagIds: [],
165
- // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
166
- loading: true,
167
- previewKnowledgeId: "",
168
- showSummary: false,
169
- iframeHeight: "100%",
170
- isDownload: false,
171
- textWatermarkStr: "",
172
- copy: '',
173
- newVersion: '',
174
- previewHref: "",
175
- newFileType: "",
176
- numberPage: 0,
177
- pageChunkData: [],
178
- currentPage: 0
179
- }
180
- },
181
- mounted() {
182
- this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
183
- window.addEventListener('message', this.handleIframeMessage, false);
184
- this.isPcFun();
185
- },
186
- props: {
187
- url: {
188
- type: String,
189
- required: true,
190
- },
191
- officePreviewType: {
192
- type: String,
193
- default: ''
194
- },
195
- isMessageRecord: {
196
- type: Boolean,
197
- default: false,
198
- },
199
- sourceFileType: {
200
- type: String,
201
- default: '',
202
- },
203
- title: {
204
- type: String,
205
- default: ''
206
- },
207
- isHasChat: {
208
- type: Boolean,
209
- default: false
210
- },
211
- knowledgeId: {
212
- type: String,
213
- default: '',
214
- },
215
- previewOssPath: {
216
- type: String,
217
- default: '',
218
- },
219
- folderName: {
220
- type: String,
221
- default: '',
222
- },
223
- folderUrl: {
224
- type: String,
225
- default: '',
226
- },
227
- isLiBang: {
228
- type: Boolean,
229
- default: false
230
- },
231
- mainId: {
232
- type: String,
233
- default: ''
234
- },
235
- userId: {
236
- type: String,
237
- default: ''
238
- }
239
- },
240
- components: {
241
- NewPositionPreview,
242
- IntelligentSummary,
243
- pdfPosition
244
- },
245
- watch: {
246
- drawer(value) {
247
- if (value) {
248
- this.$emit('open')
249
- this.$nextTick(() => {
250
- zoomElement(document.getElementById('drawer_content_pre'))
251
- })
252
- } else {
253
- this.$emit('close')
254
- }
255
- },
256
- showSummary: {
257
- handler(val) {
258
- // if (!val){
259
- // this.$nextTick(() => {
260
- // let preCon = document.querySelector('.pdf_view');
261
- // if (preCon){
262
- // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
263
- // }
264
- // })
265
- // } else {
266
- // this.getSummarySuccess();
267
- // }
268
- if (val) {
269
- this.getSummarySuccess();
270
- }
271
- }
272
- },
273
- knowledgeId: {
274
- handler(val) {
275
- if (val) {
276
- this.getTextWatermark();
277
- }
278
- }
279
- }
280
- },
281
- computed: {
282
- pdfStyle() {
283
- return {
284
- paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
285
- paddingBottom: this.tagIds > 1 ? '60px' : '0',
286
- height: '100%'
287
- }
288
- },
289
- previewUrl() {
290
- console.debug('VUE_APP_ENV', process.env.VUE_APP_ENV)
291
- let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
292
- // if(this.url != '') {
293
- // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
294
- // url += btoa(encodeURIComponent(this.url))
295
- // } else {
296
- // url += btoa(this.url)
297
- // }
298
- // }
299
- url = url + this.url
300
- if (this.sourceFileType == '.ppt' || this.sourceFileType == '.pptx' || this.sourceFileType == '.pdf') {
301
- url += '&officePreviewType=pdf'
302
- }
303
- if(sessionStorage.getItem('wxAuth') ) {
304
- let wxAuth = JSON.parse(sessionStorage.getItem('wxAuth'))
305
- let mainId = wxAuth.mainId ? wxAuth.mainId : ''
306
- let userId = wxAuth.userId ? wxAuth.userId : ''
307
- let test = wxAuth.test ? wxAuth.test : ''
308
- let corpId = wxAuth.corpId ? wxAuth.corpId : ''
309
- url += '&mainId=' + mainId + '&userId=' + userId + '&test=' + test + '&corpId=' + corpId
310
- }
311
- // console.log('textWatermarkStr 216', this.textWatermarkStr)
312
- if (this.textWatermarkStr) {
313
- url += '&textWatermarkValue=' + this.textWatermarkStr
314
- }
315
- return url
316
- },
317
- // fileType() {
318
- // const fileType = this.url.substring(this.url.lastIndexOf('.'));
319
- // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
320
- // return 'VIDEO'
321
- // } else {
322
- // return 'OTHER'
323
- // }
324
-
325
- // }
326
- },
327
- methods: {
328
- load() {
329
- this.loading = false;
330
- if(sessionStorage.getItem('wxAuth')){
331
- window.postMessage({
332
- type: "wx_bind",
333
- data: JSON.parse(sessionStorage.getItem('wxAuth'))
334
- }, '*')
335
- } else {
336
- window.postMessage({
337
- type: "wx_bind",
338
- data: 'pass'
339
- }, '*')
340
- }
341
- },
342
- close() {
343
- setTimeout(() => {
344
- this.previewShowPopup = false;
345
- this.fileType = ''
346
- }, 300)
347
- this.drawer = false;
348
- this.showSummary = false;
349
- },
350
- loadIframe() {
351
- if (this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0 && this.newFileType !== 'PPT')) {
352
- this.loading = false
353
- } else {
354
- let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
355
- if (iframe) {
356
- iframe.onload = () => {
357
- this.loading = false;
358
- document.getElementById('drawer_content_pre').style.backgroundImage = 'none'
359
- }
360
- }
361
- // let time = setInterval(() =>{
362
- //
363
- // if(iframe) {
364
- // this.loading = false
365
- // clearInterval(time)
366
- // }
367
- // }, 500)
368
- }
369
- },
370
- getBolb() {
371
- this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false', {
372
- fileInOssPath: this.url,
373
- templateId: ''
374
- }).then(res => {
375
- if (res.data.code == 0) {
376
- this.fileText = res.data.data
377
- this.loading = false
378
- }
379
- })
380
- },
381
- previewToDialog(flag) {
382
- this.$emit('previewToDialog', flag)
383
- },
384
- closeSummary() {
385
- this.showSummary = false;
386
- },
387
- recommendQues(item, knowledgeId) {
388
- console.log('recommendQues', item, knowledgeId);
389
- this.$emit('recommendQues', item, knowledgeId)
390
- },
391
- handleIframeMessage(res) {
392
- if (res.data.type == 'getViewerHeight') {
393
- let iframeHeight = this.iframeHeight.replace('px', '')
394
- if (res.data.data && iframeHeight != (res.data.data + 50)) {
395
- this.iframeHeight = res.data.data + 50 + 'px'
396
- }
397
- }
398
- if (res.data.type == 'getViewPage' && res.data.data) {
399
- this.numberPage = Number(res.data.data);
400
- if (this.pageChunkData.length > 0) {
401
- this.scrollPPTPage(this.pageChunkData[0])
402
- }
403
- }
404
- if (res.data.type == 'getViewerHeight' || res.data.type == 'getViewPage') {
405
- if (this.pageChunkData.length > 0) {
406
- this.scrollPPTPage(this.pageChunkData[0])
407
- }
408
- }
409
- },
410
- summaryFun() {
411
- this.showSummary = !this.showSummary;
412
- if (this.showSummary) {
413
- document.getElementById('drawer_content_pre').scrollTop = 0;
414
- }
415
- },
416
- getSummarySuccess() {
417
- this.$nextTick(() => {
418
- // if (this.tagIds.length > 0){
419
- // let intelligentSummary = document.getElementById('intelligentSummary');
420
- // let preCon = document.querySelector('.pdf_view')
421
- // if (intelligentSummary){
422
- // let height = intelligentSummary.offsetHeight + (this.isPc ? 100 : 50 );
423
- // if (preCon){
424
- // preCon.style.height = 'calc(100% - ' + height + 'px)'
425
- // }
426
- // console.log('height',height,preCon)
427
- // }
428
- // }
429
- // let intelligentSummary = document.getElementById('intelligentSummary');
430
- // let height = intelligentSummary.offsetHeight
431
- // this.pdfStyle.height = 'calc(100% - ' + height + 'px)'
432
- })
433
- },
434
- getTextWatermark() {
435
- let url = '/knowledge-api/open/knowledge/getPermissionInfo';
436
- let obj = {
437
- "knowledgeId": this.knowledgeId,
438
- "userId": sessionStorage.getItem('_currentUserId'),
439
- "mainId": sessionStorage.getItem('_mainId'),
440
- "corpId": sessionStorage.getItem('_corpid')
441
- }
442
- this.$http.post(url, obj).then(res => {
443
- console.log('getTextWatermark', res.data.data)
444
- if (res.data.data) {
445
- this.textWatermarkStr = res.data.data.textWatermarkStr;
446
- this.isDownload = res.data.data.showDownloadBtn;
447
- }
448
- })
449
- },
450
- downLoad() {
451
- let url = this.previewOssPath
452
- if (decodeURIComponent(url) != url) {
453
- url = decodeURIComponent(url)
454
- }
455
- const fileType = url.substring(url.lastIndexOf('.'));
456
- this.$http.post('/knowledge-api/temporary-certificate/or-origin?expired=10', url, {
457
- headers: {
458
- "Content-Type": "application/json",
459
- }
460
- }).then(res => {
461
- console.log('downLoad 341', res)
462
- if (res.data || res.bodyText) {
463
- if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
464
- this.copy = res.data
465
- if (isMobile()) {
466
- setTimeout(() => {
467
- const range = document.createRange();
468
- range.selectNode(document.getElementById('text'));
469
- const selection = window.getSelection();
470
- //移除之前选中内容
471
- if (selection.rangeCount > 0) selection.removeAllRanges();
472
- selection.addRange(range);
473
- document.execCommand('copy');
474
- selection.removeAllRanges()
475
- Toast(this.$t('dragonCommon.Safaridownload'));
476
- this.close()
477
- }, 100)
478
- } else {
479
- let a = document.createElement('a')
480
- a.href = res.data
481
- a.download = (this.title) + fileType
482
- a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
483
- }
484
- return
485
- } else {
486
- // setTimeout(() =>{
487
- // window.open(res.data,'下载', 'noopener')
488
- // }, 2000)
489
- // window.open(res.data,'下载', 'noopener')
490
- if (isMobile()) {
491
- const iframe = document.createElement("iframe");
492
- iframe.setAttribute("hidden", "hidden");
493
- iframe.onload = () => {
494
- if (iframe) {
495
- console.log("iframe onload....")
496
- iframe.setAttribute('src', 'about:blank');
497
- }
498
- };
499
- document.body.insertBefore(iframe, null);
500
- iframe.setAttribute("src", res.data);
501
- } else {
502
- let a = document.createElement('a')
503
- a.href = res.data
504
- a.download = (this.title) + fileType
505
- a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
506
- }
507
- this.close()
508
- }
509
- }
510
- })
511
- },
512
- isPcFun() {
513
- if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
514
- this.isPc = false
515
- } else {
516
- this.isPc = true
517
- }
518
- },
519
- clickFloder() {
520
- this.$emit('previewClickFloder')
521
- },
522
- getOssPath(url) {
523
- let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate';
524
- let type = this.getFileType(url)
525
- this.newFileType = type;
526
- if (type === 'VIDEO' || type === 'PDF' || type === 'EXCEL' || type === 'TXT' || type === 'DOC') {
527
- httpUrl += '?needEncrypt=false'
528
- } else {
529
- httpUrl += '?needEncrypt=true'
530
- }
531
- this.$http.post(httpUrl, {
532
- "fileInOssPath": url
533
- }).then(res => {
534
- console.log('getOssPath', res)
535
- if (res.data.code == '0') {
536
- this.previewHref = res.data.data;
537
- }
538
- })
539
- },
540
- getFileType(url) {
541
- let index = url.lastIndexOf('?')
542
- let newFileInOssPath = url.substring(0, url.indexOf("?"))
543
- if (index == -1) {
544
- newFileInOssPath = url
545
- }
546
- const fileType = newFileInOssPath.substring(newFileInOssPath.lastIndexOf('.'));
547
- if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.MOVC' || fileType === '.mov' || fileType === '.movc') {
548
- return 'VIDEO'
549
- } else if (fileType === '.html') {
550
- return 'HTML'
551
- } else if (fileType === '.png' || fileType === '.jpg' || fileType === '.jpeg' || fileType === '.PNG' || fileType === '.JPG' || fileType === '.JPEG') {
552
- return 'IMAGE'
553
- } else if (fileType === '.docx' || fileType === '.doc') {
554
- return 'DOC'
555
- } else if (fileType === '.ppt' || fileType === '.pptx') {
556
- return 'PPT'
557
- } else if (fileType === '.pdf') {
558
- return 'PDF'
559
- } else if (fileType === '.txt') {
560
- return 'TXT'
561
- } else {
562
- return 'OTHER'
563
- }
564
- },
565
- //判断是否使用新定位组件
566
- getLocationInfo() {
567
- this.newVersion = "";
568
- this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + this.tagIds.join(',')).then(res => {
569
- console.log('getLocationInfo', res)
570
- this.pageChunkData = [];
571
- if (res.data.code == 0) {
572
- if (res.data.data && res.data.data.length > 0 && res.data.data[0].extractVersion == 'v3') {
573
- this.newVersion = true;
574
- if (this.newFileType !== 'PPT') {
575
- this.loading = false;
576
- }
577
- for (let i = 0; i < res.data.data.length; i++) {
578
- if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.pageChunkData) {
579
- this.pageChunkData.push(res.data.data[i].paragraphChunkInfo.pageChunkData.page_number)
580
- }
581
- }
582
- if (this.pageChunkData.length > 1) {
583
- let iframe = document.getElementsByClassName('preview_iframe_kk')
584
- if (iframe && iframe.length > 0) {
585
- iframe[0].style.paddingBottom = '50px'
586
- }
587
- }
588
- } else {
589
- this.newVersion = false;
590
- }
591
- }
592
- })
593
- },
594
- currentChange(value) {
595
- this.currentPage = value - 1;
596
- this.scrollPPTPage()
597
- },
598
- prev() {
599
- if (this.currentPage == 0) {
600
- return
601
- }
602
- this.currentPage--;
603
- this.scrollPPTPage()
604
- },
605
- next() {
606
- if (this.currentPage === (this.pageChunkData.length - 1)) {
607
- return;
608
- }
609
- this.currentPage++;
610
- this.scrollPPTPage()
611
- },
612
- scrollPPTPage() {
613
- if (this.numberPage > 0) {
614
- let pageNumber = this.pageChunkData[this.currentPage];
615
- let height = Math.floor(Number(this.iframeHeight.replace('px', "")));
616
- let pageHeight = Math.floor(height / this.numberPage);
617
- let scrollHeight = (pageNumber - 1) * pageHeight;
618
- let dom = document.getElementById('drawer_content_pre');
619
- if (dom) {
620
- dom.scrollTo(0, scrollHeight)
621
- }
622
- }
623
- }
624
- },
625
- beforeDestroy() {
626
- window.removeEventListener('message', this.handleIframeMessage);
627
- }
628
- }
629
- </script>
630
-
631
- <style lang="less" scoped>
632
- #drawer_content_pre {
633
- padding: 20px;
634
- scroll-behavior: smooth;
635
-
636
- .mobile_onload_btn {
637
- position: absolute;
638
- right: 0;
639
- bottom: 10%;
640
- width: 20px;
641
- height: 60px;
642
- display: flex;
643
- align-items: center;
644
- justify-content: center;
645
- cursor: pointer;
646
- border-top-left-radius: 10px;
647
- border-bottom-left-radius: 10px;
648
- color: #366aff;
649
- background: #ffffff;
650
- border: 1px solid #a1b9ff;
651
- font-size: 12px;
652
- border-right: none;
653
- text-align: center;
654
- }
655
-
656
- .pdf_positon {
657
- width: 100%;
658
- box-sizing: border-box;
659
- }
660
- }
661
-
662
- .onload_btn {
663
- width: 76px;
664
- height: 26px;
665
- display: flex;
666
- align-items: center;
667
- justify-content: center;
668
- cursor: pointer;
669
- margin-right: 10px;
670
- border-radius: 15px;
671
- color: #366aff;
672
- background: #ffffff;
673
- border: 1px solid #a1b9ff;
674
- box-sizing: border-box;
675
- }
676
-
677
- .preview_iframe {
678
- width: 100%;
679
- height: 100%;
680
- box-sizing: border-box;
681
- background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
682
- background-position: center;
683
- background-size: 50px;
684
- background-repeat: no-repeat;
685
- }
686
-
687
- .preview_iframe_kk {
688
- width: 100%;
689
- height: 100%;
690
- }
691
-
692
- .btn_footer {
693
- width: 100%;
694
- height: 60px;
695
- display: flex;
696
- align-items: center;
697
- justify-content: space-around;
698
- position: absolute;
699
- bottom: 0px;
700
- left: 0;
701
- z-index: 999;
702
- background: #ffffff;
703
-
704
- .prev,
705
- .next {
706
- width: 35%;
707
- height: 40px;
708
- display: flex;
709
- align-items: center;
710
- justify-content: center;
711
- border-radius: 50px;
712
- cursor: pointer;
713
- }
714
-
715
- .prev {
716
- background: #F2F5FA;
717
- color: #000;
718
- }
719
-
720
- .next {
721
- background: #366aff;
722
- color: #ffffff;
723
- }
724
- }
725
-
726
- #pagination {
727
- .total-class {
728
- margin-right: 13px;
729
- font-weight: 400;
730
- }
731
-
732
- position: absolute;
733
- bottom: 0px;
734
- right: 0;
735
- width: 100%;
736
- display: flex;
737
- align-items: center;
738
- justify-content: center;
739
- height: 50px;
740
- background-color: white;
741
- box-shadow: 0px 0px 18px 0px rgba(29, 55, 129, 0.07);
742
- border-radius: 5px;
743
- z-index: 1000;
744
-
745
-
746
-
747
- /deep/.el-pagination {
748
- margin-right: 110px;
749
- }
750
-
751
- /deep/.el-pager {
752
- background: #EDF0F6;
753
- border-radius: 15px;
754
- }
755
-
756
- /deep/.el-pagination.is-background .btn-next {
757
- width: 30px;
758
- height: 30px;
759
- background: #EDF0F6;
760
- border-radius: 50%;
761
- }
762
-
763
- /deep/.el-pagination .btn-next {
764
- width: 30px;
765
- height: 30px;
766
- background: #EDF0F6;
767
- border-radius: 50%;
768
- padding-left: 0;
769
- margin-left: 5px;
770
- }
771
-
772
- /deep/.el-pagination .btn-prev {
773
- width: 30px;
774
- height: 30px;
775
- background: #EDF0F6;
776
- border-radius: 50%;
777
- padding-right: 0;
778
- margin-right: 5px;
779
- }
780
-
781
- /deep/.el-pagination button {
782
- padding: 0;
783
- min-width: 30px;
784
- }
785
-
786
- /deep/.el-pager li {
787
- background: #EDF0F6;
788
- height: 30px;
789
- min-width: 30px;
790
- line-height: 30px;
791
- font-size: 12px;
792
- color: #717b90;
793
- }
794
-
795
- /deep/.el-pager li:first-child {
796
- border-bottom-left-radius: 15px !important;
797
- border-top-left-radius: 15px !important;
798
- }
799
-
800
- /deep/.el-pager li:last-child {
801
- border-top-right-radius: 15px !important;
802
- border-bottom-right-radius: 15px !important;
803
- }
804
-
805
- /deep/.el-pager li.active {
806
- width: 30px;
807
- height: 30px;
808
- min-width: 30px;
809
- background: #366AFF;
810
- border: 3px solid #A1B9FF;
811
- border-radius: 50%;
812
- line-height: 24px;
813
- color: white;
814
- }
815
-
816
- /deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
817
- background: #366AFF;
818
- }
819
- }
820
-
821
- .preview_iframe_html {
822
- width: 100%;
823
- height: 100%;
824
- overflow-y: scroll;
825
- text-align: left;
826
- box-sizing: border-box;
827
- padding: 16px;
828
-
829
- /deep/.lake-content {
830
- margin-left: 10px;
831
- }
832
-
833
- /deep/a:link {
834
- color: #0000ee !important;
835
- }
836
-
837
- /deep/a:visited {
838
- color: #0000ee !important;
839
- }
840
-
841
- /deep/a:hover {
842
- color: #0000ee !important;
843
- }
844
-
845
- /deep/a:active {
846
- color: #0000ee !important;
847
- }
848
-
849
- /deep/li:not(.rich-text-li),
850
- ol:not(.list-paddingleft-2),
851
- ul:not(.list-paddingleft-2) {
852
- list-style-type: auto !important;
853
- }
854
-
855
- /deep/img {
856
- width: 100%;
857
- }
858
-
859
- /deep/.ne-table {
860
- width: 100% !important;
861
- }
862
- }
863
-
864
- .footer {
865
- width: calc(100% - 40px);
866
- height: 50px;
867
- display: flex;
868
- align-items: center;
869
- justify-content: space-between;
870
- cursor: pointer;
871
- padding: 0 20px;
872
- border-bottom: 1px solid #cccccc;
873
- }
874
-
875
- .loading_img {
876
- display: flex;
877
- align-items: center;
878
- justify-content: center;
879
- width: 100%;
880
- height: 100%;
881
- position: absolute;
882
- top: 0;
883
- left: 0;
884
- background: #FFF;
885
-
886
- img {
887
- width: 50px;
888
- height: 50px;
889
- }
890
- }
891
-
892
- .libang_head {
893
- height: 64px !important;
894
- }
895
-
896
- .has_btn_libang_head {
897
- height: 85px !important;
898
- }
899
-
900
- .has_btn_head {
901
- height: 60px !important;
902
- }
903
-
904
- .drawer-header {
905
- width: 100%;
906
- height: 50px;
907
- cursor: pointer;
908
- padding: 6px 20px;
909
- border-bottom: 1px solid #cccccc;
910
-
911
- .btn_position {
912
- position: absolute;
913
- top: -34px;
914
- left: 12px;
915
- }
916
-
917
- .header-btn {
918
- display: flex;
919
- align-items: center;
920
- justify-content: space-between;
921
-
922
- .header-right {
923
- display: flex;
924
- }
925
-
926
- .summaryBtn {
927
- flex: none;
928
- //width: 95px;
929
- height: 26px;
930
- padding: 0 8px;
931
- background: #ffffff;
932
- display: flex;
933
- align-items: center;
934
- justify-content: center;
935
- box-sizing: border-box;
936
- border: 1px solid #a1b9ff;
937
- border-radius: 15px;
938
- cursor: pointer;
939
- color: #366aff;
940
- margin-right: 10px;
941
- font-size: 14px;
942
-
943
- i {
944
- font-size: 14px;
945
- margin-right: 5px;
946
- }
947
- }
948
-
949
- .summaryActiveBtn {
950
- background: #366aff !important;
951
- color: #ffffff !important;
952
- }
953
-
954
- .chat {
955
- flex: none;
956
- height: 26px;
957
- padding: 0 8px;
958
- background: #ffffff;
959
- display: flex;
960
- align-items: center;
961
- justify-content: center;
962
- box-sizing: border-box;
963
- border: 1px solid #a1b9ff;
964
- border-radius: 15px 0px 15px 15px;
965
- cursor: pointer;
966
- color: #366aff;
967
- margin-right: 10px;
968
- font-size: 14px;
969
-
970
- i {
971
- font-size: 14px;
972
- margin-right: 5px;
973
- margin-top: 2px;
974
- }
975
- }
976
-
977
- .chat_active {
978
- background: #366aff !important;
979
- color: #FFFFFF !important;
980
- }
981
- }
982
-
983
- .header_title {
984
- font-size: 14px;
985
- height: 100%;
986
-
987
- .header_close {
988
- display: flex;
989
- align-items: center;
990
- justify-content: space-between;
991
- line-height: 26px;
992
- }
993
-
994
- .title_left {
995
- white-space: nowrap;
996
- /* 确保文本不会换行 */
997
- overflow: hidden;
998
- /* 隐藏超出容器的文本 */
999
- text-overflow: ellipsis;
1000
- /* 当文本超出容器时显示省略号 */
1001
- margin-right: 8px;
1002
- text-align: left;
1003
- }
1004
-
1005
- .top-header {
1006
- display: flex;
1007
- align-items: center;
1008
- justify-content: flex-end;
1009
- margin-bottom: 6px;
1010
- }
1011
-
1012
- .header_floder {
1013
- display: flex;
1014
- align-items: center;
1015
- line-height: 26px;
1016
- text-align: left;
1017
-
1018
- i {
1019
- margin: 0 5px;
1020
- color: #366aff;
1021
- }
1022
- }
1023
-
1024
- .header_top {
1025
- height: 100%;
1026
- display: flex;
1027
- align-items: center;
1028
- justify-content: space-between;
1029
- }
1030
- }
1031
- }
1032
-
1033
- .has_btn_libang_content_pre {
1034
- height: calc(100% - 85px) !important;
1035
- }
1036
-
1037
- @media screen and (max-width: 767px) {
1038
-
1039
- /* 这里是针对移动设备的css样式设置 */
1040
- /deep/.el-drawer__body {
1041
- height: 100%;
1042
- }
1043
-
1044
- #drawer_content_pre {
1045
- overflow: auto;
1046
- height: calc(100% - 50px);
1047
- background: #FFF;
1048
- background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
1049
- background-position: center;
1050
- background-size: 50px;
1051
- background-repeat: no-repeat;
1052
- }
1053
-
1054
- .libang_content_pre {
1055
- height: calc(100% - 64px) !important;
1056
- }
1057
- }
1058
-
1059
- @media screen and (min-width: 768px) {
1060
-
1061
- /* 这里是针对pc设备的css样式设置 */
1062
- /deep/.el-drawer__body {
1063
- height: 100%;
1064
- }
1065
-
1066
- #drawer_content_pre {
1067
- overflow: auto;
1068
- height: calc(100% - 50px);
1069
- background: #FFF;
1070
- }
1071
-
1072
- .libang_content_pre {
1073
- height: calc(100% - 64px) !important;
1074
- }
1075
- }
1076
-
1077
- @media screen and (min-width: 1200px) {
1078
-
1079
- /* 这里是针对pc设备的css样式设置 */
1080
- .el-drawer__wrapper {
1081
- width: 55%;
1082
- left: calc(100vw - 55%);
1083
- right: 0;
1084
-
1085
- /deep/.pdf-preview-drawer {
1086
- width: 100% !important;
1087
- }
1088
- }
1089
-
1090
- /deep/.el-drawer__body {
1091
- height: 100%;
1092
- }
1093
-
1094
- #drawer_content_pre {
1095
- overflow: auto;
1096
- height: calc(100% - 50px);
1097
- background: #FFF;
1098
- }
1099
-
1100
- .libang_content_pre {
1101
- height: calc(100% - 64px) !important;
1102
- }
1103
- }
1104
- </style>
1105
- <style lang="less">
1106
- .pdf-preview-drawer {
1107
- overflow: visible !important;
1108
- }
1109
-
1110
- .libang_content_pre {
1111
- .change_scale {
1112
- top: 64px !important;
1113
- }
1114
-
1115
- .float_intelligentSummary {
1116
- top: 74px !important;
1117
- }
1118
- }
1119
- </style>
1
+ <!-- preview-pdf
2
+ 组件主要负责 知识项目中 文件的预览,携带定位信息参数 tagIds tagId 的会解析文件增加定位功能
3
+ 不携带定位信息的 也是走 kkview项目预览
4
+ 另外增加了在知识项目中预览当前文件的一些功能
5
+ -->
6
+ <template>
7
+ <el-drawer title="" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
8
+ :modal="false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
9
+ custom-class="pdf-preview-drawer" v-if="drawer">
10
+ <div class="drawer-header"
11
+ :class="(isDownload || (isHasChat && fileType != 'IMAGE')) && isLiBang ? 'has_btn_libang_head' : (isLiBang ? 'libang_head' : (isDownload || (isHasChat && fileType != 'IMAGE') ? 'has_btn_head' : ''))"
12
+ v-if="!isPc">
13
+ <div class="header_title">
14
+ <template v-if="isDownload || (isHasChat && fileType != 'IMAGE')">
15
+ <div class="top-header">
16
+ <div class="header-btn">
17
+ <div class="onload_btn" v-if="isDownload" @click="downLoad">
18
+ {{ $t('dragonCommon.download') }}
19
+ </div>
20
+ <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
21
+ v-if="isHasChat && fileType != 'IMAGE'">
22
+ <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
23
+ <span>{{ $t('dragonCommon.smartSummary') }}</span>
24
+ </div>
25
+ <template v-if="isHasChat && fileType != 'IMAGE'">
26
+ <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
27
+ <i class="iconfont guoran-wendapingjia"></i>
28
+ {{ $t('dragonCommon.chat') }}
29
+ </div>
30
+ <div class="chat chat_active" @click="previewToDialog(false)" v-else>
31
+ <i class="iconfont guoran-wendapingjia"></i>
32
+ {{ $t('dragonCommon.chat') }}
33
+ </div>
34
+ </template>
35
+ </div>
36
+ <section @click="close">
37
+ <i class="iconfont guoran-shanchu"></i>
38
+ </section>
39
+ </div>
40
+ <span class="title_left">
41
+ {{ title ? title : $t('dragonCommon.viewDetails') }}
42
+ </span>
43
+ </template>
44
+ <div class="header_close" v-else>
45
+ <span class="title_left">
46
+ {{ title ? title : $t('dragonCommon.viewDetails') }}
47
+ </span>
48
+ <section @click="close">
49
+ <i class="iconfont guoran-shanchu"></i>
50
+ </section>
51
+ </div>
52
+ <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
53
+ <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
54
+ {{ folderName }}
55
+ <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
56
+ </p>
57
+ </div>
58
+ </div>
59
+ <div class="drawer-header" :class="isLiBang && folderName ? 'libang_head' : ''" v-else>
60
+ <div class="header_title">
61
+ <div :class="isLiBang && folderName ? 'header_close' : 'header_top'">
62
+ <span class="title_left">
63
+ {{ title ? title : $t('dragonCommon.viewDetails') }}
64
+ </span>
65
+ <div class="header-btn">
66
+ <div class="onload_btn" v-if="isDownload" @click="downLoad">
67
+ {{ $t('dragonCommon.download') }}
68
+ </div>
69
+ <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
70
+ v-if="isHasChat && fileType != 'IMAGE'">
71
+ <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
72
+ <span>{{ $t('dragonCommon.smartSummary') }}</span>
73
+ </div>
74
+ <template v-if="isHasChat && fileType != 'IMAGE'">
75
+ <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
76
+ <i class="iconfont guoran-wendapingjia"></i>
77
+ {{ $t('dragonCommon.chat') }}
78
+ </div>
79
+ <div class="chat chat_active" @click="previewToDialog(false)" v-else>
80
+ <i class="iconfont guoran-wendapingjia"></i>
81
+ {{ $t('dragonCommon.chat') }}
82
+ </div>
83
+ </template>
84
+ <section @click="close">
85
+ <i class="iconfont guoran-shanchu"></i>
86
+ </section>
87
+ </div>
88
+ </div>
89
+ <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
90
+ <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
91
+ {{ folderName }}
92
+ <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
93
+ </p>
94
+ </div>
95
+ </div>
96
+ <div id="drawer_content_pre"
97
+ :class="(isDownload || (isHasChat && fileType != 'IMAGE')) && !isPc && isLiBang && folderName ? 'has_btn_libang_content_pre' : (isLiBang && folderName ? 'libang_content_pre' : '')">
98
+ <intelligent-summary v-show="showSummary && (isHasChat && fileType != 'IMAGE')" :tagIds="tagIds"
99
+ :knowledgeId="knowledgeId" @closeSummary="closeSummary" @recommendQues="recommendQues"
100
+ @getSummarySuccess="getSummarySuccess"></intelligent-summary>
101
+ <div class="pdf_positon" :style="pdfStyle"
102
+ v-if="tagIds && tagIds.length != 0 && drawer && newVersion === false && newFileType !== 'PPT'">
103
+ <pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :textWatermarkStr="textWatermarkStr">
104
+ </pdfPosition>
105
+ </div>
106
+ <new-position-preview ref="newPositionPreview"
107
+ v-else-if="tagIds && tagIds.length != 0 && newVersion && newFileType !== 'PPT'"
108
+ :textWatermarkStr="textWatermarkStr"
109
+ :knowledgeId="knowledgeId" :tagIds="tagIds" :url="previewHref":textWatermarkStr="textWatermarkStr"></new-position-preview>
110
+ <template v-else>
111
+ <div v-if="fileType == 'VIDEO'" style="width: 100%;height: 100%">
112
+ <video :src="url" controls width="100%;" height="98%"></video>
113
+ </div>
114
+ <div v-else-if="fileType == 'HTML'" style="width: 100%;">
115
+ <div class="preview_iframe_html" style="text-align:left" v-html="fileText"></div>
116
+ </div>
117
+ <template v-else-if="url.includes('https://www') || url.includes('http://www')">
118
+ <iframe class="preview_iframe" :src="url" width="100%" height="100%" scrolling="100%"
119
+ frameborder="no" border="0"></iframe>
120
+ </template>
121
+ <template v-else>
122
+ <iframe class="preview_iframe_kk" :src="previewUrl" @load="load" style="border:none;"
123
+ :style="{ height: iframeHeight }"></iframe>
124
+ <template v-if="!loading && (newFileType === 'PPT' && pageChunkData.length > 1)">
125
+ <div class="btn_footer" v-if="!isPc">
126
+ <div class="prev" @click="prev">上一段</div>
127
+ <div class="next" @click="next">下一段</div>
128
+ </div>
129
+ <div id="pagination" v-if="isPc">
130
+ <el-pagination :current-page="currentPage + 1" @current-change="currentChange"
131
+ @prev-click="prev" @next-click="next" layout="slot, prev, pager, next" :page-size="1"
132
+ :total="pageChunkData.length">
133
+ <span class="total-class">答案由{{ pageChunkData.length }}段内容生成</span>
134
+ </el-pagination>
135
+ </div>
136
+ </template>
137
+ </template>
138
+ </template>
139
+ </div>
140
+ <div class="loading_img" v-show="loading">
141
+ <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
142
+ </div>
143
+ <div id="text">
144
+ {{ copy }}
145
+ </div>
146
+ </el-drawer>
147
+ </template>
148
+
149
+ <script>
150
+ import pdfPosition from './pdfPosition.vue'
151
+ import { zoomElement } from '../assets/js/hammer'
152
+ import IntelligentSummary from "./intelligentSummary";
153
+ import { isMobile } from "../assets/js/common";
154
+ import { Toast } from 'vant';
155
+ import NewPositionPreview from "./preview/newPositionPreview";
156
+ export default {
157
+ data() {
158
+ return {
159
+ previewShowPopup: false,
160
+ fileText: '',
161
+ fileType: "",
162
+ isPc: false,
163
+ drawer: false,
164
+ tagIds: [],
165
+ // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
166
+ loading: true,
167
+ fileName: '',
168
+ previewKnowledgeId: "",
169
+ showSummary: false,
170
+ iframeHeight: "100%",
171
+ isDownload: false,
172
+ textWatermarkStr: "",
173
+ copy: '',
174
+ newVersion: '',
175
+ previewHref: "",
176
+ newFileType: "",
177
+ numberPage: 0,
178
+ pageChunkData: [],
179
+ currentPage: 0
180
+ }
181
+ },
182
+ mounted () {
183
+ this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
184
+ window.addEventListener('message', this.handleIframeMessage, false);
185
+ this.isPcFun();
186
+ },
187
+ props: {
188
+ url: {
189
+ type: String,
190
+ required: true,
191
+ },
192
+ officePreviewType: {
193
+ type: String,
194
+ default: ''
195
+ },
196
+ isMessageRecord: {
197
+ type: Boolean,
198
+ default: false,
199
+ },
200
+ sourceFileType: {
201
+ type: String,
202
+ default: '',
203
+ },
204
+ title: {
205
+ type: String,
206
+ default: ''
207
+ },
208
+ isHasChat: {
209
+ type: Boolean,
210
+ default: false
211
+ },
212
+ knowledgeId: {
213
+ type: String,
214
+ default: '',
215
+ },
216
+ previewOssPath: {
217
+ type: String,
218
+ default: '',
219
+ },
220
+ folderName: {
221
+ type: String,
222
+ default: '',
223
+ },
224
+ folderUrl: {
225
+ type: String,
226
+ default: '',
227
+ },
228
+ isLiBang: {
229
+ type: Boolean,
230
+ default: false
231
+ },
232
+ formKnowledgeManagement: {
233
+ type: Boolean,
234
+ default: false
235
+ },
236
+ mainId: {
237
+ type: String,
238
+ default: ''
239
+ },
240
+ userId: {
241
+ type: String,
242
+ default: ''
243
+ }
244
+ },
245
+ components: {
246
+ NewPositionPreview,
247
+ IntelligentSummary,
248
+ pdfPosition
249
+ },
250
+ watch: {
251
+ drawer (value) {
252
+ if (value) {
253
+ this.$emit('open')
254
+ this.$nextTick(() => {
255
+ zoomElement(document.getElementById('drawer_content_pre'))
256
+ })
257
+ } else {
258
+ this.$emit('close')
259
+ }
260
+ },
261
+ showSummary: {
262
+ handler (val) {
263
+ // if (!val){
264
+ // this.$nextTick(() => {
265
+ // let preCon = document.querySelector('.pdf_view');
266
+ // if (preCon){
267
+ // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
268
+ // }
269
+ // })
270
+ // } else {
271
+ // this.getSummarySuccess();
272
+ // }
273
+ if (val) {
274
+ this.getSummarySuccess();
275
+ }
276
+ }
277
+ },
278
+ knowledgeId: {
279
+ handler (val) {
280
+ if (val) {
281
+ this.getTextWatermark();
282
+ }
283
+ }
284
+ }
285
+ },
286
+ computed: {
287
+ pdfStyle () {
288
+ return {
289
+ paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
290
+ paddingBottom: this.tagIds > 1 ? '60px' : '0',
291
+ height: '100%'
292
+ }
293
+ },
294
+ previewUrl () {
295
+ console.debug('VUE_APP_ENV', process.env.VUE_APP_ENV)
296
+ let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
297
+ // if(this.url != '') {
298
+ // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
299
+ // url += btoa(encodeURIComponent(this.url))
300
+ // } else {
301
+ // url += btoa(this.url)
302
+ // }
303
+ // }
304
+ url = url + this.url
305
+ if (this.sourceFileType == '.ppt' || this.sourceFileType == '.pptx' || this.sourceFileType == '.pdf') {
306
+ url += '&officePreviewType=pdf'
307
+ if (this.watermark) {
308
+ url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
309
+ url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
310
+ }
311
+ let mainId = sessionStorage.getItem('_mainId')
312
+ let userId = sessionStorage.getItem('_currentUserId')
313
+ let test = process.env.VUE_APP_ENV === 'production'
314
+ url += '&mainId=' + mainId+ '&userId=' + userId + '&test=' + test
315
+ console.log('textWatermarkStr 216', this.textWatermarkStr)
316
+ if (this.textWatermarkStr) {
317
+ url += '&textWatermarkValue=' + this.textWatermarkStr
318
+ }
319
+ }
320
+ return url
321
+ // fileType() {
322
+ // const fileType = this.url.substring(this.url.lastIndexOf('.'));
323
+ // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
324
+ // return 'VIDEO'
325
+ // } else {
326
+ // return 'OTHER'
327
+ // }
328
+
329
+ }
330
+ },
331
+ methods: {
332
+ load() {
333
+ this.loading = false;
334
+ if(sessionStorage.getItem('wxAuth')){
335
+ window.postMessage({
336
+ type: "wx_bind",
337
+ data: JSON.parse(sessionStorage.getItem('wxAuth'))
338
+ }, '*')
339
+ } else {
340
+ window.postMessage({
341
+ type: "wx_bind",
342
+ data: 'pass'
343
+ }, '*')
344
+ }
345
+ },
346
+ close() {
347
+ setTimeout(() => {
348
+ this.previewShowPopup = false;
349
+ this.fileType = ''
350
+ }, 300)
351
+ this.drawer = false;
352
+ this.showSummary = false;
353
+ },
354
+ loadIframe() {
355
+ if (this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0 && this.newFileType !== 'PPT')) {
356
+ this.loading = false
357
+ } else {
358
+ let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
359
+ if (iframe) {
360
+ iframe.onload = () => {
361
+ this.loading = false;
362
+ document.getElementById('drawer_content_pre').style.backgroundImage = 'none'
363
+ }
364
+ }
365
+ // let time = setInterval(() =>{
366
+ //
367
+ // if(iframe) {
368
+ // this.loading = false
369
+ // clearInterval(time)
370
+ // }
371
+ // }, 500)
372
+ }
373
+ },
374
+ getBolb() {
375
+ this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false', {
376
+ fileInOssPath: this.url,
377
+ templateId: ''
378
+ }).then(res => {
379
+ if (res.data.code == 0) {
380
+ this.fileText = res.data.data
381
+ this.loading = false
382
+ }
383
+ })
384
+ },
385
+ previewToDialog(flag) {
386
+ this.$emit('previewToDialog', flag)
387
+ },
388
+ closeSummary() {
389
+ this.showSummary = false;
390
+ },
391
+ recommendQues(item, knowledgeId) {
392
+ console.log('recommendQues', item, knowledgeId);
393
+ this.$emit('recommendQues', item, knowledgeId)
394
+ },
395
+ handleIframeMessage(res) {
396
+ if (res.data.type == 'getViewerHeight') {
397
+ let iframeHeight = this.iframeHeight.replace('px', '')
398
+ if (res.data.data && iframeHeight != (res.data.data + 50)) {
399
+ this.iframeHeight = res.data.data + 50 + 'px'
400
+ }
401
+ }
402
+ if (res.data.type == 'getViewPage' && res.data.data) {
403
+ this.numberPage = Number(res.data.data);
404
+ if (this.pageChunkData.length > 0) {
405
+ this.scrollPPTPage(this.pageChunkData[0])
406
+ }
407
+ }
408
+ if (res.data.type == 'getViewerHeight' || res.data.type == 'getViewPage') {
409
+ if (this.pageChunkData.length > 0) {
410
+ this.scrollPPTPage(this.pageChunkData[0])
411
+ }
412
+ }
413
+ },
414
+ summaryFun() {
415
+ this.showSummary = !this.showSummary;
416
+ if (this.showSummary) {
417
+ document.getElementById('drawer_content_pre').scrollTop = 0;
418
+ }
419
+ },
420
+ getSummarySuccess() {
421
+ this.$nextTick(() => {
422
+ // if (this.tagIds.length > 0){
423
+ // let intelligentSummary = document.getElementById('intelligentSummary');
424
+ // let preCon = document.querySelector('.pdf_view')
425
+ // if (intelligentSummary){
426
+ // let height = intelligentSummary.offsetHeight + (this.isPc ? 100 : 50 );
427
+ // if (preCon){
428
+ // preCon.style.height = 'calc(100% - ' + height + 'px)'
429
+ // }
430
+ // console.log('height',height,preCon)
431
+ // }
432
+ // }
433
+ // let intelligentSummary = document.getElementById('intelligentSummary');
434
+ // let height = intelligentSummary.offsetHeight
435
+ // this.pdfStyle.height = 'calc(100% - ' + height + 'px)'
436
+ })
437
+ },
438
+ getTextWatermark() {
439
+ let url = '/knowledge-api/open/knowledge/getPermissionInfo';
440
+ let obj = {
441
+ "knowledgeId": this.knowledgeId,
442
+ "userId": sessionStorage.getItem('_currentUserId'),
443
+ "mainId": sessionStorage.getItem('_mainId'),
444
+ "corpId": sessionStorage.getItem('_corpid')
445
+ }
446
+ this.$http.post(url, obj).then(res => {
447
+ console.log('getTextWatermark', res.data.data)
448
+ if (res.data.data) {
449
+ this.textWatermarkStr = res.data.data.textWatermarkStr;
450
+ this.isDownload = res.data.data.showDownloadBtn;
451
+ }
452
+ })
453
+ },
454
+ downLoad() {
455
+ let url = this.previewOssPath
456
+ if (decodeURIComponent(url) != url) {
457
+ url = decodeURIComponent(url)
458
+ }
459
+ const fileType = url.substring(url.lastIndexOf('.'));
460
+ this.$http.post('/knowledge-api/temporary-certificate/or-origin?expired=10', url, {
461
+ headers: {
462
+ "Content-Type": "application/json",
463
+ }
464
+ }).then(res => {
465
+ console.log('downLoad 341', res)
466
+ if (res.data || res.bodyText) {
467
+ if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
468
+ this.copy = res.data
469
+ if (isMobile()) {
470
+ setTimeout(() => {
471
+ const range = document.createRange();
472
+ range.selectNode(document.getElementById('text'));
473
+ const selection = window.getSelection();
474
+ //移除之前选中内容
475
+ if (selection.rangeCount > 0) selection.removeAllRanges();
476
+ selection.addRange(range);
477
+ document.execCommand('copy');
478
+ selection.removeAllRanges()
479
+ Toast(this.$t('dragonCommon.Safaridownload'));
480
+ this.close()
481
+ }, 100)
482
+ } else {
483
+ let a = document.createElement('a')
484
+ a.href = res.data
485
+ a.download = (this.title) + fileType
486
+ a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
487
+ }
488
+ return
489
+ } else {
490
+ // setTimeout(() =>{
491
+ // window.open(res.data,'下载', 'noopener')
492
+ // }, 2000)
493
+ // window.open(res.data,'下载', 'noopener')
494
+ if (isMobile()) {
495
+ const iframe = document.createElement("iframe");
496
+ iframe.setAttribute("hidden", "hidden");
497
+ iframe.onload = () => {
498
+ if (iframe) {
499
+ console.log("iframe onload....")
500
+ iframe.setAttribute('src', 'about:blank');
501
+ }
502
+ };
503
+ document.body.insertBefore(iframe, null);
504
+ iframe.setAttribute("src", res.data);
505
+ } else {
506
+ let a = document.createElement('a')
507
+ a.href = res.data
508
+ a.download = (this.title) + fileType
509
+ a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
510
+ }
511
+ this.close()
512
+ }
513
+ }
514
+ })
515
+ },
516
+ isPcFun() {
517
+ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
518
+ this.isPc = false
519
+ } else {
520
+ this.isPc = true
521
+ }
522
+ },
523
+ clickFloder() {
524
+ this.$emit('previewClickFloder')
525
+ },
526
+ getOssPath(url) {
527
+ let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate';
528
+ let type = this.getFileType(url)
529
+ this.newFileType = type;
530
+ if (type === 'VIDEO' || type === 'PDF' || type === 'EXCEL' || type === 'TXT' || type === 'DOC') {
531
+ httpUrl += '?needEncrypt=false'
532
+ } else {
533
+ httpUrl += '?needEncrypt=true'
534
+ }
535
+ this.$http.post(httpUrl, {
536
+ "fileInOssPath": url
537
+ }).then(res => {
538
+ console.log('getOssPath', res)
539
+ if (res.data.code == '0') {
540
+ this.previewHref = res.data.data;
541
+ }
542
+ })
543
+ },
544
+ getFileType(url) {
545
+ let index = url.lastIndexOf('?')
546
+ let newFileInOssPath = url.substring(0, url.indexOf("?"))
547
+ if (index == -1) {
548
+ newFileInOssPath = url
549
+ }
550
+ const fileType = newFileInOssPath.substring(newFileInOssPath.lastIndexOf('.'));
551
+ if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.MOVC' || fileType === '.mov' || fileType === '.movc') {
552
+ return 'VIDEO'
553
+ } else if (fileType === '.html') {
554
+ return 'HTML'
555
+ } else if (fileType === '.png' || fileType === '.jpg' || fileType === '.jpeg' || fileType === '.PNG' || fileType === '.JPG' || fileType === '.JPEG') {
556
+ return 'IMAGE'
557
+ } else if (fileType === '.docx' || fileType === '.doc') {
558
+ return 'DOC'
559
+ } else if (fileType === '.ppt' || fileType === '.pptx') {
560
+ return 'PPT'
561
+ } else if (fileType === '.pdf') {
562
+ return 'PDF'
563
+ } else if (fileType === '.txt') {
564
+ return 'TXT'
565
+ } else {
566
+ return 'OTHER'
567
+ }
568
+ },
569
+ //判断是否使用新定位组件
570
+ getLocationInfo() {
571
+ this.newVersion = "";
572
+ this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + this.tagIds.join(',')).then(res => {
573
+ console.log('getLocationInfo', res)
574
+ this.pageChunkData = [];
575
+ if (res.data.code == 0) {
576
+ if (res.data.data && res.data.data.length > 0 && res.data.data[0].extractVersion == 'v3') {
577
+ this.newVersion = true;
578
+ if (this.newFileType !== 'PPT') {
579
+ this.loading = false;
580
+ }
581
+ for (let i = 0; i < res.data.data.length; i++) {
582
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.pageChunkData) {
583
+ this.pageChunkData.push(res.data.data[i].paragraphChunkInfo.pageChunkData.page_number)
584
+ }
585
+ }
586
+ if (this.pageChunkData.length > 1) {
587
+ let iframe = document.getElementsByClassName('preview_iframe_kk')
588
+ if (iframe && iframe.length > 0) {
589
+ iframe[0].style.paddingBottom = '50px'
590
+ }
591
+ }
592
+ } else {
593
+ this.newVersion = false;
594
+ }
595
+ }
596
+ })
597
+ },
598
+ currentChange(value) {
599
+ this.currentPage = value - 1;
600
+ this.scrollPPTPage()
601
+ },
602
+ prev() {
603
+ if (this.currentPage == 0) {
604
+ return
605
+ }
606
+ this.currentPage--;
607
+ this.scrollPPTPage()
608
+ },
609
+ next() {
610
+ if (this.currentPage === (this.pageChunkData.length - 1)) {
611
+ return;
612
+ }
613
+ this.currentPage++;
614
+ this.scrollPPTPage()
615
+ },
616
+ scrollPPTPage() {
617
+ if (this.numberPage > 0) {
618
+ let pageNumber = this.pageChunkData[this.currentPage];
619
+ let height = Math.floor(Number(this.iframeHeight.replace('px', "")));
620
+ let pageHeight = Math.floor(height / this.numberPage);
621
+ let scrollHeight = (pageNumber - 1) * pageHeight;
622
+ let dom = document.getElementById('drawer_content_pre');
623
+ if (dom) {
624
+ dom.scrollTo(0, scrollHeight)
625
+ }
626
+ }
627
+ }
628
+ },
629
+ beforeDestroy() {
630
+ window.removeEventListener('message', this.handleIframeMessage);
631
+ }
632
+ }
633
+ </script>
634
+
635
+ <style lang="less" scoped>
636
+ #drawer_content_pre {
637
+ padding: 20px;
638
+ scroll-behavior: smooth;
639
+
640
+ .mobile_onload_btn {
641
+ position: absolute;
642
+ right: 0;
643
+ bottom: 10%;
644
+ width: 20px;
645
+ height: 60px;
646
+ display: flex;
647
+ align-items: center;
648
+ justify-content: center;
649
+ cursor: pointer;
650
+ border-top-left-radius: 10px;
651
+ border-bottom-left-radius: 10px;
652
+ color: #366aff;
653
+ background: #ffffff;
654
+ border: 1px solid #a1b9ff;
655
+ font-size: 12px;
656
+ border-right: none;
657
+ text-align: center;
658
+ }
659
+
660
+ .pdf_positon {
661
+ width: 100%;
662
+ box-sizing: border-box;
663
+ }
664
+ }
665
+
666
+ .onload_btn {
667
+ width: 76px;
668
+ height: 26px;
669
+ display: flex;
670
+ align-items: center;
671
+ justify-content: center;
672
+ cursor: pointer;
673
+ margin-right: 10px;
674
+ border-radius: 15px;
675
+ color: #366aff;
676
+ background: #ffffff;
677
+ border: 1px solid #a1b9ff;
678
+ box-sizing: border-box;
679
+ }
680
+
681
+ .preview_iframe {
682
+ width: 100%;
683
+ height: 100%;
684
+ box-sizing: border-box;
685
+ background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
686
+ background-position: center;
687
+ background-size: 50px;
688
+ background-repeat: no-repeat;
689
+ }
690
+
691
+ .preview_iframe_kk {
692
+ width: 100%;
693
+ height: 100%;
694
+ }
695
+
696
+ .btn_footer {
697
+ width: 100%;
698
+ height: 60px;
699
+ display: flex;
700
+ align-items: center;
701
+ justify-content: space-around;
702
+ position: absolute;
703
+ bottom: 0px;
704
+ left: 0;
705
+ z-index: 999;
706
+ background: #ffffff;
707
+
708
+ .prev,
709
+ .next {
710
+ width: 35%;
711
+ height: 40px;
712
+ display: flex;
713
+ align-items: center;
714
+ justify-content: center;
715
+ border-radius: 50px;
716
+ cursor: pointer;
717
+ }
718
+
719
+ .prev {
720
+ background: #F2F5FA;
721
+ color: #000;
722
+ }
723
+
724
+ .next {
725
+ background: #366aff;
726
+ color: #ffffff;
727
+ }
728
+ }
729
+
730
+ #pagination {
731
+ .total-class {
732
+ margin-right: 13px;
733
+ font-weight: 400;
734
+ }
735
+
736
+ position: absolute;
737
+ bottom: 0px;
738
+ right: 0;
739
+ width: 100%;
740
+ display: flex;
741
+ align-items: center;
742
+ justify-content: center;
743
+ height: 50px;
744
+ background-color: white;
745
+ box-shadow: 0px 0px 18px 0px rgba(29, 55, 129, 0.07);
746
+ border-radius: 5px;
747
+ z-index: 1000;
748
+
749
+
750
+
751
+ /deep/.el-pagination {
752
+ margin-right: 110px;
753
+ }
754
+
755
+ /deep/.el-pager {
756
+ background: #EDF0F6;
757
+ border-radius: 15px;
758
+ }
759
+
760
+ /deep/.el-pagination.is-background .btn-next {
761
+ width: 30px;
762
+ height: 30px;
763
+ background: #EDF0F6;
764
+ border-radius: 50%;
765
+ }
766
+
767
+ /deep/.el-pagination .btn-next {
768
+ width: 30px;
769
+ height: 30px;
770
+ background: #EDF0F6;
771
+ border-radius: 50%;
772
+ padding-left: 0;
773
+ margin-left: 5px;
774
+ }
775
+
776
+ /deep/.el-pagination .btn-prev {
777
+ width: 30px;
778
+ height: 30px;
779
+ background: #EDF0F6;
780
+ border-radius: 50%;
781
+ padding-right: 0;
782
+ margin-right: 5px;
783
+ }
784
+
785
+ /deep/.el-pagination button {
786
+ padding: 0;
787
+ min-width: 30px;
788
+ }
789
+
790
+ /deep/.el-pager li {
791
+ background: #EDF0F6;
792
+ height: 30px;
793
+ min-width: 30px;
794
+ line-height: 30px;
795
+ font-size: 12px;
796
+ color: #717b90;
797
+ }
798
+
799
+ /deep/.el-pager li:first-child {
800
+ border-bottom-left-radius: 15px !important;
801
+ border-top-left-radius: 15px !important;
802
+ }
803
+
804
+ /deep/.el-pager li:last-child {
805
+ border-top-right-radius: 15px !important;
806
+ border-bottom-right-radius: 15px !important;
807
+ }
808
+
809
+ /deep/.el-pager li.active {
810
+ width: 30px;
811
+ height: 30px;
812
+ min-width: 30px;
813
+ background: #366AFF;
814
+ border: 3px solid #A1B9FF;
815
+ border-radius: 50%;
816
+ line-height: 24px;
817
+ color: white;
818
+ }
819
+
820
+ /deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
821
+ background: #366AFF;
822
+ }
823
+ }
824
+
825
+ .preview_iframe_html {
826
+ width: 100%;
827
+ height: 100%;
828
+ overflow-y: scroll;
829
+ text-align: left;
830
+ box-sizing: border-box;
831
+ padding: 16px;
832
+
833
+ /deep/.lake-content {
834
+ margin-left: 10px;
835
+ }
836
+
837
+ /deep/a:link {
838
+ color: #0000ee !important;
839
+ }
840
+
841
+ /deep/a:visited {
842
+ color: #0000ee !important;
843
+ }
844
+
845
+ /deep/a:hover {
846
+ color: #0000ee !important;
847
+ }
848
+
849
+ /deep/a:active {
850
+ color: #0000ee !important;
851
+ }
852
+
853
+ /deep/li:not(.rich-text-li),
854
+ ol:not(.list-paddingleft-2),
855
+ ul:not(.list-paddingleft-2) {
856
+ list-style-type: auto !important;
857
+ }
858
+
859
+ /deep/img {
860
+ width: 100%;
861
+ }
862
+
863
+ /deep/.ne-table {
864
+ width: 100% !important;
865
+ }
866
+ }
867
+
868
+ .footer {
869
+ width: calc(100% - 40px);
870
+ height: 50px;
871
+ display: flex;
872
+ align-items: center;
873
+ justify-content: space-between;
874
+ cursor: pointer;
875
+ padding: 0 20px;
876
+ border-bottom: 1px solid #cccccc;
877
+ }
878
+
879
+ .loading_img {
880
+ display: flex;
881
+ align-items: center;
882
+ justify-content: center;
883
+ width: 100%;
884
+ height: 100%;
885
+ position: absolute;
886
+ top: 0;
887
+ left: 0;
888
+ background: #FFF;
889
+
890
+ img {
891
+ width: 50px;
892
+ height: 50px;
893
+ }
894
+ }
895
+
896
+ .libang_head {
897
+ height: 64px !important;
898
+ }
899
+
900
+ .has_btn_libang_head {
901
+ height: 85px !important;
902
+ }
903
+
904
+ .has_btn_head {
905
+ height: 60px !important;
906
+ }
907
+
908
+ .drawer-header {
909
+ width: 100%;
910
+ height: 50px;
911
+ cursor: pointer;
912
+ padding: 6px 20px;
913
+ border-bottom: 1px solid #cccccc;
914
+
915
+ .btn_position {
916
+ position: absolute;
917
+ top: -34px;
918
+ left: 12px;
919
+ }
920
+
921
+ .header-btn {
922
+ display: flex;
923
+ align-items: center;
924
+ justify-content: space-between;
925
+
926
+ .header-right {
927
+ display: flex;
928
+ }
929
+
930
+ .summaryBtn {
931
+ flex: none;
932
+ //width: 95px;
933
+ height: 26px;
934
+ padding: 0 8px;
935
+ background: #ffffff;
936
+ display: flex;
937
+ align-items: center;
938
+ justify-content: center;
939
+ box-sizing: border-box;
940
+ border: 1px solid #a1b9ff;
941
+ border-radius: 15px;
942
+ cursor: pointer;
943
+ color: #366aff;
944
+ margin-right: 10px;
945
+ font-size: 14px;
946
+
947
+ i {
948
+ font-size: 14px;
949
+ margin-right: 5px;
950
+ }
951
+ }
952
+
953
+ .summaryActiveBtn {
954
+ background: #366aff !important;
955
+ color: #ffffff !important;
956
+ }
957
+
958
+ .chat {
959
+ flex: none;
960
+ height: 26px;
961
+ padding: 0 8px;
962
+ background: #ffffff;
963
+ display: flex;
964
+ align-items: center;
965
+ justify-content: center;
966
+ box-sizing: border-box;
967
+ border: 1px solid #a1b9ff;
968
+ border-radius: 15px 0px 15px 15px;
969
+ cursor: pointer;
970
+ color: #366aff;
971
+ margin-right: 10px;
972
+ font-size: 14px;
973
+
974
+ i {
975
+ font-size: 14px;
976
+ margin-right: 5px;
977
+ margin-top: 2px;
978
+ }
979
+ }
980
+
981
+ .chat_active {
982
+ background: #366aff !important;
983
+ color: #FFFFFF !important;
984
+ }
985
+ }
986
+
987
+ .header_title {
988
+ font-size: 14px;
989
+ height: 100%;
990
+
991
+ .header_close {
992
+ display: flex;
993
+ align-items: center;
994
+ justify-content: space-between;
995
+ line-height: 26px;
996
+ }
997
+
998
+ .title_left {
999
+ white-space: nowrap;
1000
+ /* 确保文本不会换行 */
1001
+ overflow: hidden;
1002
+ /* 隐藏超出容器的文本 */
1003
+ text-overflow: ellipsis;
1004
+ /* 当文本超出容器时显示省略号 */
1005
+ margin-right: 8px;
1006
+ text-align: left;
1007
+ }
1008
+
1009
+ .top-header {
1010
+ display: flex;
1011
+ align-items: center;
1012
+ justify-content: flex-end;
1013
+ margin-bottom: 6px;
1014
+ }
1015
+
1016
+ .header_floder {
1017
+ display: flex;
1018
+ align-items: center;
1019
+ line-height: 26px;
1020
+ text-align: left;
1021
+
1022
+ i {
1023
+ margin: 0 5px;
1024
+ color: #366aff;
1025
+ }
1026
+ }
1027
+
1028
+ .header_top {
1029
+ height: 100%;
1030
+ display: flex;
1031
+ align-items: center;
1032
+ justify-content: space-between;
1033
+ }
1034
+ }
1035
+ }
1036
+
1037
+ .has_btn_libang_content_pre {
1038
+ height: calc(100% - 85px) !important;
1039
+ }
1040
+
1041
+ @media screen and (max-width: 767px) {
1042
+
1043
+ /* 这里是针对移动设备的css样式设置 */
1044
+ /deep/.el-drawer__body {
1045
+ height: 100%;
1046
+ }
1047
+
1048
+ #drawer_content_pre {
1049
+ overflow: auto;
1050
+ height: calc(100% - 50px);
1051
+ background: #FFF;
1052
+ }
1053
+
1054
+ .libang_content_pre {
1055
+ height: calc(100% - 64px) !important;
1056
+ }
1057
+ }
1058
+
1059
+ @media screen and (min-width: 768px) {
1060
+
1061
+ /* 这里是针对pc设备的css样式设置 */
1062
+ /deep/.el-drawer__body {
1063
+ height: 100%;
1064
+ }
1065
+
1066
+ #drawer_content_pre {
1067
+ overflow: auto;
1068
+ height: calc(100% - 50px);
1069
+ background: #FFF;
1070
+ }
1071
+
1072
+ .libang_content_pre {
1073
+ height: calc(100% - 64px) !important;
1074
+ }
1075
+ }
1076
+
1077
+ @media screen and (min-width: 1200px) {
1078
+
1079
+ /* 这里是针对pc设备的css样式设置 */
1080
+ .el-drawer__wrapper {
1081
+ width: 55%;
1082
+ left: calc(100vw - 55%);
1083
+ right: 0;
1084
+
1085
+ /deep/.pdf-preview-drawer {
1086
+ width: 100% !important;
1087
+ }
1088
+ }
1089
+
1090
+ /deep/.el-drawer__body {
1091
+ height: 100%;
1092
+ }
1093
+
1094
+ #drawer_content_pre {
1095
+ overflow: auto;
1096
+ height: calc(100% - 50px);
1097
+ background: #FFF;
1098
+ }
1099
+
1100
+ .libang_content_pre {
1101
+ height: calc(100% - 64px) !important;
1102
+ }
1103
+ }
1104
+ </style>
1105
+ <style lang="less">
1106
+ .pdf-preview-drawer {
1107
+ overflow: visible !important;
1108
+ }
1109
+
1110
+ .libang_content_pre {
1111
+ .change_scale {
1112
+ top: 64px !important;
1113
+ }
1114
+
1115
+ .float_intelligentSummary {
1116
+ top: 74px !important;
1117
+ }
1118
+ }
1119
+ </style>