askbot-dragon 1.3.70 → 1.3.72

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.3.70",
3
+ "version": "1.3.72",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -66,6 +66,7 @@
66
66
  </template>
67
67
 
68
68
  <script>
69
+ /* eslint-disable */
69
70
  import previewPdf from "./previewPdf";
70
71
  import { isMobile } from "../assets/js/common";
71
72
  export default {
@@ -158,6 +159,7 @@ export default {
158
159
  //预览图片
159
160
  lookAttach(url, item, event) {
160
161
  event.preventDefault();
162
+ this.isAskLightning = 2
161
163
  if (this.isAskLightning == 1){
162
164
  window.parent.postMessage({
163
165
  data: "bot_preview",
@@ -816,6 +816,22 @@ export default {
816
816
  // this.$nextTick()将回调延迟到下次 DOM 更新循环之后执行
817
817
  let that = this;
818
818
  this.$nextTick(() => {
819
+ // setInterval(() => {
820
+ // this.scale = this.scale + 0.1
821
+ // that.pages.forEach((item, index) =>{
822
+ // if(item.dom) {
823
+ // item.dom.children.forEach( childDom =>{
824
+ // if(childDom.getAttribute('react-count')) {
825
+ // childDom.style.transform = "scale(" + this.scale + ")";
826
+ // childDom.style.transformOrigin = "0px 0px 0px";
827
+ // } else {
828
+ // item.dom = null
829
+ // this.startRenderPages(item.pdfPage, null, index)
830
+ // }
831
+ // } )
832
+ // }
833
+ // })
834
+ // }, 100);
819
835
  // 获取放大或缩小的区域DOM
820
836
  let matrix_box = this.contentView
821
837
  matrix_box.addEventListener("touchstart", function (event) {
@@ -886,17 +902,19 @@ export default {
886
902
  }
887
903
  // 记住使用的缩放值
888
904
  that.displacement.scale = newScale;
905
+ that.scale = newScale
889
906
  // 图像应用缩放效果
890
- that.pages.forEach(item =>{
907
+ that.pages.forEach((item, index) =>{
891
908
  if(item.dom) {
892
909
  item.dom.children.forEach( childDom =>{
893
- if(childDom.tagName == 'CANVNS') {
894
- childDom.scale(newScale,newScale)
895
- } else {
910
+ if(childDom.getAttribute('react-count')) {
896
911
  childDom.style.transform = "scale(" + newScale + ")";
897
912
  childDom.style.transformOrigin = "0px 0px 0px";
913
+ } else {
914
+ item.dom = null
915
+ that.startRenderPages(item.pdfPage, null, index)
898
916
  }
899
- } )
917
+ })
900
918
  }
901
919
  })
902
920
  // console.log(newScale);
@@ -934,6 +952,156 @@ export default {
934
952
  // 在 pdf_view 下创建 所有canvs的容器
935
953
  this.contentView = document.createElement('div')
936
954
  this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + value.join(',')).then(res =>{
955
+ res.data = {
956
+ "data": [
957
+ {
958
+ "id": "64592044ec66de61a8971049",
959
+ "knowledgeId": "64591f8ca3222a26557e17f0",
960
+ "mainId": "137e3903781f45cb8f6d5c4a1e17ac9c",
961
+ "page": 1,
962
+ "total": 2,
963
+ "pageHeight": 841.9,
964
+ "pageWidth": 595.3,
965
+ "publicPageFileUrl": "https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/137e3903781f45cb8f6d5c4a1e17ac9c/2023/05/09/12/16/02/64592042ec66de61a8970ff4/1.pdf",
966
+ "extractInfo": {
967
+ "location": [
968
+ 90,
969
+ 389.32,
970
+ 419.05,
971
+ 138.96997
972
+ ],
973
+ "content": "没想到正直的魏绛一口谢绝了赠礼,并劝晋悼公说:“《书》曰:‘居安思危’,思则有备,有备无患。”意思是说,如今晋国虽然很强大昌盛,但是我们绝对不能因此而大意,因为人在安全的时候,一定要想到未来可能会发生的危险,这样才会先做准备,以避免失败和灾祸的发生。[2]",
974
+ "lines": [
975
+ {
976
+ "content": "没想到正直的魏绛一口谢绝了赠礼,并劝晋悼公说:“《书》曰:",
977
+ "location": [
978
+ 111,
979
+ 389.32,
980
+ 398.05,
981
+ 14.169983
982
+ ]
983
+ },
984
+ {
985
+ "content": "‘居安思危’,思则有备,有备无患。”意思是说,如今晋国虽然很强大",
986
+ "location": [
987
+ 90,
988
+ 420.519,
989
+ 415.32794,
990
+ 14.17099
991
+ ]
992
+ },
993
+ {
994
+ "content": "昌盛,但是我们绝对不能因此而大意,因为人在安全的时候,一定要",
995
+ "location": [
996
+ 90,
997
+ 451.84003,
998
+ 415.3284,
999
+ 14.049988
1000
+ ]
1001
+ },
1002
+ {
1003
+ "content": "想到未来可能会发生的危险,这样才会先做准备,以避免失败和灾祸",
1004
+ "location": [
1005
+ 90,
1006
+ 483.04,
1007
+ 415.32837,
1008
+ 14.049988
1009
+ ]
1010
+ },
1011
+ {
1012
+ "content": "的发生。[2]",
1013
+ "location": [
1014
+ 90,
1015
+ 514.24,
1016
+ 72.16771,
1017
+ 14.049988
1018
+ ]
1019
+ }
1020
+ ],
1021
+ "tagId": null
1022
+ }
1023
+ },
1024
+ {
1025
+ "id": "64592044ec66de61a897104d",
1026
+ "knowledgeId": "64591f8ca3222a26557e17f0",
1027
+ "mainId": "137e3903781f45cb8f6d5c4a1e17ac9c",
1028
+ "page": 2,
1029
+ "total": 2,
1030
+ "pageHeight": 841.9,
1031
+ "pageWidth": 595.3,
1032
+ "publicPageFileUrl": "https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/137e3903781f45cb8f6d5c4a1e17ac9c/2023/05/09/12/16/02/64592042ec66de61a8970ff4/2.pdf",
1033
+ "extractInfo": {
1034
+ "location": [
1035
+ 90,
1036
+ 109.84001,
1037
+ 415.33,
1038
+ 170.05
1039
+ ],
1040
+ "content": "家来说则更是如此。居安思危是一种超前的危机意识和忧患意识,人的一生当中不可能始终是一帆风顺,总会有曲折与风雨相伴,坎坷与逆境相随。所以,面对任何事情,人们都应当做到未雨绸缪,这样在遇到突发情况时才不至于手忙脚乱。在和平时期,要有居安思危的应变措施,在做好物质准备的同时,思想上还要常守不虞之戒,牢记失戒的教训,只有做到居安思危,才能有备无患,防患于未然。",
1041
+ "lines": [
1042
+ {
1043
+ "content": "家来说则更是如此。居安思危是一种超前的危机意识和忧患意识,人",
1044
+ "location": [
1045
+ 90,
1046
+ 109.84001,
1047
+ 415.33,
1048
+ 14.050003
1049
+ ]
1050
+ },
1051
+ {
1052
+ "content": "的一生当中不可能始终是一帆风顺,总会有曲折与风雨相伴,坎坷与",
1053
+ "location": [
1054
+ 90,
1055
+ 141.03996,
1056
+ 415.3284,
1057
+ 14.050003
1058
+ ]
1059
+ },
1060
+ {
1061
+ "content": "逆境相随。所以,面对任何事情,人们都应当做到未雨绸缪,这样在",
1062
+ "location": [
1063
+ 90,
1064
+ 172.23997,
1065
+ 415.3284,
1066
+ 14.050003
1067
+ ]
1068
+ },
1069
+ {
1070
+ "content": "遇到突发情况时才不至于手忙脚乱。在和平时期,要有居安思危的应",
1071
+ "location": [
1072
+ 90,
1073
+ 203.43999,
1074
+ 415.32837,
1075
+ 14.050003
1076
+ ]
1077
+ },
1078
+ {
1079
+ "content": "变措施,在做好物质准备的同时,思想上还要常守不虞之戒,牢记失",
1080
+ "location": [
1081
+ 90,
1082
+ 234.64,
1083
+ 415.3284,
1084
+ 14.050003
1085
+ ]
1086
+ },
1087
+ {
1088
+ "content": "戒的教训,只有做到居安思危,才能有备无患,防患于未然。",
1089
+ "location": [
1090
+ 90,
1091
+ 265.84003,
1092
+ 378.0035,
1093
+ 14.049988
1094
+ ]
1095
+ }
1096
+ ],
1097
+ "tagId": null
1098
+ }
1099
+ }
1100
+ ],
1101
+ "code": "0",
1102
+ "msg": null,
1103
+ "traceId": null
1104
+ }
937
1105
  if (res.data.code == 0) {
938
1106
  // tagIds 会按照gpt识别的生成有序的数组,前端直接按照下标的顺序取就可以了
939
1107
  // 缓存拿到的所有数据