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