|
@@ -18,8 +18,8 @@
|
|
|
/>
|
|
|
<div class="interaction-box" v-if="data.video_list.length > 0">
|
|
|
<video id="interaction-video" :src="data.video_list[0].file_url" width="100%" height="400" controls></video>
|
|
|
- <el-button type="primary" size="small" @click="handlePause">暂停视频上传文件</el-button>
|
|
|
- <el-button @click="handleMultilingual">多语言</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="handlePause">暂停视频编辑题目</el-button>
|
|
|
+ <!-- <el-button @click="handleMultilingual">多语言</el-button> -->
|
|
|
<ul v-if="data.file_info_list.length > 0" class="file-list">
|
|
|
<li v-for="(file, i) in data.file_info_list" :key="i">
|
|
|
<div class="file-name">
|
|
@@ -28,12 +28,13 @@
|
|
|
<span>{{ file.file_name ?? file.name }}</span>
|
|
|
</span>
|
|
|
</div>
|
|
|
+ <SvgIcon icon-class="edit" size="12" @click="editFile(file, i)" />
|
|
|
<SvgIcon icon-class="delete-black" size="12" @click="removeFile(file, i)" />
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<!-- 上传 -->
|
|
|
- <el-dialog
|
|
|
+ <!-- <el-dialog
|
|
|
:visible.sync="sourceAddFlag"
|
|
|
width="500px"
|
|
|
append-to-body
|
|
@@ -61,6 +62,24 @@
|
|
|
<el-button @click="handleCancle">取 消</el-button>
|
|
|
<el-button :loading="loading" type="primary" @click="submitAdd">确 定</el-button>
|
|
|
</footer>
|
|
|
+ </el-dialog> -->
|
|
|
+ <!-- 编辑练习题题目 -->
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="exerciseFlag"
|
|
|
+ width="90%"
|
|
|
+ append-to-body
|
|
|
+ :show-close="true"
|
|
|
+ title="练习题"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ class="module-content"
|
|
|
+ @close="handleCancle"
|
|
|
+ v-if="exerciseFlag"
|
|
|
+ >
|
|
|
+ <exercise-add
|
|
|
+ :exerciseContent="exerciseContent"
|
|
|
+ @handleCancle="handleCancle"
|
|
|
+ @submitAdd="submitAdd"
|
|
|
+ ></exercise-add>
|
|
|
</el-dialog>
|
|
|
<MultilingualFill
|
|
|
:visible.sync="multilingualVisible"
|
|
@@ -75,13 +94,15 @@
|
|
|
<script>
|
|
|
import ModuleMixin from '../../common/ModuleMixin';
|
|
|
import UploadFile from '../../base/common/UploadFile.vue';
|
|
|
+import ExerciseAdd from './ExerciseAdd.vue';
|
|
|
|
|
|
import { getVideoInteractionData } from '@/views/book/courseware/data/videoInteraction';
|
|
|
import { GetFileURLMap } from '@/api/app';
|
|
|
+import { GetCoursewareExercise } from '@/api/book';
|
|
|
|
|
|
export default {
|
|
|
name: 'VideoInteractionPage',
|
|
|
- components: { UploadFile },
|
|
|
+ components: { UploadFile, ExerciseAdd },
|
|
|
mixins: [ModuleMixin],
|
|
|
data() {
|
|
|
return {
|
|
@@ -91,11 +112,13 @@ export default {
|
|
|
uploadTip: '支持上传mp4格式视频文件,单个视频文件最大2GB,总文件体积不超10GB。',
|
|
|
iconClass: 'video',
|
|
|
sourceAddFlag: false,
|
|
|
+ exerciseFlag: false,
|
|
|
file_list: [],
|
|
|
file_id_list: [],
|
|
|
loading: false,
|
|
|
currentTime: 0,
|
|
|
multilingualText: '',
|
|
|
+ exerciseContent: null,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -151,13 +174,23 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleCancle() {
|
|
|
- this.sourceAddFlag = false;
|
|
|
- this.file_list = [];
|
|
|
- this.file_id_list = [];
|
|
|
+ // this.sourceAddFlag = false;
|
|
|
+ this.exerciseFlag = false;
|
|
|
+ document.getElementById('interaction-video').play();
|
|
|
},
|
|
|
// 确定新增资源
|
|
|
- submitAdd() {
|
|
|
- this.loading = true;
|
|
|
+ submitAdd(id, type) {
|
|
|
+ if (id) {
|
|
|
+ this.data.file_info_list.push({
|
|
|
+ currentTime: this.currentTime,
|
|
|
+ file_name: type,
|
|
|
+ id: id,
|
|
|
+ });
|
|
|
+ this.file_id_list.push(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.exerciseFlag = false;
|
|
|
+ document.getElementById('interaction-video').play();
|
|
|
},
|
|
|
// 暂停视频上传资源
|
|
|
handlePause() {
|
|
@@ -166,17 +199,20 @@ export default {
|
|
|
this.currentTime = video.currentTime.toFixed(3);
|
|
|
this.file_list = [];
|
|
|
this.file_id_list = [];
|
|
|
- this.sourceAddFlag = true;
|
|
|
+ // this.sourceAddFlag = true;
|
|
|
+ this.exerciseContent = null;
|
|
|
+ this.exerciseFlag = true;
|
|
|
},
|
|
|
// 删除文件
|
|
|
removeFile(file, i) {
|
|
|
- this.$confirm('是否删除当前文件?', '提示', {
|
|
|
+ this.$confirm('是否删除当前题目?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.data.file_info_list.splice(i, 1);
|
|
|
+ this.file_id_list.splice(i, 1);
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
},
|
|
@@ -187,6 +223,23 @@ export default {
|
|
|
});
|
|
|
this.multilingualVisible = true;
|
|
|
},
|
|
|
+ // 获取练习题题目
|
|
|
+ editFile(file) {
|
|
|
+ let data = {
|
|
|
+ exercise_id: file.id,
|
|
|
+ courseware_id: this.$route.params.courseware_id,
|
|
|
+ };
|
|
|
+ GetCoursewareExercise(data)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.exerciseContent = res;
|
|
|
+ this.exerciseFlag = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$emit('handleCancle');
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|