|
@@ -136,6 +136,7 @@
|
|
|
:totalNumber="writeTableData.result.length"
|
|
|
:fontSize="from.fontSize"
|
|
|
:audio_file_obj="writeTableData.audio_file_obj"
|
|
|
+ :infoObj="from.infoObj"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -180,7 +181,7 @@
|
|
|
//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
|
//例如:import 《组件名称》from ‘《组件路径》';
|
|
|
import Header from '@/components/Header';
|
|
|
-import { getLogin, LearnWebSI } from '@/api/api';
|
|
|
+import { getLogin, LearnWebSI, getHZChineseInfo, getContentFile } from '@/api/api';
|
|
|
import writeTable from './writeTable.vue';
|
|
|
import html2canvas from 'html2canvas';
|
|
|
import { jsPDF } from 'jspdf';
|
|
@@ -217,6 +218,7 @@ export default {
|
|
|
writeColor: '#000000', //书写颜色
|
|
|
borderColor: '#D65353', //边框颜色
|
|
|
fontColor: '#000000', //文字颜色
|
|
|
+ infoObj: {}, // 存储上传图片及文字信息等内容
|
|
|
},
|
|
|
loading: false,
|
|
|
writeTableData: null,
|
|
@@ -437,6 +439,7 @@ export default {
|
|
|
writeBoxNumber: this.from.writeBoxNumber,
|
|
|
miaoRedBoxNumber: this.from.miaoRedBoxNumber,
|
|
|
lastNullrow: this.from.lastNullrow,
|
|
|
+ infoObj: this.from.infoObj ? this.from.infoObj : {}, // 存储上传图片及文字信息等内容
|
|
|
};
|
|
|
if (this.from.fontSize == 'big') {
|
|
|
data.width = '62px';
|
|
@@ -604,15 +607,36 @@ export default {
|
|
|
});
|
|
|
item.hz_list = hz_list;
|
|
|
item.pinyin = pinyin(item.con);
|
|
|
- let MethodName = 'tool-PinyinToVoiceFile';
|
|
|
+ let MethodName = 'tool-TextToVoiceFile';
|
|
|
let datas = {
|
|
|
- pinyin: item.pinyin.split(' ').join(','),
|
|
|
+ text: item.con,
|
|
|
};
|
|
|
await getLogin(MethodName, datas).then((res) => {
|
|
|
if (res.status === 1) {
|
|
|
audio_file_obj[item.con] = res.file_id;
|
|
|
}
|
|
|
});
|
|
|
+ // let data = {
|
|
|
+ // query: item.con,
|
|
|
+ // };
|
|
|
+ // getHZChineseInfo(data).then((res) => {
|
|
|
+ // let dataDetail = res.data.result;
|
|
|
+ // if (dataDetail && dataDetail.length > 0) {
|
|
|
+ // dataDetail.forEach((item) => {
|
|
|
+ // if (item.request.queryType == 'entity') {
|
|
|
+ // // 读音
|
|
|
+ // item.response.entity.forEach((items) => {
|
|
|
+ // items.attrs.forEach((itemss) => {
|
|
|
+ // if (itemss.key == 'pronunciation') {
|
|
|
+ // // 音频
|
|
|
+ // audio_file_obj[item.con] = itemss.objects[0]['@value'] ? itemss.objects[0]['@value'] : '';
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
});
|
|
|
|
|
|
data.option.forEach((item) => {
|
|
@@ -711,13 +735,22 @@ export default {
|
|
|
arr.push(numrow);
|
|
|
}
|
|
|
}
|
|
|
+ if (!this.from.infoObj[item.con]) {
|
|
|
+ let item_con_obj = {
|
|
|
+ fileList: [],
|
|
|
+ definition: '',
|
|
|
+ collocation: '',
|
|
|
+ exampleSent: '',
|
|
|
+ };
|
|
|
+ this.$set(this.from.infoObj, item.con, item_con_obj);
|
|
|
+ }
|
|
|
if (arr.length <= data.firstPageLine) {
|
|
|
let obj = {
|
|
|
- fileList: [],
|
|
|
+ fileList: this.from.infoObj[item.con] ? this.from.infoObj[item.con].fileList : [],
|
|
|
info: {
|
|
|
- definition: '',
|
|
|
- collocation: '',
|
|
|
- exampleSent: '',
|
|
|
+ definition: this.from.infoObj[item.con] ? this.from.infoObj[item.con].definition : '',
|
|
|
+ collocation: this.from.infoObj[item.con] ? this.from.infoObj[item.con].collocation : '',
|
|
|
+ exampleSent: this.from.infoObj[item.con] ? this.from.infoObj[item.con].exampleSent : '',
|
|
|
},
|
|
|
list: arr,
|
|
|
hz_info: item.hz_list,
|
|
@@ -727,11 +760,11 @@ export default {
|
|
|
final_result.push(obj);
|
|
|
} else {
|
|
|
let obj = {
|
|
|
- fileList: [],
|
|
|
+ fileList: this.from.infoObj[item.con] ? this.from.infoObj[item.con].fileList : [],
|
|
|
info: {
|
|
|
- definition: '',
|
|
|
- collocation: '',
|
|
|
- exampleSent: '',
|
|
|
+ definition: this.from.infoObj[item.con] ? this.from.infoObj[item.con].definition : '',
|
|
|
+ collocation: this.from.infoObj[item.con] ? this.from.infoObj[item.con].collocation : '',
|
|
|
+ exampleSent: this.from.infoObj[item.con] ? this.from.infoObj[item.con].exampleSent : '',
|
|
|
},
|
|
|
list: arr.slice(0, data.firstPageLine),
|
|
|
hz_info: item.hz_list,
|
|
@@ -1029,6 +1062,7 @@ export default {
|
|
|
writeColor: '#000000', //书写颜色
|
|
|
borderColor: '#D65353', //边框颜色
|
|
|
fontColor: '#000000', //文字颜色
|
|
|
+ infoObj: {},
|
|
|
};
|
|
|
this.loading = false;
|
|
|
this.writeTableData = null;
|