|
@@ -2,7 +2,6 @@
|
|
|
<template>
|
|
|
<div class="practice practiceSingleNPC">
|
|
|
<img
|
|
|
- @click="changePraShow()"
|
|
|
class="close-icon"
|
|
|
:src="
|
|
|
themeColor
|
|
@@ -13,6 +12,7 @@
|
|
|
: require('@/assets/icon/Cross-16-normal-red.png')
|
|
|
: require('@/assets/icon/Cross-16-normal-red.png')
|
|
|
"
|
|
|
+ @click="changePraShow()"
|
|
|
/>
|
|
|
<div class="right-content">
|
|
|
<div class="right-strockred">
|
|
@@ -20,21 +20,21 @@
|
|
|
<img class="img" :src="data.strokes_image_url" alt="" />
|
|
|
</template>
|
|
|
<FreeWriteQP
|
|
|
- :bgColor.sync="bgColor"
|
|
|
+ id="esign"
|
|
|
+ ref="esign"
|
|
|
+ :bg-color.sync="bgColor"
|
|
|
:height="height"
|
|
|
- :isCrop="isCrop"
|
|
|
- :lineColor="hanzicolor"
|
|
|
- :lineWidth="hanziweight"
|
|
|
+ :is-crop="isCrop"
|
|
|
+ :line-color="hanzicolor"
|
|
|
+ :line-width="hanziweight"
|
|
|
:width="width"
|
|
|
class="vueEsign"
|
|
|
- ref="esign"
|
|
|
- id="esign"
|
|
|
/>
|
|
|
- <a @click="resetHuahua" class="clean-btn" v-if="TaskModel != 'ANSWER'"></a>
|
|
|
+ <a v-if="TaskModel != 'ANSWER'" class="clean-btn" @click="resetHuahua"></a>
|
|
|
</div>
|
|
|
<ul class="nav-list">
|
|
|
- <li @click="play()" :class="currenHzData && currenHzData.history ? '' : 'disabled'">播放</li>
|
|
|
- <li @click="handleWriteImg" :class="TaskModel == 'ANSWER' ? 'disabled' : ''">保存</li>
|
|
|
+ <li :class="currenHzData && currenHzData.history ? '' : 'disabled'" @click="play()">播放</li>
|
|
|
+ <li :class="TaskModel == 'ANSWER' ? 'disabled' : ''" @click="handleWriteImg">保存</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -48,7 +48,7 @@ import FreeWriteQP from './FreeWriteQP.vue';
|
|
|
// import ChinaDict from "./ChinaDict";
|
|
|
// import Audio from "./AudioRed.vue";
|
|
|
import { LearnWebSI } from '@/api/app';
|
|
|
-import { set } from 'js-cookie';
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
Strockplayredline,
|
|
@@ -86,7 +86,7 @@ export default {
|
|
|
penIndex: 0,
|
|
|
hanzicolor: '',
|
|
|
hanziweight: '',
|
|
|
- thinpen: require('../../../../assets/common/thin-pen.png'), //细笔
|
|
|
+ thinpen: require('../../../../assets/common/thin-pen.png'), // 细笔
|
|
|
thinpenActive: require('../../../../assets/common/thin-pen-active.png'),
|
|
|
thickpen: require('../../../../assets/common/thick-pen.png'),
|
|
|
thickpenActive: require('../../../../assets/common/thick-pen-active.png'),
|
|
@@ -99,7 +99,27 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
- //方法集合
|
|
|
+ // 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {
|
|
|
+ let _this = this;
|
|
|
+ let color = _this.colorsList[_this.colorIndex];
|
|
|
+ _this.hanzicolor = color;
|
|
|
+ _this.hanziweight = 6;
|
|
|
+ if (_this.currenHzData && _this.currenHzData.strokes_image_url) {
|
|
|
+ _this.imgOrCans = true;
|
|
|
+ }
|
|
|
+ _this.data = JSON.parse(JSON.stringify(_this.currenHzData));
|
|
|
+ },
|
|
|
+ // 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {},
|
|
|
+ beforeCreate() {}, // 生命周期 - 创建之前
|
|
|
+ beforeMount() {}, // 生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, // 生命周期 - 更新之前
|
|
|
+ updated() {}, // 生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, // 生命周期 - 销毁之前
|
|
|
+ destroyed() {}, // 生命周期 - 销毁完成
|
|
|
+ activated() {},
|
|
|
+ // 方法集合
|
|
|
methods: {
|
|
|
play(index) {
|
|
|
let _this = this;
|
|
@@ -160,7 +180,7 @@ export default {
|
|
|
_this.data.strokes_image_url = '';
|
|
|
}
|
|
|
_this.$emit('deleteWriteRecord', _this.rowIndex, _this.colIndex, _this.currentHz);
|
|
|
- //this.removeImage();
|
|
|
+ // this.removeImage();
|
|
|
},
|
|
|
removeImage() {
|
|
|
let _this = this;
|
|
@@ -177,18 +197,18 @@ export default {
|
|
|
_this.$message.success('删除成功');
|
|
|
_this.data = {};
|
|
|
_this.$emit('deleteWriteRecord', _this.rowIndex, _this.colIndex);
|
|
|
- //this.resetHuahua();
|
|
|
+ // this.resetHuahua();
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- //不保存到记录列表
|
|
|
+ // 不保存到记录列表
|
|
|
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 write_img = `data:image/png;base64,${Book_img}`;
|
|
|
let answer = {};
|
|
|
answer = {
|
|
|
hz: this.currentHz,
|
|
@@ -204,7 +224,7 @@ export default {
|
|
|
// this.$message.warning("请先书写在保存");
|
|
|
});
|
|
|
},
|
|
|
- //保存到记录列表
|
|
|
+ // 保存到记录列表
|
|
|
handleWriteImg_save() {
|
|
|
if (this.TaskModel == 'ANSWER') {
|
|
|
return;
|
|
@@ -213,7 +233,7 @@ export default {
|
|
|
.generate()
|
|
|
.then((res) => {
|
|
|
let Book_img = res.replace('data:image/png;base64,', '');
|
|
|
- let write_img = 'data:image/png;base64,' + Book_img;
|
|
|
+ let write_img = `data:image/png;base64,${Book_img}`;
|
|
|
let answer = {};
|
|
|
answer = {
|
|
|
hz: this.currentHz,
|
|
@@ -242,34 +262,14 @@ export default {
|
|
|
}
|
|
|
this.closeifFreeShow(obj, this.rowIndex, this.colIndex);
|
|
|
});
|
|
|
- //console.log(Book_img);
|
|
|
+ // console.log(Book_img);
|
|
|
// this.textOcr(res.replace("data:image/png;base64,", ""));
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.$message.warning('请先书写在保存');
|
|
|
});
|
|
|
},
|
|
|
- },
|
|
|
- //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {
|
|
|
- let _this = this;
|
|
|
- let color = _this.colorsList[_this.colorIndex];
|
|
|
- _this.hanzicolor = color;
|
|
|
- _this.hanziweight = 6;
|
|
|
- if (_this.currenHzData && _this.currenHzData.strokes_image_url) {
|
|
|
- _this.imgOrCans = true;
|
|
|
- }
|
|
|
- _this.data = JSON.parse(JSON.stringify(_this.currenHzData));
|
|
|
- },
|
|
|
- //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted() {},
|
|
|
- beforeCreate() {}, //生命周期 - 创建之前
|
|
|
- beforeMount() {}, //生命周期 - 挂载之前
|
|
|
- beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
- updated() {}, //生命周期 - 更新之后
|
|
|
- beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
- destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ }, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|