|
@@ -23,6 +23,39 @@
|
|
|
<el-radio :label="false">不需要</el-radio>
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
+ <div class="adult-book-input-item" v-if="curQue.IsRecord">
|
|
|
+ <span class="adult-book-lable">录音控件:</span>
|
|
|
+ <img src="../../../assets/adult/pro.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">题目:</span>
|
|
|
+ <el-input
|
|
|
+ class="adult-book-input"
|
|
|
+ :autosize="{ minRows: 2 }"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入题目"
|
|
|
+ v-model="curQue.topic.con"
|
|
|
+ @blur="curQue.topic.con = curQue.topic.con.trim()"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">题目图片:</span>
|
|
|
+ <Upload
|
|
|
+ :changeFillId="timuchangeImage"
|
|
|
+ :datafileList="curQue.topic.img_list"
|
|
|
+ :filleNumber="imgNumber"
|
|
|
+ :uploadType="'image'"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="adult-book-input-item">
|
|
|
+ <span class="adult-book-lable">题目音频:</span>
|
|
|
+ <Upload
|
|
|
+ :changeFillId="timuchangeMp3"
|
|
|
+ :datafileList="curQue.topic.mp3_list"
|
|
|
+ :filleNumber="mp3Number"
|
|
|
+ :uploadType="'mp3'"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div
|
|
|
class="Big-Book-main"
|
|
|
v-for="(item, index) in curQue.option"
|
|
@@ -58,13 +91,15 @@
|
|
|
<script>
|
|
|
import Inputmodule from "../common/Inputmodule.vue";
|
|
|
import SingleModule from "../common/SingleModule.vue";
|
|
|
+import Upload from "../common/Upload.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "Single",
|
|
|
- props: ["curQue", "fn_data", "changeCurQue","type"],
|
|
|
+ props: ["curQue", "fn_data", "changeCurQue", "type"],
|
|
|
components: {
|
|
|
Inputmodule,
|
|
|
SingleModule,
|
|
|
+ Upload,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -79,29 +114,26 @@ export default {
|
|
|
mp3_url: [],
|
|
|
},
|
|
|
},
|
|
|
+ imgNumber: 1,
|
|
|
+ mp3Number: 1,
|
|
|
data_structure: {
|
|
|
type: "single_chs",
|
|
|
name: "单选题",
|
|
|
title: "",
|
|
|
IsRecord: false,
|
|
|
+ topic: {
|
|
|
+ con: "",
|
|
|
+ img_list: [],
|
|
|
+ mp3_list: [],
|
|
|
+ },
|
|
|
option: [
|
|
|
{
|
|
|
- topic: {
|
|
|
- con: "",
|
|
|
- img_list: [],
|
|
|
- mp3_list: [],
|
|
|
- },
|
|
|
con: "",
|
|
|
img_list: [],
|
|
|
mp3_list: [],
|
|
|
isAnswer: "",
|
|
|
},
|
|
|
{
|
|
|
- topic: {
|
|
|
- con: "",
|
|
|
- img_list: [],
|
|
|
- mp3_list: [],
|
|
|
- },
|
|
|
con: "",
|
|
|
img_list: [],
|
|
|
mp3_list: [],
|
|
@@ -134,28 +166,23 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
data_structure2: {
|
|
|
- type: "checkbox_chs",
|
|
|
+ type: "checkbox_chs",
|
|
|
name: "多选题",
|
|
|
title: "",
|
|
|
IsRecord: false,
|
|
|
+ topic: {
|
|
|
+ con: "",
|
|
|
+ img_list: [],
|
|
|
+ mp3_list: [],
|
|
|
+ },
|
|
|
option: [
|
|
|
{
|
|
|
- topic: {
|
|
|
- con: "",
|
|
|
- img_list: [],
|
|
|
- mp3_list: [],
|
|
|
- },
|
|
|
con: "",
|
|
|
img_list: [],
|
|
|
mp3_list: [],
|
|
|
isAnswer: "",
|
|
|
},
|
|
|
{
|
|
|
- topic: {
|
|
|
- con: "",
|
|
|
- img_list: [],
|
|
|
- mp3_list: [],
|
|
|
- },
|
|
|
con: "",
|
|
|
img_list: [],
|
|
|
mp3_list: [],
|
|
@@ -229,16 +256,47 @@ export default {
|
|
|
let obj = JSON.parse(JSON.stringify(this.data_structure.option[0]));
|
|
|
this.curQue.option.push(obj);
|
|
|
},
|
|
|
+ timuchangeMp3(fileList) {
|
|
|
+ console.log(fileList);
|
|
|
+ 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.topic.mp3_list = JSON.parse(JSON.stringify(articleImgRes));
|
|
|
+ },
|
|
|
+ timuchangeImage(fileList) {
|
|
|
+ console.log(fileList);
|
|
|
+ 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]",
|
|
|
+ };
|
|
|
+ articleImgRes.push(obj);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.curQue.topic.img_list = JSON.parse(JSON.stringify(articleImgRes));
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
if (!this.curQue) {
|
|
|
- if(this.type=='single_chs'){
|
|
|
- this.changeCurQue(this.data_structure);
|
|
|
-
|
|
|
- }else if(this.type == 'checkbox_chs'){
|
|
|
- this.changeCurQue(this.data_structure2);
|
|
|
-
|
|
|
+ if (this.type == "single_chs") {
|
|
|
+ this.changeCurQue(this.data_structure);
|
|
|
+ } else if (this.type == "checkbox_chs") {
|
|
|
+ this.changeCurQue(this.data_structure2);
|
|
|
}
|
|
|
}
|
|
|
},
|