|
@@ -8,7 +8,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<el-row :gutter="20" style="margin-bottom:10px;">
|
|
<el-row :gutter="20" style="margin-bottom:10px;">
|
|
|
<el-col :span="18">
|
|
<el-col :span="18">
|
|
|
- <el-steps :active="stepNum" simple>
|
|
|
|
|
|
|
+ <el-steps :active="stepNum" simple >
|
|
|
<el-step title="定标准点" icon="el-icon-edit"></el-step>
|
|
<el-step title="定标准点" icon="el-icon-edit"></el-step>
|
|
|
<el-step title="考号区域" icon="el-icon-upload"></el-step>
|
|
<el-step title="考号区域" icon="el-icon-upload"></el-step>
|
|
|
<el-step title="客观题" icon="el-icon-picture"></el-step>
|
|
<el-step title="客观题" icon="el-icon-picture"></el-step>
|
|
@@ -16,7 +16,7 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
|
<el-button size="mini" type="primary" v-if="stepNum > 1" @click="stepNum-=1">上一步</el-button>
|
|
<el-button size="mini" type="primary" v-if="stepNum > 1" @click="stepNum-=1">上一步</el-button>
|
|
|
- <el-button size="mini" type="primary" v-if="stepNum < 3" @click="stepNum+=1">下一步</el-button>
|
|
|
|
|
|
|
+ <el-button size="mini" type="primary" v-if="stepNum < 3" @click="nextStep">下一步</el-button>
|
|
|
<el-button size="mini" type="success" v-if="stepNum == 3" @click="updatePaperRecInfo">保存</el-button>
|
|
<el-button size="mini" type="success" v-if="stepNum == 3" @click="updatePaperRecInfo">保存</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -26,7 +26,7 @@
|
|
|
<img width="100%" :src="curPaperImg" />
|
|
<img width="100%" :src="curPaperImg" />
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="14" style="background:#fff;">
|
|
|
|
|
|
|
+ <el-col :span="14" style="background:#ccc;">
|
|
|
<img id="image" ref="image" width="100%" :src="curPaperImg" />
|
|
<img id="image" ref="image" width="100%" :src="curPaperImg" />
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
@@ -35,25 +35,28 @@
|
|
|
<div slot="header" class="clearfix">
|
|
<div slot="header" class="clearfix">
|
|
|
<span>选取标准点</span>
|
|
<span>选取标准点</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-image height="60px" width="100%" :src="stdPointImg" :preview-src-list="[stdPointImg]"></el-image>
|
|
|
|
|
|
|
+ 阈值:<el-input-number size="mini" v-model="stdThreshVal" :min="1" :max="5" label="描述文字"></el-input-number>
|
|
|
|
|
+ <el-image style="margin-top:20px 0px;border:1px solid #ccc;" height="60px" width="100%" :src="stdPointImg" :preview-src-list="[stdPointImg]"></el-image>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
<el-card class="box-card" v-if="stepNum==2">
|
|
<el-card class="box-card" v-if="stepNum==2">
|
|
|
<div slot="header" class="clearfix">
|
|
<div slot="header" class="clearfix">
|
|
|
<span>标注考号区域</span>
|
|
<span>标注考号区域</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div style="margin-bottom:10px;">
|
|
|
|
|
- <i class="el-icon-edit" @click="editKhCard(snoImg,curPaperId)"
|
|
|
|
|
- style="float:right;color:blue;margin-right:20px;cursor: pointer;"></i>
|
|
|
|
|
- <div class="clear"></div>
|
|
|
|
|
|
|
+ <div v-if="snoImg">
|
|
|
|
|
+ <div style="margin-bottom:10px;">
|
|
|
|
|
+ <i class="el-icon-edit" @click="editKhCard(snoImg,curPaperId)"
|
|
|
|
|
+ style="float:right;color:blue;margin-right:20px;cursor: pointer;"></i>
|
|
|
|
|
+ <div class="clear"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-image style="margin-bottom:20px 0px;border:1px solid #ccc;" height="60px" width="100%" :src="snoImg" :preview-src-list="[snoImg]"></el-image>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-image height="60px" width="100%" :src="snoImg" :preview-src-list="[snoImg]"></el-image>
|
|
|
|
|
</el-card>
|
|
</el-card>
|
|
|
<el-card class="box-card" v-if="stepNum==3">
|
|
<el-card class="box-card" v-if="stepNum==3">
|
|
|
<div slot="header" class="clearfix">
|
|
<div slot="header" class="clearfix">
|
|
|
<span>标注客观题</span>
|
|
<span>标注客观题</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div v-for="(item,index) in ansCardImgList">
|
|
|
|
|
- <div style="margin-bottom:10px;">
|
|
|
|
|
|
|
+ <div v-if="ansCardImgList.length>0" v-for="(item,index) in ansCardImgList">
|
|
|
|
|
+ <div style="margin-bottom:10px;" >
|
|
|
<i class="el-icon-delete" @click="ansCardImgList.splice(index,1)"
|
|
<i class="el-icon-delete" @click="ansCardImgList.splice(index,1)"
|
|
|
style="float:right;color:red;cursor: pointer;"></i>
|
|
style="float:right;color:red;cursor: pointer;"></i>
|
|
|
<i class="el-icon-edit" @click="editAnsCard(item,curPaperId)"
|
|
<i class="el-icon-edit" @click="editAnsCard(item,curPaperId)"
|
|
@@ -62,7 +65,6 @@
|
|
|
</div>
|
|
</div>
|
|
|
<el-image style="margin-bottom:20px 0px;border:1px solid #ccc;" width="100%" :src="item"
|
|
<el-image style="margin-bottom:20px 0px;border:1px solid #ccc;" width="100%" :src="item"
|
|
|
:preview-src-list="[item]"></el-image>
|
|
:preview-src-list="[item]"></el-image>
|
|
|
-
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</div>
|
|
</div>
|
|
@@ -245,7 +247,7 @@
|
|
|
open: false,
|
|
open: false,
|
|
|
doctorList: [],
|
|
doctorList: [],
|
|
|
rules: {},
|
|
rules: {},
|
|
|
- stepNum: 3,
|
|
|
|
|
|
|
+ stepNum: 1,
|
|
|
stdPointImg: "",
|
|
stdPointImg: "",
|
|
|
snoImg: "",
|
|
snoImg: "",
|
|
|
snoImgW:0,
|
|
snoImgW:0,
|
|
@@ -317,6 +319,7 @@
|
|
|
recCurAnsImg: "",
|
|
recCurAnsImg: "",
|
|
|
choiceType: 2,
|
|
choiceType: 2,
|
|
|
threshVal: 7,
|
|
threshVal: 7,
|
|
|
|
|
+ stdThreshVal:3,
|
|
|
stdChoiceList: [],
|
|
stdChoiceList: [],
|
|
|
myCropper: null,
|
|
myCropper: null,
|
|
|
myAnsCropper: null,
|
|
myAnsCropper: null,
|
|
@@ -327,7 +330,10 @@
|
|
|
pageSize:10,
|
|
pageSize:10,
|
|
|
khType:1,
|
|
khType:1,
|
|
|
khLength:6,
|
|
khLength:6,
|
|
|
- khOpen:false
|
|
|
|
|
|
|
+ khOpen:false,
|
|
|
|
|
+ stdPoints:null,
|
|
|
|
|
+ khPointsCrop:{},
|
|
|
|
|
+ ansPointsCrop:{}
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -370,8 +376,11 @@
|
|
|
this.$api.getPaperInfo(params).then((res) => {
|
|
this.$api.getPaperInfo(params).then((res) => {
|
|
|
let imgs = JSON.parse(res.data.data.imgs);
|
|
let imgs = JSON.parse(res.data.data.imgs);
|
|
|
this.curPaperImg = imgs[0];
|
|
this.curPaperImg = imgs[0];
|
|
|
- this.ansCardImgList = [res.data.data.ansPoints];
|
|
|
|
|
|
|
+ this.stdPointImg = res.data.data.stdPointsImg;
|
|
|
|
|
+ this.stdPoints = res.data.data.stdPoints?JSON.parse(res.data.data.stdPoints):{};
|
|
|
this.snoImg = res.data.data.khPoints;
|
|
this.snoImg = res.data.data.khPoints;
|
|
|
|
|
+ this.khPointsCrop = res.data.data.khPointsCrop?JSON.parse(res.data.data.khPointsCrop):{};
|
|
|
|
|
+ this.ansPointsCrop = res.data.data.ansPointsCrop?[res.data.data.ansPointsCrop]:[];
|
|
|
this.khType = res.data.data.khType;
|
|
this.khType = res.data.data.khType;
|
|
|
this.khLength = res.data.data.khLength;
|
|
this.khLength = res.data.data.khLength;
|
|
|
this.initCropper();
|
|
this.initCropper();
|
|
@@ -411,6 +420,10 @@
|
|
|
this.initAnsCropper();
|
|
this.initAnsCropper();
|
|
|
},
|
|
},
|
|
|
updatePaperRecInfo() {
|
|
updatePaperRecInfo() {
|
|
|
|
|
+ if (!this.stdPointImg) {
|
|
|
|
|
+ this.msgError("请标注标准点!")
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
if (!this.snoImg) {
|
|
if (!this.snoImg) {
|
|
|
this.msgError("请标注考号区域!")
|
|
this.msgError("请标注考号区域!")
|
|
|
return
|
|
return
|
|
@@ -423,11 +436,12 @@
|
|
|
id: this.$route.query.id,
|
|
id: this.$route.query.id,
|
|
|
stdQnoPoints: this.stdQnoPoints,
|
|
stdQnoPoints: this.stdQnoPoints,
|
|
|
khPoints: this.snoImg,
|
|
khPoints: this.snoImg,
|
|
|
- ansPoints: this.curAnsImg,
|
|
|
|
|
|
|
+ ansPoints: this.ansCardImgList,
|
|
|
stdChoices: this.stdChoiceList,
|
|
stdChoices: this.stdChoiceList,
|
|
|
stdQueList:this.stdQueList,
|
|
stdQueList:this.stdQueList,
|
|
|
khType:this.khType,
|
|
khType:this.khType,
|
|
|
- khLength:this.khLength
|
|
|
|
|
|
|
+ khLength:this.khLength,
|
|
|
|
|
+ ansPointsCrop:this.ansPointsCrop
|
|
|
}
|
|
}
|
|
|
this.$api.updatePaperInfo(params).then(res => {
|
|
this.$api.updatePaperInfo(params).then(res => {
|
|
|
this.msgSuccess("成功!");
|
|
this.msgSuccess("成功!");
|
|
@@ -473,25 +487,56 @@
|
|
|
cropstart: function (e) {},
|
|
cropstart: function (e) {},
|
|
|
cropend: function (e) {
|
|
cropend: function (e) {
|
|
|
if (that.dragMode == "crop") {
|
|
if (that.dragMode == "crop") {
|
|
|
- let cropData = that.myCropper.getCropBoxData();
|
|
|
|
|
- console.log(cropData,333333333333)
|
|
|
|
|
|
|
+ let cropData = this.cropper.getData();
|
|
|
let cropperImgData = this.cropper.getCroppedCanvas({
|
|
let cropperImgData = this.cropper.getCroppedCanvas({
|
|
|
width: 1310
|
|
width: 1310
|
|
|
}).toDataURL("image/jpeg");
|
|
}).toDataURL("image/jpeg");
|
|
|
|
|
+ // 标准点
|
|
|
if (that.stepNum == 1) {
|
|
if (that.stepNum == 1) {
|
|
|
that.stdPointImg = cropperImgData;
|
|
that.stdPointImg = cropperImgData;
|
|
|
|
|
+ that.$api.tryRecArray({
|
|
|
|
|
+ sx: cropData.x,
|
|
|
|
|
+ sy: cropData.y,
|
|
|
|
|
+ yz: that.stdThreshVal,
|
|
|
|
|
+ img: that.stdPointImg,
|
|
|
|
|
+ khLength: 15
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ let oneRect = res.data.data.oneRect;
|
|
|
|
|
+ let b64img = res.data.data.img;
|
|
|
|
|
+ that.stdPointImg = b64img;
|
|
|
|
|
+ that.stdPoints = oneRect;
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
+ // 考号区域
|
|
|
if (that.stepNum == 2) {
|
|
if (that.stepNum == 2) {
|
|
|
|
|
+ let khPointsCrop = {
|
|
|
|
|
+ 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;
|
|
|
that.snoImg = cropperImgData;
|
|
that.snoImg = cropperImgData;
|
|
|
that.snoImgW = cropData.width;
|
|
that.snoImgW = cropData.width;
|
|
|
that.snoImgH = cropData.height;
|
|
that.snoImgH = cropData.height;
|
|
|
- console.log(that.snoImgW,that.snoImgH,33333333333333)
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ // 客观题
|
|
|
if (that.stepNum == 3) {
|
|
if (that.stepNum == 3) {
|
|
|
|
|
+ let khPointsCrop = {
|
|
|
|
|
+ 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);
|
|
that.ansCardImgList.push(cropperImgData);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
that.myCropper.clear()
|
|
that.myCropper.clear()
|
|
|
|
|
+ this.cropper.clear()
|
|
|
},
|
|
},
|
|
|
crop() {
|
|
crop() {
|
|
|
let cropData = that.myCropper.getCropBoxData();
|
|
let cropData = that.myCropper.getCropBoxData();
|
|
@@ -519,9 +564,6 @@
|
|
|
cropBoxResizable: true,
|
|
cropBoxResizable: true,
|
|
|
movable: true,
|
|
movable: true,
|
|
|
ready: function () {
|
|
ready: function () {
|
|
|
- // self.croppable = true;
|
|
|
|
|
- // this.cropperCutImg = this.cropper.getCroppedCanvas({ width: 1310 }).toDataURL("image/jpeg")
|
|
|
|
|
- // console.log(this.cropperCutImg,333333333)
|
|
|
|
|
document.addEventListener('keydown', function (e) {
|
|
document.addEventListener('keydown', function (e) {
|
|
|
if (e.keyCode == 32) {
|
|
if (e.keyCode == 32) {
|
|
|
that.myAnsCropper.setDragMode("move");
|
|
that.myAnsCropper.setDragMode("move");
|
|
@@ -614,6 +656,48 @@
|
|
|
},
|
|
},
|
|
|
handleCurrentChange(val){
|
|
handleCurrentChange(val){
|
|
|
this.currentPage=val
|
|
this.currentPage=val
|
|
|
|
|
+ },
|
|
|
|
|
+ nextStep(){
|
|
|
|
|
+ if(this.stepNum==1&&!this.stdPointImg){
|
|
|
|
|
+ this.msgError("请框选标准点,一般建议框选试卷标题!");
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if(this.stepNum==2&&!this.snoImg){
|
|
|
|
|
+ this.msgError("请框选考号区域!");
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // 标准点
|
|
|
|
|
+ if(this.stepNum==1){
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ id: this.$route.query.id,
|
|
|
|
|
+ stdPointsImg: this.stdPointImg,
|
|
|
|
|
+ stdPoints:this.stdPoints
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$api.updatePaperInfo(params).then(res => {
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ // 考号
|
|
|
|
|
+ if(this.stepNum==2){
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ id: this.$route.query.id,
|
|
|
|
|
+ khPoints:this.snoImg,
|
|
|
|
|
+ khPointsCrop:this.khPointsCrop
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$api.updatePaperInfo(params).then(res => {
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ // 客观题
|
|
|
|
|
+ if(this.stepNum==2){
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ id: this.$route.query.id,
|
|
|
|
|
+ ansPoints:this.ansCardImgList,
|
|
|
|
|
+ khPointsCrop:this.khPointsCrop
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$api.updatePaperInfo(params).then(res => {
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ this.stepNum += 1;
|
|
|
|
|
+ this.getData();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -623,7 +707,7 @@
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.getData();
|
|
this.getData();
|
|
|
// this.initCropper();
|
|
// this.initCropper();
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|