|
@@ -77,7 +77,7 @@
|
|
|
]"
|
|
|
></div> -->
|
|
|
<img
|
|
|
- v-if="!playStatus && items.strokes_image_url"
|
|
|
+ v-if="!playStatus && items && items.strokes_image_url"
|
|
|
:src="items.strokes_image_url"
|
|
|
alt=""
|
|
|
/>
|
|
@@ -111,7 +111,6 @@
|
|
|
:colIndex="activeColIndex"
|
|
|
:closeifFreeShow="closeifFreeShow"
|
|
|
:TaskModel="TaskModel"
|
|
|
- :writeList="curQue.Bookanswer.writeModel"
|
|
|
@changeCurQue="changeCurQue"
|
|
|
@deleteWriteRecord="deleteWriteRecord"
|
|
|
/>
|
|
@@ -211,6 +210,30 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ // 处理数据
|
|
|
+ handleAnswerData() {
|
|
|
+ let _this = this;
|
|
|
+ _this.curQue.option.forEach((item, index) => {
|
|
|
+ let con = item.con;
|
|
|
+ let arr = [];
|
|
|
+ if (
|
|
|
+ _this.curQue.Bookanswer.writeModel &&
|
|
|
+ _this.curQue.Bookanswer.writeModel[con]
|
|
|
+ ) {
|
|
|
+ arr = _this.curQue.Bookanswer.writeModel[con].map((it) => {
|
|
|
+ if (it && it.strokes_content) {
|
|
|
+ it.history = JSON.parse(it.strokes_content);
|
|
|
+ }
|
|
|
+
|
|
|
+ return it;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ arr = [null, null, null, null, null, null];
|
|
|
+ }
|
|
|
+ item.imgarr = arr;
|
|
|
+ });
|
|
|
+ console.log(_this.curQue.option);
|
|
|
+ },
|
|
|
changePraShow() {
|
|
|
this.isPraShow = false;
|
|
|
this.ifFreeShow = false;
|
|
@@ -239,35 +262,39 @@ export default {
|
|
|
this.isPraShow = true;
|
|
|
},
|
|
|
closeifFreeShow(data, rowIndex, colIndex) {
|
|
|
- this.curQue.option[rowIndex].imgarr[colIndex - 1] = data;
|
|
|
+ this.curQue.option[rowIndex].imgarr[colIndex] = data;
|
|
|
this.ifFreeShow = false;
|
|
|
this.freeWrite(data, rowIndex, colIndex);
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
freeWrite(imgUrl, index, indexs) {
|
|
|
- this.ifFreeShow = true;
|
|
|
- this.activeIndex = index;
|
|
|
- this.activeColIndex = indexs;
|
|
|
- this.currentHz = this.curQue.option[index].con;
|
|
|
- this.currenHzData = imgUrl;
|
|
|
+ let _this = this;
|
|
|
+ if (_this.TaskModel == "ANSWER" && !imgUrl) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ _this.ifFreeShow = true;
|
|
|
+ _this.activeIndex = index;
|
|
|
+ _this.activeColIndex = indexs;
|
|
|
+ _this.currentHz = _this.curQue.option[index].con;
|
|
|
+ _this.currenHzData = imgUrl;
|
|
|
//console.log(this.currenHzData);
|
|
|
},
|
|
|
//删除记录
|
|
|
deleteWriteRecord(rowIndex, colIndex) {
|
|
|
this.$set(this.curQue.option[rowIndex].imgarr, colIndex, {});
|
|
|
},
|
|
|
- changeCurQue(answer, rowIndex) {
|
|
|
+ changeCurQue(answer, colIndex) {
|
|
|
if (answer) {
|
|
|
let writeModel = this.curQue.Bookanswer.writeModel;
|
|
|
let hz = answer.hz;
|
|
|
if (writeModel.hasOwnProperty(hz)) {
|
|
|
- writeModel[hz][rowIndex] = answer;
|
|
|
+ writeModel[hz][colIndex] = answer;
|
|
|
} else {
|
|
|
writeModel[hz] = [];
|
|
|
for (let i = 0; i < 6; i++) {
|
|
|
writeModel[hz].push(null);
|
|
|
}
|
|
|
- writeModel[hz][0] = answer;
|
|
|
+ writeModel[hz][colIndex] = answer;
|
|
|
}
|
|
|
console.log(this.curQue.Bookanswer);
|
|
|
}
|
|
@@ -279,7 +306,11 @@ export default {
|
|
|
if (!_this.curQue.Bookanswer) {
|
|
|
_this.curQue.Bookanswer = JSON.parse(JSON.stringify(_this.userAnswer));
|
|
|
}
|
|
|
- this.handleData();
|
|
|
+ if (_this.TaskModel != "ANSWER") {
|
|
|
+ _this.handleData();
|
|
|
+ } else {
|
|
|
+ _this.handleAnswerData();
|
|
|
+ }
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {},
|