|
@@ -5,7 +5,7 @@
|
|
|
<div
|
|
|
:class="[index == curLeftIndex ? 'cur' : '', 'paperBox']"
|
|
|
v-for="(img, index) in leftImgs"
|
|
|
- :key="index+'paper'"
|
|
|
+ :key="index + 'paper'"
|
|
|
@click="leftClick(index)"
|
|
|
>
|
|
|
<span class="paper">
|
|
@@ -140,7 +140,7 @@
|
|
|
<li
|
|
|
:class="[curBoxIndex == 'answerBox' ? ' cur' : '', 'cutBox']"
|
|
|
v-for="(element, index) in answerList"
|
|
|
- :key="index+'answer'"
|
|
|
+ :key="index + 'answer'"
|
|
|
@click="cutBoxClick('answerBox')"
|
|
|
>
|
|
|
<!-- <el-input
|
|
@@ -154,7 +154,7 @@
|
|
|
<div
|
|
|
style="position: relative"
|
|
|
v-for="(item, index2) in element.ele"
|
|
|
- :key="index2+'anbk'"
|
|
|
+ :key="index2 + 'anbk'"
|
|
|
>
|
|
|
<!-- <el-input
|
|
|
v-show="curOpt != 'fast'"
|
|
@@ -197,7 +197,7 @@
|
|
|
<li
|
|
|
:class="[index == curBoxIndex ? ' cur' : '', 'cutBox']"
|
|
|
v-for="(element, index) in list"
|
|
|
- :key="index+'cut'"
|
|
|
+ :key="index + 'cut'"
|
|
|
@click="cutBoxClick(index)"
|
|
|
>
|
|
|
<el-input
|
|
@@ -216,7 +216,7 @@
|
|
|
<div
|
|
|
style="position: relative"
|
|
|
v-for="(item, index2) in element.ele"
|
|
|
- :key="index2+'cutbk'"
|
|
|
+ :key="index2 + 'cutbk'"
|
|
|
>
|
|
|
<el-input
|
|
|
v-show="curOpt != 'fast' && curOpt != 'answer'"
|
|
@@ -544,6 +544,7 @@ export default {
|
|
|
if (ques[ques.length - 1].ele.length <= 0) {
|
|
|
ques.pop();
|
|
|
}
|
|
|
+ debugger
|
|
|
var req = {
|
|
|
id: this.paperInfo.id,
|
|
|
pid: this.paperInfo.id,
|
|
@@ -557,7 +558,7 @@ export default {
|
|
|
page: i2.page,
|
|
|
qno: i.order + "",
|
|
|
sqno: i2.subNum,
|
|
|
- imgtype: 0,
|
|
|
+ imgtype: i2.imgType,
|
|
|
points: [i2.point],
|
|
|
imgs: [],
|
|
|
};
|
|
@@ -685,6 +686,7 @@ export default {
|
|
|
} else {
|
|
|
// 添加单张截图
|
|
|
if (!that.isMaterial) {
|
|
|
+ debugger;
|
|
|
// 不是材料正常添加逻辑
|
|
|
if (that.curBoxIndex == "answerBox") {
|
|
|
that.addAnswerImg();
|
|
@@ -696,8 +698,17 @@ export default {
|
|
|
that.addAnswerImg();
|
|
|
that.curBoxIndex = "answerBox";
|
|
|
} else {
|
|
|
- that.list[that.curBoxIndex].ele = [];
|
|
|
- that.addImg();
|
|
|
+ if (
|
|
|
+ that.list[that.curBoxIndex].ele.every((item) => {
|
|
|
+ return item.imgType == 1;
|
|
|
+ })
|
|
|
+ ) {
|
|
|
+ console.log("hasMaterial");
|
|
|
+ that.addImg();
|
|
|
+ } else {
|
|
|
+ that.list[that.curBoxIndex].ele = [];
|
|
|
+ that.addImg();
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
if (that.curOpt == "answer") {
|
|
@@ -720,6 +731,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
+ debugger;
|
|
|
// 材料添加逻辑
|
|
|
if (that.list[that.curBoxIndex].ele.length > 0) {
|
|
|
that.addImg("material");
|
|
@@ -750,7 +762,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
addImg(ImgType) {
|
|
|
- var imgType = ImgType ? 1 : 0;
|
|
|
+ var imgType = ImgType ? 1 : 0; // 1 切割材料
|
|
|
let cropData = this.myCropper.getCropBoxData();
|
|
|
let standardPoint = this.paperInfo.points[0][0];
|
|
|
let point = {
|
|
@@ -760,6 +772,7 @@ export default {
|
|
|
h: cropData.height / this.imgSize,
|
|
|
};
|
|
|
if (imgType) {
|
|
|
+ // 切割材料
|
|
|
this.list[this.curBoxIndex].ele.unshift({
|
|
|
// subNum: this.list[this.curBoxIndex].ele.length + 1,
|
|
|
subNum: 1,
|
|
@@ -769,7 +782,9 @@ export default {
|
|
|
point: point,
|
|
|
imgType: imgType,
|
|
|
});
|
|
|
+ debugger;
|
|
|
} else {
|
|
|
+ // 正常切题
|
|
|
this.list[this.curBoxIndex].id = 0;
|
|
|
this.list[this.curBoxIndex].ele.push({
|
|
|
// subNum: this.list[this.curBoxIndex].ele.length + 1,
|
|
@@ -830,7 +845,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
if (!this.previewTop) {
|
|
|
- this.previewCss ={};
|
|
|
+ this.previewCss = {};
|
|
|
this.previewCss.transform = "scale(1.1)";
|
|
|
this.previewTop = "40%";
|
|
|
this.previewIMG = img;
|