askbot-dragon 1.3.81 → 1.3.82
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/public/index.html +1 -1
- package/src/components/pdfPosition.vue +156 -4
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.1.266/pdf_viewer.js" integrity="sha512-/Kuwn901frjpfp2NMgB9S/LEtm+ilDzwVy/iS8MlY0BeIwkvtjGTxnjY8u+fn8QyDxS23OLJ+M2g++W/zsb0nw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
39
39
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.1.266/pdf_viewer.css" integrity="sha512-0LYOXoVuJYymEk9nBWqkOCflK2quQSJHaKavRoiaaq7LFM0ThLErV8uqE9vBuXAliN+8qbymsx0u5C9B/pHn7g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
|
40
40
|
<!-- hammer.js -->
|
|
41
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js" integrity="sha512-UXumZrZNiOwnTcZSHLOfcTs0aos2MzBWHXOHOuB0J/R44QB0dwY5JgfbvljXcklVf65Gc4El6RjZ+lnwd2az2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
41
|
+
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js" integrity="sha512-UXumZrZNiOwnTcZSHLOfcTs0aos2MzBWHXOHOuB0J/R44QB0dwY5JgfbvljXcklVf65Gc4El6RjZ+lnwd2az2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> -->
|
|
42
42
|
<style>
|
|
43
43
|
*{
|
|
44
44
|
margin: 0;
|
|
@@ -21,7 +21,7 @@ if(pdfjsLib) {
|
|
|
21
21
|
// 'pdfjs-dist/build/pdf.worker';
|
|
22
22
|
}
|
|
23
23
|
const { TextLayerBuilder } = window['pdfjs-dist/web/pdf_viewer']
|
|
24
|
-
import { zoomElement } from '../assets/js/hammer'
|
|
24
|
+
// import { zoomElement } from '../assets/js/hammer'
|
|
25
25
|
export default {
|
|
26
26
|
name: 'pdfView',
|
|
27
27
|
props:['tagIds'],
|
|
@@ -77,8 +77,9 @@ export default {
|
|
|
77
77
|
methods: {
|
|
78
78
|
getpdfResloutePage (pdfResloute) {
|
|
79
79
|
// 根据当前页面宽度设置缩放比例
|
|
80
|
-
this.scale = this.$refs.pdfView.clientWidth / pdfResloute.pageWidth
|
|
81
|
-
// this.scale
|
|
80
|
+
// this.scale = Math.round(this.$refs.pdfView.clientWidth / pdfResloute.pageWidth * 100) / 100
|
|
81
|
+
// console.log(this.scale,'this.scale');
|
|
82
|
+
this.scale = 1
|
|
82
83
|
// 从后端获取到当前分片后所有的pdf页码,初始化数组,数组下{} 对应每页pdf文件
|
|
83
84
|
this.pdfUrl = pdfResloute.publicPageFileUrl.substring(0, pdfResloute.publicPageFileUrl.lastIndexOf('/') + 1)
|
|
84
85
|
this.initPages(pdfResloute.total)
|
|
@@ -283,7 +284,8 @@ export default {
|
|
|
283
284
|
} else {
|
|
284
285
|
this.$refs.pdfView.scrollTop = `${((pageNo - 1) * (this.pageSize.height + this.PAGE_INTVERVAL))}`
|
|
285
286
|
}
|
|
286
|
-
|
|
287
|
+
this.contentView.style.transform = "scale(" + this.$refs.pdfView.clientWidth / this.pageSize.width + ")";
|
|
288
|
+
// zoomElement(this.contentView)
|
|
287
289
|
}, 100)
|
|
288
290
|
}
|
|
289
291
|
})
|
|
@@ -663,6 +665,156 @@ export default {
|
|
|
663
665
|
this.contentView = document.createElement('div')
|
|
664
666
|
this.contentView.style.transformOrigin = '0px 0px 0px'
|
|
665
667
|
this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + value.join(',')).then(res =>{
|
|
668
|
+
res.data = {
|
|
669
|
+
"data": [
|
|
670
|
+
{
|
|
671
|
+
"id": "64592044ec66de61a8971049",
|
|
672
|
+
"knowledgeId": "64591f8ca3222a26557e17f0",
|
|
673
|
+
"mainId": "137e3903781f45cb8f6d5c4a1e17ac9c",
|
|
674
|
+
"page": 1,
|
|
675
|
+
"total": 2,
|
|
676
|
+
"pageHeight": 841.9,
|
|
677
|
+
"pageWidth": 595.3,
|
|
678
|
+
"publicPageFileUrl": "https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/137e3903781f45cb8f6d5c4a1e17ac9c/2023/05/09/12/16/02/64592042ec66de61a8970ff4/1.pdf",
|
|
679
|
+
"extractInfo": {
|
|
680
|
+
"location": [
|
|
681
|
+
90,
|
|
682
|
+
389.32,
|
|
683
|
+
419.05,
|
|
684
|
+
138.96997
|
|
685
|
+
],
|
|
686
|
+
"content": "没想到正直的魏绛一口谢绝了赠礼,并劝晋悼公说:“《书》曰:‘居安思危’,思则有备,有备无患。”意思是说,如今晋国虽然很强大昌盛,但是我们绝对不能因此而大意,因为人在安全的时候,一定要想到未来可能会发生的危险,这样才会先做准备,以避免失败和灾祸的发生。[2]",
|
|
687
|
+
"lines": [
|
|
688
|
+
{
|
|
689
|
+
"content": "没想到正直的魏绛一口谢绝了赠礼,并劝晋悼公说:“《书》曰:",
|
|
690
|
+
"location": [
|
|
691
|
+
111,
|
|
692
|
+
389.32,
|
|
693
|
+
398.05,
|
|
694
|
+
14.169983
|
|
695
|
+
]
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"content": "‘居安思危’,思则有备,有备无患。”意思是说,如今晋国虽然很强大",
|
|
699
|
+
"location": [
|
|
700
|
+
90,
|
|
701
|
+
420.519,
|
|
702
|
+
415.32794,
|
|
703
|
+
14.17099
|
|
704
|
+
]
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"content": "昌盛,但是我们绝对不能因此而大意,因为人在安全的时候,一定要",
|
|
708
|
+
"location": [
|
|
709
|
+
90,
|
|
710
|
+
451.84003,
|
|
711
|
+
415.3284,
|
|
712
|
+
14.049988
|
|
713
|
+
]
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"content": "想到未来可能会发生的危险,这样才会先做准备,以避免失败和灾祸",
|
|
717
|
+
"location": [
|
|
718
|
+
90,
|
|
719
|
+
483.04,
|
|
720
|
+
415.32837,
|
|
721
|
+
14.049988
|
|
722
|
+
]
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
"content": "的发生。[2]",
|
|
726
|
+
"location": [
|
|
727
|
+
90,
|
|
728
|
+
514.24,
|
|
729
|
+
72.16771,
|
|
730
|
+
14.049988
|
|
731
|
+
]
|
|
732
|
+
}
|
|
733
|
+
],
|
|
734
|
+
"tagId": null
|
|
735
|
+
}
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
"id": "64592044ec66de61a897104d",
|
|
739
|
+
"knowledgeId": "64591f8ca3222a26557e17f0",
|
|
740
|
+
"mainId": "137e3903781f45cb8f6d5c4a1e17ac9c",
|
|
741
|
+
"page": 2,
|
|
742
|
+
"total": 2,
|
|
743
|
+
"pageHeight": 841.9,
|
|
744
|
+
"pageWidth": 595.3,
|
|
745
|
+
"publicPageFileUrl": "https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/137e3903781f45cb8f6d5c4a1e17ac9c/2023/05/09/12/16/02/64592042ec66de61a8970ff4/2.pdf",
|
|
746
|
+
"extractInfo": {
|
|
747
|
+
"location": [
|
|
748
|
+
90,
|
|
749
|
+
109.84001,
|
|
750
|
+
415.33,
|
|
751
|
+
170.05
|
|
752
|
+
],
|
|
753
|
+
"content": "家来说则更是如此。居安思危是一种超前的危机意识和忧患意识,人的一生当中不可能始终是一帆风顺,总会有曲折与风雨相伴,坎坷与逆境相随。所以,面对任何事情,人们都应当做到未雨绸缪,这样在遇到突发情况时才不至于手忙脚乱。在和平时期,要有居安思危的应变措施,在做好物质准备的同时,思想上还要常守不虞之戒,牢记失戒的教训,只有做到居安思危,才能有备无患,防患于未然。",
|
|
754
|
+
"lines": [
|
|
755
|
+
{
|
|
756
|
+
"content": "家来说则更是如此。居安思危是一种超前的危机意识和忧患意识,人",
|
|
757
|
+
"location": [
|
|
758
|
+
90,
|
|
759
|
+
109.84001,
|
|
760
|
+
415.33,
|
|
761
|
+
14.050003
|
|
762
|
+
]
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"content": "的一生当中不可能始终是一帆风顺,总会有曲折与风雨相伴,坎坷与",
|
|
766
|
+
"location": [
|
|
767
|
+
90,
|
|
768
|
+
141.03996,
|
|
769
|
+
415.3284,
|
|
770
|
+
14.050003
|
|
771
|
+
]
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"content": "逆境相随。所以,面对任何事情,人们都应当做到未雨绸缪,这样在",
|
|
775
|
+
"location": [
|
|
776
|
+
90,
|
|
777
|
+
172.23997,
|
|
778
|
+
415.3284,
|
|
779
|
+
14.050003
|
|
780
|
+
]
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
"content": "遇到突发情况时才不至于手忙脚乱。在和平时期,要有居安思危的应",
|
|
784
|
+
"location": [
|
|
785
|
+
90,
|
|
786
|
+
203.43999,
|
|
787
|
+
415.32837,
|
|
788
|
+
14.050003
|
|
789
|
+
]
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"content": "变措施,在做好物质准备的同时,思想上还要常守不虞之戒,牢记失",
|
|
793
|
+
"location": [
|
|
794
|
+
90,
|
|
795
|
+
234.64,
|
|
796
|
+
415.3284,
|
|
797
|
+
14.050003
|
|
798
|
+
]
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
"content": "戒的教训,只有做到居安思危,才能有备无患,防患于未然。",
|
|
802
|
+
"location": [
|
|
803
|
+
90,
|
|
804
|
+
265.84003,
|
|
805
|
+
378.0035,
|
|
806
|
+
14.049988
|
|
807
|
+
]
|
|
808
|
+
}
|
|
809
|
+
],
|
|
810
|
+
"tagId": null
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
],
|
|
814
|
+
"code": "0",
|
|
815
|
+
"msg": null,
|
|
816
|
+
"traceId": null
|
|
817
|
+
}
|
|
666
818
|
if (res.data.code == 0) {
|
|
667
819
|
// tagIds 会按照gpt识别的生成有序的数组,前端直接按照下标的顺序取就可以了
|
|
668
820
|
// 缓存拿到的所有数据
|