|
@@ -41,6 +41,7 @@ class ComPDFAnnotationLayer {
|
|
|
scale,
|
|
|
pageIndex,
|
|
|
eventBus,
|
|
|
+ enableReply = true,
|
|
|
$t
|
|
|
}) {
|
|
|
this._cancelled = false;
|
|
@@ -72,6 +73,8 @@ class ComPDFAnnotationLayer {
|
|
|
this.onHandleAddSign = this.addSign.bind(this)
|
|
|
|
|
|
this.annotationStore.$t = $t
|
|
|
+
|
|
|
+ this.enableReply = enableReply
|
|
|
}
|
|
|
|
|
|
// 处理注释工具切换
|
|
@@ -377,6 +380,7 @@ class ComPDFAnnotationLayer {
|
|
|
this.renderContainer()
|
|
|
}
|
|
|
if (this.annotations && this.annotations.length) {
|
|
|
+ const enableReply = this.enableReply
|
|
|
for (let i = 0; i < this.annotations.length; i++) {
|
|
|
const annotation = this.annotations[i]
|
|
|
if (!annotation) continue
|
|
@@ -389,7 +393,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(markup)
|
|
|
} else if (annotation.type === 'line' && !annotation.isDelete) {
|
|
@@ -416,7 +421,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(line)
|
|
|
}
|
|
@@ -429,7 +435,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(shape)
|
|
|
} else if (annotation.type === 'ink' && !annotation.isDelete) {
|
|
@@ -440,7 +447,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(ink)
|
|
|
} else if (annotation.type === 'freetext' && !annotation.isDelete) {
|
|
@@ -451,7 +459,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(freetext)
|
|
|
}
|
|
@@ -463,7 +472,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(text)
|
|
|
}
|
|
@@ -476,7 +486,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(text)
|
|
|
}
|
|
@@ -687,6 +698,8 @@ class ComPDFAnnotationLayer {
|
|
|
if (!this.div) {
|
|
|
this.renderContainer()
|
|
|
}
|
|
|
+
|
|
|
+ const enableReply = this.enableReply
|
|
|
const markupType = ['highlight', 'underline', 'squiggly', 'strikeout']
|
|
|
if (markupType.includes(annotation.type)) {
|
|
|
const markup = new MarkupTextAnnotation({
|
|
@@ -696,7 +709,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(markup)
|
|
|
} else if (annotation.type === 'line' || annotation.type === 'arrow') {
|
|
@@ -708,7 +722,8 @@ class ComPDFAnnotationLayer {
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
show: true,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(line)
|
|
|
} else if (annotation.type === 'square' || annotation.type === 'circle') {
|
|
@@ -719,7 +734,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(shape)
|
|
|
} else if (annotation.type === 'ink' && !annotation.isDelete) {
|
|
@@ -730,7 +746,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(ink)
|
|
|
} else if (annotation.type === 'freetext' && !annotation.isDelete) {
|
|
@@ -742,7 +759,8 @@ class ComPDFAnnotationLayer {
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
layer: this,
|
|
|
- show
|
|
|
+ show,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(freetext)
|
|
|
} else if (annotation.type === 'text' && !annotation.isDelete) {
|
|
@@ -753,7 +771,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(text)
|
|
|
} else if ((annotation.type === 'stamp') && !annotation.isDelete) {
|
|
@@ -765,7 +784,8 @@ class ComPDFAnnotationLayer {
|
|
|
viewport: this.viewport,
|
|
|
scale: this.scale,
|
|
|
eventBus: this.eventBus,
|
|
|
- layer: this
|
|
|
+ layer: this,
|
|
|
+ enableReply
|
|
|
})
|
|
|
this.annotationsArray.push(text)
|
|
|
} else if (annotation.type === 'textfield' && !annotation.isDelete) {
|