|
@@ -2,7 +2,7 @@
|
|
|
<ModuleBase :type="data.type">
|
|
|
<template #content>
|
|
|
<!-- eslint-disable max-len -->
|
|
|
- <div class="fill-wrapper">
|
|
|
+ <div class="write-wrapper">
|
|
|
<template v-if="data.property.content_type === 'con'">
|
|
|
<el-input v-model="data.content" placeholder="输入" type="textarea" @change="handleChangeContent"></el-input>
|
|
|
<span class="tips">输入字或词请一字一行</span>
|
|
@@ -24,6 +24,21 @@
|
|
|
@updateFileList="updateFileList"
|
|
|
/>
|
|
|
</template>
|
|
|
+ <template v-if="data.content_list.length > 0">
|
|
|
+ <el-divider content-position="left">拼音效果</el-divider>
|
|
|
+ <div class="content-list">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in data.content_list"
|
|
|
+ :key="index"
|
|
|
+ title="点击校对拼音"
|
|
|
+ @click="correctPinyin1(item.con, index)"
|
|
|
+ >
|
|
|
+ <span>{{ item.pinyin }}</span>
|
|
|
+ <b>{{ item.con }}</b>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <CorrectPinyin :visible.sync="visible" :select-content="selectContent" @fillTonePinyin="fillTonePinyin" />
|
|
|
</div>
|
|
|
</template>
|
|
|
</ModuleBase>
|
|
@@ -39,6 +54,7 @@ import { getWriteData } from '@/views/book/courseware/data/write';
|
|
|
import { GetStaticResources } from '@/api/app';
|
|
|
import cnchar from 'cnchar';
|
|
|
import { getRandomNumber } from '@/utils';
|
|
|
+import CorrectPinyin from '@/views/book/courseware/create/components/base/common/CorrectPinyin.vue';
|
|
|
|
|
|
export default {
|
|
|
name: 'WritePage',
|
|
@@ -46,6 +62,7 @@ export default {
|
|
|
SoundRecord,
|
|
|
UploadAudio,
|
|
|
UploadFile,
|
|
|
+ CorrectPinyin,
|
|
|
},
|
|
|
mixins: [ModuleMixin],
|
|
|
data() {
|
|
@@ -56,6 +73,9 @@ export default {
|
|
|
uploadTip:
|
|
|
'The size of the uploaded image should not exceed 2MB, the size of the uploaded audio file, pdf file, and excel file should not exceed 20MB, and the size of the uploaded audio file should not exceed 20MB',
|
|
|
iconClass: 'picture',
|
|
|
+ visible: false,
|
|
|
+ selectContent: '',
|
|
|
+ paragraph_index: 0,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -120,12 +140,35 @@ export default {
|
|
|
this.data.file_id_list = file_id_list;
|
|
|
this.data.file_info_list = file_info_list;
|
|
|
},
|
|
|
+ // 校对拼音
|
|
|
+ correctPinyin1(text, i) {
|
|
|
+ if (text) {
|
|
|
+ this.visible = true;
|
|
|
+ this.selectContent = text;
|
|
|
+ this.paragraph_index = i;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 回填校对后的拼音
|
|
|
+ fillTonePinyin(tonePinyin) {
|
|
|
+ this.data.content_list[this.paragraph_index].pinyin = tonePinyin;
|
|
|
+ let MethodName = 'tool-PinyinToVoiceFile';
|
|
|
+ let data = {
|
|
|
+ pinyin: tonePinyin.split(' ').join(','),
|
|
|
+ };
|
|
|
+ GetStaticResources(MethodName, data)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.data.content_list[this.paragraph_index].audio_file_id = res.file_id;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.fill-wrapper {
|
|
|
+.write-wrapper {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
row-gap: 16px;
|
|
@@ -140,6 +183,27 @@ export default {
|
|
|
color: #999;
|
|
|
}
|
|
|
|
|
|
+ .content-list {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 8px 8px;
|
|
|
+
|
|
|
+ div {
|
|
|
+ text-align: center;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ span {
|
|
|
+ font-family: 'League';
|
|
|
+ }
|
|
|
+
|
|
|
+ b {
|
|
|
+ display: block;
|
|
|
+ font-family: '楷体';
|
|
|
+ font-weight: normal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.auto-matic,
|
|
|
.upload-audio-play {
|
|
|
:deep .upload-wrapper {
|