askbot-dragon 1.6.74-beta → 1.6.76-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.
- package/package.json +1 -1
- package/src/components/previewPdf.vue +33 -98
package/package.json
CHANGED
|
@@ -5,40 +5,6 @@
|
|
|
5
5
|
另外增加了在知识项目中预览当前文件的一些功能
|
|
6
6
|
-->
|
|
7
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
8
|
<el-drawer title="我是标题" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
|
|
43
9
|
:modal="false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
|
|
44
10
|
custom-class="pdf-preview-drawer" v-if="drawer">
|
|
@@ -157,24 +123,24 @@ import pdfPosition from './pdfPosition.vue'
|
|
|
157
123
|
import { zoomElement } from '../assets/js/hammer'
|
|
158
124
|
import IntelligentSummary from "./intelligentSummary";
|
|
159
125
|
import { isMobile } from "../assets/js/common";
|
|
160
|
-
import { Toast } from 'vant';
|
|
126
|
+
// import { Toast } from 'vant';
|
|
161
127
|
export default {
|
|
162
128
|
data () {
|
|
163
129
|
return {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
130
|
+
previewShowPopup: false,
|
|
131
|
+
fileText: '',
|
|
132
|
+
fileType: "",
|
|
133
|
+
isPc: false,
|
|
134
|
+
drawer: false,
|
|
135
|
+
tagIds: [],
|
|
136
|
+
// '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
|
|
137
|
+
loading: true,
|
|
138
|
+
fileName:'',
|
|
139
|
+
previewKnowledgeId:"",
|
|
140
|
+
showSummary:true,
|
|
141
|
+
iframeHeight:"100%",
|
|
142
|
+
isDownload: false,
|
|
143
|
+
textWatermarkStr:""
|
|
178
144
|
}
|
|
179
145
|
},
|
|
180
146
|
mounted() {
|
|
@@ -214,7 +180,7 @@ export default {
|
|
|
214
180
|
type: String,
|
|
215
181
|
default: '',
|
|
216
182
|
},
|
|
217
|
-
|
|
183
|
+
folderName: {
|
|
218
184
|
type: String,
|
|
219
185
|
default: '',
|
|
220
186
|
},
|
|
@@ -430,58 +396,27 @@ export default {
|
|
|
430
396
|
}
|
|
431
397
|
}).then(res => {
|
|
432
398
|
console.log('downLoad 341', res)
|
|
433
|
-
if (res.data) {
|
|
434
|
-
if (
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
if(successful) {
|
|
447
|
-
Toast('下载地址已复制,请前往Safari浏览器访问下载')} else {
|
|
448
|
-
Toast('请允许复制内容到剪贴板')
|
|
449
|
-
}
|
|
450
|
-
// 移除 textarea 元素
|
|
451
|
-
document.body.removeChild(textArea);
|
|
452
|
-
this.close()
|
|
453
|
-
|
|
454
|
-
} else {
|
|
455
|
-
navigator.clipboard.writeText(res.data)
|
|
456
|
-
this.$message.success({
|
|
457
|
-
message: '下载地址已复制,请前往Safari浏览器访问下载',
|
|
458
|
-
})
|
|
459
|
-
}
|
|
460
|
-
return
|
|
461
|
-
} else {
|
|
462
|
-
// setTimeout(() =>{
|
|
463
|
-
// window.open(res.data,'下载', 'noopener')
|
|
464
|
-
// }, 2000)
|
|
465
|
-
// window.open(res.data,'下载', 'noopener')
|
|
466
|
-
if (isMobile()) {
|
|
467
|
-
const iframe = document.createElement("iframe");
|
|
468
|
-
iframe.setAttribute("hidden", "hidden");
|
|
469
|
-
iframe.onload = () => {
|
|
470
|
-
if (iframe) {
|
|
471
|
-
console.log("iframe onload....")
|
|
472
|
-
iframe.setAttribute('src', 'about:blank');
|
|
473
|
-
}
|
|
474
|
-
};
|
|
475
|
-
document.body.insertBefore(iframe, null);
|
|
476
|
-
iframe.setAttribute("src", res.data);
|
|
399
|
+
if (res.data|| res.bodyText) {
|
|
400
|
+
if (isMobile()) {
|
|
401
|
+
|
|
402
|
+
const iframe = document.createElement("iframe");
|
|
403
|
+
iframe.setAttribute("hidden", "hidden");
|
|
404
|
+
iframe.onload = () => {
|
|
405
|
+
if (iframe) {
|
|
406
|
+
console.log("iframe onload....")
|
|
407
|
+
iframe.setAttribute('src', 'about:blank');
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
document.body.insertBefore(iframe, null);
|
|
411
|
+
iframe.setAttribute("src", res.data || res.bodyText);
|
|
477
412
|
} else {
|
|
478
413
|
let a = document.createElement('a')
|
|
479
|
-
a.href = res.data
|
|
414
|
+
a.href = res.data|| res.bodyText
|
|
480
415
|
a.download = (this.title) + fileType
|
|
481
416
|
a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
|
|
482
417
|
}
|
|
483
418
|
this.close()
|
|
484
|
-
|
|
419
|
+
|
|
485
420
|
}
|
|
486
421
|
})
|
|
487
422
|
},
|
|
@@ -650,6 +585,7 @@ export default {
|
|
|
650
585
|
top: -34px;
|
|
651
586
|
left: 12px;
|
|
652
587
|
}
|
|
588
|
+
|
|
653
589
|
.header-btn {
|
|
654
590
|
display: flex;
|
|
655
591
|
align-items: center;
|
|
@@ -806,8 +742,7 @@ export default {
|
|
|
806
742
|
height: calc(100% - 64px) !important;
|
|
807
743
|
}
|
|
808
744
|
}
|
|
809
|
-
</style>
|
|
810
|
-
<style lang="less">
|
|
745
|
+
</style><style lang="less">
|
|
811
746
|
.pdf-preview-drawer {
|
|
812
747
|
overflow: visible !important;
|
|
813
748
|
}
|