askbot-dragon 1.3.87 → 1.3.89
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
package/public/index.html
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<script src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/pdfJS2.1.266/pdf.min.js" integrity="sha512-1VjCQ9oENTPqqDCs6xQAk6ETB/jbCPvaOPI2z3Q+bWxTudBP7aTJZI3eB+mSbVvth0W2LQL1jePGkAWa79zr5Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
37
37
|
<script src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/pdfJS2.1.266/pdf.worker.min.js" integrity="sha512-14hvtl/LxmtX9F2tsqmOUveDlKql0bm7lR5ua+J+ddLuhoXCrOfG8aD/WJejCtLLvnjcEhX/XCuOyoTZv4Xq4A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
38
38
|
<script src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/pdfJS2.1.266/pdf_viewer.js" integrity="sha512-/Kuwn901frjpfp2NMgB9S/LEtm+ilDzwVy/iS8MlY0BeIwkvtjGTxnjY8u+fn8QyDxS23OLJ+M2g++W/zsb0nw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
39
|
-
<link rel="stylesheet" href="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/pdfJS2.1.266/pdf_viewer.css"
|
|
39
|
+
<link rel="stylesheet" href="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/pdfJS2.1.266/pdf_viewer.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
|
40
40
|
<!-- hammer.js -->
|
|
41
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>
|
|
@@ -174,10 +174,12 @@ export default {
|
|
|
174
174
|
}
|
|
175
175
|
this.pageSize = pageSize
|
|
176
176
|
// 创建内容绘制区,并设置大小
|
|
177
|
-
this.contentView.style.width = `${pageSize.width}px`;
|
|
178
|
-
this.contentView.style.height = `${(this.totalPageCount * (pageSize.height + this.PAGE_INTVERVAL)
|
|
179
|
-
this.contentView.style.margin = '0
|
|
177
|
+
this.contentView.style.width = `${pageSize.width * this.$refs.pdfView.clientWidth / this.pageSize.width}px`;
|
|
178
|
+
this.contentView.style.height = `${(this.totalPageCount * (pageSize.height + this.PAGE_INTVERVAL) * (this.$refs.pdfView.clientWidth / this.pageSize.width)) + this.PAGE_INTVERVAL}px`;
|
|
179
|
+
this.contentView.style.margin = '0'
|
|
180
180
|
this.contentView.style.position = 'relative'
|
|
181
|
+
this.contentView.style.paddingBottom = '60px'
|
|
182
|
+
|
|
181
183
|
// contentView.style.overflowY = 'auto'
|
|
182
184
|
this.$refs.pdfView.appendChild(this.contentView);
|
|
183
185
|
this.renderPages(pageIndex)
|
|
@@ -243,8 +245,8 @@ export default {
|
|
|
243
245
|
let div = document.createElement('div')
|
|
244
246
|
div.style.position = 'absolute';
|
|
245
247
|
div.style.left = postionArr[0] * this.scale + 'px',
|
|
246
|
-
|
|
247
|
-
|
|
248
|
+
// 后端返回的坐标有基线对齐的问题,top 值是后端算好(基线top - 文字高度),在此加上文字高度的 1/9 (大致比例)为实际展示出文字的top值
|
|
249
|
+
div.style.top = (postionArr[1] + postionArr[3] / 9) * this.scale + 'px'
|
|
248
250
|
div.style.height = postionArr[3] * this.scale + 'px';
|
|
249
251
|
div.style.width = postionArr[2] * this.scale + 'px'
|
|
250
252
|
div.style.backgroundColor = 'rgba(54, 106, 255, 0.3)'
|
|
@@ -666,6 +668,84 @@ export default {
|
|
|
666
668
|
this.contentView = document.createElement('div')
|
|
667
669
|
this.contentView.style.transformOrigin = '0px 0px 0px'
|
|
668
670
|
this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + value.join(',')).then(res =>{
|
|
671
|
+
res.data = {
|
|
672
|
+
"data": [
|
|
673
|
+
{
|
|
674
|
+
"id": "645899fb70573a6ead6f1a5d",
|
|
675
|
+
"knowledgeId": "645899efeeb0e86a5194af6c",
|
|
676
|
+
"mainId": "46b76aebe572421fa10e51f8f2086056",
|
|
677
|
+
"page": 3,
|
|
678
|
+
"total": 3,
|
|
679
|
+
"pageHeight": 841.9,
|
|
680
|
+
"pageWidth": 595.3,
|
|
681
|
+
"publicPageFileUrl": "https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/46b76aebe572421fa10e51f8f2086056/2023/05/08/06/43/06/645899fa70573a6ead6f1a18/3.pdf",
|
|
682
|
+
"extractInfo": {
|
|
683
|
+
"location": [
|
|
684
|
+
73.7,
|
|
685
|
+
166.401,
|
|
686
|
+
148.05,
|
|
687
|
+
12
|
|
688
|
+
],
|
|
689
|
+
"content": "(1) 分批做好用膳安排; ",
|
|
690
|
+
"lines": [
|
|
691
|
+
{
|
|
692
|
+
"content": "(1) 分批做好用膳安排; ",
|
|
693
|
+
"location": [
|
|
694
|
+
73.7,
|
|
695
|
+
166.401,
|
|
696
|
+
148.05,
|
|
697
|
+
12
|
|
698
|
+
]
|
|
699
|
+
}
|
|
700
|
+
],
|
|
701
|
+
"tagId": null
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
"id": "645899fb70573a6ead6f1a62",
|
|
706
|
+
"knowledgeId": "645899efeeb0e86a5194af6c",
|
|
707
|
+
"mainId": "46b76aebe572421fa10e51f8f2086056",
|
|
708
|
+
"page": 3,
|
|
709
|
+
"total": 3,
|
|
710
|
+
"pageHeight": 841.9,
|
|
711
|
+
"pageWidth": 595.3,
|
|
712
|
+
"publicPageFileUrl": "https://askbot-pdf-all.oss-cn-zhangjiakou.aliyuncs.com/46b76aebe572421fa10e51f8f2086056/2023/05/08/06/43/06/645899fa70573a6ead6f1a18/3.pdf",
|
|
713
|
+
"extractInfo": {
|
|
714
|
+
"location": [
|
|
715
|
+
73.7,
|
|
716
|
+
316.401,
|
|
717
|
+
464.87012,
|
|
718
|
+
37
|
|
719
|
+
],
|
|
720
|
+
"content": "(1) 留意开铺、关铺过程摆货、收货的现场情况,防止因松懈而导致失物或错误运作; ",
|
|
721
|
+
"lines": [
|
|
722
|
+
{
|
|
723
|
+
"content": "(1) 留意开铺、关铺过程摆货、收货的现场情况,防止因松懈而导致失物或错误运",
|
|
724
|
+
"location": [
|
|
725
|
+
73.7,
|
|
726
|
+
316.401,
|
|
727
|
+
464.87012,
|
|
728
|
+
12
|
|
729
|
+
]
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"content": "作; ",
|
|
733
|
+
"location": [
|
|
734
|
+
107.75,
|
|
735
|
+
341.401,
|
|
736
|
+
30,
|
|
737
|
+
12
|
|
738
|
+
]
|
|
739
|
+
}
|
|
740
|
+
],
|
|
741
|
+
"tagId": null
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
],
|
|
745
|
+
"code": "0",
|
|
746
|
+
"msg": null,
|
|
747
|
+
"traceId": null
|
|
748
|
+
}
|
|
669
749
|
if (res.data.code == 0) {
|
|
670
750
|
// tagIds 会按照gpt识别的生成有序的数组,前端直接按照下标的顺序取就可以了
|
|
671
751
|
// 缓存拿到的所有数据
|
|
@@ -54,19 +54,19 @@ class MyUploadAdapter {
|
|
|
54
54
|
);
|
|
55
55
|
res.then(resp=>{
|
|
56
56
|
imgInfo.url = ossFileUrl(ossConfig, resp.name)
|
|
57
|
-
let root = this.editor.model.document.getRoot()
|
|
58
|
-
let children = root.getChildren()
|
|
59
|
-
for(let child of children){
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
57
|
+
// let root = this.editor.model.document.getRoot()
|
|
58
|
+
// let children = root.getChildren()
|
|
59
|
+
// for(let child of children){
|
|
60
|
+
// for (let index = 0; index < child._children._nodes.length; index++) {
|
|
61
|
+
// if(child._children._nodes[index].name == 'askComponentPlaceholderContainer'){
|
|
62
|
+
// if(child._children._nodes[index]._children._nodes[0]) {
|
|
63
|
+
// this.editor.model.change(writer => {
|
|
64
|
+
// writer.remove(child._children._nodes[index]._children._nodes[0]);
|
|
65
|
+
// });
|
|
66
|
+
// }
|
|
67
|
+
// }
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
70
|
let command = this.editor.commands.get("insertAskComponent");
|
|
71
71
|
command.execute({
|
|
72
72
|
tag: "img",
|