askbot-dragon 1.3.91 → 1.3.93
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
CHANGED
|
@@ -131,7 +131,7 @@ export default {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
-
props: ['msg','isAskLightning'],
|
|
134
|
+
props: ['msg','isAskLightning', 'isMessageRecord'],
|
|
135
135
|
beforeMounted() {
|
|
136
136
|
|
|
137
137
|
},
|
|
@@ -218,6 +218,9 @@ export default {
|
|
|
218
218
|
}
|
|
219
219
|
this.$refs.previewPdf.fileType = type
|
|
220
220
|
this.$refs.previewPdf.tagIds = item.tagIds
|
|
221
|
+
this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false
|
|
222
|
+
// this.$refs.previewPdf.tagIds = ["6463435ae607ba08d55fd46b"]
|
|
223
|
+
|
|
221
224
|
if(item.tagIds && item.tagIds.length != 0) {
|
|
222
225
|
this.$refs.previewPdf.loading = false
|
|
223
226
|
return
|
|
@@ -234,7 +237,7 @@ export default {
|
|
|
234
237
|
},
|
|
235
238
|
fileType (url) {
|
|
236
239
|
const fileType = url.substring(url.lastIndexOf('.'));
|
|
237
|
-
if (fileType === '.mp4' || fileType === '.MP4') {
|
|
240
|
+
if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.MOVC' || fileType === '.mov' || fileType === '.movc' || fileType === '.mav' || fileType === '.MAV' || fileType == '.mp3' || fileType == '.MP3') {
|
|
238
241
|
return 'VIDEO'
|
|
239
242
|
} else if (fileType === '.html') {
|
|
240
243
|
return 'HTML'
|
|
@@ -24,7 +24,7 @@ const { TextLayerBuilder } = window['pdfjs-dist/web/pdf_viewer']
|
|
|
24
24
|
// import { zoomElement } from '../assets/js/hammer'
|
|
25
25
|
export default {
|
|
26
26
|
name: 'pdfView',
|
|
27
|
-
props:['tagIds'],
|
|
27
|
+
props:['tagIds','isMessageRecord'],
|
|
28
28
|
data() {
|
|
29
29
|
return {
|
|
30
30
|
url: '',
|
|
@@ -80,7 +80,11 @@ export default {
|
|
|
80
80
|
// 根据当前页面宽度设置缩放比例
|
|
81
81
|
// this.scale = Math.round(this.$refs.pdfView.clientWidth / pdfResloute.pageWidth * 100) / 100
|
|
82
82
|
// console.log(this.scale,'this.scale');
|
|
83
|
-
this.
|
|
83
|
+
if(this.isMessageRecord) {
|
|
84
|
+
this.scale = Math.round(this.$refs.pdfView.clientWidth / pdfResloute.pageWidth * 100) / 100
|
|
85
|
+
} else {
|
|
86
|
+
this.scale = 1
|
|
87
|
+
}
|
|
84
88
|
// 从后端获取到当前分片后所有的pdf页码,初始化数组,数组下{} 对应每页pdf文件
|
|
85
89
|
this.pdfUrl = pdfResloute.publicPageFileUrl.substring(0, pdfResloute.publicPageFileUrl.lastIndexOf('/') + 1)
|
|
86
90
|
this.initPages(pdfResloute.total)
|
|
@@ -175,7 +179,7 @@ export default {
|
|
|
175
179
|
}
|
|
176
180
|
this.pageSize = pageSize
|
|
177
181
|
// 创建内容绘制区,并设置大小
|
|
178
|
-
if(this.$refs.pdfView.clientWidth / this.pageSize.width >= 1) {
|
|
182
|
+
if(this.$refs.pdfView.clientWidth / this.pageSize.width >= 1 || this.isMessageRecord) {
|
|
179
183
|
this.contentView.style.width = `${pageSize.width }px`;
|
|
180
184
|
this.contentView.style.height = `${(this.totalPageCount * (pageSize.height + this.PAGE_INTVERVAL)) + this.PAGE_INTVERVAL}px`;
|
|
181
185
|
} else {
|
|
@@ -296,12 +300,15 @@ export default {
|
|
|
296
300
|
this.fisrtLoad = false
|
|
297
301
|
} else {
|
|
298
302
|
this.$refs.pdfView.scrollTop = `${((pageNo - 1) * (this.pageSize.height + this.PAGE_INTVERVAL) * this.transformSalce)}`
|
|
303
|
+
this.renderHighlights()
|
|
299
304
|
}
|
|
300
305
|
} else {
|
|
301
306
|
if (this.$refs.pdfView.scrollTop == Math.floor((pageNo - 1) * (this.pageSize.height + this.PAGE_INTVERVAL))) {
|
|
302
307
|
this.fisrtLoad = false
|
|
303
308
|
} else {
|
|
304
309
|
this.$refs.pdfView.scrollTop = `${((pageNo - 1) * (this.pageSize.height + this.PAGE_INTVERVAL))}`
|
|
310
|
+
this.renderHighlights()
|
|
311
|
+
|
|
305
312
|
}
|
|
306
313
|
}
|
|
307
314
|
// zoomElement(this.contentView)
|
|
@@ -487,12 +494,14 @@ export default {
|
|
|
487
494
|
scrollToExcalTop(currentPage) {
|
|
488
495
|
for (let index = 0; index < this.allTr.length; index++) {
|
|
489
496
|
if(index == currentPage) {
|
|
490
|
-
this.allTr[index].children.forEach(item =>{
|
|
497
|
+
Array.from(this.allTr[index].children).forEach(item =>{
|
|
491
498
|
item.style.background = 'rgba(255, 136, 0, 0.6)'
|
|
492
499
|
})
|
|
493
|
-
this.$refs.pdfView.scrollTop = this.allTr[index].offsetTop
|
|
500
|
+
// this.$refs.pdfView.scrollTop = this.allTr[index].offsetTop
|
|
501
|
+
this.$refs.pdfView.scrollTop = this.allTr[index].getBoundingClientRect().top
|
|
502
|
+
|
|
494
503
|
} else {
|
|
495
|
-
this.allTr[index].children.forEach(item =>{
|
|
504
|
+
Array.from(this.allTr[index].children).forEach(item =>{
|
|
496
505
|
item.style.background = 'rgba(54, 106, 255, 0.6)'
|
|
497
506
|
})
|
|
498
507
|
}
|
|
@@ -711,13 +720,14 @@ export default {
|
|
|
711
720
|
}).then(res => {
|
|
712
721
|
// 使用原声请求方式 axios会带有不需要的请求头
|
|
713
722
|
let xhr = new XMLHttpRequest();
|
|
714
|
-
xhr.open('GET', res.data, true);
|
|
723
|
+
xhr.open('GET', res.data || res.bodyText , true);
|
|
715
724
|
// 定义请求完成的处理函数,请求前也可以增加加载框/禁用下载按钮逻辑
|
|
716
725
|
xhr.onload = ({ currentTarget }) => {
|
|
717
726
|
// 请求完成
|
|
718
727
|
if (currentTarget.status === 200) { // 返回200
|
|
719
728
|
this.contentView.innerHTML = currentTarget.response
|
|
720
729
|
this.contentView.style.padding = '10px'
|
|
730
|
+
// this.contentView.style.position = 'relative'
|
|
721
731
|
this.$refs.pdfView.style.backgroundColor = '#FFFFFF'
|
|
722
732
|
this.$refs.pdfView.appendChild(this.contentView)
|
|
723
733
|
let allTr = Array.from(this.$refs.pdfView.getElementsByTagName('tr'))
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
:destroy-on-close="true"
|
|
42
42
|
:direction="previewShowPopup ? 'btt' : 'rtl'"
|
|
43
43
|
:size="previewShowPopup ? '90%' : '65%'"
|
|
44
|
+
custom-class="pdf-preview-drawer"
|
|
44
45
|
>
|
|
45
46
|
<!-- v-else-if="drawer" -->
|
|
46
47
|
<div class="drawer-footer">
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
</section>
|
|
51
52
|
</div>
|
|
52
53
|
<template v-if="tagIds && tagIds.length != 0 && drawer">
|
|
53
|
-
<pdfPosition :tagIds="tagIds"></pdfPosition>
|
|
54
|
+
<pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord"></pdfPosition>
|
|
54
55
|
</template>
|
|
55
56
|
<template v-else>
|
|
56
57
|
<div v-if="fileType == 'VIDEO'" style="width: 100%;height:calc(100% - 60px)">
|
|
@@ -104,6 +105,10 @@ export default {
|
|
|
104
105
|
officePreviewType:{
|
|
105
106
|
type: String,
|
|
106
107
|
default: ''
|
|
108
|
+
},
|
|
109
|
+
isMessageRecord:{
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default:false,
|
|
107
112
|
}
|
|
108
113
|
},
|
|
109
114
|
components:{
|
|
@@ -138,21 +143,23 @@ export default {
|
|
|
138
143
|
},
|
|
139
144
|
methods :{
|
|
140
145
|
close() {
|
|
146
|
+
setTimeout(() =>{
|
|
141
147
|
this.previewShowPopup = false;
|
|
142
|
-
this.
|
|
148
|
+
this.fileType = ''
|
|
149
|
+
}, 300)
|
|
150
|
+
this.drawer = false;
|
|
143
151
|
},
|
|
144
152
|
loadIframe() {
|
|
145
|
-
let iframe = document.getElementsByClassName('preview_iframe')[0]
|
|
146
|
-
console.log(iframe,'iframeiframe');
|
|
147
|
-
if(iframe) {
|
|
148
|
-
// this.loading = true
|
|
149
|
-
iframe.onload = () =>{
|
|
150
|
-
console.log('1111111');
|
|
151
|
-
this.loading = false
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
153
|
if(this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0)) {
|
|
155
154
|
this.loading = false
|
|
155
|
+
} else {
|
|
156
|
+
let time = setInterval(() =>{
|
|
157
|
+
let iframe = document.getElementsByClassName('preview_iframe')[0]
|
|
158
|
+
if(iframe) {
|
|
159
|
+
this.loading = false
|
|
160
|
+
clearInterval(time)
|
|
161
|
+
}
|
|
162
|
+
}, 500)
|
|
156
163
|
}
|
|
157
164
|
},
|
|
158
165
|
getBolb() {
|