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