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