|
@@ -16,7 +16,7 @@
|
|
|
/>
|
|
|
<div class="right-content">
|
|
|
<div class="right-strockred">
|
|
|
- <template v-if="!hasPlay && data.strokes_image_url">
|
|
|
+ <template v-if="!hasPlay && data && data.strokes_image_url">
|
|
|
<img class="img" :src="data.strokes_image_url" alt="" />
|
|
|
</template>
|
|
|
<FreeWriteQP
|
|
@@ -37,7 +37,10 @@
|
|
|
></a>
|
|
|
</div>
|
|
|
<ul class="nav-list">
|
|
|
- <li @click="play()" :class="currenHzData.history ? '' : 'disabled'">
|
|
|
+ <li
|
|
|
+ @click="play()"
|
|
|
+ :class="currenHzData && currenHzData.history ? '' : 'disabled'"
|
|
|
+ >
|
|
|
播放
|
|
|
</li>
|
|
|
<li
|
|
@@ -158,13 +161,22 @@ export default {
|
|
|
this.learn_mode = mode;
|
|
|
},
|
|
|
resetHuahua() {
|
|
|
- if (this.hasPlay) {
|
|
|
- this.$message.warning("请等待播放完成");
|
|
|
+ let _this = this;
|
|
|
+ if (_this.hasPlay) {
|
|
|
+ _this.$message.warning("请等待播放完成");
|
|
|
return;
|
|
|
}
|
|
|
- this.imgOrCans = false;
|
|
|
- this.$refs.esign.reset();
|
|
|
- this.data.strokes_image_url = "";
|
|
|
+ _this.imgOrCans = false;
|
|
|
+ _this.$refs.esign.reset();
|
|
|
+ if (_this.data) {
|
|
|
+ _this.data.strokes_image_url = "";
|
|
|
+ }
|
|
|
+ _this.$emit(
|
|
|
+ "deleteWriteRecord",
|
|
|
+ _this.rowIndex,
|
|
|
+ _this.colIndex,
|
|
|
+ _this.currentHz
|
|
|
+ );
|
|
|
//this.removeImage();
|
|
|
},
|
|
|
removeImage() {
|
|
@@ -187,10 +199,34 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ //不保存到记录列表
|
|
|
handleWriteImg() {
|
|
|
if (this.TaskModel == "ANSWER") {
|
|
|
return;
|
|
|
}
|
|
|
+ this.$refs.esign.generate().then((res) => {
|
|
|
+ let Book_img = res.replace("data:image/png;base64,", "");
|
|
|
+ let write_img = "data:image/png;base64," + Book_img;
|
|
|
+ let answer = {};
|
|
|
+ answer = {
|
|
|
+ hz: this.currentHz,
|
|
|
+ strokes_content: JSON.stringify(this.$refs.esign.history),
|
|
|
+ strokes_image_url: write_img,
|
|
|
+ };
|
|
|
+ this.$emit("changeCurQue", answer, this.colIndex);
|
|
|
+ let obj = {
|
|
|
+ history: this.$refs.esign.history,
|
|
|
+ strokes_image_url: write_img,
|
|
|
+ };
|
|
|
+ this.closeifFreeShow(obj, this.rowIndex, this.colIndex);
|
|
|
+ // this.$message.warning("请先书写在保存");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //保存到记录列表
|
|
|
+ handleWriteImg_save() {
|
|
|
+ if (this.TaskModel == "ANSWER") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$refs.esign
|
|
|
.generate()
|
|
|
.then((res) => {
|
|
@@ -203,6 +239,7 @@ export default {
|
|
|
strokes_image_url: write_img,
|
|
|
};
|
|
|
this.$emit("changeCurQue", answer, this.colIndex);
|
|
|
+
|
|
|
let data = {
|
|
|
courseware_id: this.currentTreeID,
|
|
|
hz: this.currentHz,
|
|
@@ -235,10 +272,10 @@ export default {
|
|
|
let color = _this.colorsList[_this.colorIndex];
|
|
|
_this.hanzicolor = color;
|
|
|
_this.hanziweight = 6;
|
|
|
- if (this.currenHzData.strokes_image_url) {
|
|
|
- this.imgOrCans = true;
|
|
|
+ if (_this.currenHzData && _this.currenHzData.strokes_image_url) {
|
|
|
+ _this.imgOrCans = true;
|
|
|
}
|
|
|
- this.data = JSON.parse(JSON.stringify(this.currenHzData));
|
|
|
+ _this.data = JSON.parse(JSON.stringify(_this.currenHzData));
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {},
|