|
@@ -38,20 +38,114 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <div
|
|
|
- class="Big-Book-main"
|
|
|
- v-for="(item, index) in curQue.option"
|
|
|
- :key="item + index"
|
|
|
- style="margin-bottom: 20px"
|
|
|
+ <template
|
|
|
+ v-if="type == 'text_problem_chs' || type == 'newWord_preview_chs'"
|
|
|
>
|
|
|
- <template v-if="type == 'text_problem_chs'">
|
|
|
+ <div
|
|
|
+ class="Big-Book-main"
|
|
|
+ v-for="(item, index) in curQue.option"
|
|
|
+ :key="item + index"
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ >
|
|
|
+ <template v-if="type == 'text_problem_chs'">
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">序号:</span>
|
|
|
+ <el-input
|
|
|
+ class="adult-book-input"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
+ placeholder="请输入序号"
|
|
|
+ v-model="item.number"
|
|
|
+ @blur="onBlur(item, 'number')"
|
|
|
+ ></el-input>
|
|
|
+ <img
|
|
|
+ @click="deleteOptionOne(index)"
|
|
|
+ class="close"
|
|
|
+ src="../../../assets/adult/del-close.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="NPC-sentence-Segword">
|
|
|
+ <SentenceSegwordChs :curQue="item.detail" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="type == 'newWord_preview_chs'">
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">拼音:</span>
|
|
|
+ <el-input
|
|
|
+ class="adult-book-input"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
+ placeholder="请输入拼音"
|
|
|
+ v-model="item.pinyin"
|
|
|
+ @blur="onBlur(item, 'pinyin')"
|
|
|
+ ></el-input>
|
|
|
+ <img
|
|
|
+ @click="deleteOptionOne(index)"
|
|
|
+ class="close"
|
|
|
+ src="../../../assets/adult/del-close.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">展示方式:</span>
|
|
|
+ <el-radio-group v-model="item.imgOrText">
|
|
|
+ <el-radio label="image">图片</el-radio>
|
|
|
+ <el-radio label="text">文本</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <template v-if="item.imgOrText == 'image'">
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">图片:</span>
|
|
|
+ <Upload
|
|
|
+ :changeFillId="changeImage"
|
|
|
+ :datafileList="item.img_list"
|
|
|
+ :filleNumber="mp3Number"
|
|
|
+ :uploadType="'image'"
|
|
|
+ :index="index"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="item.imgOrText == 'text'">
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">生字:</span>
|
|
|
+ <el-input
|
|
|
+ class="adult-book-input"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
+ placeholder="请输入生字"
|
|
|
+ v-model="item.con"
|
|
|
+ @blur="onBlur(item, 'con')"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">音频:</span>
|
|
|
+ <Upload
|
|
|
+ :changeFillId="changeMp3"
|
|
|
+ :datafileList="item.mp3_list"
|
|
|
+ :filleNumber="mp3Number"
|
|
|
+ :uploadType="'mp3'"
|
|
|
+ :index="index"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="type == 'listen_record_single_syllable_chs'">
|
|
|
+ <div
|
|
|
+ class="Big-Book-main"
|
|
|
+ v-for="(item, index) in curQue"
|
|
|
+ :key="item + index"
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ >
|
|
|
<div class="adult-book-input-item">
|
|
|
<span class="adult-book-lable">序号:</span>
|
|
|
<el-input
|
|
|
class="adult-book-input"
|
|
|
type="textarea"
|
|
|
:autosize="{ minRows: 2 }"
|
|
|
- placeholder="请输入序号"
|
|
|
+ placeholder="请输入拼音"
|
|
|
v-model="item.number"
|
|
|
@blur="onBlur(item, 'number')"
|
|
|
></el-input>
|
|
@@ -62,70 +156,30 @@
|
|
|
alt=""
|
|
|
/>
|
|
|
</div>
|
|
|
- <div class="NPC-sentence-Segword">
|
|
|
- <SentenceSegwordChs :curQue="item.detail" />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-if="type == 'newWord_preview_chs'">
|
|
|
- <div class="adult-book-input-item">
|
|
|
- <span class="adult-book-lable">拼音:</span>
|
|
|
- <el-input
|
|
|
- class="adult-book-input"
|
|
|
- type="textarea"
|
|
|
- :autosize="{ minRows: 2 }"
|
|
|
- placeholder="请输入拼音"
|
|
|
- v-model="item.pinyin"
|
|
|
- @blur="onBlur(item, 'pinyin')"
|
|
|
- ></el-input>
|
|
|
- <img
|
|
|
- @click="deleteOptionOne(index)"
|
|
|
- class="close"
|
|
|
- src="../../../assets/adult/del-close.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="adult-book-input-item">
|
|
|
- <span class="adult-book-lable">生字:</span>
|
|
|
- <el-input
|
|
|
- class="adult-book-input"
|
|
|
- type="textarea"
|
|
|
- :autosize="{ minRows: 2 }"
|
|
|
- placeholder="请输入生字"
|
|
|
- v-model="item.con"
|
|
|
- @blur="onBlur(item, 'con')"
|
|
|
- ></el-input>
|
|
|
+ <div v-for="(it, itI) in item.option" :key="'it' + itI">
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">拼音:</span>
|
|
|
+ <el-input
|
|
|
+ class="adult-book-input"
|
|
|
+ type="textarea"
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
+ placeholder="请输入拼音"
|
|
|
+ v-model="it.pinyin"
|
|
|
+ @blur="onBlur(it, 'pinyin')"
|
|
|
+ ></el-input>
|
|
|
+ <img
|
|
|
+ @click="deleteyinjie(index, itI)"
|
|
|
+ class="close"
|
|
|
+ src="../../../assets/adult/del-close.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="adult-book-input-item">
|
|
|
- <span class="adult-book-lable">音频:</span>
|
|
|
- <Upload
|
|
|
- :changeFillId="changeMp3"
|
|
|
- :datafileList="item.mp3_list"
|
|
|
- :filleNumber="mp3Number"
|
|
|
- :uploadType="'mp3'"
|
|
|
- :index="index"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template v-if="type == 'listen_record_single_syllable_chs'">
|
|
|
- <div class="adult-book-input-item">
|
|
|
- <span class="adult-book-lable">拼音:</span>
|
|
|
- <el-input
|
|
|
- class="adult-book-input"
|
|
|
- type="textarea"
|
|
|
- :autosize="{ minRows: 2 }"
|
|
|
- placeholder="请输入拼音"
|
|
|
- v-model="item.pinyin"
|
|
|
- @blur="onBlur(item, 'pinyin')"
|
|
|
- ></el-input>
|
|
|
- <img
|
|
|
- @click="deleteOptionOne(index)"
|
|
|
- class="close"
|
|
|
- src="../../../assets/adult/del-close.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
+ <div class="addoption" @click="addyinjie(index, itI)">
|
|
|
+ 添加一个音节
|
|
|
</div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<div class="Big-Book-addrole">
|
|
|
<div class="addoption" @click="addOption">添加一个</div>
|
|
|
</div>
|
|
@@ -183,37 +237,61 @@ export default {
|
|
|
type: "newWord_preview_chs",
|
|
|
name: "生字展示",
|
|
|
title: "",
|
|
|
+ imgOrText: null,
|
|
|
option: [
|
|
|
{
|
|
|
mp3_list: [],
|
|
|
+ img_list: [],
|
|
|
con: "", //生字
|
|
|
pinyin: "", //拼音
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- data_structure3: {
|
|
|
- type: "listen_record_single_syllable_chs",
|
|
|
- name: "听录音选择音节",
|
|
|
- title: "",
|
|
|
- mp3_list: [],
|
|
|
- number: "",
|
|
|
- option: [
|
|
|
- {
|
|
|
- pinyin: "", //拼音
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
+ data_structure3: [
|
|
|
+ {
|
|
|
+ type: "listen_record_single_syllable_chs",
|
|
|
+ name: "听录音选择音节",
|
|
|
+ title: "",
|
|
|
+ mp3_list: [],
|
|
|
+ number: "",
|
|
|
+ option: [
|
|
|
+ {
|
|
|
+ number: "",
|
|
|
+ pinyin: "", //拼音
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
+ // 添加音节
|
|
|
+ addyinjie(index) {
|
|
|
+ let obj = JSON.parse(JSON.stringify(this.data_structure3[0].option[0]));
|
|
|
+ this.curQue[index].option.push(obj);
|
|
|
+ },
|
|
|
+ // 删除音节
|
|
|
+ deleteyinjie(index, yjIndex) {
|
|
|
+ if (this.curQue[index].option.length <= 1) {
|
|
|
+ this.$message.warning("至少要保留1个音节");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.curQue[index].option.splice(yjIndex, 1);
|
|
|
+ },
|
|
|
onBlur(item, field) {
|
|
|
item[field] = item[field] ? item[field].trim() : "";
|
|
|
},
|
|
|
// 删除其中一个选项
|
|
|
deleteOptionOne(index) {
|
|
|
+ if (this.type == "listen_record_single_syllable_chs") {
|
|
|
+ if (this.curQue[index].option.length <= 1) {
|
|
|
+ this.$message.warning("至少要保留1个选项");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (this.curQue.option.length <= 1) {
|
|
|
this.$message.warning("至少要保留1个选项");
|
|
|
return;
|
|
@@ -225,12 +303,14 @@ export default {
|
|
|
let obj;
|
|
|
if (this.type == "newWord_preview_chs") {
|
|
|
obj = JSON.parse(JSON.stringify(this.data_structure2.option[0]));
|
|
|
+ this.curQue.option.push(obj);
|
|
|
} else if (this.type == "text_problem_chs") {
|
|
|
obj = JSON.parse(JSON.stringify(this.data_structure.option[0]));
|
|
|
+ this.curQue.option.push(obj);
|
|
|
} else if (this.type == "listen_record_single_syllable_chs") {
|
|
|
- obj = JSON.parse(JSON.stringify(this.data_structure3.option[0]));
|
|
|
- }
|
|
|
- this.curQue.option.push(obj);
|
|
|
+ obj = JSON.parse(JSON.stringify(this.data_structure3[0]));
|
|
|
+ this.curQue.push(obj);
|
|
|
+ }
|
|
|
},
|
|
|
initcurQue() {
|
|
|
let data;
|
|
@@ -262,6 +342,24 @@ export default {
|
|
|
JSON.stringify(articleImgRes)
|
|
|
);
|
|
|
},
|
|
|
+ changeImage(fileList, item, index) {
|
|
|
+ const articleImgList = JSON.parse(JSON.stringify(fileList));
|
|
|
+ const articleImgRes = [];
|
|
|
+ articleImgList.forEach((item) => {
|
|
|
+ if (item.response) {
|
|
|
+ const obj = {
|
|
|
+ name: item.name,
|
|
|
+ url: item.response.file_info_list[0].file_url,
|
|
|
+ id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
|
|
|
+ media_duration: item.response.file_info_list[0].media_duration, //音频时长
|
|
|
+ };
|
|
|
+ articleImgRes.push(obj);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.curQue.option[index].img_list = JSON.parse(
|
|
|
+ JSON.stringify(articleImgRes)
|
|
|
+ );
|
|
|
+ },
|
|
|
// 题目的音频
|
|
|
timuchangeMp3(fileList) {
|
|
|
const articleImgList = JSON.parse(JSON.stringify(fileList));
|