askbot-dragon 1.6.61-beta → 1.6.63-beta

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