|
@@ -29,6 +29,10 @@ export default {
|
|
|
type: Number,
|
|
|
default: 0
|
|
|
},
|
|
|
+ quesType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -253,7 +257,8 @@ export default {
|
|
|
y: em.offsetY,
|
|
|
w: mark.w - (em.offsetX - sX),
|
|
|
h: mark.h - (em.offsetY - sY),
|
|
|
- addIndex: mark.addIndex
|
|
|
+ addIndex: mark.addIndex,
|
|
|
+ type: mark.type,
|
|
|
}
|
|
|
break;
|
|
|
case 2:
|
|
@@ -262,7 +267,8 @@ export default {
|
|
|
y: mark.y + (em.offsetY - sY),
|
|
|
w: mark.w + (em.offsetX - sX),
|
|
|
h: mark.h - (em.offsetY - sY),
|
|
|
- addIndex: mark.addIndex
|
|
|
+ addIndex: mark.addIndex,
|
|
|
+ type: mark.type,
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
@@ -271,7 +277,8 @@ export default {
|
|
|
y: mark.y,
|
|
|
w: mark.w - (em.offsetX - sX),
|
|
|
h: mark.h + (em.offsetY - sY),
|
|
|
- addIndex: mark.addIndex
|
|
|
+ addIndex: mark.addIndex,
|
|
|
+ type: mark.type,
|
|
|
}
|
|
|
break;
|
|
|
case 4:
|
|
@@ -280,7 +287,8 @@ export default {
|
|
|
y: mark.y,
|
|
|
w: mark.w + (em.offsetX - sX),
|
|
|
h: mark.h + (em.offsetY - sY),
|
|
|
- addIndex: mark.addIndex
|
|
|
+ addIndex: mark.addIndex,
|
|
|
+ type: mark.type,
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -351,7 +359,9 @@ export default {
|
|
|
if (start && Math.abs(eu.offsetX - sX) > 10 && Math.abs(eu.offsetY - sY) > 10) {
|
|
|
// 改变矩形数组
|
|
|
let frame = {
|
|
|
- x: sX, y: sY, w: eu.offsetX - sX, h: eu.offsetY - sY, addIndex: that.cavList.length - that.list.length + 1 + that.quesNum
|
|
|
+ x: sX, y: sY, w: eu.offsetX - sX, h: eu.offsetY - sY,
|
|
|
+ addIndex: that.cavList.length - that.list.length + 1 + that.quesNum,
|
|
|
+ type: that.quesType,
|
|
|
};
|
|
|
that.cavList.push(frame);
|
|
|
// 重新绘制
|
|
@@ -375,7 +385,9 @@ export default {
|
|
|
if (start && Math.abs(eo.offsetX - sX) > 10 && Math.abs(eo.offsetY - sY) > 10) {
|
|
|
// 改变矩形数组
|
|
|
let frame = {
|
|
|
- x: sX, y: sY, w: eo.offsetX - sX, h: eo.offsetY - sY, addIndex: that.cavList.length - that.list.length + 1 + that.quesNum
|
|
|
+ x: sX, y: sY, w: eo.offsetX - sX, h: eo.offsetY - sY,
|
|
|
+ addIndex: that.cavList.length - that.list.length + 1 + that.quesNum,
|
|
|
+ type: that.quesType,
|
|
|
};
|
|
|
that.cavList.push(frame);
|
|
|
// 重新绘制
|
|
@@ -441,7 +453,8 @@ export default {
|
|
|
y: mark.y + (em.offsetY - sY),
|
|
|
w: mark.w,
|
|
|
h: mark.h,
|
|
|
- addIndex: mark.addIndex
|
|
|
+ addIndex: mark.addIndex,
|
|
|
+ type: mark.type,
|
|
|
}
|
|
|
// 更新矩形数组中选中矩形的数据
|
|
|
that.cavList.splice(i, 1, iframe);
|
|
@@ -535,7 +548,7 @@ export default {
|
|
|
this.contentText.rect(value.x, value.y, value.w, value.h);
|
|
|
this.contentText.stroke();
|
|
|
this.contentText.fillStyle = 'blue'
|
|
|
- this.contentText.fillText(`${this.$t('answerSheet.tip2')}${this.editQuesIndex != -1 ? this.editQuesIndex + 1 : (value.qIndex !== undefined ? value.qIndex + 1 : value.addIndex)}${this.$t('answerSheet.tip14')}`, value.x + 5, value.y + 20)
|
|
|
+ this.contentText.fillText(`${this.$t('answerSheet.tip2')}${this.editQuesIndex != -1 ? this.editQuesIndex + 1 : (value.qIndex !== undefined ? value.qIndex + 1 : value.addIndex)}${this.$t('answerSheet.tip14')}(${this.$t(`evaluation.${value.type}`)})`, value.x + 5, value.y + 20)
|
|
|
}
|
|
|
});
|
|
|
// 绘制已选中部分
|
|
@@ -580,7 +593,7 @@ export default {
|
|
|
this.contentText.fillStyle = "red";
|
|
|
this.contentText.fill();// 画终点实心圆
|
|
|
this.contentText.stroke();
|
|
|
- this.contentText.fillText(`${this.$t('answerSheet.tip2')}${this.editQuesIndex != -1 ? this.editQuesIndex + 1 : (value.qIndex !== undefined ? value.qIndex + 1 : value.addIndex)}${this.$t('answerSheet.tip14')}`, value.x + 5, value.y + 20)
|
|
|
+ this.contentText.fillText(`${this.$t('answerSheet.tip2')}${this.editQuesIndex != -1 ? this.editQuesIndex + 1 : (value.qIndex !== undefined ? value.qIndex + 1 : value.addIndex)}${this.$t('answerSheet.tip14')}(${this.$t(`evaluation.${value.type}`)})`, value.x + 5, value.y + 20)
|
|
|
}
|
|
|
})
|
|
|
}
|