askbot-dragon 1.5.14 → 1.5.15
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/pdfPosition.vue +6 -102
package/package.json
CHANGED
|
@@ -156,9 +156,10 @@ export default {
|
|
|
156
156
|
this.loadPdfData(pdfResloute.page)
|
|
157
157
|
},
|
|
158
158
|
async loadPdfData (loadPage) {
|
|
159
|
-
if(this.pages[loadPage - 1] && this.pages[loadPage - 1].dom && this.pages[loadPage - 1].dom.children.length > 0) {
|
|
159
|
+
if(this.pages[loadPage - 1] && ((this.pages[loadPage - 1].dom && this.pages[loadPage - 1].dom.children.length > 0) || this.pages[loadPage - 1].loading)) {
|
|
160
160
|
return
|
|
161
161
|
}
|
|
162
|
+
this.pages[loadPage - 1].loading = true
|
|
162
163
|
// pdfjsLib.GlobalWorkerOptions.workerSrc = require("pdfjs-dist/legacy/build/pdf.worker.entry.js");
|
|
163
164
|
// 拿到第一个分片
|
|
164
165
|
const { startPage, url } = await this.fetchPdfFragment(loadPage);
|
|
@@ -352,6 +353,7 @@ export default {
|
|
|
352
353
|
textLayer.render()
|
|
353
354
|
pageDom.appendChild(textLayer.textLayerDiv);
|
|
354
355
|
page.dom = pageDom;
|
|
356
|
+
page.loading = false
|
|
355
357
|
this.contentView.appendChild(pageDom);
|
|
356
358
|
if(this.transformSalce !== null) {
|
|
357
359
|
this.contentView.style.transform = `scale(${this.transformSalce}, ${this.transformSalce})`
|
|
@@ -371,7 +373,7 @@ export default {
|
|
|
371
373
|
} else {
|
|
372
374
|
pageoffsetHeight = (this.pageSize.height + this.PAGE_INTVERVAL)
|
|
373
375
|
}
|
|
374
|
-
if (this.$refs.pdfView.clientHeight - pageoffsetHeight > 0) {
|
|
376
|
+
if (this.$refs.pdfView.clientHeight - pageoffsetHeight > 0 && pageIndex == 1) {
|
|
375
377
|
const height = this.$refs.pdfView.clientHeight;
|
|
376
378
|
let startNum = 0
|
|
377
379
|
let endNum = 0
|
|
@@ -502,6 +504,7 @@ export default {
|
|
|
502
504
|
if (page.dom) {
|
|
503
505
|
this.contentView.removeChild(page.dom);
|
|
504
506
|
page.loadStatus = 0
|
|
507
|
+
page.loading = false
|
|
505
508
|
page.dom = undefined;
|
|
506
509
|
}
|
|
507
510
|
},
|
|
@@ -859,105 +862,6 @@ export default {
|
|
|
859
862
|
// if(value.length === 1) {
|
|
860
863
|
// this.$refs.pdfView.style.height = 'calc(100% - 50px)'
|
|
861
864
|
// }
|
|
862
|
-
// res.data = {
|
|
863
|
-
// "data": [
|
|
864
|
-
// {
|
|
865
|
-
// "id": "64ffc9db73158d7a824f6d60",
|
|
866
|
-
// "knowledgeId": "64ffc9da5e51ee791930a1cd",
|
|
867
|
-
// "mainId": "adbbf75ff2af4fe49561e876210bf70f",
|
|
868
|
-
// "page": 7,
|
|
869
|
-
// "total": 11,
|
|
870
|
-
// "pageHeight": 841.8898,
|
|
871
|
-
// "pageWidth": 595.30396,
|
|
872
|
-
// "publicPageFileUrl": "https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/adbbf75ff2af4fe49561e876210bf70f/2023/09/12/02/15/54/64ffc9da73158d7a824f6cf5/7.pdf",
|
|
873
|
-
// "extractInfo": {
|
|
874
|
-
// "location": [
|
|
875
|
-
// 56.8,
|
|
876
|
-
// 182.0008,
|
|
877
|
-
// 480.0,
|
|
878
|
-
// 80.0
|
|
879
|
-
// ],
|
|
880
|
-
// "content": "第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:工作时间:9:00至12:00,13:00至18:00;第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:工作时间:9:00至12:00,13:00至18:00;午休时间:12:00至13:00。",
|
|
881
|
-
// "lines": [
|
|
882
|
-
// {
|
|
883
|
-
// "content": "第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:",
|
|
884
|
-
// "location": [
|
|
885
|
-
// 56.8,
|
|
886
|
-
// 182.0008,
|
|
887
|
-
// 480.0,
|
|
888
|
-
// 55.599976
|
|
889
|
-
// ]
|
|
890
|
-
// },
|
|
891
|
-
// {
|
|
892
|
-
// "content": "第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:工作时间:9:00至12:00,13:00至18:00;",
|
|
893
|
-
// "location": [
|
|
894
|
-
// 56.8,
|
|
895
|
-
// 182.0008,
|
|
896
|
-
// 480.0,
|
|
897
|
-
// 67.0
|
|
898
|
-
// ]
|
|
899
|
-
// },
|
|
900
|
-
// {
|
|
901
|
-
// "content": "第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:工作时间:9:00至12:00,13:00至18:00;午休时间:12:00至13:00。",
|
|
902
|
-
// "location": [
|
|
903
|
-
// 56.8,
|
|
904
|
-
// 182.0008,
|
|
905
|
-
// 480.0,
|
|
906
|
-
// 80.0
|
|
907
|
-
// ]
|
|
908
|
-
// }
|
|
909
|
-
// ],
|
|
910
|
-
// "tagId": null
|
|
911
|
-
// },
|
|
912
|
-
// "block": {
|
|
913
|
-
// "type": "TEXT",
|
|
914
|
-
// "location": [
|
|
915
|
-
// 56.8,
|
|
916
|
-
// 182.0008,
|
|
917
|
-
// 480.0,
|
|
918
|
-
// 80.0
|
|
919
|
-
// ],
|
|
920
|
-
// "color": null,
|
|
921
|
-
// "flowChart": null,
|
|
922
|
-
// "image": null,
|
|
923
|
-
// "table": null,
|
|
924
|
-
// "text": {
|
|
925
|
-
// "originText": "第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:工作时间:9:00至12:00,13:00至18:00;第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:工作时间:9:00至12:00,13:00至18:00;午休时间:12:00至13:00。",
|
|
926
|
-
// "indexText": "第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:工作时间:9:00至12:00,13:00至18:00;第五章 工作时间与休假第四十二条 工作时间非实行特殊工时制的岗位,按每周工作五天(周一至周五)、每天工作八小时的标准工时制执行,具体作息时间为:工作时间:9:00至12:00,13:00至18:00;午休时间:12:00至13:00。",
|
|
927
|
-
// "lines": [
|
|
928
|
-
// {
|
|
929
|
-
// "location": [
|
|
930
|
-
// 56.8,
|
|
931
|
-
// 182.0008,
|
|
932
|
-
// 480.0,
|
|
933
|
-
// 55.599976
|
|
934
|
-
// ]
|
|
935
|
-
// },
|
|
936
|
-
// {
|
|
937
|
-
// "location": [
|
|
938
|
-
// 56.8,
|
|
939
|
-
// 182.0008,
|
|
940
|
-
// 480.0,
|
|
941
|
-
// 67.0
|
|
942
|
-
// ]
|
|
943
|
-
// },
|
|
944
|
-
// {
|
|
945
|
-
// "location": [
|
|
946
|
-
// 56.8,
|
|
947
|
-
// 182.0008,
|
|
948
|
-
// 480.0,
|
|
949
|
-
// 80.0
|
|
950
|
-
// ]
|
|
951
|
-
// }
|
|
952
|
-
// ]
|
|
953
|
-
// }
|
|
954
|
-
// }
|
|
955
|
-
// }
|
|
956
|
-
// ],
|
|
957
|
-
// "code": "0",
|
|
958
|
-
// "msg": null,
|
|
959
|
-
// "traceId": null
|
|
960
|
-
// }
|
|
961
865
|
if (res.data.code == 0) {
|
|
962
866
|
// tagIds 会按照gpt识别的生成有序的数组,前端直接按照下标的顺序取就可以了
|
|
963
867
|
// 缓存拿到的所有数据
|
|
@@ -967,7 +871,7 @@ export default {
|
|
|
967
871
|
// console.log(publicPageFileUrl.substring(publicPageFileUrl.lastIndexOf('.')));
|
|
968
872
|
if (publicPageFileUrl.substring(publicPageFileUrl.lastIndexOf('.')) === '.pdf') {
|
|
969
873
|
this.preViewType = 'pdf'
|
|
970
|
-
this.setPageAllLine(this.cachePdf)
|
|
874
|
+
// this.setPageAllLine(this.cachePdf)
|
|
971
875
|
this.getpdfResloutePage(res.data.data[0])
|
|
972
876
|
} else {
|
|
973
877
|
this.preViewType = 'excal'
|