|
|
@@ -217,7 +217,7 @@
|
|
|
</el-row>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="open = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="updatePaperRecInfo">保 存</el-button>
|
|
|
+ <el-button type="primary" @click="updatePaperScore">保 存</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</section>
|
|
|
@@ -380,6 +380,7 @@
|
|
|
this.stdPoints = res.data.data.stdPoints?JSON.parse(res.data.data.stdPoints):{};
|
|
|
this.snoImg = res.data.data.khPoints;
|
|
|
this.khPointsCrop = res.data.data.khPointsCrop?JSON.parse(res.data.data.khPointsCrop):{};
|
|
|
+ this.ansCardImgList = res.data.data.ansPoints?JSON.parse(res.data.data.ansPoints):[];
|
|
|
this.ansPointsCrop = res.data.data.ansPointsCrop?[res.data.data.ansPointsCrop]:[];
|
|
|
this.khType = res.data.data.khType;
|
|
|
this.khLength = res.data.data.khLength;
|
|
|
@@ -407,7 +408,7 @@
|
|
|
this.$api.getPaperInfo({id:curPaperId}).then((res) => {
|
|
|
let imgs = JSON.parse(res.data.data.imgs);
|
|
|
this.curPaperImg = imgs[0];
|
|
|
- this.ansCardImgList = [res.data.data.ansPoints];
|
|
|
+ this.ansCardImgList = res.data.data.ansPoints?JSON.parse(res.data.data.ansPoints):[];
|
|
|
this.snoImg = res.data.data.khPoints;
|
|
|
if(res.data.data.stdChoices){
|
|
|
this.stdChoiceList = JSON.parse(res.data.data.stdChoices);
|
|
|
@@ -449,6 +450,35 @@
|
|
|
this.open = false;
|
|
|
})
|
|
|
},
|
|
|
+ updatePaperScore() {
|
|
|
+ if (!this.stdPointImg) {
|
|
|
+ this.msgError("请标注标准点!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.snoImg) {
|
|
|
+ this.msgError("请标注考号区域!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!this.ansCardImgList.length) {
|
|
|
+ this.msgError("请标注客观题区域!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ id: this.$route.query.id,
|
|
|
+ stdQnoPoints: this.stdQnoPoints,
|
|
|
+ khPoints: this.snoImg,
|
|
|
+ ansPoints: this.ansCardImgList,
|
|
|
+ stdChoices: this.stdChoiceList,
|
|
|
+ stdQueList:this.stdQueList,
|
|
|
+ khType:this.khType,
|
|
|
+ khLength:this.khLength,
|
|
|
+ }
|
|
|
+ this.$api.updatePaperInfo(params).then(res => {
|
|
|
+ this.msgSuccess("成功!");
|
|
|
+ this.getData();
|
|
|
+ this.open = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
initCropper() {
|
|
|
let that = this;
|
|
|
that.myCropper = null;
|
|
|
@@ -495,8 +525,8 @@
|
|
|
if (that.stepNum == 1) {
|
|
|
that.stdPointImg = cropperImgData;
|
|
|
that.$api.tryRecArray({
|
|
|
- sx: cropData.x,
|
|
|
- sy: cropData.y,
|
|
|
+ sx:cropData.x,
|
|
|
+ sy:cropData.y,
|
|
|
yz: that.stdThreshVal,
|
|
|
img: that.stdPointImg,
|
|
|
khLength: 15
|
|
|
@@ -506,15 +536,16 @@
|
|
|
that.stdPointImg = b64img;
|
|
|
that.stdPoints = oneRect;
|
|
|
})
|
|
|
+ // that.stdPoints = {"x":cropData.x,"y":cropData.y,"w":cropData.width,"h":cropData.height};
|
|
|
}
|
|
|
// 考号区域
|
|
|
if (that.stepNum == 2) {
|
|
|
let khPointsCrop = {
|
|
|
- x:cropData.x,
|
|
|
- y:cropData.y,
|
|
|
+ x:cropData.x,y:cropData.y,
|
|
|
w:cropData.width,h:cropData.height
|
|
|
}
|
|
|
khPointsCrop["x"] = khPointsCrop["x"]-that.stdPoints["x"];
|
|
|
+
|
|
|
khPointsCrop["y"] = khPointsCrop["y"]-that.stdPoints["y"];
|
|
|
|
|
|
that.khPointsCrop = khPointsCrop;
|
|
|
@@ -525,12 +556,13 @@
|
|
|
// 客观题
|
|
|
if (that.stepNum == 3) {
|
|
|
let khPointsCrop = {
|
|
|
- x:cropData.x,
|
|
|
- y:cropData.y,
|
|
|
+ x:cropData.x,y:cropData.y,
|
|
|
w:cropData.width,h:cropData.height
|
|
|
}
|
|
|
+
|
|
|
khPointsCrop["x"] = khPointsCrop["x"]-that.stdPoints["x"];
|
|
|
khPointsCrop["y"] = khPointsCrop["y"]-that.stdPoints["y"];
|
|
|
+
|
|
|
that.ansPointsCrop = khPointsCrop;
|
|
|
that.ansCardImgList.push(cropperImgData);
|
|
|
}
|