askbot-dragon 1.6.64-beta → 1.6.66-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.
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
另外增加了在知识项目中预览当前文件的一些功能
|
|
6
6
|
-->
|
|
7
7
|
<template>
|
|
8
|
-
|
|
8
|
+
<!-- <van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}" v-if="previewShowPopup">
|
|
9
9
|
<div class="footer">
|
|
10
10
|
<span>查看详情</span>
|
|
11
11
|
<section @click="close">
|
|
@@ -39,34 +39,21 @@
|
|
|
39
39
|
<img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
|
|
40
40
|
</div>
|
|
41
41
|
</van-popup> -->
|
|
42
|
-
<el-drawer
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
>
|
|
42
|
+
<el-drawer title="我是标题" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
|
|
43
|
+
:modal="false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
|
|
44
|
+
custom-class="pdf-preview-drawer" v-if="drawer">
|
|
54
45
|
<!-- v-else-if="drawer" -->
|
|
55
|
-
<div class="drawer-
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
<div class="onload_btn" v-if="isDownload && isPc" @click="downLoad">
|
|
46
|
+
<div class="drawer-header" :class="isLiBang ? 'libang_head' : ''" v-if="!isPc">
|
|
47
|
+
<div class="header-btn btn_position">
|
|
48
|
+
<div class="onload_btn" v-if="isDownload || true" @click="downLoad">
|
|
59
49
|
下载
|
|
60
50
|
</div>
|
|
61
|
-
<div class="summaryBtn"
|
|
62
|
-
|
|
63
|
-
@click="summaryFun"
|
|
64
|
-
v-if="isHasChat"
|
|
65
|
-
>
|
|
51
|
+
<div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
|
|
52
|
+
v-if="isHasChat || true">
|
|
66
53
|
<i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
|
|
67
54
|
<span>智能摘要</span>
|
|
68
55
|
</div>
|
|
69
|
-
<template v-if="isHasChat">
|
|
56
|
+
<template v-if="isHasChat || true">
|
|
70
57
|
<div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
|
|
71
58
|
<i class="iconfont guoran-wendapingjia"></i>
|
|
72
59
|
聊一聊
|
|
@@ -76,23 +63,68 @@
|
|
|
76
63
|
聊一聊
|
|
77
64
|
</div>
|
|
78
65
|
</template>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
</div>
|
|
67
|
+
<div class="header_title">
|
|
68
|
+
<div class="header_close">
|
|
69
|
+
<span>
|
|
70
|
+
{{ title ? title : "查看详情" }}
|
|
71
|
+
</span>
|
|
72
|
+
<section @click="close">
|
|
73
|
+
<i class="iconfont guoran-shanchu"></i>
|
|
74
|
+
</section>
|
|
75
|
+
</div>
|
|
76
|
+
<p v-if="folderName && isLiBang" class="header_floder">
|
|
77
|
+
<i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
|
|
78
|
+
{{ folderName }}
|
|
79
|
+
<i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
|
|
80
|
+
</p>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="drawer-header" :class="isLiBang && folderName ? 'libang_head' : ''" v-else>
|
|
84
|
+
<div class="header_title">
|
|
85
|
+
<div :class="isLiBang && folderName ? 'header_close' : 'header_top'">
|
|
86
|
+
<span>
|
|
87
|
+
{{ title ? title : "查看详情" }}
|
|
88
|
+
</span>
|
|
89
|
+
<div class="header-btn">
|
|
90
|
+
<div class="onload_btn" v-if="isDownload || true" @click="downLoad">
|
|
91
|
+
下载
|
|
92
|
+
</div>
|
|
93
|
+
<div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
|
|
94
|
+
v-if="isHasChat || true">
|
|
95
|
+
<i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
|
|
96
|
+
<span>智能摘要</span>
|
|
97
|
+
</div>
|
|
98
|
+
<template v-if="isHasChat || true">
|
|
99
|
+
<div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
|
|
100
|
+
<i class="iconfont guoran-wendapingjia"></i>
|
|
101
|
+
聊一聊
|
|
102
|
+
</div>
|
|
103
|
+
<div class="chat chat_active" @click="previewToDialog(false)" v-else>
|
|
104
|
+
<i class="iconfont guoran-wendapingjia"></i>
|
|
105
|
+
聊一聊
|
|
106
|
+
</div>
|
|
107
|
+
</template>
|
|
108
|
+
<section @click="close">
|
|
109
|
+
<i class="iconfont guoran-shanchu"></i>
|
|
110
|
+
</section>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
|
|
114
|
+
<i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
|
|
115
|
+
{{ folderName }}
|
|
116
|
+
<i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
|
|
117
|
+
</p>
|
|
82
118
|
</div>
|
|
83
119
|
</div>
|
|
84
|
-
<div id="drawer_content_pre">
|
|
120
|
+
<div id="drawer_content_pre" :class="isLiBang && folderName ? 'libang_content_pre' : ''">
|
|
85
121
|
<!-- :style="{marginTop:tagIds && tagIds.length != 0 && isPc ? '50px' : ''}" -->
|
|
86
|
-
<intelligent-summary
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
:knowledgeId="knowledgeId"
|
|
90
|
-
@closeSummary="closeSummary"
|
|
91
|
-
@recommendQues="recommendQues"
|
|
92
|
-
@getSummarySuccess="getSummarySuccess"
|
|
93
|
-
></intelligent-summary>
|
|
122
|
+
<intelligent-summary v-show="showSummary && isHasChat" :tagIds="tagIds" :knowledgeId="knowledgeId"
|
|
123
|
+
@closeSummary="closeSummary" @recommendQues="recommendQues"
|
|
124
|
+
@getSummarySuccess="getSummarySuccess"></intelligent-summary>
|
|
94
125
|
<div class="pdf_positon" :style="pdfStyle" v-if="tagIds && tagIds.length != 0 && drawer">
|
|
95
|
-
<pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :textWatermarkStr="textWatermarkStr"
|
|
126
|
+
<pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :textWatermarkStr="textWatermarkStr">
|
|
127
|
+
</pdfPosition>
|
|
96
128
|
</div>
|
|
97
129
|
<template v-else>
|
|
98
130
|
<div v-if="fileType == 'VIDEO'" style="width: 100%;">
|
|
@@ -102,25 +134,21 @@
|
|
|
102
134
|
<div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
|
|
103
135
|
</div>
|
|
104
136
|
<template v-else-if="url.includes('https://www') || url.includes('http://www')">
|
|
105
|
-
<iframe class="preview_iframe"
|
|
106
|
-
|
|
107
|
-
width="100%"
|
|
108
|
-
height="100%"
|
|
109
|
-
scrolling="100%"
|
|
110
|
-
frameborder="no"
|
|
111
|
-
border="0"></iframe>
|
|
137
|
+
<iframe class="preview_iframe" :src="url" width="100%" height="100%" scrolling="100%" frameborder="no"
|
|
138
|
+
border="0"></iframe>
|
|
112
139
|
</template>
|
|
113
140
|
<template v-else>
|
|
114
|
-
<iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;"
|
|
141
|
+
<iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;"
|
|
142
|
+
:style="{ height: iframeHeight }"></iframe>
|
|
115
143
|
</template>
|
|
116
144
|
</template>
|
|
117
|
-
<div class="mobile_onload_btn" v-if="isDownload && !isPc" @click="downLoad">
|
|
145
|
+
<!-- <div class="mobile_onload_btn" v-if="isDownload && !isPc" @click="downLoad">
|
|
118
146
|
下载
|
|
119
|
-
</div>
|
|
147
|
+
</div> -->
|
|
120
148
|
</div>
|
|
121
149
|
<div class="loading_img" v-show="loading">
|
|
122
|
-
|
|
123
|
-
|
|
150
|
+
<img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
|
|
151
|
+
</div>
|
|
124
152
|
</el-drawer>
|
|
125
153
|
</template>
|
|
126
154
|
|
|
@@ -131,17 +159,17 @@ import IntelligentSummary from "./intelligentSummary";
|
|
|
131
159
|
import { isMobile } from "../assets/js/common";
|
|
132
160
|
import { Toast } from 'vant';
|
|
133
161
|
export default {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
162
|
+
data () {
|
|
163
|
+
return {
|
|
164
|
+
previewShowPopup: false,
|
|
165
|
+
fileText: '',
|
|
166
|
+
fileType: "",
|
|
167
|
+
isPc: false,
|
|
168
|
+
drawer: false,
|
|
169
|
+
tagIds: [],
|
|
170
|
+
// '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
|
|
171
|
+
loading: true,
|
|
172
|
+
fileName:'',
|
|
145
173
|
previewKnowledgeId:"",
|
|
146
174
|
showSummary:true,
|
|
147
175
|
iframeHeight:"100%",
|
|
@@ -185,18 +213,30 @@ export default {
|
|
|
185
213
|
previewOssPath:{
|
|
186
214
|
type: String,
|
|
187
215
|
default: '',
|
|
188
|
-
}
|
|
216
|
+
},
|
|
217
|
+
folderName: {
|
|
218
|
+
type: String,
|
|
219
|
+
default: '',
|
|
189
220
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
221
|
+
folderUrl: {
|
|
222
|
+
type: String,
|
|
223
|
+
default: '',
|
|
193
224
|
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
225
|
+
isLiBang: {
|
|
226
|
+
type: Boolean,
|
|
227
|
+
default: false
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
components: {
|
|
231
|
+
IntelligentSummary,
|
|
232
|
+
pdfPosition
|
|
233
|
+
},
|
|
234
|
+
watch: {
|
|
235
|
+
drawer (value) {
|
|
236
|
+
if (value) {
|
|
237
|
+
this.$emit('open')
|
|
238
|
+
this.$nextTick(() => {
|
|
239
|
+
if (this.tagIds && this.tagIds.length != 0){
|
|
200
240
|
zoomElement(document.getElementById('pdf_container_view'))
|
|
201
241
|
}
|
|
202
242
|
})
|
|
@@ -261,203 +301,207 @@ export default {
|
|
|
261
301
|
if(this.watermark) {
|
|
262
302
|
url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
|
|
263
303
|
url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
304
|
+
}
|
|
305
|
+
console.log('textWatermarkStr 216', this.textWatermarkStr)
|
|
306
|
+
if (this.textWatermarkStr) {
|
|
307
|
+
url += '&textWatermarkValue=' + this.textWatermarkStr
|
|
308
|
+
}
|
|
309
|
+
return url
|
|
310
|
+
},
|
|
311
|
+
// fileType() {
|
|
312
|
+
// const fileType = this.url.substring(this.url.lastIndexOf('.'));
|
|
313
|
+
// if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
|
|
314
|
+
// return 'VIDEO'
|
|
315
|
+
// } else {
|
|
316
|
+
// return 'OTHER'
|
|
317
|
+
// }
|
|
278
318
|
|
|
279
|
-
|
|
319
|
+
// }
|
|
320
|
+
},
|
|
321
|
+
methods: {
|
|
322
|
+
close () {
|
|
323
|
+
setTimeout(() => {
|
|
324
|
+
this.previewShowPopup = false;
|
|
325
|
+
this.fileType = ''
|
|
326
|
+
}, 300)
|
|
327
|
+
this.drawer = false;
|
|
328
|
+
this.showSummary = false;
|
|
280
329
|
},
|
|
281
|
-
|
|
282
|
-
close() {
|
|
283
|
-
setTimeout(() =>{
|
|
284
|
-
this.previewShowPopup = false;
|
|
285
|
-
this.fileType = ''
|
|
286
|
-
}, 300)
|
|
287
|
-
this.drawer = false;
|
|
288
|
-
this.showSummary = false;
|
|
289
|
-
},
|
|
290
|
-
loadIframe() {
|
|
330
|
+
loadIframe () {
|
|
291
331
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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'
|
|
332
|
+
if (this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0)) {
|
|
333
|
+
this.loading = false
|
|
334
|
+
} else {
|
|
335
|
+
let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
|
|
336
|
+
if (iframe) {
|
|
337
|
+
iframe.onload = () => {
|
|
338
|
+
this.loading = false;
|
|
339
|
+
document.getElementById('drawer_content_pre').style.backgroundImage = 'none'
|
|
338
340
|
}
|
|
339
341
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
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')
|
|
342
|
+
// let time = setInterval(() =>{
|
|
343
|
+
//
|
|
344
|
+
// if(iframe) {
|
|
345
|
+
// this.loading = false
|
|
346
|
+
// clearInterval(time)
|
|
347
|
+
// }
|
|
348
|
+
// }, 500)
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
getBolb () {
|
|
352
|
+
this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false', {
|
|
353
|
+
fileInOssPath: this.url,
|
|
354
|
+
templateId: ''
|
|
355
|
+
}).then(res => {
|
|
356
|
+
if (res.data.code == 0) {
|
|
357
|
+
this.fileText = res.data.data
|
|
358
|
+
this.loading = false
|
|
372
359
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
360
|
+
})
|
|
361
|
+
},
|
|
362
|
+
previewToDialog (flag) {
|
|
363
|
+
this.$emit('previewToDialog', flag)
|
|
364
|
+
},
|
|
365
|
+
closeSummary () {
|
|
366
|
+
this.showSummary = false;
|
|
367
|
+
},
|
|
368
|
+
recommendQues (item, knowledgeId) {
|
|
369
|
+
console.log('recommendQues', item, knowledgeId);
|
|
370
|
+
this.$emit('recommendQues', item, knowledgeId)
|
|
371
|
+
},
|
|
372
|
+
handleIframeMessage (res) {
|
|
373
|
+
console.log('handleIframeMessage', res)
|
|
374
|
+
if (res.data.type == 'getViewerHeight') {
|
|
375
|
+
let iframeHeight = this.iframeHeight.replace('px', '')
|
|
376
|
+
if (res.data.data && iframeHeight != (res.data.data + 50)) {
|
|
377
|
+
this.iframeHeight = res.data.data + 50 + 'px'
|
|
385
378
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
summaryFun () {
|
|
382
|
+
this.showSummary = !this.showSummary;
|
|
383
|
+
if (this.showSummary) {
|
|
384
|
+
document.getElementById('drawer_content_pre').scrollTop = 0;
|
|
385
|
+
}
|
|
386
|
+
},
|
|
387
|
+
getSummarySuccess () {
|
|
388
|
+
this.$nextTick(() => {
|
|
389
|
+
// if (this.tagIds.length > 0){
|
|
390
|
+
// let intelligentSummary = document.getElementById('intelligentSummary');
|
|
391
|
+
// let preCon = document.querySelector('.pdf_view')
|
|
392
|
+
// if (intelligentSummary){
|
|
393
|
+
// let height = intelligentSummary.offsetHeight + (this.isPc ? 100 : 50 );
|
|
394
|
+
// if (preCon){
|
|
395
|
+
// preCon.style.height = 'calc(100% - ' + height + 'px)'
|
|
396
|
+
// }
|
|
397
|
+
// console.log('height',height,preCon)
|
|
398
|
+
// }
|
|
399
|
+
// }
|
|
400
|
+
// let intelligentSummary = document.getElementById('intelligentSummary');
|
|
401
|
+
// let height = intelligentSummary.offsetHeight
|
|
402
|
+
// this.pdfStyle.height = 'calc(100% - ' + height + 'px)'
|
|
403
|
+
})
|
|
404
|
+
},
|
|
405
|
+
getTextWatermark () {
|
|
406
|
+
let url = '/knowledge-api/open/knowledge/getPermissionInfo';
|
|
407
|
+
let obj = {
|
|
408
|
+
"knowledgeId": this.knowledgeId,
|
|
409
|
+
"userId": sessionStorage.getItem('_currentUserId'),
|
|
410
|
+
"mainId": sessionStorage.getItem('_mainId'),
|
|
411
|
+
"corpId": sessionStorage.getItem('_corpid')
|
|
412
|
+
}
|
|
413
|
+
this.$http.post(url, obj).then(res => {
|
|
414
|
+
console.log('getTextWatermark', res.data.data)
|
|
415
|
+
if (res.data.data) {
|
|
416
|
+
this.textWatermarkStr = res.data.data.textWatermarkStr;
|
|
417
|
+
this.isDownload = res.data.data.showDownloadBtn;
|
|
418
|
+
}
|
|
419
|
+
})
|
|
420
|
+
},
|
|
421
|
+
downLoad () {
|
|
422
|
+
let url = this.previewOssPath
|
|
423
|
+
if (decodeURIComponent(url) != url) {
|
|
424
|
+
url = decodeURIComponent(url)
|
|
425
|
+
}
|
|
426
|
+
const fileType = url.substring(url.lastIndexOf('.'));
|
|
427
|
+
this.$http.post('/knowledge-api/temporary-certificate/or-origin?expired=10', url, {
|
|
428
|
+
headers: {
|
|
429
|
+
"Content-Type": "application/json",
|
|
430
|
+
}
|
|
431
|
+
}).then(res => {
|
|
432
|
+
console.log('downLoad 341', res)
|
|
433
|
+
if (res.data) {
|
|
434
|
+
if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
|
|
435
|
+
if (isMobile()) {
|
|
436
|
+
setTimeout(() => {
|
|
437
|
+
const range = document.createRange();
|
|
438
|
+
range.selectNode(document.getElementById('text'));
|
|
439
|
+
const selection = window.getSelection();
|
|
440
|
+
//移除之前选中内容
|
|
441
|
+
if (selection.rangeCount > 0) selection.removeAllRanges();
|
|
442
|
+
selection.addRange(range);
|
|
443
|
+
document.execCommand('copy');
|
|
444
|
+
selection.removeAllRanges()
|
|
445
|
+
Toast('下载地址已复制,请前往Safari浏览器访问下载');
|
|
446
|
+
this.close()
|
|
447
|
+
}, 100)
|
|
415
448
|
} else {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
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()
|
|
449
|
+
navigator.clipboard.writeText(res.data)
|
|
450
|
+
this.$message.success({
|
|
451
|
+
message: '下载地址已复制,请前往Safari浏览器访问下载',
|
|
452
|
+
})
|
|
438
453
|
}
|
|
454
|
+
return
|
|
455
|
+
} else {
|
|
456
|
+
// setTimeout(() =>{
|
|
457
|
+
// window.open(res.data,'下载', 'noopener')
|
|
458
|
+
// }, 2000)
|
|
459
|
+
// window.open(res.data,'下载', 'noopener')
|
|
460
|
+
if (isMobile()) {
|
|
461
|
+
const iframe = document.createElement("iframe");
|
|
462
|
+
iframe.setAttribute("hidden", "hidden");
|
|
463
|
+
iframe.onload = () => {
|
|
464
|
+
if (iframe) {
|
|
465
|
+
console.log("iframe onload....")
|
|
466
|
+
iframe.setAttribute('src', 'about:blank');
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
document.body.insertBefore(iframe, null);
|
|
470
|
+
iframe.setAttribute("src", res.data);
|
|
471
|
+
} else {
|
|
472
|
+
let a = document.createElement('a')
|
|
473
|
+
a.href = res.data
|
|
474
|
+
a.download = (this.title) + fileType
|
|
475
|
+
a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
|
|
476
|
+
}
|
|
477
|
+
this.close()
|
|
439
478
|
}
|
|
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
479
|
}
|
|
480
|
+
})
|
|
481
|
+
},
|
|
482
|
+
isPcFun () {
|
|
483
|
+
if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
|
|
484
|
+
this.isPc = false
|
|
485
|
+
} else {
|
|
486
|
+
this.isPc = true
|
|
448
487
|
}
|
|
449
488
|
},
|
|
450
|
-
|
|
451
|
-
|
|
489
|
+
clickFloder() {
|
|
490
|
+
this.$emit('previewClickFloder')
|
|
452
491
|
}
|
|
492
|
+
},
|
|
493
|
+
beforeDestroy () {
|
|
494
|
+
window.removeEventListener('message', this.handleIframeMessage);
|
|
495
|
+
}
|
|
453
496
|
}
|
|
454
497
|
</script>
|
|
455
498
|
|
|
456
499
|
<style lang="less" scoped>
|
|
457
|
-
#drawer_content_pre{
|
|
500
|
+
#drawer_content_pre {
|
|
458
501
|
padding: 20px;
|
|
459
502
|
scroll-behavior: smooth;
|
|
460
|
-
|
|
503
|
+
|
|
504
|
+
.mobile_onload_btn {
|
|
461
505
|
position: absolute;
|
|
462
506
|
right: 0;
|
|
463
507
|
bottom: 10%;
|
|
@@ -476,13 +520,15 @@ export default {
|
|
|
476
520
|
border-right: none;
|
|
477
521
|
text-align: center;
|
|
478
522
|
}
|
|
523
|
+
|
|
479
524
|
.pdf_positon {
|
|
480
525
|
width: 100%;
|
|
481
526
|
box-sizing: border-box;
|
|
482
527
|
}
|
|
483
528
|
}
|
|
529
|
+
|
|
484
530
|
.onload_btn {
|
|
485
|
-
width:
|
|
531
|
+
width: 76px;
|
|
486
532
|
height: 26px;
|
|
487
533
|
display: flex;
|
|
488
534
|
align-items: center;
|
|
@@ -493,80 +539,70 @@ export default {
|
|
|
493
539
|
color: #366aff;
|
|
494
540
|
background: #ffffff;
|
|
495
541
|
border: 1px solid #a1b9ff;
|
|
542
|
+
box-sizing: border-box;
|
|
496
543
|
}
|
|
544
|
+
|
|
497
545
|
.preview_iframe {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
546
|
+
width: 100%;
|
|
547
|
+
height: 100%;
|
|
548
|
+
box-sizing: border-box;
|
|
549
|
+
background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
|
|
550
|
+
background-position: center;
|
|
551
|
+
background-size: 50px;
|
|
552
|
+
background-repeat: no-repeat;
|
|
505
553
|
}
|
|
506
|
-
|
|
554
|
+
|
|
555
|
+
.preview_iframe_kk {
|
|
507
556
|
width: 100%;
|
|
508
557
|
height: 100%;
|
|
509
558
|
}
|
|
510
|
-
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
.preview_iframe_html {
|
|
511
562
|
width: 100%;
|
|
512
563
|
height: 100%;
|
|
513
564
|
overflow-y: scroll;
|
|
514
565
|
text-align: left;
|
|
515
566
|
box-sizing: border-box;
|
|
516
567
|
padding: 16px;
|
|
517
|
-
|
|
568
|
+
|
|
569
|
+
/deep/.lake-content {
|
|
518
570
|
margin-left: 10px;
|
|
519
571
|
}
|
|
572
|
+
|
|
520
573
|
/deep/a:link {
|
|
521
|
-
color: #0000ee!important;
|
|
574
|
+
color: #0000ee !important;
|
|
522
575
|
}
|
|
576
|
+
|
|
523
577
|
/deep/a:visited {
|
|
524
|
-
color: #0000ee!important;
|
|
578
|
+
color: #0000ee !important;
|
|
525
579
|
}
|
|
580
|
+
|
|
526
581
|
/deep/a:hover {
|
|
527
|
-
color: #0000ee!important;
|
|
582
|
+
color: #0000ee !important;
|
|
528
583
|
}
|
|
584
|
+
|
|
529
585
|
/deep/a:active {
|
|
530
|
-
color: #0000ee!important;
|
|
586
|
+
color: #0000ee !important;
|
|
531
587
|
}
|
|
532
|
-
|
|
533
|
-
|
|
588
|
+
|
|
589
|
+
/deep/li:not(.rich-text-li),
|
|
590
|
+
ol:not(.list-paddingleft-2),
|
|
591
|
+
ul:not(.list-paddingleft-2) {
|
|
592
|
+
list-style-type: auto !important;
|
|
534
593
|
}
|
|
535
|
-
|
|
594
|
+
|
|
595
|
+
/deep/img {
|
|
536
596
|
width: 100%;
|
|
537
597
|
}
|
|
538
|
-
|
|
598
|
+
|
|
599
|
+
/deep/.ne-table {
|
|
539
600
|
width: 100% !important;
|
|
540
601
|
}
|
|
541
602
|
}
|
|
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
603
|
|
|
568
|
-
.
|
|
569
|
-
width:100
|
|
604
|
+
.footer {
|
|
605
|
+
width: calc(100% - 40px);
|
|
570
606
|
height: 50px;
|
|
571
607
|
display: flex;
|
|
572
608
|
align-items: center;
|
|
@@ -574,14 +610,54 @@ export default {
|
|
|
574
610
|
cursor: pointer;
|
|
575
611
|
padding: 0 20px;
|
|
576
612
|
border-bottom: 1px solid #cccccc;
|
|
577
|
-
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.loading_img {
|
|
616
|
+
display: flex;
|
|
617
|
+
align-items: center;
|
|
618
|
+
justify-content: center;
|
|
619
|
+
width: 100%;
|
|
620
|
+
height: 100%;
|
|
621
|
+
position: absolute;
|
|
622
|
+
top: 0;
|
|
623
|
+
left: 0;
|
|
624
|
+
background: #FFF;
|
|
625
|
+
|
|
626
|
+
img {
|
|
627
|
+
width: 50px;
|
|
628
|
+
height: 50px;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.libang_head {
|
|
633
|
+
height: 64px !important;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.drawer-header {
|
|
637
|
+
width: 100%;
|
|
638
|
+
height: 50px;
|
|
639
|
+
cursor: pointer;
|
|
640
|
+
padding: 6px 20px;
|
|
641
|
+
border-bottom: 1px solid #cccccc;
|
|
642
|
+
.btn_position {
|
|
643
|
+
position: absolute;
|
|
644
|
+
top: -34px;
|
|
645
|
+
left: 12px;
|
|
646
|
+
}
|
|
647
|
+
.header-btn {
|
|
578
648
|
display: flex;
|
|
579
649
|
align-items: center;
|
|
580
|
-
|
|
650
|
+
justify-content: space-between;
|
|
651
|
+
|
|
652
|
+
.header-right {
|
|
653
|
+
display: flex;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.summaryBtn {
|
|
581
657
|
flex: none;
|
|
582
658
|
//width: 95px;
|
|
583
659
|
height: 26px;
|
|
584
|
-
padding: 0
|
|
660
|
+
padding: 0 8px;
|
|
585
661
|
background: #ffffff;
|
|
586
662
|
display: flex;
|
|
587
663
|
align-items: center;
|
|
@@ -593,18 +669,22 @@ export default {
|
|
|
593
669
|
color: #366aff;
|
|
594
670
|
margin-right: 10px;
|
|
595
671
|
font-size: 14px;
|
|
672
|
+
|
|
596
673
|
i {
|
|
597
|
-
font-size:
|
|
598
|
-
margin:
|
|
674
|
+
font-size: 14px;
|
|
675
|
+
margin-right: 5px;
|
|
599
676
|
}
|
|
600
677
|
}
|
|
601
|
-
|
|
678
|
+
|
|
679
|
+
.summaryActiveBtn {
|
|
602
680
|
background: #366aff !important;
|
|
603
681
|
color: #ffffff !important;
|
|
604
682
|
}
|
|
683
|
+
|
|
605
684
|
.chat {
|
|
606
|
-
|
|
685
|
+
flex: none;
|
|
607
686
|
height: 26px;
|
|
687
|
+
padding: 0 8px;
|
|
608
688
|
background: #ffffff;
|
|
609
689
|
display: flex;
|
|
610
690
|
align-items: center;
|
|
@@ -616,57 +696,121 @@ export default {
|
|
|
616
696
|
color: #366aff;
|
|
617
697
|
margin-right: 10px;
|
|
618
698
|
font-size: 14px;
|
|
699
|
+
|
|
619
700
|
i {
|
|
620
|
-
font-size:
|
|
621
|
-
margin:
|
|
701
|
+
font-size: 14px;
|
|
702
|
+
margin-right: 5px;
|
|
703
|
+
margin-top: 2px;
|
|
622
704
|
}
|
|
623
705
|
}
|
|
706
|
+
|
|
624
707
|
.chat_active {
|
|
625
708
|
background: #366aff !important;
|
|
626
709
|
color: #FFFFFF !important;
|
|
627
710
|
}
|
|
628
711
|
}
|
|
712
|
+
|
|
713
|
+
.header_title {
|
|
714
|
+
font-size: 14px;
|
|
715
|
+
height: 100%;
|
|
716
|
+
.header_close {
|
|
717
|
+
display: flex;
|
|
718
|
+
align-items: center;
|
|
719
|
+
justify-content: space-between;
|
|
720
|
+
line-height: 26px;
|
|
721
|
+
}
|
|
722
|
+
.header_floder {
|
|
723
|
+
display: flex;
|
|
724
|
+
align-items: center;
|
|
725
|
+
line-height: 26px;
|
|
726
|
+
i {
|
|
727
|
+
margin: 0 5px;
|
|
728
|
+
color: #366aff;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
.header_top {
|
|
732
|
+
height: 100%;
|
|
733
|
+
display: flex;
|
|
734
|
+
align-items: center;
|
|
735
|
+
justify-content: space-between;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
629
738
|
}
|
|
739
|
+
|
|
630
740
|
@media screen and (max-width: 767px) {
|
|
631
|
-
|
|
632
|
-
|
|
741
|
+
|
|
742
|
+
/* 这里是针对移动设备的css样式设置 */
|
|
743
|
+
/deep/.el-drawer__body {
|
|
633
744
|
height: 100%;
|
|
634
745
|
}
|
|
746
|
+
|
|
635
747
|
#drawer_content_pre {
|
|
636
748
|
overflow: auto;
|
|
637
749
|
height: calc(100% - 50px);
|
|
638
750
|
background: #FFF;
|
|
639
751
|
}
|
|
752
|
+
|
|
753
|
+
.libang_content_pre {
|
|
754
|
+
height: calc(100% - 64px) !important;
|
|
755
|
+
}
|
|
640
756
|
}
|
|
757
|
+
|
|
641
758
|
@media screen and (min-width: 768px) {
|
|
642
|
-
|
|
643
|
-
|
|
759
|
+
|
|
760
|
+
/* 这里是针对pc设备的css样式设置 */
|
|
761
|
+
/deep/.el-drawer__body {
|
|
644
762
|
height: 100%;
|
|
645
763
|
}
|
|
764
|
+
|
|
646
765
|
#drawer_content_pre {
|
|
647
766
|
overflow: auto;
|
|
648
767
|
height: calc(100% - 50px);
|
|
649
768
|
background: #FFF;
|
|
650
769
|
}
|
|
770
|
+
|
|
771
|
+
.libang_content_pre {
|
|
772
|
+
height: calc(100% - 64px) !important;
|
|
773
|
+
}
|
|
651
774
|
}
|
|
652
775
|
|
|
653
776
|
@media screen and (min-width: 1200px) {
|
|
654
|
-
|
|
777
|
+
|
|
778
|
+
/* 这里是针对pc设备的css样式设置 */
|
|
655
779
|
.el-drawer__wrapper {
|
|
656
780
|
width: 55%;
|
|
657
781
|
left: calc(100vw - 55%);
|
|
658
782
|
right: 0;
|
|
783
|
+
|
|
659
784
|
/deep/.pdf-preview-drawer {
|
|
660
785
|
width: 100% !important;
|
|
661
786
|
}
|
|
662
787
|
}
|
|
663
|
-
|
|
788
|
+
|
|
789
|
+
/deep/.el-drawer__body {
|
|
664
790
|
height: 100%;
|
|
665
791
|
}
|
|
792
|
+
|
|
666
793
|
#drawer_content_pre {
|
|
667
794
|
overflow: auto;
|
|
668
795
|
height: calc(100% - 50px);
|
|
669
796
|
background: #FFF;
|
|
670
797
|
}
|
|
798
|
+
|
|
799
|
+
.libang_content_pre {
|
|
800
|
+
height: calc(100% - 64px) !important;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
</style>
|
|
804
|
+
<style lang="less">
|
|
805
|
+
.pdf-preview-drawer {
|
|
806
|
+
overflow: visible !important;
|
|
807
|
+
}
|
|
808
|
+
.libang_content_pre {
|
|
809
|
+
.change_scale {
|
|
810
|
+
top: 64px !important;
|
|
811
|
+
}
|
|
812
|
+
.float_intelligentSummary {
|
|
813
|
+
top: 74px !important;
|
|
814
|
+
}
|
|
671
815
|
}
|
|
672
816
|
</style>
|