|
@@ -80,7 +80,7 @@ export default {
|
|
|
"wordNum",
|
|
|
"currentTreeID",
|
|
|
"TaskModel",
|
|
|
- "writeList",
|
|
|
+ "writeList"
|
|
|
],
|
|
|
data() {
|
|
|
return {
|
|
@@ -94,14 +94,14 @@ export default {
|
|
|
saveShow: false,
|
|
|
tabIndex: 0,
|
|
|
hasPlay: false,
|
|
|
- isNotice: false,
|
|
|
+ isNotice: false
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
watch: {
|
|
|
lineColor(newVal, oldVal) {
|
|
|
this.updateColor(newVal);
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
//方法集合
|
|
|
methods: {
|
|
@@ -115,11 +115,11 @@ export default {
|
|
|
courseware_id: this.currentTreeID,
|
|
|
hz: hz,
|
|
|
search_scope: 1,
|
|
|
- count_limit: 5,
|
|
|
+ count_limit: 5
|
|
|
};
|
|
|
- LearnWebSI(MethodName, data).then((res) => {
|
|
|
+ LearnWebSI(MethodName, data).then(res => {
|
|
|
let imgarr = res.hz_handwritten_record_list;
|
|
|
- this.imgarr = imgarr.map((item) => {
|
|
|
+ this.imgarr = imgarr.map(item => {
|
|
|
item.history = JSON.parse(item.strokes_content);
|
|
|
return item;
|
|
|
});
|
|
@@ -131,7 +131,7 @@ export default {
|
|
|
let hz =
|
|
|
this.tabIndex == 0 ? this.cur.stem[0].con : this.cur.stem[0].TChinese;
|
|
|
let imgarr = JSON.parse(JSON.stringify(this.writeList));
|
|
|
- this.imgarr = imgarr[hz].map((item) => {
|
|
|
+ this.imgarr = imgarr[hz].map(item => {
|
|
|
item.history = JSON.parse(item.strokes_content);
|
|
|
return item;
|
|
|
});
|
|
@@ -141,12 +141,13 @@ export default {
|
|
|
this.$message.warning("正在播放,不能删除");
|
|
|
return;
|
|
|
}
|
|
|
+ if (this.imgIndex === null) return;
|
|
|
let MethodName = "teaching-practice_manager-DeleteMyHZHandwrittenRecord";
|
|
|
let data = {
|
|
|
- hz_handwritten_record_id:
|
|
|
- this.imgarr[this.imgIndex].hz_handwritten_record_id,
|
|
|
+ hz_handwritten_record_id: this.imgarr[this.imgIndex]
|
|
|
+ .hz_handwritten_record_id
|
|
|
};
|
|
|
- LearnWebSI(MethodName, data).then((res) => {
|
|
|
+ LearnWebSI(MethodName, data).then(res => {
|
|
|
this.$message.success("删除成功");
|
|
|
this.imgarr.splice(this.imgIndex, 1);
|
|
|
this.handelReset();
|
|
@@ -197,32 +198,34 @@ export default {
|
|
|
this.tabIndex == 0 ? this.cur.stem[0].con : this.cur.stem[0].TChinese;
|
|
|
this.$refs.esign
|
|
|
.generate()
|
|
|
- .then((res) => {
|
|
|
+ .then(res => {
|
|
|
let Book_img = res.replace("data:image/png;base64,", "");
|
|
|
let write_img = "data:image/png;base64," + Book_img;
|
|
|
let answer = {};
|
|
|
answer = {
|
|
|
hz: hz,
|
|
|
strokes_content: JSON.stringify(this.$refs.esign.history),
|
|
|
- strokes_image_url: write_img,
|
|
|
+ strokes_image_url: write_img
|
|
|
};
|
|
|
this.$emit("saveWriteAnswer", answer);
|
|
|
+ let obj = {
|
|
|
+ hz_handwritten_record_id: "",
|
|
|
+ history: this.$refs.esign.history,
|
|
|
+ strokes_image_url: write_img
|
|
|
+ };
|
|
|
let data = {
|
|
|
courseware_id: this.currentTreeID,
|
|
|
hz: hz,
|
|
|
strokes_content: JSON.stringify(this.$refs.esign.history),
|
|
|
- strokes_image_base64: Book_img,
|
|
|
+ strokes_image_base64: Book_img
|
|
|
};
|
|
|
let MethodName =
|
|
|
"teaching-practice_manager-SaveMyHZHandwrittenRecord";
|
|
|
- LearnWebSI(MethodName, data).then((res) => {
|
|
|
- this.$message.success("保存成功!");
|
|
|
- // this.getImgList(this.tabIndex);
|
|
|
- let obj = {
|
|
|
- hz_handwritten_record_id: res.hz_handwritten_record_id,
|
|
|
- history: this.$refs.esign.history,
|
|
|
- strokes_image_url: write_img,
|
|
|
- };
|
|
|
+ LearnWebSI(MethodName, data).then(res => {
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.$message.success("保存成功!");
|
|
|
+ obj.hz_handwritten_record_id = res.hz_handwritten_record_id;
|
|
|
+ }
|
|
|
this.imgarr.push(obj);
|
|
|
this.saveShow = false;
|
|
|
this.handelReset();
|
|
@@ -230,13 +233,13 @@ export default {
|
|
|
//console.log(Book_img);
|
|
|
// this.textOcr(res.replace("data:image/png;base64,", ""));
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
+ .catch(err => {
|
|
|
this.saveShow = false;
|
|
|
|
|
|
console.log(err);
|
|
|
this.$message.warning("请先书写在保存");
|
|
|
});
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|
|
@@ -250,10 +253,10 @@ export default {
|
|
|
updated() {}, //生命周期 - 更新之后
|
|
|
beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
destroyed() {}, //生命周期 - 销毁完成
|
|
|
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+ activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|
|
|
-<style lang='scss' scoped>
|
|
|
+<style lang="scss" scoped>
|
|
|
//@import url(); 引入公共css类
|
|
|
.freewrite {
|
|
|
position: relative;
|